Commit Graph

167279 Commits

Author SHA1 Message Date
GCC Administrator
fe3732876f Daily bump.
From-SVN: r269336
2019-03-02 00:16:20 +00:00
Ian Lance Taylor
8ea1c33cb3 cmd/go: restore passing D to ar
This restores part of https://golang.org/cl/45695 that was
    accidentally lost in https://golang.org/cl/158019 (the update to
    Go1.12beta2).
    
    Reviewed-on: https://go-review.googlesource.com/c/164737

From-SVN: r269333
2019-03-01 22:22:18 +00:00
Jakub Jelinek
6d9fa41bae re PR middle-end/89497 (ICE caused by Segmentation Fault when compiling cups 2.2.10 with LTO flags enabled)
PR middle-end/89497
	* g++.dg/tree-prof/devirt.C: Adjust also the ilp32
	scan-tree-dump-times from dom3 to tracer pass.

From-SVN: r269332
2019-03-01 20:06:36 +01:00
Segher Boessenkool
5234d2e686 rs6000: Adapt testcases for -mdejagnu-cpu=
This is the result of these two oneliners:
perl -ni -e 'print unless /dg-skip-if "do not override -mcpu"/' \
  $(find gcc/testsuite/gcc.target/powerpc/ -type f)
perl -pi -e 's/(dg-options.*)-mcpu=/\1-mdejagnu-cpu=/'  \
  $(find gcc/testsuite/gcc.target/powerpc/ -type f)


gcc/testsuite/
	* gcc.target/powerpc/ throughout: Delete dg-skip-if "do not override
	-mcpu".  Use -mdejagnu-cpu= in dg-options instead of -mcpu=.

From-SVN: r269324
2019-03-01 19:04:31 +01:00
Segher Boessenkool
75e2b35dd0 rs6000: Add -mdejagnu-cpu=
This adds an option -mdejagnu-cpu=.  This option simply overrides what
is given in -mcpu=.  The reason for this is that with older versions
of DejaGnu the value given in the RUNTESTFLAGS will override the value
a testcase wants to have.


	* config/rs6000/rs6000.c (rs6000_option_override_internal): If
	rs6000_dejagnu_cpu_index is set, use that to override rs6000_cpu_index.
	* config/rs6000/rs6000.opt (mdejagnu-cpu=): New option.

From-SVN: r269322
2019-03-01 18:44:15 +01:00
Alexander Monakov
5055060066 haifa-sched: handle fallthru edge to EXIT block (PR 85899)
PR rtl-optimization/85899
	* haifa-sched.c (find_fallthru_edge_from): Relax assert to account for
	fallthru edges leading to the exit block.

	* gcc.dg/pr85899.c: New test.

From-SVN: r269319
2019-03-01 19:18:04 +03:00
Marek Polacek
6fe7ce18d0 PR c++/89537 - missing location for error with non-static member fn.
* call.c (resolve_args): Use EXPR_LOCATION.
	* typeck.c (build_class_member_access_expr): Use input_location.

	* g++.dg/diagnostic/member-fn-1.C: New test.

From-SVN: r269318
2019-03-01 15:57:46 +00:00
Marek Polacek
d724d2aff6 PR c++/89532 - ICE with incomplete type in decltype.
* semantics.c (finish_compound_literal): Return error_mark_node
	if digest_init_flags returns error_mark_node.

	* g++.dg/cpp2a/nontype-class14.C: New test.

From-SVN: r269317
2019-03-01 15:55:56 +00:00
Ian Lance Taylor
337f1caed6 runtime: call execname and getpagesize on Solaris
Interpreting auxv as []uintptr is incorrect on 64-bit big-endian,
    as auxv alternates a 32-bit int with a 64-bit pointer.
    
    Patch from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/c/164739

