MFC: GCC 3.4.6
This commit is contained in:
parent
d7ba98f40c
commit
334a6ca004
@ -1,3 +1,822 @@
|
|||||||
|
2006-04-25 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* config/m32r/m32r.c (gen_compare): Fix reg/smallconst equal code,
|
||||||
|
the patch for which was accidentally omitted from the previous
|
||||||
|
commit.
|
||||||
|
|
||||||
|
2006-04-04 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
|
||||||
|
|
||||||
|
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 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.
|
||||||
|
|
||||||
|
2006-03-05 Release Manager
|
||||||
|
|
||||||
|
* GCC 3.4.6 released.
|
||||||
|
|
||||||
|
2006-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||||
|
|
||||||
|
Backport
|
||||||
|
2005-11-03 James E Wilson <wilson@specifix.com>
|
||||||
|
|
||||||
|
PR preprocessor/24202
|
||||||
|
* cppfiles.c (_cpp_pop_file_buffer): Set buffer_valid to false.
|
||||||
|
|
||||||
|
2006-03-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
2006-02-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
2006-02-18 Olivier Hainque <hainque@adacore.com>
|
||||||
|
|
||||||
|
PR ada/13408
|
||||||
|
* pa.h (WIDEST_HARDWARE_FP_SIZE): Define.
|
||||||
|
|
||||||
|
2006-02-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2006-02-01 Steve Ellcey <sje@cup.hp.com>
|
||||||
|
|
||||||
|
PR middle-end/24901
|
||||||
|
* fold-const.c (fold_checksum_tree): Change type of buf.
|
||||||
|
|
||||||
|
2006-02-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* doc/contrib.texi: Update my entry.
|
||||||
|
|
||||||
|
2006-02-09 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
* config/sparc/sparc.c (tls_call_delay): Fix oversight.
|
||||||
|
|
||||||
|
2006-02-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
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-02 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
2006-01-21 Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
2006-01-12 Kaz Kojima <kkojima@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR target/25613
|
||||||
|
* config/sh/sh.h (CONSTRAINT_LEN): Use unchecking version.
|
||||||
|
|
||||||
|
2005-12-30 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
|
PR target/25213
|
||||||
|
Backport from mainline
|
||||||
|
2005-09-06 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
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-12-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
PR fortran/25586
|
||||||
|
* pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point
|
||||||
|
store patterns.
|
||||||
|
|
||||||
|
2005-12-29 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
PR target/25572
|
||||||
|
* config/rs6000/rs6000.c (create_TOC_reference): Set regs_ever_live.
|
||||||
|
|
||||||
|
2005-12-17 Steven Bosscher <stevenb@suse.de>
|
||||||
|
|
||||||
|
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 <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
Backport from mainline:
|
||||||
|
2004-11-01 Mike Stump <mrs@apple.com>
|
||||||
|
|
||||||
|
* 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 <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define.
|
||||||
|
|
||||||
|
2005-12-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
PR target/25258
|
||||||
|
* pa.c (som_text_section_asm_op): Use .NSUBSPA directive when changing
|
||||||
|
to the text subspace to output debugging information.
|
||||||
|
|
||||||
|
2005-12-06 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
PR other/13873
|
||||||
|
* longlong.h: Merge PPC tests from upstream.
|
||||||
|
|
||||||
|
2005-12-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
* builtins.c (expand_builtin_fputs): Defer check for missing
|
||||||
|
replacement functions.
|
||||||
|
|
||||||
|
2005-12-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/24103
|
||||||
|
Backport:
|
||||||
|
2002-08-22 Diego Novillo <dnovillo@redhat.com>
|
||||||
|
|
||||||
|
* tree.c (simple_cst_equal): Call simple_cst_list_equal to compare
|
||||||
|
CONSTRUCTOR_ELTS pointers.
|
||||||
|
|
||||||
|
2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||||
|
|
||||||
|
* 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 <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
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 <dalej@apple.com>
|
||||||
|
* 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 <rth@redhat.com>
|
||||||
|
* expmed.c (store_bit_field): Use simplify_gen_subreg instead
|
||||||
|
of gen_rtx_SUBREG directly.
|
||||||
|
|
||||||
|
2005-11-16 Steve Ellcey <sje@cup.hp.com>
|
||||||
|
|
||||||
|
PR target/24718
|
||||||
|
* mklibgcc.in: Create dummy object for libgcc_eh.a
|
||||||
|
* config/ia64/hpux.h (LIBGCC_SPEC): Remove.
|
||||||
|
|
||||||
|
2005-11-13 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
|
* fixinc/check.tpl: Handle CVS additionally.
|
||||||
|
|
||||||
|
2005-11-10 Uros Bizjak <uros@kss-loka.si>
|
||||||
|
|
||||||
|
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 <uros@kss-loka.si>
|
||||||
|
|
||||||
|
PR target/19340
|
||||||
|
* reg-stack.c (reg_to_stack): Update register liveness also
|
||||||
|
for flag_sched2_use_traces.
|
||||||
|
|
||||||
|
2005-11-09 Per Bothner <per@bothner.com>
|
||||||
|
Uros Bizjak <uros@kss-loka.si>
|
||||||
|
|
||||||
|
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 <sje@cup.hp.com>
|
||||||
|
|
||||||
|
PR bootstrap/24688
|
||||||
|
* fixinc/inclhack.def (sco_math): Add bypass.
|
||||||
|
* fixinc/fixincl.x: Regenerate.
|
||||||
|
|
||||||
|
2005-11-07 James E Wilson <wilson@specifix.com>
|
||||||
|
|
||||||
|
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 <aj@suse.de>
|
||||||
|
|
||||||
|
* fixinc/check.tpl: Adopt for move to subversion.
|
||||||
|
|
||||||
|
2005-11-03 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/24470
|
||||||
|
* fold-const.c (fold): Avoid running in circles if we
|
||||||
|
got some un-folded subtree.
|
||||||
|
|
||||||
|
2005-10-30 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
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 <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
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 <bonzini@gnu.org>
|
||||||
|
|
||||||
|
* dojump.c (do_jump): Revert the last patch as it breaks Ada.
|
||||||
|
|
||||||
|
2005-10-19 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
|
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 <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
* config/sparc/gmon-sol2.c (internal_mcount): Mark as used.
|
||||||
|
|
||||||
|
2005-10-08 Janis Johnson <janis187@us.ibm.com>
|
||||||
|
|
||||||
|
PR debug/24267
|
||||||
|
Partial backport from mainline
|
||||||
|
2004-05-04 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
Richard Henderson <rth@redhat.com>
|
||||||
|
* 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 <bonzini@gnu.org>
|
||||||
|
Richard Henderson <rth@redhat.com>
|
||||||
|
* 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 <wilson@specifix.com>
|
||||||
|
|
||||||
|
PR target/23644
|
||||||
|
* doc/invoke.texi (IA-64 Options, item -mtune): Renamed from
|
||||||
|
-mtune-arch.
|
||||||
|
|
||||||
|
2005-10-01 Richard Earnshaw <richard.earnshaw@arm.com>
|
||||||
|
|
||||||
|
PR target/23985
|
||||||
|
Back-port 2004-08-19 Richard Henderson <rth@redhat.com>
|
||||||
|
* 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 <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
PR target/24102
|
||||||
|
* config/rs6000/rs6000.md (floatdisf2_internal2): Correct range
|
||||||
|
check for numbers that need no bit twiddle.
|
||||||
|
|
||||||
|
2005-09-09 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR c/20239
|
||||||
|
* cppinit.c (cpp_read_main_file): Avoid segfaulting on
|
||||||
|
NULL pfile->map.
|
||||||
|
|
||||||
|
2005-09-09 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR c++/23624
|
||||||
|
* fold-const.c (fold): Check truth_value_p before calling
|
||||||
|
invert_truthvalue.
|
||||||
|
|
||||||
|
2005-09-08 Craig Rodrigues <rodrigc@gcc.gnu.org>
|
||||||
|
|
||||||
|
Backport from mainline
|
||||||
|
2005-09-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
|
||||||
|
|
||||||
|
* 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 <richard@codesourcery.com>
|
||||||
|
|
||||||
|
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 <jakub@redhat.com>
|
||||||
|
|
||||||
|
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 <richard.earnshaw@arm.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/17810 target/15342
|
||||||
|
* regrename.c: Fix polluted patch in previous change.
|
||||||
|
|
||||||
|
2005-09-01 Richard Earnshaw <richard.earnshaw@arm.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/17810
|
||||||
|
Backport
|
||||||
|
2004-11-04 Richard Sandiford <rsandifo@redhat.com>
|
||||||
|
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 <edelsohn@gnu.org>
|
||||||
|
|
||||||
|
PR target/23539
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2005-08-27 David Edelsohn <edelsohn@gnu.org>
|
||||||
|
* config/rs6000/rs6000.c (expand_block_move): Use HImode when
|
||||||
|
bytes >= 2 not bytes == 2.
|
||||||
|
|
||||||
|
2005-08-21 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* simplify-rtx.c (simplify_immed_subreg) <case CONST_DOUBLE>: Only
|
||||||
|
clear up to elem_bitsize bits, not max_bitsize.
|
||||||
|
|
||||||
|
2005-07-20 Steve Ellcey <sje@cup.hp.com>
|
||||||
|
|
||||||
|
PR target/21841
|
||||||
|
* doc/invoke.texi (-mgnu-ld): Update description.
|
||||||
|
(-mhp-ld): Ditto.
|
||||||
|
|
||||||
|
2005-08-09 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
|
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 <jconner@apple.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/23241
|
||||||
|
* combine.c (simplify_comparison): Fix error in determining
|
||||||
|
whether to lift a subreg from comparison.
|
||||||
|
|
||||||
|
2005-08-08 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
PR middle-end/21964
|
||||||
|
* stmt.c (tail_recursion_args): Insert a call to emit_queue.
|
||||||
|
|
||||||
|
2005-08-08 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
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 <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
* pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Fix loop upper bound.
|
||||||
|
|
||||||
|
2005-08-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
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 <christian.joensson@gmail.com>
|
||||||
|
|
||||||
|
PR target/20673
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2005-04-15 David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
|
* config/sparc/sparc.h (sparc_hard_reg_printed): Mark as GTY(()).
|
||||||
|
|
||||||
|
2005-08-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
* 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 <gerald@pfeifer.com>
|
||||||
|
|
||||||
|
* 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 <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* doc/invoke.texi (Optimize Options): Document that -funswitch-loops
|
||||||
|
is enabled at -O3.
|
||||||
|
|
||||||
|
2005-08-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
|
||||||
|
|
||||||
|
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 <richard@codesourcery.com>
|
||||||
|
|
||||||
|
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 <ian@airs.com>
|
||||||
|
|
||||||
|
PR pch/14400
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2005-08-01 Ian Lance Taylor <ian@airs.com>
|
||||||
|
|
||||||
|
* 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 <phython@gcc.gnu.org>
|
||||||
|
|
||||||
|
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 <phython@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR pch/14940
|
||||||
|
* config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __sparc__
|
||||||
|
definitions.
|
||||||
|
|
||||||
|
2004-10-15 Jon Grimm <jgrimm2@us.ibm.com>
|
||||||
|
|
||||||
|
* config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __powerpc__
|
||||||
|
definition.
|
||||||
|
|
||||||
|
2004-04-24 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __s390__
|
||||||
|
and __s390x__ hosts.
|
||||||
|
|
||||||
|
2004-04-08 Ian Lance Taylor <ian@wasabisystems.com>
|
||||||
|
|
||||||
|
* config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address):
|
||||||
|
Return 1 if file was successfully mapped.
|
||||||
|
|
||||||
|
2004-03-15 Ian Lance Taylor <ian@wasabisystems.com>
|
||||||
|
|
||||||
|
* 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 <apinski@apple.com>
|
||||||
|
|
||||||
|
* 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 <rth@redhat.com>
|
||||||
|
|
||||||
|
* 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 <richard@codesourcery.com>
|
||||||
|
|
||||||
|
PR target/20621
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2004-08-01 Richard Sandiford <rsandifo@redhat.com>
|
||||||
|
* 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 <rsandifo@redhat.com>
|
||||||
|
* 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 <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* config/rs6000/sysv4.h (TARGET_ASM_EXCEPTION_SECTION): Delete.
|
||||||
|
|
||||||
|
2005-07-28 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
PR rtl-opt/22619
|
||||||
|
* cfgcleanup.c (try_forward_edges): Watch out for end of
|
||||||
|
insn chain.
|
||||||
|
|
||||||
|
2005-07-28 Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
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 <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
PR c/21873
|
||||||
|
* c-typeck.c (push_init_level): Don't pop levels without braces if
|
||||||
|
implicit == 1.
|
||||||
|
|
||||||
|
2005-07-28 Gerald Pfeifer <gerald@pfeifer.com>
|
||||||
|
|
||||||
|
* doc/install.texi (Configuration): Update Valgrind homepage.
|
||||||
|
|
||||||
|
2005-07-28 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
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 <richard@codesourcery.com>
|
||||||
|
|
||||||
|
PR c/22589
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2004-06-16 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
* tree.c (get_narrower): Don't narrow integral types into
|
||||||
|
non-integral types.
|
||||||
|
|
||||||
|
2005-07-26 Bernardo Innocenti <bernie@develer.com>
|
||||||
|
|
||||||
|
Backport from mainline:
|
||||||
|
2005-07-12 Peter Barada <peter@the-baradas.com>
|
||||||
|
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 <janis187@us.ibm.com>
|
||||||
|
|
||||||
|
PR target/20191
|
||||||
|
Backport from mainline:
|
||||||
|
|
||||||
|
2004-04-23 Dale Johannesen <dalej@apple.com>
|
||||||
|
|
||||||
|
* 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 <richard@codesourcery.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/22167
|
||||||
|
* gcse.c (hoist_code): Fix hoist_exprs[] check.
|
||||||
|
|
||||||
|
2005-07-19 Gerald Pfeifer <gerald@pfeifer.com>
|
||||||
|
|
||||||
|
* config.gcc: Add support for *-*-freebsd7, *-*-freebsd8,
|
||||||
|
and *-*-freebsd9.
|
||||||
|
* config/freebsd-spec.h (FBSD_TARGET_OS_CPP_BUILTINS): Ditto.
|
||||||
|
|
||||||
|
2005-07-09 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* 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 <edelsohn@gnu.org>
|
||||||
|
|
||||||
|
Backport from mainline:
|
||||||
|
2005-06-18 Roger Sayle <roger@eyesopen.com>
|
||||||
|
PR target/22083
|
||||||
|
* config/rs6000/aix51.h (TARGET_C99_FUNCTIONS): Remove definition.
|
||||||
|
|
||||||
|
2005-07-05 Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
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 <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
PR target/20301
|
||||||
|
* config/sparc/sol2.h (ASM_GENERATE_INTERNAL_LABEL): Emit
|
||||||
|
unsigned index numbers.
|
||||||
|
|
||||||
|
2005-06-08 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
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 <rth@redhat.com>
|
||||||
|
|
||||||
|
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 <rth@redhat.com>
|
||||||
|
|
||||||
|
* 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 <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
* doc/install.texi (sparc-sun-solaris2*): Update note
|
||||||
|
about Sun bug 4910101.
|
||||||
|
|
||||||
|
2005-05-29 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
|
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 <ebotcazou@libertysurf.fr>
|
||||||
|
Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* 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 <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* 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 <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* 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 <jakub@redhat.com>
|
||||||
|
|
||||||
|
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 <roger@eyesopen.com>
|
||||||
|
|
||||||
|
PR middle-end/21709
|
||||||
|
* fold-const.c (const_binop): Check for division by zero during
|
||||||
|
complex division.
|
||||||
|
|
||||||
|
2005-05-24 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
|
||||||
|
|
||||||
|
* 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 <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* unroll.c (loop_iterations): Remove common term from initial
|
||||||
|
and final value only if it is loop invariant.
|
||||||
|
|
||||||
|
2005-05-20 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* version.c (version_string): Mark as 3.4.5.
|
||||||
|
|
||||||
|
2005-05-19 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* version.c (version_string): Restore pre-release marker.
|
||||||
|
|
||||||
2005-05-19 Release Manager
|
2005-05-19 Release Manager
|
||||||
|
|
||||||
* GCC 3.4.4 released.
|
* GCC 3.4.4 released.
|
||||||
@ -87,7 +906,7 @@
|
|||||||
(m68hc11_split_move): Likewise.
|
(m68hc11_split_move): Likewise.
|
||||||
|
|
||||||
2005-05-06 Bruce Korb <bkorb@gnu.org>
|
2005-05-06 Bruce Korb <bkorb@gnu.org>
|
||||||
Joseph S. Myers <joseph@codesourcery.com>
|
Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* fixinc/inclhack.def: Correct backslashes
|
* fixinc/inclhack.def: Correct backslashes
|
||||||
* fixinc/fixincl.x: regen
|
* fixinc/fixincl.x: regen
|
||||||
|
@ -305,6 +305,15 @@ So instead we use the macro below and test it against specific values. */
|
|||||||
# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
|
# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
|
||||||
#endif /* ATTRIBUTE_NULL_PRINTF */
|
#endif /* ATTRIBUTE_NULL_PRINTF */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef ATTRIBUTE_ALIGNED_ALIGNOF
|
||||||
|
# if (GCC_VERSION >= 3000)
|
||||||
|
# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
|
||||||
|
# else
|
||||||
|
# define ATTRIBUTE_ALIGNED_ALIGNOF(m)
|
||||||
|
# endif /* GNUC >= 3.0 */
|
||||||
|
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
|
||||||
|
|
||||||
/* We use __extension__ in some places to suppress -pedantic warnings
|
/* We use __extension__ in some places to suppress -pedantic warnings
|
||||||
about GCC extensions. This feature didn't work properly before
|
about GCC extensions. This feature didn't work properly before
|
||||||
gcc 2.8. */
|
gcc 2.8. */
|
||||||
|
@ -4329,14 +4329,15 @@ static rtx
|
|||||||
expand_builtin_fputs (tree arglist, rtx target, bool unlocked)
|
expand_builtin_fputs (tree arglist, rtx target, bool unlocked)
|
||||||
{
|
{
|
||||||
tree len, fn;
|
tree len, fn;
|
||||||
tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
|
/* 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];
|
: implicit_built_in_decls[BUILT_IN_FPUTC];
|
||||||
tree fn_fwrite = unlocked ? implicit_built_in_decls[BUILT_IN_FWRITE_UNLOCKED]
|
tree const fn_fwrite = unlocked ? built_in_decls[BUILT_IN_FWRITE_UNLOCKED]
|
||||||
: implicit_built_in_decls[BUILT_IN_FWRITE];
|
: implicit_built_in_decls[BUILT_IN_FWRITE];
|
||||||
|
|
||||||
/* If the return value is used, or the replacement _DECL isn't
|
/* If the return value is used, don't do the transformation. */
|
||||||
initialized, don't do the transformation. */
|
if (target != const0_rtx)
|
||||||
if (target != const0_rtx || !fn_fputc || !fn_fwrite)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Verify the arguments in the original call. */
|
/* Verify the arguments in the original call. */
|
||||||
@ -4397,6 +4398,11 @@ expand_builtin_fputs (tree arglist, rtx target, bool unlocked)
|
|||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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),
|
return expand_expr (build_function_call_expr (fn, arglist),
|
||||||
const0_rtx, VOIDmode, EXPAND_NORMAL);
|
const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||||
}
|
}
|
||||||
@ -4651,11 +4657,12 @@ static rtx
|
|||||||
expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode,
|
expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode,
|
||||||
bool unlocked)
|
bool unlocked)
|
||||||
{
|
{
|
||||||
tree fn_putchar = unlocked
|
/* If we're using an unlocked function, assume the other unlocked
|
||||||
? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED]
|
functions exist explicitly. */
|
||||||
: implicit_built_in_decls[BUILT_IN_PUTCHAR];
|
tree const fn_putchar = unlocked ? built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED]
|
||||||
tree fn_puts = unlocked ? implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED]
|
: implicit_built_in_decls[BUILT_IN_PUTCHAR];
|
||||||
: implicit_built_in_decls[BUILT_IN_PUTS];
|
tree const fn_puts = unlocked ? built_in_decls[BUILT_IN_PUTS_UNLOCKED]
|
||||||
|
: implicit_built_in_decls[BUILT_IN_PUTS];
|
||||||
const char *fmt_str;
|
const char *fmt_str;
|
||||||
tree fn, fmt, arg;
|
tree fn, fmt, arg;
|
||||||
|
|
||||||
@ -4754,10 +4761,12 @@ static rtx
|
|||||||
expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode,
|
expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode,
|
||||||
bool unlocked)
|
bool unlocked)
|
||||||
{
|
{
|
||||||
tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
|
/* If we're using an unlocked function, assume the other unlocked
|
||||||
: implicit_built_in_decls[BUILT_IN_FPUTC];
|
functions exist explicitly. */
|
||||||
tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED]
|
tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
|
||||||
: implicit_built_in_decls[BUILT_IN_FPUTS];
|
: implicit_built_in_decls[BUILT_IN_FPUTC];
|
||||||
|
tree const fn_fputs = unlocked ? built_in_decls[BUILT_IN_FPUTS_UNLOCKED]
|
||||||
|
: implicit_built_in_decls[BUILT_IN_FPUTS];
|
||||||
const char *fmt_str;
|
const char *fmt_str;
|
||||||
tree fn, fmt, fp, arg;
|
tree fn, fmt, fp, arg;
|
||||||
|
|
||||||
|
@ -1281,6 +1281,18 @@ constant_fits_type_p (tree c, tree type)
|
|||||||
return !TREE_OVERFLOW (c);
|
return !TREE_OVERFLOW (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Nonzero if vector types T1 and T2 can be converted to each other
|
||||||
|
without an explicit cast. */
|
||||||
|
int
|
||||||
|
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))
|
||||||
|
&& INTEGRAL_TYPE_P (TREE_TYPE (t1))
|
||||||
|
== INTEGRAL_TYPE_P (TREE_TYPE (t2)));
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert EXPR to TYPE, warning about conversion problems with constants.
|
/* Convert EXPR to TYPE, warning about conversion problems with constants.
|
||||||
Invoke this function on every expression that is converted implicitly,
|
Invoke this function on every expression that is converted implicitly,
|
||||||
i.e. because of language rules and not because of an explicit cast. */
|
i.e. because of language rules and not because of an explicit cast. */
|
||||||
|
@ -1268,6 +1268,8 @@ extern tree finish_label_address_expr (tree);
|
|||||||
different implementations. Used in c-common.c. */
|
different implementations. Used in c-common.c. */
|
||||||
extern tree lookup_label (tree);
|
extern tree lookup_label (tree);
|
||||||
|
|
||||||
|
extern int vector_types_convertible_p (tree t1, tree t2);
|
||||||
|
|
||||||
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
|
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
|
||||||
|
|
||||||
extern int c_safe_from_p (rtx, tree);
|
extern int c_safe_from_p (rtx, tree);
|
||||||
|
@ -957,6 +957,15 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Enumerators have no linkage, so may only be declared once in a
|
||||||
|
given scope. */
|
||||||
|
if (TREE_CODE (olddecl) == CONST_DECL)
|
||||||
|
{
|
||||||
|
error ("%Jredeclaration of enumerator `%D'", newdecl, newdecl);
|
||||||
|
locate_old_decl (olddecl, error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!comptypes (oldtype, newtype, COMPARE_STRICT))
|
if (!comptypes (oldtype, newtype, COMPARE_STRICT))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (olddecl) == FUNCTION_DECL
|
if (TREE_CODE (olddecl) == FUNCTION_DECL
|
||||||
@ -2956,12 +2965,21 @@ void
|
|||||||
push_parm_decl (tree parm)
|
push_parm_decl (tree parm)
|
||||||
{
|
{
|
||||||
tree decl;
|
tree decl;
|
||||||
|
int old_dont_save_pending_sizes_p = 0;
|
||||||
|
|
||||||
/* Don't attempt to expand sizes while parsing this decl.
|
/* Don't attempt to expand sizes while parsing this decl.
|
||||||
(We can get here with i_s_e 1 somehow from Objective-C.) */
|
(We can get here with i_s_e 1 somehow from Objective-C.) */
|
||||||
int save_immediate_size_expand = immediate_size_expand;
|
int save_immediate_size_expand = immediate_size_expand;
|
||||||
immediate_size_expand = 0;
|
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)),
|
decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)),
|
||||||
TREE_PURPOSE (TREE_PURPOSE (parm)),
|
TREE_PURPOSE (TREE_PURPOSE (parm)),
|
||||||
PARM, 0, NULL);
|
PARM, 0, NULL);
|
||||||
@ -2971,6 +2989,8 @@ push_parm_decl (tree parm)
|
|||||||
|
|
||||||
finish_decl (decl, NULL_TREE, NULL_TREE);
|
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;
|
immediate_size_expand = save_immediate_size_expand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4784,13 +4804,22 @@ start_struct (enum tree_code code, tree name)
|
|||||||
ref = lookup_tag (code, name, 1);
|
ref = lookup_tag (code, name, 1);
|
||||||
if (ref && TREE_CODE (ref) == code)
|
if (ref && TREE_CODE (ref) == code)
|
||||||
{
|
{
|
||||||
if (TYPE_FIELDS (ref))
|
if (TYPE_SIZE (ref))
|
||||||
{
|
{
|
||||||
if (code == UNION_TYPE)
|
if (code == UNION_TYPE)
|
||||||
error ("redefinition of `union %s'", IDENTIFIER_POINTER (name));
|
error ("redefinition of `union %s'", IDENTIFIER_POINTER (name));
|
||||||
else
|
else
|
||||||
error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name));
|
error ("redefinition of `struct %s'", IDENTIFIER_POINTER (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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5005,11 +5034,6 @@ finish_struct (tree t, tree fieldlist, tree attributes)
|
|||||||
if (C_DECL_VARIABLE_SIZE (x))
|
if (C_DECL_VARIABLE_SIZE (x))
|
||||||
C_TYPE_VARIABLE_SIZE (t) = 1;
|
C_TYPE_VARIABLE_SIZE (t) = 1;
|
||||||
|
|
||||||
/* Detect invalid nested redefinition. */
|
|
||||||
if (TREE_TYPE (x) == t)
|
|
||||||
error ("nested redefinition of `%s'",
|
|
||||||
IDENTIFIER_POINTER (TYPE_NAME (t)));
|
|
||||||
|
|
||||||
if (DECL_INITIAL (x))
|
if (DECL_INITIAL (x))
|
||||||
{
|
{
|
||||||
unsigned HOST_WIDE_INT width = tree_low_cst (DECL_INITIAL (x), 1);
|
unsigned HOST_WIDE_INT width = tree_low_cst (DECL_INITIAL (x), 1);
|
||||||
@ -5131,6 +5155,9 @@ finish_struct (tree t, tree fieldlist, tree attributes)
|
|||||||
TYPE_LANG_SPECIFIC (x) = TYPE_LANG_SPECIFIC (t);
|
TYPE_LANG_SPECIFIC (x) = TYPE_LANG_SPECIFIC (t);
|
||||||
TYPE_ALIGN (x) = TYPE_ALIGN (t);
|
TYPE_ALIGN (x) = TYPE_ALIGN (t);
|
||||||
TYPE_USER_ALIGN (x) = TYPE_USER_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this was supposed to be a transparent union, but we can't
|
/* If this was supposed to be a transparent union, but we can't
|
||||||
@ -5204,6 +5231,9 @@ start_enum (tree name)
|
|||||||
pushtag (name, enumtype);
|
pushtag (name, enumtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (C_TYPE_BEING_DEFINED (enumtype))
|
||||||
|
error ("nested redefinition of `enum %s'", IDENTIFIER_POINTER (name));
|
||||||
|
|
||||||
C_TYPE_BEING_DEFINED (enumtype) = 1;
|
C_TYPE_BEING_DEFINED (enumtype) = 1;
|
||||||
|
|
||||||
if (TYPE_VALUES (enumtype) != 0)
|
if (TYPE_VALUES (enumtype) != 0)
|
||||||
@ -5976,9 +6006,6 @@ store_parm_decls (void)
|
|||||||
{
|
{
|
||||||
tree fndecl = current_function_decl;
|
tree fndecl = current_function_decl;
|
||||||
|
|
||||||
/* The function containing FNDECL, if any. */
|
|
||||||
tree context = decl_function_context (fndecl);
|
|
||||||
|
|
||||||
/* True if this definition is written with a prototype. */
|
/* True if this definition is written with a prototype. */
|
||||||
bool prototype = (current_function_parms
|
bool prototype = (current_function_parms
|
||||||
&& TREE_CODE (current_function_parms) != TREE_LIST);
|
&& TREE_CODE (current_function_parms) != TREE_LIST);
|
||||||
@ -6003,20 +6030,9 @@ store_parm_decls (void)
|
|||||||
/* Begin the statement tree for this function. */
|
/* Begin the statement tree for this function. */
|
||||||
begin_stmt_tree (&DECL_SAVED_TREE (fndecl));
|
begin_stmt_tree (&DECL_SAVED_TREE (fndecl));
|
||||||
|
|
||||||
/* If this is a nested function, save away the sizes of any
|
/* Save away the sizes of any variable-size types so that we can
|
||||||
variable-size types so that we can expand them when generating
|
expand them when generating RTL. */
|
||||||
RTL. */
|
DECL_LANG_SPECIFIC (fndecl)->pending_sizes = get_pending_sizes ();
|
||||||
if (context)
|
|
||||||
{
|
|
||||||
tree t;
|
|
||||||
|
|
||||||
DECL_LANG_SPECIFIC (fndecl)->pending_sizes
|
|
||||||
= nreverse (get_pending_sizes ());
|
|
||||||
for (t = DECL_LANG_SPECIFIC (fndecl)->pending_sizes;
|
|
||||||
t;
|
|
||||||
t = TREE_CHAIN (t))
|
|
||||||
SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function is being processed in whole-function mode. */
|
/* This function is being processed in whole-function mode. */
|
||||||
cfun->x_whole_function_mode_p = 1;
|
cfun->x_whole_function_mode_p = 1;
|
||||||
@ -6167,15 +6183,12 @@ static void
|
|||||||
c_expand_body_1 (tree fndecl, int nested_p)
|
c_expand_body_1 (tree fndecl, int nested_p)
|
||||||
{
|
{
|
||||||
if (nested_p)
|
if (nested_p)
|
||||||
{
|
/* Squirrel away our current state. */
|
||||||
/* Make sure that we will evaluate variable-sized types involved
|
push_function_context ();
|
||||||
in our function's type. */
|
|
||||||
expand_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes);
|
|
||||||
|
|
||||||
/* 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);
|
tree_rest_of_compilation (fndecl, nested_p);
|
||||||
|
|
||||||
if (nested_p)
|
if (nested_p)
|
||||||
@ -6396,7 +6409,7 @@ c_begin_compound_stmt (void)
|
|||||||
tree stmt;
|
tree stmt;
|
||||||
|
|
||||||
/* Create the COMPOUND_STMT. */
|
/* Create the COMPOUND_STMT. */
|
||||||
stmt = add_stmt (build_stmt (COMPOUND_STMT, NULL_TREE));
|
stmt = add_stmt (build_stmt (COMPOUND_STMT, error_mark_node));
|
||||||
|
|
||||||
return stmt;
|
return stmt;
|
||||||
}
|
}
|
||||||
|
@ -118,17 +118,12 @@ c_cannot_inline_tree_fn (tree *fnp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! DECL_FILE_SCOPE_P (fn))
|
if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
|
||||||
{
|
{
|
||||||
/* If a nested function has pending sizes, we may have already
|
if (do_warning)
|
||||||
saved them. */
|
warning ("%Jfunction '%F' can never be inlined because it has "
|
||||||
if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
|
"pending sizes", fn, fn);
|
||||||
{
|
goto cannot_inline;
|
||||||
if (do_warning)
|
|
||||||
warning ("%Jnested function '%F' can never be inlined because it "
|
|
||||||
"has possibly saved pending sizes", fn, fn);
|
|
||||||
goto cannot_inline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -428,6 +428,6 @@ c_common_no_more_pch (void)
|
|||||||
if (cpp_get_callbacks (parse_in)->valid_pch)
|
if (cpp_get_callbacks (parse_in)->valid_pch)
|
||||||
{
|
{
|
||||||
cpp_get_callbacks (parse_in)->valid_pch = NULL;
|
cpp_get_callbacks (parse_in)->valid_pch = NULL;
|
||||||
host_hooks.gt_pch_use_address (NULL, 0);
|
host_hooks.gt_pch_use_address (NULL, 0, -1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4098,7 +4098,8 @@ digest_init (tree type, tree init, int require_constant)
|
|||||||
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
|
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
|
||||||
below and handle as a constructor. */
|
below and handle as a constructor. */
|
||||||
if (code == VECTOR_TYPE
|
if (code == VECTOR_TYPE
|
||||||
&& comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT)
|
&& TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
|
||||||
|
&& vector_types_convertible_p (TREE_TYPE (inside_init), type)
|
||||||
&& TREE_CONSTANT (inside_init))
|
&& TREE_CONSTANT (inside_init))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (inside_init) == VECTOR_CST
|
if (TREE_CODE (inside_init) == VECTOR_CST
|
||||||
@ -4634,19 +4635,27 @@ push_init_level (int implicit)
|
|||||||
tree value = NULL_TREE;
|
tree value = NULL_TREE;
|
||||||
|
|
||||||
/* If we've exhausted any levels that didn't have braces,
|
/* If we've exhausted any levels that didn't have braces,
|
||||||
pop them now. */
|
pop them now. If implicit == 1, this will have been done in
|
||||||
while (constructor_stack->implicit)
|
process_init_element; do not repeat it here because in the case
|
||||||
|
of excess initializers for an empty aggregate this leads to an
|
||||||
|
infinite cycle of popping a level and immediately recreating
|
||||||
|
it. */
|
||||||
|
if (implicit != 1)
|
||||||
{
|
{
|
||||||
if ((TREE_CODE (constructor_type) == RECORD_TYPE
|
while (constructor_stack->implicit)
|
||||||
|| TREE_CODE (constructor_type) == UNION_TYPE)
|
{
|
||||||
&& constructor_fields == 0)
|
if ((TREE_CODE (constructor_type) == RECORD_TYPE
|
||||||
process_init_element (pop_init_level (1));
|
|| TREE_CODE (constructor_type) == UNION_TYPE)
|
||||||
else if (TREE_CODE (constructor_type) == ARRAY_TYPE
|
&& constructor_fields == 0)
|
||||||
&& constructor_max_index
|
process_init_element (pop_init_level (1));
|
||||||
&& tree_int_cst_lt (constructor_max_index, constructor_index))
|
else if (TREE_CODE (constructor_type) == ARRAY_TYPE
|
||||||
process_init_element (pop_init_level (1));
|
&& constructor_max_index
|
||||||
else
|
&& tree_int_cst_lt (constructor_max_index,
|
||||||
break;
|
constructor_index))
|
||||||
|
process_init_element (pop_init_level (1));
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unless this is an explicit brace, we need to preserve previous
|
/* Unless this is an explicit brace, we need to preserve previous
|
||||||
|
@ -521,7 +521,7 @@ try_forward_edges (int mode, basic_block b)
|
|||||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
|
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (GET_CODE (insn) == NOTE)
|
if (insn && GET_CODE (insn) == NOTE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Do not clean up branches to just past the end of a loop
|
/* Do not clean up branches to just past the end of a loop
|
||||||
|
@ -10739,7 +10739,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
|
|||||||
/* (A - C1) always sign-extends, like C2. */
|
/* (A - C1) always sign-extends, like C2. */
|
||||||
&& num_sign_bit_copies (a, inner_mode)
|
&& num_sign_bit_copies (a, inner_mode)
|
||||||
> (unsigned int) (GET_MODE_BITSIZE (inner_mode)
|
> (unsigned int) (GET_MODE_BITSIZE (inner_mode)
|
||||||
- mode_width - 1)))
|
- (mode_width - 1))))
|
||||||
{
|
{
|
||||||
op0 = SUBREG_REG (op0);
|
op0 = SUBREG_REG (op0);
|
||||||
continue;
|
continue;
|
||||||
|
@ -406,6 +406,12 @@ case ${target} in
|
|||||||
tm_defines="${tm_defines} FBSD_MAJOR=5" ;;
|
tm_defines="${tm_defines} FBSD_MAJOR=5" ;;
|
||||||
*-*-freebsd6 | *-*-freebsd[6].*)
|
*-*-freebsd6 | *-*-freebsd[6].*)
|
||||||
tm_defines="${tm_defines} FBSD_MAJOR=6" ;;
|
tm_defines="${tm_defines} FBSD_MAJOR=6" ;;
|
||||||
|
*-*-freebsd7 | *-*-freebsd[7].*)
|
||||||
|
tm_defines="${tm_defines} FBSD_MAJOR=7" ;;
|
||||||
|
*-*-freebsd8 | *-*-freebsd[8].*)
|
||||||
|
tm_defines="${tm_defines} FBSD_MAJOR=8" ;;
|
||||||
|
*-*-freebsd9 | *-*-freebsd[9].*)
|
||||||
|
tm_defines="${tm_defines} FBSD_MAJOR=9" ;;
|
||||||
*)
|
*)
|
||||||
echo 'Please update *-*-freebsd* in gcc/config.gcc'
|
echo 'Please update *-*-freebsd* in gcc/config.gcc'
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -103,7 +103,12 @@ case ${host} in
|
|||||||
hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10* | \
|
hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10* | \
|
||||||
hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \
|
hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \
|
||||||
hppa*64*-*-hpux11*)
|
hppa*64*-*-hpux11*)
|
||||||
host_xmake_file="pa/x-ada"
|
out_host_hook_obj=pa-host.o
|
||||||
|
host_xmake_file=pa/x-hpux
|
||||||
|
;;
|
||||||
|
hppa*-*-linux*)
|
||||||
|
out_host_hook_obj=pa-host.o
|
||||||
|
host_xmake_file=pa/x-linux
|
||||||
;;
|
;;
|
||||||
i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture
|
i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture
|
||||||
host_xm_defines='FATAL_EXIT_CODE=12'
|
host_xm_defines='FATAL_EXIT_CODE=12'
|
||||||
@ -113,6 +118,8 @@ case ${host} in
|
|||||||
;;
|
;;
|
||||||
i[34567]86-*-solaris2*)
|
i[34567]86-*-solaris2*)
|
||||||
host_xm_defines="SMALL_ARG_MAX"
|
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
|
i[34567]86-*-sysv4*) # Intel 80386's running System V Release 4
|
||||||
host_xm_defines="SMALL_ARG_MAX"
|
host_xm_defines="SMALL_ARG_MAX"
|
||||||
@ -152,4 +159,12 @@ case ${host} in
|
|||||||
out_host_hook_obj=host-darwin.o
|
out_host_hook_obj=host-darwin.o
|
||||||
host_xmake_file=rs6000/x-darwin
|
host_xmake_file=rs6000/x-darwin
|
||||||
;;
|
;;
|
||||||
|
*-*-solaris2*)
|
||||||
|
out_host_hook_obj=host-solaris.o
|
||||||
|
host_xmake_file=x-solaris
|
||||||
|
;;
|
||||||
|
*-*-linux*)
|
||||||
|
out_host_hook_obj=host-linux.o
|
||||||
|
host_xmake_file=x-linux
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -97,6 +97,9 @@
|
|||||||
/* Define if your assembler supports the Sun syntax for cmov. */
|
/* Define if your assembler supports the Sun syntax for cmov. */
|
||||||
#undef HAVE_AS_IX86_CMOV_SUN_SYNTAX
|
#undef HAVE_AS_IX86_CMOV_SUN_SYNTAX
|
||||||
|
|
||||||
|
/* Define if your assembler supports the lituse_jsrdirect relocation. */
|
||||||
|
#undef HAVE_AS_JSRDIRECT_RELOCS
|
||||||
|
|
||||||
/* Define if your assembler supports .sleb128 and .uleb128. */
|
/* Define if your assembler supports .sleb128 and .uleb128. */
|
||||||
#undef HAVE_AS_LEB128
|
#undef HAVE_AS_LEB128
|
||||||
|
|
||||||
|
@ -5469,6 +5469,21 @@ print_operand (FILE *file, rtx x, int code)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'j':
|
||||||
|
{
|
||||||
|
const char *lituse;
|
||||||
|
|
||||||
|
#ifdef HAVE_AS_JSRDIRECT_RELOCS
|
||||||
|
lituse = "lituse_jsrdirect";
|
||||||
|
#else
|
||||||
|
lituse = "lituse_jsr";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (INTVAL (x) == 0)
|
||||||
|
abort ();
|
||||||
|
fprintf (file, "\t\t!%s!%d", lituse, (int) INTVAL (x));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
/* If this operand is the constant zero, write it as "$31". */
|
/* If this operand is the constant zero, write it as "$31". */
|
||||||
if (GET_CODE (x) == REG)
|
if (GET_CODE (x) == REG)
|
||||||
@ -8814,7 +8829,7 @@ alpha_align_insns (unsigned int max_align,
|
|||||||
unsigned int align;
|
unsigned int align;
|
||||||
/* OFS is the offset of the current insn in the insn group. */
|
/* OFS is the offset of the current insn in the insn group. */
|
||||||
int ofs;
|
int ofs;
|
||||||
int prev_in_use, in_use, len;
|
int prev_in_use, in_use, len, ldgp;
|
||||||
rtx i, next;
|
rtx i, next;
|
||||||
|
|
||||||
/* Let shorten branches care for assigning alignments to code labels. */
|
/* Let shorten branches care for assigning alignments to code labels. */
|
||||||
@ -8832,6 +8847,8 @@ alpha_align_insns (unsigned int max_align,
|
|||||||
if (GET_CODE (i) == NOTE)
|
if (GET_CODE (i) == NOTE)
|
||||||
i = next_nonnote_insn (i);
|
i = next_nonnote_insn (i);
|
||||||
|
|
||||||
|
ldgp = alpha_function_needs_gp ? 8 : 0;
|
||||||
|
|
||||||
while (i)
|
while (i)
|
||||||
{
|
{
|
||||||
next = (*next_group) (i, &in_use, &len);
|
next = (*next_group) (i, &in_use, &len);
|
||||||
@ -8888,6 +8905,10 @@ alpha_align_insns (unsigned int max_align,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We may not insert padding inside the initial ldgp sequence. */
|
||||||
|
else if (ldgp > 0)
|
||||||
|
ldgp -= len;
|
||||||
|
|
||||||
/* If the group won't fit in the same INT16 as the previous,
|
/* If the group won't fit in the same INT16 as the previous,
|
||||||
we need to add padding to keep the group together. Rather
|
we need to add padding to keep the group together. Rather
|
||||||
than simply leaving the insn filling to the assembler, we
|
than simply leaving the insn filling to the assembler, we
|
||||||
|
@ -967,7 +967,7 @@
|
|||||||
(clobber (reg:DI 23))
|
(clobber (reg:DI 23))
|
||||||
(clobber (reg:DI 28))]
|
(clobber (reg:DI 28))]
|
||||||
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
||||||
"ldq $27,__%E3($29)\t\t!literal!%#\;jsr $23,($27),__%E3\t\t!lituse_jsr!%#"
|
"#"
|
||||||
"&& reload_completed"
|
"&& reload_completed"
|
||||||
[(parallel [(set (match_dup 0)
|
[(parallel [(set (match_dup 0)
|
||||||
(sign_extend:DI (match_dup 3)))
|
(sign_extend:DI (match_dup 3)))
|
||||||
@ -1012,7 +1012,7 @@
|
|||||||
(clobber (reg:DI 23))
|
(clobber (reg:DI 23))
|
||||||
(clobber (reg:DI 28))]
|
(clobber (reg:DI 28))]
|
||||||
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
||||||
"jsr $23,($27),__%E3%J5"
|
"jsr $23,($27),__%E3%j5"
|
||||||
[(set_attr "type" "jsr")
|
[(set_attr "type" "jsr")
|
||||||
(set_attr "length" "4")])
|
(set_attr "length" "4")])
|
||||||
|
|
||||||
@ -1036,7 +1036,7 @@
|
|||||||
(clobber (reg:DI 23))
|
(clobber (reg:DI 23))
|
||||||
(clobber (reg:DI 28))]
|
(clobber (reg:DI 28))]
|
||||||
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
||||||
"ldq $27,__%E3($29)\t\t!literal!%#\;jsr $23,($27),__%E3\t\t!lituse_jsr!%#"
|
"#"
|
||||||
"&& reload_completed"
|
"&& reload_completed"
|
||||||
[(parallel [(set (match_dup 0) (match_dup 3))
|
[(parallel [(set (match_dup 0) (match_dup 3))
|
||||||
(use (match_dup 0))
|
(use (match_dup 0))
|
||||||
@ -1080,7 +1080,7 @@
|
|||||||
(clobber (reg:DI 23))
|
(clobber (reg:DI 23))
|
||||||
(clobber (reg:DI 28))]
|
(clobber (reg:DI 28))]
|
||||||
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
"TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
|
||||||
"jsr $23,($27),__%E3%J5"
|
"jsr $23,($27),__%E3%j5"
|
||||||
[(set_attr "type" "jsr")
|
[(set_attr "type" "jsr")
|
||||||
(set_attr "length" "4")])
|
(set_attr "length" "4")])
|
||||||
|
|
||||||
|
@ -105,8 +105,10 @@ extern int load_multiple_sequence (rtx *, int, int *, int *, HOST_WIDE_INT *);
|
|||||||
extern const char *emit_ldm_seq (rtx *, int);
|
extern const char *emit_ldm_seq (rtx *, int);
|
||||||
extern int store_multiple_sequence (rtx *, int, int *, int *, HOST_WIDE_INT *);
|
extern int store_multiple_sequence (rtx *, int, int *, int *, HOST_WIDE_INT *);
|
||||||
extern const char * emit_stm_seq (rtx *, int);
|
extern const char * emit_stm_seq (rtx *, int);
|
||||||
extern rtx arm_gen_load_multiple (int, int, rtx, int, int, int, int, int);
|
extern rtx arm_gen_load_multiple (int, int, rtx, int, int,
|
||||||
extern rtx arm_gen_store_multiple (int, int, rtx, int, int, int, 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 int arm_gen_movstrqi (rtx *);
|
||||||
extern rtx arm_gen_rotated_half_load (rtx);
|
extern rtx arm_gen_rotated_half_load (rtx);
|
||||||
extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
|
extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
|
||||||
|
@ -5158,13 +5158,13 @@ multi_register_push (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
rtx
|
rtx
|
||||||
arm_gen_load_multiple (int base_regno, int count, rtx from, int up,
|
arm_gen_load_multiple (int base_regno, int count, rtx from, int up,
|
||||||
int write_back, int unchanging_p, int in_struct_p,
|
int write_back, rtx basemem, HOST_WIDE_INT *offsetp)
|
||||||
int scalar_p)
|
|
||||||
{
|
{
|
||||||
|
HOST_WIDE_INT offset = *offsetp;
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
rtx result;
|
rtx result;
|
||||||
int sign = up ? 1 : -1;
|
int sign = up ? 1 : -1;
|
||||||
rtx mem;
|
rtx mem, addr;
|
||||||
|
|
||||||
/* XScale has load-store double instructions, but they have stricter
|
/* 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 can not
|
||||||
@ -5202,15 +5202,17 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up,
|
|||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (SImode, plus_constant (from, i * 4 * sign));
|
addr = plus_constant (from, i * 4 * sign);
|
||||||
RTX_UNCHANGING_P (mem) = unchanging_p;
|
mem = adjust_automodify_address (basemem, SImode, addr, offset);
|
||||||
MEM_IN_STRUCT_P (mem) = in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = scalar_p;
|
|
||||||
emit_move_insn (gen_rtx_REG (SImode, base_regno + i), mem);
|
emit_move_insn (gen_rtx_REG (SImode, base_regno + i), mem);
|
||||||
|
offset += 4 * sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write_back)
|
if (write_back)
|
||||||
emit_move_insn (from, plus_constant (from, count * 4 * sign));
|
{
|
||||||
|
emit_move_insn (from, plus_constant (from, count * 4 * sign));
|
||||||
|
*offsetp = offset;
|
||||||
|
}
|
||||||
|
|
||||||
seq = get_insns ();
|
seq = get_insns ();
|
||||||
end_sequence ();
|
end_sequence ();
|
||||||
@ -5231,26 +5233,28 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up,
|
|||||||
|
|
||||||
for (j = 0; i < count; i++, j++)
|
for (j = 0; i < count; i++, j++)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (SImode, plus_constant (from, j * 4 * sign));
|
addr = plus_constant (from, j * 4 * sign);
|
||||||
RTX_UNCHANGING_P (mem) = unchanging_p;
|
mem = adjust_automodify_address_nv (basemem, SImode, addr, offset);
|
||||||
MEM_IN_STRUCT_P (mem) = in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = scalar_p;
|
|
||||||
XVECEXP (result, 0, i)
|
XVECEXP (result, 0, i)
|
||||||
= gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, base_regno + j), mem);
|
= gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, base_regno + j), mem);
|
||||||
|
offset += 4 * sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (write_back)
|
||||||
|
*offsetp = offset;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
arm_gen_store_multiple (int base_regno, int count, rtx to, int up,
|
arm_gen_store_multiple (int base_regno, int count, rtx to, int up,
|
||||||
int write_back, int unchanging_p, int in_struct_p,
|
int write_back, rtx basemem, HOST_WIDE_INT *offsetp)
|
||||||
int scalar_p)
|
|
||||||
{
|
{
|
||||||
|
HOST_WIDE_INT offset = *offsetp;
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
rtx result;
|
rtx result;
|
||||||
int sign = up ? 1 : -1;
|
int sign = up ? 1 : -1;
|
||||||
rtx mem;
|
rtx mem, addr;
|
||||||
|
|
||||||
/* See arm_gen_load_multiple for discussion of
|
/* See arm_gen_load_multiple for discussion of
|
||||||
the pros/cons of ldm/stm usage for XScale. */
|
the pros/cons of ldm/stm usage for XScale. */
|
||||||
@ -5262,15 +5266,17 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up,
|
|||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (SImode, plus_constant (to, i * 4 * sign));
|
addr = plus_constant (to, i * 4 * sign);
|
||||||
RTX_UNCHANGING_P (mem) = unchanging_p;
|
mem = adjust_automodify_address (basemem, SImode, addr, offset);
|
||||||
MEM_IN_STRUCT_P (mem) = in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = scalar_p;
|
|
||||||
emit_move_insn (mem, gen_rtx_REG (SImode, base_regno + i));
|
emit_move_insn (mem, gen_rtx_REG (SImode, base_regno + i));
|
||||||
|
offset += 4 * sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write_back)
|
if (write_back)
|
||||||
emit_move_insn (to, plus_constant (to, count * 4 * sign));
|
{
|
||||||
|
emit_move_insn (to, plus_constant (to, count * 4 * sign));
|
||||||
|
*offsetp = offset;
|
||||||
|
}
|
||||||
|
|
||||||
seq = get_insns ();
|
seq = get_insns ();
|
||||||
end_sequence ();
|
end_sequence ();
|
||||||
@ -5291,15 +5297,16 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up,
|
|||||||
|
|
||||||
for (j = 0; i < count; i++, j++)
|
for (j = 0; i < count; i++, j++)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (SImode, plus_constant (to, j * 4 * sign));
|
addr = plus_constant (to, j * 4 * sign);
|
||||||
RTX_UNCHANGING_P (mem) = unchanging_p;
|
mem = adjust_automodify_address_nv (basemem, SImode, addr, offset);
|
||||||
MEM_IN_STRUCT_P (mem) = in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = scalar_p;
|
|
||||||
|
|
||||||
XVECEXP (result, 0, i)
|
XVECEXP (result, 0, i)
|
||||||
= gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (SImode, base_regno + j));
|
= gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (SImode, base_regno + j));
|
||||||
|
offset += 4 * sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (write_back)
|
||||||
|
*offsetp = offset;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5307,13 +5314,11 @@ int
|
|||||||
arm_gen_movstrqi (rtx *operands)
|
arm_gen_movstrqi (rtx *operands)
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes;
|
HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes;
|
||||||
|
HOST_WIDE_INT srcoffset, dstoffset;
|
||||||
int i;
|
int i;
|
||||||
rtx src, dst;
|
rtx src, dst, srcbase, dstbase;
|
||||||
rtx st_src, st_dst, fin_src, fin_dst;
|
|
||||||
rtx part_bytes_reg = NULL;
|
rtx part_bytes_reg = NULL;
|
||||||
rtx mem;
|
rtx mem;
|
||||||
int dst_unchanging_p, dst_in_struct_p, src_unchanging_p, src_in_struct_p;
|
|
||||||
int dst_scalar_p, src_scalar_p;
|
|
||||||
|
|
||||||
if (GET_CODE (operands[2]) != CONST_INT
|
if (GET_CODE (operands[2]) != CONST_INT
|
||||||
|| GET_CODE (operands[3]) != CONST_INT
|
|| GET_CODE (operands[3]) != CONST_INT
|
||||||
@ -5321,23 +5326,17 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
|| INTVAL (operands[3]) & 3)
|
|| INTVAL (operands[3]) & 3)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
st_dst = XEXP (operands[0], 0);
|
dstbase = operands[0];
|
||||||
st_src = XEXP (operands[1], 0);
|
srcbase = operands[1];
|
||||||
|
|
||||||
dst_unchanging_p = RTX_UNCHANGING_P (operands[0]);
|
dst = copy_to_mode_reg (SImode, XEXP (dstbase, 0));
|
||||||
dst_in_struct_p = MEM_IN_STRUCT_P (operands[0]);
|
src = copy_to_mode_reg (SImode, XEXP (srcbase, 0));
|
||||||
dst_scalar_p = MEM_SCALAR_P (operands[0]);
|
|
||||||
src_unchanging_p = RTX_UNCHANGING_P (operands[1]);
|
|
||||||
src_in_struct_p = MEM_IN_STRUCT_P (operands[1]);
|
|
||||||
src_scalar_p = MEM_SCALAR_P (operands[1]);
|
|
||||||
|
|
||||||
fin_dst = dst = copy_to_mode_reg (SImode, st_dst);
|
|
||||||
fin_src = src = copy_to_mode_reg (SImode, st_src);
|
|
||||||
|
|
||||||
in_words_to_go = ARM_NUM_INTS (INTVAL (operands[2]));
|
in_words_to_go = ARM_NUM_INTS (INTVAL (operands[2]));
|
||||||
out_words_to_go = INTVAL (operands[2]) / 4;
|
out_words_to_go = INTVAL (operands[2]) / 4;
|
||||||
last_bytes = INTVAL (operands[2]) & 3;
|
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)
|
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);
|
part_bytes_reg = gen_rtx_REG (SImode, (in_words_to_go - 1) & 3);
|
||||||
|
|
||||||
@ -5345,38 +5344,32 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
{
|
{
|
||||||
if (in_words_to_go > 4)
|
if (in_words_to_go > 4)
|
||||||
emit_insn (arm_gen_load_multiple (0, 4, src, TRUE, TRUE,
|
emit_insn (arm_gen_load_multiple (0, 4, src, TRUE, TRUE,
|
||||||
src_unchanging_p,
|
srcbase, &srcoffset));
|
||||||
src_in_struct_p,
|
|
||||||
src_scalar_p));
|
|
||||||
else
|
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, src_unchanging_p,
|
FALSE, srcbase, &srcoffset));
|
||||||
src_in_struct_p, src_scalar_p));
|
|
||||||
|
|
||||||
if (out_words_to_go)
|
if (out_words_to_go)
|
||||||
{
|
{
|
||||||
if (out_words_to_go > 4)
|
if (out_words_to_go > 4)
|
||||||
emit_insn (arm_gen_store_multiple (0, 4, dst, TRUE, TRUE,
|
emit_insn (arm_gen_store_multiple (0, 4, dst, TRUE, TRUE,
|
||||||
dst_unchanging_p,
|
dstbase, &dstoffset));
|
||||||
dst_in_struct_p,
|
|
||||||
dst_scalar_p));
|
|
||||||
else if (out_words_to_go != 1)
|
else if (out_words_to_go != 1)
|
||||||
emit_insn (arm_gen_store_multiple (0, out_words_to_go,
|
emit_insn (arm_gen_store_multiple (0, out_words_to_go,
|
||||||
dst, TRUE,
|
dst, TRUE,
|
||||||
(last_bytes == 0
|
(last_bytes == 0
|
||||||
? FALSE : TRUE),
|
? FALSE : TRUE),
|
||||||
dst_unchanging_p,
|
dstbase, &dstoffset));
|
||||||
dst_in_struct_p,
|
|
||||||
dst_scalar_p));
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (SImode, dst);
|
mem = adjust_automodify_address (dstbase, SImode, dst, dstoffset);
|
||||||
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
|
|
||||||
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = dst_scalar_p;
|
|
||||||
emit_move_insn (mem, gen_rtx_REG (SImode, 0));
|
emit_move_insn (mem, gen_rtx_REG (SImode, 0));
|
||||||
if (last_bytes != 0)
|
if (last_bytes != 0)
|
||||||
emit_insn (gen_addsi3 (dst, dst, GEN_INT (4)));
|
{
|
||||||
|
emit_insn (gen_addsi3 (dst, dst, GEN_INT (4)));
|
||||||
|
dstoffset += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5388,20 +5381,12 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
if (out_words_to_go)
|
if (out_words_to_go)
|
||||||
{
|
{
|
||||||
rtx sreg;
|
rtx sreg;
|
||||||
|
|
||||||
mem = gen_rtx_MEM (SImode, src);
|
mem = adjust_automodify_address (srcbase, SImode, src, srcoffset);
|
||||||
RTX_UNCHANGING_P (mem) = src_unchanging_p;
|
sreg = copy_to_reg (mem);
|
||||||
MEM_IN_STRUCT_P (mem) = src_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = src_scalar_p;
|
mem = adjust_automodify_address (dstbase, SImode, dst, dstoffset);
|
||||||
emit_move_insn (sreg = gen_reg_rtx (SImode), mem);
|
|
||||||
emit_move_insn (fin_src = gen_reg_rtx (SImode), plus_constant (src, 4));
|
|
||||||
|
|
||||||
mem = gen_rtx_MEM (SImode, dst);
|
|
||||||
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
|
|
||||||
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = dst_scalar_p;
|
|
||||||
emit_move_insn (mem, sreg);
|
emit_move_insn (mem, sreg);
|
||||||
emit_move_insn (fin_dst = gen_reg_rtx (SImode), plus_constant (dst, 4));
|
|
||||||
in_words_to_go--;
|
in_words_to_go--;
|
||||||
|
|
||||||
if (in_words_to_go) /* Sanity check */
|
if (in_words_to_go) /* Sanity check */
|
||||||
@ -5413,10 +5398,7 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
if (in_words_to_go < 0)
|
if (in_words_to_go < 0)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
mem = gen_rtx_MEM (SImode, src);
|
mem = adjust_automodify_address (srcbase, SImode, src, srcoffset);
|
||||||
RTX_UNCHANGING_P (mem) = src_unchanging_p;
|
|
||||||
MEM_IN_STRUCT_P (mem) = src_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = src_scalar_p;
|
|
||||||
part_bytes_reg = copy_to_mode_reg (SImode, mem);
|
part_bytes_reg = copy_to_mode_reg (SImode, mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5434,10 +5416,9 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
|
|
||||||
while (last_bytes)
|
while (last_bytes)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (QImode, plus_constant (dst, last_bytes - 1));
|
mem = adjust_automodify_address (dstbase, QImode,
|
||||||
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
|
plus_constant (dst, last_bytes - 1),
|
||||||
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
|
dstoffset + last_bytes - 1);
|
||||||
MEM_SCALAR_P (mem) = dst_scalar_p;
|
|
||||||
emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg));
|
emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg));
|
||||||
|
|
||||||
if (--last_bytes)
|
if (--last_bytes)
|
||||||
@ -5453,10 +5434,7 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
{
|
{
|
||||||
if (last_bytes > 1)
|
if (last_bytes > 1)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (HImode, dst);
|
mem = adjust_automodify_address (dstbase, HImode, dst, dstoffset);
|
||||||
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
|
|
||||||
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = dst_scalar_p;
|
|
||||||
emit_move_insn (mem, gen_lowpart (HImode, part_bytes_reg));
|
emit_move_insn (mem, gen_lowpart (HImode, part_bytes_reg));
|
||||||
last_bytes -= 2;
|
last_bytes -= 2;
|
||||||
if (last_bytes)
|
if (last_bytes)
|
||||||
@ -5466,15 +5444,13 @@ arm_gen_movstrqi (rtx *operands)
|
|||||||
emit_insn (gen_addsi3 (dst, dst, GEN_INT (2)));
|
emit_insn (gen_addsi3 (dst, dst, GEN_INT (2)));
|
||||||
emit_insn (gen_lshrsi3 (tmp, part_bytes_reg, GEN_INT (16)));
|
emit_insn (gen_lshrsi3 (tmp, part_bytes_reg, GEN_INT (16)));
|
||||||
part_bytes_reg = tmp;
|
part_bytes_reg = tmp;
|
||||||
|
dstoffset += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_bytes)
|
if (last_bytes)
|
||||||
{
|
{
|
||||||
mem = gen_rtx_MEM (QImode, dst);
|
mem = adjust_automodify_address (dstbase, QImode, dst, dstoffset);
|
||||||
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
|
|
||||||
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
|
|
||||||
MEM_SCALAR_P (mem) = dst_scalar_p;
|
|
||||||
emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg));
|
emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5043,7 +5043,9 @@
|
|||||||
(match_operand:SI 1 "" ""))
|
(match_operand:SI 1 "" ""))
|
||||||
(use (match_operand:SI 2 "" ""))])]
|
(use (match_operand:SI 2 "" ""))])]
|
||||||
"TARGET_ARM"
|
"TARGET_ARM"
|
||||||
"
|
{
|
||||||
|
HOST_WIDE_INT offset = 0;
|
||||||
|
|
||||||
/* Support only fixed point registers. */
|
/* Support only fixed point registers. */
|
||||||
if (GET_CODE (operands[2]) != CONST_INT
|
if (GET_CODE (operands[2]) != CONST_INT
|
||||||
|| INTVAL (operands[2]) > 14
|
|| INTVAL (operands[2]) > 14
|
||||||
@ -5057,11 +5059,9 @@
|
|||||||
operands[3]
|
operands[3]
|
||||||
= arm_gen_load_multiple (REGNO (operands[0]), INTVAL (operands[2]),
|
= arm_gen_load_multiple (REGNO (operands[0]), INTVAL (operands[2]),
|
||||||
force_reg (SImode, XEXP (operands[1], 0)),
|
force_reg (SImode, XEXP (operands[1], 0)),
|
||||||
TRUE, FALSE, RTX_UNCHANGING_P(operands[1]),
|
TRUE, FALSE, operands[1], &offset);
|
||||||
MEM_IN_STRUCT_P(operands[1]),
|
|
||||||
MEM_SCALAR_P (operands[1]));
|
})
|
||||||
"
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Load multiple with write-back
|
;; Load multiple with write-back
|
||||||
|
|
||||||
@ -5165,7 +5165,9 @@
|
|||||||
(match_operand:SI 1 "" ""))
|
(match_operand:SI 1 "" ""))
|
||||||
(use (match_operand:SI 2 "" ""))])]
|
(use (match_operand:SI 2 "" ""))])]
|
||||||
"TARGET_ARM"
|
"TARGET_ARM"
|
||||||
"
|
{
|
||||||
|
HOST_WIDE_INT offset = 0;
|
||||||
|
|
||||||
/* Support only fixed point registers. */
|
/* Support only fixed point registers. */
|
||||||
if (GET_CODE (operands[2]) != CONST_INT
|
if (GET_CODE (operands[2]) != CONST_INT
|
||||||
|| INTVAL (operands[2]) > 14
|
|| INTVAL (operands[2]) > 14
|
||||||
@ -5179,11 +5181,8 @@
|
|||||||
operands[3]
|
operands[3]
|
||||||
= arm_gen_store_multiple (REGNO (operands[1]), INTVAL (operands[2]),
|
= arm_gen_store_multiple (REGNO (operands[1]), INTVAL (operands[2]),
|
||||||
force_reg (SImode, XEXP (operands[0], 0)),
|
force_reg (SImode, XEXP (operands[0], 0)),
|
||||||
TRUE, FALSE, RTX_UNCHANGING_P (operands[0]),
|
TRUE, FALSE, operands[0], &offset);
|
||||||
MEM_IN_STRUCT_P(operands[0]),
|
})
|
||||||
MEM_SCALAR_P (operands[0]));
|
|
||||||
"
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Store multiple with write-back
|
;; Store multiple with write-back
|
||||||
|
|
||||||
|
@ -4903,7 +4903,7 @@ output_set_got (rtx dest)
|
|||||||
if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION)
|
if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION)
|
||||||
output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops);
|
output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops);
|
||||||
else if (!TARGET_MACHO)
|
else if (!TARGET_MACHO)
|
||||||
output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %a1+(.-%a2)}", xops);
|
output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops);
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -13961,6 +13961,7 @@ ix86_expand_unop_builtin (enum insn_code icode, tree arglist,
|
|||||||
|
|
||||||
if (! target
|
if (! target
|
||||||
|| GET_MODE (target) != tmode
|
|| GET_MODE (target) != tmode
|
||||||
|
|| (do_load && GET_CODE (target) == MEM)
|
||||||
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
|
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
|
||||||
target = gen_reg_rtx (tmode);
|
target = gen_reg_rtx (tmode);
|
||||||
if (do_load)
|
if (do_load)
|
||||||
|
@ -1850,7 +1850,8 @@
|
|||||||
(define_split
|
(define_split
|
||||||
[(set (match_operand:DI 0 "push_operand" "")
|
[(set (match_operand:DI 0 "push_operand" "")
|
||||||
(match_operand:DI 1 "immediate_operand" ""))]
|
(match_operand:DI 1 "immediate_operand" ""))]
|
||||||
"TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2))
|
"TARGET_64BIT && ((optimize > 0 && flag_peephole2)
|
||||||
|
? flow2_completed : reload_completed)
|
||||||
&& !symbolic_operand (operands[1], DImode)
|
&& !symbolic_operand (operands[1], DImode)
|
||||||
&& !x86_64_immediate_operand (operands[1], DImode)"
|
&& !x86_64_immediate_operand (operands[1], DImode)"
|
||||||
[(set (match_dup 0) (match_dup 1))
|
[(set (match_dup 0) (match_dup 1))
|
||||||
@ -2105,7 +2106,8 @@
|
|||||||
(define_split
|
(define_split
|
||||||
[(set (match_operand:DI 0 "memory_operand" "")
|
[(set (match_operand:DI 0 "memory_operand" "")
|
||||||
(match_operand:DI 1 "immediate_operand" ""))]
|
(match_operand:DI 1 "immediate_operand" ""))]
|
||||||
"TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2))
|
"TARGET_64BIT && ((optimize > 0 && flag_peephole2)
|
||||||
|
? flow2_completed : reload_completed)
|
||||||
&& !symbolic_operand (operands[1], DImode)
|
&& !symbolic_operand (operands[1], DImode)
|
||||||
&& !x86_64_immediate_operand (operands[1], DImode)"
|
&& !x86_64_immediate_operand (operands[1], DImode)"
|
||||||
[(set (match_dup 2) (match_dup 3))
|
[(set (match_dup 2) (match_dup 3))
|
||||||
@ -2172,11 +2174,10 @@
|
|||||||
(match_operand:SF 1 "memory_operand" ""))]
|
(match_operand:SF 1 "memory_operand" ""))]
|
||||||
"reload_completed
|
"reload_completed
|
||||||
&& GET_CODE (operands[1]) == MEM
|
&& GET_CODE (operands[1]) == MEM
|
||||||
&& GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
|
&& constant_pool_reference_p (operands[1])"
|
||||||
&& CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))"
|
|
||||||
[(set (match_dup 0)
|
[(set (match_dup 0)
|
||||||
(match_dup 1))]
|
(match_dup 1))]
|
||||||
"operands[1] = get_pool_constant (XEXP (operands[1], 0));")
|
"operands[1] = avoid_constant_pool_reference (operands[1]);")
|
||||||
|
|
||||||
|
|
||||||
;; %%% Kill this when call knows how to work this out.
|
;; %%% Kill this when call knows how to work this out.
|
||||||
@ -2889,11 +2890,10 @@
|
|||||||
&& GET_CODE (operands[1]) == MEM
|
&& GET_CODE (operands[1]) == MEM
|
||||||
&& (GET_MODE (operands[0]) == XFmode
|
&& (GET_MODE (operands[0]) == XFmode
|
||||||
|| GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
|
|| GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
|
||||||
&& GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
|
&& constant_pool_reference_p (operands[1])"
|
||||||
&& CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))"
|
|
||||||
[(set (match_dup 0) (match_dup 1))]
|
[(set (match_dup 0) (match_dup 1))]
|
||||||
{
|
{
|
||||||
rtx c = get_pool_constant (XEXP (operands[1], 0));
|
rtx c = avoid_constant_pool_reference (operands[1]);
|
||||||
rtx r = operands[0];
|
rtx r = operands[0];
|
||||||
|
|
||||||
if (GET_CODE (r) == SUBREG)
|
if (GET_CODE (r) == SUBREG)
|
||||||
|
@ -84,13 +84,6 @@ do { \
|
|||||||
%{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
|
%{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
|
||||||
%{!symbolic:-lc}}"
|
%{!symbolic:-lc}}"
|
||||||
|
|
||||||
#ifndef CROSS_COMPILE
|
|
||||||
#undef LIBGCC_SPEC
|
|
||||||
#define LIBGCC_SPEC \
|
|
||||||
"%{shared-libgcc:%{!mlp64:-lgcc_s}%{mlp64:-lgcc_s_hpux64} -lgcc} \
|
|
||||||
%{!shared-libgcc:-lgcc}"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef SUBTARGET_SWITCHES
|
#undef SUBTARGET_SWITCHES
|
||||||
#define SUBTARGET_SWITCHES \
|
#define SUBTARGET_SWITCHES \
|
||||||
{ "ilp32", MASK_ILP32, "Generate ILP32 code" }, \
|
{ "ilp32", MASK_ILP32, "Generate ILP32 code" }, \
|
||||||
|
@ -197,7 +197,3 @@ do { \
|
|||||||
#undef LD_INIT_SWITCH
|
#undef LD_INIT_SWITCH
|
||||||
#define LD_INIT_SWITCH "-binitfini"
|
#define LD_INIT_SWITCH "-binitfini"
|
||||||
|
|
||||||
/* AIX 5.1 has the float and long double forms of math functions. */
|
|
||||||
#undef TARGET_C99_FUNCTIONS
|
|
||||||
#define TARGET_C99_FUNCTIONS 1
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Darwin/powerpc host-specific hook definitions.
|
/* Darwin/powerpc host-specific hook definitions.
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
|
|
||||||
@ -137,22 +137,18 @@ darwin_rs6000_extra_signals (void)
|
|||||||
fatal_error ("While setting up signal handler: %m");
|
fatal_error ("While setting up signal handler: %m");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void * darwin_rs6000_gt_pch_get_address (size_t);
|
|
||||||
static bool darwin_rs6000_gt_pch_use_address (void *, size_t);
|
|
||||||
|
|
||||||
#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
|
#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
|
||||||
#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_rs6000_gt_pch_get_address
|
#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_rs6000_gt_pch_get_address
|
||||||
#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
|
#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
|
||||||
#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_rs6000_gt_pch_use_address
|
#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_rs6000_gt_pch_use_address
|
||||||
|
|
||||||
|
|
||||||
/* Yes, this is really supposed to work. */
|
/* Yes, this is really supposed to work. */
|
||||||
static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096)));
|
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. */
|
/* Return the address of the PCH address space, if the PCH will fit in it. */
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
darwin_rs6000_gt_pch_get_address (size_t sz)
|
darwin_rs6000_gt_pch_get_address (size_t sz, int fd ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (sz <= sizeof (pch_address_space))
|
if (sz <= sizeof (pch_address_space))
|
||||||
return pch_address_space;
|
return pch_address_space;
|
||||||
@ -163,18 +159,19 @@ darwin_rs6000_gt_pch_get_address (size_t sz)
|
|||||||
/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of
|
/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of
|
||||||
pch_address_space beyond SZ. */
|
pch_address_space beyond SZ. */
|
||||||
|
|
||||||
static bool
|
static int
|
||||||
darwin_rs6000_gt_pch_use_address (void *addr, size_t sz)
|
darwin_rs6000_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off)
|
||||||
{
|
{
|
||||||
const size_t pagesize = getpagesize();
|
const size_t pagesize = getpagesize();
|
||||||
bool result;
|
void *mmap_result;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if ((size_t)pch_address_space % pagesize != 0
|
if ((size_t)pch_address_space % pagesize != 0
|
||||||
|| sizeof (pch_address_space) % pagesize != 0)
|
|| sizeof (pch_address_space) % pagesize != 0)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
result = (addr == pch_address_space && sz <= sizeof (pch_address_space));
|
ret = (addr == pch_address_space && sz <= sizeof (pch_address_space));
|
||||||
if (! result)
|
if (! ret)
|
||||||
sz = 0;
|
sz = 0;
|
||||||
|
|
||||||
/* Round the size to a whole page size. Normally this is a no-op. */
|
/* Round the size to a whole page size. Normally this is a no-op. */
|
||||||
@ -183,7 +180,22 @@ darwin_rs6000_gt_pch_use_address (void *addr, size_t sz)
|
|||||||
if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
|
if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
|
||||||
fatal_error ("couldn't unmap pch_address_space: %m\n");
|
fatal_error ("couldn't unmap pch_address_space: %m\n");
|
||||||
|
|
||||||
return result;
|
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;
|
const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
|
||||||
|
@ -244,6 +244,12 @@
|
|||||||
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
|
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
|
||||||
: MAX ((COMPUTED), (SPECIFIED)))
|
: MAX ((COMPUTED), (SPECIFIED)))
|
||||||
|
|
||||||
|
/* Use the default for compiling target libs. */
|
||||||
|
#ifdef IN_TARGET_LIBS
|
||||||
|
#undef TARGET_ALIGN_NATURAL
|
||||||
|
#define TARGET_ALIGN_NATURAL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Indicate that jump tables go in the text section. */
|
/* Indicate that jump tables go in the text section. */
|
||||||
#undef JUMP_TABLES_IN_TEXT_SECTION
|
#undef JUMP_TABLES_IN_TEXT_SECTION
|
||||||
#define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
|
#define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
|
||||||
|
@ -105,7 +105,7 @@ extern int registers_ok_for_quad_peep (rtx, rtx);
|
|||||||
extern int addrs_ok_for_quad_peep (rtx, rtx);
|
extern int addrs_ok_for_quad_peep (rtx, rtx);
|
||||||
extern bool gpr_or_gpr_p (rtx, rtx);
|
extern bool gpr_or_gpr_p (rtx, rtx);
|
||||||
extern enum reg_class secondary_reload_class (enum reg_class,
|
extern enum reg_class secondary_reload_class (enum reg_class,
|
||||||
enum machine_mode, rtx, int);
|
enum machine_mode, rtx);
|
||||||
extern int ccr_bit (rtx, int);
|
extern int ccr_bit (rtx, int);
|
||||||
extern int extract_MB (rtx);
|
extern int extract_MB (rtx);
|
||||||
extern int extract_ME (rtx);
|
extern int extract_ME (rtx);
|
||||||
|
@ -2497,43 +2497,6 @@ word_offset_memref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
|||||||
return (off % 4) == 0;
|
return (off % 4) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if operand is a (MEM (PLUS (REG) (offset))) where offset
|
|
||||||
is not divisible by four. */
|
|
||||||
|
|
||||||
int
|
|
||||||
invalid_gpr_mem (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
rtx addr;
|
|
||||||
long off;
|
|
||||||
|
|
||||||
if (GET_CODE (op) != MEM)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
addr = XEXP (op, 0);
|
|
||||||
if (GET_CODE (addr) != PLUS
|
|
||||||
|| GET_CODE (XEXP (addr, 0)) != REG
|
|
||||||
|| GET_CODE (XEXP (addr, 1)) != CONST_INT)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
off = INTVAL (XEXP (addr, 1));
|
|
||||||
return (off & 3) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return true if operand is a hard register that can be used as a base
|
|
||||||
register. */
|
|
||||||
|
|
||||||
int
|
|
||||||
base_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
unsigned int regno;
|
|
||||||
|
|
||||||
if (!REG_P (op))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
regno = REGNO (op);
|
|
||||||
return regno != 0 && regno <= 31;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return true if either operand is a general purpose register. */
|
/* Return true if either operand is a general purpose register. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -2658,16 +2621,18 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict)
|
|||||||
|
|
||||||
case DFmode:
|
case DFmode:
|
||||||
case DImode:
|
case DImode:
|
||||||
/* Both DFmode and DImode may end up in gprs. If gprs are 32-bit,
|
if (mode == DFmode || !TARGET_POWERPC64)
|
||||||
then we need to load/store at both offset and offset+4. */
|
|
||||||
if (!TARGET_POWERPC64)
|
|
||||||
extra = 4;
|
extra = 4;
|
||||||
|
else if (offset & 3)
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TFmode:
|
case TFmode:
|
||||||
case TImode:
|
case TImode:
|
||||||
if (!TARGET_POWERPC64)
|
if (mode == TFmode || !TARGET_POWERPC64)
|
||||||
extra = 12;
|
extra = 12;
|
||||||
|
else if (offset & 3)
|
||||||
|
return false;
|
||||||
else
|
else
|
||||||
extra = 8;
|
extra = 8;
|
||||||
break;
|
break;
|
||||||
@ -2989,7 +2954,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
|
|||||||
rtx r3, got, tga, tmp1, tmp2, eqv;
|
rtx r3, got, tga, tmp1, tmp2, eqv;
|
||||||
|
|
||||||
if (TARGET_64BIT)
|
if (TARGET_64BIT)
|
||||||
got = gen_rtx_REG (Pmode, TOC_REGISTER);
|
got = gen_rtx_REG (Pmode, 2);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (flag_pic == 1)
|
if (flag_pic == 1)
|
||||||
@ -3206,6 +3171,26 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Force ld/std non-word aligned offset into base register by wrapping
|
||||||
|
in offset 0. */
|
||||||
|
if (GET_CODE (x) == PLUS
|
||||||
|
&& GET_CODE (XEXP (x, 0)) == REG
|
||||||
|
&& REGNO (XEXP (x, 0)) < 32
|
||||||
|
&& REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode)
|
||||||
|
&& GET_CODE (XEXP (x, 1)) == CONST_INT
|
||||||
|
&& (INTVAL (XEXP (x, 1)) & 3) != 0
|
||||||
|
&& GET_MODE_SIZE (mode) >= UNITS_PER_WORD
|
||||||
|
&& TARGET_POWERPC64)
|
||||||
|
{
|
||||||
|
x = gen_rtx_PLUS (GET_MODE (x), x, GEN_INT (0));
|
||||||
|
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);
|
||||||
|
*win = 1;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
if (GET_CODE (x) == PLUS
|
if (GET_CODE (x) == PLUS
|
||||||
&& GET_CODE (XEXP (x, 0)) == REG
|
&& GET_CODE (XEXP (x, 0)) == REG
|
||||||
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
|
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
|
||||||
@ -3240,6 +3225,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
|
|||||||
*win = 1;
|
*win = 1;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TARGET_MACHO
|
#if TARGET_MACHO
|
||||||
if (GET_CODE (x) == SYMBOL_REF
|
if (GET_CODE (x) == SYMBOL_REF
|
||||||
&& DEFAULT_ABI == ABI_DARWIN
|
&& DEFAULT_ABI == ABI_DARWIN
|
||||||
@ -3269,6 +3255,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (TARGET_TOC
|
if (TARGET_TOC
|
||||||
&& constant_pool_expr_p (x)
|
&& constant_pool_expr_p (x)
|
||||||
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode))
|
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode))
|
||||||
@ -4369,9 +4356,10 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
|||||||
if (mode == VOIDmode)
|
if (mode == VOIDmode)
|
||||||
{
|
{
|
||||||
if (abi == ABI_V4
|
if (abi == ABI_V4
|
||||||
&& cum->nargs_prototype < 0
|
|
||||||
&& (cum->call_cookie & CALL_LIBCALL) == 0
|
&& (cum->call_cookie & CALL_LIBCALL) == 0
|
||||||
&& (cum->prototype || TARGET_NO_PROTOTYPE))
|
&& (cum->stdarg
|
||||||
|
|| (cum->nargs_prototype < 0
|
||||||
|
&& (cum->prototype || TARGET_NO_PROTOTYPE))))
|
||||||
{
|
{
|
||||||
/* For the SPE, we need to crxor CR6 always. */
|
/* For the SPE, we need to crxor CR6 always. */
|
||||||
if (TARGET_SPE_ABI)
|
if (TARGET_SPE_ABI)
|
||||||
@ -7856,7 +7844,7 @@ expand_block_move (rtx operands[])
|
|||||||
mode = SImode;
|
mode = SImode;
|
||||||
gen_func.mov = gen_movsi;
|
gen_func.mov = gen_movsi;
|
||||||
}
|
}
|
||||||
else if (bytes == 2 && (align >= 2 || ! STRICT_ALIGNMENT))
|
else if (bytes >= 2 && (align >= 2 || ! STRICT_ALIGNMENT))
|
||||||
{ /* move 2 bytes */
|
{ /* move 2 bytes */
|
||||||
move_bytes = 2;
|
move_bytes = 2;
|
||||||
mode = HImode;
|
mode = HImode;
|
||||||
@ -8725,14 +8713,12 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2)
|
|||||||
|
|
||||||
/* Return the register class of a scratch register needed to copy IN into
|
/* 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,
|
or out of a register in CLASS in MODE. If it can be done directly,
|
||||||
NO_REGS is returned. INP is nonzero if we are loading the reg, zero
|
NO_REGS is returned. */
|
||||||
for storing. */
|
|
||||||
|
|
||||||
enum reg_class
|
enum reg_class
|
||||||
secondary_reload_class (enum reg_class class,
|
secondary_reload_class (enum reg_class class,
|
||||||
enum machine_mode mode,
|
enum machine_mode mode,
|
||||||
rtx in,
|
rtx in)
|
||||||
int inp)
|
|
||||||
{
|
{
|
||||||
int regno;
|
int regno;
|
||||||
|
|
||||||
@ -8757,14 +8743,6 @@ secondary_reload_class (enum reg_class class,
|
|||||||
return BASE_REGS;
|
return BASE_REGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A 64-bit gpr load or store using an offset that isn't a multiple of
|
|
||||||
four needs a secondary reload. */
|
|
||||||
if (TARGET_POWERPC64
|
|
||||||
&& GET_MODE_UNIT_SIZE (mode) >= 8
|
|
||||||
&& (!inp || class != BASE_REGS)
|
|
||||||
&& invalid_gpr_mem (in, mode))
|
|
||||||
return BASE_REGS;
|
|
||||||
|
|
||||||
if (GET_CODE (in) == REG)
|
if (GET_CODE (in) == REG)
|
||||||
{
|
{
|
||||||
regno = REGNO (in);
|
regno = REGNO (in);
|
||||||
@ -11620,6 +11598,8 @@ uses_TOC (void)
|
|||||||
rtx
|
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_REG (Pmode, TOC_REGISTER),
|
||||||
gen_rtx_CONST (Pmode,
|
gen_rtx_CONST (Pmode,
|
||||||
|
@ -1492,11 +1492,8 @@ enum reg_class
|
|||||||
or out of a register in CLASS in MODE. If it can be done directly,
|
or out of a register in CLASS in MODE. If it can be done directly,
|
||||||
NO_REGS is returned. */
|
NO_REGS is returned. */
|
||||||
|
|
||||||
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, IN) \
|
#define SECONDARY_RELOAD_CLASS(CLASS, MODE, IN) \
|
||||||
secondary_reload_class (CLASS, MODE, IN, 1)
|
secondary_reload_class (CLASS, MODE, IN)
|
||||||
|
|
||||||
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, IN) \
|
|
||||||
secondary_reload_class (CLASS, MODE, IN, 0)
|
|
||||||
|
|
||||||
/* If we are copying between FP or AltiVec registers and anything
|
/* If we are copying between FP or AltiVec registers and anything
|
||||||
else, we need a memory location. */
|
else, we need a memory location. */
|
||||||
@ -2671,8 +2668,6 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
|
|||||||
{"lwa_operand", {SUBREG, MEM, REG}}, \
|
{"lwa_operand", {SUBREG, MEM, REG}}, \
|
||||||
{"volatile_mem_operand", {MEM}}, \
|
{"volatile_mem_operand", {MEM}}, \
|
||||||
{"offsettable_mem_operand", {MEM}}, \
|
{"offsettable_mem_operand", {MEM}}, \
|
||||||
{"invalid_gpr_mem", {MEM}}, \
|
|
||||||
{"base_reg_operand", {REG}}, \
|
|
||||||
{"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \
|
{"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \
|
||||||
{"add_operand", {SUBREG, REG, CONST_INT}}, \
|
{"add_operand", {SUBREG, REG, CONST_INT}}, \
|
||||||
{"non_add_cint_operand", {CONST_INT}}, \
|
{"non_add_cint_operand", {CONST_INT}}, \
|
||||||
|
@ -5236,7 +5236,7 @@
|
|||||||
(set (match_dup 0) (plus:DI (match_dup 0)
|
(set (match_dup 0) (plus:DI (match_dup 0)
|
||||||
(const_int 2047)))
|
(const_int 2047)))
|
||||||
(set (match_dup 4) (compare:CCUNS (match_dup 3)
|
(set (match_dup 4) (compare:CCUNS (match_dup 3)
|
||||||
(const_int 3)))
|
(const_int 2)))
|
||||||
(set (match_dup 0) (ior:DI (match_dup 0)
|
(set (match_dup 0) (ior:DI (match_dup 0)
|
||||||
(match_dup 1)))
|
(match_dup 1)))
|
||||||
(parallel [(set (match_dup 0) (and:DI (match_dup 0)
|
(parallel [(set (match_dup 0) (and:DI (match_dup 0)
|
||||||
@ -7839,8 +7839,8 @@
|
|||||||
}")
|
}")
|
||||||
|
|
||||||
(define_insn "*movsf_hardfloat"
|
(define_insn "*movsf_hardfloat"
|
||||||
[(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!cl,!q,!r,!r,!r")
|
[(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!cl,!q,!r,!h,!r,!r")
|
||||||
(match_operand:SF 1 "input_operand" "r,m,r,f,m,f,r,r,h,G,Fn"))]
|
(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[0], SFmode)
|
||||||
|| gpc_reg_operand (operands[1], SFmode))
|
|| gpc_reg_operand (operands[1], SFmode))
|
||||||
&& (TARGET_HARD_FLOAT && TARGET_FPRS)"
|
&& (TARGET_HARD_FLOAT && TARGET_FPRS)"
|
||||||
@ -7854,10 +7854,11 @@
|
|||||||
mt%0 %1
|
mt%0 %1
|
||||||
mt%0 %1
|
mt%0 %1
|
||||||
mf%1 %0
|
mf%1 %0
|
||||||
|
{cror 0,0,0|nop}
|
||||||
#
|
#
|
||||||
#"
|
#"
|
||||||
[(set_attr "type" "*,load,store,fp,fpload,fpstore,*,mtjmpr,*,*,*")
|
[(set_attr "type" "*,load,store,fp,fpload,fpstore,*,mtjmpr,*,*,*,*")
|
||||||
(set_attr "length" "4,4,4,4,4,4,4,4,4,4,8")])
|
(set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,8")])
|
||||||
|
|
||||||
(define_insn "*movsf_softfloat"
|
(define_insn "*movsf_softfloat"
|
||||||
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,cl,q,r,r,m,r,r,r,r,r,*h")
|
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,cl,q,r,r,m,r,r,r,r,r,*h")
|
||||||
@ -8114,67 +8115,26 @@
|
|||||||
; ld/std require word-aligned displacements -> 'Y' constraint.
|
; ld/std require word-aligned displacements -> 'Y' constraint.
|
||||||
; List Y->r and r->Y before r->r for reload.
|
; List Y->r and r->Y before r->r for reload.
|
||||||
(define_insn "*movdf_hardfloat64"
|
(define_insn "*movdf_hardfloat64"
|
||||||
[(set (match_operand:DF 0 "nonimmediate_operand" "=Y,r,b,!r,f,f,m,!cl,!r,!r,!r,!r")
|
[(set (match_operand:DF 0 "nonimmediate_operand" "=Y,r,!r,f,f,m,!cl,!r,!h,!r,!r,!r")
|
||||||
(match_operand:DF 1 "input_operand" "r,Y,m,r,f,m,f,r,h,G,H,F"))]
|
(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
|
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS
|
||||||
&& (gpc_reg_operand (operands[0], DFmode)
|
&& (gpc_reg_operand (operands[0], DFmode)
|
||||||
|| gpc_reg_operand (operands[1], DFmode))"
|
|| gpc_reg_operand (operands[1], DFmode))"
|
||||||
"@
|
"@
|
||||||
std%U0%X0 %1,%0
|
std%U0%X0 %1,%0
|
||||||
ld%U1%X1 %0,%1
|
ld%U1%X1 %0,%1
|
||||||
#
|
|
||||||
mr %0,%1
|
mr %0,%1
|
||||||
fmr %0,%1
|
fmr %0,%1
|
||||||
lfd%U1%X1 %0,%1
|
lfd%U1%X1 %0,%1
|
||||||
stfd%U0%X0 %1,%0
|
stfd%U0%X0 %1,%0
|
||||||
mt%0 %1
|
mt%0 %1
|
||||||
mf%1 %0
|
mf%1 %0
|
||||||
|
{cror 0,0,0|nop}
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#"
|
#"
|
||||||
[(set_attr "type" "store,load,load,*,fp,fpload,fpstore,mtjmpr,*,*,*,*")
|
[(set_attr "type" "store,load,*,fp,fpload,fpstore,mtjmpr,*,*,*,*,*")
|
||||||
(set_attr "length" "4,4,8,4,4,4,4,4,4,8,12,16")])
|
(set_attr "length" "4,4,4,4,4,4,4,4,4,8,12,16")])
|
||||||
|
|
||||||
(define_split
|
|
||||||
[(set (match_operand:DF 0 "base_reg_operand" "")
|
|
||||||
(match_operand:DF 1 "invalid_gpr_mem" ""))]
|
|
||||||
"TARGET_POWERPC64 && no_new_pseudos"
|
|
||||||
[(set (match_dup 2) (match_dup 3))
|
|
||||||
(set (match_dup 0) (match_dup 4))]
|
|
||||||
"
|
|
||||||
{
|
|
||||||
operands[2] = gen_rtx_REG (Pmode, REGNO (operands[0]));
|
|
||||||
operands[3] = XEXP (operands[1], 0);
|
|
||||||
operands[4] = replace_equiv_address (operands[1], operands[2]);
|
|
||||||
}")
|
|
||||||
|
|
||||||
(define_expand "reload_outdf"
|
|
||||||
[(parallel [(match_operand:DF 0 "invalid_gpr_mem" "")
|
|
||||||
(match_operand:DF 1 "register_operand" "")
|
|
||||||
(match_operand:DI 2 "register_operand" "=&b")])]
|
|
||||||
"TARGET_POWERPC64"
|
|
||||||
{
|
|
||||||
if (!TARGET_64BIT)
|
|
||||||
operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]));
|
|
||||||
emit_move_insn (operands[2], XEXP (operands[0], 0));
|
|
||||||
operands[0] = replace_equiv_address (operands[0], operands[2]);
|
|
||||||
emit_move_insn (operands[0], operands[1]);
|
|
||||||
DONE;
|
|
||||||
})
|
|
||||||
|
|
||||||
(define_expand "reload_indf"
|
|
||||||
[(parallel [(match_operand:DF 0 "register_operand" "")
|
|
||||||
(match_operand:DF 1 "invalid_gpr_mem" "")
|
|
||||||
(match_operand:DI 2 "register_operand" "=&b")])]
|
|
||||||
"TARGET_POWERPC64"
|
|
||||||
{
|
|
||||||
if (!TARGET_64BIT)
|
|
||||||
operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]));
|
|
||||||
emit_move_insn (operands[2], XEXP (operands[1], 0));
|
|
||||||
operands[1] = replace_equiv_address (operands[1], operands[2]);
|
|
||||||
emit_move_insn (operands[0], operands[1]);
|
|
||||||
DONE;
|
|
||||||
})
|
|
||||||
|
|
||||||
(define_insn "*movdf_softfloat64"
|
(define_insn "*movdf_softfloat64"
|
||||||
[(set (match_operand:DF 0 "nonimmediate_operand" "=r,Y,r,cl,r,r,r,r,*h")
|
[(set (match_operand:DF 0 "nonimmediate_operand" "=r,Y,r,cl,r,r,r,r,*h")
|
||||||
@ -8191,7 +8151,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
nop"
|
{cror 0,0,0|nop}"
|
||||||
[(set_attr "type" "load,store,*,*,*,*,*,*,*")
|
[(set_attr "type" "load,store,*,*,*,*,*,*,*")
|
||||||
(set_attr "length" "4,4,4,4,4,8,12,16,4")])
|
(set_attr "length" "4,4,4,4,4,8,12,16,4")])
|
||||||
|
|
||||||
@ -8519,15 +8479,14 @@
|
|||||||
}")
|
}")
|
||||||
|
|
||||||
(define_insn "*movdi_internal64"
|
(define_insn "*movdi_internal64"
|
||||||
[(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,b,r,r,r,r,r,??f,f,m,r,*h,*h")
|
[(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,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
|
(match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,R,f,m,f,*h,r,0"))]
|
||||||
"TARGET_POWERPC64
|
"TARGET_POWERPC64
|
||||||
&& (gpc_reg_operand (operands[0], DImode)
|
&& (gpc_reg_operand (operands[0], DImode)
|
||||||
|| gpc_reg_operand (operands[1], DImode))"
|
|| gpc_reg_operand (operands[1], DImode))"
|
||||||
"@
|
"@
|
||||||
std%U0%X0 %1,%0
|
std%U0%X0 %1,%0
|
||||||
ld%U1%X1 %0,%1
|
ld%U1%X1 %0,%1
|
||||||
#
|
|
||||||
mr %0,%1
|
mr %0,%1
|
||||||
li %0,%1
|
li %0,%1
|
||||||
lis %0,%v1
|
lis %0,%v1
|
||||||
@ -8539,51 +8498,8 @@
|
|||||||
mf%1 %0
|
mf%1 %0
|
||||||
mt%0 %1
|
mt%0 %1
|
||||||
{cror 0,0,0|nop}"
|
{cror 0,0,0|nop}"
|
||||||
[(set_attr "type" "store,load,load,*,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*")
|
[(set_attr "type" "store,load,*,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*")
|
||||||
(set_attr "length" "4,4,8,4,4,4,20,4,4,4,4,4,4,4")])
|
(set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
|
||||||
|
|
||||||
(define_split
|
|
||||||
[(set (match_operand:DI 0 "base_reg_operand" "")
|
|
||||||
(match_operand:DI 1 "invalid_gpr_mem" ""))]
|
|
||||||
"TARGET_POWERPC64 && no_new_pseudos"
|
|
||||||
[(set (match_dup 2) (match_dup 3))
|
|
||||||
(set (match_dup 0) (match_dup 4))]
|
|
||||||
"
|
|
||||||
{
|
|
||||||
operands[2] = operands[0];
|
|
||||||
if (!TARGET_64BIT)
|
|
||||||
operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]));
|
|
||||||
operands[3] = XEXP (operands[1], 0);
|
|
||||||
operands[4] = replace_equiv_address (operands[1], operands[2]);
|
|
||||||
}")
|
|
||||||
|
|
||||||
(define_expand "reload_outdi"
|
|
||||||
[(parallel [(match_operand:DI 0 "invalid_gpr_mem" "")
|
|
||||||
(match_operand:DI 1 "register_operand" "")
|
|
||||||
(match_operand:DI 2 "register_operand" "=&b")])]
|
|
||||||
"TARGET_POWERPC64"
|
|
||||||
{
|
|
||||||
if (!TARGET_64BIT)
|
|
||||||
operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]));
|
|
||||||
emit_move_insn (operands[2], XEXP (operands[0], 0));
|
|
||||||
operands[0] = replace_equiv_address (operands[0], operands[2]);
|
|
||||||
emit_move_insn (operands[0], operands[1]);
|
|
||||||
DONE;
|
|
||||||
})
|
|
||||||
|
|
||||||
(define_expand "reload_indi"
|
|
||||||
[(parallel [(match_operand:DI 0 "register_operand" "")
|
|
||||||
(match_operand:DI 1 "invalid_gpr_mem" "")
|
|
||||||
(match_operand:DI 2 "register_operand" "=&b")])]
|
|
||||||
"TARGET_POWERPC64"
|
|
||||||
{
|
|
||||||
if (!TARGET_64BIT)
|
|
||||||
operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]));
|
|
||||||
emit_move_insn (operands[2], XEXP (operands[1], 0));
|
|
||||||
operands[1] = replace_equiv_address (operands[1], operands[2]);
|
|
||||||
emit_move_insn (operands[0], operands[1]);
|
|
||||||
DONE;
|
|
||||||
})
|
|
||||||
|
|
||||||
;; immediate value valid for a single instruction hiding in a const_double
|
;; immediate value valid for a single instruction hiding in a const_double
|
||||||
(define_insn ""
|
(define_insn ""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Target definitions for GNU compiler for PowerPC running System V.4
|
/* Target definitions for GNU compiler for PowerPC running System V.4
|
||||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||||
2004 Free Software Foundation, Inc.
|
2004, 2005 Free Software Foundation, Inc.
|
||||||
Contributed by Cygnus Support.
|
Contributed by Cygnus Support.
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
@ -123,8 +123,10 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
|
|||||||
{ "no-toc", 0, N_("no description yet") }, \
|
{ "no-toc", 0, N_("no description yet") }, \
|
||||||
{ "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
|
{ "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
|
||||||
{ "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
|
{ "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
|
||||||
{ "prototype", MASK_PROTOTYPE, N_("no description yet") }, \
|
{ "prototype", MASK_PROTOTYPE, \
|
||||||
{ "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \
|
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") }, \
|
{ "no-traceback", 0, N_("no description yet") }, \
|
||||||
{ "eabi", MASK_EABI, N_("Use EABI") }, \
|
{ "eabi", MASK_EABI, N_("Use EABI") }, \
|
||||||
{ "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \
|
{ "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \
|
||||||
@ -1354,8 +1356,6 @@ ncrtn.o%s"
|
|||||||
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
|
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
|
||||||
: DW_EH_PE_absptr)
|
: DW_EH_PE_absptr)
|
||||||
|
|
||||||
#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
|
|
||||||
|
|
||||||
#define DOUBLE_INT_ASM_OP "\t.quad\t"
|
#define DOUBLE_INT_ASM_OP "\t.quad\t"
|
||||||
|
|
||||||
/* Generate entries in .fixup for relocatable addresses. */
|
/* Generate entries in .fixup for relocatable addresses. */
|
||||||
|
@ -267,8 +267,7 @@ _mcleanup(void)
|
|||||||
* -- [eichin:19920702.1107EST]
|
* -- [eichin:19920702.1107EST]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void internal_mcount (char *, unsigned short *)
|
static void internal_mcount (char *, unsigned short *) __attribute__ ((used));
|
||||||
__attribute__ ((__unused__));
|
|
||||||
|
|
||||||
/* i7 == last ret, -> frompcindex */
|
/* i7 == last ret, -> frompcindex */
|
||||||
/* o7 == current ret, -> selfpc */
|
/* o7 == current ret, -> selfpc */
|
||||||
|
@ -3,3 +3,9 @@
|
|||||||
|
|
||||||
#undef AS_SPARC64_FLAG
|
#undef AS_SPARC64_FLAG
|
||||||
#define AS_SPARC64_FLAG "-TSO -64 -Av9"
|
#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
|
||||||
|
@ -84,7 +84,7 @@ Boston, MA 02111-1307, USA. */
|
|||||||
|
|
||||||
#undef ASM_GENERATE_INTERNAL_LABEL
|
#undef ASM_GENERATE_INTERNAL_LABEL
|
||||||
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
|
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
|
||||||
sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
|
sprintf ((LABEL), "*.L%s%lu", (PREFIX), (unsigned long)(NUM))
|
||||||
|
|
||||||
/* The native TLS-enabled assembler requires the directive #tls_object
|
/* The native TLS-enabled assembler requires the directive #tls_object
|
||||||
to be put on objects in TLS sections (as of v7.1). This is not
|
to be put on objects in TLS sections (as of v7.1). This is not
|
||||||
@ -113,6 +113,12 @@ Boston, MA 02111-1307, USA. */
|
|||||||
} \
|
} \
|
||||||
while (0)
|
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
|
||||||
|
|
||||||
|
|
||||||
#undef ENDFILE_SPEC
|
#undef ENDFILE_SPEC
|
||||||
|
@ -2946,26 +2946,34 @@ eligible_for_epilogue_delay (rtx trial, int slot)
|
|||||||
int
|
int
|
||||||
tls_call_delay (rtx trial)
|
tls_call_delay (rtx trial)
|
||||||
{
|
{
|
||||||
rtx pat, unspec;
|
rtx pat;
|
||||||
|
|
||||||
/* Binutils allows
|
/* Binutils allows
|
||||||
call __tls_get_addr, %tgd_call (foo)
|
call __tls_get_addr, %tgd_call (foo)
|
||||||
add %l7, %o0, %o0, %tgd_add (foo)
|
add %l7, %o0, %o0, %tgd_add (foo)
|
||||||
while Sun as/ld does not. */
|
while Sun as/ld does not. */
|
||||||
if (TARGET_GNU_TLS || !TARGET_TLS)
|
if (TARGET_GNU_TLS || !TARGET_TLS)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
pat = PATTERN (trial);
|
pat = PATTERN (trial);
|
||||||
if (GET_CODE (pat) != SET || GET_CODE (SET_DEST (pat)) != PLUS)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
unspec = XEXP (SET_DEST (pat), 1);
|
/* We must reject tgd_add{32|64}, i.e.
|
||||||
if (GET_CODE (unspec) != UNSPEC
|
(set (reg) (plus (reg) (unspec [(reg) (symbol_ref)] UNSPEC_TLSGD)))
|
||||||
|| (XINT (unspec, 1) != UNSPEC_TLSGD
|
and tldm_add{32|64}, i.e.
|
||||||
&& XINT (unspec, 1) != UNSPEC_TLSLDM))
|
(set (reg) (plus (reg) (unspec [(reg) (symbol_ref)] UNSPEC_TLSLDM)))
|
||||||
return 1;
|
for Sun as/ld. */
|
||||||
|
if (GET_CODE (pat) == SET
|
||||||
|
&& GET_CODE (SET_SRC (pat)) == PLUS)
|
||||||
|
{
|
||||||
|
rtx unspec = XEXP (SET_SRC (pat), 1);
|
||||||
|
|
||||||
return 0;
|
if (GET_CODE (unspec) == UNSPEC
|
||||||
|
&& (XINT (unspec, 1) == UNSPEC_TLSGD
|
||||||
|
|| XINT (unspec, 1) == UNSPEC_TLSLDM))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return nonzero if TRIAL can go into the sibling call
|
/* Return nonzero if TRIAL can go into the sibling call
|
||||||
|
@ -1892,7 +1892,7 @@ extern GTY(()) rtx sparc_compare_op1;
|
|||||||
case of a global register variable occupying more than one register
|
case of a global register variable occupying more than one register
|
||||||
we prefix the second and following registers with .gnu.part1. etc. */
|
we prefix the second and following registers with .gnu.part1. etc. */
|
||||||
|
|
||||||
extern char sparc_hard_reg_printed[8];
|
extern GTY(()) char sparc_hard_reg_printed[8];
|
||||||
|
|
||||||
#ifdef HAVE_AS_REGISTER_PSEUDO_OP
|
#ifdef HAVE_AS_REGISTER_PSEUDO_OP
|
||||||
#define ASM_DECLARE_REGISTER_GLOBAL(FILE, DECL, REGNO, NAME) \
|
#define ASM_DECLARE_REGISTER_GLOBAL(FILE, DECL, REGNO, NAME) \
|
||||||
|
39
contrib/gcc/configure
vendored
39
contrib/gcc/configure
vendored
@ -11090,6 +11090,45 @@ cat >>confdefs.h <<\_ACEOF
|
|||||||
#define HAVE_AS_EXPLICIT_RELOCS 1
|
#define HAVE_AS_EXPLICIT_RELOCS 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: checking assembler for jsrdirect relocation support" >&5
|
||||||
|
echo $ECHO_N "checking assembler for jsrdirect relocation support... $ECHO_C" >&6
|
||||||
|
if test "${gcc_cv_as_alpha_jsrdirect_relocs+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
gcc_cv_as_alpha_jsrdirect_relocs=no
|
||||||
|
if test $in_tree_gas = yes; then
|
||||||
|
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 90`
|
||||||
|
then gcc_cv_as_alpha_jsrdirect_relocs=yes
|
||||||
|
fi
|
||||||
|
elif test x$gcc_cv_as != x; then
|
||||||
|
echo ' .set nomacro
|
||||||
|
.text
|
||||||
|
ldq $27, a($29) !literal!1
|
||||||
|
jsr $26, ($27), a !lituse_jsrdirect!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_alpha_jsrdirect_relocs=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_alpha_jsrdirect_relocs" >&5
|
||||||
|
echo "${ECHO_T}$gcc_cv_as_alpha_jsrdirect_relocs" >&6
|
||||||
|
if test $gcc_cv_as_alpha_jsrdirect_relocs = yes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define HAVE_AS_JSRDIRECT_RELOCS 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -2327,6 +2327,14 @@ case "$target" in
|
|||||||
lda $29, 0($29) !gpdisp!3],,
|
lda $29, 0($29) !gpdisp!3],,
|
||||||
[AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
|
[AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
|
||||||
[Define if your assembler supports explicit relocations.])])
|
[Define if your assembler supports explicit relocations.])])
|
||||||
|
gcc_GAS_CHECK_FEATURE([jsrdirect relocation support],
|
||||||
|
gcc_cv_as_alpha_jsrdirect_relocs, [2,16,90],,
|
||||||
|
[ .set nomacro
|
||||||
|
.text
|
||||||
|
ldq $27, a($29) !literal!1
|
||||||
|
jsr $26, ($27), a !lituse_jsrdirect!1],,
|
||||||
|
[AC_DEFINE(HAVE_AS_JSRDIRECT_RELOCS, 1,
|
||||||
|
[Define if your assembler supports the lituse_jsrdirect relocation.])])
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cris-*-*)
|
cris-*-*)
|
||||||
|
@ -172,8 +172,8 @@ read_counts_file (void)
|
|||||||
GCOV_UNSIGNED2STRING (v, tag);
|
GCOV_UNSIGNED2STRING (v, tag);
|
||||||
GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
|
GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
|
||||||
|
|
||||||
warning ("`%s' is version `%.4s', expected version `%.4s'",
|
warning ("`%s' is version `%.*s', expected version `%.*s'",
|
||||||
da_file_name, v, e);
|
da_file_name, 4, v, 4, e);
|
||||||
gcov_close ();
|
gcov_close ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,466 @@
|
|||||||
|
2006-03-05 Release Manager
|
||||||
|
|
||||||
|
* GCC 3.4.6 released.
|
||||||
|
|
||||||
|
2006-02-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/26291
|
||||||
|
* decl.c (grok_op_properties): Check for ellipsis in arguments of
|
||||||
|
operators.
|
||||||
|
|
||||||
|
2006-02-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/26070
|
||||||
|
* decl.c (grokdeclarator): Clear RID_STATIC together with staticp.
|
||||||
|
|
||||||
|
2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-12-22 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
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-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-12-19 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/24915
|
||||||
|
* class.c (add_method): Do not treat templates as identical unless
|
||||||
|
their return types are the same.
|
||||||
|
|
||||||
|
2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-12-19 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/24278
|
||||||
|
* init.c (expand_member_init): Print messages about baseclasses
|
||||||
|
using %T rather than %D.
|
||||||
|
|
||||||
|
2006-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/16829
|
||||||
|
* decl.c (start_preparsed_function): Check default arguments
|
||||||
|
unconditionally.
|
||||||
|
* name-lookup.c (pushdecl_maybe_friend): Check default arguments
|
||||||
|
of all functions and function templates.
|
||||||
|
* parser.c (cp_parser_late_parsing_default_args): Check default
|
||||||
|
arguments.
|
||||||
|
* decl2.c (check_default_args): Set missing default arguments to
|
||||||
|
error_mark_node.
|
||||||
|
|
||||||
|
2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/25854
|
||||||
|
* pt.c (maybe_process_partial_specialization): Return early on
|
||||||
|
error_mark_node.
|
||||||
|
|
||||||
|
2005-12-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/20552
|
||||||
|
Backport:
|
||||||
|
2004-03-08 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* decl.c (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
|
||||||
|
|
||||||
|
2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
2005-12-07 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-10-20 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/22618
|
||||||
|
* search.c (accessible_p): Check access in the outermost set of
|
||||||
|
template parameters.
|
||||||
|
|
||||||
|
2005-12-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/21383
|
||||||
|
* name-lookup.c (arg_assoc): Template args can be null in a
|
||||||
|
template-id-expr.
|
||||||
|
|
||||||
|
2005-12-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-10-13 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
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-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-10-13 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/22464
|
||||||
|
* semantics.c (finish_id_expression): Issue errors about uses of
|
||||||
|
local variables in containing functions even in templates.
|
||||||
|
|
||||||
|
2005-12-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2005-10-13 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/23307
|
||||||
|
* pt.c (push_template_decl_real): Complain about attempts to
|
||||||
|
declare template variables.
|
||||||
|
|
||||||
|
2005-11-30 Release Manager
|
||||||
|
|
||||||
|
* GCC 3.4.5 released.
|
||||||
|
|
||||||
|
2005-11-23 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/21983
|
||||||
|
* class.c (find_final_overrider): Move diagnostic about no unique final
|
||||||
|
overrider to...
|
||||||
|
(update_vtable_entry_for_fn): ... here.
|
||||||
|
|
||||||
|
2005-11-15 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/24580
|
||||||
|
* method.c (locate_copy): Also use skip_artificial_parms here.
|
||||||
|
(synthesize_exception_spec): Use CLASS_TYPE_P rather than checking
|
||||||
|
for RECORD_TYPE.
|
||||||
|
|
||||||
|
2005-11-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport from mainline:
|
||||||
|
2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/23797
|
||||||
|
* parser.c (cp_parser_functional_cast): Cope when TYPE is not a
|
||||||
|
TYPE_DECL. Use dependent_type_p to check type.
|
||||||
|
* pt.c (uses_template_parms_p): Use dependent_type_p for a
|
||||||
|
TYPE_DECL.
|
||||||
|
(type_dependent_expression_p): Assert we've not been given a
|
||||||
|
TYPE_DECL.
|
||||||
|
|
||||||
|
2005-11-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/19253
|
||||||
|
PR c++/22172
|
||||||
|
Backport from mainline:
|
||||||
|
2005-11-02 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* 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 <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/24580
|
||||||
|
* method.c (locate_ctor): Skip all artificial parms, not just
|
||||||
|
'this'.
|
||||||
|
|
||||||
|
2005-10-28 Josh Conner <jconner@apple.com>
|
||||||
|
|
||||||
|
PR c++/22153
|
||||||
|
* parser.c (cp_parser_member_declaration): Detect and handle
|
||||||
|
a template specialization.
|
||||||
|
|
||||||
|
2005-10-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/22508
|
||||||
|
* init.c (build_new_1): Remove misleading comment.
|
||||||
|
|
||||||
|
2005-10-12 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
|
PR c++/24052
|
||||||
|
* error.c (dump_expr): Pass LABEL_DECL to dump_decl. Print
|
||||||
|
an ADDR_EXPR of a LABEL_DECL as &&.
|
||||||
|
|
||||||
|
2005-10-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
2004-09-23 Andrew Pinski <pinskia@physics.uc.edu>
|
||||||
|
PR c++/17618
|
||||||
|
* cvt.c (cp_convert_to_pointer): Return early when the type is
|
||||||
|
an error_mark_node.
|
||||||
|
|
||||||
|
2004-05-22 Roger Sayle <roger@eyesopen.com>
|
||||||
|
* 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-11-02 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/18177
|
||||||
|
* typeck.c (build_const_cast): Use error_operand_p.
|
||||||
|
|
||||||
|
2005-10-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
* call.c (resolve_args): Remove redundant test.
|
||||||
|
|
||||||
|
2005-09-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
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 <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/17609
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-03-08 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
* 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-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-11-27 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/18803
|
||||||
|
Revert:
|
||||||
|
|
||||||
|
2005-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
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-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-12-14 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2005-08-26 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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.
|
||||||
|
|
||||||
|
2005-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
2005-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-11-25 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-11-25 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-11-27 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/18512
|
||||||
|
* parser.c (cp_parser_postfix_expression): Robustify.
|
||||||
|
|
||||||
|
2005-09-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-11-25 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/18545
|
||||||
|
* typeck.c (check_return_expr): Robustify.
|
||||||
|
|
||||||
|
2005-09-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2005-02-22 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/20153
|
||||||
|
* decl2.c (build_anon_union_vars): Add type parameter.
|
||||||
|
(finish_anon_union): Pass it.
|
||||||
|
|
||||||
|
2005-07-28 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/22545
|
||||||
|
* call.c (add_builtin_candidate): Adjust for changes in
|
||||||
|
representation of pointer-to-member types.
|
||||||
|
|
||||||
|
2005-09-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/13377
|
||||||
|
* parser.c (cp_parser_lookup_name): Pass LOOKUP_COMPLAIN to
|
||||||
|
lookup_name_real on final parse.
|
||||||
|
|
||||||
|
2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
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 <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/23639
|
||||||
|
* semantics.c (qualified_name_lookup_error): Do not complain again
|
||||||
|
on invalid scope.
|
||||||
|
|
||||||
|
2005-07-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||||
|
|
||||||
|
Backport:
|
||||||
|
|
||||||
|
2004-09-16 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
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.
|
||||||
|
|
||||||
|
2005-06-17 Geoffrey Keating <geoffk@apple.com>
|
||||||
|
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 <mark@codesourcery.com>
|
||||||
|
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.
|
||||||
|
|
||||||
|
2004-12-21 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
PR c++/18378
|
||||||
|
* call.c (convert_like_real): Do not permit the use of a copy
|
||||||
|
constructor to copy a packed field.
|
||||||
|
|
||||||
|
2005-07-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR c++/19208
|
||||||
|
* pt.c (tsubst): Use fold_non_dependent_expr to fold array domains.
|
||||||
|
|
||||||
|
2005-06-14 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/21987
|
||||||
|
* decl.c (grok_op_properties): Add missing warn_conversion check.
|
||||||
|
|
||||||
|
2005-06-13 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/20789
|
||||||
|
* decl.c (cp_finish_decl): Clear runtime runtime initialization if
|
||||||
|
in-class decl's initializer is bad.
|
||||||
|
|
||||||
|
2005-06-10 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
|
PR c++/10611
|
||||||
|
* cvt.c (build_expr_type_conversion): Same.
|
||||||
|
* 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 <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
2005-06-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/20563
|
||||||
|
* parser.c (cp_parser_label_declaration): Deal with invalid/missing
|
||||||
|
identifiers.
|
||||||
|
|
||||||
|
2005-06-03 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
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 <mark@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/21336
|
||||||
|
* cp-tree.h (grok_op_properties): Remove friendp parameter.
|
||||||
|
* decl.c (grokfndecl): Adjust call.
|
||||||
|
(grok_op_properties): Determine the class of which the function is
|
||||||
|
a member by looking at its DECL_CONTEXT, not current_class_type.
|
||||||
|
* pt.c (tsubst_decl): Adjust call to grok_op_properties.
|
||||||
|
|
||||||
|
2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
|
PR c++/21768
|
||||||
|
* pt.c (redeclare_class_template): Change error message according
|
||||||
|
to coding conventions.
|
||||||
|
|
||||||
2005-05-19 Release Manager
|
2005-05-19 Release Manager
|
||||||
|
|
||||||
* GCC 3.4.4 released.
|
* GCC 3.4.4 released.
|
||||||
|
@ -1556,7 +1556,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
|
|||||||
|
|
||||||
if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1)
|
if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1)
|
||||||
&& (TYPE_PTRMEMFUNC_P (type2)
|
&& (TYPE_PTRMEMFUNC_P (type2)
|
||||||
|| is_complete (TREE_TYPE (TREE_TYPE (type2)))))
|
|| is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2))))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -2544,7 +2544,7 @@ resolve_args (tree args)
|
|||||||
{
|
{
|
||||||
tree arg = TREE_VALUE (t);
|
tree arg = TREE_VALUE (t);
|
||||||
|
|
||||||
if (arg == error_mark_node)
|
if (error_operand_p (arg))
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
else if (VOID_TYPE_P (TREE_TYPE (arg)))
|
else if (VOID_TYPE_P (TREE_TYPE (arg)))
|
||||||
{
|
{
|
||||||
@ -4080,13 +4080,12 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
|
|||||||
if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr))
|
if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr))
|
||||||
{
|
{
|
||||||
tree type = TREE_TYPE (TREE_OPERAND (convs, 0));
|
tree type = TREE_TYPE (TREE_OPERAND (convs, 0));
|
||||||
|
cp_lvalue_kind lvalue = real_lvalue_p (expr);
|
||||||
|
|
||||||
if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)))
|
if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)))
|
||||||
{
|
{
|
||||||
/* If the reference is volatile or non-const, we
|
/* If the reference is volatile or non-const, we
|
||||||
cannot create a temporary. */
|
cannot create a temporary. */
|
||||||
cp_lvalue_kind lvalue = real_lvalue_p (expr);
|
|
||||||
|
|
||||||
if (lvalue & clk_bitfield)
|
if (lvalue & clk_bitfield)
|
||||||
error ("cannot bind bitfield `%E' to `%T'",
|
error ("cannot bind bitfield `%E' to `%T'",
|
||||||
expr, ref_type);
|
expr, ref_type);
|
||||||
@ -4097,6 +4096,20 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
|
|||||||
error ("cannot bind rvalue `%E' to `%T'", expr, ref_type);
|
error ("cannot bind rvalue `%E' to `%T'", expr, ref_type);
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
|
/* If the source is a packed field, and we must use a copy
|
||||||
|
constructor, then building the target expr will require
|
||||||
|
binding the field to the reference parameter to the
|
||||||
|
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)
|
||||||
|
&& !TYPE_HAS_TRIVIAL_INIT_REF (type))
|
||||||
|
{
|
||||||
|
error ("cannot bind packed field `%E' to `%T'",
|
||||||
|
expr, ref_type);
|
||||||
|
return error_mark_node;
|
||||||
|
}
|
||||||
expr = build_target_expr_with_type (expr, type);
|
expr = build_target_expr_with_type (expr, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,9 +879,10 @@ add_method (tree type, tree method, int error_p)
|
|||||||
fns = OVL_NEXT (fns))
|
fns = OVL_NEXT (fns))
|
||||||
{
|
{
|
||||||
tree fn = OVL_CURRENT (fns);
|
tree fn = OVL_CURRENT (fns);
|
||||||
|
tree fn_type;
|
||||||
|
tree method_type;
|
||||||
tree parms1;
|
tree parms1;
|
||||||
tree parms2;
|
tree parms2;
|
||||||
bool same = 1;
|
|
||||||
|
|
||||||
if (TREE_CODE (fn) != TREE_CODE (method))
|
if (TREE_CODE (fn) != TREE_CODE (method))
|
||||||
continue;
|
continue;
|
||||||
@ -896,8 +897,10 @@ add_method (tree type, tree method, int error_p)
|
|||||||
functions in the derived class override and/or hide member
|
functions in the derived class override and/or hide member
|
||||||
functions with the same name and parameter types in a base
|
functions with the same name and parameter types in a base
|
||||||
class (rather than conflicting). */
|
class (rather than conflicting). */
|
||||||
parms1 = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
fn_type = TREE_TYPE (fn);
|
||||||
parms2 = TYPE_ARG_TYPES (TREE_TYPE (method));
|
method_type = TREE_TYPE (method);
|
||||||
|
parms1 = TYPE_ARG_TYPES (fn_type);
|
||||||
|
parms2 = TYPE_ARG_TYPES (method_type);
|
||||||
|
|
||||||
/* Compare the quals on the 'this' parm. Don't compare
|
/* Compare the quals on the 'this' parm. Don't compare
|
||||||
the whole types, as used functions are treated as
|
the whole types, as used functions are treated as
|
||||||
@ -906,23 +909,25 @@ add_method (tree type, tree method, int error_p)
|
|||||||
&& ! DECL_STATIC_FUNCTION_P (method)
|
&& ! DECL_STATIC_FUNCTION_P (method)
|
||||||
&& (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
|
&& (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
|
||||||
!= TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
|
!= TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
|
||||||
same = 0;
|
continue;
|
||||||
|
|
||||||
/* For templates, the template parms must be identical. */
|
/* For templates, the template parms must be identical. */
|
||||||
if (TREE_CODE (fn) == TEMPLATE_DECL
|
if (TREE_CODE (fn) == TEMPLATE_DECL
|
||||||
&& !comp_template_parms (DECL_TEMPLATE_PARMS (fn),
|
&& (!same_type_p (TREE_TYPE (fn_type),
|
||||||
DECL_TEMPLATE_PARMS (method)))
|
TREE_TYPE (method_type))
|
||||||
same = 0;
|
|| !comp_template_parms (DECL_TEMPLATE_PARMS (fn),
|
||||||
|
DECL_TEMPLATE_PARMS (method))))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (! DECL_STATIC_FUNCTION_P (fn))
|
if (! DECL_STATIC_FUNCTION_P (fn))
|
||||||
parms1 = TREE_CHAIN (parms1);
|
parms1 = TREE_CHAIN (parms1);
|
||||||
if (! DECL_STATIC_FUNCTION_P (method))
|
if (! DECL_STATIC_FUNCTION_P (method))
|
||||||
parms2 = TREE_CHAIN (parms2);
|
parms2 = TREE_CHAIN (parms2);
|
||||||
|
|
||||||
if (same && compparms (parms1, parms2)
|
if (compparms (parms1, parms2)
|
||||||
&& (!DECL_CONV_FN_P (fn)
|
&& (!DECL_CONV_FN_P (fn)
|
||||||
|| same_type_p (TREE_TYPE (TREE_TYPE (fn)),
|
|| same_type_p (TREE_TYPE (fn_type),
|
||||||
TREE_TYPE (TREE_TYPE (method)))))
|
TREE_TYPE (method_type))))
|
||||||
{
|
{
|
||||||
if (using && DECL_CONTEXT (fn) == type)
|
if (using && DECL_CONTEXT (fn) == type)
|
||||||
/* Defer to the local function. */
|
/* Defer to the local function. */
|
||||||
@ -2035,11 +2040,7 @@ find_final_overrider (tree derived, tree binfo, tree fn)
|
|||||||
|
|
||||||
/* If there was no winner, issue an error message. */
|
/* If there was no winner, issue an error message. */
|
||||||
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
|
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
|
||||||
{
|
return error_mark_node;
|
||||||
error ("no unique final overrider for `%D' in `%T'", fn,
|
|
||||||
BINFO_TYPE (derived));
|
|
||||||
return error_mark_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ffod.candidates;
|
return ffod.candidates;
|
||||||
}
|
}
|
||||||
@ -2099,7 +2100,10 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
|
|||||||
/* Find the final overrider. */
|
/* Find the final overrider. */
|
||||||
overrider = find_final_overrider (TYPE_BINFO (t), b, target_fn);
|
overrider = find_final_overrider (TYPE_BINFO (t), b, target_fn);
|
||||||
if (overrider == error_mark_node)
|
if (overrider == error_mark_node)
|
||||||
return;
|
{
|
||||||
|
error ("no unique final overrider for `%D' in `%T'", target_fn, t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
overrider_target = overrider_fn = TREE_PURPOSE (overrider);
|
overrider_target = overrider_fn = TREE_PURPOSE (overrider);
|
||||||
|
|
||||||
/* Check for adjusting covariant return types. */
|
/* Check for adjusting covariant return types. */
|
||||||
|
@ -203,7 +203,9 @@ DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
|
|||||||
/* A using directive. The operand is USING_STMT_NAMESPACE. */
|
/* A using directive. The operand is USING_STMT_NAMESPACE. */
|
||||||
DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
|
DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
|
||||||
|
|
||||||
/* An un-parsed default argument. Looks like an IDENTIFIER_NODE. */
|
/* 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)
|
DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 0)
|
||||||
|
|
||||||
/* A template-id, like foo<int>. The first operand is the template.
|
/* A template-id, like foo<int>. The first operand is the template.
|
||||||
|
@ -3683,7 +3683,7 @@ extern int copy_fn_p (tree);
|
|||||||
extern tree get_scope_of_declarator (tree);
|
extern tree get_scope_of_declarator (tree);
|
||||||
extern void grok_special_member_properties (tree);
|
extern void grok_special_member_properties (tree);
|
||||||
extern int grok_ctor_properties (tree, tree);
|
extern int grok_ctor_properties (tree, tree);
|
||||||
extern bool grok_op_properties (tree, int, bool);
|
extern bool grok_op_properties (tree, bool);
|
||||||
extern tree xref_tag (enum tag_types, tree, bool, bool);
|
extern tree xref_tag (enum tag_types, tree, bool, bool);
|
||||||
extern tree xref_tag_from_type (tree, tree, int);
|
extern tree xref_tag_from_type (tree, tree, int);
|
||||||
extern void xref_basetypes (tree, tree);
|
extern void xref_basetypes (tree, tree);
|
||||||
|
@ -79,6 +79,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
|||||||
tree intype = TREE_TYPE (expr);
|
tree intype = TREE_TYPE (expr);
|
||||||
enum tree_code form;
|
enum tree_code form;
|
||||||
tree rval;
|
tree rval;
|
||||||
|
if (intype == error_mark_node)
|
||||||
|
return error_mark_node;
|
||||||
|
|
||||||
if (IS_AGGR_TYPE (intype))
|
if (IS_AGGR_TYPE (intype))
|
||||||
{
|
{
|
||||||
@ -1029,6 +1031,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
|
|||||||
return expr;
|
return expr;
|
||||||
/* else fall through... */
|
/* else fall through... */
|
||||||
|
|
||||||
|
case VECTOR_TYPE:
|
||||||
case BOOLEAN_TYPE:
|
case BOOLEAN_TYPE:
|
||||||
return (desires & WANT_INT) ? expr : NULL_TREE;
|
return (desires & WANT_INT) ? expr : NULL_TREE;
|
||||||
case ENUMERAL_TYPE:
|
case ENUMERAL_TYPE:
|
||||||
|
@ -1380,10 +1380,7 @@ duplicate_decls (tree newdecl, tree olddecl)
|
|||||||
else
|
else
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* Already complained about this, so don't do so again. */
|
|
||||||
else if (current_class_type == NULL_TREE
|
|
||||||
|| IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
|
|
||||||
{
|
{
|
||||||
error ("conflicting declaration '%#D'", newdecl);
|
error ("conflicting declaration '%#D'", newdecl);
|
||||||
cp_error_at ("'%D' has a previous declaration as `%#D'",
|
cp_error_at ("'%D' has a previous declaration as `%#D'",
|
||||||
@ -2647,16 +2644,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
|
|||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802);
|
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802);
|
||||||
|
my_friendly_assert (TYPE_P (context), 20050905);
|
||||||
if (TREE_CODE (context) == NAMESPACE_DECL)
|
|
||||||
{
|
|
||||||
/* We can get here from typename_sub0 in the explicit_template_type
|
|
||||||
expansion. Just fail. */
|
|
||||||
if (complain & tf_error)
|
|
||||||
error ("no class template named `%#T' in `%#T'",
|
|
||||||
name, context);
|
|
||||||
return error_mark_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dependent_type_p (context)
|
if (!dependent_type_p (context)
|
||||||
|| currently_open_class (context))
|
|| currently_open_class (context))
|
||||||
@ -4919,6 +4907,16 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
|
|||||||
"initialized", decl);
|
"initialized", decl);
|
||||||
init = NULL_TREE;
|
init = NULL_TREE;
|
||||||
}
|
}
|
||||||
|
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"
|
||||||
|
" when being declared", decl);
|
||||||
|
DECL_INITIALIZED_IN_CLASS_P (decl) = 0;
|
||||||
|
init = NULL_TREE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle:
|
/* Handle:
|
||||||
|
|
||||||
[dcl.init]
|
[dcl.init]
|
||||||
@ -5718,7 +5716,7 @@ grokfndecl (tree ctype,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IDENTIFIER_OPNAME_P (DECL_NAME (decl)))
|
if (IDENTIFIER_OPNAME_P (DECL_NAME (decl)))
|
||||||
grok_op_properties (decl, friendp, /*complain=*/true);
|
grok_op_properties (decl, /*complain=*/true);
|
||||||
|
|
||||||
if (ctype && decl_function_context (decl))
|
if (ctype && decl_function_context (decl))
|
||||||
DECL_NO_STATIC_CHAIN (decl) = 1;
|
DECL_NO_STATIC_CHAIN (decl) = 1;
|
||||||
@ -5893,6 +5891,7 @@ grokvardecl (tree type,
|
|||||||
tree scope)
|
tree scope)
|
||||||
{
|
{
|
||||||
tree decl;
|
tree decl;
|
||||||
|
tree explicit_scope;
|
||||||
RID_BIT_TYPE specbits;
|
RID_BIT_TYPE specbits;
|
||||||
|
|
||||||
my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE,
|
my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE,
|
||||||
@ -5900,7 +5899,9 @@ grokvardecl (tree type,
|
|||||||
|
|
||||||
specbits = *specbits_in;
|
specbits = *specbits_in;
|
||||||
|
|
||||||
/* Compute the scope in which to place the variable. */
|
/* Compute the scope in which to place the variable, but remember
|
||||||
|
whether or not that scope was explicitly specified by the user. */
|
||||||
|
explicit_scope = scope;
|
||||||
if (!scope)
|
if (!scope)
|
||||||
{
|
{
|
||||||
/* An explicit "extern" specifier indicates a namespace-scope
|
/* An explicit "extern" specifier indicates a namespace-scope
|
||||||
@ -5929,8 +5930,8 @@ grokvardecl (tree type,
|
|||||||
else
|
else
|
||||||
decl = build_decl (VAR_DECL, name, type);
|
decl = build_decl (VAR_DECL, name, type);
|
||||||
|
|
||||||
if (scope && TREE_CODE (scope) == NAMESPACE_DECL)
|
if (explicit_scope && TREE_CODE (explicit_scope) == NAMESPACE_DECL)
|
||||||
set_decl_namespace (decl, scope, 0);
|
set_decl_namespace (decl, explicit_scope, 0);
|
||||||
else
|
else
|
||||||
DECL_CONTEXT (decl) = scope;
|
DECL_CONTEXT (decl) = scope;
|
||||||
|
|
||||||
@ -7187,8 +7188,8 @@ grokdeclarator (tree declarator,
|
|||||||
|
|
||||||
if (virtualp && staticp == 2)
|
if (virtualp && staticp == 2)
|
||||||
{
|
{
|
||||||
error ("member `%D' cannot be declared both virtual and static",
|
error ("member `%D' cannot be declared both virtual and static", dname);
|
||||||
dname);
|
RIDBIT_RESET (RID_STATIC, specbits);
|
||||||
staticp = 0;
|
staticp = 0;
|
||||||
}
|
}
|
||||||
friendp = RIDBIT_SETP (RID_FRIEND, specbits);
|
friendp = RIDBIT_SETP (RID_FRIEND, specbits);
|
||||||
@ -9004,7 +9005,7 @@ unary_op_p (enum tree_code code)
|
|||||||
errors are issued for invalid declarations. */
|
errors are issued for invalid declarations. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
grok_op_properties (tree decl, int friendp, bool complain)
|
grok_op_properties (tree decl, bool complain)
|
||||||
{
|
{
|
||||||
tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl));
|
tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl));
|
||||||
tree argtype;
|
tree argtype;
|
||||||
@ -9012,20 +9013,24 @@ grok_op_properties (tree decl, int friendp, bool complain)
|
|||||||
tree name = DECL_NAME (decl);
|
tree name = DECL_NAME (decl);
|
||||||
enum tree_code operator_code;
|
enum tree_code operator_code;
|
||||||
int arity;
|
int arity;
|
||||||
|
bool ellipsis_p;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
tree class_type;
|
||||||
|
|
||||||
/* Assume that the declaration is valid. */
|
/* Assume that the declaration is valid. */
|
||||||
ok = true;
|
ok = true;
|
||||||
|
|
||||||
/* Count the number of arguments. */
|
/* Count the number of arguments. and check for ellipsis */
|
||||||
for (argtype = argtypes, arity = 0;
|
for (argtype = argtypes, arity = 0;
|
||||||
argtype && argtype != void_list_node;
|
argtype && argtype != void_list_node;
|
||||||
argtype = TREE_CHAIN (argtype))
|
argtype = TREE_CHAIN (argtype))
|
||||||
++arity;
|
++arity;
|
||||||
|
ellipsis_p = !argtype;
|
||||||
|
|
||||||
if (current_class_type == NULL_TREE)
|
class_type = DECL_CONTEXT (decl);
|
||||||
friendp = 1;
|
if (class_type && !CLASS_TYPE_P (class_type))
|
||||||
|
class_type = NULL_TREE;
|
||||||
|
|
||||||
if (DECL_CONV_FN_P (decl))
|
if (DECL_CONV_FN_P (decl))
|
||||||
operator_code = TYPE_EXPR;
|
operator_code = TYPE_EXPR;
|
||||||
else
|
else
|
||||||
@ -9053,30 +9058,28 @@ grok_op_properties (tree decl, int friendp, bool complain)
|
|||||||
my_friendly_assert (operator_code != LAST_CPLUS_TREE_CODE, 20000526);
|
my_friendly_assert (operator_code != LAST_CPLUS_TREE_CODE, 20000526);
|
||||||
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
|
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
|
||||||
|
|
||||||
if (! friendp)
|
if (class_type)
|
||||||
{
|
switch (operator_code)
|
||||||
switch (operator_code)
|
{
|
||||||
{
|
case NEW_EXPR:
|
||||||
case NEW_EXPR:
|
TYPE_HAS_NEW_OPERATOR (class_type) = 1;
|
||||||
TYPE_HAS_NEW_OPERATOR (current_class_type) = 1;
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case DELETE_EXPR:
|
case DELETE_EXPR:
|
||||||
TYPE_GETS_DELETE (current_class_type) |= 1;
|
TYPE_GETS_DELETE (class_type) |= 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEC_NEW_EXPR:
|
case VEC_NEW_EXPR:
|
||||||
TYPE_HAS_ARRAY_NEW_OPERATOR (current_class_type) = 1;
|
TYPE_HAS_ARRAY_NEW_OPERATOR (class_type) = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEC_DELETE_EXPR:
|
case VEC_DELETE_EXPR:
|
||||||
TYPE_GETS_DELETE (current_class_type) |= 2;
|
TYPE_GETS_DELETE (class_type) |= 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (operator_code == NEW_EXPR || operator_code == VEC_NEW_EXPR)
|
if (operator_code == NEW_EXPR || operator_code == VEC_NEW_EXPR)
|
||||||
TREE_TYPE (decl) = coerce_new_type (TREE_TYPE (decl));
|
TREE_TYPE (decl) = coerce_new_type (TREE_TYPE (decl));
|
||||||
@ -9130,37 +9133,46 @@ grok_op_properties (tree decl, int friendp, bool complain)
|
|||||||
if (operator_code == CALL_EXPR)
|
if (operator_code == CALL_EXPR)
|
||||||
return ok;
|
return ok;
|
||||||
|
|
||||||
if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl))
|
/* Warn about conversion operators that will never be used. */
|
||||||
|
if (IDENTIFIER_TYPENAME_P (name)
|
||||||
|
&& ! DECL_TEMPLATE_INFO (decl)
|
||||||
|
&& warn_conversion
|
||||||
|
/* Warn only declaring the function; there is no need to
|
||||||
|
warn again about out-of-class definitions. */
|
||||||
|
&& class_type == current_class_type)
|
||||||
{
|
{
|
||||||
tree t = TREE_TYPE (name);
|
tree t = TREE_TYPE (name);
|
||||||
if (! friendp)
|
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)
|
||||||
{
|
{
|
||||||
int ref = (TREE_CODE (t) == REFERENCE_TYPE);
|
if (t == class_type)
|
||||||
const char *what = 0;
|
|
||||||
|
|
||||||
if (ref)
|
|
||||||
t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
|
|
||||||
|
|
||||||
if (TREE_CODE (t) == VOID_TYPE)
|
|
||||||
what = "void";
|
|
||||||
else if (t == current_class_type)
|
|
||||||
what = "the same type";
|
what = "the same type";
|
||||||
/* Don't force t to be complete here. */
|
/* Don't force t to be complete here. */
|
||||||
else if (IS_AGGR_TYPE (t)
|
else if (IS_AGGR_TYPE (t)
|
||||||
&& COMPLETE_TYPE_P (t)
|
&& COMPLETE_TYPE_P (t)
|
||||||
&& DERIVED_FROM_P (t, current_class_type))
|
&& DERIVED_FROM_P (t, class_type))
|
||||||
what = "a base class";
|
what = "a base class";
|
||||||
|
|
||||||
if (what && warn_conversion)
|
|
||||||
warning ("conversion to %s%s will never use a type conversion operator",
|
|
||||||
ref ? "a reference to " : "", what);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (what)
|
||||||
|
warning ("conversion to %s%s will never use a type conversion operator",
|
||||||
|
ref ? "a reference to " : "", what);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operator_code == COND_EXPR)
|
if (operator_code == COND_EXPR)
|
||||||
{
|
{
|
||||||
/* 13.4.0.3 */
|
/* 13.4.0.3 */
|
||||||
error ("ISO C++ prohibits overloading operator ?:");
|
error ("ISO C++ prohibits overloading operator ?:");
|
||||||
}
|
}
|
||||||
|
else if (ellipsis_p)
|
||||||
|
error ("`%D' must not have variable number of arguments", decl);
|
||||||
else if (ambi_op_p (operator_code))
|
else if (ambi_op_p (operator_code))
|
||||||
{
|
{
|
||||||
if (arity == 1)
|
if (arity == 1)
|
||||||
@ -9325,9 +9337,11 @@ tag_name (enum tag_types code)
|
|||||||
case class_type:
|
case class_type:
|
||||||
return "class";
|
return "class";
|
||||||
case union_type:
|
case union_type:
|
||||||
return "union ";
|
return "union";
|
||||||
case enum_type:
|
case enum_type:
|
||||||
return "enum";
|
return "enum";
|
||||||
|
case typename_type:
|
||||||
|
return "typename";
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
@ -9365,7 +9379,8 @@ check_elaborated_type_specifier (enum tag_types tag_code,
|
|||||||
In other words, the only legitimate declaration to use in the
|
In other words, the only legitimate declaration to use in the
|
||||||
elaborated type specifier is the implicit typedef created when
|
elaborated type specifier is the implicit typedef created when
|
||||||
the type is declared. */
|
the type is declared. */
|
||||||
if (!DECL_IMPLICIT_TYPEDEF_P (decl))
|
if (!DECL_IMPLICIT_TYPEDEF_P (decl)
|
||||||
|
&& tag_code != typename_type)
|
||||||
{
|
{
|
||||||
error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code));
|
error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code));
|
||||||
return IS_AGGR_TYPE (type) ? type : error_mark_node;
|
return IS_AGGR_TYPE (type) ? type : error_mark_node;
|
||||||
@ -9379,7 +9394,8 @@ check_elaborated_type_specifier (enum tag_types tag_code,
|
|||||||
}
|
}
|
||||||
else if (TREE_CODE (type) != RECORD_TYPE
|
else if (TREE_CODE (type) != RECORD_TYPE
|
||||||
&& TREE_CODE (type) != UNION_TYPE
|
&& TREE_CODE (type) != UNION_TYPE
|
||||||
&& tag_code != enum_type)
|
&& tag_code != enum_type
|
||||||
|
&& tag_code != typename_type)
|
||||||
{
|
{
|
||||||
error ("`%T' referred to as `%s'", type, tag_name (tag_code));
|
error ("`%T' referred to as `%s'", type, tag_name (tag_code));
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
@ -10301,7 +10317,11 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
|
|||||||
class scope, current_class_type will be NULL_TREE until set above
|
class scope, current_class_type will be NULL_TREE until set above
|
||||||
by push_nested_class.) */
|
by push_nested_class.) */
|
||||||
if (processing_template_decl)
|
if (processing_template_decl)
|
||||||
decl1 = push_template_decl (decl1);
|
{
|
||||||
|
tree newdecl1 = push_template_decl (decl1);
|
||||||
|
if (newdecl1 != error_mark_node)
|
||||||
|
decl1 = newdecl1;
|
||||||
|
}
|
||||||
|
|
||||||
/* We are now in the scope of the function being defined. */
|
/* We are now in the scope of the function being defined. */
|
||||||
current_function_decl = decl1;
|
current_function_decl = decl1;
|
||||||
@ -10315,6 +10335,8 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
|
|||||||
must be complete when you define the function. */
|
must be complete when you define the function. */
|
||||||
if (! processing_template_decl)
|
if (! processing_template_decl)
|
||||||
check_function_type (decl1, current_function_parms);
|
check_function_type (decl1, current_function_parms);
|
||||||
|
/* Make sure no default arg is missing. */
|
||||||
|
check_default_args (decl1);
|
||||||
|
|
||||||
/* Build the return declaration for the function. */
|
/* Build the return declaration for the function. */
|
||||||
restype = TREE_TYPE (fntype);
|
restype = TREE_TYPE (fntype);
|
||||||
@ -10378,8 +10400,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
|
|||||||
/* We need to set the DECL_CONTEXT. */
|
/* We need to set the DECL_CONTEXT. */
|
||||||
if (!DECL_CONTEXT (decl1) && DECL_TEMPLATE_INFO (decl1))
|
if (!DECL_CONTEXT (decl1) && DECL_TEMPLATE_INFO (decl1))
|
||||||
DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1));
|
DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1));
|
||||||
/* And make sure we have enough default args. */
|
|
||||||
check_default_args (decl1);
|
|
||||||
}
|
}
|
||||||
fntype = TREE_TYPE (decl1);
|
fntype = TREE_TYPE (decl1);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ typedef struct priority_info_s {
|
|||||||
static void mark_vtable_entries (tree);
|
static void mark_vtable_entries (tree);
|
||||||
static void grok_function_init (tree, tree);
|
static void grok_function_init (tree, tree);
|
||||||
static bool maybe_emit_vtables (tree);
|
static bool maybe_emit_vtables (tree);
|
||||||
static tree build_anon_union_vars (tree);
|
|
||||||
static bool acceptable_java_type (tree);
|
static bool acceptable_java_type (tree);
|
||||||
static tree start_objects (int, int);
|
static tree start_objects (int, int);
|
||||||
static void finish_objects (int, int, tree);
|
static void finish_objects (int, int, tree);
|
||||||
@ -1131,14 +1130,13 @@ defer_fn (tree fn)
|
|||||||
VARRAY_PUSH_TREE (deferred_fns, fn);
|
VARRAY_PUSH_TREE (deferred_fns, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Walks through the namespace- or function-scope anonymous union OBJECT,
|
/* Walks through the namespace- or function-scope anonymous union
|
||||||
building appropriate ALIAS_DECLs. Returns one of the fields for use in
|
OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs.
|
||||||
the mangled name. */
|
Returns one of the fields for use in the mangled name. */
|
||||||
|
|
||||||
static tree
|
static tree
|
||||||
build_anon_union_vars (tree object)
|
build_anon_union_vars (tree type, tree object)
|
||||||
{
|
{
|
||||||
tree type = TREE_TYPE (object);
|
|
||||||
tree main_decl = NULL_TREE;
|
tree main_decl = NULL_TREE;
|
||||||
tree field;
|
tree field;
|
||||||
|
|
||||||
@ -1185,7 +1183,7 @@ build_anon_union_vars (tree object)
|
|||||||
decl = pushdecl (decl);
|
decl = pushdecl (decl);
|
||||||
}
|
}
|
||||||
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
|
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
|
||||||
decl = build_anon_union_vars (ref);
|
decl = build_anon_union_vars (TREE_TYPE (field), ref);
|
||||||
else
|
else
|
||||||
decl = 0;
|
decl = 0;
|
||||||
|
|
||||||
@ -1225,7 +1223,7 @@ finish_anon_union (tree anon_union_decl)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
main_decl = build_anon_union_vars (anon_union_decl);
|
main_decl = build_anon_union_vars (type, anon_union_decl);
|
||||||
if (main_decl == NULL_TREE)
|
if (main_decl == NULL_TREE)
|
||||||
{
|
{
|
||||||
warning ("anonymous union with no members");
|
warning ("anonymous union with no members");
|
||||||
@ -2961,7 +2959,7 @@ check_default_args (tree x)
|
|||||||
{
|
{
|
||||||
cp_error_at ("default argument missing for parameter %P of `%+#D'",
|
cp_error_at ("default argument missing for parameter %P of `%+#D'",
|
||||||
i, x);
|
i, x);
|
||||||
break;
|
TREE_PURPOSE (arg) = error_mark_node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2969,6 +2967,18 @@ check_default_args (tree x)
|
|||||||
void
|
void
|
||||||
mark_used (tree decl)
|
mark_used (tree decl)
|
||||||
{
|
{
|
||||||
|
/* 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
|
||||||
|
actually used until after overload resolution. */
|
||||||
|
if (TREE_CODE (decl) == BASELINK)
|
||||||
|
{
|
||||||
|
decl = BASELINK_FUNCTIONS (decl);
|
||||||
|
if (really_overloaded_fn (decl))
|
||||||
|
return;
|
||||||
|
decl = OVL_CURRENT (decl);
|
||||||
|
}
|
||||||
|
|
||||||
TREE_USED (decl) = 1;
|
TREE_USED (decl) = 1;
|
||||||
if (processing_template_decl || skip_evaluation)
|
if (processing_template_decl || skip_evaluation)
|
||||||
return;
|
return;
|
||||||
|
@ -1307,6 +1307,7 @@ dump_expr (tree t, int flags)
|
|||||||
case FUNCTION_DECL:
|
case FUNCTION_DECL:
|
||||||
case TEMPLATE_DECL:
|
case TEMPLATE_DECL:
|
||||||
case NAMESPACE_DECL:
|
case NAMESPACE_DECL:
|
||||||
|
case LABEL_DECL:
|
||||||
case OVERLOAD:
|
case OVERLOAD:
|
||||||
case IDENTIFIER_NODE:
|
case IDENTIFIER_NODE:
|
||||||
dump_decl (t, (flags & ~TFF_DECL_SPECIFIERS) | TFF_NO_FUNCTION_ARGUMENTS);
|
dump_decl (t, (flags & ~TFF_DECL_SPECIFIERS) | TFF_NO_FUNCTION_ARGUMENTS);
|
||||||
@ -1547,6 +1548,8 @@ dump_expr (tree t, int flags)
|
|||||||
|| (TREE_TYPE (t)
|
|| (TREE_TYPE (t)
|
||||||
&& TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
|
&& TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
|
||||||
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
|
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
|
||||||
|
else if (TREE_CODE (TREE_OPERAND (t, 0)) == LABEL_DECL)
|
||||||
|
dump_unary_op ("&&", t, flags);
|
||||||
else
|
else
|
||||||
dump_unary_op ("&", t, flags);
|
dump_unary_op ("&", t, flags);
|
||||||
break;
|
break;
|
||||||
|
@ -1015,11 +1015,11 @@ expand_member_init (tree name)
|
|||||||
if (!direct_binfo && !virtual_binfo)
|
if (!direct_binfo && !virtual_binfo)
|
||||||
{
|
{
|
||||||
if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
|
if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
|
||||||
error ("type `%D' is not a direct or virtual base of `%T'",
|
error ("type `%T' is not a direct or virtual base of `%T'",
|
||||||
name, current_class_type);
|
basetype, current_class_type);
|
||||||
else
|
else
|
||||||
error ("type `%D' is not a direct base of `%T'",
|
error ("type `%T' is not a direct base of `%T'",
|
||||||
name, current_class_type);
|
basetype, current_class_type);
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2075,9 +2075,6 @@ build_new_1 (tree exp)
|
|||||||
fns = lookup_fnfields (true_type, fnname, /*protect=*/2);
|
fns = lookup_fnfields (true_type, fnname, /*protect=*/2);
|
||||||
if (!fns)
|
if (!fns)
|
||||||
{
|
{
|
||||||
/* See PR 15967. This should never happen (and it is
|
|
||||||
fixed correctly in mainline), but on the release branch
|
|
||||||
we prefer this less-intrusive approacch. */
|
|
||||||
error ("no suitable or ambiguous `%D' found in class `%T'",
|
error ("no suitable or ambiguous `%D' found in class `%T'",
|
||||||
fnname, true_type);
|
fnname, true_type);
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
@ -627,26 +627,18 @@ unqualified_name_lookup_error (tree name)
|
|||||||
if (name != ansi_opname (ERROR_MARK))
|
if (name != ansi_opname (ERROR_MARK))
|
||||||
error ("`%D' not defined", name);
|
error ("`%D' not defined", name);
|
||||||
}
|
}
|
||||||
else if (current_function_decl == 0)
|
|
||||||
error ("`%D' was not declared in this scope", name);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
|
error ("`%D' was not declared in this scope", name);
|
||||||
|| IDENTIFIER_ERROR_LOCUS (name) != current_function_decl)
|
/* Prevent repeated error messages by creating a VAR_DECL with
|
||||||
|
this NAME in the innermost block scope. */
|
||||||
|
if (current_function_decl)
|
||||||
{
|
{
|
||||||
static int undeclared_variable_notice;
|
tree decl;
|
||||||
|
decl = build_decl (VAR_DECL, name, error_mark_node);
|
||||||
error ("`%D' undeclared (first use this function)", name);
|
DECL_CONTEXT (decl) = current_function_decl;
|
||||||
|
push_local_binding (name, decl, 0);
|
||||||
if (! undeclared_variable_notice)
|
|
||||||
{
|
|
||||||
error ("(Each undeclared identifier is reported only once for each function it appears in.)");
|
|
||||||
undeclared_variable_notice = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Prevent repeated error messages. */
|
|
||||||
SET_IDENTIFIER_NAMESPACE_VALUE (name, error_mark_node);
|
|
||||||
SET_IDENTIFIER_ERROR_LOCUS (name, current_function_decl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
@ -851,7 +851,7 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
|
|||||||
continue;
|
continue;
|
||||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
while (TREE_CODE (type) == ARRAY_TYPE)
|
||||||
type = TREE_TYPE (type);
|
type = TREE_TYPE (type);
|
||||||
if (TREE_CODE (type) != RECORD_TYPE)
|
if (!CLASS_TYPE_P (type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fn = (*extractor) (type, client);
|
fn = (*extractor) (type, client);
|
||||||
@ -896,7 +896,9 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED)
|
|||||||
tree fn = OVL_CURRENT (fns);
|
tree fn = OVL_CURRENT (fns);
|
||||||
tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
||||||
|
|
||||||
if (sufficient_parms_p (TREE_CHAIN (parms)))
|
parms = skip_artificial_parms_for (fn, parms);
|
||||||
|
|
||||||
|
if (sufficient_parms_p (parms))
|
||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
@ -940,7 +942,7 @@ locate_copy (tree type, void *client_)
|
|||||||
int excess;
|
int excess;
|
||||||
int quals;
|
int quals;
|
||||||
|
|
||||||
parms = TREE_CHAIN (parms);
|
parms = skip_artificial_parms_for (fn, parms);
|
||||||
if (!parms)
|
if (!parms)
|
||||||
continue;
|
continue;
|
||||||
src_type = non_reference (TREE_VALUE (parms));
|
src_type = non_reference (TREE_VALUE (parms));
|
||||||
|
@ -35,7 +35,6 @@ static cxx_scope *innermost_nonclass_level (void);
|
|||||||
static tree select_decl (cxx_binding *, int);
|
static tree select_decl (cxx_binding *, int);
|
||||||
static cxx_binding *binding_for_name (cxx_scope *, tree);
|
static cxx_binding *binding_for_name (cxx_scope *, tree);
|
||||||
static tree lookup_name_current_level (tree);
|
static tree lookup_name_current_level (tree);
|
||||||
static void push_local_binding (tree, tree, int);
|
|
||||||
static tree push_overloaded_decl (tree, int);
|
static tree push_overloaded_decl (tree, int);
|
||||||
static bool lookup_using_namespace (tree, cxx_binding *, tree,
|
static bool lookup_using_namespace (tree, cxx_binding *, tree,
|
||||||
tree, int);
|
tree, int);
|
||||||
@ -607,6 +606,9 @@ pushdecl (tree x)
|
|||||||
{
|
{
|
||||||
int different_binding_level = 0;
|
int different_binding_level = 0;
|
||||||
|
|
||||||
|
if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x))
|
||||||
|
check_default_args (x);
|
||||||
|
|
||||||
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
||||||
name = TREE_OPERAND (name, 0);
|
name = TREE_OPERAND (name, 0);
|
||||||
|
|
||||||
@ -718,8 +720,6 @@ pushdecl (tree x)
|
|||||||
{
|
{
|
||||||
if (TREE_CODE (t) == TYPE_DECL)
|
if (TREE_CODE (t) == TYPE_DECL)
|
||||||
SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t));
|
SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t));
|
||||||
else if (TREE_CODE (t) == FUNCTION_DECL)
|
|
||||||
check_default_args (t);
|
|
||||||
|
|
||||||
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
|
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
|
||||||
}
|
}
|
||||||
@ -1002,9 +1002,6 @@ pushdecl (tree x)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TREE_CODE (x) == FUNCTION_DECL)
|
|
||||||
check_default_args (x);
|
|
||||||
|
|
||||||
if (TREE_CODE (x) == VAR_DECL)
|
if (TREE_CODE (x) == VAR_DECL)
|
||||||
maybe_register_incomplete_var (x);
|
maybe_register_incomplete_var (x);
|
||||||
}
|
}
|
||||||
@ -1052,7 +1049,7 @@ maybe_push_decl (tree decl)
|
|||||||
doesn't really belong to this binding level, that it got here
|
doesn't really belong to this binding level, that it got here
|
||||||
through a using-declaration. */
|
through a using-declaration. */
|
||||||
|
|
||||||
static void
|
void
|
||||||
push_local_binding (tree id, tree decl, int flags)
|
push_local_binding (tree id, tree decl, int flags)
|
||||||
{
|
{
|
||||||
struct cp_binding_level *b;
|
struct cp_binding_level *b;
|
||||||
@ -1180,6 +1177,10 @@ check_for_out_of_scope_variable (tree decl)
|
|||||||
return decl;
|
return decl;
|
||||||
|
|
||||||
DECL_ERROR_REPORTED (decl) = 1;
|
DECL_ERROR_REPORTED (decl) = 1;
|
||||||
|
|
||||||
|
if (TREE_TYPE (decl) == error_mark_node)
|
||||||
|
return decl;
|
||||||
|
|
||||||
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
|
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
|
||||||
{
|
{
|
||||||
error ("name lookup of `%D' changed for new ISO `for' scoping",
|
error ("name lookup of `%D' changed for new ISO `for' scoping",
|
||||||
@ -3021,7 +3022,13 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
{
|
||||||
|
/* Writing "int N::i" to declare a variable within "N" is invalid. */
|
||||||
|
if (at_namespace_scope_p ())
|
||||||
|
error ("explicit qualification in declaration of `%D'", decl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
complain:
|
complain:
|
||||||
error ("`%D' should have been declared inside `%D'",
|
error ("`%D' should have been declared inside `%D'",
|
||||||
decl, scope);
|
decl, scope);
|
||||||
@ -3199,12 +3206,10 @@ namespace_ancestor (tree ns1, tree ns2)
|
|||||||
void
|
void
|
||||||
do_namespace_alias (tree alias, tree namespace)
|
do_namespace_alias (tree alias, tree namespace)
|
||||||
{
|
{
|
||||||
if (TREE_CODE (namespace) != NAMESPACE_DECL)
|
if (namespace == error_mark_node)
|
||||||
{
|
return;
|
||||||
/* The parser did not find it, so it's not there. */
|
|
||||||
error ("unknown namespace `%D'", namespace);
|
my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 20050830);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace = ORIGINAL_NAMESPACE (namespace);
|
namespace = ORIGINAL_NAMESPACE (namespace);
|
||||||
|
|
||||||
@ -3345,26 +3350,15 @@ do_toplevel_using_decl (tree decl, tree scope, tree name)
|
|||||||
void
|
void
|
||||||
do_using_directive (tree namespace)
|
do_using_directive (tree namespace)
|
||||||
{
|
{
|
||||||
|
if (namespace == error_mark_node)
|
||||||
|
return;
|
||||||
|
|
||||||
|
my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 20050830);
|
||||||
|
|
||||||
if (building_stmt_tree ())
|
if (building_stmt_tree ())
|
||||||
add_stmt (build_stmt (USING_STMT, namespace));
|
add_stmt (build_stmt (USING_STMT, namespace));
|
||||||
|
|
||||||
/* using namespace A::B::C; */
|
|
||||||
if (TREE_CODE (namespace) == SCOPE_REF)
|
|
||||||
namespace = TREE_OPERAND (namespace, 1);
|
|
||||||
if (TREE_CODE (namespace) == IDENTIFIER_NODE)
|
|
||||||
{
|
|
||||||
/* Lookup in lexer did not find a namespace. */
|
|
||||||
if (!processing_template_decl)
|
|
||||||
error ("namespace `%T' undeclared", namespace);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (TREE_CODE (namespace) != NAMESPACE_DECL)
|
|
||||||
{
|
|
||||||
if (!processing_template_decl)
|
|
||||||
error ("`%T' is not a namespace", namespace);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
namespace = ORIGINAL_NAMESPACE (namespace);
|
namespace = ORIGINAL_NAMESPACE (namespace);
|
||||||
|
|
||||||
if (!toplevel_bindings_p ())
|
if (!toplevel_bindings_p ())
|
||||||
push_using_directive (namespace);
|
push_using_directive (namespace);
|
||||||
else
|
else
|
||||||
@ -4437,9 +4431,10 @@ arg_assoc (struct arg_lookup *k, tree n)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Now the arguments. */
|
/* Now the arguments. */
|
||||||
for (ix = TREE_VEC_LENGTH (args); ix--;)
|
if (args)
|
||||||
if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1)
|
for (ix = TREE_VEC_LENGTH (args); ix--;)
|
||||||
return true;
|
if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1)
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else if (TREE_CODE (n) == OVERLOAD)
|
else if (TREE_CODE (n) == OVERLOAD)
|
||||||
{
|
{
|
||||||
|
@ -287,6 +287,7 @@ extern tree lookup_namespace_name (tree, tree);
|
|||||||
extern tree lookup_qualified_name (tree, tree, bool, bool);
|
extern tree lookup_qualified_name (tree, tree, bool, bool);
|
||||||
extern tree lookup_name_nonclass (tree);
|
extern tree lookup_name_nonclass (tree);
|
||||||
extern tree lookup_function_nonclass (tree, tree);
|
extern tree lookup_function_nonclass (tree, tree);
|
||||||
|
extern void push_local_binding (tree, tree, int);
|
||||||
extern int push_class_binding (tree, tree);
|
extern int push_class_binding (tree, tree);
|
||||||
extern bool pushdecl_class_level (tree);
|
extern bool pushdecl_class_level (tree);
|
||||||
extern tree pushdecl_namespace_level (tree);
|
extern tree pushdecl_namespace_level (tree);
|
||||||
|
@ -1672,6 +1672,8 @@ static bool cp_parser_declares_only_class_p
|
|||||||
(cp_parser *);
|
(cp_parser *);
|
||||||
static bool cp_parser_friend_p
|
static bool cp_parser_friend_p
|
||||||
(tree);
|
(tree);
|
||||||
|
static bool cp_parser_typedef_p
|
||||||
|
(tree);
|
||||||
static cp_token *cp_parser_require
|
static cp_token *cp_parser_require
|
||||||
(cp_parser *, enum cpp_ttype, const char *);
|
(cp_parser *, enum cpp_ttype, const char *);
|
||||||
static cp_token *cp_parser_require_keyword
|
static cp_token *cp_parser_require_keyword
|
||||||
@ -1717,7 +1719,7 @@ static bool cp_parser_simulate_error
|
|||||||
static void cp_parser_check_type_definition
|
static void cp_parser_check_type_definition
|
||||||
(cp_parser *);
|
(cp_parser *);
|
||||||
static void cp_parser_check_for_definition_in_return_type
|
static void cp_parser_check_for_definition_in_return_type
|
||||||
(tree, int);
|
(tree, tree);
|
||||||
static void cp_parser_check_for_invalid_template_id
|
static void cp_parser_check_for_invalid_template_id
|
||||||
(cp_parser *, tree);
|
(cp_parser *, tree);
|
||||||
static bool cp_parser_non_integral_constant_expression
|
static bool cp_parser_non_integral_constant_expression
|
||||||
@ -1849,14 +1851,13 @@ cp_parser_check_type_definition (cp_parser* parser)
|
|||||||
error ("%s", parser->type_definition_forbidden_message);
|
error ("%s", parser->type_definition_forbidden_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called when a declaration is parsed. If
|
/* This function is called when the DECLARATOR is processed. The TYPE
|
||||||
DECLARATOR is a function declarator and DECLARES_CLASS_OR_ENUM
|
was a type defined in the decl-specifiers. If it is invalid to
|
||||||
indicates that a type was defined in the decl-specifiers for DECL,
|
define a type in the decl-specifiers for DECLARATOR, an error is
|
||||||
then an error is issued. */
|
issued. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cp_parser_check_for_definition_in_return_type (tree declarator,
|
cp_parser_check_for_definition_in_return_type (tree declarator, tree type)
|
||||||
int declares_class_or_enum)
|
|
||||||
{
|
{
|
||||||
/* [dcl.fct] forbids type definitions in return types.
|
/* [dcl.fct] forbids type definitions in return types.
|
||||||
Unfortunately, it's not easy to know whether or not we are
|
Unfortunately, it's not easy to know whether or not we are
|
||||||
@ -1866,9 +1867,12 @@ cp_parser_check_for_definition_in_return_type (tree declarator,
|
|||||||
|| TREE_CODE (declarator) == ADDR_EXPR))
|
|| TREE_CODE (declarator) == ADDR_EXPR))
|
||||||
declarator = TREE_OPERAND (declarator, 0);
|
declarator = TREE_OPERAND (declarator, 0);
|
||||||
if (declarator
|
if (declarator
|
||||||
&& TREE_CODE (declarator) == CALL_EXPR
|
&& TREE_CODE (declarator) == CALL_EXPR)
|
||||||
&& declares_class_or_enum & 2)
|
{
|
||||||
error ("new types may not be defined in a return type");
|
error ("new types may not be defined in a return type");
|
||||||
|
inform ("(perhaps a semicolon is missing after the definition of `%T')",
|
||||||
|
type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A type-specifier (TYPE) has been parsed which cannot be followed by
|
/* A type-specifier (TYPE) has been parsed which cannot be followed by
|
||||||
@ -3548,52 +3552,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
|
|||||||
|
|
||||||
case RID_TYPENAME:
|
case RID_TYPENAME:
|
||||||
{
|
{
|
||||||
bool template_p = false;
|
|
||||||
tree id;
|
|
||||||
tree type;
|
tree type;
|
||||||
tree scope;
|
|
||||||
|
|
||||||
/* Consume the `typename' token. */
|
|
||||||
cp_lexer_consume_token (parser->lexer);
|
|
||||||
/* Look for the optional `::' operator. */
|
|
||||||
cp_parser_global_scope_opt (parser,
|
|
||||||
/*current_scope_valid_p=*/false);
|
|
||||||
/* Look for the nested-name-specifier. In case of error here,
|
|
||||||
consume the trailing id to avoid subsequent error messages
|
|
||||||
for usual cases. */
|
|
||||||
scope = cp_parser_nested_name_specifier (parser,
|
|
||||||
/*typename_keyword_p=*/true,
|
|
||||||
/*check_dependency_p=*/true,
|
|
||||||
/*type_p=*/true,
|
|
||||||
/*is_declaration=*/true);
|
|
||||||
|
|
||||||
/* Look for the optional `template' keyword. */
|
|
||||||
template_p = cp_parser_optional_template_keyword (parser);
|
|
||||||
/* We don't know whether we're looking at a template-id or an
|
|
||||||
identifier. */
|
|
||||||
cp_parser_parse_tentatively (parser);
|
|
||||||
/* Try a template-id. */
|
|
||||||
id = cp_parser_template_id (parser, template_p,
|
|
||||||
/*check_dependency_p=*/true,
|
|
||||||
/*is_declaration=*/true);
|
|
||||||
/* If that didn't work, try an identifier. */
|
|
||||||
if (!cp_parser_parse_definitely (parser))
|
|
||||||
id = cp_parser_identifier (parser);
|
|
||||||
|
|
||||||
/* Don't process id if nested name specifier is invalid. */
|
|
||||||
if (scope == error_mark_node)
|
|
||||||
return error_mark_node;
|
|
||||||
/* If we look up a template-id in a non-dependent qualifying
|
|
||||||
scope, there's no need to create a dependent type. */
|
|
||||||
else if (TREE_CODE (id) == TYPE_DECL
|
|
||||||
&& !dependent_type_p (parser->scope))
|
|
||||||
type = TREE_TYPE (id);
|
|
||||||
/* Create a TYPENAME_TYPE to represent the type to which the
|
|
||||||
functional cast is being performed. */
|
|
||||||
else
|
|
||||||
type = make_typename_type (parser->scope, id,
|
|
||||||
/*complain=*/1);
|
|
||||||
|
|
||||||
|
/* The syntax permitted here is the same permitted for an
|
||||||
|
elaborated-type-specifier. */
|
||||||
|
type = cp_parser_elaborated_type_specifier (parser,
|
||||||
|
/*is_friend=*/false,
|
||||||
|
/*is_declaration=*/false);
|
||||||
postfix_expression = cp_parser_functional_cast (parser, type);
|
postfix_expression = cp_parser_functional_cast (parser, type);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3964,20 +3929,29 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
|
|||||||
if (parser->scope)
|
if (parser->scope)
|
||||||
idk = CP_ID_KIND_QUALIFIED;
|
idk = CP_ID_KIND_QUALIFIED;
|
||||||
|
|
||||||
if (name != error_mark_node
|
/* If the name is a template-id that names a type, we will
|
||||||
&& !BASELINK_P (name)
|
get a TYPE_DECL here. That is invalid code. */
|
||||||
&& parser->scope)
|
if (TREE_CODE (name) == TYPE_DECL)
|
||||||
{
|
{
|
||||||
name = build_nt (SCOPE_REF, parser->scope, name);
|
error ("invalid use of `%D'", name);
|
||||||
parser->scope = NULL_TREE;
|
postfix_expression = error_mark_node;
|
||||||
parser->qualifying_scope = NULL_TREE;
|
}
|
||||||
parser->object_scope = NULL_TREE;
|
else
|
||||||
|
{
|
||||||
|
if (name != error_mark_node && !BASELINK_P (name)
|
||||||
|
&& parser->scope)
|
||||||
|
{
|
||||||
|
name = build_nt (SCOPE_REF, parser->scope, name);
|
||||||
|
parser->scope = NULL_TREE;
|
||||||
|
parser->qualifying_scope = NULL_TREE;
|
||||||
|
parser->object_scope = NULL_TREE;
|
||||||
|
}
|
||||||
|
if (scope && name && BASELINK_P (name))
|
||||||
|
adjust_result_of_qualified_name_lookup
|
||||||
|
(name, BINFO_TYPE (BASELINK_BINFO (name)), scope);
|
||||||
|
postfix_expression = finish_class_member_access_expr
|
||||||
|
(postfix_expression, name);
|
||||||
}
|
}
|
||||||
if (scope && name && BASELINK_P (name))
|
|
||||||
adjust_result_of_qualified_name_lookup
|
|
||||||
(name, BINFO_TYPE (BASELINK_BINFO (name)), scope);
|
|
||||||
postfix_expression
|
|
||||||
= finish_class_member_access_expr (postfix_expression, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We no longer need to look up names in the scope of the
|
/* We no longer need to look up names in the scope of the
|
||||||
@ -6523,6 +6497,13 @@ cp_parser_simple_declaration (cp_parser* parser,
|
|||||||
/* Give up. */
|
/* Give up. */
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we have seen at least one decl-specifier, and the next token
|
||||||
|
is not a parenthesis, then we must be looking at a declaration.
|
||||||
|
(After "int (" we might be looking at a functional cast.) */
|
||||||
|
if (decl_specifiers
|
||||||
|
&& cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))
|
||||||
|
cp_parser_commit_to_tentative_parse (parser);
|
||||||
|
|
||||||
/* Keep going until we hit the `;' at the end of the simple
|
/* Keep going until we hit the `;' at the end of the simple
|
||||||
declaration. */
|
declaration. */
|
||||||
@ -6576,7 +6557,12 @@ cp_parser_simple_declaration (cp_parser* parser,
|
|||||||
/* Anything else is an error. */
|
/* Anything else is an error. */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cp_parser_error (parser, "expected `,' or `;'");
|
/* If we have already issued an error message we don't need
|
||||||
|
to issue another one. */
|
||||||
|
if (decl != error_mark_node
|
||||||
|
|| (cp_parser_parsing_tentatively (parser)
|
||||||
|
&& !cp_parser_committed_to_tentative_parse (parser)))
|
||||||
|
cp_parser_error (parser, "expected `,' or `;'");
|
||||||
/* Skip tokens until we reach the end of the statement. */
|
/* Skip tokens until we reach the end of the statement. */
|
||||||
cp_parser_skip_to_end_of_statement (parser);
|
cp_parser_skip_to_end_of_statement (parser);
|
||||||
/* If the next token is now a `;', consume it. */
|
/* If the next token is now a `;', consume it. */
|
||||||
@ -7802,9 +7788,15 @@ cp_parser_type_parameter (cp_parser* parser)
|
|||||||
if (cp_lexer_next_token_is_not (parser->lexer, CPP_EQ)
|
if (cp_lexer_next_token_is_not (parser->lexer, CPP_EQ)
|
||||||
&& cp_lexer_next_token_is_not (parser->lexer, CPP_GREATER)
|
&& cp_lexer_next_token_is_not (parser->lexer, CPP_GREATER)
|
||||||
&& cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
|
&& cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
|
||||||
identifier = cp_parser_identifier (parser);
|
{
|
||||||
|
identifier = cp_parser_identifier (parser);
|
||||||
|
/* Treat invalid names as if the parameter were nameless. */
|
||||||
|
if (identifier == error_mark_node)
|
||||||
|
identifier = NULL_TREE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
identifier = NULL_TREE;
|
identifier = NULL_TREE;
|
||||||
|
|
||||||
/* Create the template parameter. */
|
/* Create the template parameter. */
|
||||||
parameter = finish_template_template_parm (class_type_node,
|
parameter = finish_template_template_parm (class_type_node,
|
||||||
identifier);
|
identifier);
|
||||||
@ -7846,15 +7838,13 @@ cp_parser_type_parameter (cp_parser* parser)
|
|||||||
|
|
||||||
/* Create the combined representation of the parameter and the
|
/* Create the combined representation of the parameter and the
|
||||||
default argument. */
|
default argument. */
|
||||||
parameter = build_tree_list (default_argument, parameter);
|
parameter = build_tree_list (default_argument, parameter);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Anything else is an error. */
|
abort ();
|
||||||
cp_parser_error (parser,
|
break;
|
||||||
"expected `class', `typename', or `template'");
|
|
||||||
parameter = error_mark_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return parameter;
|
return parameter;
|
||||||
@ -8610,8 +8600,9 @@ cp_parser_explicit_instantiation (cp_parser* parser)
|
|||||||
/*ctor_dtor_or_conv_p=*/NULL,
|
/*ctor_dtor_or_conv_p=*/NULL,
|
||||||
/*parenthesized_p=*/NULL,
|
/*parenthesized_p=*/NULL,
|
||||||
/*member_p=*/false);
|
/*member_p=*/false);
|
||||||
cp_parser_check_for_definition_in_return_type (declarator,
|
if (declares_class_or_enum & 2)
|
||||||
declares_class_or_enum);
|
cp_parser_check_for_definition_in_return_type
|
||||||
|
(declarator, TREE_VALUE (decl_specifiers));
|
||||||
if (declarator != error_mark_node)
|
if (declarator != error_mark_node)
|
||||||
{
|
{
|
||||||
decl = grokdeclarator (declarator, decl_specifiers,
|
decl = grokdeclarator (declarator, decl_specifiers,
|
||||||
@ -9218,7 +9209,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* For a `typename', we needn't call xref_tag. */
|
/* For a `typename', we needn't call xref_tag. */
|
||||||
if (tag_type == typename_type)
|
if (tag_type == typename_type
|
||||||
|
&& TREE_CODE (parser->scope) != NAMESPACE_DECL)
|
||||||
return make_typename_type (parser->scope, identifier,
|
return make_typename_type (parser->scope, identifier,
|
||||||
/*complain=*/1);
|
/*complain=*/1);
|
||||||
/* Look up a qualified name in the usual way. */
|
/* Look up a qualified name in the usual way. */
|
||||||
@ -9262,7 +9254,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|
|||||||
|
|
||||||
if (TREE_CODE (decl) != TYPE_DECL)
|
if (TREE_CODE (decl) != TYPE_DECL)
|
||||||
{
|
{
|
||||||
error ("expected type-name");
|
cp_parser_diagnose_invalid_type_name (parser);
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9514,6 +9506,9 @@ cp_parser_namespace_name (cp_parser* parser)
|
|||||||
if (namespace_decl == error_mark_node
|
if (namespace_decl == error_mark_node
|
||||||
|| TREE_CODE (namespace_decl) != NAMESPACE_DECL)
|
|| TREE_CODE (namespace_decl) != NAMESPACE_DECL)
|
||||||
{
|
{
|
||||||
|
if (!cp_parser_parsing_tentatively (parser)
|
||||||
|
|| cp_parser_committed_to_tentative_parse (parser))
|
||||||
|
error ("`%D' is not a namespace-name", identifier);
|
||||||
cp_parser_error (parser, "expected namespace-name");
|
cp_parser_error (parser, "expected namespace-name");
|
||||||
namespace_decl = error_mark_node;
|
namespace_decl = error_mark_node;
|
||||||
}
|
}
|
||||||
@ -9982,8 +9977,9 @@ cp_parser_init_declarator (cp_parser* parser,
|
|||||||
if (declarator == error_mark_node)
|
if (declarator == error_mark_node)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
cp_parser_check_for_definition_in_return_type (declarator,
|
if (declares_class_or_enum & 2)
|
||||||
declares_class_or_enum);
|
cp_parser_check_for_definition_in_return_type
|
||||||
|
(declarator, TREE_VALUE (decl_specifiers));
|
||||||
|
|
||||||
/* Figure out what scope the entity declared by the DECLARATOR is
|
/* Figure out what scope the entity declared by the DECLARATOR is
|
||||||
located in. `grokdeclarator' sometimes changes the scope, so
|
located in. `grokdeclarator' sometimes changes the scope, so
|
||||||
@ -10069,7 +10065,7 @@ cp_parser_init_declarator (cp_parser* parser,
|
|||||||
&& token->type != CPP_COMMA
|
&& token->type != CPP_COMMA
|
||||||
&& token->type != CPP_SEMICOLON)
|
&& token->type != CPP_SEMICOLON)
|
||||||
{
|
{
|
||||||
cp_parser_error (parser, "expected init-declarator");
|
cp_parser_error (parser, "expected initializer");
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10909,7 +10905,7 @@ cp_parser_declarator_id (cp_parser* parser)
|
|||||||
/*declarator_p=*/true);
|
/*declarator_p=*/true);
|
||||||
/* If the name was qualified, create a SCOPE_REF to represent
|
/* If the name was qualified, create a SCOPE_REF to represent
|
||||||
that. */
|
that. */
|
||||||
if (parser->scope)
|
if (parser->scope && id_expression != error_mark_node)
|
||||||
{
|
{
|
||||||
id_expression = build_nt (SCOPE_REF, parser->scope, id_expression);
|
id_expression = build_nt (SCOPE_REF, parser->scope, id_expression);
|
||||||
parser->scope = NULL_TREE;
|
parser->scope = NULL_TREE;
|
||||||
@ -12483,8 +12479,13 @@ cp_parser_member_declaration (cp_parser* parser)
|
|||||||
/* Check for a template-declaration. */
|
/* Check for a template-declaration. */
|
||||||
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE))
|
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE))
|
||||||
{
|
{
|
||||||
/* Parse the template-declaration. */
|
/* An explicit specialization here is an error condition, and we
|
||||||
cp_parser_template_declaration (parser, /*member_p=*/true);
|
expect the specialization handler to detect and report this. */
|
||||||
|
if (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_LESS
|
||||||
|
&& cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_GREATER)
|
||||||
|
cp_parser_explicit_specialization (parser);
|
||||||
|
else
|
||||||
|
cp_parser_template_declaration (parser, /*member_p=*/true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -12685,8 +12686,9 @@ cp_parser_member_declaration (cp_parser* parser)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cp_parser_check_for_definition_in_return_type
|
if (declares_class_or_enum & 2)
|
||||||
(declarator, declares_class_or_enum);
|
cp_parser_check_for_definition_in_return_type
|
||||||
|
(declarator, TREE_VALUE (decl_specifiers));
|
||||||
|
|
||||||
/* Look for an asm-specification. */
|
/* Look for an asm-specification. */
|
||||||
asm_specification = cp_parser_asm_specification_opt (parser);
|
asm_specification = cp_parser_asm_specification_opt (parser);
|
||||||
@ -13639,7 +13641,10 @@ cp_parser_label_declaration (cp_parser* parser)
|
|||||||
|
|
||||||
/* Look for an identifier. */
|
/* Look for an identifier. */
|
||||||
identifier = cp_parser_identifier (parser);
|
identifier = cp_parser_identifier (parser);
|
||||||
/* Declare it as a lobel. */
|
/* If we failed, stop. */
|
||||||
|
if (identifier == error_mark_node)
|
||||||
|
break;
|
||||||
|
/* Declare it as a label. */
|
||||||
finish_label_decl (identifier);
|
finish_label_decl (identifier);
|
||||||
/* If the next token is a `;', stop. */
|
/* If the next token is a `;', stop. */
|
||||||
if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
|
if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
|
||||||
@ -13689,6 +13694,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||||||
bool is_type, bool is_template, bool is_namespace,
|
bool is_type, bool is_template, bool is_namespace,
|
||||||
bool check_dependency)
|
bool check_dependency)
|
||||||
{
|
{
|
||||||
|
int flags = 0;
|
||||||
tree decl;
|
tree decl;
|
||||||
tree object_type = parser->context->object_type;
|
tree object_type = parser->context->object_type;
|
||||||
|
|
||||||
@ -13700,6 +13706,10 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||||||
if (name == error_mark_node)
|
if (name == error_mark_node)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
|
if (!cp_parser_parsing_tentatively (parser)
|
||||||
|
|| cp_parser_committed_to_tentative_parse (parser))
|
||||||
|
flags |= LOOKUP_COMPLAIN;
|
||||||
|
|
||||||
/* A template-id has already been resolved; there is no lookup to
|
/* A template-id has already been resolved; there is no lookup to
|
||||||
do. */
|
do. */
|
||||||
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
||||||
@ -13813,8 +13823,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||||||
/*protect=*/0, is_type);
|
/*protect=*/0, is_type);
|
||||||
/* Look it up in the enclosing context, too. */
|
/* Look it up in the enclosing context, too. */
|
||||||
decl = lookup_name_real (name, is_type, /*nonclass=*/0,
|
decl = lookup_name_real (name, is_type, /*nonclass=*/0,
|
||||||
is_namespace,
|
is_namespace, flags);
|
||||||
/*flags=*/0);
|
|
||||||
parser->object_scope = object_type;
|
parser->object_scope = object_type;
|
||||||
parser->qualifying_scope = NULL_TREE;
|
parser->qualifying_scope = NULL_TREE;
|
||||||
if (object_decl)
|
if (object_decl)
|
||||||
@ -13823,8 +13832,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
decl = lookup_name_real (name, is_type, /*nonclass=*/0,
|
decl = lookup_name_real (name, is_type, /*nonclass=*/0,
|
||||||
is_namespace,
|
is_namespace, flags);
|
||||||
/*flags=*/0);
|
|
||||||
parser->qualifying_scope = NULL_TREE;
|
parser->qualifying_scope = NULL_TREE;
|
||||||
parser->object_scope = NULL_TREE;
|
parser->object_scope = NULL_TREE;
|
||||||
}
|
}
|
||||||
@ -14508,6 +14516,12 @@ cp_parser_single_declaration (cp_parser* parser,
|
|||||||
tree attributes;
|
tree attributes;
|
||||||
bool function_definition_p = false;
|
bool function_definition_p = false;
|
||||||
|
|
||||||
|
/* This function is only used when processing a template
|
||||||
|
declaration. */
|
||||||
|
if (innermost_scope_kind () != sk_template_parms
|
||||||
|
&& innermost_scope_kind () != sk_template_spec)
|
||||||
|
abort ();
|
||||||
|
|
||||||
/* Defer access checks until we know what is being declared. */
|
/* Defer access checks until we know what is being declared. */
|
||||||
push_deferring_access_checks (dk_deferred);
|
push_deferring_access_checks (dk_deferred);
|
||||||
|
|
||||||
@ -14520,6 +14534,14 @@ cp_parser_single_declaration (cp_parser* parser,
|
|||||||
&declares_class_or_enum);
|
&declares_class_or_enum);
|
||||||
if (friend_p)
|
if (friend_p)
|
||||||
*friend_p = cp_parser_friend_p (decl_specifiers);
|
*friend_p = cp_parser_friend_p (decl_specifiers);
|
||||||
|
|
||||||
|
/* There are no template typedefs. */
|
||||||
|
if (cp_parser_typedef_p (decl_specifiers))
|
||||||
|
{
|
||||||
|
error ("template declaration of `typedef'");
|
||||||
|
decl = error_mark_node;
|
||||||
|
}
|
||||||
|
|
||||||
/* Gather up the access checks that occurred the
|
/* Gather up the access checks that occurred the
|
||||||
decl-specifier-seq. */
|
decl-specifier-seq. */
|
||||||
stop_deferring_access_checks ();
|
stop_deferring_access_checks ();
|
||||||
@ -14536,8 +14558,6 @@ cp_parser_single_declaration (cp_parser* parser,
|
|||||||
decl = error_mark_node;
|
decl = error_mark_node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
decl = NULL_TREE;
|
|
||||||
/* If it's not a template class, try for a template function. If
|
/* If it's not a template class, try for a template function. If
|
||||||
the next token is a `;', then this declaration does not declare
|
the next token is a `;', then this declaration does not declare
|
||||||
anything. But, if there were errors in the decl-specifiers, then
|
anything. But, if there were errors in the decl-specifiers, then
|
||||||
@ -14563,7 +14583,8 @@ cp_parser_single_declaration (cp_parser* parser,
|
|||||||
parser->object_scope = NULL_TREE;
|
parser->object_scope = NULL_TREE;
|
||||||
/* Look for a trailing `;' after the declaration. */
|
/* Look for a trailing `;' after the declaration. */
|
||||||
if (!function_definition_p
|
if (!function_definition_p
|
||||||
&& !cp_parser_require (parser, CPP_SEMICOLON, "`;'"))
|
&& (decl == error_mark_node
|
||||||
|
|| !cp_parser_require (parser, CPP_SEMICOLON, "`;'")))
|
||||||
cp_parser_skip_to_end_of_block_or_statement (parser);
|
cp_parser_skip_to_end_of_block_or_statement (parser);
|
||||||
|
|
||||||
return decl;
|
return decl;
|
||||||
@ -14593,8 +14614,10 @@ cp_parser_functional_cast (cp_parser* parser, tree type)
|
|||||||
cast = build_functional_cast (type, expression_list);
|
cast = build_functional_cast (type, expression_list);
|
||||||
/* [expr.const]/1: In an integral constant expression "only type
|
/* [expr.const]/1: In an integral constant expression "only type
|
||||||
conversions to integral or enumeration type can be used". */
|
conversions to integral or enumeration type can be used". */
|
||||||
if (cast != error_mark_node && !type_dependent_expression_p (type)
|
if (TREE_CODE (type) == TYPE_DECL)
|
||||||
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (type)))
|
type = TREE_TYPE (type);
|
||||||
|
if (cast != error_mark_node && !dependent_type_p (type)
|
||||||
|
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
|
||||||
{
|
{
|
||||||
if (cp_parser_non_integral_constant_expression
|
if (cp_parser_non_integral_constant_expression
|
||||||
(parser, "a call to a constructor"))
|
(parser, "a call to a constructor"))
|
||||||
@ -14716,8 +14739,8 @@ cp_parser_enclosed_template_argument_list (cp_parser* parser)
|
|||||||
cp_lexer_consume_token (parser->lexer);
|
cp_lexer_consume_token (parser->lexer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!cp_parser_require (parser, CPP_GREATER, "`>'"))
|
else
|
||||||
error ("missing `>' to terminate the template argument list");
|
cp_parser_skip_until_found (parser, CPP_GREATER, "`>'");
|
||||||
/* The `>' token might be a greater-than operator again now. */
|
/* The `>' token might be a greater-than operator again now. */
|
||||||
parser->greater_than_is_operator_p
|
parser->greater_than_is_operator_p
|
||||||
= saved_greater_than_is_operator_p;
|
= saved_greater_than_is_operator_p;
|
||||||
@ -14768,9 +14791,10 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
|
|||||||
tokens = DECL_PENDING_INLINE_INFO (member_function);
|
tokens = DECL_PENDING_INLINE_INFO (member_function);
|
||||||
DECL_PENDING_INLINE_INFO (member_function) = NULL;
|
DECL_PENDING_INLINE_INFO (member_function) = NULL;
|
||||||
DECL_PENDING_INLINE_P (member_function) = 0;
|
DECL_PENDING_INLINE_P (member_function) = 0;
|
||||||
/* If this was an inline function in a local class, enter the scope
|
|
||||||
of the containing function. */
|
/* If this is a local class, enter the scope of the containing
|
||||||
function_scope = decl_function_context (member_function);
|
function. */
|
||||||
|
function_scope = current_function_decl;
|
||||||
if (function_scope)
|
if (function_scope)
|
||||||
push_function_context_to (function_scope);
|
push_function_context_to (function_scope);
|
||||||
|
|
||||||
@ -14851,33 +14875,49 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
|
|||||||
parameters;
|
parameters;
|
||||||
parameters = TREE_CHAIN (parameters))
|
parameters = TREE_CHAIN (parameters))
|
||||||
{
|
{
|
||||||
if (!TREE_PURPOSE (parameters)
|
tree default_arg = TREE_PURPOSE (parameters);
|
||||||
|| TREE_CODE (TREE_PURPOSE (parameters)) != DEFAULT_ARG)
|
tree parsed_arg;
|
||||||
|
|
||||||
|
if (!default_arg)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (TREE_CODE (default_arg) != DEFAULT_ARG)
|
||||||
|
/* This can happen for a friend declaration for a function
|
||||||
|
already declared with default arguments. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Save away the current lexer. */
|
/* Save away the current lexer. */
|
||||||
saved_lexer = parser->lexer;
|
saved_lexer = parser->lexer;
|
||||||
/* Create a new one, using the tokens we have saved. */
|
/* Create a new one, using the tokens we have saved. */
|
||||||
tokens = DEFARG_TOKENS (TREE_PURPOSE (parameters));
|
tokens = DEFARG_TOKENS (default_arg);
|
||||||
parser->lexer = cp_lexer_new_from_tokens (tokens);
|
parser->lexer = cp_lexer_new_from_tokens (tokens);
|
||||||
|
|
||||||
/* Set the current source position to be the location of the
|
/* Set the current source position to be the location of the
|
||||||
first token in the default argument. */
|
first token in the default argument. */
|
||||||
cp_lexer_peek_token (parser->lexer);
|
cp_lexer_peek_token (parser->lexer);
|
||||||
|
|
||||||
/* Local variable names (and the `this' keyword) may not appear
|
/* Local variable names (and the `this' keyword) may not appear
|
||||||
in a default argument. */
|
in a default argument. */
|
||||||
saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
|
saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
|
||||||
parser->local_variables_forbidden_p = true;
|
parser->local_variables_forbidden_p = true;
|
||||||
/* Parse the assignment-expression. */
|
|
||||||
|
/* Parse the assignment-expression. */
|
||||||
if (DECL_FRIEND_CONTEXT (fn))
|
if (DECL_FRIEND_CONTEXT (fn))
|
||||||
push_nested_class (DECL_FRIEND_CONTEXT (fn));
|
push_nested_class (DECL_FRIEND_CONTEXT (fn));
|
||||||
else if (DECL_CLASS_SCOPE_P (fn))
|
else if (DECL_CLASS_SCOPE_P (fn))
|
||||||
push_nested_class (DECL_CONTEXT (fn));
|
push_nested_class (DECL_CONTEXT (fn));
|
||||||
TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser);
|
parsed_arg = cp_parser_assignment_expression (parser);
|
||||||
if (DECL_FRIEND_CONTEXT (fn) || DECL_CLASS_SCOPE_P (fn))
|
if (DECL_FRIEND_CONTEXT (fn) || DECL_CLASS_SCOPE_P (fn))
|
||||||
pop_nested_class ();
|
pop_nested_class ();
|
||||||
|
|
||||||
|
TREE_PURPOSE (parameters) = parsed_arg;
|
||||||
|
|
||||||
|
/* Update any instantiations we've already created. */
|
||||||
|
for (default_arg = TREE_CHAIN (default_arg);
|
||||||
|
default_arg;
|
||||||
|
default_arg = TREE_CHAIN (default_arg))
|
||||||
|
TREE_PURPOSE (TREE_PURPOSE (default_arg)) = parsed_arg;
|
||||||
|
|
||||||
/* If the token stream has not been completely used up, then
|
/* If the token stream has not been completely used up, then
|
||||||
there was extra junk after the end of the default
|
there was extra junk after the end of the default
|
||||||
argument. */
|
argument. */
|
||||||
@ -14889,6 +14929,9 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
|
|||||||
parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
|
parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure no default arg is missing. */
|
||||||
|
check_default_args (fn);
|
||||||
|
|
||||||
/* Restore the queue. */
|
/* Restore the queue. */
|
||||||
parser->unparsed_functions_queues
|
parser->unparsed_functions_queues
|
||||||
= TREE_CHAIN (parser->unparsed_functions_queues);
|
= TREE_CHAIN (parser->unparsed_functions_queues);
|
||||||
@ -15012,6 +15055,27 @@ cp_parser_friend_p (tree decl_specifiers)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DECL_SPECIFIERS is the representation of a decl-specifier-seq.
|
||||||
|
Returns TRUE iff `typedef' appears among the DECL_SPECIFIERS. */
|
||||||
|
|
||||||
|
static bool
|
||||||
|
cp_parser_typedef_p (tree decl_specifiers)
|
||||||
|
{
|
||||||
|
while (decl_specifiers)
|
||||||
|
{
|
||||||
|
/* See if this decl-specifier is `typedef'. */
|
||||||
|
if (TREE_CODE (TREE_VALUE (decl_specifiers)) == IDENTIFIER_NODE
|
||||||
|
&& C_RID_CODE (TREE_VALUE (decl_specifiers)) == RID_TYPEDEF)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* Go on to the next decl-specifier. */
|
||||||
|
decl_specifiers = TREE_CHAIN (decl_specifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* If the next token is of the indicated TYPE, consume it. Otherwise,
|
/* If the next token is of the indicated TYPE, consume it. Otherwise,
|
||||||
issue an error message indicating that TOKEN_DESC was expected.
|
issue an error message indicating that TOKEN_DESC was expected.
|
||||||
|
|
||||||
|
@ -744,8 +744,12 @@ check_specialization_namespace (tree tmpl)
|
|||||||
void
|
void
|
||||||
maybe_process_partial_specialization (tree type)
|
maybe_process_partial_specialization (tree type)
|
||||||
{
|
{
|
||||||
/* TYPE maybe an ERROR_MARK_NODE. */
|
tree context;
|
||||||
tree context = TYPE_P (type) ? TYPE_CONTEXT (type) : NULL_TREE;
|
|
||||||
|
if (type == error_mark_node)
|
||||||
|
return;
|
||||||
|
|
||||||
|
context = TYPE_CONTEXT (type);
|
||||||
|
|
||||||
if (CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type))
|
if (CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type))
|
||||||
{
|
{
|
||||||
@ -1779,6 +1783,11 @@ check_explicit_specialization (tree declarator,
|
|||||||
/* Find the namespace binding, using the declaration
|
/* Find the namespace binding, using the declaration
|
||||||
context. */
|
context. */
|
||||||
fns = namespace_binding (dname, CP_DECL_CONTEXT (decl));
|
fns = namespace_binding (dname, CP_DECL_CONTEXT (decl));
|
||||||
|
if (!fns || !is_overloaded_fn (fns))
|
||||||
|
{
|
||||||
|
error ("`%D' is not a template function", dname);
|
||||||
|
fns = error_mark_node;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declarator = lookup_template_function (fns, NULL_TREE);
|
declarator = lookup_template_function (fns, NULL_TREE);
|
||||||
@ -2832,9 +2841,8 @@ push_template_decl_real (tree decl, int is_friend)
|
|||||||
return decl;
|
return decl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((DECL_IMPLICIT_TYPEDEF_P (decl)
|
else if (DECL_IMPLICIT_TYPEDEF_P (decl)
|
||||||
&& CLASS_TYPE_P (TREE_TYPE (decl)))
|
&& CLASS_TYPE_P (TREE_TYPE (decl)))
|
||||||
|| (TREE_CODE (decl) == VAR_DECL && ctx && CLASS_TYPE_P (ctx)))
|
|
||||||
/* OK */;
|
/* OK */;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2973,6 +2981,7 @@ push_template_decl_real (tree decl, int is_friend)
|
|||||||
error ("got %d template parameters for `%#T'",
|
error ("got %d template parameters for `%#T'",
|
||||||
TREE_VEC_LENGTH (a), current);
|
TREE_VEC_LENGTH (a), current);
|
||||||
error (" but %d required", TREE_VEC_LENGTH (t));
|
error (" but %d required", TREE_VEC_LENGTH (t));
|
||||||
|
return error_mark_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perhaps we should also check that the parms are used in the
|
/* Perhaps we should also check that the parms are used in the
|
||||||
@ -3074,10 +3083,9 @@ redeclare_class_template (tree type, tree parms)
|
|||||||
if (TREE_VEC_LENGTH (parms) != TREE_VEC_LENGTH (tmpl_parms))
|
if (TREE_VEC_LENGTH (parms) != TREE_VEC_LENGTH (tmpl_parms))
|
||||||
{
|
{
|
||||||
cp_error_at ("previous declaration `%D'", tmpl);
|
cp_error_at ("previous declaration `%D'", tmpl);
|
||||||
error ("used %d template parameter%s instead of %d",
|
error ("used %d template parameter(s) instead of %d",
|
||||||
TREE_VEC_LENGTH (tmpl_parms),
|
TREE_VEC_LENGTH (tmpl_parms),
|
||||||
TREE_VEC_LENGTH (tmpl_parms) == 1 ? "" : "s",
|
TREE_VEC_LENGTH (parms));
|
||||||
TREE_VEC_LENGTH (parms));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4067,18 +4075,9 @@ lookup_template_function (tree fns, tree arglist)
|
|||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
my_friendly_assert (!arglist || TREE_CODE (arglist) == TREE_VEC, 20030726);
|
my_friendly_assert (!arglist || TREE_CODE (arglist) == TREE_VEC, 20030726);
|
||||||
if (fns == NULL_TREE
|
my_friendly_assert (fns && (is_overloaded_fn (fns)
|
||||||
|| TREE_CODE (fns) == FUNCTION_DECL)
|
|| TREE_CODE (fns) == IDENTIFIER_NODE),
|
||||||
{
|
20050608);
|
||||||
error ("non-template used as template");
|
|
||||||
return error_mark_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
my_friendly_assert (TREE_CODE (fns) == TEMPLATE_DECL
|
|
||||||
|| TREE_CODE (fns) == OVERLOAD
|
|
||||||
|| BASELINK_P (fns)
|
|
||||||
|| TREE_CODE (fns) == IDENTIFIER_NODE,
|
|
||||||
20020730);
|
|
||||||
|
|
||||||
if (BASELINK_P (fns))
|
if (BASELINK_P (fns))
|
||||||
{
|
{
|
||||||
@ -4809,11 +4808,14 @@ uses_template_parms (tree t)
|
|||||||
else if (TREE_CODE (t) == TREE_LIST)
|
else if (TREE_CODE (t) == TREE_LIST)
|
||||||
dependent_p = (uses_template_parms (TREE_VALUE (t))
|
dependent_p = (uses_template_parms (TREE_VALUE (t))
|
||||||
|| uses_template_parms (TREE_CHAIN (t)));
|
|| uses_template_parms (TREE_CHAIN (t)));
|
||||||
|
else if (TREE_CODE (t) == TYPE_DECL)
|
||||||
|
dependent_p = dependent_type_p (TREE_TYPE (t));
|
||||||
else if (DECL_P (t)
|
else if (DECL_P (t)
|
||||||
|| EXPR_P (t)
|
|| EXPR_P (t)
|
||||||
|| TREE_CODE (t) == TEMPLATE_PARM_INDEX
|
|| TREE_CODE (t) == TEMPLATE_PARM_INDEX
|
||||||
|| TREE_CODE (t) == OVERLOAD
|
|| TREE_CODE (t) == OVERLOAD
|
||||||
|| TREE_CODE (t) == BASELINK
|
|| TREE_CODE (t) == BASELINK
|
||||||
|
|| TREE_CODE (t) == IDENTIFIER_NODE
|
||||||
|| TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
|
|| TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
|
||||||
dependent_p = (type_dependent_expression_p (t)
|
dependent_p = (type_dependent_expression_p (t)
|
||||||
|| value_dependent_expression_p (t));
|
|| value_dependent_expression_p (t));
|
||||||
@ -5787,6 +5789,12 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain)
|
|||||||
tree r = NULL_TREE;
|
tree r = NULL_TREE;
|
||||||
tree* new_parms;
|
tree* new_parms;
|
||||||
|
|
||||||
|
/* When substituting into a template, we must set
|
||||||
|
PROCESSING_TEMPLATE_DECL as the template parameters may be
|
||||||
|
dependent if they are based on one-another, and the dependency
|
||||||
|
predicates are short-circuit outside of templates. */
|
||||||
|
++processing_template_decl;
|
||||||
|
|
||||||
for (new_parms = &r;
|
for (new_parms = &r;
|
||||||
TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args);
|
TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args);
|
||||||
new_parms = &(TREE_CHAIN (*new_parms)),
|
new_parms = &(TREE_CHAIN (*new_parms)),
|
||||||
@ -5816,6 +5824,8 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain)
|
|||||||
new_vec, NULL_TREE);
|
new_vec, NULL_TREE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--processing_template_decl;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6001,8 +6011,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||||||
: DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t));
|
: DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t));
|
||||||
tree full_args;
|
tree full_args;
|
||||||
|
|
||||||
|
/* Because this is a template, the arguments will still be
|
||||||
|
dependent, even after substitution. If
|
||||||
|
PROCESSING_TEMPLATE_DECL is not set, the dependency
|
||||||
|
predicates will short-circuit. */
|
||||||
|
++processing_template_decl;
|
||||||
full_args = tsubst_template_args (tmpl_args, args,
|
full_args = tsubst_template_args (tmpl_args, args,
|
||||||
complain, in_decl);
|
complain, in_decl);
|
||||||
|
--processing_template_decl;
|
||||||
|
|
||||||
/* tsubst_template_args doesn't copy the vector if
|
/* tsubst_template_args doesn't copy the vector if
|
||||||
nothing changed. But, *something* should have
|
nothing changed. But, *something* should have
|
||||||
@ -6034,15 +6050,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_CONTEXT (r)
|
|
||||||
= tsubst_aggr_type (DECL_CONTEXT (t), args,
|
|
||||||
complain, in_decl,
|
|
||||||
/*entering_scope=*/1);
|
|
||||||
DECL_TEMPLATE_INFO (r) = build_tree_list (t, args);
|
DECL_TEMPLATE_INFO (r) = build_tree_list (t, args);
|
||||||
|
|
||||||
if (TREE_CODE (decl) == TYPE_DECL)
|
if (TREE_CODE (decl) == TYPE_DECL)
|
||||||
{
|
{
|
||||||
tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
|
tree new_type;
|
||||||
|
++processing_template_decl;
|
||||||
|
new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
|
||||||
|
--processing_template_decl;
|
||||||
if (new_type == error_mark_node)
|
if (new_type == error_mark_node)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
@ -6050,10 +6065,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||||||
CLASSTYPE_TI_TEMPLATE (new_type) = r;
|
CLASSTYPE_TI_TEMPLATE (new_type) = r;
|
||||||
DECL_TEMPLATE_RESULT (r) = TYPE_MAIN_DECL (new_type);
|
DECL_TEMPLATE_RESULT (r) = TYPE_MAIN_DECL (new_type);
|
||||||
DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type);
|
DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type);
|
||||||
|
DECL_CONTEXT (r) = TYPE_CONTEXT (new_type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tree new_decl = tsubst (decl, args, complain, in_decl);
|
tree new_decl;
|
||||||
|
++processing_template_decl;
|
||||||
|
new_decl = tsubst (decl, args, complain, in_decl);
|
||||||
|
--processing_template_decl;
|
||||||
if (new_decl == error_mark_node)
|
if (new_decl == error_mark_node)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
@ -6061,6 +6080,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||||||
DECL_TI_TEMPLATE (new_decl) = r;
|
DECL_TI_TEMPLATE (new_decl) = r;
|
||||||
TREE_TYPE (r) = TREE_TYPE (new_decl);
|
TREE_TYPE (r) = TREE_TYPE (new_decl);
|
||||||
DECL_TI_ARGS (r) = DECL_TI_ARGS (new_decl);
|
DECL_TI_ARGS (r) = DECL_TI_ARGS (new_decl);
|
||||||
|
DECL_CONTEXT (r) = DECL_CONTEXT (new_decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_DECL_IMPLICIT_INSTANTIATION (r);
|
SET_DECL_IMPLICIT_INSTANTIATION (r);
|
||||||
@ -6292,8 +6312,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||||||
clone_function_decl (r, /*update_method_vec_p=*/0);
|
clone_function_decl (r, /*update_method_vec_p=*/0);
|
||||||
}
|
}
|
||||||
else if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
|
else if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
|
||||||
grok_op_properties (r, DECL_FRIEND_P (r),
|
grok_op_properties (r, (complain & tf_error) != 0);
|
||||||
(complain & tf_error) != 0);
|
|
||||||
|
|
||||||
if (DECL_FRIEND_P (t) && DECL_FRIEND_CONTEXT (t))
|
if (DECL_FRIEND_P (t) && DECL_FRIEND_CONTEXT (t))
|
||||||
SET_DECL_FRIEND_CONTEXT (r,
|
SET_DECL_FRIEND_CONTEXT (r,
|
||||||
@ -6486,6 +6505,8 @@ tsubst_arg_types (tree arg_types,
|
|||||||
{
|
{
|
||||||
tree remaining_arg_types;
|
tree remaining_arg_types;
|
||||||
tree type;
|
tree type;
|
||||||
|
tree default_arg;
|
||||||
|
tree result = NULL_TREE;
|
||||||
|
|
||||||
if (!arg_types || arg_types == void_list_node)
|
if (!arg_types || arg_types == void_list_node)
|
||||||
return arg_types;
|
return arg_types;
|
||||||
@ -6513,12 +6534,25 @@ tsubst_arg_types (tree arg_types,
|
|||||||
top-level qualifiers as required. */
|
top-level qualifiers as required. */
|
||||||
type = TYPE_MAIN_VARIANT (type_decays_to (type));
|
type = TYPE_MAIN_VARIANT (type_decays_to (type));
|
||||||
|
|
||||||
/* Note that we do not substitute into default arguments here. The
|
/* We do not substitute into default arguments here. The standard
|
||||||
standard mandates that they be instantiated only when needed,
|
mandates that they be instantiated only when needed, which is
|
||||||
which is done in build_over_call. */
|
done in build_over_call. */
|
||||||
return hash_tree_cons (TREE_PURPOSE (arg_types), type,
|
default_arg = TREE_PURPOSE (arg_types);
|
||||||
remaining_arg_types);
|
|
||||||
|
if (default_arg && TREE_CODE (default_arg) == DEFAULT_ARG)
|
||||||
|
{
|
||||||
|
/* We've instantiated a template before its default arguments
|
||||||
|
have been parsed. This can happen for a nested template
|
||||||
|
class, and is not an error unless we require the default
|
||||||
|
argument in a call of this function. */
|
||||||
|
result = tree_cons (default_arg, type, remaining_arg_types);
|
||||||
|
TREE_CHAIN (default_arg) = tree_cons (result, NULL_TREE,
|
||||||
|
TREE_CHAIN (default_arg));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result = hash_tree_cons (default_arg, type, remaining_arg_types);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Substitute into a FUNCTION_TYPE or METHOD_TYPE. This routine does
|
/* Substitute into a FUNCTION_TYPE or METHOD_TYPE. This routine does
|
||||||
@ -6711,8 +6745,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
|||||||
/* The array dimension behaves like a non-type template arg,
|
/* The array dimension behaves like a non-type template arg,
|
||||||
in that we want to fold it as much as possible. */
|
in that we want to fold it as much as possible. */
|
||||||
max = tsubst_template_arg (omax, args, complain, in_decl);
|
max = tsubst_template_arg (omax, args, complain, in_decl);
|
||||||
if (!processing_template_decl)
|
max = fold_non_dependent_expr (max);
|
||||||
max = decl_constant_value (max);
|
|
||||||
|
|
||||||
if (integer_zerop (omax))
|
if (integer_zerop (omax))
|
||||||
{
|
{
|
||||||
@ -7774,6 +7807,10 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
|||||||
in_decl),
|
in_decl),
|
||||||
tsubst (TREE_TYPE (t), args, complain, in_decl));
|
tsubst (TREE_TYPE (t), args, complain, in_decl));
|
||||||
|
|
||||||
|
case OFFSET_REF:
|
||||||
|
mark_used (TREE_OPERAND (t, 1));
|
||||||
|
return t;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -9158,17 +9195,12 @@ type_unification_real (tree tparms,
|
|||||||
else
|
else
|
||||||
type = arg;
|
type = arg;
|
||||||
|
|
||||||
if (strict == DEDUCE_EXACT || strict == DEDUCE_ORDER)
|
if (same_type_p (parm, type))
|
||||||
{
|
|
||||||
if (same_type_p (parm, type))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* It might work; we shouldn't check now, because we might
|
|
||||||
get into infinite recursion. Overload resolution will
|
|
||||||
handle it. */
|
|
||||||
continue;
|
continue;
|
||||||
|
if (strict != DEDUCE_EXACT
|
||||||
|
&& can_convert_arg (parm, type, TYPE_P (arg) ? NULL_TREE : arg))
|
||||||
|
continue;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12024,7 +12056,8 @@ type_dependent_expression_p (tree expression)
|
|||||||
return true;
|
return true;
|
||||||
expression = TREE_OPERAND (expression, 0);
|
expression = TREE_OPERAND (expression, 0);
|
||||||
}
|
}
|
||||||
if (TREE_CODE (expression) == OVERLOAD)
|
if (TREE_CODE (expression) == OVERLOAD
|
||||||
|
|| TREE_CODE (expression) == FUNCTION_DECL)
|
||||||
{
|
{
|
||||||
while (expression)
|
while (expression)
|
||||||
{
|
{
|
||||||
@ -12037,6 +12070,8 @@ type_dependent_expression_p (tree expression)
|
|||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my_friendly_assert (TREE_CODE (expression) != TYPE_DECL, 20051116);
|
||||||
|
|
||||||
return (dependent_type_p (TREE_TYPE (expression)));
|
return (dependent_type_p (TREE_TYPE (expression)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,8 +946,12 @@ accessible_p (tree type, tree decl)
|
|||||||
/* In a template declaration, we cannot be sure whether the
|
/* In a template declaration, we cannot be sure whether the
|
||||||
particular specialization that is instantiated will be a friend
|
particular specialization that is instantiated will be a friend
|
||||||
or not. Therefore, all access checks are deferred until
|
or not. Therefore, all access checks are deferred until
|
||||||
instantiation. */
|
instantiation. However, PROCESSING_TEMPLATE_DECL is set in the
|
||||||
if (processing_template_decl)
|
parameter list for a template (because we may see dependent types
|
||||||
|
in default arguments for template parameters), and access
|
||||||
|
checking should be performed in the outermost parameter list. */
|
||||||
|
if (processing_template_decl
|
||||||
|
&& (!processing_template_parmlist || processing_template_decl > 1))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!TYPE_P (type))
|
if (!TYPE_P (type))
|
||||||
|
@ -2295,7 +2295,9 @@ check_multiple_declarators (void)
|
|||||||
void
|
void
|
||||||
qualified_name_lookup_error (tree scope, tree name)
|
qualified_name_lookup_error (tree scope, tree name)
|
||||||
{
|
{
|
||||||
if (TYPE_P (scope))
|
if (scope == error_mark_node)
|
||||||
|
; /* We already complained. */
|
||||||
|
else if (TYPE_P (scope))
|
||||||
{
|
{
|
||||||
if (!COMPLETE_TYPE_P (scope))
|
if (!COMPLETE_TYPE_P (scope))
|
||||||
error ("incomplete type `%T' used in nested name specifier", scope);
|
error ("incomplete type `%T' used in nested name specifier", scope);
|
||||||
@ -2398,6 +2400,21 @@ finish_id_expression (tree id_expression,
|
|||||||
was entirely defined. */
|
was entirely defined. */
|
||||||
if (!scope && decl != error_mark_node)
|
if (!scope && decl != error_mark_node)
|
||||||
maybe_note_name_used_in_class (id_expression, decl);
|
maybe_note_name_used_in_class (id_expression, decl);
|
||||||
|
|
||||||
|
/* Disallow uses of local variables from containing functions. */
|
||||||
|
if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
|
||||||
|
{
|
||||||
|
tree context = decl_function_context (decl);
|
||||||
|
if (context != NULL_TREE && context != current_function_decl
|
||||||
|
&& ! TREE_STATIC (decl))
|
||||||
|
{
|
||||||
|
error (TREE_CODE (decl) == VAR_DECL
|
||||||
|
? "use of `auto' variable from containing function"
|
||||||
|
: "use of parameter from containing function");
|
||||||
|
cp_error_at (" `%#D' declared here", decl);
|
||||||
|
return error_mark_node;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we didn't find anything, or what we found was a type,
|
/* If we didn't find anything, or what we found was a type,
|
||||||
@ -2664,23 +2681,6 @@ finish_id_expression (tree id_expression,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TREE_CODE (decl) == VAR_DECL
|
|
||||||
|| TREE_CODE (decl) == PARM_DECL
|
|
||||||
|| TREE_CODE (decl) == RESULT_DECL)
|
|
||||||
{
|
|
||||||
tree context = decl_function_context (decl);
|
|
||||||
|
|
||||||
if (context != NULL_TREE && context != current_function_decl
|
|
||||||
&& ! TREE_STATIC (decl))
|
|
||||||
{
|
|
||||||
error ("use of %s from containing function",
|
|
||||||
(TREE_CODE (decl) == VAR_DECL
|
|
||||||
? "`auto' variable" : "parameter"));
|
|
||||||
cp_error_at (" `%#D' declared here", decl);
|
|
||||||
return error_mark_node;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DECL_P (decl) && DECL_NONLOCAL (decl)
|
if (DECL_P (decl) && DECL_NONLOCAL (decl)
|
||||||
&& DECL_CLASS_SCOPE_P (decl)
|
&& DECL_CLASS_SCOPE_P (decl)
|
||||||
&& DECL_CONTEXT (decl) != current_class_type)
|
&& DECL_CONTEXT (decl) != current_class_type)
|
||||||
|
@ -95,6 +95,9 @@ require_complete_type (tree value)
|
|||||||
else
|
else
|
||||||
type = TREE_TYPE (value);
|
type = TREE_TYPE (value);
|
||||||
|
|
||||||
|
if (type == error_mark_node)
|
||||||
|
return error_mark_node;
|
||||||
|
|
||||||
/* First, detect a valid value with a complete type. */
|
/* First, detect a valid value with a complete type. */
|
||||||
if (COMPLETE_TYPE_P (type))
|
if (COMPLETE_TYPE_P (type))
|
||||||
return value;
|
return value;
|
||||||
@ -265,10 +268,12 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
|
|||||||
/* FIXME: Attributes. */
|
/* FIXME: Attributes. */
|
||||||
my_friendly_assert (ARITHMETIC_TYPE_P (t1)
|
my_friendly_assert (ARITHMETIC_TYPE_P (t1)
|
||||||
|| TREE_CODE (t1) == COMPLEX_TYPE
|
|| TREE_CODE (t1) == COMPLEX_TYPE
|
||||||
|
|| TREE_CODE (t1) == VECTOR_TYPE
|
||||||
|| TREE_CODE (t1) == ENUMERAL_TYPE,
|
|| TREE_CODE (t1) == ENUMERAL_TYPE,
|
||||||
19990725);
|
19990725);
|
||||||
my_friendly_assert (ARITHMETIC_TYPE_P (t2)
|
my_friendly_assert (ARITHMETIC_TYPE_P (t2)
|
||||||
|| TREE_CODE (t2) == COMPLEX_TYPE
|
|| TREE_CODE (t2) == COMPLEX_TYPE
|
||||||
|
|| TREE_CODE (t2) == VECTOR_TYPE
|
||||||
|| TREE_CODE (t2) == ENUMERAL_TYPE,
|
|| TREE_CODE (t2) == ENUMERAL_TYPE,
|
||||||
19990725);
|
19990725);
|
||||||
|
|
||||||
@ -296,6 +301,16 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
|
|||||||
attributes);
|
attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (code1 == VECTOR_TYPE)
|
||||||
|
{
|
||||||
|
/* When we get here we should have two vectors of the same size.
|
||||||
|
Just prefer the unsigned one if present. */
|
||||||
|
if (TREE_UNSIGNED (t1))
|
||||||
|
return build_type_attribute_variant (t1, attributes);
|
||||||
|
else
|
||||||
|
return build_type_attribute_variant (t2, attributes);
|
||||||
|
}
|
||||||
|
|
||||||
/* If only one is real, use it as the result. */
|
/* If only one is real, use it as the result. */
|
||||||
if (code1 == REAL_TYPE && code2 != REAL_TYPE)
|
if (code1 == REAL_TYPE && code2 != REAL_TYPE)
|
||||||
return build_type_attribute_variant (t1, attributes);
|
return build_type_attribute_variant (t1, attributes);
|
||||||
@ -745,9 +760,9 @@ common_type (tree t1, tree t2)
|
|||||||
code2 = TREE_CODE (t2);
|
code2 = TREE_CODE (t2);
|
||||||
|
|
||||||
if ((ARITHMETIC_TYPE_P (t1) || code1 == ENUMERAL_TYPE
|
if ((ARITHMETIC_TYPE_P (t1) || code1 == ENUMERAL_TYPE
|
||||||
|| code1 == COMPLEX_TYPE)
|
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE)
|
||||||
&& (ARITHMETIC_TYPE_P (t2) || code2 == ENUMERAL_TYPE
|
&& (ARITHMETIC_TYPE_P (t2) || code2 == ENUMERAL_TYPE
|
||||||
|| code2 == COMPLEX_TYPE))
|
|| code2 == COMPLEX_TYPE || code2 == VECTOR_TYPE))
|
||||||
return type_after_usual_arithmetic_conversions (t1, t2);
|
return type_after_usual_arithmetic_conversions (t1, t2);
|
||||||
|
|
||||||
else if ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2))
|
else if ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2))
|
||||||
@ -2878,9 +2893,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|
|||||||
case ROUND_DIV_EXPR:
|
case ROUND_DIV_EXPR:
|
||||||
case EXACT_DIV_EXPR:
|
case EXACT_DIV_EXPR:
|
||||||
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
|
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
|
||||||
|| code0 == COMPLEX_TYPE)
|
|| code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
|
||||||
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE
|
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE
|
||||||
|| code1 == COMPLEX_TYPE))
|
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
|
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
|
||||||
warning ("division by zero in `%E / 0'", op0);
|
warning ("division by zero in `%E / 0'", op0);
|
||||||
@ -2907,7 +2922,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|
|||||||
case BIT_AND_EXPR:
|
case BIT_AND_EXPR:
|
||||||
case BIT_IOR_EXPR:
|
case BIT_IOR_EXPR:
|
||||||
case BIT_XOR_EXPR:
|
case BIT_XOR_EXPR:
|
||||||
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
|
if ((code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
|
||||||
|
|| (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE))
|
||||||
shorten = -1;
|
shorten = -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3158,12 +3174,17 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE)
|
if (((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE)
|
||||||
&&
|
&&
|
||||||
(code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE))
|
(code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE))
|
||||||
|
|| (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE))
|
||||||
{
|
{
|
||||||
int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
|
int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
|
||||||
|
|
||||||
|
if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
|
||||||
|
&& !tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1)))
|
||||||
|
error ("can't convert between vector values of different size");
|
||||||
|
|
||||||
if (shorten || common || short_compare)
|
if (shorten || common || short_compare)
|
||||||
result_type = common_type (type0, type1);
|
result_type = common_type (type0, type1);
|
||||||
|
|
||||||
@ -4776,7 +4797,7 @@ build_const_cast (tree type, tree expr)
|
|||||||
{
|
{
|
||||||
tree intype;
|
tree intype;
|
||||||
|
|
||||||
if (type == error_mark_node || expr == error_mark_node)
|
if (type == error_mark_node || error_operand_p (expr))
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
if (processing_template_decl)
|
if (processing_template_decl)
|
||||||
@ -6066,6 +6087,15 @@ check_return_expr (tree retval)
|
|||||||
/* Remember that this function did return a value. */
|
/* Remember that this function did return a value. */
|
||||||
current_function_returns_value = 1;
|
current_function_returns_value = 1;
|
||||||
|
|
||||||
|
/* Check for erroneous operands -- but after giving ourselves a
|
||||||
|
chance to provide an error about returning a value from a void
|
||||||
|
function. */
|
||||||
|
if (error_operand_p (retval))
|
||||||
|
{
|
||||||
|
current_function_return_value = error_mark_node;
|
||||||
|
return error_mark_node;
|
||||||
|
}
|
||||||
|
|
||||||
/* Only operator new(...) throw(), can return NULL [expr.new/13]. */
|
/* Only operator new(...) throw(), can return NULL [expr.new/13]. */
|
||||||
if ((DECL_OVERLOADED_OPERATOR_P (current_function_decl) == NEW_EXPR
|
if ((DECL_OVERLOADED_OPERATOR_P (current_function_decl) == NEW_EXPR
|
||||||
|| DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR)
|
|| DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR)
|
||||||
@ -6122,8 +6152,8 @@ check_return_expr (tree retval)
|
|||||||
|
|
||||||
/* We don't need to do any conversions when there's nothing being
|
/* We don't need to do any conversions when there's nothing being
|
||||||
returned. */
|
returned. */
|
||||||
if (!retval || retval == error_mark_node)
|
if (!retval)
|
||||||
return retval;
|
return NULL_TREE;
|
||||||
|
|
||||||
/* Do any required conversions. */
|
/* Do any required conversions. */
|
||||||
if (retval == result || DECL_CONSTRUCTOR_P (current_function_decl))
|
if (retval == result || DECL_CONSTRUCTOR_P (current_function_decl))
|
||||||
@ -6314,11 +6344,6 @@ casts_away_constness_r (tree *t1, tree *t2)
|
|||||||
and pointers to members (conv.qual), the "member" aspect of a
|
and pointers to members (conv.qual), the "member" aspect of a
|
||||||
pointer to member level is ignored when determining if a const
|
pointer to member level is ignored when determining if a const
|
||||||
cv-qualifier has been cast away. */
|
cv-qualifier has been cast away. */
|
||||||
if (TYPE_PTRMEM_P (*t1))
|
|
||||||
*t1 = build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (*t1));
|
|
||||||
if (TYPE_PTRMEM_P (*t2))
|
|
||||||
*t2 = build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (*t2));
|
|
||||||
|
|
||||||
/* [expr.const.cast]
|
/* [expr.const.cast]
|
||||||
|
|
||||||
For two pointer types:
|
For two pointer types:
|
||||||
@ -6336,9 +6361,8 @@ casts_away_constness_r (tree *t1, tree *t2)
|
|||||||
to
|
to
|
||||||
|
|
||||||
Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */
|
Tcv2,(M-K+1) * cv2,(M-K+2) * ... cv2,M *. */
|
||||||
|
if ((!TYPE_PTR_P (*t1) && !TYPE_PTRMEM_P (*t1))
|
||||||
if (TREE_CODE (*t1) != POINTER_TYPE
|
|| (!TYPE_PTR_P (*t2) && !TYPE_PTRMEM_P (*t2)))
|
||||||
|| TREE_CODE (*t2) != POINTER_TYPE)
|
|
||||||
{
|
{
|
||||||
*t1 = cp_build_qualified_type (void_type_node,
|
*t1 = cp_build_qualified_type (void_type_node,
|
||||||
cp_type_quals (*t1));
|
cp_type_quals (*t1));
|
||||||
@ -6349,8 +6373,16 @@ casts_away_constness_r (tree *t1, tree *t2)
|
|||||||
|
|
||||||
quals1 = cp_type_quals (*t1);
|
quals1 = cp_type_quals (*t1);
|
||||||
quals2 = cp_type_quals (*t2);
|
quals2 = cp_type_quals (*t2);
|
||||||
*t1 = TREE_TYPE (*t1);
|
|
||||||
*t2 = TREE_TYPE (*t2);
|
if (TYPE_PTRMEM_P (*t1))
|
||||||
|
*t1 = TYPE_PTRMEM_POINTED_TO_TYPE (*t1);
|
||||||
|
else
|
||||||
|
*t1 = TREE_TYPE (*t1);
|
||||||
|
if (TYPE_PTRMEM_P (*t2))
|
||||||
|
*t2 = TYPE_PTRMEM_POINTED_TO_TYPE (*t2);
|
||||||
|
else
|
||||||
|
*t2 = TREE_TYPE (*t2);
|
||||||
|
|
||||||
casts_away_constness_r (t1, t2);
|
casts_away_constness_r (t1, t2);
|
||||||
*t1 = build_pointer_type (*t1);
|
*t1 = build_pointer_type (*t1);
|
||||||
*t2 = build_pointer_type (*t2);
|
*t2 = build_pointer_type (*t2);
|
||||||
|
@ -164,7 +164,7 @@ static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import);
|
|||||||
static struct cpp_dir *search_path_head (cpp_reader *, const char *fname,
|
static struct cpp_dir *search_path_head (cpp_reader *, const char *fname,
|
||||||
int angle_brackets, enum include_type);
|
int angle_brackets, enum include_type);
|
||||||
static const char *dir_name_of_file (_cpp_file *file);
|
static const char *dir_name_of_file (_cpp_file *file);
|
||||||
static void open_file_failed (cpp_reader *pfile, _cpp_file *file);
|
static void open_file_failed (cpp_reader *pfile, _cpp_file *file, int);
|
||||||
static struct file_hash_entry *search_cache (struct file_hash_entry *head,
|
static struct file_hash_entry *search_cache (struct file_hash_entry *head,
|
||||||
const cpp_dir *start_dir);
|
const cpp_dir *start_dir);
|
||||||
static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname);
|
static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname);
|
||||||
@ -330,7 +330,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
|
|||||||
|
|
||||||
if (file->err_no != ENOENT)
|
if (file->err_no != ENOENT)
|
||||||
{
|
{
|
||||||
open_file_failed (pfile, file);
|
open_file_failed (pfile, file, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ _cpp_find_failed (_cpp_file *file)
|
|||||||
to open_file().
|
to open_file().
|
||||||
*/
|
*/
|
||||||
_cpp_file *
|
_cpp_file *
|
||||||
_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake)
|
_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake, int angle_brackets)
|
||||||
{
|
{
|
||||||
struct file_hash_entry *entry, **hash_slot;
|
struct file_hash_entry *entry, **hash_slot;
|
||||||
_cpp_file *file;
|
_cpp_file *file;
|
||||||
@ -391,7 +391,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f
|
|||||||
file->dir = file->dir->next;
|
file->dir = file->dir->next;
|
||||||
if (file->dir == NULL)
|
if (file->dir == NULL)
|
||||||
{
|
{
|
||||||
open_file_failed (pfile, file);
|
open_file_failed (pfile, file, angle_brackets);
|
||||||
if (invalid_pch)
|
if (invalid_pch)
|
||||||
{
|
{
|
||||||
cpp_error (pfile, CPP_DL_ERROR,
|
cpp_error (pfile, CPP_DL_ERROR,
|
||||||
@ -533,7 +533,7 @@ read_file (cpp_reader *pfile, _cpp_file *file)
|
|||||||
|
|
||||||
if (file->fd == -1 && !open_file (file))
|
if (file->fd == -1 && !open_file (file))
|
||||||
{
|
{
|
||||||
open_file_failed (pfile, file);
|
open_file_failed (pfile, file, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,16 +757,17 @@ _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets,
|
|||||||
if (!dir)
|
if (!dir)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false),
|
return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false,
|
||||||
|
angle_brackets),
|
||||||
type == IT_IMPORT);
|
type == IT_IMPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Could not open FILE. The complication is dependency output. */
|
/* Could not open FILE. The complication is dependency output. */
|
||||||
static void
|
static void
|
||||||
open_file_failed (cpp_reader *pfile, _cpp_file *file)
|
open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets)
|
||||||
{
|
{
|
||||||
int sysp = pfile->map ? pfile->map->sysp: 0;
|
int sysp = pfile->map ? pfile->map->sysp: 0;
|
||||||
bool print_dep = CPP_OPTION (pfile, deps.style) > !!sysp;
|
bool print_dep = CPP_OPTION (pfile, deps.style) > (angle_brackets || !!sysp);
|
||||||
|
|
||||||
errno = file->err_no;
|
errno = file->err_no;
|
||||||
if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT)
|
if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT)
|
||||||
@ -948,7 +949,7 @@ _cpp_cleanup_files (cpp_reader *pfile)
|
|||||||
void
|
void
|
||||||
_cpp_fake_include (cpp_reader *pfile, const char *fname)
|
_cpp_fake_include (cpp_reader *pfile, const char *fname)
|
||||||
{
|
{
|
||||||
_cpp_find_file (pfile, fname, pfile->buffer->file->dir, true);
|
_cpp_find_file (pfile, fname, pfile->buffer->file->dir, true, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not everyone who wants to set system-header-ness on a buffer can
|
/* Not everyone who wants to set system-header-ness on a buffer can
|
||||||
@ -1030,7 +1031,7 @@ _cpp_compare_file_date (cpp_reader *pfile, const char *fname,
|
|||||||
if (!dir)
|
if (!dir)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
file = _cpp_find_file (pfile, fname, dir, false);
|
file = _cpp_find_file (pfile, fname, dir, false, angle_brackets);
|
||||||
if (file->err_no)
|
if (file->err_no)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1070,6 +1071,7 @@ _cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file)
|
|||||||
{
|
{
|
||||||
free ((void *) file->buffer);
|
free ((void *) file->buffer);
|
||||||
file->buffer = NULL;
|
file->buffer = NULL;
|
||||||
|
file->buffer_valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ extern void _cpp_destroy_hashtable (cpp_reader *);
|
|||||||
/* In cppfiles.c */
|
/* In cppfiles.c */
|
||||||
typedef struct _cpp_file _cpp_file;
|
typedef struct _cpp_file _cpp_file;
|
||||||
extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname,
|
extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname,
|
||||||
cpp_dir *start_dir, bool fake);
|
cpp_dir *start_dir, bool fake, int);
|
||||||
extern bool _cpp_find_failed (_cpp_file *);
|
extern bool _cpp_find_failed (_cpp_file *);
|
||||||
extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
|
extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
|
||||||
extern void _cpp_fake_include (cpp_reader *, const char *);
|
extern void _cpp_fake_include (cpp_reader *, const char *);
|
||||||
|
@ -468,7 +468,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pfile->main_file
|
pfile->main_file
|
||||||
= _cpp_find_file (pfile, fname, &pfile->no_search_path, false);
|
= _cpp_find_file (pfile, fname, &pfile->no_search_path, false, 0);
|
||||||
if (_cpp_find_failed (pfile->main_file))
|
if (_cpp_find_failed (pfile->main_file))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -479,6 +479,8 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
|
|||||||
if (CPP_OPTION (pfile, preprocessed))
|
if (CPP_OPTION (pfile, preprocessed))
|
||||||
{
|
{
|
||||||
read_original_filename (pfile);
|
read_original_filename (pfile);
|
||||||
|
if (!pfile->map)
|
||||||
|
return NULL;
|
||||||
fname = pfile->map->to_file;
|
fname = pfile->map->to_file;
|
||||||
}
|
}
|
||||||
return fname;
|
return fname;
|
||||||
@ -498,8 +500,10 @@ read_original_filename (cpp_reader *pfile)
|
|||||||
token = _cpp_lex_direct (pfile);
|
token = _cpp_lex_direct (pfile);
|
||||||
if (token->type == CPP_HASH)
|
if (token->type == CPP_HASH)
|
||||||
{
|
{
|
||||||
|
pfile->state.in_directive = 1;
|
||||||
token1 = _cpp_lex_direct (pfile);
|
token1 = _cpp_lex_direct (pfile);
|
||||||
_cpp_backup_tokens (pfile, 1);
|
_cpp_backup_tokens (pfile, 1);
|
||||||
|
pfile->state.in_directive = 0;
|
||||||
|
|
||||||
/* If it's a #line directive, handle it. */
|
/* If it's a #line directive, handle it. */
|
||||||
if (token1->type == CPP_NUMBER)
|
if (token1->type == CPP_NUMBER)
|
||||||
|
@ -3518,6 +3518,9 @@ fold_rtx (rtx x, rtx insn)
|
|||||||
addr = addr_ent->const_rtx;
|
addr = addr_ent->const_rtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Call target hook to avoid the effects of -fpic etc.... */
|
||||||
|
addr = targetm.delegitimize_address (addr);
|
||||||
|
|
||||||
/* If address is constant, split it into a base and integer offset. */
|
/* If address is constant, split it into a base and integer offset. */
|
||||||
if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF)
|
if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF)
|
||||||
base = addr;
|
base = addr;
|
||||||
|
@ -269,9 +269,12 @@ Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ.
|
|||||||
Peter Gerwinski for various bug fixes and the Pascal front end.
|
Peter Gerwinski for various bug fixes and the Pascal front end.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Kaveh Ghazi for his direction via the steering committee,
|
Kaveh R.@: Ghazi for his direction via the steering committee, amazing
|
||||||
amazing work to make @samp{-W -Wall} useful, and continuously testing
|
work to make @samp{-W -Wall -W* -Werror} useful, and continuously
|
||||||
GCC on a plethora of platforms.
|
testing GCC on a plethora of platforms. Kaveh extends his gratitude to
|
||||||
|
the @uref{http://www.caip.rutgers.edu,,CAIP Center} at Rutgers
|
||||||
|
University for providing him with computing resources to work on Free
|
||||||
|
Software since the late 1980s.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
John Gilmore for a donation to the FSF earmarked improving GNU Java.
|
John Gilmore for a donation to the FSF earmarked improving GNU Java.
|
||||||
|
@ -42,35 +42,31 @@ This host hook is used to set up handling for extra signals. The most
|
|||||||
common thing to do in this hook is to detect stack overflow.
|
common thing to do in this hook is to detect stack overflow.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
@deftypefn {Host Hook} void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t @var{size})
|
@deftypefn {Host Hook} void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t @var{size}, int @var{fd})
|
||||||
This host hook returns the address of some space in which a PCH may be
|
This host hook returns the address of some space that is likely to be
|
||||||
loaded with @samp{HOST_HOOKS_PCH_LOAD_PCH}. The space will need to
|
free in some subsequent invocation of the compiler. We intend to load
|
||||||
have @var{size} bytes. If insufficient space is available,
|
the PCH data at this address such that the data need not be relocated.
|
||||||
@samp{NULL} may be returned; the PCH machinery will try to find a
|
The area should be able to hold @var{size} bytes. If the host uses
|
||||||
suitable address using a heuristic.
|
@code{mmap}, @var{fd} is an open file descriptor that can be used for
|
||||||
|
probing.
|
||||||
The memory does not have to be available now. In fact, usually
|
|
||||||
@samp{HOST_HOOKS_PCH_LOAD_PCH} will already have been called. The memory
|
|
||||||
need only be available in future invocations of GCC.
|
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
@deftypefn {Host Hook} bool HOST_HOOKS_GT_PCH_USE_ADDRESS (size_t @var{size}, void * @var{address})
|
@deftypefn {Host Hook} int HOST_HOOKS_GT_PCH_USE_ADDRESS (void * @var{address}, size_t @var{size}, int @var{fd}, size_t @var{offset})
|
||||||
This host hook is called when a PCH file is about to be loaded. If
|
This host hook is called when a PCH file is about to be loaded.
|
||||||
@var{address} is the address that would have been returned by
|
We want to load @var{size} bytes from @var{fd} at @var{offset}
|
||||||
@samp{HOST_HOOKS_PCH_MEMORY_ADDRESS}, and @var{size} is smaller than
|
into memory at @var{address}. The given address will be the result of
|
||||||
the maximum than @samp{HOST_HOOKS_PCH_MEMORY_ADDRESS} would have
|
a previous invocation of @code{HOST_HOOKS_GT_PCH_GET_ADDRESS}.
|
||||||
accepted, return true, otherwise return false.
|
Return @minus{}1 if we couldn't allocate @var{size} bytes at @var{address}.
|
||||||
|
Return 0 if the memory is allocated but the data is not loaded. Return 1
|
||||||
|
if the hook has performed everything.
|
||||||
|
|
||||||
In addition, free any address space reserved that isn't needed to hold
|
If the implementation uses reserved address space, free any reserved
|
||||||
@var{size} bytes (whether or not true is returned). The PCH machinery will
|
space beyond @var{size}, regardless of the return value. If no PCH will
|
||||||
use @samp{mmap} with @samp{MAP_FIXED} to load the PCH if @samp{HAVE_MMAP_FILE},
|
be loaded, this hook may be called with @var{size} zero, in which case
|
||||||
or will use @samp{fread} otherwise.
|
all reserved address space should be freed.
|
||||||
|
|
||||||
If no PCH will be loaded, this hook may be called with @var{size}
|
|
||||||
zero, in which case all reserved address space should be freed.
|
|
||||||
|
|
||||||
Do not try to handle values of @var{address} that could not have been
|
Do not try to handle values of @var{address} that could not have been
|
||||||
returned by this executable; just return false. Such values usually
|
returned by this executable; just return @minus{}1. Such values usually
|
||||||
indicate an out-of-date PCH file (built by some other GCC executable),
|
indicate an out-of-date PCH file (built by some other GCC executable),
|
||||||
and such a PCH file won't work.
|
and such a PCH file won't work.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
@c Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
@c Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
@c This is part of the GCC manual.
|
@c This is part of the GCC manual.
|
||||||
@c For copying conditions, see the file gcc.texi.
|
@c For copying conditions, see the file gcc.texi.
|
||||||
|
|
||||||
@c Common values used in the GCC manuals:
|
@c Common values used in the GCC manuals:
|
||||||
|
|
||||||
@set version-GCC 3.4.4
|
@set version-GCC 3.4.6
|
||||||
|
|
||||||
@c DEVELOPMENT is set to indicate an in-development version,
|
@c DEVELOPMENT is set to indicate an in-development version,
|
||||||
@c as compared to a release version. When making a release
|
@c as compared to a release version. When making a release
|
||||||
|
@ -3651,7 +3651,8 @@ invoking @option{-O2} on programs that use computed gotos.
|
|||||||
@opindex O3
|
@opindex O3
|
||||||
Optimize yet more. @option{-O3} turns on all optimizations specified by
|
Optimize yet more. @option{-O3} turns on all optimizations specified by
|
||||||
@option{-O2} and also turns on the @option{-finline-functions},
|
@option{-O2} and also turns on the @option{-finline-functions},
|
||||||
@option{-fweb} and @option{-frename-registers} options.
|
@option{-fweb}, @option{-frename-registers} and @option{-funswitch-loops}
|
||||||
|
options.
|
||||||
|
|
||||||
@item -O0
|
@item -O0
|
||||||
@opindex O0
|
@opindex O0
|
||||||
@ -8691,7 +8692,8 @@ have any affect on which ld is called, it only changes what parameters
|
|||||||
are passed to that ld. The ld that is called is determined by the
|
are passed to that ld. The ld that is called is determined by the
|
||||||
@option{--with-ld} configure option, GCC's program search path, and
|
@option{--with-ld} configure option, GCC's program search path, and
|
||||||
finally by the user's @env{PATH}. The linker used by GCC can be printed
|
finally by the user's @env{PATH}. The linker used by GCC can be printed
|
||||||
using @samp{which `gcc -print-prog-name=ld`}.
|
using @samp{which `gcc -print-prog-name=ld`}. This option is only available
|
||||||
|
on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
|
||||||
|
|
||||||
@item -mhp-ld
|
@item -mhp-ld
|
||||||
@opindex hp-ld
|
@opindex hp-ld
|
||||||
@ -8703,7 +8705,8 @@ which ld is called, it only changes what parameters are passed to that
|
|||||||
ld. The ld that is called is determined by the @option{--with-ld}
|
ld. The ld that is called is determined by the @option{--with-ld}
|
||||||
configure option, GCC's program search path, and finally by the user's
|
configure option, GCC's program search path, and finally by the user's
|
||||||
@env{PATH}. The linker used by GCC can be printed using @samp{which
|
@env{PATH}. The linker used by GCC can be printed using @samp{which
|
||||||
`gcc -print-prog-name=ld`}.
|
`gcc -print-prog-name=ld`}. This option is only available on the 64 bit
|
||||||
|
HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
|
||||||
|
|
||||||
@item -mlong-calls
|
@item -mlong-calls
|
||||||
@opindex mno-long-calls
|
@opindex mno-long-calls
|
||||||
@ -10075,8 +10078,8 @@ specified separated by a comma.
|
|||||||
Specify bit size of immediate TLS offsets. Valid values are 14, 22, and
|
Specify bit size of immediate TLS offsets. Valid values are 14, 22, and
|
||||||
64.
|
64.
|
||||||
|
|
||||||
@item -mtune-arch=@var{cpu-type}
|
@item -mtune=@var{cpu-type}
|
||||||
@opindex mtune-arch
|
@opindex mtune
|
||||||
Tune the instruction scheduling for a particular CPU, Valid values are
|
Tune the instruction scheduling for a particular CPU, Valid values are
|
||||||
itanium, itanium1, merced, itanium2, and mckinley.
|
itanium, itanium1, merced, itanium2, and mckinley.
|
||||||
|
|
||||||
|
@ -389,25 +389,11 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
|
|||||||
|| (offset * BITS_PER_UNIT % bitsize == 0
|
|| (offset * BITS_PER_UNIT % bitsize == 0
|
||||||
&& MEM_ALIGN (op0) % GET_MODE_BITSIZE (fieldmode) == 0))))
|
&& MEM_ALIGN (op0) % GET_MODE_BITSIZE (fieldmode) == 0))))
|
||||||
{
|
{
|
||||||
if (GET_MODE (op0) != fieldmode)
|
if (GET_CODE (op0) == MEM)
|
||||||
{
|
op0 = adjust_address (op0, fieldmode, offset);
|
||||||
if (GET_CODE (op0) == SUBREG)
|
else if (GET_MODE (op0) != fieldmode)
|
||||||
{
|
op0 = simplify_gen_subreg (fieldmode, op0, GET_MODE (op0),
|
||||||
if (GET_MODE (SUBREG_REG (op0)) == fieldmode
|
byte_offset);
|
||||||
|| GET_MODE_CLASS (fieldmode) == MODE_INT
|
|
||||||
|| GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT)
|
|
||||||
op0 = SUBREG_REG (op0);
|
|
||||||
else
|
|
||||||
/* Else we've got some float mode source being extracted into
|
|
||||||
a different float mode destination -- this combination of
|
|
||||||
subregs results in Severe Tire Damage. */
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
if (GET_CODE (op0) == REG)
|
|
||||||
op0 = gen_rtx_SUBREG (fieldmode, op0, byte_offset);
|
|
||||||
else
|
|
||||||
op0 = adjust_address (op0, fieldmode, offset);
|
|
||||||
}
|
|
||||||
emit_move_insn (op0, value);
|
emit_move_insn (op0, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -622,6 +608,7 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
|
|||||||
bestmode = GET_MODE (op0);
|
bestmode = GET_MODE (op0);
|
||||||
|
|
||||||
if (bestmode == VOIDmode
|
if (bestmode == VOIDmode
|
||||||
|
|| GET_MODE_SIZE (bestmode) < GET_MODE_SIZE (fieldmode)
|
||||||
|| (SLOW_UNALIGNED_ACCESS (bestmode, MEM_ALIGN (op0))
|
|| (SLOW_UNALIGNED_ACCESS (bestmode, MEM_ALIGN (op0))
|
||||||
&& GET_MODE_BITSIZE (bestmode) > MEM_ALIGN (op0)))
|
&& GET_MODE_BITSIZE (bestmode) > MEM_ALIGN (op0)))
|
||||||
goto insv_loses;
|
goto insv_loses;
|
||||||
@ -1401,6 +1388,11 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
|
|||||||
xbitpos = bitnum % unit;
|
xbitpos = bitnum % unit;
|
||||||
xop0 = adjust_address (xop0, bestmode, xoffset);
|
xop0 = adjust_address (xop0, bestmode, xoffset);
|
||||||
|
|
||||||
|
/* Make sure register is big enough for the whole field. */
|
||||||
|
if (xoffset * BITS_PER_UNIT + unit
|
||||||
|
< offset * BITS_PER_UNIT + bitsize)
|
||||||
|
goto extzv_loses;
|
||||||
|
|
||||||
/* Fetch it to a register in that size. */
|
/* Fetch it to a register in that size. */
|
||||||
xop0 = force_reg (bestmode, xop0);
|
xop0 = force_reg (bestmode, xop0);
|
||||||
|
|
||||||
@ -1531,6 +1523,11 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
|
|||||||
xbitpos = bitnum % unit;
|
xbitpos = bitnum % unit;
|
||||||
xop0 = adjust_address (xop0, bestmode, xoffset);
|
xop0 = adjust_address (xop0, bestmode, xoffset);
|
||||||
|
|
||||||
|
/* Make sure register is big enough for the whole field. */
|
||||||
|
if (xoffset * BITS_PER_UNIT + unit
|
||||||
|
< offset * BITS_PER_UNIT + bitsize)
|
||||||
|
goto extv_loses;
|
||||||
|
|
||||||
/* Fetch it to a register in that size. */
|
/* Fetch it to a register in that size. */
|
||||||
xop0 = force_reg (bestmode, xop0);
|
xop0 = force_reg (bestmode, xop0);
|
||||||
|
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
2006-03-05 Release Manager
|
||||||
|
|
||||||
|
* GCC 3.4.6 released.
|
||||||
|
|
||||||
|
2006-01-21 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* g77spec.c (lang_specific_driver): Update copyright notice date.
|
||||||
|
|
||||||
|
2005-12-27 Toon Moene <toon@moene.indiv.nluug.nl>
|
||||||
|
|
||||||
|
PR/25494
|
||||||
|
* g77.texi: Corrected entry about catching
|
||||||
|
Floating Point Exceptions.
|
||||||
|
|
||||||
|
2005-11-30 Release Manager
|
||||||
|
|
||||||
|
* GCC 3.4.5 released.
|
||||||
|
|
||||||
2005-05-19 Release Manager
|
2005-05-19 Release Manager
|
||||||
|
|
||||||
* GCC 3.4.4 released.
|
* GCC 3.4.4 released.
|
||||||
|
@ -9415,12 +9415,13 @@ trapfpe ()
|
|||||||
@}
|
@}
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
A convenient trick is to compile this something like:
|
Assuming the above source is in file @file{trapfpe.c},
|
||||||
|
then compile this routine as follows:
|
||||||
@smallexample
|
@smallexample
|
||||||
gcc -o libtrapfpe.a trapfpe.c
|
gcc -c trapfpe.c
|
||||||
@end smallexample
|
@end smallexample
|
||||||
and then use it by adding @option{-trapfpe} to the @command{g77} command line
|
and subsequently use it by adding @file{trapfpe.o} to the @command{g77}
|
||||||
when linking.
|
command line when linking.
|
||||||
|
|
||||||
@node Nonportable Conversions
|
@node Nonportable Conversions
|
||||||
@subsection Nonportable Conversions
|
@subsection Nonportable Conversions
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Specific flags and argument handling of the Fortran front-end.
|
/* Specific flags and argument handling of the Fortran front-end.
|
||||||
Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004
|
Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
@ -370,7 +370,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
|
|||||||
|
|
||||||
case OPTION_version:
|
case OPTION_version:
|
||||||
printf ("GNU Fortran (GCC) %s\n", version_string);
|
printf ("GNU Fortran (GCC) %s\n", version_string);
|
||||||
printf ("Copyright %s 2004 Free Software Foundation, Inc.\n",
|
printf ("Copyright %s 2006 Free Software Foundation, Inc.\n",
|
||||||
_("(C)"));
|
_("(C)"));
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
printf (_("\
|
printf (_("\
|
||||||
|
@ -104,7 +104,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||||||
|
|
||||||
life_analysis fills in certain vectors containing information about
|
life_analysis fills in certain vectors containing information about
|
||||||
register usage: REG_N_REFS, REG_N_DEATHS, REG_N_SETS, REG_LIVE_LENGTH,
|
register usage: REG_N_REFS, REG_N_DEATHS, REG_N_SETS, REG_LIVE_LENGTH,
|
||||||
REG_N_CALLS_CROSSED and REG_BASIC_BLOCK.
|
REG_N_CALLS_CROSSED, REG_N_THROWING_CALLS_CROSSED and REG_BASIC_BLOCK.
|
||||||
|
|
||||||
life_analysis sets current_function_sp_is_unchanging if the function
|
life_analysis sets current_function_sp_is_unchanging if the function
|
||||||
doesn't modify the stack pointer. */
|
doesn't modify the stack pointer. */
|
||||||
@ -1470,6 +1470,7 @@ allocate_reg_life_data (void)
|
|||||||
REG_N_REFS (i) = 0;
|
REG_N_REFS (i) = 0;
|
||||||
REG_N_DEATHS (i) = 0;
|
REG_N_DEATHS (i) = 0;
|
||||||
REG_N_CALLS_CROSSED (i) = 0;
|
REG_N_CALLS_CROSSED (i) = 0;
|
||||||
|
REG_N_THROWING_CALLS_CROSSED (i) = 0;
|
||||||
REG_LIVE_LENGTH (i) = 0;
|
REG_LIVE_LENGTH (i) = 0;
|
||||||
REG_FREQ (i) = 0;
|
REG_FREQ (i) = 0;
|
||||||
REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
|
REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
|
||||||
@ -1688,8 +1689,13 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn)
|
|||||||
record this for them. */
|
record this for them. */
|
||||||
|
|
||||||
if (GET_CODE (insn) == CALL_INSN && (flags & PROP_REG_INFO))
|
if (GET_CODE (insn) == CALL_INSN && (flags & PROP_REG_INFO))
|
||||||
EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
|
{
|
||||||
{ REG_N_CALLS_CROSSED (i)++; });
|
EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
|
||||||
|
{ REG_N_CALLS_CROSSED (i)++; });
|
||||||
|
if (can_throw_internal (insn))
|
||||||
|
EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
|
||||||
|
{ REG_N_THROWING_CALLS_CROSSED (i)++; });
|
||||||
|
}
|
||||||
|
|
||||||
/* Record sets. Do this even for dead instructions, since they
|
/* Record sets. Do this even for dead instructions, since they
|
||||||
would have killed the values if they hadn't been deleted. */
|
would have killed the values if they hadn't been deleted. */
|
||||||
@ -3365,7 +3371,11 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn,
|
|||||||
that REGNO now crosses them. */
|
that REGNO now crosses them. */
|
||||||
for (temp = insn; temp != incr; temp = NEXT_INSN (temp))
|
for (temp = insn; temp != incr; temp = NEXT_INSN (temp))
|
||||||
if (GET_CODE (temp) == CALL_INSN)
|
if (GET_CODE (temp) == CALL_INSN)
|
||||||
REG_N_CALLS_CROSSED (regno)++;
|
{
|
||||||
|
REG_N_CALLS_CROSSED (regno)++;
|
||||||
|
if (can_throw_internal (temp))
|
||||||
|
REG_N_THROWING_CALLS_CROSSED (regno)++;
|
||||||
|
}
|
||||||
|
|
||||||
/* Invalidate alias info for Q since we just changed its value. */
|
/* Invalidate alias info for Q since we just changed its value. */
|
||||||
clear_reg_alias_info (q);
|
clear_reg_alias_info (q);
|
||||||
|
@ -1467,33 +1467,36 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
|
|||||||
|
|
||||||
case RDIV_EXPR:
|
case RDIV_EXPR:
|
||||||
{
|
{
|
||||||
|
tree t1, t2, real, imag;
|
||||||
tree magsquared
|
tree magsquared
|
||||||
= const_binop (PLUS_EXPR,
|
= const_binop (PLUS_EXPR,
|
||||||
const_binop (MULT_EXPR, r2, r2, notrunc),
|
const_binop (MULT_EXPR, r2, r2, notrunc),
|
||||||
const_binop (MULT_EXPR, i2, i2, notrunc),
|
const_binop (MULT_EXPR, i2, i2, notrunc),
|
||||||
notrunc);
|
notrunc);
|
||||||
|
|
||||||
t = build_complex (type,
|
t1 = const_binop (PLUS_EXPR,
|
||||||
const_binop
|
const_binop (MULT_EXPR, r1, r2, notrunc),
|
||||||
(INTEGRAL_TYPE_P (TREE_TYPE (r1))
|
const_binop (MULT_EXPR, i1, i2, notrunc),
|
||||||
? TRUNC_DIV_EXPR : RDIV_EXPR,
|
notrunc);
|
||||||
const_binop (PLUS_EXPR,
|
t2 = const_binop (MINUS_EXPR,
|
||||||
const_binop (MULT_EXPR, r1, r2,
|
const_binop (MULT_EXPR, i1, r2, notrunc),
|
||||||
notrunc),
|
const_binop (MULT_EXPR, r1, i2, notrunc),
|
||||||
const_binop (MULT_EXPR, i1, i2,
|
notrunc);
|
||||||
notrunc),
|
|
||||||
notrunc),
|
if (INTEGRAL_TYPE_P (TREE_TYPE (r1)))
|
||||||
magsquared, notrunc),
|
{
|
||||||
const_binop
|
real = const_binop (TRUNC_DIV_EXPR, t1, magsquared, notrunc);
|
||||||
(INTEGRAL_TYPE_P (TREE_TYPE (r1))
|
imag = const_binop (TRUNC_DIV_EXPR, t2, magsquared, notrunc);
|
||||||
? TRUNC_DIV_EXPR : RDIV_EXPR,
|
}
|
||||||
const_binop (MINUS_EXPR,
|
else
|
||||||
const_binop (MULT_EXPR, i1, r2,
|
{
|
||||||
notrunc),
|
real = const_binop (RDIV_EXPR, t1, magsquared, notrunc);
|
||||||
const_binop (MULT_EXPR, r1, i2,
|
imag = const_binop (RDIV_EXPR, t2, magsquared, notrunc);
|
||||||
notrunc),
|
if (!real || !imag)
|
||||||
notrunc),
|
return NULL_TREE;
|
||||||
magsquared, notrunc));
|
}
|
||||||
|
|
||||||
|
t = build_complex (type, real, imag);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -7497,6 +7500,8 @@ fold (tree expr)
|
|||||||
else if (TREE_CODE (TREE_TYPE (arg0)) == INTEGER_TYPE
|
else if (TREE_CODE (TREE_TYPE (arg0)) == INTEGER_TYPE
|
||||||
&& TREE_CODE (arg0) == NOP_EXPR
|
&& TREE_CODE (arg0) == NOP_EXPR
|
||||||
&& (tem = get_unwidened (arg0, NULL_TREE)) != arg0
|
&& (tem = get_unwidened (arg0, NULL_TREE)) != arg0
|
||||||
|
&& (TYPE_PRECISION (TREE_TYPE (tem))
|
||||||
|
> TYPE_PRECISION (TREE_TYPE (arg0)))
|
||||||
&& (code == EQ_EXPR || code == NE_EXPR
|
&& (code == EQ_EXPR || code == NE_EXPR
|
||||||
|| TREE_UNSIGNED (TREE_TYPE (arg0))
|
|| TREE_UNSIGNED (TREE_TYPE (arg0))
|
||||||
== TREE_UNSIGNED (TREE_TYPE (tem)))
|
== TREE_UNSIGNED (TREE_TYPE (tem)))
|
||||||
@ -8137,7 +8142,12 @@ fold (tree expr)
|
|||||||
|
|
||||||
if (INTEGRAL_TYPE_P (type)
|
if (INTEGRAL_TYPE_P (type)
|
||||||
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
|
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
|
||||||
&& TREE_CODE (arg2) == INTEGER_CST)
|
&& TREE_CODE (arg2) == INTEGER_CST
|
||||||
|
/* ??? We somehow can end up here with
|
||||||
|
(unsigned int)1 == 1 ? 1U : 2U
|
||||||
|
for which we won't make any progress but recurse
|
||||||
|
indefinitely. Just stop here in this case. */
|
||||||
|
&& TREE_CODE (arg1) != INTEGER_CST)
|
||||||
switch (comp_code)
|
switch (comp_code)
|
||||||
{
|
{
|
||||||
case EQ_EXPR:
|
case EQ_EXPR:
|
||||||
@ -8194,8 +8204,9 @@ fold (tree expr)
|
|||||||
|
|
||||||
/* If the second operand is simpler than the third, swap them
|
/* If the second operand is simpler than the third, swap them
|
||||||
since that produces better jump optimization results. */
|
since that produces better jump optimization results. */
|
||||||
if (tree_swap_operands_p (TREE_OPERAND (t, 1),
|
if (truth_value_p (TREE_CODE (arg0))
|
||||||
TREE_OPERAND (t, 2), false))
|
&& tree_swap_operands_p (TREE_OPERAND (t, 1),
|
||||||
|
TREE_OPERAND (t, 2), false))
|
||||||
{
|
{
|
||||||
/* See if this can be inverted. If it can't, possibly because
|
/* See if this can be inverted. If it can't, possibly because
|
||||||
it was a floating-point inequality comparison, don't do
|
it was a floating-point inequality comparison, don't do
|
||||||
@ -8431,7 +8442,7 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
|
|||||||
{
|
{
|
||||||
void **slot;
|
void **slot;
|
||||||
enum tree_code code;
|
enum tree_code code;
|
||||||
char buf[sizeof (struct tree_decl)];
|
struct tree_decl buf;
|
||||||
int i, len;
|
int i, len;
|
||||||
|
|
||||||
if (sizeof (struct tree_exp) + 5 * sizeof (tree)
|
if (sizeof (struct tree_exp) + 5 * sizeof (tree)
|
||||||
@ -8448,23 +8459,23 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
|
|||||||
if (code == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (expr))
|
if (code == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (expr))
|
||||||
{
|
{
|
||||||
/* Allow SAVE_EXPR_NOPLACEHOLDER flag to be modified. */
|
/* Allow SAVE_EXPR_NOPLACEHOLDER flag to be modified. */
|
||||||
memcpy (buf, expr, tree_size (expr));
|
memcpy (&buf, expr, tree_size (expr));
|
||||||
expr = (tree) buf;
|
expr = (tree) &buf;
|
||||||
SAVE_EXPR_NOPLACEHOLDER (expr) = 0;
|
SAVE_EXPR_NOPLACEHOLDER (expr) = 0;
|
||||||
}
|
}
|
||||||
else if (TREE_CODE_CLASS (code) == 'd' && DECL_ASSEMBLER_NAME_SET_P (expr))
|
else if (TREE_CODE_CLASS (code) == 'd' && DECL_ASSEMBLER_NAME_SET_P (expr))
|
||||||
{
|
{
|
||||||
/* Allow DECL_ASSEMBLER_NAME to be modified. */
|
/* Allow DECL_ASSEMBLER_NAME to be modified. */
|
||||||
memcpy (buf, expr, tree_size (expr));
|
memcpy (&buf, expr, tree_size (expr));
|
||||||
expr = (tree) buf;
|
expr = (tree) &buf;
|
||||||
SET_DECL_ASSEMBLER_NAME (expr, NULL);
|
SET_DECL_ASSEMBLER_NAME (expr, NULL);
|
||||||
}
|
}
|
||||||
else if (TREE_CODE_CLASS (code) == 't'
|
else if (TREE_CODE_CLASS (code) == 't'
|
||||||
&& (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr)))
|
&& (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr)))
|
||||||
{
|
{
|
||||||
/* Allow TYPE_POINTER_TO and TYPE_REFERENCE_TO to be modified. */
|
/* Allow TYPE_POINTER_TO and TYPE_REFERENCE_TO to be modified. */
|
||||||
memcpy (buf, expr, tree_size (expr));
|
memcpy (&buf, expr, tree_size (expr));
|
||||||
expr = (tree) buf;
|
expr = (tree) &buf;
|
||||||
TYPE_POINTER_TO (expr) = NULL;
|
TYPE_POINTER_TO (expr) = NULL;
|
||||||
TYPE_REFERENCE_TO (expr) = NULL;
|
TYPE_REFERENCE_TO (expr) = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/* Compiler driver program that can handle many languages.
|
/* Compiler driver program that can handle many languages.
|
||||||
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||||
1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
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.
|
This file is part of GCC.
|
||||||
|
|
||||||
@ -3406,7 +3408,7 @@ process_command (int argc, const char **argv)
|
|||||||
{
|
{
|
||||||
/* translate_options () has turned --version into -fversion. */
|
/* translate_options () has turned --version into -fversion. */
|
||||||
printf (_("%s (GCC) %s\n"), programname, version_string);
|
printf (_("%s (GCC) %s\n"), programname, version_string);
|
||||||
printf ("Copyright %s 2004 Free Software Foundation, Inc.\n",
|
printf ("Copyright %s 2006 Free Software Foundation, Inc.\n",
|
||||||
_("(C)"));
|
_("(C)"));
|
||||||
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
|
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Dump a gcov file, for debugging use.
|
/* Dump a gcov file, for debugging use.
|
||||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Nathan Sidwell <nathan@codesourcery.com>
|
Contributed by Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
Gcov is free software; you can redistribute it and/or modify
|
Gcov is free software; you can redistribute it and/or modify
|
||||||
@ -118,7 +118,7 @@ static void
|
|||||||
print_version (void)
|
print_version (void)
|
||||||
{
|
{
|
||||||
printf ("gcov-dump (GCC) %s\n", version_string);
|
printf ("gcov-dump (GCC) %s\n", version_string);
|
||||||
printf ("Copyright (C) 2003 Free Software Foundation, Inc.\n");
|
printf ("Copyright (C) 2006 Free Software Foundation, Inc.\n");
|
||||||
printf ("This is free software; see the source for copying conditions.\n"
|
printf ("This is free software; see the source for copying conditions.\n"
|
||||||
"There is NO warranty; not even for MERCHANTABILITY or \n"
|
"There is NO warranty; not even for MERCHANTABILITY or \n"
|
||||||
"FITNESS FOR A PARTICULAR PURPOSE.\n\n");
|
"FITNESS FOR A PARTICULAR PURPOSE.\n\n");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* Gcov.c: prepend line execution counts and branch probabilities to a
|
/* Gcov.c: prepend line execution counts and branch probabilities to a
|
||||||
source file.
|
source file.
|
||||||
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
|
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
|
||||||
1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by James E. Wilson of Cygnus Support.
|
Contributed by James E. Wilson of Cygnus Support.
|
||||||
Mangled by Bob Manson of Cygnus Support.
|
Mangled by Bob Manson of Cygnus Support.
|
||||||
Mangled further by Nathan Sidwell <nathan@codesourcery.com>
|
Mangled further by Nathan Sidwell <nathan@codesourcery.com>
|
||||||
@ -420,7 +420,7 @@ static void
|
|||||||
print_version (void)
|
print_version (void)
|
||||||
{
|
{
|
||||||
fnotice (stdout, "gcov (GCC) %s\n", version_string);
|
fnotice (stdout, "gcov (GCC) %s\n", version_string);
|
||||||
fprintf (stdout, "Copyright %s 2004 Free Software Foundation, Inc.\n",
|
fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n",
|
||||||
_("(C)"));
|
_("(C)"));
|
||||||
fnotice (stdout,
|
fnotice (stdout,
|
||||||
_("This is free software; see the source for copying conditions.\n"
|
_("This is free software; see the source for copying conditions.\n"
|
||||||
|
@ -6445,7 +6445,7 @@ hoist_code (void)
|
|||||||
insn_inserted_p = 0;
|
insn_inserted_p = 0;
|
||||||
|
|
||||||
/* These tests should be the same as the tests above. */
|
/* These tests should be the same as the tests above. */
|
||||||
if (TEST_BIT (hoist_vbeout[bb->index], i))
|
if (TEST_BIT (hoist_exprs[bb->index], i))
|
||||||
{
|
{
|
||||||
/* We've found a potentially hoistable expression, now
|
/* We've found a potentially hoistable expression, now
|
||||||
we look at every block BB dominates to see if it
|
we look at every block BB dominates to see if it
|
||||||
|
@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||||||
#include "toplev.h"
|
#include "toplev.h"
|
||||||
#include "params.h"
|
#include "params.h"
|
||||||
#include "hosthooks.h"
|
#include "hosthooks.h"
|
||||||
|
#include "hosthooks-def.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_RESOURCE_H
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
# include <sys/resource.h>
|
# include <sys/resource.h>
|
||||||
@ -458,21 +459,8 @@ gt_pch_save (FILE *f)
|
|||||||
and on the rest it's a lot of work to do better.
|
and on the rest it's a lot of work to do better.
|
||||||
(The extra work goes in HOST_HOOKS_GT_PCH_GET_ADDRESS and
|
(The extra work goes in HOST_HOOKS_GT_PCH_GET_ADDRESS and
|
||||||
HOST_HOOKS_GT_PCH_USE_ADDRESS.) */
|
HOST_HOOKS_GT_PCH_USE_ADDRESS.) */
|
||||||
mmi.preferred_base = host_hooks.gt_pch_get_address (mmi.size);
|
mmi.preferred_base = host_hooks.gt_pch_get_address (mmi.size, fileno (f));
|
||||||
|
|
||||||
#if HAVE_MMAP_FILE
|
|
||||||
if (mmi.preferred_base == NULL)
|
|
||||||
{
|
|
||||||
mmi.preferred_base = mmap (NULL, mmi.size,
|
|
||||||
PROT_READ | PROT_WRITE, MAP_PRIVATE,
|
|
||||||
fileno (state.f), 0);
|
|
||||||
if (mmi.preferred_base == (void *) MAP_FAILED)
|
|
||||||
mmi.preferred_base = NULL;
|
|
||||||
else
|
|
||||||
munmap (mmi.preferred_base, mmi.size);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_MMAP_FILE */
|
|
||||||
|
|
||||||
ggc_pch_this_base (state.d, mmi.preferred_base);
|
ggc_pch_this_base (state.d, mmi.preferred_base);
|
||||||
|
|
||||||
state.ptrs = xmalloc (state.count * sizeof (*state.ptrs));
|
state.ptrs = xmalloc (state.count * sizeof (*state.ptrs));
|
||||||
@ -526,7 +514,8 @@ gt_pch_save (FILE *f)
|
|||||||
state.ptrs[i]->note_ptr_cookie,
|
state.ptrs[i]->note_ptr_cookie,
|
||||||
relocate_ptrs, &state);
|
relocate_ptrs, &state);
|
||||||
ggc_pch_write_object (state.d, state.f, state.ptrs[i]->obj,
|
ggc_pch_write_object (state.d, state.f, state.ptrs[i]->obj,
|
||||||
state.ptrs[i]->new_addr, state.ptrs[i]->size, state.ptrs[i]->note_ptr_fn == gt_pch_p_S);
|
state.ptrs[i]->new_addr, state.ptrs[i]->size,
|
||||||
|
state.ptrs[i]->note_ptr_fn == gt_pch_p_S);
|
||||||
if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S)
|
if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S)
|
||||||
memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size);
|
memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size);
|
||||||
}
|
}
|
||||||
@ -546,8 +535,7 @@ gt_pch_restore (FILE *f)
|
|||||||
const struct ggc_root_tab *rti;
|
const struct ggc_root_tab *rti;
|
||||||
size_t i;
|
size_t i;
|
||||||
struct mmap_info mmi;
|
struct mmap_info mmi;
|
||||||
void *addr;
|
int result;
|
||||||
bool needs_read;
|
|
||||||
|
|
||||||
/* Delete any deletable objects. This makes ggc_pch_read much
|
/* Delete any deletable objects. This makes ggc_pch_read much
|
||||||
faster, as it can be sure that no GCable objects remain other
|
faster, as it can be sure that no GCable objects remain other
|
||||||
@ -580,110 +568,95 @@ gt_pch_restore (FILE *f)
|
|||||||
if (fread (&mmi, sizeof (mmi), 1, f) != 1)
|
if (fread (&mmi, sizeof (mmi), 1, f) != 1)
|
||||||
fatal_error ("can't read PCH file: %m");
|
fatal_error ("can't read PCH file: %m");
|
||||||
|
|
||||||
if (host_hooks.gt_pch_use_address (mmi.preferred_base, mmi.size))
|
result = host_hooks.gt_pch_use_address (mmi.preferred_base, mmi.size,
|
||||||
{
|
fileno (f), mmi.offset);
|
||||||
#if HAVE_MMAP_FILE
|
if (result < 0)
|
||||||
void *mmap_result;
|
fatal_error ("had to relocate PCH");
|
||||||
|
if (result == 0)
|
||||||
mmap_result = mmap (mmi.preferred_base, mmi.size,
|
|
||||||
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
|
|
||||||
fileno (f), mmi.offset);
|
|
||||||
|
|
||||||
/* The file might not be mmap-able. */
|
|
||||||
needs_read = mmap_result == (void *) MAP_FAILED;
|
|
||||||
|
|
||||||
/* Sanity check for broken MAP_FIXED. */
|
|
||||||
if (! needs_read && mmap_result != mmi.preferred_base)
|
|
||||||
abort ();
|
|
||||||
#else
|
|
||||||
needs_read = true;
|
|
||||||
#endif
|
|
||||||
addr = mmi.preferred_base;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#if HAVE_MMAP_FILE
|
|
||||||
addr = mmap (mmi.preferred_base, mmi.size,
|
|
||||||
PROT_READ | PROT_WRITE, MAP_PRIVATE,
|
|
||||||
fileno (f), mmi.offset);
|
|
||||||
|
|
||||||
#if HAVE_MINCORE
|
|
||||||
if (addr != mmi.preferred_base)
|
|
||||||
{
|
|
||||||
size_t page_size = getpagesize();
|
|
||||||
char one_byte;
|
|
||||||
|
|
||||||
if (addr != (void *) MAP_FAILED)
|
|
||||||
munmap (addr, mmi.size);
|
|
||||||
|
|
||||||
/* We really want to be mapped at mmi.preferred_base
|
|
||||||
so we're going to resort to MAP_FIXED. But before,
|
|
||||||
make sure that we can do so without destroying a
|
|
||||||
previously mapped area, by looping over all pages
|
|
||||||
that would be affected by the fixed mapping. */
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < mmi.size; i+= page_size)
|
|
||||||
if (mincore ((char *)mmi.preferred_base + i, page_size,
|
|
||||||
(void *)&one_byte) == -1
|
|
||||||
&& errno == ENOMEM)
|
|
||||||
continue; /* The page is not mapped. */
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (i >= mmi.size)
|
|
||||||
addr = mmap (mmi.preferred_base, mmi.size,
|
|
||||||
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
|
|
||||||
fileno (f), mmi.offset);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_MINCORE */
|
|
||||||
|
|
||||||
needs_read = addr == (void *) MAP_FAILED;
|
|
||||||
|
|
||||||
#else /* HAVE_MMAP_FILE */
|
|
||||||
needs_read = true;
|
|
||||||
#endif /* HAVE_MMAP_FILE */
|
|
||||||
if (needs_read)
|
|
||||||
addr = xmalloc (mmi.size);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needs_read)
|
|
||||||
{
|
{
|
||||||
if (fseek (f, mmi.offset, SEEK_SET) != 0
|
if (fseek (f, mmi.offset, SEEK_SET) != 0
|
||||||
|| fread (&mmi, mmi.size, 1, f) != 1)
|
|| fread (mmi.preferred_base, mmi.size, 1, f) != 1)
|
||||||
fatal_error ("can't read PCH file: %m");
|
fatal_error ("can't read PCH file: %m");
|
||||||
}
|
}
|
||||||
else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0)
|
else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0)
|
||||||
fatal_error ("can't read PCH file: %m");
|
fatal_error ("can't read PCH file: %m");
|
||||||
|
|
||||||
ggc_pch_read (f, addr);
|
ggc_pch_read (f, mmi.preferred_base);
|
||||||
|
|
||||||
if (addr != mmi.preferred_base)
|
|
||||||
{
|
|
||||||
for (rt = gt_ggc_rtab; *rt; rt++)
|
|
||||||
for (rti = *rt; rti->base != NULL; rti++)
|
|
||||||
for (i = 0; i < rti->nelt; i++)
|
|
||||||
{
|
|
||||||
char **ptr = (char **)((char *)rti->base + rti->stride * i);
|
|
||||||
if (*ptr != NULL)
|
|
||||||
*ptr += (size_t)addr - (size_t)mmi.preferred_base;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (rt = gt_pch_cache_rtab; *rt; rt++)
|
|
||||||
for (rti = *rt; rti->base != NULL; rti++)
|
|
||||||
for (i = 0; i < rti->nelt; i++)
|
|
||||||
{
|
|
||||||
char **ptr = (char **)((char *)rti->base + rti->stride * i);
|
|
||||||
if (*ptr != NULL)
|
|
||||||
*ptr += (size_t)addr - (size_t)mmi.preferred_base;
|
|
||||||
}
|
|
||||||
|
|
||||||
sorry ("had to relocate PCH");
|
|
||||||
}
|
|
||||||
|
|
||||||
gt_pch_restore_stringpool ();
|
gt_pch_restore_stringpool ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Default version of HOST_HOOKS_GT_PCH_GET_ADDRESS when mmap is not present.
|
||||||
|
Select no address whatsoever, and let gt_pch_save choose what it will with
|
||||||
|
malloc, presumably. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
default_gt_pch_get_address (size_t size ATTRIBUTE_UNUSED,
|
||||||
|
int fd ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Default version of HOST_HOOKS_GT_PCH_USE_ADDRESS when mmap is not present.
|
||||||
|
Allocate SIZE bytes with malloc. Return 0 if the address we got is the
|
||||||
|
same as base, indicating that the memory has been allocated but needs to
|
||||||
|
be read in from the file. Return -1 if the address differs, to relocation
|
||||||
|
of the PCH file would be required. */
|
||||||
|
|
||||||
|
int
|
||||||
|
default_gt_pch_use_address (void *base, size_t size, int fd ATTRIBUTE_UNUSED,
|
||||||
|
size_t offset ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
void *addr = xmalloc (size);
|
||||||
|
return (addr == base) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if HAVE_MMAP_FILE
|
||||||
|
/* Default version of HOST_HOOKS_GT_PCH_GET_ADDRESS when mmap is present.
|
||||||
|
We temporarily allocate SIZE bytes, and let the kernel place the data
|
||||||
|
whereever it will. If it worked, that's our spot, if not we're likely
|
||||||
|
to be in trouble. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
mmap_gt_pch_get_address (size_t size, int fd)
|
||||||
|
{
|
||||||
|
void *ret;
|
||||||
|
|
||||||
|
ret = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||||
|
if (ret == (void *) MAP_FAILED)
|
||||||
|
ret = NULL;
|
||||||
|
else
|
||||||
|
munmap (ret, size);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Default version of HOST_HOOKS_GT_PCH_USE_ADDRESS when mmap is present.
|
||||||
|
Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
|
||||||
|
mapping the data at BASE, -1 if we couldn't.
|
||||||
|
|
||||||
|
This version assumes that the kernel honors the START operand of mmap
|
||||||
|
even without MAP_FIXED if START through START+SIZE are not currently
|
||||||
|
mapped with something. */
|
||||||
|
|
||||||
|
int
|
||||||
|
mmap_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;
|
||||||
|
|
||||||
|
addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
|
||||||
|
fd, offset);
|
||||||
|
|
||||||
|
return addr == base ? 1 : -1;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_MMAP_FILE */
|
||||||
|
|
||||||
/* Modify the bound based on rlimits. Keep the smallest number found. */
|
/* Modify the bound based on rlimits. Keep the smallest number found. */
|
||||||
static double
|
static double
|
||||||
ggc_rlimit_bound (double limit)
|
ggc_rlimit_bound (double limit)
|
||||||
|
@ -96,6 +96,9 @@ struct allocno
|
|||||||
/* Number of calls crossed by each allocno. */
|
/* Number of calls crossed by each allocno. */
|
||||||
int calls_crossed;
|
int calls_crossed;
|
||||||
|
|
||||||
|
/* Number of calls that might throw crossed by each allocno. */
|
||||||
|
int throwing_calls_crossed;
|
||||||
|
|
||||||
/* Number of refs to each allocno. */
|
/* Number of refs to each allocno. */
|
||||||
int n_refs;
|
int n_refs;
|
||||||
|
|
||||||
@ -469,6 +472,8 @@ global_alloc (FILE *file)
|
|||||||
allocno[num].reg = i;
|
allocno[num].reg = i;
|
||||||
allocno[num].size = PSEUDO_REGNO_SIZE (i);
|
allocno[num].size = PSEUDO_REGNO_SIZE (i);
|
||||||
allocno[num].calls_crossed += REG_N_CALLS_CROSSED (i);
|
allocno[num].calls_crossed += REG_N_CALLS_CROSSED (i);
|
||||||
|
allocno[num].throwing_calls_crossed
|
||||||
|
+= REG_N_THROWING_CALLS_CROSSED (i);
|
||||||
allocno[num].n_refs += REG_N_REFS (i);
|
allocno[num].n_refs += REG_N_REFS (i);
|
||||||
allocno[num].freq += REG_FREQ (i);
|
allocno[num].freq += REG_FREQ (i);
|
||||||
if (allocno[num].live_length < REG_LIVE_LENGTH (i))
|
if (allocno[num].live_length < REG_LIVE_LENGTH (i))
|
||||||
@ -1187,9 +1192,11 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
|
|||||||
{
|
{
|
||||||
/* Did not find a register. If it would be profitable to
|
/* Did not find a register. If it would be profitable to
|
||||||
allocate a call-clobbered register and save and restore it
|
allocate a call-clobbered register and save and restore it
|
||||||
around calls, do that. */
|
around calls, do that. Don't do this if it crosses any calls
|
||||||
|
that might throw. */
|
||||||
if (! accept_call_clobbered
|
if (! accept_call_clobbered
|
||||||
&& allocno[num].calls_crossed != 0
|
&& allocno[num].calls_crossed != 0
|
||||||
|
&& allocno[num].throwing_calls_crossed == 0
|
||||||
&& CALLER_SAVE_PROFITABLE (allocno[num].n_refs,
|
&& CALLER_SAVE_PROFITABLE (allocno[num].n_refs,
|
||||||
allocno[num].calls_crossed))
|
allocno[num].calls_crossed))
|
||||||
{
|
{
|
||||||
|
@ -213,21 +213,6 @@ hook_rtx_tree_int_null (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generic hook that takes a size_t and returns NULL. */
|
|
||||||
void *
|
|
||||||
hook_voidp_size_t_null (size_t a ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Generic hook that takes a size_t and a pointer and returns false. */
|
|
||||||
bool
|
|
||||||
hook_bool_voidp_size_t_false (void * a ATTRIBUTE_UNUSED,
|
|
||||||
size_t b ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Generic hook that takes a tree and returns a NULL string. */
|
/* Generic hook that takes a tree and returns a NULL string. */
|
||||||
const char *
|
const char *
|
||||||
hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED)
|
hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED)
|
||||||
|
@ -58,7 +58,5 @@ extern bool hook_bool_tree_tree_false (tree, tree);
|
|||||||
extern rtx hook_rtx_rtx_identity (rtx);
|
extern rtx hook_rtx_rtx_identity (rtx);
|
||||||
extern rtx hook_rtx_rtx_null (rtx);
|
extern rtx hook_rtx_rtx_null (rtx);
|
||||||
extern rtx hook_rtx_tree_int_null (tree, int);
|
extern rtx hook_rtx_tree_int_null (tree, int);
|
||||||
extern void * hook_voidp_size_t_null (size_t);
|
|
||||||
extern bool hook_bool_voidp_size_t_false (void *, size_t);
|
|
||||||
extern const char *hook_constcharptr_tree_null (tree);
|
extern const char *hook_constcharptr_tree_null (tree);
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,8 +24,18 @@ Boston, MA 02111-1307, USA. */
|
|||||||
#include "hooks.h"
|
#include "hooks.h"
|
||||||
|
|
||||||
#define HOST_HOOKS_EXTRA_SIGNALS hook_void_void
|
#define HOST_HOOKS_EXTRA_SIGNALS hook_void_void
|
||||||
#define HOST_HOOKS_GT_PCH_GET_ADDRESS hook_voidp_size_t_null
|
#if HAVE_MMAP_FILE
|
||||||
#define HOST_HOOKS_GT_PCH_USE_ADDRESS hook_bool_voidp_size_t_false
|
#define HOST_HOOKS_GT_PCH_GET_ADDRESS mmap_gt_pch_get_address
|
||||||
|
#define HOST_HOOKS_GT_PCH_USE_ADDRESS mmap_gt_pch_use_address
|
||||||
|
#else
|
||||||
|
#define HOST_HOOKS_GT_PCH_GET_ADDRESS default_gt_pch_get_address
|
||||||
|
#define HOST_HOOKS_GT_PCH_USE_ADDRESS default_gt_pch_use_address
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void* default_gt_pch_get_address (size_t, int);
|
||||||
|
extern int default_gt_pch_use_address (void *, size_t, int, size_t);
|
||||||
|
extern void* mmap_gt_pch_get_address (size_t, int);
|
||||||
|
extern int mmap_gt_pch_use_address (void *, size_t, int, size_t);
|
||||||
|
|
||||||
/* The structure is defined in hosthooks.h. */
|
/* The structure is defined in hosthooks.h. */
|
||||||
#define HOST_HOOKS_INITIALIZER { \
|
#define HOST_HOOKS_INITIALIZER { \
|
||||||
|
@ -25,8 +25,16 @@ struct host_hooks
|
|||||||
{
|
{
|
||||||
void (*extra_signals) (void);
|
void (*extra_signals) (void);
|
||||||
|
|
||||||
void * (*gt_pch_get_address) (size_t);
|
/* Identify an address that's likely to be free in a subsequent invocation
|
||||||
bool (*gt_pch_use_address) (void *, size_t);
|
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. */
|
||||||
|
void * (*gt_pch_get_address) (size_t size, int fd);
|
||||||
|
|
||||||
|
/* 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. */
|
||||||
|
int (*gt_pch_use_address) (void *addr, size_t size, int fd, size_t offset);
|
||||||
|
|
||||||
/* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
|
/* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
|
||||||
};
|
};
|
||||||
|
@ -120,6 +120,11 @@ struct qty
|
|||||||
|
|
||||||
int n_calls_crossed;
|
int n_calls_crossed;
|
||||||
|
|
||||||
|
/* Number of times a reg tied to given qty lives across a CALL_INSN
|
||||||
|
that might throw. */
|
||||||
|
|
||||||
|
int n_throwing_calls_crossed;
|
||||||
|
|
||||||
/* The register number of one pseudo register whose reg_qty value is Q.
|
/* The register number of one pseudo register whose reg_qty value is Q.
|
||||||
This register should be the head of the chain
|
This register should be the head of the chain
|
||||||
maintained in reg_next_in_qty. */
|
maintained in reg_next_in_qty. */
|
||||||
@ -317,6 +322,7 @@ alloc_qty (int regno, enum machine_mode mode, int size, int birth)
|
|||||||
qty[qtyno].mode = mode;
|
qty[qtyno].mode = mode;
|
||||||
qty[qtyno].birth = birth;
|
qty[qtyno].birth = birth;
|
||||||
qty[qtyno].n_calls_crossed = REG_N_CALLS_CROSSED (regno);
|
qty[qtyno].n_calls_crossed = REG_N_CALLS_CROSSED (regno);
|
||||||
|
qty[qtyno].n_throwing_calls_crossed = REG_N_THROWING_CALLS_CROSSED (regno);
|
||||||
qty[qtyno].min_class = reg_preferred_class (regno);
|
qty[qtyno].min_class = reg_preferred_class (regno);
|
||||||
qty[qtyno].alternate_class = reg_alternate_class (regno);
|
qty[qtyno].alternate_class = reg_alternate_class (regno);
|
||||||
qty[qtyno].n_refs = REG_N_REFS (regno);
|
qty[qtyno].n_refs = REG_N_REFS (regno);
|
||||||
@ -1119,6 +1125,7 @@ update_equiv_regs (void)
|
|||||||
|
|
||||||
REG_BASIC_BLOCK (regno) = bb->index;
|
REG_BASIC_BLOCK (regno) = bb->index;
|
||||||
REG_N_CALLS_CROSSED (regno) = 0;
|
REG_N_CALLS_CROSSED (regno) = 0;
|
||||||
|
REG_N_THROWING_CALLS_CROSSED (regno) = 0;
|
||||||
REG_LIVE_LENGTH (regno) = 2;
|
REG_LIVE_LENGTH (regno) = 2;
|
||||||
|
|
||||||
if (insn == BB_HEAD (bb))
|
if (insn == BB_HEAD (bb))
|
||||||
@ -1946,6 +1953,8 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number,
|
|||||||
|
|
||||||
/* Update info about quantity SQTY. */
|
/* Update info about quantity SQTY. */
|
||||||
qty[sqty].n_calls_crossed += REG_N_CALLS_CROSSED (sreg);
|
qty[sqty].n_calls_crossed += REG_N_CALLS_CROSSED (sreg);
|
||||||
|
qty[sqty].n_throwing_calls_crossed
|
||||||
|
+= REG_N_THROWING_CALLS_CROSSED (sreg);
|
||||||
qty[sqty].n_refs += REG_N_REFS (sreg);
|
qty[sqty].n_refs += REG_N_REFS (sreg);
|
||||||
qty[sqty].freq += REG_FREQ (sreg);
|
qty[sqty].freq += REG_FREQ (sreg);
|
||||||
if (usize < ssize)
|
if (usize < ssize)
|
||||||
@ -2251,12 +2260,14 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno,
|
|||||||
|
|
||||||
/* We need not check to see if the current function has nonlocal
|
/* We need not check to see if the current function has nonlocal
|
||||||
labels because we don't put any pseudos that are live over calls in
|
labels because we don't put any pseudos that are live over calls in
|
||||||
registers in that case. */
|
registers in that case. Avoid putting pseudos crossing calls that
|
||||||
|
might throw into call used registers. */
|
||||||
|
|
||||||
if (! accept_call_clobbered
|
if (! accept_call_clobbered
|
||||||
&& flag_caller_saves
|
&& flag_caller_saves
|
||||||
&& ! just_try_suggested
|
&& ! just_try_suggested
|
||||||
&& qty[qtyno].n_calls_crossed != 0
|
&& qty[qtyno].n_calls_crossed != 0
|
||||||
|
&& qty[qtyno].n_throwing_calls_crossed == 0
|
||||||
&& CALLER_SAVE_PROFITABLE (qty[qtyno].n_refs,
|
&& CALLER_SAVE_PROFITABLE (qty[qtyno].n_refs,
|
||||||
qty[qtyno].n_calls_crossed))
|
qty[qtyno].n_calls_crossed))
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
|
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
|
||||||
Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||||
Free Software Foundation, Inc.
|
2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This definition file is free software; you can redistribute it
|
This definition file is free software; you can redistribute it
|
||||||
and/or modify it under the terms of the GNU General Public
|
and/or modify it under the terms of the GNU General Public
|
||||||
@ -646,7 +646,9 @@ UDItype __umulsidi3 (USItype, USItype);
|
|||||||
|| defined (__powerpc__) /* gcc */ \
|
|| defined (__powerpc__) /* gcc */ \
|
||||||
|| defined (__POWERPC__) /* BEOS */ \
|
|| defined (__POWERPC__) /* BEOS */ \
|
||||||
|| defined (__ppc__) /* Darwin */ \
|
|| defined (__ppc__) /* Darwin */ \
|
||||||
|| defined (PPC) /* GNU/Linux, SysV */ \
|
|| (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
|
||||||
|
|| (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
|
||||||
|
&& CPU_FAMILY == PPC) \
|
||||||
) && W_TYPE_SIZE == 32
|
) && W_TYPE_SIZE == 32
|
||||||
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
|
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
|
||||||
do { \
|
do { \
|
||||||
@ -684,7 +686,10 @@ UDItype __umulsidi3 (USItype, USItype);
|
|||||||
__asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
|
__asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
|
||||||
#define COUNT_LEADING_ZEROS_0 32
|
#define COUNT_LEADING_ZEROS_0 32
|
||||||
#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
|
#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
|
||||||
|| defined (__ppc__) || defined (PPC)
|
|| defined (__ppc__) \
|
||||||
|
|| (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
|
||||||
|
|| (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
|
||||||
|
&& CPU_FAMILY == PPC)
|
||||||
#define umul_ppmm(ph, pl, m0, m1) \
|
#define umul_ppmm(ph, pl, m0, m1) \
|
||||||
do { \
|
do { \
|
||||||
USItype __m0 = (m0), __m1 = (m1); \
|
USItype __m0 = (m0), __m1 = (m1); \
|
||||||
|
@ -8396,17 +8396,6 @@ check_dbra_loop (struct loop *loop, int insn_count)
|
|||||||
|
|
||||||
/* First check if we can do a vanilla loop reversal. */
|
/* First check if we can do a vanilla loop reversal. */
|
||||||
if (initial_value == const0_rtx
|
if (initial_value == const0_rtx
|
||||||
/* If we have a decrement_and_branch_on_count,
|
|
||||||
prefer the NE test, since this will allow that
|
|
||||||
instruction to be generated. Note that we must
|
|
||||||
use a vanilla loop reversal if the biv is used to
|
|
||||||
calculate a giv or has a non-counting use. */
|
|
||||||
#if ! defined (HAVE_decrement_and_branch_until_zero) \
|
|
||||||
&& defined (HAVE_decrement_and_branch_on_count)
|
|
||||||
&& (! (add_val == 1 && loop->vtop
|
|
||||||
&& (bl->biv_count == 0
|
|
||||||
|| no_use_except_counting)))
|
|
||||||
#endif
|
|
||||||
&& GET_CODE (comparison_value) == CONST_INT
|
&& GET_CODE (comparison_value) == CONST_INT
|
||||||
/* Now do postponed overflow checks on COMPARISON_VAL. */
|
/* Now do postponed overflow checks on COMPARISON_VAL. */
|
||||||
&& ! (((comparison_val - add_val) ^ INTVAL (comparison_value))
|
&& ! (((comparison_val - add_val) ^ INTVAL (comparison_value))
|
||||||
@ -8418,13 +8407,6 @@ check_dbra_loop (struct loop *loop, int insn_count)
|
|||||||
nonneg = 1;
|
nonneg = 1;
|
||||||
cmp_code = GE;
|
cmp_code = GE;
|
||||||
}
|
}
|
||||||
else if (add_val == 1 && loop->vtop
|
|
||||||
&& (bl->biv_count == 0
|
|
||||||
|| no_use_except_counting))
|
|
||||||
{
|
|
||||||
add_adjust = 0;
|
|
||||||
cmp_code = NE;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -236,6 +236,23 @@ md5_process_bytes (buffer, len, ctx)
|
|||||||
/* Process available complete blocks. */
|
/* Process available complete blocks. */
|
||||||
if (len > 64)
|
if (len > 64)
|
||||||
{
|
{
|
||||||
|
#if !_STRING_ARCH_unaligned
|
||||||
|
/* To check alignment gcc has an appropriate operator. Other
|
||||||
|
compilers don't. */
|
||||||
|
# if __GNUC__ >= 2
|
||||||
|
# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0)
|
||||||
|
# else
|
||||||
|
# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0)
|
||||||
|
# endif
|
||||||
|
if (UNALIGNED_P (buffer))
|
||||||
|
while (len > 64)
|
||||||
|
{
|
||||||
|
md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
|
||||||
|
buffer = (const char *) buffer + 64;
|
||||||
|
len -= 64;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
md5_process_block (buffer, len & ~63, ctx);
|
md5_process_block (buffer, len & ~63, ctx);
|
||||||
buffer = (const void *) ((const char *) buffer + (len & ~63));
|
buffer = (const void *) ((const char *) buffer + (len & ~63));
|
||||||
len &= 63;
|
len &= 63;
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ansidecl.h"
|
||||||
|
|
||||||
/* The following contortions are an attempt to use the C preprocessor
|
/* The following contortions are an attempt to use the C preprocessor
|
||||||
to determine an unsigned integral type that is 32 bits wide. An
|
to determine an unsigned integral type that is 32 bits wide. An
|
||||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||||
@ -37,6 +39,7 @@
|
|||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
typedef u_int32_t md5_uint32;
|
typedef u_int32_t md5_uint32;
|
||||||
|
typedef uintptr_t md5_uintptr;
|
||||||
#else
|
#else
|
||||||
# define INT_MAX_32_BITS 2147483647
|
# define INT_MAX_32_BITS 2147483647
|
||||||
|
|
||||||
@ -64,6 +67,9 @@ typedef u_int32_t md5_uint32;
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
/* We have to make a guess about the integer type equivalent in size
|
||||||
|
to pointers which should always be correct. */
|
||||||
|
typedef unsigned long int md5_uintptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef __P
|
#undef __P
|
||||||
@ -83,7 +89,7 @@ struct md5_ctx
|
|||||||
|
|
||||||
md5_uint32 total[2];
|
md5_uint32 total[2];
|
||||||
md5_uint32 buflen;
|
md5_uint32 buflen;
|
||||||
char buffer[128];
|
char buffer[128] ATTRIBUTE_ALIGNED_ALIGNOF(md5_uint32);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Read and manage MIPS symbol tables from object modules.
|
/* Read and manage MIPS symbol tables from object modules.
|
||||||
Copyright (C) 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2003
|
Copyright (C) 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2003, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Contributed by hartzell@boulder.colorado.edu,
|
Contributed by hartzell@boulder.colorado.edu,
|
||||||
Rewritten by meissner@osf.org.
|
Rewritten by meissner@osf.org.
|
||||||
@ -1412,7 +1412,7 @@ main (int argc, char **argv)
|
|||||||
if (version)
|
if (version)
|
||||||
{
|
{
|
||||||
printf ("mips-tdump (GCC) %s\n", version_string);
|
printf ("mips-tdump (GCC) %s\n", version_string);
|
||||||
fputs ("Copyright (C) 2003 Free Software Foundation, Inc.\n", stdout);
|
fputs ("Copyright (C) 2006 Free Software Foundation, Inc.\n", stdout);
|
||||||
fputs ("This is free software; see the source for copying conditions. There is NO\n\
|
fputs ("This is free software; see the source for copying conditions. There is NO\n\
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n",
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n",
|
||||||
stdout);
|
stdout);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
in the form of comments (the mips assembler does not support
|
in the form of comments (the mips assembler does not support
|
||||||
assembly access to debug information).
|
assembly access to debug information).
|
||||||
Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
|
Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
|
||||||
2002, 2003, 2004 Free Software Foundation, Inc.
|
2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Meissner (meissner@cygnus.com).
|
Contributed by Michael Meissner (meissner@cygnus.com).
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
@ -4774,7 +4774,7 @@ main (int argc, char **argv)
|
|||||||
if (version)
|
if (version)
|
||||||
{
|
{
|
||||||
printf (_("mips-tfile (GCC) %s\n"), version_string);
|
printf (_("mips-tfile (GCC) %s\n"), version_string);
|
||||||
fputs ("Copyright (C) 2004 Free Software Foundation, Inc.\n", stdout);
|
fputs ("Copyright (C) 2006 Free Software Foundation, Inc.\n", stdout);
|
||||||
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
|
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
|
||||||
stdout);
|
stdout);
|
||||||
|
@ -246,6 +246,9 @@ for file in $LIB2ADDEH; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Flag whether we need eh_dummy.c
|
||||||
|
need_eh_dummy=
|
||||||
|
|
||||||
if [ "$SHLIB_LINK" ]; then
|
if [ "$SHLIB_LINK" ]; then
|
||||||
# Those should be in libgcc_eh.a.
|
# Those should be in libgcc_eh.a.
|
||||||
for file in $LIB2ADDEHSTATIC; do
|
for file in $LIB2ADDEHSTATIC; do
|
||||||
@ -260,6 +263,23 @@ if [ "$SHLIB_LINK" ]; then
|
|||||||
oname=`echo $name | sed -e 's,.*/,,'`
|
oname=`echo $name | sed -e 's,.*/,,'`
|
||||||
libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}"
|
libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# If nothing went into libgcc_eh.a, create a dummy object -
|
||||||
|
# some linkers don't like totally empty archives.
|
||||||
|
if [ -z "$LIB2ADDEHSTATIC" ]; then
|
||||||
|
file=eh_dummy.c
|
||||||
|
libgcc2_eh_static_objs="$libgcc2_eh_static_objs eh_dummy${objext}"
|
||||||
|
need_eh_dummy=1
|
||||||
|
|
||||||
|
for ml in $MULTILIBS; do
|
||||||
|
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
|
||||||
|
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
|
||||||
|
out="libgcc/${dir}/eh_dummy${objext}"
|
||||||
|
|
||||||
|
echo $out: stmp-dirs $file
|
||||||
|
echo " $gcc_compile" $flags -fexceptions -c $file -o $out
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in $LIB2ADD_ST; do
|
for file in $LIB2ADD_ST; do
|
||||||
@ -649,6 +669,11 @@ done
|
|||||||
echo ""
|
echo ""
|
||||||
echo "all: $all"
|
echo "all: $all"
|
||||||
|
|
||||||
|
if [ "$need_eh_dummy" ]; then
|
||||||
|
echo "eh_dummy.c:"
|
||||||
|
echo " echo 'int __libgcc_eh_dummy;' > \$@"
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "install: $all"
|
echo "install: $all"
|
||||||
for ml in $MULTILIBS; do
|
for ml in $MULTILIBS; do
|
||||||
|
@ -1078,7 +1078,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
&& ashl_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
&& ashl_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
||||||
&& lshr_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
&& lshr_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
||||||
{
|
{
|
||||||
rtx insns, equiv_value;
|
rtx insns;
|
||||||
rtx into_target, outof_target;
|
rtx into_target, outof_target;
|
||||||
rtx into_input, outof_input;
|
rtx into_input, outof_input;
|
||||||
rtx inter;
|
rtx inter;
|
||||||
@ -1174,20 +1174,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
|
|
||||||
if (inter != 0)
|
if (inter != 0)
|
||||||
{
|
{
|
||||||
if (binoptab->code != UNKNOWN)
|
emit_insn (insns);
|
||||||
equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
|
|
||||||
else
|
|
||||||
equiv_value = 0;
|
|
||||||
|
|
||||||
/* We can't make this a no conflict block if this is a word swap,
|
|
||||||
because the word swap case fails if the input and output values
|
|
||||||
are in the same register. */
|
|
||||||
if (shift_count != BITS_PER_WORD)
|
|
||||||
emit_no_conflict_block (insns, target, op0, op1, equiv_value);
|
|
||||||
else
|
|
||||||
emit_insn (insns);
|
|
||||||
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ pp_base_indent (pretty_printer *pp)
|
|||||||
%p: pointer.
|
%p: pointer.
|
||||||
%m: strerror(text->err_no) - does not consume a value from args_ptr.
|
%m: strerror(text->err_no) - does not consume a value from args_ptr.
|
||||||
%%: `%'.
|
%%: `%'.
|
||||||
%*.s: a substring the length of which is specified by an integer.
|
%.*s: a substring the length of which is specified by an integer.
|
||||||
%H: location_t. */
|
%H: location_t. */
|
||||||
void
|
void
|
||||||
pp_base_format_text (pretty_printer *pp, text_info *text)
|
pp_base_format_text (pretty_printer *pp, text_info *text)
|
||||||
|
@ -429,7 +429,7 @@ reg_to_stack (rtx first, FILE *file)
|
|||||||
Also need to rebuild life when superblock scheduling is done
|
Also need to rebuild life when superblock scheduling is done
|
||||||
as it don't update liveness yet. */
|
as it don't update liveness yet. */
|
||||||
if (!optimize
|
if (!optimize
|
||||||
|| (flag_sched2_use_superblocks
|
|| ((flag_sched2_use_superblocks || flag_sched2_use_traces)
|
||||||
&& flag_schedule_insns_after_reload))
|
&& flag_schedule_insns_after_reload))
|
||||||
{
|
{
|
||||||
count_or_remove_death_notes (NULL, 1);
|
count_or_remove_death_notes (NULL, 1);
|
||||||
@ -1231,9 +1231,9 @@ swap_rtx_condition (rtx insn)
|
|||||||
pat = PATTERN (insn);
|
pat = PATTERN (insn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See if this is, or ends in, a fnstsw, aka unspec 9. If so, we're
|
/* See if this is, or ends in, a fnstsw. If so, we're not doing anything
|
||||||
not doing anything with the cc value right now. We may be able to
|
with the cc value right now. We may be able to search for one
|
||||||
search for one though. */
|
though. */
|
||||||
|
|
||||||
if (GET_CODE (pat) == SET
|
if (GET_CODE (pat) == SET
|
||||||
&& GET_CODE (SET_SRC (pat)) == UNSPEC
|
&& GET_CODE (SET_SRC (pat)) == UNSPEC
|
||||||
@ -1252,9 +1252,13 @@ swap_rtx_condition (rtx insn)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We haven't found it. */
|
||||||
|
if (insn == BB_END (current_block))
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* So we've found the insn using this value. If it is anything
|
/* So we've found the insn using this value. If it is anything
|
||||||
other than sahf, aka unspec 10, or the value does not die
|
other than sahf or the value does not die (meaning we'd have
|
||||||
(meaning we'd have to search further), then we must give up. */
|
to search further), then we must give up. */
|
||||||
pat = PATTERN (insn);
|
pat = PATTERN (insn);
|
||||||
if (GET_CODE (pat) != SET
|
if (GET_CODE (pat) != SET
|
||||||
|| GET_CODE (SET_SRC (pat)) != UNSPEC
|
|| GET_CODE (SET_SRC (pat)) != UNSPEC
|
||||||
|
@ -675,7 +675,8 @@ scan_rtx (rtx insn, rtx *loc, enum reg_class class,
|
|||||||
|
|
||||||
case SET:
|
case SET:
|
||||||
scan_rtx (insn, &SET_SRC (x), class, action, OP_IN, 0);
|
scan_rtx (insn, &SET_SRC (x), class, action, OP_IN, 0);
|
||||||
scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 0);
|
scan_rtx (insn, &SET_DEST (x), class, action,
|
||||||
|
GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case STRICT_LOW_PART:
|
case STRICT_LOW_PART:
|
||||||
@ -700,7 +701,8 @@ scan_rtx (rtx insn, rtx *loc, enum reg_class class,
|
|||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
case CLOBBER:
|
case CLOBBER:
|
||||||
scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 1);
|
scan_rtx (insn, &SET_DEST (x), class, action,
|
||||||
|
GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EXPR_LIST:
|
case EXPR_LIST:
|
||||||
|
@ -59,6 +59,7 @@ typedef struct reg_info_def
|
|||||||
int deaths; /* # of times (REG n) dies */
|
int deaths; /* # of times (REG n) dies */
|
||||||
int live_length; /* # of instructions (REG n) is live */
|
int live_length; /* # of instructions (REG n) is live */
|
||||||
int calls_crossed; /* # of calls (REG n) is live across */
|
int calls_crossed; /* # of calls (REG n) is live across */
|
||||||
|
int throw_calls_crossed; /* # of calls that may throw (REG n) is live across */
|
||||||
int basic_block; /* # of basic blocks (REG n) is used in */
|
int basic_block; /* # of basic blocks (REG n) is used in */
|
||||||
char changes_mode; /* whether (SUBREG (REG n)) exists and
|
char changes_mode; /* whether (SUBREG (REG n)) exists and
|
||||||
is illegal. */
|
is illegal. */
|
||||||
@ -125,6 +126,12 @@ extern varray_type reg_n_info;
|
|||||||
|
|
||||||
#define REG_N_CALLS_CROSSED(N) (VARRAY_REG (reg_n_info, N)->calls_crossed)
|
#define REG_N_CALLS_CROSSED(N) (VARRAY_REG (reg_n_info, N)->calls_crossed)
|
||||||
|
|
||||||
|
/* Indexed by N, gives number of CALL_INSNS that may throw, across which
|
||||||
|
(REG n) is live. */
|
||||||
|
|
||||||
|
#define REG_N_THROWING_CALLS_CROSSED(N) \
|
||||||
|
(VARRAY_REG (reg_n_info, N)->throw_calls_crossed)
|
||||||
|
|
||||||
/* Total number of instructions at which (REG n) is live.
|
/* Total number of instructions at which (REG n) is live.
|
||||||
The larger this is, the less priority (REG n) gets for
|
The larger this is, the less priority (REG n) gets for
|
||||||
allocation in a hard register (in global-alloc).
|
allocation in a hard register (in global-alloc).
|
||||||
|
@ -1639,6 +1639,7 @@ extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
|
|||||||
extern rtx simplify_replace_rtx (rtx, rtx, rtx);
|
extern rtx simplify_replace_rtx (rtx, rtx, rtx);
|
||||||
extern rtx simplify_rtx (rtx);
|
extern rtx simplify_rtx (rtx);
|
||||||
extern rtx avoid_constant_pool_reference (rtx);
|
extern rtx avoid_constant_pool_reference (rtx);
|
||||||
|
extern bool constant_pool_reference_p (rtx);
|
||||||
|
|
||||||
/* In function.c */
|
/* In function.c */
|
||||||
extern rtx gen_mem_addressof (rtx, tree, int);
|
extern rtx gen_mem_addressof (rtx, tree, int);
|
||||||
|
@ -2078,6 +2078,42 @@ add_branch_dependences (rtx head, rtx tail)
|
|||||||
insn = PREV_INSN (insn);
|
insn = PREV_INSN (insn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_cc0
|
||||||
|
/* There may be other cc0 setters earlier on in this block.
|
||||||
|
Look for them and include them in the set not to be disturbed. */
|
||||||
|
if (insn != head && last != NULL_RTX)
|
||||||
|
{
|
||||||
|
rtx earlier_cc0_setter = NULL_RTX;
|
||||||
|
|
||||||
|
for (insn = last; insn != NULL_RTX && insn != head;)
|
||||||
|
{
|
||||||
|
insn = prev_nonnote_insn (insn);
|
||||||
|
if (sets_cc0_p (insn))
|
||||||
|
earlier_cc0_setter = insn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (earlier_cc0_setter != NULL_RTX)
|
||||||
|
{
|
||||||
|
insn = last;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
insn = prev_nonnote_insn (insn);
|
||||||
|
|
||||||
|
if (last != 0 && ! find_insn_list (insn, LOG_LINKS (last)))
|
||||||
|
{
|
||||||
|
add_dependence (last, insn, REG_DEP_ANTI);
|
||||||
|
INSN_REF_COUNT (insn)++;
|
||||||
|
}
|
||||||
|
|
||||||
|
CANT_MOVE (insn) = 1;
|
||||||
|
|
||||||
|
last = insn;
|
||||||
|
}
|
||||||
|
while (insn != earlier_cc0_setter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure these insns are scheduled last in their block. */
|
/* Make sure these insns are scheduled last in their block. */
|
||||||
insn = last;
|
insn = last;
|
||||||
if (insn != 0)
|
if (insn != 0)
|
||||||
|
@ -188,6 +188,14 @@ simplify_gen_ternary (enum rtx_code code, enum machine_mode mode,
|
|||||||
|
|
||||||
return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
|
return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return true if X is a MEM referencing the constant pool. */
|
||||||
|
|
||||||
|
bool
|
||||||
|
constant_pool_reference_p (rtx x)
|
||||||
|
{
|
||||||
|
return avoid_constant_pool_reference (x) != x;
|
||||||
|
}
|
||||||
|
|
||||||
/* Likewise, for relational operations.
|
/* Likewise, for relational operations.
|
||||||
CMP_MODE specifies mode comparison is done in.
|
CMP_MODE specifies mode comparison is done in.
|
||||||
@ -3126,7 +3134,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
|
|||||||
}
|
}
|
||||||
/* It shouldn't matter what's done here, so fill it with
|
/* It shouldn't matter what's done here, so fill it with
|
||||||
zero. */
|
zero. */
|
||||||
for (; i < max_bitsize; i += value_bit)
|
for (; i < elem_bitsize; i += value_bit)
|
||||||
*vp++ = 0;
|
*vp++ = 0;
|
||||||
}
|
}
|
||||||
else if (GET_MODE_CLASS (GET_MODE (el)) == MODE_FLOAT)
|
else if (GET_MODE_CLASS (GET_MODE (el)) == MODE_FLOAT)
|
||||||
|
@ -3353,6 +3353,12 @@ tail_recursion_args (tree actuals, tree formals)
|
|||||||
argvec[i] = copy_to_reg (argvec[i]);
|
argvec[i] = copy_to_reg (argvec[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Insert the pre-call sequence point. This is important in cases
|
||||||
|
where the actual values post-modify the formals: we want the final
|
||||||
|
values of the formals to be the ones that we assign below, not the
|
||||||
|
result of the post-modification. */
|
||||||
|
emit_queue ();
|
||||||
|
|
||||||
/* Store the values of the actuals into the formals. */
|
/* Store the values of the actuals into the formals. */
|
||||||
|
|
||||||
for (f = formals, a = actuals, i = 0; f;
|
for (f = formals, a = actuals, i = 0; f;
|
||||||
|
@ -4277,6 +4277,10 @@ general_init (const char *argv0)
|
|||||||
static void
|
static void
|
||||||
process_options (void)
|
process_options (void)
|
||||||
{
|
{
|
||||||
|
/* Just in case lang_hooks.post_options ends up calling a debug_hook.
|
||||||
|
This can happen with incorrect pre-processed input. */
|
||||||
|
debug_hooks = &do_nothing_debug_hooks;
|
||||||
|
|
||||||
/* Allow the front end to perform consistency checks and do further
|
/* Allow the front end to perform consistency checks and do further
|
||||||
initialization based on the command line options. This hook also
|
initialization based on the command line options. This hook also
|
||||||
sets the original filename if appropriate (e.g. foo.i -> foo.c)
|
sets the original filename if appropriate (e.g. foo.i -> foo.c)
|
||||||
@ -4406,7 +4410,7 @@ process_options (void)
|
|||||||
/* Now we know write_symbols, set up the debug hooks based on it.
|
/* Now we know write_symbols, set up the debug hooks based on it.
|
||||||
By default we do nothing for debug output. */
|
By default we do nothing for debug output. */
|
||||||
if (write_symbols == NO_DEBUG)
|
if (write_symbols == NO_DEBUG)
|
||||||
debug_hooks = &do_nothing_debug_hooks;
|
;
|
||||||
#if defined(DBX_DEBUGGING_INFO)
|
#if defined(DBX_DEBUGGING_INFO)
|
||||||
else if (write_symbols == DBX_DEBUG)
|
else if (write_symbols == DBX_DEBUG)
|
||||||
debug_hooks = &dbx_debug_hooks;
|
debug_hooks = &dbx_debug_hooks;
|
||||||
|
@ -3417,10 +3417,8 @@ simple_cst_equal (tree t1, tree t2)
|
|||||||
TREE_STRING_LENGTH (t1)));
|
TREE_STRING_LENGTH (t1)));
|
||||||
|
|
||||||
case CONSTRUCTOR:
|
case CONSTRUCTOR:
|
||||||
if (CONSTRUCTOR_ELTS (t1) == CONSTRUCTOR_ELTS (t2))
|
return simple_cst_list_equal (CONSTRUCTOR_ELTS (t1),
|
||||||
return 1;
|
CONSTRUCTOR_ELTS (t2));
|
||||||
else
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
case SAVE_EXPR:
|
case SAVE_EXPR:
|
||||||
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
|
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
|
||||||
@ -4156,6 +4154,7 @@ get_narrower (tree op, int *unsignedp_ptr)
|
|||||||
int uns = 0;
|
int uns = 0;
|
||||||
int first = 1;
|
int first = 1;
|
||||||
tree win = op;
|
tree win = op;
|
||||||
|
bool integral_p = INTEGRAL_TYPE_P (TREE_TYPE (op));
|
||||||
|
|
||||||
while (TREE_CODE (op) == NOP_EXPR)
|
while (TREE_CODE (op) == NOP_EXPR)
|
||||||
{
|
{
|
||||||
@ -4192,6 +4191,10 @@ get_narrower (tree op, int *unsignedp_ptr)
|
|||||||
uns = TREE_UNSIGNED (TREE_TYPE (op));
|
uns = TREE_UNSIGNED (TREE_TYPE (op));
|
||||||
first = 0;
|
first = 0;
|
||||||
op = TREE_OPERAND (op, 0);
|
op = TREE_OPERAND (op, 0);
|
||||||
|
/* Keep trying to narrow, but don't assign op to win if it
|
||||||
|
would turn an integral type into something else. */
|
||||||
|
if (INTEGRAL_TYPE_P (TREE_TYPE (op)) != integral_p)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
win = op;
|
win = op;
|
||||||
@ -4803,6 +4806,27 @@ finish_vector_type (tree t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static tree
|
||||||
|
make_or_reuse_type (unsigned size, int unsignedp)
|
||||||
|
{
|
||||||
|
if (size == INT_TYPE_SIZE)
|
||||||
|
return unsignedp ? unsigned_type_node : integer_type_node;
|
||||||
|
if (size == CHAR_TYPE_SIZE)
|
||||||
|
return unsignedp ? unsigned_char_type_node : signed_char_type_node;
|
||||||
|
if (size == SHORT_TYPE_SIZE)
|
||||||
|
return unsignedp ? short_unsigned_type_node : short_integer_type_node;
|
||||||
|
if (size == LONG_TYPE_SIZE)
|
||||||
|
return unsignedp ? long_unsigned_type_node : long_integer_type_node;
|
||||||
|
if (size == LONG_LONG_TYPE_SIZE)
|
||||||
|
return (unsignedp ? long_long_unsigned_type_node
|
||||||
|
: long_long_integer_type_node);
|
||||||
|
|
||||||
|
if (unsignedp)
|
||||||
|
return make_unsigned_type (size);
|
||||||
|
else
|
||||||
|
return make_signed_type (size);
|
||||||
|
}
|
||||||
|
|
||||||
/* Create nodes for all integer types (and error_mark_node) using the sizes
|
/* Create nodes for all integer types (and error_mark_node) using the sizes
|
||||||
of C datatypes. The caller should call set_sizetype soon after calling
|
of C datatypes. The caller should call set_sizetype soon after calling
|
||||||
this function to select one of the types as sizetype. */
|
this function to select one of the types as sizetype. */
|
||||||
@ -4845,18 +4869,20 @@ build_common_tree_nodes (int signed_char)
|
|||||||
TREE_TYPE (TYPE_MAX_VALUE (boolean_type_node)) = boolean_type_node;
|
TREE_TYPE (TYPE_MAX_VALUE (boolean_type_node)) = boolean_type_node;
|
||||||
TYPE_PRECISION (boolean_type_node) = 1;
|
TYPE_PRECISION (boolean_type_node) = 1;
|
||||||
|
|
||||||
intQI_type_node = make_signed_type (GET_MODE_BITSIZE (QImode));
|
/* Fill in the rest of the sized types. Reuse existing type nodes
|
||||||
intHI_type_node = make_signed_type (GET_MODE_BITSIZE (HImode));
|
when possible. */
|
||||||
intSI_type_node = make_signed_type (GET_MODE_BITSIZE (SImode));
|
intQI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (QImode), 0);
|
||||||
intDI_type_node = make_signed_type (GET_MODE_BITSIZE (DImode));
|
intHI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (HImode), 0);
|
||||||
intTI_type_node = make_signed_type (GET_MODE_BITSIZE (TImode));
|
intSI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (SImode), 0);
|
||||||
|
intDI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (DImode), 0);
|
||||||
|
intTI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (TImode), 0);
|
||||||
|
|
||||||
unsigned_intQI_type_node = make_unsigned_type (GET_MODE_BITSIZE (QImode));
|
unsigned_intQI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (QImode), 1);
|
||||||
unsigned_intHI_type_node = make_unsigned_type (GET_MODE_BITSIZE (HImode));
|
unsigned_intHI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (HImode), 1);
|
||||||
unsigned_intSI_type_node = make_unsigned_type (GET_MODE_BITSIZE (SImode));
|
unsigned_intSI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (SImode), 1);
|
||||||
unsigned_intDI_type_node = make_unsigned_type (GET_MODE_BITSIZE (DImode));
|
unsigned_intDI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (DImode), 1);
|
||||||
unsigned_intTI_type_node = make_unsigned_type (GET_MODE_BITSIZE (TImode));
|
unsigned_intTI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (TImode), 1);
|
||||||
|
|
||||||
access_public_node = get_identifier ("public");
|
access_public_node = get_identifier ("public");
|
||||||
access_protected_node = get_identifier ("protected");
|
access_protected_node = get_identifier ("protected");
|
||||||
access_private_node = get_identifier ("private");
|
access_private_node = get_identifier ("private");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user