179507 Commits

Author SHA1 Message Date
Tom de Vries
c0e9cee285 [libgomp, nvptx] Print error log for link error
By running libgomp test-case libgomp.c/target-28.c with GOMP_NVPTX_PTXRW=w
(using a maintenance patch that adds support for this env var), we dump the
ptx in target-28.exe to file.  By editing one ptx file to rename
gomp_nvptx_main to gomp_nvptx_main2 in both declaration and call, and
running with GOMP_NVPTX_PTXRW=r, we trigger a link error:
...
$ GOMP_NVPTX_PTXRW=r ./target-28.exe
libgomp: cuLinkComplete error: unknown error
...
The error is somewhat uninformative.

Fix this by dumping the error log returned by the failing cuda call, such
that we have instead:
...
$ GOMP_NVPTX_PTXRW=r ./target-28.exe
libgomp: Link error log error   : \
  Undefined reference to 'gomp_nvptx_main2' in ''
libgomp: cuLinkComplete error: unknown error
...

Build on x86_64 with nvptx accelerator, tested libgomp.

libgomp/ChangeLog:

	* plugin/plugin-nvptx.c (link_ptx): Print elog if cuLinkComplete call
	fails.
2020-09-22 13:38:00 +02:00
Kyrylo Tkachov
30957092db AArch64: Implement missing vcls intrinsics on unsigned types
This patch implements some missing intrinsics that perform a CLS on unsigned SIMD types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
	PR target/71233
	* config/aarch64/arm_neon.h (vcls_u8, vcls_u16, vcls_u32,
	vclsq_u8, vclsq_u16, vclsq_u32): Define.

gcc/testsuite/
	PR target/71233
	* gcc.target/aarch64/simd/vcls_unsigned_1.c: New test.
2020-09-22 12:03:49 +01:00
Kyrylo Tkachov
d4703be185 AArch64: Implement missing vceq*_p* intrinsics
This patch implements some missing vceq* intrinsics on poly types.
The behaviour is to produce the appropriate CMEQ instruction as for the unsigned types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
	PR target/71233
	* config/aarch64/arm_neon.h (vceqq_p64, vceqz_p64, vceqzq_p64): Define.

gcc/testsuite/

	PR target/71233
	* gcc.target/aarch64/simd/vceq_poly_1.c: New test.
2020-09-22 12:00:38 +01:00
Kyrylo Tkachov
fa9ad35dae AArch64: Implement poly-type vadd intrinsics
This implements the vadd[p]_p* intrinsics.
In terms of functionality they are aliases of veor operations on the relevant unsigned types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
	PR target/71233
	* config/aarch64/arm_neon.h (vadd_p8, vadd_p16, vadd_p64, vaddq_p8,
	vaddq_p16, vaddq_p64, vaddq_p128): Define.

gcc/testsuite/
	PR target/71233
	* gcc.target/aarch64/simd/vadd_poly_1.c: New test.
2020-09-22 11:58:36 +01:00
Sergei Trofimovich
4ecf368f4b gcov: fix TOPN streaming from shared libraries
Before the change gcc did not stream correctly TOPN counters
if counters belonged to a non-local shared object.

As a result zero-section optimization generated TOPN sections
in a form not recognizable by '__gcov_merge_topn'.

The problem happens because in a case of multiple shared objects
'__gcov_merge_topn' function is present in address space multiple
times (once per each object).

The fix is to never rely on function address and predicate on TOPN
counter types.

libgcc/ChangeLog:

	PR gcov-profile/96913
	* libgcov-driver.c (write_one_data): Avoid function pointer
	comparison in TOP streaming decision.
2020-09-22 11:41:04 +01:00
Jakub Jelinek
46a2741547 Fix some typos
2020-09-22  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* params.opt (--param=modref-max-tests=): Fix typo in help text:
	perofmed -> performed.
	* common.opt: Fix typo: incrmeental -> incremental.
	* ipa-modref.c: Fix typos: recroding -> recording, becaue -> because,
	analsis -> analysis.
	(class modref_summaries): Fix typo: betweehn -> between.
	(analyze_call): Fix typo: calle -> callee.
	(read_modref_records): Fix typo: expcted -> expected.
	(pass_ipa_modref::execute): Fix typo: calle -> callee.
