This replaces runtime/cpuprof.goc with go/runtime/cpuprof.go and adjusts
the supporting code in runtime/proc.c.
This adds another case where the compiler needs to avoid heap allocation
in the runtime package: when evaluating a method expression into a
closure. Implementing this required moving the relevant code from
do_get_backend to do_flatten, so that I could easily add a temporary
variable. Doing that let me get rid of Bound_method_expression::do_lower.
Reviewed-on: https://go-review.googlesource.com/31050
From-SVN: r241163
2016-10-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/77979
* tree-vrp.c (compare_name_with_value): Handle released SSA names
in the equivalency sets.
(compare_names): Likewise.
* gcc.dg/torture/pr77979.c: New testcase.
From-SVN: r241162
* builtins.h(target_char_cst_p): Declare the function.
* builtins.c (fold_builtin_memchr): Remove.
(target_char_cst_p): Move the function from gimple-fold.c.
(fold_builtin_3): Do not call the function.
* gimple-fold.c (gimple_fold_builtin_memchr): New function.
(gimple_fold_builtin): Call the function.
* fold-const-call.c (fold_const_call_1): Handle CFN_BUILT_IN_MEMCHR.
From-SVN: r241160
PR ada/77968
* gcc-interface/utils.c (create_var_decl): Do not clear TREE_READONLY
in LTO mode for an external variable.
(can_materialize_object_renaming_p): Move up.
From-SVN: r241154
* fold-const.c (c_getstr): Support of properly \0-terminated
string constants. New argument is added.
* fold-const.h: New argument is added.
From-SVN: r241152
* include/std/functional (_Reference_wrapper_base_impl): Remove.
(_Refwrap_base_arg1, _Refwrap_base_arg2): New helpers using __void_t.
(_Reference_wrapper_base): Inherit from new helpers.
From-SVN: r241151
2016-10-11 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (gen_member_die): Handle inline static data member
definitions.
c-family/
* c-cppbuiltin.c (c_cpp_builtins): Add __cpp_inline_variables.
cp/
* cp-tree.h (struct lang_type): Shrink language field to 1 bit
from 4. Add var_declared_inline_p field. Mention 2 spare bits.
(DECL_VAR_DECLARED_INLINE_P): Define.
(SET_DECL_VAR_DECLARED_INLINE_P): Define.
(DECL_INLINE_VAR_P): Define.
(diagnose_inline_vars_for_namespace): Declare.
* decl.c (diagnose_inline_vars_for_namespace): New function.
(duplicate_decls): For static data members copy
DECL_DECLARED_CONSTEXPR_P.
(redeclaration_error_message): Handle C++17 redundant redeclaration
of constexpr static data member outside of class.
(maybe_commonize_var): Handle inline variables.
(check_initializer): Ignore inline variables for diagnostics.
Adjust diagnostic wording for C++17.
(make_rtl_for_nonlocal_decl): Allow in-class definition of
inline static data members.
(bad_specifiers): Don't diagnose inline on variables here.
(grokvardecl): Add inlinep argument, non-static const inline variables
are TREE_PUBLIC.
(check_static_variable_definition): Return early also for inline
variables.
(grokdeclarator): Handle inline variables and inline static data
members.
* typeck2.c (store_init_value): Don't diagnose non-constant
initializers for non-constexpr inline static data members.
* decl2.c (vague_linkage_p): Return true for inline variables.
(c_parse_final_cleanups): In-class declaration of inline static
data members is a definition. Call diagnose_inline_vars_for_namespace
through walk_namespaces.
* pt.c (instantiate_decl): Set pattern_defined for in-class definitions
of inline static data members.
From-SVN: r241137
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