Yufeng Zhang [Wed, 4 Dec 2013 08:06:16 +0000 (08:06 +0000)]
gimple-ssa-strength-reduction.c: Include tree-affine.h.
gcc/
* gimple-ssa-strength-reduction.c: Include tree-affine.h.
(name_expansions): New static variable.
(alt_base_map): Ditto.
(get_alternative_base): New function.
(find_basis_for_candidate): For CAND_REF, optionally call
find_basis_for_base_expr with the returned value from
get_alternative_base.
(record_potential_basis): Add new parameter 'base' of type 'tree';
add an assertion of non-NULL base; use base to set node->base_expr.
(alloc_cand_and_find_basis): Update; call record_potential_basis
for CAND_REF with the returned value from get_alternative_base.
(replace_refs): Dump details on the replacing.
(execute_strength_reduction): Call pointer_map_create for
alt_base_map; call free_affine_expand_cache with &name_expansions.
gcc/testsuite/
* gcc.dg/tree-ssa/slsr-39.c: Update.
* gcc.dg/tree-ssa/slsr-41.c: New test.
Wei Mi [Tue, 3 Dec 2013 18:35:24 +0000 (18:35 +0000)]
re PR rtl-optimization/59020 (internal compiler error: in maybe_add_or_update_dep_1, at sched-deps.c:933)
2013-12-03 Wei Mi <wmi@google.com>
PR rtl-optimization/59020
* sched-deps.c (try_group_insn): Move it from haifa-sched.c to here.
(sched_analyze_insn): Call try_group_insn.
(sched_analyze): Cleanup SCHED_GROUP_P before start the analysis.
* haifa-sched.c (try_group_insn): Moved to sched-deps.c.
(group_insns_for_macro_fusion): Removed.
(sched_init): Remove calling group_insns_for_macro_fusion.
Yury Gribov [Tue, 3 Dec 2013 16:01:13 +0000 (16:01 +0000)]
re PR sanitizer/59063 (ASAN: segfault in __interceptor_clock_gettime)
PR sanitizer/59063
* lib/asan-dg.exp: Don't add anything to flags if libsanitizer
has not been found.
* lib/ubsan-dg.exp: Likewise. Append to flags also
-B${gccpath}/libsanitizer/.
Chung-Ju Wu [Tue, 3 Dec 2013 10:58:05 +0000 (10:58 +0000)]
Fix some testcases for nds32 target and provide new nds32 target specific tests.
gcc/testsuite/
* gcc.dg/20020312-2.c: Add __nds32__ case.
* gcc.dg/builtin-apply2.c: Skip for nds32*-*-*.
* gcc.dg/sibcall-3.c: Expected fail for nds32*-*-*.
* gcc.dg/sibcall-4.c: Expected fail for nds32*-*-*.
* gcc.dg/stack-usage-1.c (SIZE): Define case for __nds32__.
* gcc.dg/torture/pr37868.c: Skip for nds32*-*-*.
* gcc.dg/torture/stackalign/builtin-apply-2.c: Skip for nds32*-*-*.
* gcc.dg/tree-ssa/20040204-1.c: Expected fail for nds32*-*-*.
* gcc.dg/tree-ssa/pr42585.c: Skip for nds32*-*-*.
* gcc.dg/tree-ssa/sra-12.c: Skip for nds32*-*-*.
* gcc.target/nds32: New nds32 specific directory and testcases.
* lib/target-supports.exp (check_profiling_available): Check for
nds32*-*-elf.
Jakub Jelinek [Tue, 3 Dec 2013 07:48:58 +0000 (08:48 +0100)]
re PR tree-optimization/59362 (Abort in fini_object_sizes)
PR tree-optimization/59362
* tree-object-size.c (object_sizes): Change into array of
vec<unsigned HOST_WIDE_INT>.
(compute_builtin_object_size): Check computed bitmap for
non-NULL instead of object_sizes. Call safe_grow on object_sizes
vector if new SSA_NAMEs appeared.
(init_object_sizes): Check computed bitmap for non-NULL.
Call safe_grow on object_sizes elements instead of initializing
it with XNEWVEC.
(fini_object_sizes): Call release on object_sizes elements, don't
set it to NULL.
Jakub Jelinek [Tue, 3 Dec 2013 07:44:37 +0000 (08:44 +0100)]
re PR middle-end/59011 (ICE in make_decl_rtl, at varasm.c:1147)
PR middle-end/59011
* gimplify.c (nonlocal_vla_vars): New variable.
(gimplify_var_or_parm_decl): Put VAR_DECLs for VLAs into
nonlocal_vla_vars chain.
(gimplify_body): Call declare_vars on nonlocal_vla_vars chain
if outer_bind has DECL_INITIAL (current_function_decl) block.
Sriraman Tallam [Tue, 3 Dec 2013 03:14:09 +0000 (03:14 +0000)]
This patch fixes PR 58944
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58944
ix86_valid_target_attribute_tree in config/i386/i386.c was
refactored to not depend on global_options structure and to be able to
use any gcc_options structure. One clean way to fix this is by having
target_option_default_node save all the default target options which
can be restored to any gcc_options structure. The root cause of the
above bugs was that ix86_arch_string and ix86_tune_string was not
saved in target_option_deault_node.
This patch saves all the target options used in i386.opt which are
either obtained from the command-line or set to some default.
Testing:
Patch tested for bootstrap on all default languages(also obj-c++ and ada)
on x86_64 and regression testsuite checked for parity with RUNTESTFLAGS -m32
and m64.
Jakub Jelinek [Mon, 2 Dec 2013 22:41:23 +0000 (23:41 +0100)]
re PR tree-optimization/59358 (Infinite loop generated with >=O2)
PR tree-optimization/59358
* tree-vrp.c (union_ranges): To check for the partially
overlapping ranges or adjacent ranges, also compare *vr0max
with vr1max.
Fix C++0x memory model for unaligned fields in packed, aligned(4)
structures with -fno-strict-volatile-bitfields on STRICT_ALIGNMENT
targets like arm-none-eabi.
* expr.c (expand_assignment): Handle normal fields like bit regions.
Richard Biener [Mon, 2 Dec 2013 15:13:52 +0000 (15:13 +0000)]
tree-ssa-operands.c (opf_implicit): Remove.
2013-12-02 Richard Biener <rguenther@suse.de>
* tree-ssa-operands.c (opf_implicit): Remove.
(opf_address_taken): New flag.
(get_expr_operands): Remove early out, pass down
opf_address_taken for ADDR_EXPRs, add a use operand only
for non-opf_address_taken bases.
(get_indirect_ref_operands): Rename to ...
(get_mem_ref_operands): ... this.
(get_asm_expr_operands): Rename to ...
(get_asm_stmt_operands): ... this.
Eric Botcazou [Mon, 2 Dec 2013 11:20:14 +0000 (11:20 +0000)]
re PR tree-optimization/59356 (ACATS C52102A and C52102C failures)
PR tree-optimization/59356
* tree-dfa.h (get_addr_base_and_unit_offset_1) <case ARRAY_REF>: Do the
offset computation using the precision of the index type.
Paul Thomas [Sun, 1 Dec 2013 11:50:20 +0000 (11:50 +0000)]
re PR fortran/57354 (Wrong run-time assignment of allocatable array of derived type with allocatable component)
2013-12-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57354
* trans-array.c (gfc_conv_resolve_dependencies): For other than
SS_SECTION, do a dependency check if the lhs is liable to be
reallocated.
2013-12-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57354
* gfortran.dg/realloc_on_assign_23.f90 : New test
Paul Thomas [Sun, 1 Dec 2013 11:42:25 +0000 (11:42 +0000)]
re PR fortran/58410 (Bogus uninitialized variable warning for allocatable derived type array function result)
2013-12-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/58410
* trans-array.c (gfc_alloc_allocatable_for_assignment): Do not
use the array bounds of an unallocated array but set its size
to zero instead.
Ian Lance Taylor [Sat, 30 Nov 2013 17:14:50 +0000 (17:14 +0000)]
reflect: Fix MakeFunc for 386 when returning a struct.
When a 386 function returns a struct, it needs to return using
an rtd instruction that pops the hidden struct parameter off
the stack. That wasn't happening.
Paulo Matos [Sat, 30 Nov 2013 11:13:07 +0000 (11:13 +0000)]
combine.c (reg_nonzero_bits_for_combine): Apply mask transformation as applied to nonzero_sign_valid when...
* combine.c (reg_nonzero_bits_for_combine): Apply mask transformation
as applied to nonzero_sign_valid when last_set_mode has less precision
than mode.
Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r205550
Tobias Burnus [Sat, 30 Nov 2013 09:11:13 +0000 (10:11 +0100)]
re PR sanitizer/59275 (Document environment variables used by the sanitizers)
2013-11-30 Tobias Burnus <burnus@net-b.de>
PR sanitizer/59275
* doc/invoke.texi (-fsanitize=address,leak): Mention the
* associated
environment variable and link to a list with flags.
(-fsanitize=thread): Ditto and update link.
Joseph Myers [Fri, 29 Nov 2013 21:24:14 +0000 (21:24 +0000)]
re PR c/42262 (internal compiler error: in set_designator, at c-typeck.c:5771)
PR c/42262
c:
* c-typeck.c (process_init_element): Do not treat a string as
initializing a whole array when used with a designator for an
individual element.
testsuite:
* gcc.dg/c99-init-5.c, gcc.dg/c99-init-6.c: New tests.
Vladimir Makarov [Fri, 29 Nov 2013 20:08:38 +0000 (20:08 +0000)]
re PR rtl-optimization/59340 (LRA enable-checking bootstrap failure since r205136)
2013-11-29 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/59340
* lra.c (check_rtl): Use recog_memoized instead of insn_invalid_p.
Revert
2013-11-20 Robert Suchanek <Robert.Suchanek@imgtec.com>
* lra.c (lra): Set lra_in_progress before check_rtl call.
* recog.c (insn_invalid_p): Add !lra_in_progress to prevent
adding clobber regs when LRA is running.
Jakub Jelinek [Fri, 29 Nov 2013 07:42:23 +0000 (08:42 +0100)]
re PR c/59280 (ICE with attribute((constructor(invalid))))
PR c/59280
* c-common.c (get_priority): If TREE_VALUE (args) is IDENTIFIER_NODE,
goto invalid. If it is error_mark_node, don't issue further
diagnostics.
testsuite/
* c-c++-common/pr59280.c: New test.
* doc/implement-c.texi: Document C11 implementation-defined
behavior. Refer to -ffp-contract=fast for contraction behavior.
* doc/invoke.texi (-std=c99, std=c11): Update description of
completeness.
(-std=gnu99): Don't mention as future default.
(-std=gnu11): Mention as intended future default.
* doc/standards.texi: Update descriptions of C99 and C11 support.
Limit statement about C99 facilities for freestanding
implementations to some platforms only.
Vladimir Makarov [Thu, 28 Nov 2013 21:45:21 +0000 (21:45 +0000)]
re PR target/57293 (not needed frame pointers on IA-32 (performance regression?))
2013-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/57293
* ira.h (ira_setup_eliminable_regset): Remove parameter.
* ira.c (ira_setup_eliminable_regset): Ditto. Add
SUPPORTS_STACK_ALIGNMENT for crtl->stack_realign_needed.
Don't call lra_init_elimination.
(ira): Call ira_setup_eliminable_regset without arguments.
* loop-invariant.c (calculate_loop_reg_pressure): Remove argument
from ira_setup_eliminable_regset call.
* gcse.c (calculate_bb_reg_pressure): Ditto.
* haifa-sched.c (sched_init): Ditto.
* lra.h (lra_init_elimination): Remove the prototype.
* lra-int.h (lra_insn_recog_data): New member sp_offset. Move
used_insn_alternative upper.
(lra_eliminate_regs_1): Add one more parameter.
(lra-eliminate): Ditto.
* lra.c (lra_invalidate_insn_data): Set sp_offset.
(setup_sp_offset): New.
(lra_process_new_insns): Call setup_sp_offset.
(lra): Add argument to lra_eliminate calls.
* lra-constraints.c (get_equiv_substitution): Rename to get_equiv.
(get_equiv_with_elimination): New.
(process_addr_reg): Call get_equiv_with_elimination instead of
get_equiv_substitution.
(equiv_address_substitution): Ditto.
(loc_equivalence_change_p): Ditto.
(loc_equivalence_callback, lra_constraints): Ditto.
(curr_insn_transform): Ditto. Print the sp offset
(process_alt_operands): Prevent stack pointer reloads.
(lra_constraints): Remove one argument from lra_eliminate call.
Move it up. Mark used hard regs bfore it. Use
get_equiv_with_elimination instead of get_equiv_substitution.
* lra-eliminations.c (lra_eliminate_regs_1): Add parameter and
assert for param values combination. Use sp offset. Add argument
to lra_eliminate_regs_1 calls.
(lra_eliminate_regs): Add argument to lra_eliminate_regs_1 call.
(curr_sp_change): New static var.
(mark_not_eliminable): Add parameter. Update curr_sp_change.
Don't prevent elimination to sp if we can calculate its change.
Pass the argument to mark_not_eliminable calls.
(eliminate_regs_in_insn): Add a parameter. Use sp offset. Add
argument to lra_eliminate_regs_1 call.
(update_reg_eliminate): Move calculation of hard regs for spill
lower. Switch off lra_in_progress temporarily to generate regs
involved into elimination.
(lra_init_elimination): Rename to init_elimination. Make it
static. Set up insn sp offset, check the offsets at the end of
BBs.
(process_insn_for_elimination): Add parameter. Pass its value to
eliminate_regs_in_insn.
(lra_eliminate): : Add parameter. Pass its value to
process_insn_for_elimination. Add assert for param values
combination. Call init_elimination. Don't update offsets in
equivalence substitutions.
* lra-spills.c (assign_mem_slot): Don't call lra_eliminate_regs_1
for created stack slot.
(remove_pseudos): Call lra_eliminate_regs_1 before changing memory
onto stack slot.
Ian Lance Taylor [Thu, 28 Nov 2013 16:19:57 +0000 (16:19 +0000)]
dwarf.c (find_address_ranges): New static function, broken out of build_address_map.
* dwarf.c (find_address_ranges): New static function, broken out
of build_address_map.
(build_address_map): Call it.
* btest.c (check): Check for missing filename or function, rather
than crashing.
(f3): Check that enough frames were returned.
tree-core.h (tree_base): Document use of static_flag for SSA_NAME.
gcc/
* tree-core.h (tree_base): Document use of static_flag for SSA_NAME.
* tree.h (SSA_NAME_ANTI_RANGE_P, SSA_NAME_RANGE_TYPE): New macros.
* tree-ssanames.h (set_range_info): Add range_type argument.
(duplicate_ssa_name_range_info): Likewise.
* tree-ssanames.c (set_range_info): Take the range type as argument
and store it in SSA_NAME_ANTI_RANGE_P.
(duplicate_ssa_name_range_info): Likewise.
(get_range_info): Use SSA_NAME_ANTI_RANGE_P.
(set_nonzero_bits): Update call to set_range_info.
(duplicate_ssa_name_fn): Update call to duplicate_ssa_name_range_info.
* tree-ssa-copy.c (fini_copy_prop): Likewise.
* tree-vrp.c (remove_range_assertions): Update call to set_range_info.
(vrp_finalize): Likewise, passing anti-ranges directly.