Commit graph

174401 commits

Author SHA1 Message Date
GCC Administrator
d0683c187f Daily bump. 2020-01-26 00:16:28 +00:00
Jakub Jelinek
05107d4e4c testsuite: Fix up pr93166.C test, so that it doesn't FAIL with -std=c++98 and tests what it is supposed to test.
2020-01-26  Jakub Jelinek  <jakub@redhat.com>

	PR ipa/93166
	* g++.dg/pr93166.C: Move to ...
	* g++.dg/pr93166_0.C: ... here.  Turn it into a proper lto test.
2020-01-26 00:47:18 +01:00
Jakub Jelinek
cc74832213 testsuite: Fix up pr92788.C FAIL on ia32.
2020-01-26  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/92788
	* g++.dg/pr92788.C: Move to ...
	* g++.target/i386/pr92788.C: ... here.  Remove target from dg-do line.
	Change type of operator new's first parameter to __SIZE_TYPE__.
2020-01-26 00:32:01 +01:00
Marek Polacek
de0684bf3f c++: Poor diagnostic for dynamic_cast in constexpr context [PR93414]
I neglected to add a proper diagnostic for the reference dynamic_cast
case when the operand of a dynamic_cast doesn't refer to a public base
of Derived, resulting in suboptimal error message

   error: call to non-'constexpr' function 'void* __cxa_bad_cast()'

2020-01-25  Marek Polacek  <polacek@redhat.com>

	PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
	* constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
	dynamic_cast diagnostic.

	* g++.dg/cpp2a/constexpr-dynamic18.C: New test.
2020-01-25 14:26:07 -05:00
John David Anglin
10be08aa27 Fix missing SCNuMAX defines in inttypes.h on hpux11.[01]*
2020-01-25  John David Anglin  <danglin@gcc.gnu.org>

	* inclhack.def (hpux_c99_inttypes4): New, add missing SCNuMAX defines.
	* fixincl.x: Regenerate.
	* tests/base/inttypes.h: Update for above fix.
2020-01-25 12:20:24 -05:00
Feng Xue
98dd8c97e4 Remove assertion in get_info_about_necessary_edges
2020-01-25  Feng Xue  <fxue@os.amperecomputing.com>

        PR ipa/93166
        * ipa-cp.c (get_info_about_necessary_edges): Remove value
        check assertion.

        PR ipa/93166
        * g++.dg/pr93166.C: New test.
2020-01-25 22:18:18 +08:00
Andrew Pinski
53d172975f Fix gcc.target/aarch64/vec_zeroextend.c for big-endian
vec_zeroextend.c fails on big-endian as it assumes
0 index is the lower part but it is not for
big-endian case.  This fixes the problem by
using the correct index for the lower part
for big-endian.

Committed as obvious after a test on aarch64_be-linux-gnu.

ChangeLog:
* gcc.target/aarch64/vec_zeroextend.c: Fix for big-endian.
2020-01-25 03:38:31 -08:00
Jason Merrill
9c1179c339 c++: Fix ICE with constrained friend (PR93400).
Here, the problem was that tsubst_friend_function was modifying the
CONSTRAINT_INFO for the friend template to have the constraints for one
instantiation, which fell down when we went to adjust it for another
instantiation.  Fixed by deferring substitution of trailing requirements
until we try to check declaration matching.

	PR c++/93400 - ICE with constrained friend.
	* constraint.cc (maybe_substitute_reqs_for): New.
	* decl.c (function_requirements_equivalent_p): Call it.
	* pt.c (tsubst_friend_function): Only substitute
	TEMPLATE_PARMS_CONSTRAINTS.
	(tsubst_template_parms): Copy constraints.
