Jakub Jelinek [Mon, 17 May 2010 17:18:24 +0000 (19:18 +0200)]
re PR middle-end/44102 (ICE with asm goto + __builtin_unreachable () in C++)
PR middle-end/44102
* cfgcleanup.c (try_optimize_cfg): When removing trivially empty
bb with no successors, move footer whenever in IR_RTL_CFGLAYOUT
mode, not just when CLEANUP_CFGLAYOUT, and when in IR_RTL_CFGRTL
add BARRIER after previous bb if needed.
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete
unnecessary prototype. Replace copy_r12 and copy_r11 flag params
with copy_reg rtx param.
(rs6000_emit_prologue): Update rs6000_emit_allocate_stack calls.
Correct cases where code for ABI_V4 did not initialise the reg
used to access frame. Also leave frame_reg_rtx as sp for large
frames that save no regs.
Martin Jambor [Mon, 17 May 2010 12:48:34 +0000 (14:48 +0200)]
re PR middle-end/44133 (Uninit warning regression with new SRA)
2010-05-17 Martin Jambor <mjambor@suse.cz>
PR middle-end/44133
* tree-sra.c (create_access_replacement): New parameter rename, mark
the replaement for renaming only when it is true.
(get_access_replacement): Pass true in the rename parameter of
create_access_replacement.
(get_unrenamed_access_replacement): New function.
(replace_uses_with_default_def_ssa_name): New parameter racc, get the
replacement declaration from it.
* testsuite/gcc.dg/tree-ssa/pr44133.c: New test.
* testsuite/gcc.dg/tree-ssa/sra-9.c: Make the scan regular
expression more precise.
Bernd Schmidt [Mon, 17 May 2010 11:16:00 +0000 (11:16 +0000)]
function.c (try_fit_stack_local, [...]): New static functions.
* function.c (try_fit_stack_local, add_frame_space): New static
functions.
(assign_stack_local_1): Use them. Look for opportunities to use
space previously wasted on alignment.
* function.h (struct frame_space): New.
(struct rtl_data): Add FRAME_SPACE_LIST member.
* reload1.c (something_was_spilled): New static variable.
(alter_reg): Set it.
(reload): Test it in addition to testing if the frame size changed.
Janus Weil [Mon, 17 May 2010 08:25:06 +0000 (10:25 +0200)]
re PR fortran/44044 ([OOP] SELECT TYPE with class-valued function)
2010-05-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/44044
* resolve.c (resolve_fl_var_and_proc): Move error messages here from ...
(resolve_fl_variable_derived): ... this place.
(resolve_symbol): Make sure function symbols (and their result
variables) are not resolved twice.
s390.c: Define sane prefetch settings and activate flag_prefetch_loop_arrays on -O3.
2010-05-17 Christian Borntraeger <borntraeger@de.ibm.com>
* config/s390/s390.c: Define sane prefetch settings and activate
flag_prefetch_loop_arrays on -O3.
* config/s390/s390.h: Declare that read can use write prefetch.
Jan Hubicka [Sun, 16 May 2010 21:49:36 +0000 (23:49 +0200)]
cgraph.c (cgraph_clone_node): Take decl argument and insert clone into hash when it is different from orig.
* cgraph.c (cgraph_clone_node): Take decl argument and insert
clone into hash when it is different from orig.
(cgraph_create_virtual_clone): Update use of cgraph_clone_node.
* cgraph.h (cgraph_clone_node): Update prototype.
* lto-cgrpah.c (lto_cgraph_encoder_new): Create body map.
(lto_cgraph_encoder_delete): Delete body map.
(lto_cgraph_encoder_size): Move to header.
(lto_cgraph_encoder_encode_body_p, lto_set_cgraph_encoder_encode_body): New.
(lto_output_node): Do not take written_decls argument; output clone_of
pointer.
(add_node_to): Add include_body_argument; call
lto_set_cgraph_encoder_encode_body on master of the clone.
(add_references): Update use of add_node_to.
(compute_ltrans_boundary): Likewise.
(output_cgraph): Do not create written_decls bitmap.
(input_node): Take nodes argument; stream in clone_of correctly.
(input_cgraph_1): Update use of input_node.
* lto-streamer-out.c (lto_output): Use encoder info to decide
what bodies to output.
* ipa-inline.c (cgraph_clone_inlined_nodes,
cgraph_decide_recursive_inlining): Update call of cgraph_clone_node.
* lto-streamer.h (lto_cgraph_encoder_d): Add body.
(lto_cgraph_encoder_size): Define here.
(lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p):
Declare.
Richard Guenther [Sun, 16 May 2010 19:56:44 +0000 (19:56 +0000)]
invoke.texi (-fipa-struct-reorg): Do not mention -fipa-type-escape.
2010-05-16 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi (-fipa-struct-reorg): Do not mention
-fipa-type-escape.
* ipa-type-escape.c (gate_type_escape_vars): Run when
-fipa-struct-reorg runs.
* opts.c (decode_options): Do not unset flag_ipa_type_escape.
* common.opt (fipa-type-escape): Remove.
* gcc.dg/pr43317.c: Do not pass -fipa-type-escape.
* gcc.dg/pr43084.c: Likewise.
* gcc.dg/pr42250.c: Pass -fipa-struct-reorg instead of
-fipa-type-escape.
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Do not pass
-fipa-type-escape.
* gcc.dg/struct/struct-reorg.exp: Likewise.
* gcc.dg/struct/wo_prof_empty_str.c: Likewise.
* gcc.dg/struct/wo_prof_escape_return.c: Likewise.
Eric Botcazou [Sun, 16 May 2010 18:46:16 +0000 (18:46 +0000)]
opts.c (handle_option): Call into LTO streamer only if ENABLE_LTO.
* opts.c (handle_option): Call into LTO streamer only if ENABLE_LTO.
(decode_options): Likewise.
* Makefile.in (opts.o): Add dependency on LTO_STREAMER_H.
misc.c (gnat_handle_option): Remove special logic for Wuninitialized without -O.
2010-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
ada/
* gcc-interface/misc.c (gnat_handle_option): Remove special logic
for Wuninitialized without -O.
fortran/
* options.c (set_Wall): Remove special logic for Wuninitialized
without -O.
Eric Botcazou [Sun, 16 May 2010 09:11:39 +0000 (09:11 +0000)]
gigi.h (enum standard_datatypes): Add new value ADT_exception_data_name_id.
* gcc-interface/gigi.h (enum standard_datatypes): Add new value
ADT_exception_data_name_id.
(exception_data_name_id): New define.
* gcc-interface/trans.c (gigi): Initialize it.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Use the standard
exception type for standard exception definitions. Do not make them
volatile.
<E_Record_Type>: Equate fields of types associated with an exception
definition to those of the standard exception type.
Steven Bosscher [Sat, 15 May 2010 20:02:11 +0000 (20:02 +0000)]
vecir.h: New file with VEC primitives for tree, gimple, and rtl.
gcc/ChangeLog
* vecir.h: New file with VEC primitives for tree, gimple, and rtl.
* Makefile.in: Add it.
Fix all other Makefile dependencies for changes below.
* tree.h: Include it instead of defining VEC primitives here.
* gimple.h: Likewise.
* rtl.h: Likewise.
* tree-inline.h: Inlclude vecir.h instead of gimple.h.
* except.h: Include vecir.h, break dependence on tree.h.
* c-lex.c: Include fixed-value.h instead of rtl.h. Do not include
tm_p.h.
* c-cppbuiltin.c: Explain why debug.h and tm_p.h are included.
* c-objc-common.h: Do not include tm.h, rtl.h, insn-config.h,
integrate.h, function.h, toplev.h, tree-inline.h, ggc.h,
tree-mudflap.h, and target.h.
* c-semantics.c: Do not include except.h, ggc.h, rtl.h, timevar.h,
predict.h, tree-inline.h, gimple.h, and langhooks.h.
* c-decl.c: Do not include expr.h, ggc.h, libfuncs.h, except.h.
Add FIXME for why gimple.h is still included (should be unnecessary
since GCC 4.5 gimplification unit-at-a-time).
* c-typeck.c: Do not include rtl.h, tm_p.h, ggc.h, and gimple.h.
* c-pragma.c: Add FIXME for why function.h needs to be included just
for cfun, at front-end level.
Add note that REGISTER_TARGET_PRAGMAS should probably be a target hook.
Do not include ggc.h, but include vecprim.h for VEC(char).
* c-opts.c: Do not include tm.h, tree-inline.h, and tm_p.h.
Explain why target.h is included.
* c-omp.h: Do not include tm.h, function.h, and bitmap.h.
Explain why gimple.h is included.
* c-ppoutput.c: Do not include tm.h.
* c-common.c: Do not include gimple.h. Explain why expr.h is included.
* c-parses.c: Explain why rtl.h is included, and that this (and only
this) is also why tm.h must be included.
Do not include except.h.
* c-lang.c: Do not include ggc.h.
cp/ChangeLog
* decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
* Make-lang.in: Fix dependencies accordingly.
Uros Bizjak [Sat, 15 May 2010 19:19:48 +0000 (21:19 +0200)]
mfdg.exp (additional_prunes): New global.
* testsuite/lib/mfdg.exp (additional_prunes): New global.
(dg-test): Clear additional_prunes before test is run.
(dg-prune-output): New procedure.
* testsuite/lib/libmudflap.exp (libmudflap-dg-test): Do not call
prune_gcc_output.
(libmudflap-dg-prune): New procedure.
* testsuite/libmudflap.c++/pass57-frag.cxx (dg-prune-output):
New dg directive.
Joseph Myers [Sat, 15 May 2010 19:07:01 +0000 (20:07 +0100)]
c-decl.c (grokfield): Allow typedefs for anonymous structs and unions by default if...
* c-decl.c (grokfield): Allow typedefs for anonymous structs and
unions by default if those structs and unions have no tags. Do
not condition anonymous struct and unions handling on flag_iso.
Allow anonymous structs and unions for C1X.
(finish_struct): Do not diagnose lack of named fields when
anonymous structs and unions present for C1X. Accept flexible
array members in structure with anonymous structs or unions but no
directly named fields.
* doc/extend.texi (Unnamed Fields): Update.
testsuite:
* gcc.dg/c1x-anon-struct-1.c, gcc.dg/c1x-anon-struct-2.c,
gcc.dg/c90-anon-struct-1.c, gcc.dg/c99-anon-struct-1.c: New tests.
* gcc.dg/20080820.c, gcc.dg/anon-struct-1.c: Update expected
diagnostics and type sizes.
Eric Botcazou [Sat, 15 May 2010 19:05:06 +0000 (19:05 +0000)]
gimple.h (compare_field_offset): Rename into...
* gimple.h (compare_field_offset): Rename into...
(gimple_compare_field_offset): ...this.
* gimple.c (compare_field_offset): Rename into...
(gimple_compare_field_offset): ...this. Compare the full access if
the offset is self-referential.
(gimple_types_compatible_p): Adjust for above renaming.
* lto-streamer-in.c (input_gimple_stmt): Likewise. Also compare the
DECL_NONADDRESSABLE_P flag of fields before merging them.
Jan Hubicka [Sat, 15 May 2010 17:06:48 +0000 (19:06 +0200)]
ipareference_1.c: Rename to ...
* gcc.dg/lto/ipareference_1.c: Rename to ...
* gcc.dg/lto/ipareference_0.c: ... this one.
* gcc.dg/lto/ipareference_2.c: Rename to ...
* gcc.dg/lto/ipareference_1.c: ... this one.
Janus Weil [Sat, 15 May 2010 13:52:33 +0000 (15:52 +0200)]
re PR fortran/43207 ([OOP] invalid (pointer) assignment to and from abstract non-polymorphic expressions)
2010-05-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/43207
PR fortran/43969
* gfortran.h (gfc_class_null_initializer): New prototype.
* expr.c (gfc_class_null_initializer): New function to build a NULL
initializer for CLASS pointers.
* symbol.c (gfc_build_class_symbol): Modify internal naming of class
containers. Remove default NULL initialization of $data component.
* trans.c (gfc_allocate_array_with_status): Fix wording of an error
message.
* trans-expr.c (gfc_conv_initializer,gfc_trans_subcomponent_assign):
Use new function 'gfc_class_null_initializer'.
* trans-intrinsic.c (gfc_conv_allocated): Handle allocatable scalar
class variables.
Jan Hubicka [Sat, 15 May 2010 09:46:55 +0000 (11:46 +0200)]
tree.h (memory_identifier_string): Remove.
* tree.h (memory_identifier_string): Remove.
* ipa-reference.c: Update comment; do not include gt-ipa-reference.h
(ipa_reference_global_vars_info_d): Remove statics_not_read and
statics_not_written.
(ipa_reference_optimization_summary_d): New structure.
(ipa_reference_optimization_summary_t): New type and vector.
(ipa_reference_vars_info_d): Embedd structures instead of using
pointers.
(reference_vars_to_consider): Remove out of GGC space.
(module_statics_escape): Remove.
(global_info_obstack): Rename to ...
(optimization_summary_obstack): ... this one.
(initialization_status_t): Remove.
(memory_identifier_string): Remove.
(get_reference_vars_info): Fix indenting.
(set_reference_vars_info): Likewise.
(get_reference_optimization_summary): New.
(set_reference_optimization_summary): New.
(get_global_reference_vars_info): Remove.
(ipa_reference_get_read_global): Remove.
(ipa_reference_get_written_global): Remove.
(ipa_reference_get_not_read_global): Update.
(ipa_reference_get_not_written_global): Update.
(is_proper_for_analysis): Outlaw addressable.
(propagate_bits): Update for new datastructures.
(analyze_variable): Remove.
(init_function_info): Update for new datastructures.
(clean_function_local_data): Remove.
(clean_function): Remove.
(copy_global_bitmap): Use optimizations_summary_obstack.
(duplicate_node_data): Duplicate optimization summary only.
(remove_node_data): Remove optimization summary only.
(generate_summary): Do not analyze variables; do not compute
module_statics_escape; do not prune solutions by it.
(read_write_all_from_decl): Fix typos in comments.
(propagate): Doscover readonly and nonaddressable first;
update for new datastructures; share global bitmaps.
* ipa-reference.h (ipa_reference_get_read_global,
ipa_reference_get_written_global): Remove.
* ipa-pure-const.c (check_stmt): Do not use memory_identifier_string.
* Makefile.in: Remove ipa-refereference from GT files.
* cgraph.h (ipa_discover_readonly_nonaddressable_vars): Declare.
(varpool_all_refs_explicit_p): New inline function.
* ipa-reference.c: Update comment.
(module_statics_written): Remove.
(get_static_decl): Remove.
(ipa_init): Do not initialize module_statics_written.
(analyze_function): Likewise.
(generate_summary): Likewise; do not compute module_statics_readonly
and do not update variable flags.
(propagate): Call ipa_discover_readonly_nonaddressable_vars.
* ipa.c: Inlucde flags.h
(cgraph_local_node_p): New.
(cgraph_remove_unreachable_nodes): Return early when not optimizing;
promote functions to local.
(ipa_discover_readonly_nonaddressable_vars): New function.
(function_and_variable_visibility): Use cgraph_local_node_p.
* varpool.c (varpool_finalize_decl): Set force_output for
DECL_PRESERVE_P vars.
Nathan Froyd [Fri, 14 May 2010 20:47:39 +0000 (20:47 +0000)]
re PR middle-end/44103 (New Java test failures)
PR 44103
* java-tree.h (START_RECORD_CONSTRUCTOR): Change first argument to a
vector. Move call to build_constructor...
(FINISH_RECORD_CONSTRUCTOR): ...here. Add necessary arguments. Clear
TREE_CONSTANT on the constructor.
(PUSH_SUPER_VALUE): Change first argument to a vector.
(PUSH_FIELD_VALUE): Likewise.
* resource.c (compile_resource_data): Update calls to above macros.
* constants.c (build_constants_constructor): Likewise.
* class.c (build_utf8_ref): Likewise.
(make_field_value): Likewise.
(make_method_value): Likewise.
(add_table_and_syms): New function.
(make_class_data): Call it. Update calls to above macros.
(build_symbol_table_entry): New function.
(build_symbol_entry): Call it. Update calls to above macros.
(emit_symbol_table): Likewise.
(make_catch_class_record): Update calls to above macros.
(build_assertion_table_entry): New function.
(add_assertion_table_entry): Call it.
(emit_assertion_table): Likewise.
Jan Hubicka [Fri, 14 May 2010 18:34:30 +0000 (20:34 +0200)]
ipa.c (enqueue_cgraph_node): Update comment; do not re-enqueue nodes already in queue.
* ipa.c (enqueue_cgraph_node): Update comment; do not re-enqueue
nodes already in queue.
(cgraph_remove_unreachable_nodes): Cleanup; fix problem with re-enqueueing
node.
* config.gcc: Add support for --with-cpu option for bdver1.
* config/i386/i386.h (TARGET_BDVER1): New macro.
(ix86_tune_indices): Change SSE_UNALIGNED_MOVE_OPTIMAL
to SSE_UNALIGNED_LOAD_OPTIMAL. Add SSE_UNALIGNED_STORE_OPTIMAL.
(ix86_tune_features) :Change SSE_UNALIGNED_MOVE_OPTIMAL
to SSE_UNALIGNED_LOAD_OPTIMAL. Add SSE_UNALIGNED_STORE_OPTIMAL.
Add SSE_PACKED_SINGLE_INSN_OPTIMAL.
(TARGET_CPU_DEFAULT_NAMES): Add bdver1.
(processor_type): Add PROCESSOR_BDVER1.
* config/i386/i386.md: Add bdver1 as a new cpu attribute to match
processor_type in config/i386/i386.h.
Add check for TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL to emit
movaps <reg, reg> instead of movapd <reg, reg> when replacing
movsd <reg, reg> or movss <reg, reg> for SSE and AVX.
Add check for TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL
to emit packed xor instead of packed double/packed integer
xor for SSE and AVX when moving a zero value.
* config/i386/sse.md: Add check for TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL
to emit movaps instead of movapd/movdqa for SSE and AVX.
Add check for TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL to emit packed single
logical operations i.e and, or and xor instead of packed double logical
operations for SSE and AVX.
* config/i386/i386-c.c:
(ix86_target_macros_internal): Add PROCESSOR_BDVER1.
* config/i386/driver-i386.c: Turn on -mtune=native for BDVER1.
(has_fma4, has_xop): New.
* config/i386/i386.c (bdver1_cost): New variable.
(m_BDVER1): New macro.
(m_AMD_MULTIPLE): Add m_BDVER1.
(x86_tune_use_leave, x86_tune_push_memory, x86_tune_unroll_strlen,
x86_tune_deep_branch_prediction, x86_tune_use_sahf, x86_tune_movx,
x86_tune_use_simode_fiop, x86_tune_promote_qimode,
x86_tune_add_esp_8, x86_tune_tune_sub_esp_4, x86_tune_sub_esp_8,
x86_tune_integer_dfmode_moves, x86_tune_partial_reg_dependency,
x86_tune_sse_partial_reg_dependency, x86_tune_sse_unaligned_load_optimal,
x86_tune_sse_unaligned_store_optimal, x86_tune_sse_typeless_stores,
x86_tune_memory_mismatch_stall, x86_tune_use_ffreep,
x86_tune_inter_unit_moves, x86_tune_inter_unit_conversions,
x86_tune_use_bt, x86_tune_pad_returns, x86_tune_slow_imul_imm32_mem,
x86_tune_slow_imul_imm8, x86_tune_fuse_cmp_and_branch):
Enable/disable for bdver1.
(processor_target_table): Add bdver1_cost.
(cpu_names): Add bdver1.
(override_options): Set up PROCESSOR_BDVER1 for bdver1 entry in
processor_alias_table.
(ix86_expand_vector_move_misalign): Change
TARGET_SSE_UNALIGNED_MOVE_OPTIMAL to TARGET_SSE_UNALIGNED_LOAD_OPTIMAL.
Check for TARGET_SSE_UNALIGNED_STORE_OPTIMAL.
Check for TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL to emit movups instead
of movupd/movdqu for SSE and AVX.
(ix86_tune_issue_rate): Add PROCESSOR_BDVER1.
(ix86_tune_adjust_cost): Add code for bdver1.
(standard_sse_constant_opcode): Add check for
TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL to emit packed single xor instead
of packed double xor for SSE and AVX.
Jakub Jelinek [Fri, 14 May 2010 07:40:06 +0000 (09:40 +0200)]
trans.c (trans_code): Set backend locus early.
* trans.c (trans_code): Set backend locus early.
* trans-decl.c (gfc_get_fake_result_decl): Use source location
of the function instead of current input_location.
PR c++/30566
* name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
shadowing the outer parameter or variables by the declaration of
nested function in nested structure or class. Warn the shadowing by
the declaration of nested lambda expression.
Jan Hubicka [Thu, 13 May 2010 17:46:21 +0000 (19:46 +0200)]
final.c (output_addr_const): Do not call mark_decl_referenced.
* final.c (output_addr_const): Do not call mark_decl_referenced.
* cgraphunit.c (process_function_and_variable_attributes): Use
mark_needed_node dirrectly.
(assemble_thunk): Do not call mark_decl_referenced.
Jakub Jelinek [Thu, 13 May 2010 10:40:51 +0000 (12:40 +0200)]
re PR debug/43983 (var-tracking needlessly throws away location info for SRAed vars)
PR debug/43983
* var-tracking.c (track_expr_p): Allow tracking of variables optimized
by SRA.
* Makefile.in (dwarf2out.o): Depend on $(TREE_FLOW_H).
* tree-sra.c (create_access_replacement): Call unshare_expr before
passing expr to SET_DECL_DEBUG_EXPR, and remove any SSA_NAMEs from
it.
* dwarf2out.c: Include tree-flow.h.
(struct var_loc_node): Rename var_loc_note field to loc, add comment.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_bit_piece.
(decl_piece_bitsize, decl_piece_varloc_ptr, decl_piece_node,
construct_piece_list, adjust_piece_list): New functions.
(add_var_loc_to_decl): Handle SRA optimized variables.
Adjust for var_loc_note to loc field renaming.
(dw_loc_list_1): For WANT_ADDRESS == 2 prefer DECL_MODE of decl
in VAR_LOCATION note.
(new_loc_descr_op_bit_piece): New function.
(dw_sra_loc_expr): New function.
(dw_loc_list): Use it. Don't handle the last range after the
loop, handle it inside of the loop. Adjust for var_loc_note
to loc field renaming.
(add_location_or_const_value_attribute): Only special case
single entry loc lists if loc is NOTE_P. Adjust for
var_loc_note to loc field renaming.
(dwarf2out_var_location): Don't set newloc->var_loc_note
and newloc->next here.
Jason Merrill [Thu, 13 May 2010 05:05:21 +0000 (01:05 -0400)]
typeck.c (build_array_ref): Take complain parm.
* typeck.c (build_array_ref): Take complain parm.
* cp-tree.h: Add it to prototype.
* call.c (build_new_op): Pass it.
* class.c (build_vtbl_ref): Pass it.
* decl2.c (grok_array_decl): Pass it.