From-SVN: r269315
2019-03-01 14:21:24 +00:00
Jakub Jelinek
1259cb6d00 Implement P1002R1, Try-catch blocks in constexpr functions PR c++/89513
Implement P1002R1, Try-catch blocks in constexpr functions
	PR c++/89513
	* parser.c (cp_parser_ctor_initializer_opt_and_function_body):
	Diagnose constexpr ctor or function with function-try-block with
	pedwarn for c++17 and earlier.  Formatting fix.
	(cp_parser_try_block): Use pedwarn instead of error and only for
	c++17 and earlier when try block appears in constexpr function.
	* constexpr.c (build_constexpr_constructor_member_initializers):
	Handle TRY_BLOCK here instead of erroring on it.

	* g++.dg/cpp2a/constexpr-try1.C: New test.
	* g++.dg/cpp2a/constexpr-try2.C: New test.
	* g++.dg/cpp2a/constexpr-try3.C: New test.
	* g++.dg/cpp2a/constexpr-try4.C: New test.
	* g++.dg/cpp2a/constexpr-try5.C: New test.
	* g++.dg/cpp0x/constexpr-ctor10.C: Don't expect error for C++2a.

From-SVN: r269314
2019-03-01 15:20:03 +01:00
Jonathan Wakely
c5effe9673 Fix test memory_resource to work without sized deallocation
The checking memory_resource in the testsuite assumes sized deallocation
is supported, which might not be true for other compilers.

	* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource)
	[!__cpp_sized_deallocation]: Do not pass size to operator delete.

From-SVN: r269312
2019-03-01 13:50:41 +00:00
Jonathan Wakely
987bbe48bb C++2a Utility functions to implement uses-allocator construction (P0591R4)
* include/std/memory (uses_allocator_construction_args): New set of
	overloaded functions.
	(make_obj_using_allocator, uninitialized_construct_using_allocator):
	New functions.
	* include/std/memory_resource (polymorphic_allocator::construct)
	[__cplusplus > 201703l]: Replace all overloads with a single function
	using uses_allocator_construction_args.
	* testsuite/20_util/polymorphic_allocator/construct_c++2a.cc: New
	test.
	* testsuite/20_util/uses_allocator/make_obj.cc: New test.

From-SVN: r269311
2019-03-01 13:50:36 +00:00
Tamar Christina
1ccd849351 AArch64: Make every option in options.def one line
Due to config.gcc all the options need to be on one line because of the grep
lines which would select only the first line of the option.

This causes it not to select the right bits on options that are spread over
multiple lines when the --with-arch configure option is used.  The issue happens
silently and you just get a compiler with an incorrect set of default flags.

This solution just collapses everything back to one line as they were in GCC7.
Unfortunately this does make some lines quite long.

I do have an alternate patch which used the pre-processors to first flatten the
file in config.gcc.  I will send that one out for GCC 10.

gcc/ChangeLog:

	PR target/89517
	* config/aarch64/aarch64-option-extensions.def (fp, simd, crypto, fp16,
	rdma, dotprod, sha2, sha3, sm4, fp16fml, sve): Collapse line.

From-SVN: r269309
2019-03-01 13:34:14 +00:00
Richard Sandiford
f2d040abea Fix mask type choice in vectorizable_call (PR 89535)
This is another case in which we were failing to pass the expected
mask vector type to vect_get_vec_def_for_operand.

2019-02-28  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/89535
	* tree-vect-stmts.c (vectorizable_call): Record the vector types
	for each operand.  Calculate the fallback choice for mask operands
	and pass it to vect_get_vec_def_for_operand.

gcc/testsuite/
	PR tree-optimization/89535
	* gfortran.dg/vect/pr89535.f90: New test.

From-SVN: r269308
2019-03-01 13:05:40 +00:00
Richard Biener
22fe0312b3 re PR tree-optimization/89541 (ICE in VN_INFO(tree_node*))
2019-03-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/89541
	* tree-ssa-operands.c (add_stmt_operand): CONST_DECL may
	get virtual operands.
	(get_expr_operands): Handle CONST_DECL like other decls.

	* gfortran.dg/pr89451.f90: New testcase.