2020-01-25 01:07:51 -05:00
Jason Merrill
8b91e84813 c++: Fix ICE with lambda in member operator (PR93279)
Here the problem was that we were remembering the lookup in template scope,
and then trying to reuse that lookup in the instantiation without
substituting into it at all.  The simplest solution is to not try to
remember a lookup that finds a class-scope declaration, as in that case
doing the normal lookup again at instantiation time will always find the
right declarations.

	PR c++/93279 - ICE with lambda in member operator.
	* name-lookup.c (maybe_save_operator_binding): Don't remember
	class-scope bindings.
2020-01-24 22:18:46 -05:00
GCC Administrator
c671727004 Daily bump. 2020-01-25 00:16:30 +00:00
Jeff Law
98181563dc Fix ICE due to invalid jump threading request
PR tree-optimization/92788
	* tree-ssa-threadedge.c (thread_across_edge): Check EDGE_COMPLEX
	not EDGE_ABNORMAL.

	PR tree-optimization/92788
	* g++.dg/pr92788.C: New test.
2020-01-24 17:51:19 -05:00
Jason Merrill
55dd44535d c++: Fix parameter map handling of member typedef.
any_template_parm_r was looking at the args of an alias template-id, but we
need to look at all args of a member alias/typedef, including implicit ones
from the enclosing class.

	PR c++/93377 - ICE with member alias in constraint.
	* pt.c (any_template_parm_r): Look at template arguments for all
	aliases, not only alias templates.
2020-01-24 17:22:56 -05:00
Jakub Jelinek
5d782a8d90 i386: prefer vpermilpd over vpermpd [PR93395]
In Agner Fog's tables, vpermilp[sd] with immediates seem to be
much faster than vpermpd with immediate, for a good reason,
the former only permute something within the lanes and don't do anything
intra-lane, while vpermpd can.  So, functionality-wise, vpermilpd
is more efficient subset of vpermpd.  We use the same RTL for those
though (and also for certain broadcast).

Now, the problem was that the vpermpd pattern appeared first in sse.md,
followed by the broadcast patterns, followed by the vpermilp[sd].
Which means unless -mavx -mno-avx2, we'd emit vpermpd instead of the
more efficient alternatives.

The following patch reorders them, so that vpermpd comes last, if we
can match a broadcast, we do, if we can match a vpermilp[sd] that is not a
broadcast, we will, otherwise fall back (of course only if -mavx2) to
vpermpd.

2020-01-24  Jakub Jelinek  <jakub@redhat.com>

	PR target/93395
	* config/i386/sse.md (*avx_vperm_broadcast_v4sf,
	*avx_vperm_broadcast_<mode>,
	<sse2_avx_avx512f>_vpermil<mode><mask_name>,
	*<sse2_avx_avx512f>_vpermilp<mode><mask_name>):
	Move before avx2_perm<mode>/avx512f_perm<mode>.

	* gcc.target/i386/pr93395.c: New test.
	* gcc.target/i386/avx512vl-vpermilpdi-1.c: Remove xfail.
2020-01-24 22:49:51 +01:00
Jakub Jelinek
14e5881e37 simplify-rtx: Punt for modes with precision above MAX_BITSIZE_MODE_ANY_INT [PR93376]
The following patch makes sure we punt in the 3 spots if precision is above
MAX_BITSIZE_MODE_ANY_INT.

2020-01-24  Jakub Jelinek  <jakub@redhat.com>

	PR target/93376
	* simplify-rtx.c (simplify_const_unary_operation,
	simplify_const_binary_operation): Punt for mode precision above
	MAX_BITSIZE_MODE_ANY_INT.
2020-01-24 22:47:23 +01:00
Andrew Pinski
6ccc19bd4d Decrease cortexa57_extra_costs's alu.shift_reg
Like I mentioned in https://gcc.gnu.org/ml/gcc/2020-01/msg00157.html,
The shift by a register should be just COSTS_N_INSNS (1) rather than
COSTS_N_INSNS (2).  This allows lshift_cheap_p to return true now
and converting switches to be using shift and other like
structures.  I noticed this difference when I was working
through PR 93131 and understanding what reassoc could handle.

