Anatoly Sokolov [Tue, 31 Aug 2010 19:32:59 +0000 (23:32 +0400)]
m32c.c (classes_intersect): Remove.
* config/m32c/m32c.c (classes_intersect): Remove.
(m32c_preferred_reload_class, m32c_secondary_reload_class): Use
reg_classes_intersect_p instead of classes_intersect.
(class_can_hold_mode): Change arguments type from enum reg_class to
reg_class_t. Use reg_class_contents instead of class_contents.
(m32c_register_move_cost): Make static. Change arguments type from
enum reg_class to reg_class_t. Use reg_classes_intersect_p instead of
classes_intersect. Use reg_class_contents instead of class_contents.
(m32c_memory_move_cost): Make static. Change arguments type from
enum reg_class to reg_class_t.
(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
* config/m32c/m32c.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
* config/m32c/m32c-protos.h (m32c_register_move_cost,
m32c_memory_move_cost): Remove.
Paolo Carlini [Tue, 31 Aug 2010 17:39:51 +0000 (17:39 +0000)]
re PR libstdc++/44480 ([C++0x] Linear performance of begin() in unordered associative containers)
2010-08-31 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44480
* include/bits/hashtable.h (_Hashtable<>::_M_begin_bucket_index):
Add, caching the index of the first non-empty bucket.
(begin, cbegin): Use it.
(_Hashtable<>::_Hashtable(_InputIterator, _InputIterator, ...),
_Hashtable(const _Hashtable&), _Hashtable(_Hashtable&&),
swap(_Hashtable&), clear): Adjust.
(_M_insert_bucket, _M_insert, erase(const_iterator),
erase(const key_type&), _M_rehash): Update it.
* include/bits/hashtable.h (_Hashtable<>::_M_erase): Remove.
(erase(const_iterator)): Inline the latter.
Nathan Froyd [Tue, 31 Aug 2010 17:19:20 +0000 (17:19 +0000)]
arm-protos.h (arm_function_arg_advance): Delete.
* config/arm/arm-protos.h (arm_function_arg_advance): Delete.
(arm_function_arg): Delete.
(arm_needs_doubleword_align): Take a const_tree.
* config/arm/arm.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/arm/arm.c (aapcs_select_call_coproc): Take a const_tree.
(aapcs_layout_arg, arm_needs_doubleword_align): Likewise.
(arm_function_arg): Make static. Take a const_tree and a bool.
(arm_function_arg_advance): Likewise.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
Eric Botcazou [Mon, 30 Aug 2010 20:04:49 +0000 (20:04 +0000)]
Stack usage support
Stack usage support
* common.opt (-fstack-usage): New option.
* doc/invoke.texi (Debugging options): Document it.
* builtins.c (expand_builtin_apply): Pass TRUE as 4th argument to
allocate_dynamic_stack_space.
(expand_builtin_alloca): Add 4th bool parameter CANNOT_ACCUMULATE
and propagate it to allocate_dynamic_stack_space.
(expand_builtin) <BUILT_IN_ALLOCA>: Adjust for above change.
* calls.c (initialize_argument_information): Pass TRUE as 4th
argument to allocate_dynamic_stack_space.
(expand_call): Set current_function_has_unbounded_dynamic_stack_size
to 1 when pushing a variable-sized argument onto the stack. Pass
TRUE as 4th argument to allocate_dynamic_stack_space.
Update current_function_pushed_stack_size.
(emit_library_call_value_1): Likewise.
* explow.c (allocate_dynamic_stack_space): Add 4th bool parameter
CANNOT_ACCUMULATE. If flag_stack_usage, look into the size and
attempt to find an upper bound. Remove redundant code for the
SETJMP_VIA_SAVE_AREA case.
* expr.h (allocate_dynamic_stack_space): Add 4th bool parameter.
* function.h (struct stack_usage): New structure.
(current_function_static_stack_size): New macro.
(current_function_dynamic_stack_size): Likewise.
(current_function_pushed_stack_size): Likewise.
(current_function_dynamic_alloc_count): Likewise.
(current_function_has_unbounded_dynamic_stack_size): Likewise.
(current_function_allocates_dynamic_stack_space): Likewise.
(struct function): Add new field 'su'.
* function.c (instantiate_virtual_regs): If SETJMP_VIA_SAVE_AREA,
add the value of the dynamic offset to the dynamic stack usage.
(gimplify_parameters): Set ALLOCA_FOR_VAR_P on call to BUILT_IN_ALLOCA
for variable-sized objects.
(prepare_function_start): Allocate cfun->su if flag_stack_usage.
(rest_of_handle_thread_prologue_and_epilogue): Call output_stack_usage.
* gimplify.c (gimplify_decl_expr): Set ALLOCA_FOR_VAR_P on call to
BUILT_IN_ALLOCA for variable-sized objects.
* output.h (output_stack_usage): Declare.
* toplev.c (stack_usage_file): New file pointer.
(output_stack_usage): New function.
(open_auxiliary_file): Likewise.
(lang_dependent_init): Open file if flag_stack_usage is set.
(finalize): Close file if stack_usage_file is not null.
* tree.h (ALLOCA_FOR_VAR_P): New macro.
* config/alpha/alpha.c (compute_frame_size): New function.
(alpha_expand_prologue): Use it.
(alpha_start_function): Likewise.
(alpha_expand_epilogue): Likewise. Set stack usage info.
* config/i386/i386.c (ix86_expand_prologue): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/mips/mips.c (mips_expand_prologue): Likewise.
* config/pa/pa.c (hppa_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
* config/sparc/sparc.c (sparc_expand_prologue): Likewise.
testsuite/
* lib/gcc-dg.exp (cleanup-stack-usage): New procedure.
* lib/scanasm.exp (scan-stack-usage): Likewise.
(scan-stack-usage-not): Likewise.
* gcc.dg/stack-usage-1.c: New test.
* gcc.target/i386/stack-usage-realign.c: Likewise.
Zdenek Dvorak [Mon, 30 Aug 2010 19:50:05 +0000 (21:50 +0200)]
re PR tree-optimization/45427 (Number of iteration analysis bogus)
PR tree-optimization/45427
* tree-ssa-loop-niter.c (number_of_iterations_ne_max): Rewritten.
Handle the case that the exit is never taken correctly.
(number_of_iterations_ne): Pass exit_must_be_taken to
number_of_iterations_ne_max.
Nathan Froyd [Mon, 30 Aug 2010 16:03:44 +0000 (16:03 +0000)]
xtensa-protos.h (function_arg_advance): Delete.
* config/xtensa/xtensa-protos.h (function_arg_advance): Delete.
(function_arg): Delete.
* config/xtensa/xtensa.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
(FUNCTION_INCOMING_ARG): Delete.
* config/xtensa/xtensa.c (function_arg_advance): Rename to...
(xtensa_function_arg_advance): ...this. Make static. Take a const_tree
and a bool.
(function_arg): Rename to...
(xtensa_function_arg_1): ...this. Make static. Take a const_tree and
a bool.
(xtensa_function_arg, xtensa_function_incoming_arg): Nex functions.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
(TARGET_FUNCTION_INCOMING_ARG): Define.
Olivier Hainque [Mon, 30 Aug 2010 13:26:10 +0000 (13:26 +0000)]
decl.c (FOREIGN_FORCE_REALIGN_STACK): New macro, replacement for FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN.
* gcc-interface/decl.c (FOREIGN_FORCE_REALIGN_STACK): New macro,
replacement for FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN.
(gnat_to_gnu_entity) <case ..., E_Procedure>: Use it.
Uros Bizjak [Mon, 30 Aug 2010 07:28:27 +0000 (09:28 +0200)]
i386.md (zero_extendsidi2_1): Rename from zero_extendsidi2_32.
* config/i386/i386.md (zero_extendsidi2_1): Rename from
zero_extendsidi2_32.
(zero_extend<mode>di2): Macroize insn from zero_extend{qi,hi}di2
using SWI12 mode iterator.
(zero_extendhisi2_and): Merge insn pattern and corresponding spliter
to define_insn_and_split pattern.
(zero_extendqi<mode>2): Macroize expander from zero_extendqi{hi,si}2
using SWI24 mode iterator.
(*zero_extendqi<mode>2_and): Macroize insn from
*zero_extendqi{hi,si}2_and using SWI24 mode iterator.
(*zero_extendqi<mode>2_movzbl_and): Macroize insn from
*zero_extendqihi2_movzbw_and and *zero_extendqisi2_movzbl_and using
SWI24 mode iterator.
(*zero_extendqi<mode>2_movzbl): Ditto from
*zero_extendqi{hi,si}2_movzbl.
(extendsidi2_1): Rename from extendsidi2_32.
(extend<mode>di2): Macroize insn from extend{qi,hi}di2 using
SWI12 mode iterator.
Janus Weil [Sun, 29 Aug 2010 21:29:38 +0000 (23:29 +0200)]
re PR fortran/42769 ([OOP] ICE in resolve_typebound_procedure)
2010-08-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/42769
* resolve.c (resolve_structure_cons): For derived types, make sure the
type has been resolved.
(resolve_typebound_procedures): Make sure the vtab has been generated.
Eric Botcazou [Sun, 29 Aug 2010 19:57:07 +0000 (19:57 +0000)]
ia64.h (HARD_REGNO_NREGS): Return 1 for CCImode in general purpose registers.
* config/ia64/ia64.h (HARD_REGNO_NREGS): Return 1 for CCImode in
general purpose registers.
(HARD_REGNO_MODE_OK): Accept CCImode in general purpose registers.
* config/ia64/ia64.md (*movcci): Change to named pattern. Deal
with general purpose registers and memory operands. Add associated
CCImode post-reload splitter.
* config/ia64/div.md: Change BImode to CCImode throughout.
Uros Bizjak [Sat, 28 Aug 2010 14:30:34 +0000 (16:30 +0200)]
sse.md (extsuffix): New code attribute.
* config/i386/sse.md (extsuffix): New code attribute.
(sse4_1_<code>v8qiv8hi2): Macroize insn from sse4_1_extendv8qiv8hi2
and sse4_1_zero_extendv8qiv8hi2 using any_extend code iterator.
(sse4_1_<code>v4qiv4si2): Ditto from sse4_1_extendv4qiv4si2
and sse4_1_zero_extendv4qiv4si2.
(sse4_1_<code>v2qiv2di2): Ditto from sse4_1_extendv2qiv2di2
and sse4_1_zero_extendv2qiv2di2.
(sse4_1_<code>v4hiv4si2): Ditto from sse4_1_extendv4hiv4si2
and sse4_1_zero_extendv4hiv4si2.
(sse4_1_<code>v2hiv2di2): Ditto from sse4_1_extendv2hiv2di2
and sse4_1_zero_extendv2hiv2di2.
(sse4_1_extendv2siv2di2): Ditto from sse4_1_extendv2siv2di2
and sse4_1_zero_extendv2siv2di2
(<s>mulv8hi3_highpart): Macroize expander from {u,s}mulv8hi3_highpart
using any_extend code iterator.
(*avx_<s>mulv8hi3_highpart): Macroize insn from
*avx_{u,s}mulv8hi3_highpart using any_extend code iterator.
(*<s>mulv8hi3_highpart): Ditto from *{u,s}mulv8hi3_highpart.
Naveen H.S [Fri, 27 Aug 2010 23:29:41 +0000 (23:29 +0000)]
sh.c (push_regs): Emit movml for interrupt handler when possible.
* config/sh/sh.c (push_regs): Emit movml for interrupt handler
when possible.
(sh_expand_epilogue): Likewise.
* config/sh/sh.md (movml_push_banked): New insn.
(movml_pop_banked): Likewise.
* gcc.dg/attr-isr.c: Skip test for -m2a. Don't run on sh2a*-*-*.
Co-Authored-By: Kaz Kojima <kkojima@gcc.gnu.org>
From-SVN: r163602
Bernd Schmidt [Fri, 27 Aug 2010 22:08:37 +0000 (22:08 +0000)]
genautomata.c (gen_regexp_repeat, [...]): Use the string found in vector element 0 rather than the original string when...
* genautomata.c (gen_regexp_repeat, gen_regexp_allof,
gen_regexp_oneof, gen_regexp_sequence): Use the string found
in vector element 0 rather than the original string when there's
only one element.
(gen_regexp): Remove extra semicolon.
re PR fortran/32049 (Support on x86_64 also kind=16)
PR fortran/32049
* gfortran.h (gfc_real_info): Add c_float128 field.
* mathbuiltins.def: Indicate which builtins are const.
* trans-types.h (float128_type_node, complex_float128_type_node,
gfc_real16_is_float128): New variables.
* trans-types.c (float128_type_node, complex_float128_type_node,
gfc_real16_is_float128): New variables.
(gfc_init_kinds): Allow TFmode.
(gfc_build_real_type): Mark __float128 types as such.
(gfc_init_types): Initialize float128_type_node and
complex_float128_type_node
* f95-lang.c (gfc_init_builtin_functions): Adjust for new
argument of OTHER_BUILTIN macro.
* trans-intrinsic.c (gfc_intrinsic_map_t): Likewise.
(builtin_decl_for_precision): Special case for __float128.
(builtin_decl_for_float_kind): Likewise.
(define_quad_builtin): New function.
(gfc_build_intrinsic_lib_fndecls): Create all __float128
library decls if necessary. Store them in the real16_decl and
complex16_decl builtin map fields.
(gfc_get_intrinsic_lib_fndecl): Handle q-suffixed __float128
library function names.
* gfortran.dg/random_seed_1.f90: Adjust test.
* gfortran.dg/float128_1.f90: New test.
Janus Weil [Fri, 27 Aug 2010 19:02:15 +0000 (21:02 +0200)]
re PR fortran/45420 ([OOP] polymorphic TBP call in a CLASS DEFAULT clause)
2010-08-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/45420
* match.c (select_type_set_tmp): Add the possibility to reset the
temporary to NULL.
(gfc_match_class_is): Reset the temporary in CLASS DEFAULT clauses.
Thomas Koenig [Fri, 27 Aug 2010 12:08:47 +0000 (12:08 +0000)]
re PR fortran/45159 (Unnecessary temporaries)
2010-08-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
* dependency.c (check_section_vs_section): Single test for
identical strides which takes into account that only one
of the strides may be NULL.
2010-08-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
* gfortran.dg/dependency_33.f90: New test.
Olivier Hainque [Fri, 27 Aug 2010 10:48:32 +0000 (10:48 +0000)]
dse.c (group_info.base_mem, [...]): Use BLKmode to cover all the possible offsets from this base.
* dse.c (group_info.base_mem, get_group_info): Use BLKmode to
cover all the possible offsets from this base.
(scan_reads_nospill): Pass base_mem's mode to canon_true_dependence.
testsuite/
* gnat.dg/dse_step.ads, dse_step.adb, test_dse_step.adb: New test.
Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r163582
Jerry DeLisle [Fri, 27 Aug 2010 06:50:03 +0000 (06:50 +0000)]
re PR fortran/43217 (Output of Hollerith constants which are not a multiple of 4 bytes)
2010-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/43217
* primary.c (match_hollerith_constant): Calculate padding needed to
fill default integer and allocate string for that size. Set pad bytes
to ' '.
* gfortran.h: Add hollerith pad value to type spec union.
* data.c (create_character_initializer): Fix spelling of function name.
Use hollerith pad value to calculate length.
* arith.c (hollerith2representation); Use hollerith pad value to
calculate length.
Daniel Kraft [Thu, 26 Aug 2010 19:48:43 +0000 (21:48 +0200)]
re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))
2010-08-26 Daniel Kraft <d@domob.eu>
PR fortran/38936
PR fortran/44047
PR fortran/45384
* gfortran.h (struct gfc_association_list): New flag `dangling'.
(gfc_build_block_ns): Declared here...
* parse.h (gfc_build_block_ns): ...instead of here.
* trans.h (gfc_process_block_locals): Expect additionally the
gfc_association_list of BLOCK (if present).
* match.c (select_type_set_tmp): Create sym->assoc for temporary.
* resolve.c (resolve_variable): Only check for invalid *array*
references on associate-names.
(resolve_assoc_var): New method with code previously in resolve_symbol.
(resolve_select_type): Use association to give the selector and
temporaries their values instead of ordinary assignment.
(resolve_fl_var_and_proc): Allow CLASS associate-names.
(resolve_symbol): Use new `resolve_assoc_var' instead of inlining here.
* trans-stmt.c (gfc_trans_block_construct): Pass association-list
to `gfc_process_block_locals' to match new interface.
* trans-decl.c (gfc_get_symbol_decl): Don't defer associate-names
here automatically.
(gfc_process_block_locals): Defer them rather here when linked to
from the BLOCK's association list.
2010-08-26 Daniel Kraft <d@domob.eu>
PR fortran/38936
PR fortran/44047
PR fortran/45384
* gfortran.dg/associate_8.f03: New test.
* gfortran.dg/select_type_13.f03: New test.
* gfortran.dg/select_type_14.f03: New test.
Jakub Jelinek [Thu, 26 Aug 2010 16:39:26 +0000 (18:39 +0200)]
re PR tree-optimization/44485 (ICE in get_expr_operands, at tree-ssa-operands.c:1020)
PR tree-optimization/44485
* calls.c (flags_from_decl_or_type): For const or pure
noreturn functions return ECF_LOOPING_CONST_OR_PURE|ECF_NORETURN
together with ECF_CONST resp. ECF_PURE.
* builtins.c (expand_builtin): Use flags_from_decl_or_type
instead of querying flags directly.
* tree-ssa-loop-niter.c (finite_loop_p): Likewise.
* tree-ssa-dce.c (find_obviously_necessary_stmts): Likewise.
Jakub Jelinek [Wed, 25 Aug 2010 14:44:46 +0000 (16:44 +0200)]
trans-decl.c (gfc_build_intrinsic_function_decls): Set TREE_NOTHROW on fndecls that can't throw.
* trans-decl.c (gfc_build_intrinsic_function_decls): Set
TREE_NOTHROW on fndecls that can't throw. Set
TREE_READONLY on gfor_fndecl_math_ishftc{4,8,16}.
(gfc_build_builtin_function_decls): Set TREE_NOTHROW on
gfor_fndecl_associated.
Bernd Schmidt [Wed, 25 Aug 2010 14:14:59 +0000 (14:14 +0000)]
combine.c (find_split_point): Undo canonicalization of multiply-add to (minus x (mult)) when...
* combine.c (find_split_point): Undo canonicalization of multiply-add
to (minus x (mult)) when it seems likely that this will increase the
chances of a split.
Richard Guenther [Wed, 25 Aug 2010 10:47:50 +0000 (10:47 +0000)]
re PR middle-end/45393 (ICE in redirect_eh_edge_1, at tree-eh.c:2135)
2010-08-25 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45393
* tree-ssa-math-opts.c (execute_cse_sincos_1): Properly transfer
and clean EH info. Avoid SSA update.
(execute_cse_sincos): Cleanup the CFG if it has changed.