gcc/c-family/
	* c.opt (Wbuiltin-declaration-mismatch): Fix typo in variable name:
	warn_builtin_declaraion_mismatch -> warn_builtin_declaration_mismatch.
2020-09-22 10:45:06 +02:00
Jakub Jelinek
466b907fad ipa: Fix up ipa modref option help texts
This fixes
FAIL: compiler driver --help=common option(s): "^ +-.*[^:.]$" absent from output: "  --param=modref-max-tests=   Maximum number of tests perofmed by modref query"
FAIL: compiler driver --help=optimizers option(s): "^ +-.*[^:.]$" absent from output: "  -fipa-modref                Perform interprocedural modref analysis"

2020-09-22  Jakub Jelinek  <jakub@redhat.com>

	* common.opt (-fipa-modref): Add dot at the end of option help.
	* params.opt (--param=modref-max-tests=): Likewise.
2020-09-22 10:02:47 +02:00
Jonathan Wakely
7825399092 libstdc++: Use correct argument type for __use_alloc, again [PR 96803]
While backporting 5494edae83ad33c769bd1ebc98f0c492453a6417 I noticed
that it's still not correct. I made the allocator-extended constructor
use the right type for the uses-allocator construction detection, but I
used an rvalue when it should be a const lvalue.

This should fix it properly this time.

libstdc++-v3/ChangeLog:

	PR libstdc++/96803
	* include/std/tuple
	(_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl<U...>&)):
	Use correct value category in __use_alloc call.
	* testsuite/20_util/tuple/cons/96803.cc: Check with constructors
	that require correct value category to be used.
2020-09-22 08:42:18 +01:00
Jan Hubicka
d149962d6a Add no strict aliasing to m128-check.h
* gcc.target/i386/m128-check.h: Add no-strict-aliasing
2020-09-22 09:29:56 +02:00
Patrick Palka
37edf28c24 libstdc++: Remove overzealous static_asserts from std::span
For a span with statically empty extent, we currently model the
preconditions of front(), back(), and operator[] as if they are
mandates, by using a static_assert to verify that extent != 0.  This
causes us to reject valid programs that would instantiate these member
functions and at runtime never call them.

Since they are already followed by more general runtime asserts, this
patch just removes these static_asserts altogether,

libstdc++-v3/ChangeLog:

	* include/std/span (span::front): Remove static_assert.
	(span::back): Likewise.
	(span::operator[]): Likewise.
	* testsuite/23_containers/span/back_neg.cc: Rewrite to verify
	that we check the preconditions of back() only when it's called.
	* testsuite/23_containers/span/front_neg.cc: Likewise for
	front().
	* testsuite/23_containers/span/index_op_neg.cc: Likewise for
	operator[].
2020-09-21 23:21:34 -04:00
Patrick Palka
813ad9c4dd libstdc++: Fix division by zero in std::sample
This fixes a division by zero in the selection-sampling std::__sample
overload when the input range is empty (and hence __unsampled_sz is 0).

libstdc++-v3/ChangeLog:

	* include/bits/stl_algo.h (__sample): Exit early when the
	input range is empty.
	* testsuite/25_algorithms/sample/3.cc: New test.
2020-09-21 20:48:23 -04:00
Patrick Palka
f017952d31 libstdc++: Mark some more algorithms constexpr for C++20
As per P0202.

libstdc++-v3/ChangeLog:

	* include/bits/stl_algo.h (for_each_n): Mark constexpr for C++20.
	(search): Likewise for the overload that takes a searcher.
	* testsuite/25_algorithms/for_each/constexpr.cc: Test constexpr
	std::for_each_n.
	* testsuite/25_algorithms/search/constexpr.cc: Test constexpr
	std::search overload that takes a searcher.
2020-09-21 20:48:17 -04:00
GCC Administrator
44135373fc Daily bump. 2020-09-22 00:16:31 +00:00
Ian Lance Taylor
27edc6c3e2 compiler: finalize methods for type aliases of struct types
Previously we would finalize the methods of the alias type itself, but
since its a type alias we really need to finalize the methods of the
aliased type.