ChangeLog:
* config/arm/aarch-cost-tables.h (cortexa57_extra_costs): Change
alu.shift_reg to 0.
2020-01-24 21:33:43 +00:00
Marek Polacek
d54a86cd92 c++: Fix ICE in tsubst_copy with parenthesized expression [PR93299]
Since e4511ca2e9 force_paren_expr can create
a VIEW_CONVERT_EXPR so that we have something to set REF_PARENTHESIZED_P
on, while not making the expression dependent.  But tsubst_copy can't cope
with such a VIEW_CONVERT_EXPR, because it's not location_wrapper_p, or
a TEMPLATE_PARM_INDEX wrapped in a VIEW_CONVERT_EXPR.

I think we need to teach tsubst_copy how to handle it.  Setting
EXPR_LOCATION_WRAPPER_P in force_paren_expr would make the ICE go away
too, but tsubst_copy would lose the REF_PARENTHESIZED_P flag.

2020-01-24  Marek Polacek  <polacek@redhat.com>

	PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
	* pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.

	* g++.dg/cpp1y/paren5.C: New test.
2020-01-24 15:44:01 -05:00
Sandra Loosemore
7c75a2a3bf Add -fdelete-null-pointer-checks to some C++ testcases.
These testcases were failing on nios2-elf, which defaults to
-fno-delete-null-pointer-checks.

2020-01-24  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* g++.dg/cpp0x/constexpr-odr1.C: Add -fdelete-null-pointer-checks.
	* g++.dg/cpp0x/constexpr-odr2.C: Likewise.
	* g++.dg/cpp0x/nontype4.C: Likewise.
	* g++.dg/cpp1y/constexpr-new.C: Likewise.
	* g++.dg/cpp1y/new1.C: Likewise.
	* g++.dg/cpp1y/new2.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic11.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic17.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic4.C: Likewise.
	* g++.dg/cpp2a/constexpr-new1.C: Likewise.
	* g++.dg/cpp2a/constexpr-new10.C: Likewise.
	* g++.dg/cpp2a/constexpr-new2.C: Likewise.
	* g++.dg/cpp2a/constexpr-new3.C: Likewise.
	* g++.dg/cpp2a/constexpr-new4.C: Likewise.
	* g++.dg/cpp2a/constexpr-new8.C: Likewise.
	* g++.dg/cpp2a/constexpr-new9.C: Likewise.
	* g++.dg/cpp2a/nontype-class1.C: Likewise.
2020-01-24 11:41:31 -08:00
Jason Merrill
28a5d5c365 c++: Unshare expressions from constexpr cache.
Another place we need to unshare cached expressions.

	PR c++/92852 - ICE with generic lambda and reference var.
	* constexpr.c (maybe_constant_value): Likewise.
2020-01-24 12:34:02 -05:00
Jason Merrill
6ad405c430 Add missing ChangeLog entry. 2020-01-24 12:34:02 -05:00
Jonathan Wakely
482eeff5f1 libstdc++: Simplify construction of comparison category types
The _Eq and _Ord enumerations can be combined into one, reducing the
number of constructors needed for the comparison category types. The
redundant equal enumerator can be removed and equivalent used in its
place. The _Less and _Greater enumerators can be renamed because 'less'
and 'greater' are already reserved names anyway.

	* libsupc++/compare (__cmp_cat::_Eq): Remove enumeration type.
	(__cmp_cat::_Ord::equivalent): Add enumerator.
	(__cmp_cat::_Ord::_Less, __cmp_cat::_Ord::_Greater): Rename to less
	and greater.
	(partial_ordering, weak_ordering, strong_ordering): Remove
	constructors taking __cmp_cat::_Eq parameters. Use renamed
	enumerators.
2020-01-24 17:17:16 +00:00
Jeff Law
64c9f2d997 Emit reasonable diagnostic rather than ICE on invalid ASM on H8 port
PR target/13721
	* config/h8300/h8300.c (h8300_print_operand): Only call byte_reg
	for REGs.  Call output_operand_lossage to get more reasonable
	diagnostics.

	PR target/13721
	* gcc.target/h8300/pr13721.c: New test.
