- Jan 09, 2019
-
-
Jakub Jelinek authored
PR rtl-optimization/88331 * function.c (assign_stack_local_1): Don't set dynamic_align_addr if not currently_expanding_to_rtl. * gcc.target/i386/pr88331.c: New test. From-SVN: r267758
-
Jonathan Wakely authored
The IBM128 long double format isn't foldable in constant expressions, so conditionally skip the std::complex<long double> cases when they'll fail. PR libstdc++/88204 * testsuite/26_numerics/complex/operators/more_constexpr.cc: Do not test std::complex<long double> if long double format is IBM128. * testsuite/26_numerics/complex/requirements/more_constexpr.cc: Likewise. From-SVN: r267757
-
Paolo Carlini authored
/cp 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (grok_reference_init): Improve error location. (grokdeclarator): Likewise, improve two locations. /testsuite 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/constexpr2.C: New. * g++.dg/diagnostic/ref3.C: Likewise. From-SVN: r267756
-
Eric Botcazou authored
* doc/invoke.texi (-Os): Remove trailing spaces. (-finline-functions): Remove reference to -O2. From-SVN: r267753
-
Sebastian Huber authored
libgomp/ * config/rtems/bar.c: Include "../linux/bar.c" and delete copy and paste code. From-SVN: r267752
-
Sebastian Huber authored
libgomp/ * config/rtems/affinity-fmt.c: New file. Include affinity-fmt.c, undefining HAVE_GETPID and HAVE_GETHOSTNAME, and mapping fwrite to write. From-SVN: r267751
-
GCC Administrator authored
From-SVN: r267750
-
Tom de Vries authored
Const int is handled differently at -O0 for -xc and -xc++, which can cause noise in testsuite/libgomp.oacc-c-c++-common test-cases (which are both run for c and c++) if const int is used for launch dimensions. Fix this by using #defines instead. 2019-01-09 Tom de Vries <tdevries@suse.de> PR target/88756 * testsuite/libgomp.oacc-c-c++-common/reduction-1.c (ng, nw, vl): Use #define instead of "const int". * testsuite/libgomp.oacc-c-c++-common/reduction-2.c (ng, nw, vl): Same. * testsuite/libgomp.oacc-c-c++-common/reduction-3.c (ng, nw, vl): Same. * testsuite/libgomp.oacc-c-c++-common/reduction-4.c (ng, nw, vl): Same. * testsuite/libgomp.oacc-c-c++-common/reduction-5.c (ng, nw, vl): Same. From-SVN: r267747
-
Tom de Vries authored
When using a compiler build with: ... +#define PTX_DEFAULT_VECTOR_LENGTH PTX_CTA_SIZE +#define PTX_MAX_VECTOR_LENGTH PTX_CTA_SIZE ... and running the libgomp testsuite, we run into an execution failure in parallel-loop-1.c, due to a cuda launch failure: ... nvptx_exec: kernel f6_none_none$_omp_fn$0: launch gangs=480, workers=0, \ vectors=1024 libgomp: cuLaunchKernel error: invalid argument ... because workers == 0. The workers variable is set to 0 here in nvptx_exec: ... workers = blocks / actual_vectors; ... because actual_vectors is 1024, and blocks is 768: ... cuOccupancyMaxPotentialBlockSize: grid = 10, block = 768 ... Fix this by ensuring that workers is at least one. 2019-01-09 Tom de Vries <tdevries@suse.de> * plugin/plugin-nvptx.c (nvptx_exec): Make sure to launch with at least one worker. From-SVN: r267746
-
Ian Lance Taylor authored
Slice value expression has backend type a struct of a pointer and two ints. Make sure the len and cap are converted to int when creating slice value expression. Reviewed-on: https://go-review.googlesource.com/c/156897 From-SVN: r267745
-
- Jan 08, 2019
-
-
Marek Polacek authored
PR c++/88744 * g++.dg/cpp2a/nontype-class12.C: New test. From-SVN: r267744
-
Jonathan Wakely authored
Test that StdUniquePtrPrinter correctly prints std::unique_ptr objects using the old layout, prior to the PR libstdc++/77990 changes. The printer test for a valueless std::variant started to fail because the PR libstdc++/87431 fix meant it no longer became valueless. Change the test to use a type that is not trivially copyable, so that the exception causes it to become valueless. * testsuite/libstdc++-prettyprinters/compat.cc: Test printer support for old std::unique_ptr layout. * testsuite/libstdc++-prettyprinters/cxx17.cc: Fix std::variant test to become valueless. Add filesystem::path tests. From-SVN: r267743
-
Jonathan Wakely authored
When the contained value is not trivially copy (or move) constructible the union's copy (or move) constructor will be deleted, and so the _Optional_payload delegating constructors are invalid. G++ fails to diagnose this because it incorrectly performs copy elision in the delegating constructors. Clang does diagnose it (llvm.org/PR40245). The solution is to avoid performing any copy (or move) when the contained value's copy (or move) constructor isn't trivial. Instead the contained value can be constructed by calling _M_construct. This is OK, because the relevant constructor doesn't need to be constexpr when the contained value isn't trivially copy (or move) constructible. Additionally, this patch removes a lot of code duplication in the _Optional_payload partial specializations and the _Optional_base partial specialization, by hoisting it into common base classes. The Python pretty printer for std::optional needs to be adjusted to support the new layout. Retain support for the old layout, and add a test to verify that the support still works. PR libstdc++/87855 * include/std/optional (_Optional_payload_base): New class template for common code hoisted from _Optional_payload specializations. Use a template for the union, to allow a partial specialization for types with non-trivial destructors. Add constructors for in-place initialization to the union. (_Optional_payload(bool, const _Optional_payload&)): Use _M_construct to perform non-trivial copy construction, instead of relying on non-standard copy elision in a delegating constructor. (_Optional_payload(bool, _Optional_payload&&)): Likewise for non-trivial move construction. (_Optional_payload): Derive from _Optional_payload_base and use it for everything except the non-trivial assignment operators, which are defined as needed. (_Optional_payload<false, C, M>): Derive from the specialization _Optional_payload<true, false, false> and add a destructor. (_Optional_base_impl::_M_destruct, _Optional_base_impl::_M_reset): Forward to corresponding members of _Optional_payload. (_Optional_base_impl::_M_is_engaged, _Optional_base_impl::_M_get): Hoist common members from _Optional_base. (_Optional_base): Make all members and base class public. (_Optional_base::_M_get, _Optional_base::_M_is_engaged): Move to _Optional_base_impl. * python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Add support for new std::optional layout. * testsuite/libstdc++-prettyprinters/compat.cc: New test. From-SVN: r267742
-
Marek Polacek authored
* parser.c (cp_parser_template_argument): Handle braced-init-list when in C++20. * g++.dg/cpp2a/nontype-class11.C: New test. From-SVN: r267741
-
Jakub Jelinek authored
PR rtl-optimization/79593 * config/i386/i386.md (reg = mem; mem = reg): New define_peephole2. From-SVN: r267740
-
Jakub Jelinek authored
PR target/88457 * gcc.target/powerpc/pr88457.c: Remove -m32, -c and -mcpu=e300c3 from dg-options. Require ppc_cpu_supports_hw effective target instead of powerpc64*-*-*. From-SVN: r267739
-
Jakub Jelinek authored
* config/rs6000/rs6000.c (rs6000_delegitimize_address): Delegitimize UNSPEC_FUSION_GPR to its argument. Formatting fixes. From-SVN: r267738
-
Janus Weil authored
2019-01-08 Janus Weil <janus@gcc.gnu.org> PR fortran/88047 * class.c (gfc_find_vtab): For polymorphic typespecs, the components of the class container may not be available (in case of invalid code). 2019-01-08 Janus Weil <janus@gcc.gnu.org> PR fortran/88047 * gfortran.dg/class_69.f90: New test case. From-SVN: r267735
-
Eric Botcazou authored
PR bootstrap/88721 * config/sparc/sparc.c (function_arg_slotno): Set *PPREGNO & *PPADDING to -1 on entry. PR debug/88723 * config/sparc/sparc.c (sparc_delegitimize_address): Deal with naked UNSPECs and UNSPEC_MOVE_GOTDATA specifically. From-SVN: r267734
-
H.J. Lu authored
There is no need to generate vzeroupper if caller passes arguments in AVX/AVX512 registers. Tested on i686 and x86-64 with and without --with-arch=native. gcc/ PR target/88717 * config/i386/i386.c (ix86_avx_u128_mode_exit): Call ix86_avx_u128_mode_entry. gcc/testsuite/ PR target/88717 * gcc.target/i386/pr88717.c: New test. From-SVN: r267732
-
Marek Polacek authored
* parser.c (cp_debug_parser): Adjust printing of local_variables_forbidden_p. (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false. (cp_parser_primary_expression): When checking local_variables_forbidden_p, use THIS_FORBIDDEN or LOCAL_VARS_FORBIDDEN. (cp_parser_lambda_body): Update the type of local_variables_forbidden_p. Set it to 0 rather than false. (cp_parser_condition): Adjust call to cp_parser_declarator. (cp_parser_explicit_instantiation): Likewise. (cp_parser_init_declarator): Likewise. (cp_parser_declarator): New parameter. Use it. (cp_parser_direct_declarator): New parameter. Use it to set local_variables_forbidden_p. Adjust call to cp_parser_declarator. (cp_parser_type_id_1): Adjust call to cp_parser_declarator. (cp_parser_parameter_declaration): Likewise. (cp_parser_default_argument): Update the type of local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN rather than true. (cp_parser_member_declaration): Tell cp_parser_declarator if we saw 'static' or 'friend'. (cp_parser_exception_declaration): Adjust call to cp_parser_declarator. (cp_parser_late_parsing_default_args): Update the type of local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN rather than true. (cp_parser_cache_defarg): Adjust call to cp_parser_declarator. (cp_parser_objc_class_ivars): Likewise. (cp_parser_objc_struct_declaration): Likewise. (cp_parser_omp_for_loop_init): Likewise. * parser.h (cp_parser): Change the type of local_variables_forbidden_p to unsigned char. (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN): Define. * g++.dg/cpp0x/this1.C: New test. From-SVN: r267731
-
Martin Liska authored
2019-01-08 Martin Liska <mliska@suse.cz> PR tree-optimization/88753 * tree-switch-conversion.c (switch_conversion::build_one_array): Come up with local variable constructor. Convert first to type of constructor values. 2019-01-08 Martin Liska <mliska@suse.cz> PR tree-optimization/88753 * gcc.dg/tree-ssa/pr88753.c: New test. From-SVN: r267728
-
Jonathan Wakely authored
Using #include "..." to include a header in the same directory fails if the user compiles with -I-, so always use something like <bits/...> for internal headers. I haven't added tests for this, because dg-options adds options to the end, and the position of -I- matters (if it's at the end then the tests won't find any headers in the build tree, as they're specified by -I options earlier in the flags). It's been manually tested though. PR libstdc++/88066 * include/bits/locale_conv.h: Use <> for includes not "". * include/ext/random: Likewise. * include/ext/vstring.h: Likewise. From-SVN: r267726
-
Richard Biener authored
2019-01-08 Richard Biener <rguenther@suse.de> PR tree-optimization/86554 * tree-ssa-sccvn.c (eliminate_dom_walker, rpo_elim, rpo_avail): Move earlier. (visit_nary_op): When value-numbering to expressions with different overflow behavior make sure there's an available expression on the path. * gcc.dg/torture/pr86554-1.c: New testcase. * gcc.dg/torture/pr86554-2.c: Likewise. From-SVN: r267725
-
Rainer Orth authored
* config/abi/pre/gnu.ver (GLIBCXX_3.4): Tighten existing patterns. (GLIBCXX_3.4.21): Likewise. From-SVN: r267723
-
Paolo Carlini authored
2019-01-08 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/thread1.C: Tweak expected error #line 13 to cover target variance. From-SVN: r267722
-
Richard Biener authored
2019-01-08 Richard Biener <rguenther@suse.de> PR fortran/88611 * trans-expr.c (gfc_conv_initializer): For ISOCBINDING_NULL_* directly build the expected GENERIC tree. * gfortran.dg/pr88611.f90: New testcase. From-SVN: r267721
-
Sam Tebbs authored
gcc/ChangeLog: 2019-01-08 Sam Tebbs <sam.tebbs@arm.com> * config/aarch64/aarch64.c (BRANCH_PROTECT_STR_MAX, aarch64_parse_branch_protection, struct aarch64_branch_protect_type, aarch64_handle_no_branch_protection, aarch64_handle_standard_branch_protection, aarch64_validate_mbranch_protection, aarch64_handle_pac_ret_protection, aarch64_handle_attr_branch_protection, accepted_branch_protection_string, aarch64_pac_ret_subtypes, aarch64_branch_protect_types, aarch64_handle_pac_ret_leaf): Define. (aarch64_override_options_after_change_1, aarch64_override_options): Add check for accepted_branch_protection_string. (aarch64_option_save): Save accepted_branch_protection_string. (aarch64_option_restore): Save accepted_branch_protection_string. * config/aarch64/aarch64.c (aarch64_attributes): Add branch-protection. * config/aarch64/aarch64.opt: Add mbranch-protection. Deprecate msign-return-address. * doc/invoke.texi: Add mbranch-protection. gcc/testsuite/Changelog: 2019-01-08 Sam Tebbs <sam.tebbs@arm.com> * gcc.target/aarch64/(return_address_sign_1.c, return_address_sign_2.c, return_address_sign_3.c (__attribute__)): Change option to -mbranch-protection. * gcc.target/aarch64/(branch-protection-option.c, branch-protection-option-2.c, branch-protection-attr.c, branch-protection-attr-2.c): New file. From-SVN: r267717
-
Jonathan Wakely authored
PR libstdc++/88749 * src/filesystem/ops.cc (last_write_time): Fix preprocessor condition to match the one that controls whether utimbuf and utime are declared. From-SVN: r267705
-
Pierre-Marie de Rodat authored
From-SVN: r267683
-
Justin Squirek authored
Following the discovery of regressions in GPRbuild, this reverts both r263100 and r264608: 2019-01-08 Justin Squirek <squirek@adacore.com> Revert: 2018-07-31 Justin Squirek <squirek@adacore.com> gcc/ada/ * lib-writ.adb (Write_With_Lines): Modfiy the generation of dependencies within ali files so that source unit bodies are properly listed even if said bodies are missing. Perform legacy behavior in GNATprove mode. * lib-writ.ads: Modify documentation to reflect current behavior. and: 2018-09-26 Justin Squirek <squirek@adacore.com> gcc/ada/ * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add documentation and an extra conditional check for RCI units so that generated ali files will list the spec only instead of a body when a body is not found. From-SVN: r267680
-
Paolo Carlini authored
/cp 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (start_decl): Improve permerror location. /testsuite 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/out-of-class-redeclaration.C: New. From-SVN: r267675
-
Iain Sandoe authored
2019-01-08 Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ * c-c++-common/builtin-has-attribute-3.c: Skip tests requiring symbol alias support. * c-c++-common/builtin-has-attribute-4.c: Likewise. Append match for warning that ‘protected’ attribute is not supported. From-SVN: r267674
-
Iain Sandoe authored
2019-01-08 Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ * gcc.dg/Wmissing-attributes.c: Require alias support. * gcc.dg/attr-copy-2.c: Likewise. * gcc.dg/attr-copy-5.c: Likewise. From-SVN: r267673
-
Jonathan Wakely authored
PR c++/88554 * decl.c (finish_function): For -Wreturn-type don't add a return *this; fixit hint if current_class_ref is NULL. Use a single if instead of two nested ones. * g++.dg/warn/Wreturn-type-11.C: New test. Co-Authored-By:
Jakub Jelinek <jakub@redhat.com> From-SVN: r267672
-
David Malcolm authored
Amongst other changes, r266077 updated value_range_base::dump so that it additionally prints the type. This broke an assertion within the jit testsuite, in jit.dg/test-sum-of-squares.c, which was checking for: ": [-INF, n_" but was now getting: ": signed int [-INF, n_" The test is merely intended as a simple verification that we can read dump files via gcc_jit_context_enable_dump. This patch loosens the requirements on the dump so that it should work with either version of value_range_base::dump. gcc/testsuite/ChangeLog: PR jit/88747 * jit.dg/test-sum-of-squares.c (verify_code): Update expected vrp dump to reflect r266077. From-SVN: r267671
-
GCC Administrator authored
From-SVN: r267670
-
- Jan 07, 2019
-
-
Jakub Jelinek authored
re PR c/88701 (Internal compiler error for valid program using compound literal with variably modified type.) PR c/88701 * c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl if current_function_decl is non-NULL. * gcc.dg/pr88701.c: New test. From-SVN: r267667
-
Alan Modra authored
This patch started off just by adding if_then_else support in write_attr_value to be able to write a saner expression for powerpc tls_gdld_nomark length. Then I noticed bit-rot in functions used to calculate insn_default_length, insn_min_length, and length_unit_log (which are used by the shorten_branches pass). These functions don't handle a const_int length value and return an "unknown" status that isn't used, or in the case of or_attr_value, doesn't need to be used. min_attr_value also attempts to return INT_MAX for the unhandled rtl case, but this can get lost in recursive calls. I fixed that problem by returning INT_MIN instead, and translating that to INT_MAX in the only caller of min_attr_value. PR target/88614 * genattrtab.c (max_attr_value, min_attr_value, or_attr_value): Delete "unknownp" parameter. Adjust callers. Handle CONST_INT, PLUS, MINUS, and MULT. (attr_value_aligned): Renamed from or_attr_value. (min_attr_value): Return INT_MIN for unhandled rtl case.. (min_fn): ..and translate to INT_MAX here. (write_length_unit_log): Modify to cope without "unknown". (write_attr_value): Handle IF_THEN_ELSE. From-SVN: r267666
-
Joseph Myers authored
Bugs 88720 and 88726 report issues where a function is declared inline in an inner scope, resulting in spurious diagnostics about it being declared but never defined when that scope is left (possibly in some cases also wrongly referring to the function as a nested function). These are regressions that were introduced with the support for C99 inline semantics in 4.3 (they don't appear with 4.2; it's possible some aspects of the bugs might have been introduced later than 4.3). For the case of functions being wrongly referred to as nested, DECL_EXTERNAL was not the right condition for a function being non-nested; TREE_PUBLIC is appropriate for the case of non-nested functions with external linkage, while !b->nested means this is the outermost scope in which the function was declared and so avoids catching the case of a file-scope static being redeclared inline inside a function. For the non-nested, external-linkage case, the code attempts to avoid duplicate diagnostics by diagnosing only when scope != external_scope, but actually scope == external_scope is more appropriate, as it's only when the file and external scopes are popped that the code can actually tell whether a function ended up being defined, and all such functions will appear in the (GCC-internal) external scope. Bootstrapped with no regressions on x86_64-pc-linux-gnu. PR c/88720 PR c/88726 gcc/c: * c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine whether a function is nested, not DECL_EXTERNAL. Diagnose inline functions declared but never defined only for external scope, not for other scopes. gcc/testsuite: * gcc.dg/inline-40.c, gcc.dg/inline-41.c: New tests. From-SVN: r267665
-