Also, handle method expressions of unnamed struct types.

Test case is https://golang.org/cl/251168.

Fixes golang/go#38125

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/251279
2020-09-21 15:53:48 -07:00
David Malcolm
1e19ecd79b analyzer: fix ICE on bogus decl of memset [PR97130]
Verify that arguments are pointers before calling handling code
that calls deref_rvalue on them.

gcc/analyzer/ChangeLog:
	PR analyzer/97130
	* region-model-impl-calls.cc (call_details::get_arg_type): New.
	* region-model.cc (region_model::on_call_pre): Check that the
	initial arg is a pointer before calling impl_call_memset and
	impl_call_strlen.
	* region-model.h (call_details::get_arg_type): New decl.

gcc/testsuite/ChangeLog:
	PR analyzer/97130
	* gcc.dg/analyzer/pr97130.c: New test.
2020-09-21 18:50:08 -04:00
David Malcolm
15e7b93ba4 analyzer: decls are not on the heap
Whilst debugging the remaining state explosion in PR analyzer/93355
I noticed that half of the states at an exploding program point had:
  'malloc': {'&buf': 'non-heap'}
whereas the other half didn't, presumably depending on whether the path
to each enode had used this local buffer:
  char buf[400];

This patch tweaks malloc_state_machine::get_default_state to be smarter
about this, so that we can implicitly treat pointers to decls as
non-heap, preventing pointless differences between sm_state_map
instances.  With that, all of the states in question have equal (empty)
malloc sm-state - though the state explosion continues for other reasons.

gcc/analyzer/ChangeLog:
	PR analyzer/93355
	* sm-malloc.cc (malloc_state_machine::get_default_state): Look at
	the base region when considering pointers.  Treat pointers to
	decls as being non-heap.
2020-09-21 18:49:22 -04:00
Jonathan Wakely
7db5967f10 libstdc++: Use __builtin_expect in __glibcxx_assert
libstdc++-v3/ChangeLog:

	* include/bits/c++config (__replacement_assert): Add noreturn
	attribute.
	(__glibcxx_assert_impl): Use __builtin_expect to hint that the
	assertion is expected to pass.
2020-09-21 23:43:25 +01:00
Jonathan Wakely
aecea4158f libstdc++: Fix constraints for drop_view::begin() const [LWG 3482]
libstdc++-v3/ChangeLog:

	* include/std/ranges (drop_view::begin()): Adjust constraints
	to match the correct condition for O(1) ranges::next (LWG 3482).
	* testsuite/std/ranges/adaptors/drop.cc: Check that iterator is
	cached for non-sized_range.
2020-09-21 23:43:25 +01:00
Clément Chigot
be3027e9c8 go/internal/gccgoimporter: recognize aixbigafMagic archives
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/255201
2020-09-21 15:42:00 -07:00
Marek Polacek
defceb206b c++: DR 1722: Make lambda to function pointer conv noexcept [PR90583]
DR 1722 clarifies that the conversion function from lambda to pointer to
function should be noexcept(true).

gcc/cp/ChangeLog:

	PR c++/90583
	DR 1722
	* lambda.c (maybe_add_lambda_conv_op): Mark the conversion function
	as noexcept.

gcc/testsuite/ChangeLog:

	PR c++/90583
	DR 1722
	* g++.dg/cpp0x/lambda/lambda-conv14.C: New test.
2020-09-21 18:13:37 -04:00
Marek Polacek
7029dfa38b c++: Implement -Wctad-maybe-unsupported.
I noticed that clang++ has this CTAD warning and thought that it might
be useful to have it.  From clang++: "Some style guides want to allow
using CTAD only on types that "opt-in"; i.e. on types that are designed
to support it and not just types that *happen* to work with it."

So this warning warns when CTAD deduced a type, but the type does not
define any deduction guides.  In that case CTAD worked only because the
compiler synthesized the implicit deduction guides.  That might not be
intended.

It can be suppressed by adding a deduction guide that will never be
considered:

  struct allow_ctad_t;
  template <typename T> struct S { S(T) {} };
  S(allow_ctad_t) -> S<void>;

This warning is off by default.  It doesn't warn when the type comes
from a system header unless -Wsystem-headers.