2020-01-24 08:57:46 -07:00
Jeff Law
e6e5cd2fd7 Add PR markers for yesterday's H8 changes 2020-01-24 08:44:29 -07:00
Andrew Stubbs
f4d4a40698 Fix ICE on unsupported FP comparison
2020-01-24  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn-valu.md (vec_cmp<mode>di): Use
	gcn_fp_compare_operator.
	(vec_cmpu<mode>di): Use gcn_compare_operator.
	(vec_cmp<u>v64qidi): Use gcn_compare_operator.
	(vec_cmp<mode>di_exec): Use gcn_fp_compare_operator.
	(vec_cmpu<mode>di_exec): Use gcn_compare_operator.
	(vec_cmp<u>v64qidi_exec): Use gcn_compare_operator.
	(vec_cmp<mode>di_dup): Use gcn_fp_compare_operator.
	(vec_cmp<mode>di_dup_exec): Use gcn_fp_compare_operator.
	(vcond<VEC_ALLREG_MODE:mode><VEC_ALLREG_ALT:mode>): Use
	gcn_fp_compare_operator.
	(vcond<VEC_ALLREG_MODE:mode><VEC_ALLREG_ALT:mode>_exec): Use
	gcn_fp_compare_operator.
	(vcondu<VEC_ALLREG_MODE:mode><VEC_ALLREG_INT_MODE:mode>): Use
	gcn_fp_compare_operator.
	(vcondu<VEC_ALLREG_MODE:mode><VEC_ALLREG_INT_MODE:mode>_exec): Use
	gcn_fp_compare_operator.
2020-01-24 14:53:35 +00:00
Richard Earnshaw
612137e171 contrib: Change 'remote' for personal branches and add branch creation script
Whilst trying to convert the add vendor branch script to work with
personal branches I encountered a minor issue where git would report
ambiguous refs when checking out the new branch.

It turns out that this is because git considers <me>/<topic> to be
ambiguous if both

  refs/heads/<me>/<topic>

and

  refs/remotes/<me>/<topic>

exist in the list of known branches.

Having thought about this a bit, I think the best solution is to adopt
something more like the vendors space and call the remote users/<me>
(this also works better if you want to set up remotes to track other
users branches as well).

So this patch has two parts.

1) It updates gcc-git-customization.sh to set up the new 'remote' and
converts any existing remote and branches tracking that to the new
format
2) It adds a new script to set up a personal branch on the gcc git repository.

	* gcc-git-customization.sh: Use users/<pfx> for the personal remote
	rather than just <pfx>.  Convert any existing personal branches to the
	new remote.
	* git-add-user-branch.sh: New file.
2020-01-24 14:38:16 +00:00
Ian Lance Taylor
ba386bea11 libgo: handle --with-toolexeclibdir=.
Patch by Maciej W. Rozycki.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216239
2020-01-24 06:33:46 -08:00
Nathan Sidwell
a1f6eff20e Remove bogus __has_include controlling macro
I noticed, but ignored this code when addressing p80005, but having
fixed up defined(X) on the modules branch, I could see where it came
from, and it's obviously wrong as we've just pulled out a string
contant from the token.

	* expr.c (parse_has_include): Remove bogus controlling macro code.
2020-01-24 04:19:36 -08:00
Maciej W. Rozycki
e8e66971cd Add `--with-toolexeclibdir=' configuration option
Provide means, in the form of a `--with-toolexeclibdir=' configuration
option, to override the default installation directory for target
libraries, otherwise known as $toolexeclibdir.  This is so that it is
possible to get newly-built libraries, particularly the shared ones,
installed in a common place, so that they can be readily used by the
target system as their host libraries, possibly over NFS, without a need
to manually copy them over from the currently hardcoded location they
would otherwise be installed in.

