PR77962 shows Go failing on 32-bit x86. This happens because the i386
port requires the split stack prologue to be created before the normal
prologue, and my previous patch changed it to be the other way around.
This patch changes it back. Things will be exactly as before for targets
that do not do shrink-wrapping for separate components. For targets
that *do* support it, all three prologue/epilogue creation functions
will now be called twice for functions that have anything wrapped
separately (instead of just the prologue created twice).
PR bootstrap/77962
* function.c (thread_prologue_and_epilogue_insns): Call all
make_*logue_seq in the same order as traditional. Call them
all a second time if shrink_wrapped-separate.
From-SVN: r241135
2016-10-13 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite/
* scd42-1.c: Skip if -mcpu incompatible with Xscale is specified,
not just -march.
* scd42-2.c: Fix existing logic to skip if -mcpu is incompatible
with Xscale.
From-SVN: r241132
Trying to get the backend representation of a redefined name can cause a
compiler crash as the compiler can walk over the same statements a
second time. It's also quite unlikely to produce any additional useful
error messages for the user.
Test case follows. I'm not going to bother adding this test case to the
testsuite--crash-on-invalid cases are worth fixing but not worth
continually retesting.
package p
type A []int
func (a A) Sum() (sum int) {
for _, v := range a {
sum += v
}
return sum
}
type A []int
func (a A) Sum() (sum int) {
for _, v := range a {
sum += v
}
return sum
}
Reviewed-on: https://go-review.googlesource.com/30976
From-SVN: r241127
2016-10-13 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Set cost
to infinite when we have a pointer with an increment of -1.
From-SVN: r241125
This replaces mem.go and the C runtime_ReadMemStats function with the Go
1.7 mstats.go.
The GCStats code is commented out for now. The corresponding gccgo code
is in runtime/mgc0.c.
The variables memstats and worldsema are shared between the Go code and
the C code, but are not exported. To make this work, add temporary
accessor functions acquireWorldsema, releaseWorldsema, getMstats (the
latter known as mstats in the C code).
Check the preemptoff field of m when allocating and when considering
whether to start a GC. This works with the new stopTheWorld and
startTheWorld functions in Go, which are essentially the Go 1.7
versions.
Change the compiler to stack allocate closures when compiling the
runtime package. Within the runtime packages closures do not escape.
This is similar to what the gc compiler does, except that the gc
compiler, when compiling the runtime package, gives an error if escape
analysis shows that a closure does escape. I added this here because
the Go version of ReadMemStats calls systemstack with a closure, and
having that allocate memory was causing some tests that measure memory
allocations to fail.
Reviewed-on: https://go-review.googlesource.com/30972
From-SVN: r241124
gcc/testsuite/Changelog:
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Cast 0 to wint_t
to placate -Wformat on targets where the type is not int.
From-SVN: r241123
gcc/ChangeLog:
* function-tests.c (selftest::test_expansion_to_rtl): Add "true"
for new "compact" param of print_rtx_function. Check for "cinsn"
rather than "insn".
* print-rtl-function.c (flag_compact): New decl.
(print_rtx_function): Add param "compact" and use it to set
flag_compact, adding a description of the effect to the leading
comment, and updating the example output.
* print-rtl.c (flag_compact): New variable.
(print_rtx_operand_code_0): Omit the JUMP_LABEL reference in compact
mode.
(print_rtx_operand_code_i): When printing source locations, wrap
xloc.file in quotes. Don't print INSN_CODEs in compact mode.
(print_rtx_operand_code_r): Don't print regnos for hard regs and
virtuals in compact mode.
(print_rtx_operand_code_u): Don't print insn UIDs in compact mode,
apart from in LABEL_REFs.
(print_rtx_operand): In case 'w', don't print in hex in compact mode.
Don't print basic block ids in compact mode.
(print_rtx): In compact mode, prefix the code of insns with "c",
only print the INSN_UID of CODE_LABELs, and omit their LABEL_NUSES.
* print-rtl.h (print_rtx_function): Add "compact" param.
gcc/testsuite/ChangeLog:
* gcc.target/i386/vararg-loc.c: Update for quoting of xloc.file
in INSN_LOCATION.
From-SVN: r241120
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function):
Remove the aspects of the original expression function has been
rewritten into a subprogram declaration or a body. Reinsert the
aspects once they have been analyzed.
2016-10-13 Tristan Gingold <gingold@adacore.com>
* exp_ch9.adb (Expand_N_Asynchronous_Select): Return immediately
on restricted profile.
2016-10-13 Javier Miranda <miranda@adacore.com>
* sem_prag.adb
(Process_Compile_Time_Warning_Or_Error): Register the pragma
for its validation after the backend has been called only if its
expression has some occurrence of attributes 'size or 'alignment
* table.ads (Release_Threshold): New formal.
(Release): Adding documentation of its new functionality.
* table.adb (Release): Extend its functionality with a
Release_Threshold.
* nlists.adb (Next_Node table): Set its Release_Threshold.
* atree.adb (Orig_Nodes table): Set its Release_Threshold.
* atree.ads (Nodes table): Set its Release_Threshold.
(Flags table): Set its Release_Threshold.
* alloc.ads (Nodes_Release_Threshold): New constant declaration.
(Orig_Nodes_Release_Threshold): New constant declaration.
* debug.adb (switch d.9): Left free.
* gnat1drv.adb (Post_Compilation_Validation_Checks): Enable
validation of pragmas Compile_Time_Error and Compile_Time_Warning.
From-SVN: r241117
* arm.h (TARGET_VFP): Unconditionally define to 1.
(arm_fpu_desc): Remove 'model' field.
(TARGET_FPU_MODEL): Delete.
* arm.c (all_fpus): Don't initialize the model field.
(arm_can_inline_p): Don't check the FPU model.
* arm-fpus.def: Remove redundant model field from all FPU
descriptions.
From-SVN: r241116
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Create_Extra_Formals): Generate
an Itype reference for the object extra formal in case the
subprogram is called within the same or nested scope.
2016-10-13 Claire Dross <dross@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification):
Also create a renaming in GNATprove mode.
2016-10-13 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Fixed_Point_Type): in SPARK mode, the
given bounds of the type must be strictly representable, and the
range reduction by one delta ("shaving") allowed by the Ada RM,
is not applicable in SPARK.
2016-10-13 Javier Miranda <miranda@adacore.com>
* debug.adb (switch d.9): Used to temporarily disable the support
needed for this enhancement since it causes regressions with
large sources.
* gnat1drv.adb (Post_Compilation_Validation_Checks): Temporarily
leave the validation of pragmas Compile_Time_Warning and
Compile_Time_Error under control of -gnatd.9/
From-SVN: r241115
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch10.adb (Entity_Needs_Body): A generic
subprogram renaming needs a body if the renamed unit is declared
outside the current compilation unit.
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com>
* sinfo.ads, sem_ch12.adb, sem.adb, expander.adb, sem_res.ads,
sem_ch4.adb, sem_ch8.adb, s-memory.adb: Minor reformatting.
2016-10-13 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Delete all temporary files when invoked as gnat
list -V -P ...
2016-10-13 Ed Falis <falis@adacore.com>
* impunit.adb: add i-vxinco.ads.
* s-interr-vxworks.adb: add hook for user interrupt connection routine.
From-SVN: r241112
2016-10-13 Richard Biener <rguenther@suse.de>
PR middle-end/77826
* genmatch.c (struct capture): Add value_match member.
(commutate): Preserve value_match.
(lower_opt_convert): Likewise.
(lower_cond): Likewise.
(replace_id): Likewise.
(struct dt_operand): Add value_match member.
(decision_tree::cmp_node): Compare it.
(decision_tree::insert_operand): Honor it when finding and
when appending a DT_MATCH.
(dt_operand::gen_match_op): Generate a type check after
operand_equal_p if ! value_match for both GENERIC and GIMPLE.
(parser::get_internal_capture_id): New helper.
(parser::finish_match_operand): New function lowering @@<id>.
(parser::parse_capture): Parse @@<id> as value-match.
(parser::parse_expr): Use get_internal_capture_id.
(parser::parse_simplify): Call finish_match_operand.
(walk_captures): New helper.
* match.pd (X - (X / Y) * Y -> X % Y): Use value-matching instead
of operand_equal_p.
((X /[ex] A) * A -> X): Likewise.
((X | Y) ^ X -> Y & ~ X): Handle constants properly by using
convert[12] and value-matching.
((A | B) & (A | C) -> A | (B & C)): Likewise.
((X | Y) | Y -> X | Y): Likewise.
((X ^ Y) ^ Y -> X): Likewise.
(A - (A & B) -> ~B & A): Likewise.
((T)(P + A) - (T)P -> (T) A): Likewise.
((T)P - (T)(P + A) -> -(T) A): Likewise.
((T)(P + A) - (T)(P + B) -> (T)A - (T)B): Likewise.
* doc/match-and-simplify.texi: Amend capture section.
From-SVN: r241108
2016-10-13 Javier Miranda <miranda@adacore.com>
* sem_prag.ads (Process_Compile_Time_Warning_Or_Error): New
overloaded subprogram that factorizes code executed as part
of the regular processing of these pragmas and as part of its
validation after invoking the backend.
* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): New
subprogram.
(Process_Compile_Time_Warning_Or_Error): If the
condition is known at compile time then invoke the new overloaded
subprogram; otherwise register the pragma in a table to validate
it after invoking the backend.
* sem.ads, sem.adb (Unlock): New subprogram.
* sem_attr.adb (Analyze_Attribute [Size]): If we are processing
pragmas Compile_Time_Warning and Compile_Time_Errors after the
backend has been called then evaluate this attribute if 'Size
is known at compile time.
* gnat1drv.adb (Post_Compilation_Validation_Checks): Validate
compile time warnings and errors.
* sem_ch13.ads, sem_ch13.adb (Validate_Compile_Time_Warning_Error):
New subprogram.
(Validate_Compile_Time_Warning_Errors): New subprogram.
From-SVN: r241107
2016-10-13 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Adapt to
optional refinement for abstract states with only partial refinement
visible.
2016-10-13 Justin Squirek <squirek@adacore.com>
* sem_ch13.adb: Minor correction in comment in
Analyze_Aspect_Specifications
* sem_prag.adb: Minor reformatting.
2016-10-13 Thomas Quinot <quinot@adacore.com>
* s-stratt-xdr.adb: Disable compiler unit warnings.
2016-10-13 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Visible_Component): In an instance body, check
whether the component may be hidden in a selected component by
a homonym that is a primitive operation of the type of the prefix.
From-SVN: r241106
* tree-vect-loop.c (loop_niters_no_overflow): New func.
(vect_transform_loop): Call loop_niters_no_overflow. Pass the
no-overflow information to vect_do_peeling_for_loop_bound and
vect_gen_vector_loop_niters.
From-SVN: r241102
* tree-predcom.c (tree_predictive_commoning_loop): Skip loop that only
iterates 1 time.
gcc/testsuite
* gfortran.dg/vect/fast-math-mgrid-resid.f: New test string.
From-SVN: r241100
* tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Put
duplicated loop after its preheader and after the original loop.
From-SVN: r241098
* tree-vect-loop.c (vect_analyze_loop_2): Check and skip loop if it
has no enough iterations for LOOP_VINFO_PEELING_FOR_GAPS.
gcc/testsuite
* gcc.dg/vect/vect-98.c: Refine test case.
* gcc.dg/vect/vect-strided-a-u8-i8-gap2.c: Increase niters.
* gcc.dg/vect/vect-strided-u8-i8-gap2.c: Ditto.
* gcc.dg/vect/vect-strided-u8-i8-gap4.c: Ditto.
From-SVN: r241097
* include/std/functional (_Bind_simple, _Bind_simple_helper)
(__bind_simple): Remove.
* include/std/future: Include <bits/invoke.h> instead of <functional>.
(__future_base::_Task_state::_M_run)
(__future_base::_Task_state::_M_run_delayed): Use lambda expressions
instead of __bind_simple.
(__future_base::_Task_state::_S_maybe_wrap_ref): Remove.
(async): Use thread::__make_invoker instead of __bind_simple.
* include/std/thread: Include <tuple> and <bits/invoke.h> instead of
<functional>.
(thread::_Invoker, thread::__make_invoker): Define helpers to do
INVOKE(DECAY_COPY(f), DECAY_COPY(args)...).
From-SVN: r241093
* include/std/functional (_Not_fn): Make exception specifications
depend on whether negating the result can throw.
* testsuite/20_util/not_fn/1.cc: Move to ...
* testsuite/20_util/function_objects/not_fn/1.cc: ... here. Add tests
for types that can throw when negated and that cannot be negated.
From-SVN: r241091
PR tree-optimization/77943
* g++.dg/tree-ssa/pr77943.C: New test.
PR tree-optimization/77943
* tree-ssa-tail-merge.c (merge_stmts_p): Do not merge BBs with
a different EH landing pads.
From-SVN: r241090
gcc/fortran/ChangeLog:
2016-09-01 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/72832
* trans-expr.c (gfc_copy_class_to_class): Add generation of
runtime array bounds check.
* trans-intrinsic.c (gfc_conv_intrinsic_size): Add a crutch to
get the descriptor of a function returning a class object.
* trans-stmt.c (gfc_trans_allocate): Use the array spec on the
array to allocate instead of the array spec from source=.
gcc/testsuite/ChangeLog:
2016-09-01 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/72832
* gfortran.dg/allocate_with_source_22.f03: New test.
* gfortran.dg/allocate_with_source_23.f03: New test. Expected to
fail.
From-SVN: r241088
2016-10-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/testsuite/
* gcc.target/arm/movhi_movw.c: Enable test for ARM mode.
* gcc.target/arm/movsi_movw.c: Likewise.
* gcc.target/arm/movdi_movw.c: Likewise and adapt scan-assembler
directive to work on big endian targets.
From-SVN: r241086
2016-10-13 Richard Biener <rguenther@suse.de>
* dwarf2out.c (tree_add_const_value_attribute): Do not try
rtl_for_decl_init during early phase.
(gen_variable_die): Do not create locations during early phase.
(gen_label_die): Likewise.
(decls_for_scope): Do not waste time handling BLOCK_NONLOCALIZED_VARs
twice.
From-SVN: r241085