gcc/c-family/ChangeLog:

	* c.opt (Wctad-maybe-unsupported): New option.

gcc/cp/ChangeLog:

	* pt.c (deduction_guides_for): Add a bool parameter.  Set it.
	(do_class_deduction): Warn when CTAD succeeds but the type doesn't
	have any explicit deduction guides.

gcc/ChangeLog:

	* doc/invoke.texi: Document -Wctad-maybe-unsupported.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wctad-maybe-unsupported.C: New test.
	* g++.dg/warn/Wctad-maybe-unsupported2.C: New test.
	* g++.dg/warn/Wctad-maybe-unsupported3.C: New test.
	* g++.dg/warn/Wctad-maybe-unsupported.h: New file.
2020-09-21 17:48:11 -04:00
Ian Lance Taylor
68402af1c6 libgo: don't put golang.org packages in zstdpkglist.go
This ensures that internal/goroot.IsStandardPackage does not treat
golang.org packages as being in the standard library.

For golang/go#41368
Fixes golang/go#41499

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256319
2020-09-21 14:11:01 -07:00
Martin Sebor
05193687dd Avoid incidental failures due to implicit attribute access.
gcc/testsuite/ChangeLog:

	PR c/50584
	* gcc.dg/ipa/ipa-sra-1.c: Use a plain pointer for argv instead of array.
	* gcc.dg/ipa/ipa-sra-12.c: Same.
	* gcc.dg/ipa/ipa-sra-13.c: Same.
	* gcc.dg/ipa/ipa-sra-14.c: Same.
	* gcc.dg/ipa/ipa-sra-15.c: Same.
2020-09-21 14:54:58 -06:00
Harald Anlauf
5c5ce60990 PR fortran/90903 [part2] - Add runtime checking for the MVBITS intrinsic
Implement inline expansion of the intrinsic elemental subroutine MVBITS
with optional runtime checks for valid argument range.

gcc/fortran/ChangeLog:

	* iresolve.c (gfc_resolve_mvbits): Remove unneeded conversion of
	FROMPOS, LEN and TOPOS arguments to fit a C int.
	* trans-intrinsic.c (gfc_conv_intrinsic_mvbits): Add inline
	expansion of MVBITS intrinsic elemental subroutine and add code
	for runtime argument checking.
	(gfc_conv_intrinsic_subroutine): Recognise MVBITS intrinsic, but
	defer handling to gfc_trans_call.
	* trans-stmt.c (replace_ss):
	(gfc_trans_call): Adjust to handle inline expansion, scalarization
	of intrinsic subroutine MVBITS in gfc_conv_intrinsic_mvbits.
	* trans.h (gfc_conv_intrinsic_mvbits): Add prototype for
	gfc_conv_intrinsic_mvbits.

gcc/testsuite/ChangeLog:

	* gfortran.dg/check_bits_2.f90: New test.

Co-authored-by: Paul Thomas  <pault@gcc.gnu.org>
2020-09-21 21:50:36 +02:00
Ian Lance Taylor
762c16eba6 libsanitizer: rename new libbacktrace symbols
* libbacktrace/backtrace-rename.h (backtrace_uncompress_lzma):
	Define.
	(backtrace_syminfo_to_full_callback): Define.
	(backtrace_syminfo_to_full_error_callback): Define.
2020-09-21 12:03:45 -07:00
Nathan Sidwell
33605e9bef c++: ts_lambda is not needed
We don't need ts_lambda, as IDENTIFIER_LAMBDA_P is sufficient.  Killed thusly.

	gcc/cp/
	* decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas.
	* lambda.c (begin_lambda_type): Use ts_current to push the tag.
	* name-lookup.h (enum tag_scope): Drop ts_lambda.
2020-09-21 11:53:14 -07:00
Iain Sandoe
4f5a297f75 Darwin, testsuite : Skip a test that requires ELF.
The symver support is only available to ELF targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/ipa/symver1.c: Skip for Darwin.
2020-09-21 19:31:22 +01:00
Christophe Lyon
b0c990f266 [arm] gcc.target/arm/cs*: Use dg-add-options arm_arch_v8_1m_main
These testcases need thumb mode, which may not be the default.