In the presence of the `--enable-version-specific-runtime-libs' option
and for configurations building native GCC the option is ignored.

	config/
	* toolexeclibdir.m4: New file.

	gcc/
	* doc/install.texi (Cross-Compiler-Specific Options): Document
	`--with-toolexeclibdir' option.

	libada/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libatomic/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libffi/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libgcc/
	* Makefile.in (configure_deps): Add `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	libgfortran/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libgomp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libhsail-rt/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libitm/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libobjc/
	* Makefile.in (aclocal_deps): Add `toolexeclibdir.m4'.
	* aclocal.m4: Include `toolexeclibdir.m4'.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* configure: Regenerate.

	liboffloadmic/
	* plugin/configure.ac: Handle `--with-toolexeclibdir='.
	* plugin/Makefile.in: Regenerate.
	* plugin/aclocal.m4: Regenerate.
	* plugin/configure: Regenerate.
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libphobos/
	* m4/druntime.m4: Handle `--with-toolexeclibdir='.
	* m4/Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libquadmath/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libsanitizer/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

	libssp/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libstdc++-v3/
	* acinclude.m4: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	libvtv/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

	zlib/
	* configure.ac: Handle `--with-toolexeclibdir='.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2020-01-24 11:24:25 +00:00
Jan Hubicka
e3fe0070c1 libgcov: Fix merging of topn [PR92924]
PR tree-optimization/92924
	* libgcov-merge.c (merge_topn_values_set): Fix merging.
2020-01-24 12:12:17 +01:00
Christophe Lyon
ad8e2415d6 debug/92763 Fix testcase to require fopenmp
The testcase fails to link on targets without -pthread which is
implied by -fopenmp. Use dg-require-effective-target fopenmp to avoid
this problem.

2020-01-24  Christophe Lyon  <christophe.lyon@linaro.org>

	PR debug/92763
	* g++.dg/debug/pr92763.C: Require fopenmp.
2020-01-24 09:23:31 +00:00
Frederik Harwath
9e424d9749 Add missing ChangeLog entry for my last commit
libgomp/ChangeLog: Add entry for commit 4bd03ed69b.
2020-01-24 09:25:35 +01:00
Frederik Harwath
4bd03ed69b Fix expectation and types in acc_get_property tests
* Weaken expectation concerning acc_property_free_memory.
  Do not expect the value returned by CUDA since that value might have
  changed in the meantime.
* Use correct type for the results of calls to acc_get_property in tests.

libgomp/
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c
	(expect_device_properties): Remove "expected_free_mem" argument,
	change "expected_total_mem" argument type to size_t;
	change types of acc_get_property results to size_t,
	adapt format strings.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property.c:
	Use %zu instead of %zd to print size_t values.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-2.c: Adapt and
	rename to ...
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-nvptx.c: ... this.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-3.c: Adapt and
	rename to ...
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-host.c: ... this.

Reviewed-by: Thomas Schwinge  <thomas@codesourcery.com>
2020-01-24 09:14:51 +01:00
Hans-Peter Nilsson
9adea9392b doc: target.def (flags_regnum): Also mention effect on delay slot filling.
* target.def (flags_regnum): Also mention effect on delay slot filling.
* doc/tm.texi: Regenerate.

Previously only mentioned an effect on compare elimination.
2020-01-24 06:47:33 +01:00
David Malcolm
a0b935ac66 analyzer: avoid relying on system <assert.h> in testsuite (PR 93367)
PR analyzer/93367 reports a testsuite failure in abort.c on
hppa64-hp-hpux11.11 when detecting if the analyzer "knows" that the
condition holds after the assert.

The root cause is that the assertion failure function in that
configuration's <assert.h> is not marked with
__attribute__ ((__noreturn__)).

This patch reworks the test to avoid <assert.h> in favor of a custom
implementation of assert, so that the test demonstrates the idea without
relying on properties of <assert.h>.