From-SVN: r269307
2019-03-01 12:52:19 +00:00
Iain Buclaw
9503d7b1ff d/dmd: Merge dmd upstream ed71446aa
Backports support for extern(C++, "namespace"), which makes the
core.stdcpp package compilable.

Added predefined condition for CppRuntime_Gcc unconditionally, as it is
unlikely that D code will be linking to anything other than libstdc++
when extern(C++) is used.

Reviewed-on: https://github.com/dlang/dmd/pull/9371

gcc/d/ChangeLog:

2019-03-01  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.cc (d_init_versions): Add CppRuntime_Gcc as predefined
	version condition.

From-SVN: r269304
2019-03-01 10:21:54 +00:00
Jakub Jelinek
c6b363486f re PR middle-end/89503 (Checking ICE in 'gcc.dg/warn-strlen-no-nul.c')
PR middle-end/89503
	* fold-const.c (fold_checksum_tree): Ignore TREE_NO_WARNING bit
	on DECL_P and EXPR_P.

From-SVN: r269303
2019-03-01 10:26:40 +01:00
Richard Biener
d7a700e0a7 re PR middle-end/89497 (ICE caused by Segmentation Fault when compiling cups 2.2.10 with LTO flags enabled)
2019-03-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/89497
	* tree-cfgcleanup.h (cleanup_tree_cfg): Add SSA update flags
	argument, defaulted to zero.
	* passes.c (execute_function_todo): Pass down SSA update flags
	to cleanup_tree_cfg.
	* tree-cfgcleanup.c: Include tree-into-ssa.h and tree-cfgcleanup.h.
	(cleanup_tree_cfg_noloop): After cleanup_control_flow_pre update SSA
	form if requested.
	(cleanup_tree_cfg): Get and pass down SSA update flags.

	* gcc.dg/tree-ssa/reassoc-43.c: Avoid false match in regex.
	* g++.dg/tree-prof/devirt.C: Scan tracer dump for foldings
	that happen now earlier.

From-SVN: r269302
2019-03-01 09:21:30 +00:00
Jakub Jelinek
743f0ba244 re PR bootstrap/89539 (gcc fails to build/bootstrap on MACOSX)
PR bootstrap/89539
	* dwarf2out.c (output_comdat_type_unit): Add ATTRIBUTE_UNUSED to
	early_lto_debug argument.

From-SVN: r269301
2019-03-01 09:10:19 +01:00
Ian Lance Taylor
2bf2aa34d1 re PR go/89406 (Go testing leaves many temporary directories in /tmp around)
PR go/89406
	* Makefile.am (GOTOOLS_TEST_TIMEOUT): Double.
	* Makefile.in: Regenerate.

From-SVN: r269300
2019-03-01 05:25:36 +00:00
Ian Lance Taylor
3eba09884e cmd/go: add -O2 to invocation of gccgo
When using the go tool with gccgo, this changes the default
    compilation to use -O2.  The -gccgoflags option can be used to
    override this default.  I think this change better corresponds to what
    people expect when using the go tool.
    
    Reviewed-on: https://go-review.googlesource.com/c/164378

From-SVN: r269299
2019-03-01 01:23:09 +00:00
Ian Lance Taylor
5b2eaa1170 commit 66ac9466852d11e968f8fd2ad6ffc7386cee49e1
gotest: avoid using echo inside $()
    
    The handling of newlines is not portable between bash and ksh.
    
    Reviewed-on: https://go-review.googlesource.com/c/164597

From-SVN: r269298
2019-03-01 01:03:54 +00:00
GCC Administrator
1e15758224 Daily bump.
From-SVN: r269297
2019-03-01 00:16:34 +00:00
Jason Merrill
2eb409c65a * g++.dg/cpp1z/fold-lambda3.C: Add test for 88183.
From-SVN: r269294
2019-02-28 19:10:28 -05:00
Jason Merrill
aaa6a4664b PR c++/88183 - ICE with .* fold-expression.
build_m_component_ref can't handle type-dependent operands, so let's use the
default case; tsubst_copy_and_build also uses build_x_binary_op for
substituting a DOTSTAR_EXPR.

	* pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.