Using dg-add-options arm_arch_v8_1m_main ensures that -mthumb is used
and makes the test pass in more configurations.

2020-09-21  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/csinc-1.c: Use dg-add-options
	arm_arch_v8_1m_main.
	* gcc.target/arm/csinv-1.c: Likewise.
	* gcc.target/arm/csneg.c: Likewise.
2020-09-21 16:19:00 +00:00
Richard Biener
e6f58fb619 tree-optimization/97139 - fix BB SLP live lane extraction
This fixes SLP live lane extraction with pattern stmts.

2020-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/97139
	* tree-vect-slp.c (vect_bb_slp_mark_live_stmts): Only mark the
	pattern root, track visited vectorized stmts.

	* gcc.dg/vect/pr97139.c: New testcase.
2020-09-21 16:54:04 +02:00
Marek Polacek
b6ff694e59 c++: Detect deduction guide redeclaration [PR97099]
[temp.deduct.guide]p3: Two deduction guide declarations in the same
translation unit for the same class template shall not have equivalent
parameter-declaration-clauses.

So let's detect that.

gcc/cp/ChangeLog:

	PR c++/97099
	* decl.c (redeclaration_error_message): Detect a redeclaration of
	deduction guides.

gcc/testsuite/ChangeLog:

	PR c++/97099
	* g++.dg/cpp1z/class-deduction74.C: New test.
2020-09-21 10:11:41 -04:00
Jonathan Wakely
2ec58cfcea libstdc++: Relax constraints on transform_view and elements_view iterators
libstdc++-v3/ChangeLog:

	* include/std/ranges (transform_view, elements_view): Relax
	constraints on operator- for iterators, as per LWG 3483.
	* testsuite/std/ranges/adaptors/elements.cc: Check that we
	can take the difference of two iterators from a non-random
	access range.
	* testsuite/std/ranges/adaptors/transform.cc: Likewise.
2020-09-21 14:30:38 +01:00
Jonathan Wakely
f10ed928e2 libstdc++: Make std::assume_aligned a constexpr function [PR 97132]
The cast from void* to T* in std::assume_aligned is not valid in a
constexpr function. The optimization hint is redundant during constant
evaluation anyway (the compiler can see the object and knows its
alignment). Simply return the original pointer without applying the
__builtin_assume_aligned hint to it when doing constant evaluation.

This change also removes the preprocessor branch that works around
uintptr_t not being available. We already assume that type is present
elsewhere in the library.

libstdc++-v3/ChangeLog:

	PR libstdc++/97132
	* include/bits/align.h (align) [!_GLIBCXX_USE_C99_STDINT_TR1]:
	Remove unused code.
	(assume_aligned): Do not use __builtin_assume_aligned during
	constant evaluation.
	* testsuite/20_util/assume_aligned/1.cc: Improve test.
	* testsuite/20_util/assume_aligned/97132.cc: New test.
2020-09-21 14:28:58 +01:00
Jakub Jelinek
5187b01a4f Fix fallout from Support new mallinfo2 function.
2020-09-21  Jakub Jelinek  <jakub@redhat.com>

	* configure.ac: Use mallinfo mallinfo2 as first operand of
	gcc_AC_CHECK_DECLS rather than [mallinfo, mallinfo2].
	* configure: Regenerated.
	* config.in: Regenerated.
2020-09-21 14:21:28 +02:00
Andrea Corallo
2c62952f81 aarch64: Do not alter value on a force_reg returned rtx expanding __jcvt
2020-09-17  Andrea Corallo  <andrea.corallo@arm.com>

	* config/aarch64/aarch64-builtins.c
	(aarch64_general_expand_builtin): Use expand machinery not to
	alter the value of an rtx returned by force_reg.
2020-09-21 14:09:17 +02:00
Richard Biener
0df746afc5 tree-optimization/97135 - fix dependence check in store-motion
The following fixes a dependence check where in the particular place
we cannot ignore self-dependences.

2020-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/97135
	* tree-ssa-loop-im.c (sm_seq_push_down): Do not ignore
	self-dependences.

	* gcc.dg/torture/pr97135.c: New testcase.
