2018-11-11 Richard Biener <rguenther@suse.de>
* tree-vrp.h (class value_range_base): New base class for
value_range containing all but the m_equiv member.
(dump_value_range_base): Add.
(range_includes_zero_p): Work on value_range_base.
* tree-vrp.c (value_range_base::set): Split out base handling
from...
(value_range::set): this.
(value_range::set_equiv): New.
(value_range_base::value_range_base): New constructors.
(value_range_base::check): Split out base handling from...
(value_range::check): this.
(value_range::equal_p): Refactor in terms of
ignore_equivs_equal_p which is now member of the base.
(value_range_base::set_undefined): New.
(value_range_base::set_varying): Likewise.
(value_range_base::dump):Split out base handling from...
(value_range::dump): this.
(value_range_base::set_and_canonicalize): Split out base handling
from...
(value_range::set_and_canonicalize): this.
(value_range_base::union_): New.
* ipa-prop.h (struct ipa_jump_func): Use value_range_base *
for m_vr.
* ipa-cp.c (class ipcp_vr_lattice): Use value_range_base
instead of value_range everywhere.
(ipcp_vr_lattice::print): Use dump_value_range_base.
(ipcp_vr_lattice::meet_with): Adjust.
(ipcp_vr_lattice::meet_with_1): Likewise.
(ipa_vr_operation_and_type_effects): Likewise.
(propagate_vr_across_jump_function): Likewise.
* ipa-prop.c (struct ipa_vr_ggc_hash_traits): Likewise.
(ipa_get_value_range): Likewise.
(ipa_set_jfunc_vr): Likewise.
(ipa_compute_jump_functions_for_edge): Likewise.
From-SVN: r266011
Implement P0318R1 unwrap_ref_decay and unwrap_reference
* include/std/type_traits (unwrap_reference, unwrap_reference_t)
(unwrap_ref_decay, unwrap_ref_decay_t): New traits and aliases.
* testsuite/20_util/unwrap_reference/1.cc: New test.
* testsuite/20_util/unwrap_reference/2.cc: New test.
From-SVN: r266010
2018-11-10 Sandra Loosemore <sandra@codesourcery.com>
PR middle-end/65703
gcc/
* doc/invoke.texi (Optimize Options): Add @opindex entries
for the positive forms of -fno-xxx and -mno-xxx options
that were lacking them.
From-SVN: r266008
This makes make_more_copies do what its documentation says, that is,
only make an intermediate pseudo if copying to a pseudo.
This regressed generated code quality when we didn't keep the original
notes that were on the copy, but since r265582 we do, and only allowing
pseudos now is a win. It also simplifies the code.
* combine.c (make_more_copies): Only make an intermediate copy if the
dest of a move is a pseudo.
From-SVN: r266004
PR target/87221
* config/netbsd-elf.h (NETBSD_STARTFILE_SPEC): Use crtbeginS.o for PIE.
(NETBSD_ENDFILE_SPEC): Use crtendS.o for PIE.
From-SVN: r265994
r265490 allowed the compiler to choose in a more flexible way whether to
use load or load-address-relative-long (LARL) instruction. When it
chose LARL for literal pool references, the latter ones were rewritten
by pass_s390_early_mach to use UNSPEC_LTREF, which assumes base register
usage, which in turn is not compatible with LARL. The end result was an
ICE because of unrecognizable insn.
UNSPEC_LTREF and friends are necessary in order to communicate the
dependency on the base register to pass_sched2. When relative
addressing is used, no base register is necessary, so in such cases the
rewrite must be avoided.
gcc/ChangeLog:
2018-11-09 Ilya Leoshkevich <iii@linux.ibm.com>
PR target/87762
* config/s390/s390.c (s390_safe_relative_long_p): New function.
(annotate_constant_pool_refs): Skip insns which support
relative addressing.
(annotate_constant_pool_refs_1): New helper function.
(find_constant_pool_ref): Skip insns which support relative
addression.
(find_constant_pool_ref_1): New helper function.
(replace_constant_pool_ref): Skip insns which support
relative addressing.
(replace_constant_pool_ref_1): New helper function.
(s390_mainpool_start): Adapt to the new signature.
(s390_mainpool_finish): Likewise.
(s390_chunkify_start): Likewise.
(s390_chunkify_finish): Likewise.
(pass_s390_early_mach::execute): Likewise.
(s390_prologue_plus_offset): Likewise.
(s390_emit_prologue): Likewise.
(s390_emit_epilogue): Likewise.
From-SVN: r265991
* gimplify.c (gimplify_scan_omp_clauses): Call sorry_at for valid
but unsupported lastprivate with conditional modifier.
* c-c++-common/gomp/lastprivate-conditional-1.c: New test.
* c-c++-common/gomp/lastprivate-conditional-2.c: New test.
From-SVN: r265987
* affinity-fmt.c: Include inttypes.h if HAVE_INTTYPES_H.
(gomp_display_affinity): Use __builtin_choose_expr to handle
properly handle argument having integral, or pointer or some other
type. If inttypes.h is available and PRIx64 is defined, use PRIx64
with uint64_t type instead of %llx and unsigned long long.
From-SVN: r265985
PR libstdc++/87787
* include/bits/stl_uninitialized.h (__relocate_a_1): Do not call
memmove when there's nothing to copy (and pointers could be null).
From-SVN: r265984
The code to implement new-style gccgo name mangling had a recipe that
didn't quite match the one in the compiler (incorrect handling for
'.'). This showed up as a failure in the gotools cgo test if the
directory containing the test run included a "." character.
Reviewed-on: https://go-review.googlesource.com/c/147917
From-SVN: r265981
A couple of very minor issues with the new support for CPU
aliases.
* config/arm/parsecpu.awk (/alias/): Tighten invisible alias
matching criteria. Remove unused array initializer.
From-SVN: r265978
2018-11-09 Bill Schmidt <wschmidt@linux.ibm.com>
Jinsong Ji <jji@us.ibm.com>
* config/rs6000/xmmintrin.h (_mm_cvtss_si32): Fix incorrect
constraints by introducing a new temporary.
(_mm_cvtss_si64): Likewise.
Co-Authored-By: Jinsong Ji <jji@us.ibm.com>
From-SVN: r265975
2018-11-09 Martin Liska <mliska@suse.cz>
* cgraph.h (ipa_discover_readonly_nonaddressable_vars): Rename
to ...
(ipa_discover_variable_flags): ... this.
* common.opt: Come up with new flag -fipa-reference-addressable.
* doc/invoke.texi: Document it.
* ipa-reference.c (propagate): Call the renamed fn.
* ipa-visibility.c (whole_program_function_and_variable_visibility):
Likewise.
* ipa.c (ipa_discover_readonly_nonaddressable_vars): Renamed to
...
(ipa_discover_variable_flags): ... this. Discover
non-addressable variables only with the newly added flag.
* opts.c: Enable the newly added flag with -O1 and higher
optimization level.
2018-11-09 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-ssa/writeonly-2.c: New test.
From-SVN: r265969
2018-11-09 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/gomp/workshare-reduction-1.c: New test.
* gcc.dg/gomp/workshare-reduction-2.c: New test.
* gcc.dg/gomp/workshare-reduction-3.c: New test.
* gcc.dg/gomp/workshare-reduction-4.c: New test.
* gcc.dg/gomp/workshare-reduction-5.c: New test.
* gcc.dg/gomp/workshare-reduction-6.c: New test.
* gcc.dg/gomp/workshare-reduction-7.c: New test.
* gcc.dg/gomp/workshare-reduction-8.c: New test.
* gcc.dg/gomp/workshare-reduction-9.c: New test.
* gcc.dg/gomp/workshare-reduction-10.c: New test.
* gcc.dg/gomp/workshare-reduction-11.c: New test.
* gcc.dg/gomp/workshare-reduction-12.c: New test.
* gcc.dg/gomp/workshare-reduction-13.c: New test.
* gcc.dg/gomp/workshare-reduction-14.c: New test.
* gcc.dg/gomp/workshare-reduction-15.c: New test.
* gcc.dg/gomp/workshare-reduction-16.c: New test.
* gcc.dg/gomp/workshare-reduction-17.c: New test.
* gcc.dg/gomp/workshare-reduction-18.c: New test.
* gcc.dg/gomp/workshare-reduction-19.c: New test.
* gcc.dg/gomp/workshare-reduction-20.c: New test.
* gcc.dg/gomp/workshare-reduction-21.c: New test.
* gcc.dg/gomp/workshare-reduction-22.c: New test.
* gcc.dg/gomp/workshare-reduction-23.c: New test.
* gcc.dg/gomp/workshare-reduction-24.c: New test.
* gcc.dg/gomp/workshare-reduction-25.c: New test.
* gcc.dg/gomp/workshare-reduction-26.c: New test.
* gcc.dg/gomp/workshare-reduction-27.c: New test.
* gcc.dg/gomp/workshare-reduction-28.c: New test.
* gcc.dg/gomp/workshare-reduction-29.c: New test.
* gcc.dg/gomp/workshare-reduction-30.c: New test.
* gcc.dg/gomp/workshare-reduction-31.c: New test.
* gcc.dg/gomp/workshare-reduction-32.c: New test.
* gcc.dg/gomp/workshare-reduction-33.c: New test.
* gcc.dg/gomp/workshare-reduction-34.c: New test.
* gcc.dg/gomp/workshare-reduction-35.c: New test.
* gcc.dg/gomp/workshare-reduction-36.c: New test.
* gcc.dg/gomp/workshare-reduction-37.c: New test.
* gcc.dg/gomp/workshare-reduction-38.c: New test.
* gcc.dg/gomp/workshare-reduction-39.c: New test.
* gcc.dg/gomp/workshare-reduction-40.c: New test.
* gcc.dg/gomp/workshare-reduction-41.c: New test.
* gcc.dg/gomp/workshare-reduction-42.c: New test.
* gcc.dg/gomp/workshare-reduction-43.c: New test.
* gcc.dg/gomp/workshare-reduction-44.c: New test.
* gcc.dg/gomp/workshare-reduction-45.c: New test.
* gcc.dg/gomp/workshare-reduction-46.c: New test.
* gcc.dg/gomp/workshare-reduction-47.c: New test.
* gcc.dg/gomp/workshare-reduction-48.c: New test.
* gcc.dg/gomp/workshare-reduction-49.c: New test.
* gcc.dg/gomp/workshare-reduction-50.c: New test.
* gcc.dg/gomp/workshare-reduction-51.c: New test.
* gcc.dg/gomp/workshare-reduction-52.c: New test.
* gcc.dg/gomp/workshare-reduction-53.c: New test.
* gcc.dg/gomp/workshare-reduction-54.c: New test.
* gcc.dg/gomp/workshare-reduction-55.c: New test.
* gcc.dg/gomp/workshare-reduction-56.c: New test.
* gcc.dg/gomp/workshare-reduction-57.c: New test.
* gcc.dg/gomp/workshare-reduction-58.c: New test.
libgomp/
* testsuite/libgomp.c-c++-common/task-reduction-13.c: New test.
* testsuite/libgomp.c-c++-common/task-reduction-14.c: New test.
From-SVN: r265967
2018-11-09 Martin Liska <mliska@suse.cz>
* config/aarch64/aarch64.c (aarch64_parse_arch): Do not copy
string to a stack buffer.
(aarch64_parse_cpu): Likewise.
(aarch64_parse_tune): Likewise.
From-SVN: r265966
This patch simplifies the table of CPUs supported in GCC by making
use of the new alias feature. Most of the changes are fairly
straight-forward:
- arm7tdmi and arm7tdmi-s are the same thing.
- arm710t, arm720t and arm740t differ only in features external to the core
- arm920 and arm920t are the same thing; arm922t and arm940t differ from
arm920t only in features external to the core; ep9312 is an arm920t-derived
core that we continue to recognize for legacy reasons.
- arm10tdmi and arm1020t differ only in features external to the core.
- arm9e, arm946te-s, arm966e-s and arm968e-s differ only in features external
to the core.
- arm10e, arm1020e and arm1022e differ only in features external to the core.
The arm10e/arm1020e/arm1022e change is the only one which changes
behaviour of the compiler slightly. Previously, and for no reason
that I can remember, the scheduler for arm1020e/arm1022e was not used
for arm10e: this was probably an oversight. The unification means
that the same scheduler is now used for all three cores.
* config/arm/arm-cpus.in (arm7tdmi): Add an alias for arm7tdmi-s.
(arm7tdmi-s): Delete CPU.
(arm710t): Add aliases for arm720t and arm740t.
(arm720t, arm740t): Delete CPUs.
(arm920t): Add aliases for arm920, arm922t and arm940t.
(arm920, arm922t, arm940t): Delete CPUs.
(arm10tdmi): Add alias for arm1020t.
(arm1020t): Delete CPU.
(arm9e): Add aliases for arm946e-s, arm966e-s and arm968e-s.
(arm946e-s, arm966e-s, arm968e-s): Delete CPUs.
(arm10e): Add aliases for arm1020e and arm1022e.
(arm1020e, arm1022e): Delete CPU.
* config/arm/arm.md (generic_sched): Remove entries that are now
handled by aliases.
(generic_vfp): Likewise.
* config/arm/arm1020e.md: Simplify tuning selection based on alias
changes.
* config/arm/arm-tune.md: Regenerated.
* config/arm/arm-tables.opt: Regenerated.
From-SVN: r265960
2018-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/87621
* tree-vect-loop.c (vectorizable_reduction): Handle reduction
op with only phi inputs.
* tree-ssa-loop-ch.c: Include tree-ssa-sccvn.h.
(ch_base::copy_headers): Run CSE on copied loop headers.
(pass_ch_vect::process_loop_p): Simplify.
* g++.dg/vect/pr87621.cc: New testcase.
From-SVN: r265959
When in_a resolves to a register set in the prev_clobber insn, we may
use the SET_SRC for the compare instead. However, when in_b so
resolves, we proceed to use the reg with its earlier value. When both
resolve to the same register and prev_clobber is an insn that modifies
the register, this arrangement may cause the compare to match (when it
shouldn't) and the elimination of the compare to incorrectly succeed.
(set (reg 1) (plus (reg 1) (const_int N)))
(set (reg 2) (reg 1))
(set (reg flags) (compare (reg 1) (reg 2)))
in_a: (reg 1) --> (plus (reg 1) (const_int N))
in_b: (reg 2) -> (reg 1) -/> oops
(parallel [
(set (reg flags) (compare (plus (reg 1) (const_int N))
(reg 1))) ;; should be (plus...)
(set (reg 1) (plus (reg 1) (const_int N)))])
(set (reg 2) (reg 1))
This patch arranges for in_b to also undergo SET_SRC substitution
when appropriate, with a shortcut for when in_a and in_b are the same
rtx.
for gcc/ChangeLog
PR rtl-optimization/86438
* compare-elim.c (try_eliminate_compare): Use SET_SRC instead
of in_b for the compare if in_b is SET_DEST.
for gcc/testsuite/ChangeLog
PR rtl-optimization/86438
* gcc.dg/torture/pr86438.c: New.
From-SVN: r265957
Before revision 254025, we'd reject UNSPECs in debug loc exprs.
TARGET_CONST_NOT_OK_FOR_DEBUG_P still rejects that by default, on all
ports that override it, except for x86, that accepts @gotoff unspecs.
We can indeed accept them in top-level expressions, but not as
subexpressions: the assembler rejects the difference between two
@gotoff symbols, for example.
We could simplify such a difference and drop the @gotoffs, provided
that the symbols are in the same section; we could also accept
@gotoffs plus literal constants. However, accepting those but
rejecting such combinations as subexpressions would be ugly, and most
likely not worth the trouble: sym@gotoff+litconst hardly makes sense
as a standalone expression, and the difference between @gotoffs should
be avoided to begin with, as follows.
Ideally, the debug loc exprs would use the symbolic data in
REG_EQUIV/REG_EQUAL notes, or delegitimized addresses, instead of
simplifying the difference between two legitimized addresses so that
the occurrences of the GOT register cancel each other. That would
require some more elaborate surgery in var-tracking and cselib than
would be appropriate at this stage.
for gcc/ChangeLog
PR target/87793
* config/i386/i386.c (ix86_const_not_ok_for_debug_p): Reject
non-toplevel UNSPEC.
for gcc/testsuite/ChangeLog
PR target/87793
* gcc.dg/pr87793.c: New.
From-SVN: r265956