From-SVN: r269293
2019-02-28 19:08:58 -05:00
Jason Merrill
1eb7a0850b PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
* class.c, lambda.c, pt.c: Revert earlier change.
	* lambda.c (add_capture): Don't special-case capture of dependent
	VLA.

From-SVN: r269292
2019-02-28 19:08:21 -05:00
Jason Merrill
fbfef5060f * name-lookup.c (print_binding_level): Print this_entity.
From-SVN: r269291
2019-02-28 19:07:29 -05:00
Eric Botcazou
85222504cc re PR tree-optimization/89536 (wrong code at -Os and above on x86_64-linux-gnu)
PR tree-optimization/89536
	* tree-ssa-dom.c (edge_info::derive_equivalences) <BIT_NOT_EXPR>: Test
	only whether bit #0 of the value is 0 instead of the entire value.

From-SVN: r269289
2019-02-28 23:03:01 +00:00
Marek Polacek
cc284d9cf7 PR c++/87068 - missing diagnostic with fallthrough statement.
* gimplify.c (expand_FALLTHROUGH_r): If IFN_FALLTHROUGH was found
	at the end of a seq, save its location to walk_stmt_info.
	(expand_FALLTHROUGH): Warn if IFN_FALLTHROUGH is at the end of
	a switch.

	* c-c++-common/Wimplicit-fallthrough-37.c: New test.

From-SVN: r269288
2019-02-28 22:29:42 +00:00
Thomas Schwinge
80d6ca0184 [PR72741, PR89433] Repeated use of the Fortran OpenACC 'routine' directive
gcc/fortran/
	PR fortran/72741
	PR fortran/89433
	* openmp.c (gfc_match_oacc_routine): Handle repeated use of the
	Fortran OpenACC 'routine' directive.
	gcc/testsuite/
	PR fortran/72741
	PR fortran/89433
	* gfortran.dg/goacc/routine-multiple-directives-1.f90: New file.
	* gfortran.dg/goacc/routine-multiple-directives-2.f90: Likewise.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r269287
2019-02-28 21:31:36 +01:00
Thomas Schwinge
e5fd6684b9 [PR72741] For all Fortran OpenACC 'routine' directive variants check for multiple clauses specifying the level of parallelism
gcc/fortran/
	PR fortran/72741
	* gfortran.h (enum oacc_routine_lop): Add OACC_ROUTINE_LOP_ERROR.
	* openmp.c (gfc_oacc_routine_lop, gfc_match_oacc_routine): Use it.
	* trans-decl.c (add_attributes_to_decl): Likewise.
	gcc/testsuite/
	PR fortran/72741
	* gfortran.dg/goacc/routine-multiple-lop-clauses-1.f90: New file.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r269286
2019-02-28 21:31:23 +01:00
Thomas Schwinge
6f87db2d78 [PR72741, PR89433] Accept intrinsic symbols in Fortran OpenACC 'routine' directives
gcc/fortran/
	PR fortran/72741
	PR fortran/89433
	* openmp.c (gfc_match_oacc_routine): Accept intrinsic symbols.
	gcc/testsuite/
	PR fortran/72741
	PR fortran/89433
	* gfortran.dg/goacc/routine-6.f90: Update
	* gfortran.dg/goacc/routine-intrinsic-1.f: New file.
	* gfortran.dg/goacc/routine-intrinsic-2.f: Likewise.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r269285
2019-02-28 21:31:01 +01:00
Jason Merrill
80f52b400e PR c++/88049 - ICE with undefined destructor and anon namespace.
A type in an anonymous namespace can never be merged with one from
another translation unit, so a member of such a type is always its own
prevailing decl.

	* lto-symtab.c (lto_symtab_prevailing_virtual_decl): Return early
	for a type in an anonymous namespace.

From-SVN: r269283
2019-02-28 12:29:48 -05:00
Jan Hubicka
6b7e4afbdc re PR lto/88585 (ICE in fld_incomplete_type_of, at tree.c:5295)
PR lto/88585
	* tree.c (find_atomic_core_type): Move ahead in file.
	(check_base_type): Correctly compare alignments of atomic types.