2020-09-21 14:06:36 +02:00
Martin Liska
d726ecd955 Fix ICE in tree-switch-conversion.
With SVE we can end up with:
switch (POLY_INT_CST [2, 2]) <default: <L2> [INV], case 2: <L3> [INV], case 4: <L3> [INV]>
which is fine to expand and we can remove the assert.

gcc/ChangeLog:

	PR tree-optimization/96915
	* tree-switch-conversion.c (switch_conversion::expand): Accept
	also integer constants.

gcc/testsuite/ChangeLog:

	PR tree-optimization/96915
	* gcc.target/aarch64/sve/pr96915.c: New test.
2020-09-21 13:52:03 +02:00
Martin Liska
48b0c1250a POLY_INT_CST: remove extra space in dump
gcc/ChangeLog:

	* print-tree.c (print_node): Remove extra space.
2020-09-21 12:47:32 +02:00
Tobias Burnus
ed5ae55e93 mklog.py: Parse first 10 lines for PR/DR number
contrib/ChangeLog:

	* mklog.py: Parse first 10 lines for PR/DR number
	not only the first line.
2020-09-21 11:22:49 +02:00
Andrea Corallo
f5e73de00e aarch64: Fix ICE on fpsr fpcr getters [PR96968]
gcc/ChangeLog

2020-09-14  Andrea Corallo  <andrea.corallo@arm.com>

	PR target/96968
	* config/aarch64/aarch64-builtins.c
	(aarch64_expand_fpsr_fpcr_setter): Fix comment nit.
	(aarch64_expand_fpsr_fpcr_getter): New function, expand these
	getters using expand_insn machinery.
	(aarch64_general_expand_builtin): Make use of.

gcc/testsuite/ChangeLog

2020-09-14  Andrea Corallo  <andrea.corallo@arm.com>

	PR target/96968
	* gcc.target/aarch64/pr96968.c: New test.
2020-09-21 10:38:23 +02:00
Martin Liska
da87190421 Use ONE_? macros.
gcc/ChangeLog:

	* ggc-common.c (ggc_rlimit_bound): Use ONE_? macro.
	(ggc_min_expand_heuristic): Likewise.
	(ggc_min_heapsize_heuristic): Likewise.
	* ggc-page.c (ggc_collect): Likewise.
	* system.h (ONE_G): Likewise.
2020-09-21 10:09:27 +02:00
Martin Liska
79f4e20dd1 Use SIZE_AMOUNT macro for GGC memory allocation numbers.
gcc/ChangeLog:

	* ggc-common.c (ggc_prune_overhead_list): Use SIZE_AMOUNT.
	* ggc-page.c (release_pages): Likewise.
	(ggc_collect): Likewise.
	(ggc_trim): Likewise.
	(ggc_grow): Likewise.
	* timevar.c (timer::print): Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/timevar1.C: Prune more possible number values.
	* g++.dg/ext/timevar2.C: Likewise.
2020-09-21 10:09:26 +02:00
Martin Liska
432c551b17 Support new mallinfo2 function.
gcc/ChangeLog:

	* config.in: Regenerate.
	* configure: Likewise.
	* configure.ac: Detect for mallinfo2.
	* ggc-common.c (defined): Use it.
	* system.h: Handle also HAVE_MALLINFO2.
2020-09-21 10:09:26 +02:00
GCC Administrator
11da31998a Daily bump. 2020-09-21 00:16:24 +00:00
Jonathan Wakely
3c755b428e libstdc++: Fix noexcept-specifier for std::bind_front [PR 97101]
libstdc++-v3/ChangeLog:

	PR libstdc++/97101
	* include/std/functional (bind_front): Fix order of parameters
	in is_nothrow_constructible_v specialization.
	* testsuite/20_util/function_objects/bind_front/97101.cc: New test.
2020-09-21 00:17:02 +01:00
John David Anglin
363e7755f2 Fix linkage with -nodefaultlibs option.
2020-09-20  John David Anglin  < danglin@gcc.gnu.org>

gcc/ChangeLog
	* config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Delete.
	* config/pa/pa64-hpux.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise.
	(ENDFILE_SPEC): Link with libgcc_stub.a and mill.a.
	* config/pa/pa32-linux.h (ENDFILE_SPEC): Link with libgcc.a.