gcc/testsuite/ChangeLog:
	PR analyzer/93367
	* gcc.dg/analyzer/abort.c: Remove include of <assert.h>.
	Replace use of assert with a custom assertion implementation.
2020-01-23 20:47:34 -05:00
GCC Administrator
472dc648ce Daily bump. 2020-01-24 00:16:25 +00:00
Ian Lance Taylor
1e156d9b21 internal/cpu: don't define CacheLinePadSize for riscv64
In libgo CacheLinePadSize is defined by the generated file cpugen.go.

Keep cpu_riscv64.go around, even though it is now empty, so that
we will pick up changes to it in future merges.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216077
2020-01-23 16:05:47 -08:00
Jeff Law
dfa075d00d Fix diagnostic text on H8.
* config/h8300/h8300.c (h8300_option_override): Fix diagnostic text.
2020-01-23 16:03:27 -07:00
Jeff Law
efe0fd930e Fix profiling issue on H8 port
* config/h8300/h8300.h (FUNCTION_PROFILER): Fix emission of
	profiling label
2020-01-23 15:55:20 -07:00
Jakub Jelinek
3a26c7b3a3 testsuite: Require lp64 target rather x86_64-*-* in pr93027.c. [PR93027]
I've noticed this test failed on x86_64-linux with -m32 or -mx32 testing,
the triplet doesn't really say which actual multilib it is, and the test
really works with lp64.

2020-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/93027
	* gcc.target/i386/pr93027.c: Require lp64 target rather x86_64-*-*.
2020-01-23 22:50:40 +01:00
Alexandre Oliva
18193e8f00 [libiberty] output empty args as a pair of quotes
writeargv writes out empty arguments in a way that expandargv skips
them instead of preserving them.  Fixed by writing out a pair of
quotes for them.


for  libiberty/ChangeLog

	* argv.c (writeargv): Output empty args as "".
2020-01-23 16:45:24 -03:00
Alexandre Oliva
f9e84b31df reject macros in math decl check
The C++ headers #undef the functions we are testing for, just in case
they're implemented as macros, so do that in the cross math decl tests
as well.


for  libstdc++-v3/ChangeLog

	* crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Reject macros.
	* configure: Rebuild.
2020-01-23 16:44:54 -03:00
Alexandre Oliva
7a900bceca tolerate padding in mbstate_t
Padding in mbstate_t objects may get the memcmp to fail.
Attempt to avoid the failure with zero initialization.


for  libstdc++-v3/ChangeLog

	* testsuite/27_io/fpos/mbstate_t/1.cc: Zero-init mbstate_t.