From-SVN: r269282
2019-02-28 16:45:44 +00:00
H.J. Lu
0c0c7049a0 i386: Identify Westmere from PCLMUL
Since AES has been removed from Westmere in GCC 9, we should identify
Westmere from PCLMUL, instead of AES.

	PR target/89455
	* config/i386/i386.c (get_builtin_code_for_version): Identify
	Westmere from PCLMUL, instead of AES.

From-SVN: r269281
2019-02-28 06:24:52 -08:00
Jakub Jelinek
8bd326535c re PR c/89521 (ICE in expand_builtin_int_roundingfn, at builtins.c:2697)
PR c/89521
	* gcc.dg/pr89521-1.c: New test.
	* gcc.dg/pr89521-2.c: New test.

From-SVN: r269280
2019-02-28 14:49:38 +01:00
John David Anglin
3267971840 Fix test-case visibility (PR testsuite/89441).
2019-02-28  John David Anglin  <danglin@gcc.gnu.org>

	PR testsuite/89441
	* g++.dg/ipa/pr89009.C: Update symbol visibility.

From-SVN: r269278
2019-02-28 13:17:09 +00:00
Jakub Jelinek
ad7abff56e re PR target/89434 (wrong code with -Og and __builtin_mul_overflow())
PR target/89434
	* config/arm/arm.md (*subsi3_carryin_compare_const): Use
	trunc_int_for_mode (-INTVAL (...), SImode), just instead of
	-UINTVAL (...).

From-SVN: r269277
2019-02-28 14:13:33 +01:00
Tamar Christina
29c6debccf AArch64: Have empty HWCAPs string ignored during native feature detection
This patch makes the feature detection code for AArch64 GCC not add features
automatically when the feature had no hwcaps string to match against.

This means that -mcpu=native no longer adds feature flags such as +profile.
The behavior wasn't noticed before because at the time +profile was added a bug
was preventing any feature bits from being added by native detections.

The loop has also been changed as Jakub specified in order to avoid a memory
leak that was present in the existing code and to be slightly more efficient.

gcc/ChangeLog:

	PR target/88530
	* config/aarch64/aarch64-option-extensions.def: Document it.
	* config/aarch64/driver-aarch64.c (host_detect_local_cpu): Skip feature
	if empty hwcaps.

gcc/testsuite/ChangeLog:

	PR target/88530
	* gcc.target/aarch64/options_set_10.c: New test.

From-SVN: r269276
2019-02-28 10:43:41 +00:00
Paolo Carlini
ee8b2b8ea4 re PR c++/89522 (ICE: trying to capture 'f' in instantiation of generic lambda)
2019-02-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/89522
	* g++.dg/cpp1y/lambda-generic-ice10.C: New.

From-SVN: r269275
2019-02-28 10:27:03 +00:00
Jakub Jelinek
66dcb747e8 re PR c/89525 (inform messages from -Wbuiltin-declaration-mismatch even with -w)
PR c/89525
	* c-typeck.c (convert_arguments): Call inform_declaration only if
	the previous warning_at call returned true.

	* gcc.dg/pr89525.c: New test.

From-SVN: r269274
2019-02-28 08:17:49 +01:00
Jakub Jelinek
c2df3c99d5 re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 operands in convert_to_integer_1, at convert.c:668)
PR c/89520
	* convert.c (convert_to_real_1, convert_to_integer_1): Punt for
	builtins if they don't have a single scalar floating point argument.
	Formatting fixes.

	* gcc.dg/pr89520-1.c: New test.
	* gcc.dg/pr89520-2.c: New test.

From-SVN: r269273
2019-02-28 08:16:38 +01:00
Ian Lance Taylor
b0cf10e423 libgo: fix go_export extraction on Darwin
On Darwin, the section name is prefixed with the segment name, __GNU_GO.
    
    Reviewed-on: https://go-review.googlesource.com/c/151097

