Commit Graph

183178 Commits

Author SHA1 Message Date
GCC Administrator
f7884fb176 Daily bump. 2021-02-02 00:16:23 +00:00
Kyrylo Tkachov
850e5878f8 aarch64: Reimplement vrshrn* intrinsics using builtins
This patch moves the vrshrn* intrinsics to builtins away from inline
asm.

It's a bit of code, but it's very similar to the recent vsrhn*
reimplementation except that we use an unspec rather than standard RTL
codes for the functionality.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (rshrn, rshrn2):
	Define builtins.
	* config/aarch64/aarch64-simd.md (aarch64_rshrn<mode>_insn_le):
	Define.
	(aarch64_rshrn<mode>_insn_be): Likewise.
	(aarch64_rshrn<mode>): Likewise.
	(aarch64_rshrn2<mode>_insn_le): Likewise.
	(aarch64_rshrn2<mode>_insn_be): Likewise.
	(aarch64_rshrn2<mode>): Likewise.
	* config/aarch64/aarch64.md (unspec): Add UNSPEC_RSHRN.
	* config/aarch64/arm_neon.h (vrshrn_high_n_s16): Reimplement
	using builtin.
	(vrshrn_high_n_s32): Likewise.
	(vrshrn_high_n_s64): Likewise.
	(vrshrn_high_n_u16): Likewise.
	(vrshrn_high_n_u32): Likewise.
	(vrshrn_high_n_u64): Likewise.
	(vrshrn_n_s16): Likewise.
	(vrshrn_n_s32): Likewise.
	(vrshrn_n_s64): Likewise.
	(vrshrn_n_u16): Likewise.
	(vrshrn_n_u32): Likewise.
	(vrshrn_n_u64): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/narrow_high-intrinsics.c: Adjust rshrn2
	assembly scan.
2021-02-01 21:10:35 +00:00
David Malcolm
11d4ec5d45 analyzer: fix false positives with *UNKNOWN_PTR [PR98918]
PR analyzer/98918 reports various false positives and state explosions
on correct code that frees nodes and other pointers in a singly-linked
list.

The issue is that state-merger in the loop leads to UNKNOWN_VALUEs,
and these are then erroneously used to form compound symbolic values
and regions, such as;
  INIT_VAL((*UNKNOWN(struct marker *)).ref)
and:
  (*INIT_VAL((*UNKNOWN(struct marker * *))))
The malloc state machine then treats these symbolic values as
identifying specific pointers, and thus e.g. erroneously reports a
double-free when
  INIT_VAL((*UNKNOWN(struct marker *)).ref)
is freed twice (on subsequent iterations of the loop).

Similarly, the increasingly complex compound symbolic values have
sm-state which prevents state merging, and eventually lead to the
analysis hitting safety limits and stopping.

This patch makes various compound values involving UNKNOWN be
themselves UNKNOWN, resolving both the false positives and the state
explosions.

gcc/analyzer/ChangeLog:
	PR analyzer/98918
	* region-model-manager.cc
	(region_model_manager::get_or_create_initial_value):
	Fold the initial value of *UNKNOWN_PTR to an UNKNOWN value.
	(region_model_manager::get_field_region): Fold the value
	of UNKNOWN_PTR->FIELD to *UNKNOWN_PTR_OF_&FIELD_TYPE.

gcc/testsuite/ChangeLog:
	PR analyzer/98918
	* gcc.dg/analyzer/pr98918.c: New test.
2021-02-01 15:13:39 -05:00
François Dumont
33a1e511b5 libstdc++: Make deque iterator operator- usable with value-init iterators
N3644 implies that operator- can be used on value-init iterators. We now return
0 if both iterators are value initialized. If only one is value initialized we
keep the UB by returning the result of a normal computation which is a meaningless
value.

libstdc++-v3/ChangeLog:

	PR libstdc++/70303
	* include/bits/stl_deque.h (std::deque<>::operator-(iterator, iterator)):
	Return 0 if both iterators are value-initialized.
	* testsuite/23_containers/deque/70303.cc: New test.
	* testsuite/23_containers/vector/70303.cc: New test.
2021-02-01 19:19:53 +01:00
Sergei Trofimovich
11056ab768 tree-optimization/98499 - fix modref analysis on RVO statements
Before the change RVO gimple statements were treated as local
stores by modres analysis. But in practice RVO escapes target.

2021-02-01  Sergei Trofimovich  <siarheit@google.com>

gcc/ChangeLog:

	PR tree-optimization/98499
	* ipa-modref.c (analyze_ssa_name_flags): treat RVO
	conservatively and assume all possible side-effects.

gcc/testsuite/ChangeLog:

	PR tree-optimization/98499
	* g++.dg/pr98499.C: new test.