2020-09-20 19:37:17 +00:00
Marek Polacek
0968df43cd c++: Add test for PR90199.
Fixed by r11-2998, which fixed this ICE too.

gcc/testsuite/ChangeLog:

	PR c++/90199
	* g++.dg/cpp1y/constexpr-90199.C: New test.
2020-09-20 15:26:52 -04:00
Jan Hubicka
9044db88d6 Fix ICE during dumping in ipa-modref.
2020-09-20  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-modref.c (dump_lto_records): Fix ICE.
2020-09-20 08:19:56 +02:00
Jan Hubicka
d119f34c95 New modref/ipa_modref optimization passes
2020-09-19  David Cepelik  <d@dcepelik.cz>
	    Jan Hubicka  <hubicka@ucw.cz>

	* Makefile.in: Add ipa-modref.c and ipa-modref-tree.c.
	* alias.c: (reference_alias_ptr_type_1): Export.
	* alias.h (reference_alias_ptr_type_1): Declare.
	* common.opt (fipa-modref): New.
	* gengtype.c (open_base_files): Add ipa-modref-tree.h and ipa-modref.h
	* ipa-modref-tree.c: New file.
	* ipa-modref-tree.h: New file.
	* ipa-modref.c: New file.
	* ipa-modref.h: New file.
	* lto-section-in.c (lto_section_name): Add ipa_modref.
	* lto-streamer.h (enum lto_section_type): Add LTO_section_ipa_modref.
	* opts.c (default_options_table): Enable ipa-modref at -O1+.
	* params.opt (-param=modref-max-bases, -param=modref-max-refs,
	-param=modref-max-tests): New params.
	* passes.def: Schedule pass_modref and pass_ipa_modref.
	* timevar.def (TV_IPA_MODREF): New timevar.
	(TV_TREE_MODREF): New timevar.
	* tree-pass.h (make_pass_modref): Declare.
	(make_pass_ipa_modref): Declare.
	* tree-ssa-alias.c (dump_alias_stats): Include ipa-modref-tree.h
	and ipa-modref.h
	(alias_stats): Add modref_use_may_alias, modref_use_no_alias,
	modref_clobber_may_alias, modref_clobber_no_alias, modref_tests.
	(dump_alias_stats): Dump new stats.
	(nonoverlapping_array_refs_p): Fix formating.
	(modref_may_conflict): New function.
	(ref_maybe_used_by_call_p_1): Use it.
	(call_may_clobber_ref_p_1): Use it.
	(call_may_clobber_ref_p): Update.
	(stmt_may_clobber_ref_p_1): Update.
	* tree-ssa-alias.h (call_may_clobber_ref_p_1): Update.
2020-09-20 07:27:48 +02:00
GCC Administrator
2fe5b7d1f6 Daily bump. 2020-09-20 00:16:23 +00:00
Martin Sebor
3f9a497d1b Extend -Warray-bounds to detect out-of-bounds accesses to array parameters.
gcc/ChangeLog:

	PR middle-end/82608
	PR middle-end/94195
	PR c/50584
	PR middle-end/84051
	* gimple-array-bounds.cc (get_base_decl): New function.
	(get_ref_size): New function.
	(trailing_array): New function.
	(array_bounds_checker::check_array_ref): Call them.  Handle arrays
	declared in function parameters.
	(array_bounds_checker::check_mem_ref):  Same.  Handle references to
	dynamically allocated arrays.

gcc/testsuite/ChangeLog:

	PR middle-end/82608
	PR middle-end/94195
	PR c/50584
	PR middle-end/84051
	* c-c++-common/Warray-bounds.c: Adjust.
	* gcc.dg/Wbuiltin-declaration-mismatch-9.c: Adjust.
	* gcc.dg/Warray-bounds-63.c: New test.
	* gcc.dg/Warray-bounds-64.c: New test.
	* gcc.dg/Warray-bounds-65.c: New test.
	* gcc.dg/Warray-bounds-66.c: New test.
	* gcc.dg/Warray-bounds-67.c: New test.
2020-09-19 17:56:13 -06:00