2019-01-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/88928
* c-warn.c (check_alignment_of_packed_member): Add a boolean parameter
for rvalue context. Handle rvalues correctly. Use min_align_of_type
instead of TYPE_ALIGN.
(check_address_or_pointer_of_packed_member): Handle rvalues coorrectly.
Use min_align_of_type instead of TYPE_ALIGN_UNIT. Check for NULL
pointer from TYPE_STUB_DECL.
testsuite:
2019-01-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/88928
* c-c++-common/Waddress-of-packed-member-1.c: New test case.
* gcc.dg/pr88928.c: New test case.
From-SVN: r268118
Philippe Waroquiers noticed a memory leak in gdb, which he tracked
down to a bug in splay-tree. splay_tree_remove does not call the
`delete_key' function when it removes the old node; but it should.
I looked at every splay tree in GCC and there is only one that passes
a non-NULL delete function -- the one in lto.c. That file does not
call splay_tree_remove. So, I think this is safe to check in.
I re-ran the LTO tests to double check.
libiberty/
* splay-tree.c (splay_tree_remove): Delete the key if necessary.
From-SVN: r268116
2019-01-20 Martin Jambor <mjambor@suse.cz>
PR ipa/87615
* ipa-prop.h (struct ipa_func_body_info): Replaced field aa_walked
with aa_walk_budget.
* cgraph.h (ipa_polymorphic_call_context::get_dynamic_type): Add
aa_walk_budget_p parameter.
* ipa-fnsummary.c (unmodified_parm_1): New parameter fbi. Limit AA
walk. Updated all callers.
(unmodified_parm): New parameter fbi, pass it to unmodified_parm_1.
(eliminated_by_inlining_prob): New parameter fbi, pass it on to
unmodified_parm.
(will_be_nonconstant_expr_predicate): New parameter fbi, removed
parameter info. Extract info from fbi. Pass fbi to recursive calls
and to unmodified_parm.
(phi_result_unknown_predicate): New parameter fbi, removed parameter
info, updated call to will_be_nonconstant_expr_predicate.
(param_change_prob): New parameter fbi, limit AA walking.
(analyze_function_body): Initialize aa_walk_budget in fbi. Update
calls to various above functions.
* ipa-polymorphic-call.c (get_dynamic_type): Add aa_walk_budget_p
parameter. Use it to limit AA walking.
* ipa-prop.c (detect_type_change_from_memory_writes): New parameter
fbi, limit AA walk.
(detect_type_change): New parameter fbi, pass it on to
detect_type_change_from_memory_writes.
(detect_type_change_ssa): Likewise.
(aa_overwalked): Removed.
(parm_preserved_before_stmt_p): Assume fbi is never NULL, stream line
accordingly, adjust to the neew AA limiting scheme.
(parm_ref_data_preserved_p): Likewise.
(ipa_compute_jump_functions_for_edge): Adjust call to
get_dynamic_type.
(ipa_analyze_call_uses): Likewise.
(ipa_analyze_virtual_call_uses): Pass fbi to detect_type_change_ssa.
(ipa_analyze_node): Initialize aa_walk_budget.
(ipcp_transform_function): Likewise.
* tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Update call
to get_dynamic_type.
From-SVN: r268107
Every back-end defines STACK_GROWS_DOWNWARD, the condition should
instead be checking whether it was defined as 1 or 0.
gcc/d/ChangeLog:
2019-01-20 Iain Buclaw <ibuclaw@gdcproject.org>
* d-builtins.cc (d_init_versions): Check value of
STACK_GROWS_DOWNWARD.
From-SVN: r268106
gcc/d/ChangeLog:
2019-01-20 Iain Buclaw <ibuclaw@gdcproject.org>
* d-codegen.cc (identity_compare_p): Return false if seen built-in
type with padding.
(build_float_identity): Moved here from expr.cc.
(lower_struct_comparison): Handle real and complex types.
* d-tree.h (build_float_identity): New.
* expr.cc (build_float_identity): Move to d-codegen.cc.
gcc/testsuite/ChangeLog:
2019-01-20 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.dg/runnable.d: Add more tests for comparing complex types.
From-SVN: r268104
2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
* io.c (match_io_element): input-item cannot be an external function.
2019-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77960
* gfortran.dg/pr77960.f90: New test.
From-SVN: r268097
2018-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/56789
* trans-expr.c (gfc_conv_procedure_call): Call
gfc_conv_subref_array_arg if the formal arg is contiguous
and the actual arg may not be.
2018-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/56789
* gfortran.dg/contiguous_3.f90: Make code compilant. Remove
scan-tree tests that fail with patch.
* gfortran.dg/contiguous_8.f90: New test.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
From-SVN: r268096
This patch tries harder to detect cases in which the inner dimension
of an array access is invariant, such as:
x(i, :) = 100
It fixes some of the code size regression in 548.exchange2_r, with
size improving by 5% compared to before the patch. Of the two other
SPEC 2017 tests affected by loop versioning, 554.roms_r improved by a
trivial amount (0.3%) and 549.fotonik3d_r didn't change. All three
results are with -Ofast -flto.
2019-01-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* gimple-loop-versioning.cc (loop_versioning::dump_inner_likelihood):
New function, split out from...
(loop_versioning::analyze_stride): ...here.
(loop_versioning::find_per_loop_multiplication): Use gassign.
(loop_versioning::analyze_term_using_scevs): Return a success code.
(loop_versioning::analyze_arbitrary_term): New function.
(loop_versioning::analyze_address_fragment): Use
analyze_arbitrary_term if all else fails.
gcc/testsuite/
* gfortran.dg/loop_versioning_1.f90: Bump the number of identified
inner strides.
* gfortran.dg/loop_versioning_9.f90: New test.
* gfortran.dg/loop_versioning_10.f90: Likewise.
From-SVN: r268093
PR fortran/88902
* trans-decl.c (gfc_get_symbol_decl): Don't add length to function
or parent function if it has been added there already.
* gfortran.dg/pr88902.f90: New test.
From-SVN: r268091
The old version of _Sp_counted_ptr_inplace::_M_get_deleter (up to GCC
8.2.0) expects to be passed a real std::typeinfo object, so mixing that
with the new definition of the __shared_ptr constructor (which always
passes the fake tag) leads to accessing the fake object as a real
std::typeinfo. Instead of trying to make it safe to mix the old and new
definitions, just stop using that function. By passing a reference to
__shared_ptr::_M_ptr to the __shared_count constructor it can be set
directly, without needing to obtain the pointer via the _M_get_deleter
back-channel. This avoids a virtual dispatch (which fixes PR 87514).
This means that code built against new libstdc++ headers doesn't use
_M_get_deleter at all, and so make_shared works the same whether RTTI is
enabled or not.
Also change _M_get_deleter so that it checks for a real type_info object
even when RTTI is disabled, by calling a library function. Unless
libstdc++ itself is built without RTTI that library function will be
able to test if it's the right type_info. This means the new definition
of _M_get_deleter can handle both the fake type_info tag and a real
type_info object, even if built without RTTI.
If linking to objects built against older versions of libstdc++ then if
all objects use -frtti or all use -fno-rtti, then the caller of
_M_get_deleter and the definition of _M_get_deleter will be consistent
and it will work. If mixing -frtti with -fno-rtti it can still fail if
the linker picks an old definition of _M_get_deleter and an old
__shared_ptr constructor that are incompatible. In that some or all
objects might need to be recompiled.
PR libstdc++/87514
PR libstdc++/87520
PR libstdc++/88782
* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export new symbol.
* include/bits/shared_ptr.h
(shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...))
(allocate_shared): Change to use new tag type.
* include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_eq):
Declare new member function.
(_Sp_alloc_shared_tag): Define new type.
(_Sp_counted_ptr_inplace): Declare __shared_count<_Lp> as a friend.
(_Sp_counted_ptr_inplace::_M_get_deleter) [!__cpp_rtti]: Use
_Sp_make_shared_tag::_S_eq to check type_info.
(__shared_count(Ptr, Deleter),__shared_count(Ptr, Deleter, Alloc)):
Constrain to prevent being called with _Sp_alloc_shared_tag.
(__shared_count(_Sp_make_shared_tag, const _Alloc&, Args&&...)):
Replace constructor with ...
(__shared_count(Tp*&, _Sp_alloc_shared_tag<_Alloc>, Args&&...)): Use
reference parameter so address of the new object can be returned to
the caller. Obtain the allocator from the tag type.
(__shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...)): Replace
constructor with ...
(__shared_ptr(_Sp_alloc_shared_tag<Alloc>, Args&&...)): Pass _M_ptr
to the __shared_count constructor.
(__allocate_shared): Change to use new tag type.
* src/c++11/shared_ptr.cc (_Sp_make_shared_tag::_S_eq): Define.
From-SVN: r268086
In my patch for CWG issue 2267, I changed reference_binding to clear
CONSTRUCTOR_IS_DIRECT_INIT on the argument init-list. But that breaks if
there's another candidate for which CONSTRUCTOR_IS_DIRECT_INIT is correct.
So instead, let's encode in the conversion that we want to override the
flag.
* call.c (reference_binding): Don't modify EXPR. Set
need_temporary_p on the ck_user conversion for a temporary.
(convert_like_real): Check it.
From-SVN: r268085
Reviewed-on: https://go-review.googlesource.com/c/158019
gotools/:
* Makefile.am (go_cmd_vet_files): Update for Go1.12beta2 release.
(GOTOOLS_TEST_TIMEOUT): Increase to 600.
(check-runtime): Export LD_LIBRARY_PATH before computing GOARCH
and GOOS.
(check-vet): Copy golang.org/x/tools into check-vet-dir.
* Makefile.in: Regenerate.
gcc/testsuite/:
* go.go-torture/execute/names-1.go: Stop using debug/xcoff, which
is no longer externally visible.
From-SVN: r268084
The memory store instructions (stfs[u][x], stxssp[x]) can result in
garbage if the value to be stored isn't already a valid single
precision floating point number. So we cannot use this here.
PR target/88892
* config/rs6000/rs6000.md (*movsi_from_df): Allow only register
operands.
From-SVN: r268083
It is wrong to use -m32 in dg-options. { target ia32 } should be used
instead. Also add -fno-pic to g++.target/i386/pr88587.C since it is
invalid with PIC.
PR middle-end/88587
* g++.target/i386/pr88587.C (dg-do): Add { target ia32 }.
(dg-options): Replace -m32 with -fno-pic.
* gcc.target/i386/mvc13.c (dg-do): Add { target ia32 }.
(dg-options): Remove -m32.
From-SVN: r268079
2019-01-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/88903
* tree-vect-stmts.c (vectorizable_shift): Verify we see all
scalar stmts a SLP shift amount is composed of when detecting
shifts by scalars.
* gcc.dg/vect/pr88903-1.c: New testcase.
* gcc.dg/vect/pr88903-2.c: Likewise.
From-SVN: r268076
Most armv7-a implementations support a number of basic extensions to
the architecture which are not particularly important to the compiler,
but can matter if code contains inline assembly. This patch adds
support for these extensions, based on the capabilities that GAS
already provides for the appropriate CPUs. For the purposes of
multilib selection we ignore these extensions entirely and map the
extended architecture versions down to the base versions we have
already support for.
gcc:
PR target/88799
* config/arm/arm-cpus.in (mp): New feature.
(sec): New feature.
(fgroup ARMv7ve): Add mp and sec features.
(arch armv7-a): Add options to allow mp and sec extensions.
(cpu generic-armv7-a): Add options to allow mp and sec extensions.
(cpu cortex-a5, cpu cortex-7, cpu cortex-a9): Add mp and sec
extenstions to the base architecture.
(cpu cortex-a8): Add sec extension to the base architecture.
(cpu marvell-pj4): Add mp and sec extensions to the base architecture.
* config/arm/t-aprofile (MULTILIB_MATCHES): Map all armv7-a arch
variants down to the base v7-a varaint.
* config/arm/t-multilib (v7_a_arch_variants): New variable.
* doc/invoke.texi (ARM Options): Add +mp and +sec to the list
of permitted extensions for -march=armv7-a and for
-mcpu=generic-armv7-a.
testsuite:
* gcc.target/arm/multilib.exp (config "aprofile"): Add tests for
mp and sec extensions to armv7-a.
From-SVN: r268072
2019-01-18 Martin Liska <mliska@suse.cz>
* libgcov-driver.c (gcov_version_string): New function.
(gcov_version): Convert version integer into string.
From-SVN: r268069
PR tree-optimization/86214
* tree-inline.h (struct copy_body_data): Add
add_clobbers_to_eh_landing_pads member.
* tree-inline.c (add_clobbers_to_eh_landing_pad): New function.
(copy_edges_for_bb): Call it if EH edge destination is <
id->add_clobbers_to_eh_landing_pads. Fix a comment typo.
(expand_call_inline): Set id->add_clobbers_to_eh_landing_pads
if flag_stack_reuse != SR_NONE and clear it afterwards.
* g++.dg/opt/pr86214-1.C: New test.
* g++.dg/opt/pr86214-2.C: New test.
From-SVN: r268067
Copy code example for fetch and nand from "Legacy __sync Built-in
Functions for Atomic Memory Access" to "Built-in Functions for Memory
Model Aware Atomic Operations".
gcc/
* doc/extend.texi (Built-in Functions for Memory Model Aware
Atomic Operations): Document atomic fetch and nand.
From-SVN: r268062
2019-01-18 Martin Liska <mliska@suse.cz>
Richard Biener <rguenther@suse.de>
PR middle-end/88587
* cgraph.h (create_version_clone_with_body): Add new argument
with attributes.
* cgraphclones.c (cgraph_node::create_version_clone): Add
DECL_ATTRIBUTES to a newly created decl. And call
valid_attribute_p so that proper cl_target_optimization_node
is set for the newly created declaration.
* multiple_target.c (create_target_clone): Set DECL_ATTRIBUTES
for declaration.
(expand_target_clones): Do not call valid_attribute_p, it must
be already done.
* tree-inline.c (copy_decl_for_dup_finish): Reset mode for
vector types.
2019-01-18 Martin Liska <mliska@suse.cz>
PR middle-end/88587
* g++.target/i386/pr88587.C: New test.
* gcc.target/i386/mvc13.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r268060
My patch for 64372 removed a bogus lvalue-rvalue conversion for one arm of a
?: expression where the other arm is a throw. But we still need to require
any overload to be resolved, even though we aren't getting that from
decay_conversion anymore.
* pt.c (resolve_nondeduced_context_or_error): Split out from...
* typeck.c (decay_conversion): ...here.
* call.c (build_conditional_expr_1): Use it.
From-SVN: r268058
The StackGrowsDown version being turned off for hppa targets.
After other fixes in the compiler, this allows core.thread unittests to
all pass, as well as the garbage collector to work correctly.
Backported from upstream druntime 2.084.
Reviewed-on: https://github.com/dlang/druntime/pull/2410
From-SVN: r268056