2020-01-23 16:36:34 -03:00
Jakub Jelinek
32667e04c7 postreload: Fix up postreload combine [PR93402]
The following testcase is miscompiled, because the postreload pass changes:
-(insn 14 13 23 2 (parallel [
-            (set (reg:DI 1 dx [94])
-                (plus:DI (reg:DI 1 dx [95])
-                    (reg:DI 5 di [92])))
-            (clobber (reg:CC 17 flags))
-        ]) "pr93402.c":8:30 186 {*adddi_1}
-     (expr_list:REG_EQUAL (plus:DI (reg:DI 5 di [92])
-            (const_int 111111111111 [0x19debd01c7]))
-        (nil)))
-(insn 23 14 25 2 (set (reg:SI 0 ax)
+(insn 23 13 25 2 (set (reg:SI 0 ax)
         (const_int 0 [0])) "pr93402.c":10:1 67 {*movsi_internal}
      (nil))
 (insn 25 23 26 2 (use (reg:SI 0 ax)) "pr93402.c":10:1 -1
      (nil))
-(insn 26 25 35 2 (use (reg:DI 1 dx)) "pr93402.c":10:1 -1
+(insn 26 25 35 2 (use (plus:DI (reg:DI 1 dx [95])
+            (reg:DI 5 di [92]))) "pr93402.c":10:1 -1
      (nil))
A USE insn is not a normal insn and verify_changes called from
apply_change_group is happy about any changes into it.
The following patch avoids this optimization if we were to change
the USE operand (this routine only changes a reg into (plus reg reg2)).

2020-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/93402
	* postreload.c (reload_combine_recognize_pattern): Don't try to adjust
	USE insns.

	* gcc.c-torture/execute/pr93402.c: New test.
2020-01-23 20:08:22 +01:00
Paolo Carlini
c91072247e Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
A rather simple ICE where we failed to properly check for concept-ids
uses in nested-name-specifiers.

Tested x86_64-linux.

       /cp
       PR c++/92804
       * parser.c (cp_parser_nested_name_specifier_opt): Properly
       diagnose concept-ids.

       /testsuite
       PR c++/92804
       * g++.dg/concepts/pr92804-1.C: New.
       * g++.dg/concepts/pr92804-2.C: New.
2020-01-23 19:28:23 +01:00
Jason Merrill
6f346913f2 c++: Avoid ICE when constant evaluation of __builtin_strchr fails.
If we can't change the argument to &"...", use the original arg instead of
the partially munged one.

	PR c++/93331 - ICE with __builtin_strchr.
	* constexpr.c (cxx_eval_builtin_function_call): Use the original
	argument if we didn't manage to extract a STRING_CST.
2020-01-23 13:11:10 -05:00
Jason Merrill
20afdcd369 c++: Fix ICE with defaulted destructor and template.
In a template we don't instantiate a deferred noexcept-spec, and we don't
need it because we aren't going to do anything with the value of
throwing_cleanup in a template anyway.

	PR c++/93345 - ICE with defaulted dtor and template.
	PR c++/33799
	* decl.c (cxx_maybe_build_cleanup): Don't try to set
	throwing_cleanup in a template.
2020-01-23 13:11:10 -05:00
David Malcolm
648796dab4 analyzer: avoid ICE with missing arguments (PR 93375)
PR analyzer/93375 reports an ICE under certain circumstances
involving a call where the number of arguments at the callsite
is less than the parameter count of the callee,

Specifically, the ICE occurs when pruning a checker_path for a
diagnostic, when attempting to maintain which expression is of
interest through such a call.

The root cause is an assumption that there were enough arguments at
the callsite, within callgraph_superedge's methods for mapping
expressions between callee and caller.

This patch adds checks for this to the relevant methods, fixing the ICE.

gcc/analyzer/ChangeLog:
	PR analyzer/93375
	* supergraph.cc (callgraph_superedge::get_arg_for_parm): Fail
	gracefully is the number of parameters at the callee exceeds the
	number of arguments at the call stmt.
	(callgraph_superedge::get_parm_for_arg): Likewise.

gcc/testsuite/ChangeLog:
	PR analyzer/93375
	* gcc.dg/analyzer/pr93375.c: New test.
2020-01-23 11:24:16 -05:00
Jason Merrill
6d00f052ef c-family: One more 40752 tweak for unsigned char.
My last patch didn't fix all the failures on unsignd char targets.  We were
missing one warning because by suppressing -Wsign-conversion for the second
operand of + we missed an overflow that we want to warn about, and we
properly don't warn about unsigned / or %.

	PR testsuite/93391 - PR 40752 test fails with unsigned plain char.
	* c-warn.c (conversion_warning): Change -Wsign-conversion handling.
	* lib/target-supports.exp (check_effective_target_unsigned_char):
	New.
2020-01-23 11:13:48 -05:00
Dragan Mladjenovic
54b3d52c3c Emit .note.GNU-stack for hard-float linux targets.
libgcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also.

gcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config.in: Regenerated.
	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to 1
	for TARGET_LIBC_GNUSTACK.
	* configure: Regenerated.
	* configure.ac: Define TARGET_LIBC_GNUSTACK if glibc version is
	found to be 2.31 or greater.
2020-01-23 17:00:03 +01:00
Dragan Mladjenovic
a3c1e1f2ff Emit .note.GNU-stack for soft-float linux targets.
gcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to
	TARGET_SOFT_FLOAT.
	* config/mips/mips.c (TARGET_ASM_FILE_END): Define to ...
	(mips_asm_file_end): New function. Delegate to
	file_end_indicate_exec_stack if NEED_INDICATE_EXEC_STACK is true.
	* config/mips/mips.h (NEED_INDICATE_EXEC_STACK): Define to 0.

libgcc/ChangeLog:

2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* config/mips/gnustack.h: New file.
	* config/mips/crti.S: Include gnustack.h.
	* config/mips/crtn.S: Likewise.
	* config/mips/mips16.S: Likewise.
	* config/mips/vr4120-div.S: Likewise.
2020-01-23 17:00:02 +01:00
Jakub Jelinek
c124b345e4 i386: Fix ICEs on TImode signed overflow add/sub patterns [PR93376]
The following testcase ICEs, because during try_combine of i3:
(insn 18 17 19 2 (parallel [
            (set (reg:CCO 17 flags)
                (eq:CCO (plus:OI (sign_extend:OI (reg:TI 96))
                        (const_int 1 [0x1]))
                    (sign_extend:OI (plus:TI (reg:TI 96)
                            (const_int 1 [0x1])))))
            (set (reg:TI 98)
                (plus:TI (reg:TI 96)
                    (const_int 1 [0x1])))
        ]) "pr93376.c":8:10 223 {*addvti4_doubleword_1}
     (expr_list:REG_UNUSED (reg:TI 98)
        (expr_list:REG_DEAD (reg:TI 96)
            (nil))))
and i2:
(insn 17 37 18 2 (set (reg:TI 96)
        (const_wide_int 0x7fffffffffffffffffffffffffffffff)) "pr93376.c":8:10 65 {*movti_internal}
     (nil))
the eq in there gets simplified into:
(eq:CCO (const_wide_int 0x080000000000000000000000000000000)
    (const_wide_int 0x80000000000000000000000000000000))
and simplify-rtx.c tries to simplify it by simplifying MINUS
of the two operands.
Now, i386 defines MAX_BITSIZE_MODE_ANY_INT to 128, because OImode
and XImode are used mainly as a placeholder for the vector modes;
these new signed overflow patterns are an exception to that,
but what they really need is just TImode precision + 1 (maybe 2 worst case)
bits at any time.

wide-int.h defines WIDE_INT_MAX_ELTS in a way that it contains one more
HWI above number of HWIs to cover WIDE_INT_MAX_ELTS, so on i386 that is
3 HWIs, meaning that TImode precision + 1/2 bits is still representable in
there.  Unfortunately, the way wi::sub_large is implemented, it needs
not just those 3 HWIs, but one HWI above the maximum of the lengths of
both operands, which means it buffer overflows, overwrites the following
precision in wide_int_storage and ICEs later on.  The need for 4 HWIs is
only temporary, because canonize immediately after it canonicalizes it
back to 3 HWIs only.

The patch is something suggested by Richard S., avoid using OImode
for this and instead use a partial int mode that is smaller.

2020-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR target/93376
	* config/i386/i386-modes.def (POImode): New mode.
	(MAX_BITSIZE_MODE_ANY_INT): Change from 128 to 160.
	* config/i386/i386.md (DPWI): New mode attribute.
	(addv<mode>4, subv<mode>4): Use <DPWI> instead of <DWI>.
	(QWI): Rename to...
	(QPWI): ... this.  Use POI instead of OI for TImode.
	(*addv<dwi>4_doubleword, *addv<dwi>4_doubleword_1,
	*subv<dwi>4_doubleword, *subv<dwi>4_doubleword_1): Use <QPWI>
	instead of <QWI>.

	* gcc.dg/pr93376.c: New test.
2020-01-23 16:17:56 +01:00