We weren't checking whether the phi in a conditional reduction was
used by the condition itself (which isn't a case we handle).
2017-08-11 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/81835
* tree-vect-loop.c (vect_is_simple_reduction): Simply checks for
the phi SSA_NAME. Check that the condition in a COND_EXPR does
not depend on the phi.
gcc/testsuite/
PR tree-optimization/81835
* gcc.dg/vect/pr81815.c: New test.
From-SVN: r251117
rs6000_reg_live_or_pic_offset_p is just save_reg_p with special
handling for the pic register and eh_return. This merge also
simplifies the eh_return handling. The intent of
https://gcc.gnu.org/ml/gcc-patches/2010-09/msg01838.html was to say
the PIC reg needed to be saved for eh_return, not all gprs. Of
course, it doesn't hurt to say all gprs need to be saved for eh_return
as that is what the target-independent code does by setting DF live,
but it's unnecessary in the backend.
* config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Merge..
(save_reg_p): ..into this. Update all callers.
(first_reg_to_save): Simplify.
From-SVN: r251115
GCC mainline built for sh4-linux-gnu runs out of memory building a
glibc test, which calls strncmp with very large constant size
argument, resulting in the SH inline strncmp expansion trying to
inline a fully unrolled expansion of strncmp for that size.
This patch limits that fully unrolled expansion to the case of less
than 32 bytes. This is explicitly *not* trying to be optimal in any
way (very likely a lower threshold makes sense), just to limit enough
to avoid the out-of-memory issue in the glibc testsuite.
I have *not* run the GCC testsuite for SH. I have verified that this
allows the glibc testsuite to build OK, with both GCC mainline and GCC
7 branch (and that the included test builds quickly with patched GCC,
runs out of memory with unpatched GCC).
PR target/78460
PR target/67712
gcc:
* config/sh/sh-mem.cc (sh_expand_cmpnstr): Only unroll for
constant count if that count is less than 32.
gcc/testsuite:
* gcc.c-torture/compile/string-large-1.c: New test.
From-SVN: r251108
2017-08-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/81790
* tree-ssa-sccvn.c (vn_lookup_simplify_result): Handle both
CONSTRUCTORs from simplifying and VN.
* gcc.dg/torture/pr81790.c: New testcase.
From-SVN: r251103
Fix longbranch test so it still generates long tbz branches.
gcc/testsuite/
PR target/81643
* gcc.target/aarch64/long_branch_1.c: Improve testcase.
From-SVN: r251094
* config/i386/i386.md (*load_tp_<mode>): Redefine as
define_insn_and_split. Split to a memory load from 0 in
DEFAULT_TLS_SEG_REG address space. Merge with *load_tp_x32
using PTR mode iterator.
(*load_tp_x32_zext"): Redefine as define_insn_and_split.
Split to a memory load from 0 in DEFAULT_TLS_SEG_REG address space.
(*add_tp_<mode>): Redefine as define_insn_and_split.
Split to an add with a memory load from 0 in DEFAULT_TLS_SEG_REG
address space. Merge with *add_tp_x32 using PTR mode iterator.
(*add_tp_x32_zext"): Redefine as define_insn_and_split.
Split to an add with a memory load from 0 in
DEFAULT_TLS_SEG_REG address space.
From-SVN: r251075
2017-08-12 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64-option-extensions.def (rdma):
Fix feature string to what Linux prints out in /proc/cpuinfo.
From-SVN: r251073
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79542 reports an ICE in
dwarf2out.c for an Ada testcase built with optimization.
This crash happens during the late generation pass because
add_gnat_descriptive_type cannot find the type DIE corresponding to some
descriptive type after having tried to generate it. This is because the
DIE was generated during the early generation pass, but then pruned by
the type pruning machinery. So why was it pruned?
We are in a situation where we have cloned types (because of inlining,
IIUC) whose TYPE_NAME have non-null DECL_ABSTRACT_ORIGIN attributes. As
a consequence:
* In modified_type_die, the "handle C typedef types" part calls
gen_type_die on the cloned type.
* gen_type_die matches a typedef variant, and then calls gen_decl_die
on its TYPE_NAME, which will end up calling gen_typedef_die.
* gen_typedef_die checks decl_ultimate_origin for this TYPE_DECL, and
finds one, so it only adds a DW_AT_abstract_origin attribute to the
DW_TAG_typedef DIE, but the cloned type itself does not get its own
DIE.
* Back in modified_type_die, the call to lookup_type_die on the type
passed to gen_type_die returns NULL.
In the end, whole type trees, i.e. the ones referenced by
DECL_ABSTRACT_ORIGIN attributes, are never referenced from type pruning
"roots" and are thus pruned. The descriptive type at stake here is one
of them, hence the assertion failure.
This patch attemps to fix that with what seems to be the most sensible
thing to do in my opinion: updating the "handle C typedef types" part in
modified_type_die to check decl_ultimate_origin before calling
gen_type_die: if that function returns something not null, then we know
that gen_type_die/gen_typedef_die will not generate a DIE for the input
type, so we try to process the ultimate origin instead. It also updates
in a similar way gen_type_die_with_usage, assert that when
gen_typedef_die is called on nodes that have an ultimate origin, this
origin is themselves.
gcc/
PR ada/79542
* dwarf2out.c (modified_type_die): For C typedef types that have
an ultimate origin, process the ultimate origin instead of the
input type.
(gen_typedef_die): Assert that input DECLs have no ultimate
origin.
(gen_type_die_with_usage): For typedef variants that have an
ultimate origin, just call gen_decl_die on the original DECL.
(process_scope_var): Avoid creating DIEs for local typedefs and
concrete static variables.
gcc/testsuite/
PR ada/79542
* gnat.dg/debug13.ads, gnat.dg/debug13.adb: New testcase.
From-SVN: r251066
These need to match the gnu-user.h definitions to support
--enable-default-pie. Otherwise we end up linking the wrong startup
files when defaulting to PIE.
PR target/81170
PR target/81295
* config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Upgrade to
match gnu-user.h startfile.
(ENDFILE_LINUX_SPEC): Similarly.
From-SVN: r251065
PR c/81795
* c-decl.c (pushtag): Only print inform if the warning was printed.
(grokdeclarator): Likewise.
* gcc.dg/pr81795.c: New test.
From-SVN: r251056
2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60355
* resolve.c (resolve_symbol): Adjust (and reformat)
comment. Perform check if a BIND(C) is declared
at module level regardless of whether it is typed
implicitly or not.
2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60355
* gfortran.dg (bind_c_usage_30): New test.
From-SVN: r251054
2017-08-11 Martin Liska <mliska@suse.cz>
PR tree-opt/79987
* tree-chkp.c (chkp_get_bounds_for_decl_addr): Do not instrument
variables of void type.
2017-08-11 Martin Liska <mliska@suse.cz>
PR tree-opt/79987
* gcc.target/i386/mpx/pr79987.c: New test.
From-SVN: r251049
2017-08-11 Martin Liska <mliska@suse.cz>
PR ipa/81213
* config/i386/i386.c (make_resolver_func): Do complete
refactoring of the function.
2017-08-11 Martin Liska <mliska@suse.cz>
PR ipa/81213
* gcc.target/i386/pr81213.c: New test.
From-SVN: r251047
PR libstdc++/81808
* testsuite/27_io/basic_fstream/53984.cc: Adjust test for targets
that allow opening a directory as a FILE and reading from it.
From-SVN: r251041
The second loop in the testcase only vectorises if we can reverse
a vector and if aligned loads aren't required.
2017-08-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/testsuite/
PR testsuite/81738
* gcc.dg/vect/vect-alias-check-6.c: Move second function to...
* gcc.dg/vect/vect-alias-check-7.c: ...this new file. Require
vect_perm and vect_element_align for vectorization.
From-SVN: r251037
* cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
tentatively changed the lvalue to an rvalue.
* call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
(build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
parameter is an rvalue reference.
* except.c (build_throw): Do maybe-rvalue overload resolution twice.
* typeck.c (check_return_expr): Likewise.
From-SVN: r251035