2021-02-01 18:13:42 +00:00
Kyrylo Tkachov
8bfdf51d85 aarch64: Reimplement vmovl_high_* intrinsics using builtins
The vmovl_high_* intrinsics map down to the SXTL2/UXTL2 instructions
that already have appropriately-named patterns and expanders,
so it's straightforward to wire them up.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (vec_unpacks_hi,
	vec_unpacku_hi_): Define builtins.
	* config/aarch64/arm_neon.h (vmovl_high_s8): Reimplement using
	builtin.
	(vmovl_high_s16): Likewise.
	(vmovl_high_s32): Likewise.
	(vmovl_high_u8): Likewise.
	(vmovl_high_u16): Likewise.
	(vmovl_high_u32): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/simd/vmovl_high_1.c: New test.
2021-02-01 16:45:05 +00:00
Kyrylo Tkachov
6b2034c479 aarch64: Reimplement vabdl_* intrinsics using builtins
Another simple set of intrinsic moved to builtins in the straightforward
way.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (sabdl, uabdl):
	Define builtins.
	* config/aarch64/aarch64-simd.md (aarch64_<sur>abdl<mode>): New
	pattern.
	* config/aarch64/aarch64.md (unspec): Define UNSPEC_SABDL,
	UNSPEC_UABDL.
	* config/aarch64/arm_neon.h (vabdl_s8): Reimplemet using
	builtin.
	(vabdl_s16): Likewise.
	(vabdl_s32): Likewise.
	(vabdl_u8): Likewise.
	(vabdl_u16): Likewise.
	(vabdl_u32): Likewise.
	* config/aarch64/iterators.md (ABDL): New int iterator.
	(sur): Handle UNSPEC_SABDL, UNSPEC_UABDL.
2021-02-01 16:45:05 +00:00
Martin Sebor
6a2053773b Document various BLOCK macros.
gcc/ChangeLog:

	* tree.h (BLOCK_VARS): Add comment.
	(BLOCK_SUBBLOCKS): Same.
	(BLOCK_SUPERCONTEXT): Same.
	(BLOCK_ABSTRACT_ORIGIN): Same.
	(inlined_function_outer_scope_p): Same.
2021-02-01 09:17:21 -07:00
Martin Sebor
0718336a52 Reset front end trees before they make it into the middle end (PR middle-end/97172).
gcc/ChangeLog:

	PR middle-end/97172
	* attribs.c (attr_access::free_lang_data): Define new function.
	* attribs.h (attr_access::free_lang_data): Declare new function.

gcc/c/ChangeLog:

	PR middle-end/97172
	* c-decl.c (free_attr_access_data): New function.
	(c_parse_final_cleanups): Call free_attr_access_data.

gcc/testsuite/ChangeLog:

	PR middle-end/97172
	* gcc.dg/pr97172.c: New test.
2021-02-01 09:09:52 -07:00
Jonathan Wakely
90c9b2c176 libstdc++: Update C++17 status table for <charconv>
libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2011.xml: Update std::call_once
	status.
	* doc/xml/manual/status_cxx2014.xml: Likewise.
	* doc/xml/manual/status_cxx2017.xml: Likewise. Update
	std::from_chars and std::to_chars status. Fix formatting.
	* doc/html/manual/status.html: Regenerate.
2021-02-01 16:06:45 +00:00
Martin Sebor
445d6db649 Avoid -Wstringop-truncation.
libiberty/ChangeLog:

	* dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy
	to avoid -Wstringop-truncation.
2021-02-01 09:00:02 -07:00
Richard Biener
d7bd009ab0 Fix statistic accounting for auto_vec and auto_bitmap
This fixes accounting issues with using auto_vec and auto_bitmap
for -fmem-report.

2021-02-01  Richard Biener  <rguenther@suse.de>

	* vec.h (auto_vec::auto_vec): Add memory stat parameters
	and pass them on.
	* bitmap.h (auto_bitmap::auto_bitmap): Likewise.
2021-02-01 16:51:29 +01:00
Martin Sebor
c2f8e378d6 Verify a warning for a class with a ref-qualified assignment (PR c++/98835).
gcc/testsuite/ChangeLog:
	PR c++/98835
	* g++.dg/Wclass-memaccess-6.C: New test.
