re PR middle-end/55030 (gcc.c-torture/execute/builtins/memcpy-chk.c execution, -Os (et al))
PR middle-end/55030
Revert:
* stmt.c (expand_nl_goto_receiver): Remove almost-copy of
expand_builtin_setjmp_receiver.
(expand_label): Adjust, call expand_builtin_setjmp_receiver
with NULL for the label parameter.
* builtins.c (expand_builtin_setjmp_receiver): Don't clobber
the frame-pointer. Adjust comments.
[HAVE_builtin_setjmp_receiver]: Emit builtin_setjmp_receiver
only if LABEL is non-NULL.
Bill Schmidt [Mon, 22 Oct 2012 22:09:22 +0000 (22:09 +0000)]
re PR tree-optimization/55008 (Internal compiler error : verify_ssa failed)
gcc:
2012-10-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/55008
* gimple-ssa-strength-reduction.c (find_basis_for_candidate): Don't
allow a candidate to be a basis for itself under another interpretation.
gcc/testsuite:
2012-10-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/55008
* gcc.dg/tree-ssa/pr55008.c: New test.
* dumpfile.c (dump_phase_enabled_p): Renamed dump_enabled_p. Update
all callers.
(dump_enabled_p): A new function to check if any of the dump files
is available.
(dump_kind_p): Remove check for current_function_decl. Add check for
dumpfile and alt_dump_file.
* dumpfile.h: Add declaration of dump_enabled_p.
Uros Bizjak [Mon, 22 Oct 2012 13:59:33 +0000 (15:59 +0200)]
i386.c (memory_address_length): Assert that non-null base or index RTXes are registers.
* config/i386/i386.c (memory_address_length): Assert that non-null
base or index RTXes are registers. Do not check for REG RTXes.
Determine addr32 prefix from original base and index RTXes.
Simplify code.
mmix.md ("nonlocal_goto_receiver"): Refer to the frame-pointer as an operand.
* config/mmix/mmix.md ("nonlocal_goto_receiver"): Refer to the
frame-pointer as an operand.
("*nonlocal_goto_receiver_expanded"): Ditto. Use
mmix_output_register_setting instead of naked output_asm_insn for
the offset from the frame-pointer to the saved rO.
* config/mmix/mmix.c (mmix_output_register_setting): Emit NEGU for
values -255..0.
* config/mmix/predicates.md ("frame_pointer_operand"): New.
* config/mmix/constraints.md ("Yf"): New.
stmt.c (expand_nl_goto_receiver): Remove almost-copy of expand_builtin_setjmp_receiver.
* stmt.c (expand_nl_goto_receiver): Remove almost-copy of
expand_builtin_setjmp_receiver.
(expand_label): Adjust, call expand_builtin_setjmp_receiver
with NULL for the label parameter.
* builtins.c (expand_builtin_setjmp_receiver): Don't clobber
the frame-pointer. Adjust comments.
[HAVE_builtin_setjmp_receiver]: Emit builtin_setjmp_receiver
only if LABEL is non-NULL.
Eric Botcazou [Mon, 22 Oct 2012 08:59:10 +0000 (08:59 +0000)]
decl.c (gnat_to_gnu_entity): Force BLKmode on the type if it is passed by reference.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Force
BLKmode on the type if it is passed by reference.
<E_Array_Subtype>: Likewise.
<E_Record_Type>: Guard the call to Is_By_Reference_Type predicate.
<E_Record_Subtype>: Likewise.
Eric Botcazou [Mon, 22 Oct 2012 07:27:21 +0000 (07:27 +0000)]
re PR bootstrap/54820 (ada: cannot find -lstdc++ since 4.8.0 20121002)
PR bootstrap/54820
* Makefile.tpl (STAGE1_FLAGS_TO_PASS): New variable.
(all-[+prefix+][+module+]): Pass stage1_args to sub-makes.
(all-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false.
(clean-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false.
(host_modules): Set stage1_args to STAGE1_FLAGS_TO_PASS.
* Makefile.in: Regenerate.
* configure.ac (have_static_libs): New variable and associated check.
(stage1-ldflags): Move to after stage1_libs and set to -static-libstdc++
-static-libgcc if stage1_libs is empty and have_static_libs is yes.
* configure: Regenerate.
ada/
* gcc-interface/Make-lang.in (GCC_LINK): Remove hardcoded options.
Uros Bizjak [Sun, 21 Oct 2012 22:12:46 +0000 (00:12 +0200)]
i386-protos.h (memory_address_length): Add new bool argument.
* config/i386/i386-protos.h (memory_address_length): Add new bool
argument. Update all uses.
* config/i386/i386.c (memory_address_length): If not LEA insn, then
add length of addr32 prefix based on mode of base or index register.
(ix86_attr_length_address_default) <TYPE_LEA>: Do not handle SImode
addresses here. Update call to memory_address_length.
(ix86_print_address_operand): Use SImode_address_operand predicate.
* config/i386/predicates.md (SImode_address_operand): New.
* config/i386/i386.md (lea<mode>): Use SImode_address_operand
to calculate "mode" attribute. Use SImode_address_operand predicate
instead of open-coding accepted RTX codes.
PR fortran/54725
* Make-lang.in (CFLAGS-cpp.o): Use TARGET_SYSTEM_ROOT_DEFINE.
* cpp.o (gfc_cpp_init_options): Use it for
setting gfc_cpp_option.sysroot.
Thomas Koenig [Sun, 21 Oct 2012 10:32:02 +0000 (10:32 +0000)]
re PR fortran/54465 (Implement -Wextra for Fortran)
2012-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/54465
* lang.opt (Wextra): Add.
* invoke.texi: Document that -Wc-binding-type, -Wconversion
and -Wline-truncation are implied by -Wall. Document that
-Wcompare-reals is implied by -Wextra. Document -Wextra.
* options.c (set_Wextra): New function.
(gfc_handle_option): Handle -Wextra.
2012-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/54465
* gfortran.dg/wextra_1.f: New test.
crti.S: Mark program and data addresses using PRELD.
* config/mmix/crti.S: Mark program and data addresses using PRELD.
Remove typo'd and unnecessary alignment-LOC for .data. Remove
no-longer-needed LDBU insns.
Eric Botcazou [Sat, 20 Oct 2012 21:00:23 +0000 (21:00 +0000)]
re PR middle-end/54315 (unnecessary copy of return value for union)
PR rtl-optimization/54315
* calls.c (expand_call): Don't deal specifically with BLKmode values
returned in naked registers.
* expr.h (copy_blkmode_from_reg): Adjust prototype.
* expr.c (copy_blkmode_from_reg): Rename first parameter into TARGET and
make it required. Assert that SRCREG hasn't BLKmode. Add a couple of
short-circuits for common cases and be prepared for sub-word registers.
(expand_assignment): Call copy_blkmode_from_reg for BLKmode values
returned in naked registers.
(store_expr): Likewise.
(store_field): Likewise.
Michael Meissner [Fri, 19 Oct 2012 19:10:03 +0000 (19:10 +0000)]
rs6000-cpus.def (POWERPC_MASKS): Don't assume OPTION_MASK_STRICT_ALIGN is defined.
[gcc]
2012-10-19 Michael Meissner <meissner@linux.vnet.ibm.com>
Dominique Dhumieres <dominiq@lps.ens.fr>
* config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Don't assume
OPTION_MASK_STRICT_ALIGN is defined.
(MASK_STRICT_ALIGN): If OPTION_MASK_STRICT_ALIGN is not defined,
define this to 0 for the 3 ports that use it.
* config/rs6000/rs6000.c (OPTION_MASK_STRICT_ALIGN): Don't do
check for ports not having -mstrict-align here, move test to
rs6000-cpus.def.
(MASK_STRICT_ALIGN): Likewise.
(rs6000_debug_reg_global): Print out correct target flag words if
-mdebug=reg.
[libobjc]
2012-10-19 Michael Meissner <meissner@linux.vnet.ibm.com>
* encoding.c (TARGET_VSX): Provide definitions based on the
current compilation options, and not based off the target options
structure.
(TARGET_ALTIVEC): Likewise.
(TARGET_64BIT): Likewise.
* include/std/scoped_allocator (__outermost_alloc_traits): Define.
(scoped_allocator_adaptor::destroy): Use it.
(scoped_allocator_adaptor::construct): Likewise. Overload for
piecewise construction of std::pair objects.
* testsuite/20_util/scoped_allocator/2.cc: New.
* doc/xml/manual/status_cxx2011.xml: Update.
Zhenqiang Chen [Fri, 19 Oct 2012 09:24:39 +0000 (09:24 +0000)]
re PR target/54892 (, ICE in extract_insn, at recog.c:2123)
gcc/ChangeLog
PR target/54892
* config/arm/arm.c (arm_expand_compare_and_swap): Use SImode to make
sure the mode is correct when falling through from above cases.
Jan Hubicka [Fri, 19 Oct 2012 09:17:06 +0000 (09:17 +0000)]
cunroll-1.c: New testcase.
* gcc.dg/tree-ssa/cunroll-1.c: New testcase.
* gcc.dg/tree-ssa/cunroll-2.c: New testcase.
* gcc.dg/tree-ssa/cunroll-3.c: New testcase.
* gcc.dg/tree-ssa/cunroll-4.c: New testcase.
* gcc.dg/tree-ssa/cunroll-5.c: New testcase.
Alan Modra [Thu, 18 Oct 2012 22:33:15 +0000 (09:03 +1030)]
predicates.md (splat_input_operand): Don't call input_operand for MEMs.
* config/rs6000/predicates.md (splat_input_operand): Don't call
input_operand for MEMs. Instead check for volatile and call
memory_address_addr_space_p with modified mode.
Tobias Burnus [Thu, 18 Oct 2012 17:09:13 +0000 (19:09 +0200)]
re PR fortran/54884 (Externally used PRIVATE module procedure wrongly marked as TREE_PUBLIC()=0)
2012-10-18 Tobias Burnus <burnus@net-b.de>
PR fortran/54884
* resolve.c (specification_expr): Change to bool.
(resolve_formal_arglist, resolve_symbol): Set
specification_expr to true before resolving the array spec.
(resolve_variable, resolve_charlen, resolve_fl_variable):
Properly reset specification_expr.
(resolve_function): Set public_use when used in
a specification expr.
Eric Botcazou [Thu, 18 Oct 2012 15:46:04 +0000 (15:46 +0000)]
loop-invariant.c: Include target.h.
* loop-invariant.c: Include target.h.
(check_dependency): Return false for an uninitialized argument register
that is likely to be spilled.
* Makefile.in (loop-invariant.o): Add $(TARGET_H).
Michael Meissner [Wed, 17 Oct 2012 20:12:38 +0000 (20:12 +0000)]
rs6000.opt (rs6000_isa_flags): New flag word to replace target_flags that gives us 63 possible switches.
2012-10-17 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/rs6000.opt (rs6000_isa_flags): New flag word to
replace target_flags that gives us 63 possible switches.
(x_rs6000_isa_flags): Save area for rs6000_isa_flags.
(x_rs6000_isa_flags_explicit): Save area for
rs6000_isa_flags_explicit.
(rs6000_target_flags_explicit): Delete in favor of
x_rs6000_isa_flags_explicit.
(-mpowerpc64): Change all switches that used to be in target_flags
to now be in rs6000_isa_flags. In using rs6000_isa_flags, the
options machinary will generate names of the form OPITON_<xxx>
instead of TARGET_<xxx> and OPTION_MASK_<xxx> instead of
MASK_<xxx>.
(-mpowerpc-gpopt): Likewise.
(-mpowerpc-gfxopt): Likewise.
(-mmfcrf): Likewise.
(-mpopcntb): Likewise.
(-mfprnd): Likewise.
(-mcmpb): Likewise.
(-mmfpgpr): Likewise.
(-maltivec): Likewise.
(-mhard-dfp): Likewise.
(-mmulhw): Likewise.
(-mdlmzb): Likewise.
(-mmultiple): Likewise.
(-mstring): Likewise.
(-msoft-float): Likewise.
(-mhard-float): Likewise.
(-mpopcntd): Likewise.
(-mvsx): Likewise.
(-mno-update): Likewise.
(-mupdate): Likewise.
(-mrecip-precision): Likewise.
(-mminimal-toc): Likewise.
(-misel): Likewise.
* config/rs6000/aix64.opt (-maix64): Likewise.
(-maix32): Likewise.
* config/rs6000/sysv4.opt (-mstrict-align): Likewise.
(-mrelocatable): Likewise.
(-mlittle-endian): Likewise.
(-mlittle): Likewise.
(-mbig-endian): LIkewise.
(-mbig): Likewise.
(-meabi): Likewise.
(-m64): Likewise.
(-m32): Likewise.
* config/rs6000/darwin.opt (-m64): Likewise.
(-m32): Likewise.
* config/rs6000/rs6000-cpus.def (ISA_2_1_MASKS): Move the various
masks used in rs6000.c here, since they are more logically in this
file. Convert from being enums to just #defines, since the types
of these masks is now HOST_WIDE_INT instead of int. For
POWERPC_MASKS, add MASK_SOFT_FLOAT, since the only use case or'ed
in the mask. Change the use in rs6000.c not to do the OR of
MASK_SOFT_FLOAT.
(ISA_2_1_MASKS): Likewise.
(ISA_2_2_MASKS): Likewise.
(ISA_2_4_MASKS): Likewise.
(ISA_2_5_MASKS_EMBEDDED): Likewise.
(ISA_2_5_MASKS_SERVER): Likewise.
(POWERPC_7400_MASK): Likewise.
(POWERPC_MASKS): Likewise.
* config/rs6000/rs6000.c (ISA_2_1_MASKS): Likewise.
(ISA_2_1_MASKS): Likewise.
(ISA_2_2_MASKS): Likewise.
(ISA_2_4_MASKS): Likewise.
(ISA_2_5_MASKS_EMBEDDED): Likewise.
(ISA_2_5_MASKS_SERVER): Likewise.
(POWERPC_7400_MASK): Likewise.
(POWERPC_MASKS): Likewise.
(rs6000_option_override_internal): Likewise.
* config/rs6000/rs6000.c (darwin_rs6000_override_options): Change
all uses of target_flags to rs6000_isa_flags. Change all uses of
target_flags_explicit to rs6000_isa_flags_explicit. Change the
use of MASK_<xxx> to OPTION_MASK_<xxx> that options.h defines when
we use a secondary flags word. Save/restore/print the new flags
word when switching contexts with different target attributes.
(rs6000_option_override_internal): Likewise.
(rs6000_darwin_file_start): Likewise.
(rs6000_opt_masks): Likewise.
(rs6000_inner_target_options): Likewise.
(rs6000_pragma_target_parse): Likewise.
(rs6000_set_current_function): Likewise.
(rs6000_function_specific_save): Likewise.
(rs6000_function_specific_restore): Likewise.
(rs6000_function_specific_print): Likewise.
(rs6000_can_inline_p): Likewise.
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros):
Likewise.
(rs6000_cpu_cpp_builtins): Likewise.
* common/config/rs6000/rs6000-driver.c (rs6000_handle_option):
Likewise.
* config/rs6000/rs6000.h (MASK_ALTIVEC): In moving to using
Var(...) for all of the isa switches, the options machinery now
uses OPTION_MASK_<xxx> instead of MASK_<xxx> for the mask name.
Use #define to map the old name into the new name. For switches
that are defined in aix64.opt, sysv4.opt, and darwin.opt, only do
the definition if those switches were defined.
(MASK_ALTIVEC): Likewise.
(MASK_CMPB): Likewise.
(MASK_DFP): Likewise.
(MASK_DLMZB): Likewise.
(MASK_EABI): Likewise.
(MASK_FPRND): Likewise.
(MASK_HARD_FLOAT): Likewise.
(MASK_ISEL): Likewise.
(MASK_MFCRF): Likewise.
(MASK_MFPGPR): Likewise.
(MASK_MULHW): Likewise.
(MASK_MULTIPLE): Likewise.
(MASK_NO_UPDATE): Likewise.
(MASK_POPCNTB): Likewise.
(MASK_POPCNTD): Likewise.
(MASK_PPC_GFXOPT): Likewise.
(MASK_PPC_GPOPT): Likewise.
(MASK_RECIP_PRECISION): Likewise.
(MASK_SOFT_FLOAT): Likewise.
(MASK_STRICT_ALIGN): Likewise.
(MASK_STRING): Likewise.
(MASK_UPDATE): Likewise.
(MASK_VSX): Likewise.
(MASK_POWERPC64): Likewise.
(MASK_64BIT): Likewise.
(MASK_RELOCATABLE): Likewise.
(MASK_LITTLE_ENDIAN): Likewise.
(MASK_MINIMAL_TOC): Likewise.
(MASK_REGNAMES): Likewise.
(MASK_PROTOTYPE): Likewise.
(rs6000_isa_flags_explicit): Define in terms of the
global_options_set structure.
Jan Hubicka [Wed, 17 Oct 2012 19:50:16 +0000 (21:50 +0200)]
cfgloopmanip.c (copy_loop_info): New function.
* cfgloopmanip.c (copy_loop_info): New function.
(duplicate_loop): Use it.
(loop_version): Use it.
* loop-unswitch.c (unswitch_loop): Use it.
* cfgloop.h (copy_loop_info): Declare.
Jan Hubicka [Wed, 17 Oct 2012 17:12:05 +0000 (19:12 +0200)]
tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Add edge_to_cancel parameter and use it to estimate code optimized out in the...
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Add edge_to_cancel
parameter and use it to estimate code optimized out in the final iteration.
(loop_edge_to_cancel): New function.
(try_unroll_loop_completely): New IRRED_IVALIDATED parameter;
handle unrolling loops with bounds given via max_loop_iteratins;
handle unrolling non-inner loops when code size shrinks;
tidy dump output; when the last iteration loop still stays
as loop in the CFG forcongly redirect the latch to
__builtin_unreachable.
(canonicalize_loop_induction_variables): Add irred_invlaidated
parameter; record niter bound derrived; dump
max_loop_iterations bounds; call try_unroll_loop_completely
even if no niter bound is given.
(canonicalize_induction_variables): Handle irred_invalidated.
(tree_unroll_loops_completely): Handle non-innermost loops;
handle irred_invalidated.
* cfgloop.h (unlop): Declare.
* cfgloopmanip.c (unloop): Export.
* tree.c (build_common_builtin_nodes): Build BULTIN_UNREACHABLE.
* gcc.target/i386/l_fma_float_?.c: Update.
* gcc.target/i386/l_fma_double_?.c: Update.
* gfortran.dg/do_1.f90: XFAIL
* gcc.dg/tree-ssa/cunroll-1.c: New testcase.
* gcc.dg/tree-ssa/cunroll-2.c: New testcase.
* gcc.dg/tree-ssa/cunroll-3.c: New testcase.
* gcc.dg/tree-ssa/cunroll-4.c: New testcase.
* gcc.dg/tree-ssa/cunroll-5.c: New testcase.
* gcc.dg/tree-ssa/ldist-17.c: Block cunroll to make testcase still
valid.
Richard Biener [Wed, 17 Oct 2012 10:25:56 +0000 (10:25 +0000)]
tree-streamer-out.c (write_ts_decl_common_tree_pointers): Do not write TREE_CHAIN of PARM_DECLs.
2012-10-17 Richard Biener <rguenther@suse.de>
* tree-streamer-out.c (write_ts_decl_common_tree_pointers):
Do not write TREE_CHAIN of PARM_DECLs.
(write_ts_decl_non_common_tree_pointers): Instead stream
the DECL_ARGUMENTS chain.
* tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
Do not read TREE_CHAIN of PARM_DECLs.
(lto_input_ts_decl_non_common_tree_pointes): Instead read
the DECL_ARGUMENTS as chain.
Steven Bosscher [Wed, 17 Oct 2012 06:15:38 +0000 (06:15 +0000)]
df-problems.c (df_kill_notes): Split up in two functions.
* df-problems.c (df_kill_notes): Split up in two functions.
(df_remove_dead_and_unused_notes): New function, first half of
df_kill notes to remove all REG_DEAD and REG_UNUSED notes.
(df_remove_dead_eq_notes): New function, second half of df_kill_notes
to remove REG_EQUAL and REG_EQUIV notes referring to dead registers.
(df_note_bb_compute): Call df_remove_dead_and_unused_notes instead
of df_kill_notes. Call df_remove_dead_eq_notes after processing insn.
Eric Botcazou [Tue, 16 Oct 2012 22:49:07 +0000 (22:49 +0000)]
re PR rtl-optimization/54870 (gfortran.dg/array_constructor_4.f90 FAILs)
PR rtl-optimization/54870
* tree.h (TREE_ADDRESSABLE): Document special usage on SSA_NAME.
* cfgexpand.c (update_alias_info_with_stack_vars ): Set it on the
SSA_NAME pointer that points to a partition if there is at least
one variable with it set in the partition.
* dse.c (local_variable_can_escape): New predicate.
(can_escape): Call it.
* gimplify.c (mark_addressable): If this is a partitioned decl, also
mark the SSA_NAME pointer that points to a partition.