From-SVN: r269271
2019-02-28 01:01:46 +00:00
GCC Administrator
d0cdfae5ed Daily bump.
From-SVN: r269270
2019-02-28 00:16:16 +00:00
Marek Polacek
294a3e20e5 PR c++/88857 - ICE with value-initialization of argument in template.
* call.c (convert_like_real): Don't call build_value_init in template.

	* g++.dg/cpp0x/initlist-value4.C: New test.

From-SVN: r269267
2019-02-28 00:07:06 +00:00
Ian Lance Taylor
cba8a572c2 re PR go/89172 (FAIL: runtime/pprof)
PR go/89172
    internal/cpu, runtime, runtime/pprof: handle function descriptors
    
    When using PPC64 ELF ABI v1 a function address is not a PC, but is the
    address of a function descriptor.  The first field in the function
    descriptor is the actual PC (see
    http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#FUNC-DES).
    The libbacktrace library knows about this, and libgo uses actual PC
    values consistently except for the helper function funcPC that appears
    in both runtime and runtime/pprof.
    
    This patch fixes funcPC by recording, in the internal/cpu package,
    whether function descriptors are being used.  We have to check for
    function descriptors using a C compiler check, because GCC can be
    configured using --with-abi to select the ELF ABI to use.
    
    Fixes https://gcc.gnu.org/PR89172
    
    Reviewed-on: https://go-review.googlesource.com/c/162978

From-SVN: r269266
2019-02-27 22:35:10 +00:00
Jason Merrill
e6df04c105 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
Here, the problem was that extract_local_specs wasn't seeing that we use
'self' inside the lambda in the else of the inner constexpr if, because we
don't walk into lambda bodies and we didn't capture it in the lambda because
'self' is still dependent.  Marek recently changed process_outer_var_ref to
do more implicit capture in templates; this example shows that we should
always capture non-packs, so that we can continue to not walk into lambda
bodies.  We do walk into lambda bodies for pack expansions, so we can delay
deciding whether we're capturing a single element or the entire pack.

Immediately capturing a VLA means we need to create a dependent VLA capture
type, and not in the context of the lambda op(), since trying to look up the
instantiation of the op() while we're substituting into the capture list
would crash.  So I force TYPE_CONTEXT and the binding level out to the
enclosing function before pushtag, avoid adding a TAG_DEFN, and instead
force the type to be complete in tsubst_lambda_expr.

	* semantics.c (process_outer_var_ref): Do capture dependent vars.
	* class.c (finish_struct): Only add TAG_DEFN if T is in
	current_function_decl.
	* lambda.c (vla_capture_type): Force the capture type out into the
	lambda's enclosing function.
	(add_capture): Pass in the lambda.
	* pt.c (tsubst_lambda_expr): complete_type a VLA capture type.

From-SVN: r269265
2019-02-27 16:54:25 -05:00
Bernd Edlinger
5b0a9c7cc1 re PR rtl-optimization/89490 (char array constant put in string merge section)
2019-02-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR rtl-optimization/89490
        * varasm.c (get_block_for_section): Bail out for mergeable sections.
        (default_use_anchors_for_symbol_p, output_object_block): Assert the
        block section is not mergeable.

From-SVN: r269264
2019-02-27 20:14:55 +00:00
Marek Polacek
867a4ad28e PR c++/89511 - ICE with using-declaration and unscoped enumerator.
* parser.c (cp_parser_using_declaration): For an unscoped enum
	only use its context if it's not a function declaration.

	* g++.dg/cpp0x/using-enum-3.C: New test.

From-SVN: r269262
2019-02-27 19:07:18 +00:00
Jakub Jelinek
ec30291038 re PR target/70341 (cost model for addresses is incorrect, slsr is using reg + reg + CST for arm)
PR target/70341
	* config/aarch64/aarch64.md (casesi): Create the casesi_dispatch
	MEM manually here, set MEM_READONLY_P and MEM_NOTRAP_P on it.

From-SVN: r269260
2019-02-27 19:11:26 +01:00