2021-02-01 08:42:58 -07:00
Patrick Palka
7e534fb7d8 c++: Fix ICE from verify_ctor_sanity [PR98295]
In this testcase we're crashing during constexpr evaluation of the
ARRAY_REF b[0] as part of evaluation of the lambda's by-copy capture of b
(which is encoded as a VEC_INIT_EXPR<b>).  Since A's constexpr default
constructor is not yet defined, b's initialization is not actually
constant, but because A is an empty type, evaluation of b from
cxx_eval_array_ref is successful and yields an empty CONSTRUCTOR.
And since this CONSTRUCTOR is empty, we {}-initialize the desired array
element, and end up crashing from verify_ctor_sanity during evaluation
of this initializer because we updated new_ctx.ctor without updating
new_ctx.object: the former now has type A[3] and the latter is still the
target of a TARGET_EXPR for b[0][0] created from cxx_eval_vec_init
(and so has type A).

This patch fixes this by setting new_ctx.object appropriately at the
same time that we set new_ctx.ctor from cxx_eval_array_reference.

gcc/cp/ChangeLog:

	PR c++/98295
	* constexpr.c (cxx_eval_array_reference): Also set
	new_ctx.object when setting new_ctx.ctor.

gcc/testsuite/ChangeLog:

	PR c++/98295
	* g++.dg/cpp0x/constexpr-98295.C: New test.
2021-02-01 10:27:45 -05:00
Marek Polacek
bab669f2fc c++: Improve sorry for __builtin_has_attribute [PR98355]
__builtin_has_attribute doesn't work in templates yet (bug 92104), so
in r11-471 I added a sorry.  But that only caught type-dependent
expressions and we also want to sorry on value-dependent expressions.
This patch uses uses_template_parms, but guarded with p_t_d, because
u_t_p sets p_t_d and then v_d_e_p considers variables with reference
types value-dependent, which breaks builtin-has-attribute-6.c.

This is a regression and I also plan to apply this to gcc-10.

gcc/cp/ChangeLog:

	PR c++/98355
	* parser.c (cp_parser_has_attribute_expression): Use
	uses_template_parms instead of type_dependent_expression_p.

gcc/testsuite/ChangeLog:

	PR c++/98355
	* g++.dg/ext/builtin-has-attribute2.C: New test.
2021-02-01 10:09:11 -05:00
Jason Merrill
6e0a231a4a c++: alias in qualified-id in template arg [PR98570]
template_args_equal has handled dependent alias specializations for a while,
but in this testcase the actual template argument is a SCOPE_REF, so we
called cp_tree_equal, which doesn't handle aliases specially when we get to
them.

This patch generalizes this by setting a flag so structural_comptypes will
check for template alias equivalence (if we aren't doing partial ordering).
The existing flag, comparing_specializations, was too broad; in particular,
when we're doing decls_match, we want to treat corresponding parameters as
equivalent, so we need to separate that from alias comparison.  So I
introduce the comparing_dependent_aliases flag.

From looking at other uses of comparing_specializations, it seems to me that
the new flag is what modules wants, as well.

The other use of comparing_specializations in structural_comptypes is a hack
to deal with spec_hasher::equal not calling push_to_top_level, which we
also don't want to tie to the alias comparison semantics.

This patch also changes how we get to structural comparison of aliases from
checking TYPE_CANONICAL in comptypes to marking the aliases as getting
structural comparison when they are built, which is more consistent with how
e.g. typename is handled.

As I mention in the comment for comparing_dependent_aliases, I think the
default should be to treat different dependent aliases for the same type as
distinct, only treating them as equal during deduction (particularly partial
ordering).  But that's a matter for the C++ committee, to try in stage 1.

gcc/cp/ChangeLog:

	PR c++/98570
	* cp-tree.h: Declare it.
	* pt.c (comparing_dependent_aliases): New flag.
	(template_args_equal, spec_hasher::equal): Set it.
	(dependent_alias_template_spec_p): Assert that we don't
	get non-types other than error_mark_node.
	(instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
	on complex alias specializations.  Set TYPE_DEPENDENT_P here.
	(tsubst_decl): Not here.
	* module.cc (module_state::read_cluster): Set
	comparing_dependent_aliases instead of
	comparing_specializations.
	* tree.c (cp_tree_equal): Remove comparing_specializations
	module handling.
	* typeck.c (structural_comptypes): Adjust.
	(comptypes): Remove comparing_specializations handling.

gcc/testsuite/ChangeLog:

	PR c++/98570
	* g++.dg/cpp0x/alias-decl-targ1.C: New test.
2021-02-01 09:49:42 -05:00
Jonathan Wright
bec5dbae56 testsuite: aarch64: Add tests for vmlXl_high intrinsics
Add tests for vmlal_high_* and vmlsl_high_* Neon intrinsics. Since
these intrinsics are only supported for AArch64, these tests are
restricted to only run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-01-31  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vmlXl_high.inc:
	New test template.
	* gcc.target/aarch64/advsimd-intrinsics/vmlXl_high_lane.inc:
	New test template.
	* gcc.target/aarch64/advsimd-intrinsics/vmlXl_high_laneq.inc:
	New test template.
	* gcc.target/aarch64/advsimd-intrinsics/vmlXl_high_n.inc:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlal_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlal_high_lane.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlal_high_laneq.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlal_high_n.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlsl_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlsl_high_lane.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlsl_high_laneq.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmlsl_high_n.c:
	New test.
2021-02-01 14:13:59 +00:00
Jonathan Wright
8db8a00476 testsuite: aarch64: Add tests for vmull_high intrinsics
Add tests for vmull_high_* Neon intrinsics. Since these intrinsics
are only supported for AArch64, these tests are restricted to only
run on AArch64 targets.

gcc/testsuite/ChangeLog:

2021-01-29  Jonathan Wright  <jonathan.wright@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vmull_high.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmull_high_lane.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmull_high_laneq.c:
	New test.
	* gcc.target/aarch64/advsimd-intrinsics/vmull_high_n.c:
	New test.
2021-02-01 14:13:04 +00:00
Tamar Christina
0a3eccb6ef AArch64: Change canonization of smlal and smlsl in order to be able to optimize the vec_dup
g:87301e3956d44ad45e384a8eb16c79029d20213a and
g:ee4c4fe289e768d3c6b6651c8bfa3fdf458934f4 changed the intrinsics to be
proper RTL but accidentally ended up creating a regression because of the
ordering in the RTL pattern.

The existing RTL that combine should try to match to remove the vec_dup is
aarch64_vec_<su>mlal_lane<Qlane> and aarch64_vec_<su>mult_lane<Qlane> which
expects the select register to be the second operand of mult.

The pattern introduced has it as the first operand so combine was unable to
remove the vec_dup.  This flips the order such that the patterns optimize
correctly.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md (aarch64_<su>mlal_n<mode>,
	aarch64_<su>mlsl<mode>, aarch64_<su>mlsl_n<mode>): Flip mult operands.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/advsimd-intrinsics/smlal-smlsl-mull-optimized.c: New test.
2021-02-01 13:50:43 +00:00
Patrick Palka
1b303ef6cc c++: Add testcase for PR84494
We correctly accept this testcase ever since r10-5143.

gcc/testsuite/ChangeLog:

	PR c++/84494
	* g++.dg/cpp1y/constexpr-84494.C: New test.
2021-02-01 08:48:46 -05:00
Xing GUO
bbe6998b22 RISC-V: Fix gcc.target/riscv/attribute-18.c
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/attribute-18.c: Add -mriscv-attribute option.
2021-02-01 17:35:48 +08:00
Richard Biener
972918eea8 rtl-optimization/98863 - prune RD with LIVE in STV
This sets DF_RD_PRUNE_DEAD_DEFS like all other uses of the UD/DU
chain problems which makes the RD problem consume a lot less memory.

2021-02-01  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/98863
	* config/i386/i386-features.c (convert_scalars_to_vector):
	Set DF_RD_PRUNE_DEAD_DEFS.
2021-02-01 09:21:26 +01:00
Xionghu Luo
b90d051ecb testsuite: Update pr79251 ilp32 store regex
BE ilp32 Linux generates extra stack stwu instructions which shouldn't
be counted in, \m … \M is needed around each instruction, not just the
beginning and end of the entire pattern.

gcc/testsuite/ChangeLog:

2021-02-01  Xionghu Luo  <luoxhu@linux.ibm.com>

	* gcc.target/powerpc/pr79251.p8.c: Update store count regex.
	* gcc.target/powerpc/pr79251.p9.c: Likewise.
2021-01-31 21:01:38 -06:00
GCC Administrator
94d5ba26f9 Daily bump. 2021-02-01 00:16:20 +00:00
Eric Botcazou
2b5af10348 Add missing definition of SIZE_MAX
If the stdint.h system file follows the ISO C99 specification, it might
not define SIZE_MAX in C++ by default, so provide a local fallback.

gcc/
	* system.h (SIZE_MAX): Define if not already defined.
2021-01-31 23:25:56 +01:00
Iain Sandoe
98342bdd2b testsuite, Darwin : Skip ELF-specific tests.
A number of ELF-specific tests were introduced in r11-6140, one
of which fails on all Mach-O/Darwin platforms.

On examination, the tests have no meaningful parallel for Mach-O
which dead strips at the symbol level, and does not make use of
function sections (the fact that a used and an unused symbol are
placed in the same section will not affect dead stripping).

Given that the tests do not demonstrate anything useful on Darwin,
skip them.

gcc/testsuite/ChangeLog:

	* c-c++-common/attr-used-5.c: Skip for Darwin.
	* c-c++-common/attr-used-6.c: Likewise.
	* c-c++-common/attr-used-7.c: Likewise.
	* c-c++-common/attr-used-8.c: Likewise.
	* c-c++-common/attr-used-9.c: Likewise.
2021-01-31 13:56:35 +00:00
GCC Administrator
5dfbad4f7c Daily bump. 2021-01-31 00:16:20 +00:00
David Edelsohn
245ccc8e6b testsuite: Update pr79251 ilp32 store counts.
With the recent changes to vector insert optimization, the number of
expected stores for the two testcases has changed.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr79251.p8.c: Update ilp32 store counts.
	* gcc.target/powerpc/pr79251.p9.c: Same.
2021-01-30 17:17:19 -05:00
Aaron Sawdey
1242eb75b3 Fusion patterns for logical-logical
This patch adds a new function to genfusion.pl to generate patterns for
logical-logical fusion. They are enabled by default for power10 and can
be disabled by -mno-power10-fusion-2logical or -mno-power10-fusion.

gcc/ChangeLog
	* config/rs6000/genfusion.pl (gen_2logical): New function to
	generate patterns for logical-logical fusion.
	* config/rs6000/fusion.md: Regenerated patterns.
	* config/rs6000/rs6000-cpus.def: Add
	OPTION_MASK_P10_FUSION_2LOGICAL.
	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Enable logical-logical fusion for p10.
	* config/rs6000/rs6000.opt: Add -mpower10-fusion-2logical.
2021-01-30 15:52:27 -06:00
David Edelsohn
349b909bb3 aix: add periods to option explanation.
gcc/ChangeLog:

	* config/rs6000/rs6000.opt: Add periods to new AIX options.
2021-01-30 13:30:00 -05:00
David Edelsohn
2e7750cb51 aix: Permit use of AIX Vector extended ABI mode
AIX only permits use of Altivec VSRs 20-31 in a Vector Extended ABI mode.
This patch explicitly enables use of the VSRs using the new -mabi=vec-extabi
command line option also implemented in LLVM for AIX.

Bootstrapped on powerpc-ibm-aix7.2.3.0 and powerpc64le-linux-gnu.

gcc/ChangeLog:

	* config/rs6000/rs6000.opt (mabi=vec-extabi): New.
	(mabi=vec-default): New.
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
	__EXTABI__ for AIX Vector extended ABI.
	* config/rs6000/rs6000.c (rs6000_debug_reg_global): Print AIX Vector
	extabi info.
	(conditional_register_usage): If AIX vec_extabi enabled, vs20-vs31
	are non-volatile.
	* doc/invoke.texi (PowerPC mabi): Add AIX vec-extabi and vec-default.
2021-01-30 12:08:00 -05:00
Iain Buclaw
92dd3e71f9 libphobos: Synchronize libdruntime bindings with upstream druntime
Reviewed-on: https://github.com/dlang/druntime/pull/3348

gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::visit (TypeInfoDeclaration *)): Don't
	layout m_arg1 and m_arg2 fields.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* libdruntime/MERGE: Merge upstream druntime e4aae28e.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Refresh module list.
	(DRUNTIME_DSOURCES_BIONIC): Add core/sys/bionic/err.d.
	(DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/err.d,
	core/sys/darwin/ifaddrs.d, core/sys/darwin/mach/nlist.d,
	core/sys/darwin/mach/stab.d, and core/sys/darwin/sys/attr.d.
	(DRUNTIME_DSOURCES_DRAGONFLYBSD): Add core/sys/dragonflybsd/err.d.
	(DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/err.d.
	(DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/err.d.
	(DRUNTIME_DSOURCES_NETBSD): Add core/sys/netbsd/err.d.
	(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/err.d.
	(DRUNTIME_DSOURCES_POSIX): Add core/sys/posix/locale.d,
	core/sys/posix/stdc/time.d, core/sys/posix/string.d, and
	core/sys/posix/strings.d.
	(DRUNTIME_DSOURCES_SOLARIS): Add core/sys/solaris/err.d.
	(DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/sdkddkver.d,
	and core/sys/windows/stdc/time.d
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/gcc/sections/elf_shared.d (sizeofTLS): New function.
	* testsuite/libphobos.thread/fiber_guard_page.d: Use
	__traits(getMember) to get internal fields.
2021-01-30 16:50:57 +01:00
Jakub Jelinek
accc5ba53e i386, df: Fix up gcc.c-torture/compile/20051216-1.c -O1 -march=cascadelake
>     rtl-optimization/98863 - tame i386 specific RPAD pass
>
> caused
>
> FAIL: gcc.c-torture/compile/20051216-1.c   -O1  (internal compiler error)
> FAIL: gcc.c-torture/compile/20051216-1.c   -O1  (test for excess errors)

The problem is that we don't revert the df flags back.
This patch fixes it by clearing DF_DEFER_INSN_RESCAN after
calling df_process_deferred_rescans, so that it doesn't leak into following
unprepared passes that expect non-deferred rescans.

2021-01-30  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386-features.c (remove_partial_avx_dependency): Clear
	DF_DEFER_INSN_RESCAN after calling df_process_deferred_rescans.

	* gcc.target/i386/20051216-1.c: New test.
2021-01-30 14:58:14 +01:00
Jakub Jelinek
25f303e9a2 testsuite: Fix up gomp/simd-{2,3}.c tests [PR98243]
The test (intentionally) is not gcc.dg/vect/, as it needs -fopenmp and uses
OpenMP directives other than simd and therefore can't rely on default
VECTFLAGS and so I think can't safely use vect_int effective target
either.  So, I'm just making sure it is vectorized on x86 and on aarch64 (the
latter as an example of a target that doesn't need any extra options to get
the vectorization).

2021-01-30  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/98243
	* gcc.dg/gomp/simd-2.c: Add -msse2 on x86.  Restrict
	scan-tree-dump-times to x86 and aarch64 targets.
	* gcc.dg/gomp/simd-3.c: Likewise.
2021-01-30 10:52:57 +01:00
GCC Administrator
2900f2f2c5 Daily bump. 2021-01-30 00:16:19 +00:00
Clément Chigot
4d31df4089 internal/cpu: correctly link to getsystemcfg
Directly set getsystemcfg as //extern in internal/cpu instead of
trying to use the runtime as in Go toolchain.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/287932
2021-01-29 16:12:43 -08:00
Michael Meissner
d761172d9b PR testsuite/98870: Fix IEEE 128-bit fortran test
This test started failing when I changed the mapping of IEEE 128-bit long
double built-in functions on 2021-01-28.  This patch fixes the test so it
uses the correct name.

gcc/testsuite/
2021-01-29  Michael Meissner  <meissner@linux.ibm.com>

	PR testsuite/98870
	* gcc.target/powerpc/ppc-fortran/ieee128-math.f90: Fix the
	expected result.
2021-01-29 17:44:54 -05:00
Will Schmidt
fa00e35c17 [PATCH, rs6000] Fix typo in gcc.target/pr91903.c dg-require stanza
Fix obvious typo in testcases dg-require stanza.

2021-01-29  Will Schmidt <will_schmidt@vnet.ibm.como>

gcc/testsuite/ChangeLog:
	* gcc.target/powerpc/pr91903.c: Fix dg-require stanza.
2021-01-29 16:24:47 -06:00
Vladimir N. Makarov
0202fa3d63 [PR97701] Modify test for trunk
Original test was for gcc-10.  The modified one for trunk.

gcc/testsuite/ChangeLog:

	PR target/97701
	* gcc.target/aarch64/pr97701.c: Modify.
2021-01-29 16:05:58 -05:00
David Malcolm
eb06fdd424 analyzer: consolidate conditionals in paths
This patch adds a simplification to analyzer paths for
repeated CFG edges generated from compound conditionals.
For example, it simplifies:

    |    5 |   if (a && b && c)
    |      |      ^~~~~~~~~~~~
    |      |      |  |    |
    |      |      |  |    (4) ...to here
    |      |      |  |    (5) following ‘true’ branch (when ‘c != 0’)...
    |      |      |  (2) ...to here
    |      |      |  (3) following ‘true’ branch (when ‘b != 0’)...
    |      |      (1) following ‘true’ branch (when ‘a != 0’)...
    |    6 |     __analyzer_dump_path ();
    |      |     ~~~~~~~~~~~~~~~~~~~~~~~
    |      |     |
    |      |     (6) ...to here

to:

    |    5 |   if (a && b && c)
    |      |      ^
    |      |      |
    |      |      (1) following ‘true’ branch...
    |    6 |     __analyzer_dump_path ();
    |      |     ~~~~~~~~~~~~~~~~~~~~~~~
    |      |     |
    |      |     (2) ...to here

gcc/analyzer/ChangeLog:
	* checker-path.cc (event_kind_to_string): Handle
	EK_START_CONSOLIDATED_CFG_EDGES and
	EK_END_CONSOLIDATED_CFG_EDGES.
	(start_consolidated_cfg_edges_event::get_desc): New.
	(checker_path::cfg_edge_pair_at_p): New.
	* checker-path.h (enum event_kind): Add
	EK_START_CONSOLIDATED_CFG_EDGES and
	EK_END_CONSOLIDATED_CFG_EDGES.
	(class start_consolidated_cfg_edges_event): New class.
	(class end_consolidated_cfg_edges_event): New class.
	(checker_path::delete_events): New.
	(checker_path::replace_event): New.
	(checker_path::cfg_edge_pair_at_p): New decl.
	* diagnostic-manager.cc (diagnostic_manager::prune_path): Call
	consolidate_conditions.
	(same_line_as_p): New.
	(diagnostic_manager::consolidate_conditions): New.
	* diagnostic-manager.h
	(diagnostic_manager::consolidate_conditions): New decl.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/combined-conditionals-1.c: New test.
2021-01-29 15:12:24 -05:00
Vladimir N. Makarov
7f9f83ef30 [PR97701] LRA: Don't narrow class only for REG or MEM.
Reload pseudos of ALL_REGS class did not narrow class from constraint
in insn (set (pseudo) (lo_sum ...)) because lo_sum is considered an
object (OBJECT_P) although the insn is not a classic move.  To permit
narrowing we are starting to use MEM_P and REG_P instead of OBJECT_P.

gcc/ChangeLog:

	PR target/97701
	* lra-constraints.c (in_class_p): Don't narrow class only for REG
	or MEM.

gcc/testsuite/ChangeLog:

	PR target/97701
	* gcc.target/aarch64/pr97701.c: New.
2021-01-29 14:54:41 -05:00
Ian Lance Taylor
726b7aa004 libgo: update to Go1.16rc1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/287493
2021-01-29 11:04:55 -08:00
Will Schmidt
91a95ad2ae [PATCH, rs6000] improve vec_ctf invalid parameter handling.
Hi,
  Per PR91903, GCC ICEs when we attempt to pass a variable
(or out of range value) into the vec_ctf() builtin.  Per
investigation, the parameter checking exists for this
builtin with the int types, but was missing for
the long long types. This problem also occurs for the
vec_cts() builtin, which is also fixed by this patch.

This patch adds the missing CODE_FOR_* entries to the
rs6000_expand_binup_builtin to cover that scenario.
This patch also updates some existing tests to remove
calls to vec_ctf() and vec_cts() that contain negative
values.

PR target/91903

2020-01-29  Will Schmidt  <will_schmidt@vnet.ibm.com>

gcc/ChangeLog:
	* config/rs6000/rs6000-call.c (rs6000_expand_binup_builtin): Add
	clauses for CODE_FOR_vsx_xvcvuxddp_scale and
	CODE_FOR_vsx_xvcvsxddp_scale to the parameter checking code.

gcc/testsuite/ChangeLog:
	* gcc.target/powerpc/pr91903.c: New test.
	* gcc.target/powerpc/builtins-1.fold.h: Update.
	* gcc.target/powerpc/builtins-2.c: Update.
2021-01-29 11:34:59 -06:00
Nathan Sidwell
83bdc9f703 c++: Fix unordered entity array [PR 98843]
A couple of module invariants are that the modules are always
allocated in ascending order and appended to the module array.  The
entity array is likewise ordered, with each module having spans in
that array in ascending order.  Prior to header-units, this was
provided by the way import declarations were encountered.  With
header-units we need to load the preprocessor state of header units
before we parse the C++, and this can lead to incorrect ordering of
the entity array.  I had made the initialization of a module's
language state a little too lazy.  This moves the allocation of entity
array spans into the initial read of a module, thus ensuring the
ordering of those spans.  We won't be looking in them until we've
loaded the language portions of that particular module, and even if we
did, we'd find NULLs there and issue a diagnostic.

	PR c++/98843
	gcc/cp/
	* module.cc (module_state_config): Add num_entities field.
	(module_state::read_entities): The entity_ary span is
	already allocated.
	(module_state::write_config): Write num_entities.
	(module_state::read_config): Read num_entities.
	(module_state::write): Set config's num_entities.
	(module_state::read_initial): Allocate the entity ary
	span here.
	(module_state::read_language): Do not set entity_lwm
	here.
	gcc/testsuite/
	* g++.dg/modules/pr98843_a.C: New.
	* g++.dg/modules/pr98843_b.H: New.
	* g++.dg/modules/pr98843_c.C: New.
2021-01-29 09:11:46 -08:00
Andrew MacLeod
2dd1f94454 tree-optimization/98866 - Compile time hog in VRP
Don't track [1, +INF] for pointer types, treat them as invariant for caching
purposes as they cannot be further refined without evaluating to UNDEFINED.

	PR tree-optimization/98866
	* gimple-range-gori.h (gori_compute:set_range_invariant): New.
	* gimple-range-gori.cc (gori_map::set_range_invariant): New.
	(gori_map::m_maybe_invariant): Rename from all_outgoing.
	(gori_map::gori_map): Rename all_outgoing to m_maybe_invariant.
	(gori_map::is_export_p): Ditto.
	(gori_map::calculate_gori): Ditto.
	(gori_compute::set_range_invariant): New.
	* gimple-range.cc (gimple_ranger::range_of_stmt): Set range
	invariant for pointers evaluating to [1, +INF].
2021-01-29 11:47:18 -05:00
Richard Biener
a7f52181a6 rtl-optimization/98863 - tame i386 specific RPAD pass
This removes analyzing DF with expensive problems which we do not
use at all and which somehow cause 5GB of memory to leak.  Instead
just do a defered rescan of added insns.

2021-01-29  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/98863
	* config/i386/i386-features.c (remove_partial_avx_dependency):
	Do not perform DF analysis.
	(pass_data_remove_partial_avx_dependency): Remove
	TODO_df_finish.
2021-01-29 17:32:19 +01:00
Jonathan Wright
ee4c4fe289 aarch64: Use RTL builtins for [su]mull_n intrinsics
Rewrite [su]mull_n Neon intrinsics to use RTL builtins rather than
inline assembly code, allowing for better scheduling and
optimization.

gcc/ChangeLog:

2021-01-19  Jonathan Wright  <jonathan.wright@arm.com>

	* config/aarch64/aarch64-simd-builtins.def: Add [su]mull_n
	builtin generator macros.
	* config/aarch64/aarch64-simd.md (aarch64_<su>mull_n<mode>):
	Define.
	* config/aarch64/arm_neon.h (vmull_n_s16): Use RTL builtin
	instead of inline asm.
	(vmull_n_s32): Likewise.
	(vmull_n_u16): Likewise.
	(vmull_n_u32): Likewise.
2021-01-29 13:53:44 +00:00
Kyrylo Tkachov
9b588cfb42 aarch64: Reimplement vabdl_high* intrinsics using builtins
This patch reimplements the vabdl_high intrinsics using builtins.
It slightly cleans up the RTL pattern (the mode iterators) but nothing
interesting apart from that.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (sabdl2, uabdl2):
	Define builtins.
	* config/aarch64/aarch64-simd.md (aarch64_<sur>abdl2<mode>_3):
	Rename to...
	(aarch64_<sur>abdl2<mode>): ... This.
	(<sur>sadv16qi): Adjust use of above.
	* config/aarch64/arm_neon.h (vabdl_high_s8): Reimplement using
	builtin.
	(vabdl_high_s16): Likewise.
	(vabdl_high_s32): Likewise.
	(vabdl_high_u8): Likewise.
	(vabdl_high_u16): Likewise.
	(vabdl_high_u32): Likewise.
2021-01-29 13:49:19 +00:00
Kyrylo Tkachov
9f499a86b2 aarch64: Re-implement vabal_high* intrinsics using builtins
This patch reimplements the vabal_high* intrinsics using RTL builtins.
It's straightforward, defining new unspecs and a new pattern.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (sabal2): Define
	builtin.
	(uabal2): Likewise.
	* config/aarch64/aarch64-simd.md (aarch64_<sur>abal2<mode>): New
	pattern.
	* config/aarch64/aarch64.md (unspec): Add UNSPEC_SABAL2 and
	UNSPEC_UABAL2.
	* config/aarch64/arm_neon.h (vabal_high_s8): Reimplement using
	builtin.
	(vabal_high_s16): Likewise.
	(vabal_high_s32): Likewise.
	(vabal_high_u8): Likewise.
	(vabal_high_u16): Likewise.
	(vabal_high_u32): Likewise.
	* config/aarch64/iterators.md (ABAL2): New mode iterator.
	(sur): Handle UNSPEC_SABAL2, UNSPEC_UABAL2.
2021-01-29 13:49:19 +00:00
Kyrylo Tkachov
d5e0d1f1d2 aarch64: Reimplement vabal* intrinsics using builtins
This patch reimplements the vabal intrinsics with builtins.
The RTL pattern is cleaned up to emit the right .8b suffixes for the
inputs (though .16b is also accepted)
and iterate over the right modes. The pattern's only other use is
through the sadv16qi expander, which is adjusted.

I've verified that the codegen for sadv16qi is not worse off.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (sabal): Define
	builtin.
	(uabal): Likewise.
	* config/aarch64/aarch64-simd.md (aarch64_<sur>abal<mode>_4):
	Rename to...
	(aarch64_<sur>abal<mode>): ... This
	(<sur>sadv16qi): Adust use of the above.
	* config/aarch64/arm_neon.h (vabal_s8): Reimplement using
	builtin.
	(vabal_s16): Likewise.
	(vabal_s32): Likewise.
	(vabal_u8): Likewise.
	(vabal_u16): Likewise.
	(vabal_u32): Likewise.
2021-01-29 13:49:19 +00:00