aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
AgeCommit message (Collapse)Author
2019-10-25PR c++/91581 - ICE in exception-specification of defaulted ctor.Marek Polacek
* g++.dg/cpp0x/noexcept55.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277462 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-25[Fortran] OpenACC – permit common blocks in some clausesCesar Philippidis
2019-10-25 Cesar Philippidis <cesar@codesourcery.com> Tobias Burnus <tobias@codesourcery.com> gcc/fortran/ * openmp.c (gfc_match_omp_map_clause): Add and pass allow_commons argument. (gfc_match_omp_clauses): Update calls to permit common blocks for OpenACC's copy/copyin/copyout, create/delete, host, pcopy/pcopy_in/pcopy_out, present_or_copy, present_or_copy_in, present_or_copy_out, present_or_create and self. gcc/ * gimplify.c (oacc_default_clause): Privatize fortran common blocks. (omp_notice_variable): Defer the expansion of DECL_VALUE_EXPR for common block decls. gcc/testsuite/ * gfortran.dg/goacc/common-block-1.f90: New test. * gfortran.dg/goacc/common-block-2.f90: New test. * gfortran.dg/goacc/common-block-3.f90: New test. libgomp/ * testsuite/libgomp.oacc-fortran/common-block-1.f90: New test. * testsuite/libgomp.oacc-fortran/common-block-2.f90: New test. * testsuite/libgomp.oacc-fortran/common-block-3.f90: New test. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com> git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277451 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-25 * gcc.target/powerpc/pr70100.c: Add -mvsx.David Edelsohn
Allow AIX ABI function name. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277450 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-252019-10-25 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92222 * tree-vect-slp.c (_slp_oprnd_info::first_pattern): Remove. (_slp_oprnd_info::second_pattern): Likewise. (_slp_oprnd_info::any_pattern): New. (vect_create_oprnd_info): Adjust. (vect_get_and_check_slp_defs): Compute whether any stmt is in a pattern. (vect_build_slp_tree_2): Avoid building up a node from scalars if any of the operand defs, not just the first, is in a pattern. * gcc.dg/torture/pr92222.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277448 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-25Fix failure in gcc.target/sve/reduc_strict_3.cRichard Sandiford
Unwanted unrolling meant that we had more single-precision FADDAs than expected. 2019-10-25 Richard Sandiford <richard.sandiford@arm.com> gcc/testsuite/ * gcc.target/aarch64/sve/reduc_strict_3.c (double_reduc1): Prevent the loop from being unrolled. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277442 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-25Update SVE tests for recent XPASSesRichard Sandiford
Recent target-independent patches mean that several SVE tests now produce the code that we'd originally wanted them to produce. Really nice to see :-) This patch therefore updates the expected baseline, so that hopefully we don't regress from this point in future. 2019-10-25 Richard Sandiford <richard.sandiford@arm.com> gcc/testsuite/ * gcc.target/aarch64/sve/loop_add_5.c: Remove XFAILs for tests that now pass. * gcc.target/aarch64/sve/reduc_1.c: Likewise. * gcc.target/aarch64/sve/reduc_2.c: Likewise. * gcc.target/aarch64/sve/reduc_5.c: Likewise. * gcc.target/aarch64/sve/reduc_8.c: Likewise. * gcc.target/aarch64/sve/slp_13.c: Likewise. * gcc.target/aarch64/sve/slp_5.c: Likewise. Update expected WHILELO counts. * gcc.target/aarch64/sve/slp_7.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277441 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-25Fix reductions for fully-masked loopsRichard Sandiford
Now that vectorizable_operation vectorises most loop stmts involved in a reduction, it needs to be aware of reductions in fully-masked loops. The LOOP_VINFO_CAN_FULLY_MASK_P parts of vectorizable_reduction now only apply to cases that use vect_transform_reduction. This new way of doing things is definitely an improvement for SVE though, since it means we can lift the old restriction of not using fully-masked loops for reduction chains. 2019-10-25 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-loop.c (vectorizable_reduction): Restrict the LOOP_VINFO_CAN_FULLY_MASK_P handling to cases that will be handled by vect_transform_reduction. Allow fully-masked loops to be used with reduction chains. * tree-vect-stmts.c (vectorizable_operation): Handle reduction operations in fully-masked loops. (vectorizable_condition): Reject EXTRACT_LAST_REDUCTION operations in fully-masked loops. gcc/testsuite/ * gcc.dg/vect/pr65947-1.c: No longer expect doubled dump lines for FOLD_EXTRACT_LAST reductions. * gcc.dg/vect/pr65947-2.c: Likewise. * gcc.dg/vect/pr65947-3.c: Likewise. * gcc.dg/vect/pr65947-4.c: Likewise. * gcc.dg/vect/pr65947-5.c: Likewise. * gcc.dg/vect/pr65947-6.c: Likewise. * gcc.dg/vect/pr65947-9.c: Likewise. * gcc.dg/vect/pr65947-10.c: Likewise. * gcc.dg/vect/pr65947-12.c: Likewise. * gcc.dg/vect/pr65947-13.c: Likewise. * gcc.dg/vect/pr65947-14.c: Likewise. * gcc.dg/vect/pr80631-1.c: Likewise. * gcc.dg/vect/pr80631-2.c: Likewise. * gcc.dg/vect/vect-cond-reduc-3.c: Likewise. * gcc.dg/vect/vect-cond-reduc-4.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277438 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-24 * gimplify.h (omp_construct_selector_matches): Declare.Jakub Jelinek
* gimplify.c (struct gimplify_omp_ctx): Add code member. (gimplify_call_expr): Call omp_resolve_declare_variant and remap called function if needed for flag_openmp. (gimplify_scan_omp_clauses): Set ctx->code. (omp_construct_selector_matches): New function. * omp-general.h (omp_constructor_traits_to_codes, omp_context_selector_matches, omp_resolve_declare_variant): Declare. * omp-general.c (omp_constructor_traits_to_codes, omp_context_selector_matches, omp_resolve_declare_variant): New functions. c-family/ * c-common.h (c_omp_context_selector_matches): Remove. * c-omp.c (c_omp_context_selector_matches): Remove. * c-attribs.c (c_common_attribute_table): Add "omp declare target {host,nohost,block}" attributes. c/ * c-parser.c (c_finish_omp_declare_variant): Use omp_context_selector_matches instead of c_omp_context_selector_matches. * c-decl.c (c_decl_attributes): Add "omp declare target block" attribute in between declare target and end declare target pragmas. cp/ * decl2.c (cplus_decl_attributes): Add "omp declare target block" attribute in between declare target and end declare target pragmas. testsuite/ * c-c++-common/gomp/declare-variant-8.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277427 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-24ipa-sra-19.c: Avoid unprototyped functionAndreas Krebbel
Power and IBM Z require a function prototype if a vector argument is passed. Complete the prototype of k to prevent errors from being triggered on these platforms gcc/testsuite/ChangeLog: 2019-10-24 Andreas Krebbel <krebbel@linux.ibm.com> * gcc.dg/ipa/ipa-sra-19.c: Remove dg-skip-if. Add argument type to prototype of k. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277409 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
* tree-vect-slp.c (vect_get_and_check_slp_defs): For reduction chains try harder with operand swapping and instead of putting a shifted chain into the reduction operands put a repetition of the final reduction op there as if we'd reassociate the expression. * gcc.dg/vect/slp-reduc-10a.c: New testcase. * gcc.dg/vect/slp-reduc-10b.c: Likewise. * gcc.dg/vect/slp-reduc-10c.c: Likewise. * gcc.dg/vect/slp-reduc-10d.c: Likewise. * gcc.dg/vect/slp-reduc-10e.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277406 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-24MSP430: Tweaks to generation of 430X instructionsJozef Lawrynowicz
gcc/ChangeLog: 2019-10-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/constraints.md: Allow post_inc for "Ya" constraint. * config/msp430/msp430.md (430x_shift_left): Use RLAM when the constant shift amount is between 1 and 4. (430x_arithmetic_shift_right): Use RRAM when the constant shift amount is between 1 and 4. gcc/testsuite/ChangeLog: 2019-10-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> * gcc.target/msp430/emulate-slli.c: Skip for -mcpu=msp430. Add shift by a constant 5 bits. Update scan-assembler directives. * gcc.target/msp430/emulate-srai.c: Likewise. * gcc.target/msp430/emulate-srli.c: Skip for -mcpu=msp430. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277394 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92205 * tree-vect-loop.c (vectorizable_reduction): Restrict search for alternate vectype_in to lane-reducing patterns we support. * gcc.dg/vect/pr92205.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277375 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92203 * treee-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Skip eliminating conversion stmts inserted by insertion. * gcc.dg/torture/pr92203.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277374 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/65930 * gcc.dg/vect/vect-reduc-2short.c: Fix typo. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277373 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/65930 * gcc.dg/vect/vect-reduc-2char-big-array.c: Adjust again. * gcc.dg/vect/vect-reduc-2char.c: Likewise. * gcc.dg/vect/vect-reduc-2short.c: Likewise. * gcc.dg/vect/vect-reduc-dot-s8b.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-2c.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277372 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-24S/390: Use UNSPEC_GET_TP for thread pointer loadsIlya Leoshkevich
gcc/ChangeLog: 2019-10-24 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_get_thread_pointer): Use gen_get_thread_pointer. (s390_expand_split_stack_prologue): Likewise. * config/s390/s390.md (UNSPEC_GET_TP): New UNSPEC. (*get_tp_31): New 31-bit splitter for UNSPEC_GET_TP. (*get_tp_64): New 64-bit splitter for UNSPEC_GET_TP. (get_thread_pointer<mode>): Use UNSPEC_GET_TP, use parameterized name. gcc/testsuite/ChangeLog: 2019-10-24 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/load-thread-pointer-once-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277368 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-242019-10-24 Richard Biener <rguenther@suse.de>Richard Biener
* tree-vect-slp.c (vect_analyze_slp): When reduction group SLP discovery fails try to handle the reduction as part of SLP reduction discovery. * gcc.dg/vect/slp-reduc-9.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277366 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-24 * gcc.target/powerpc/pr70010.c: Add -Wno-psabi.David Edelsohn
* gcc.target/powerpc/pr70010-[12].c: Require LTO. * gcc.target/powerpc/pr91275.c: Add -mcpu=power8. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277363 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-23 Implement P1286R2, Contra CWG1778Jason Merrill
The C++11 requirement that an explicit exception-specification on a defaulted function match the implicit one was found to be problematic for std::atomic. This paper, adopted in February, simply removes that requirement: if an explicitly defaulted function has a different exception-specification, that now works just like a user-written function: either it isn't noexcept when it could be, or it is noexcept and will call terminate if an exception is thrown. * method.c (defaulted_late_check): Don't check explicit exception-specification on defaulted function. (after_nsdmi_defaulted_late_checks): Remove. * parser.h (struct cp_unparsed_functions_entry): Remove classes. * parser.c (unparsed_classes): Remove. (push_unparsed_function_queues, cp_parser_class_specifier_1): Adjust. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277351 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-23Fix a bug with type constraints in constructors.Andrew Sutton
gcc/cp/ * parser.c (cp_parser_constructor_declarator_p): Pass an empty decl-specifier-seq to make sure we parse type constraints as part of a type-specifier. gcc/testsuite/ * g++.dg/cpp2a/concepts5.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277323 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-232019-10-23 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/65930 * tree-vect-loop.c (check_reduction_path): Allow conversions that only change the sign. (vectorizable_reduction): Relax latch def stmts we handle further. * gcc.dg/vect/vect-reduc-2char-big-array.c: Adjust. * gcc.dg/vect/vect-reduc-2char.c: Likewise. * gcc.dg/vect/vect-reduc-2short.c: Likewise. * gcc.dg/vect/vect-reduc-dot-s8b.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-2c.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277322 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-23 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>:Jakub Jelinek
Temporarily change input_location to CLEANUP_STMT location. * g++.dg/cpp2a/constexpr-dtor3.C: Expect in 'constexpr' expansion of message on the line with variable declaration. * g++.dg/ext/constexpr-attr-cleanup1.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277320 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-23 PR tree-optimization/92131Eric Botcazou
* tree-vrp.c (extract_range_from_plus_minus_expr): If the resulting range would be symbolic, drop to varying for any explicit overflow in the constant part or if neither range is a singleton. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277314 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-23Do not ICE in IPA inliner.Martin Liska
2019-10-23 Martin Liska <mliska@suse.cz> PR ipa/91969 * ipa-inline.c (recursive_inlining): Do not print when curr->count is not initialized. 2019-10-23 Martin Liska <mliska@suse.cz> PR ipa/91969 * g++.dg/ipa/pr91969.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277309 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-22PR c++/85746: Don't fold __builtin_constant_p prematurelyMarc Glisse
2019-10-22 Marc Glisse <marc.glisse@inria.fr> gcc/cp/ * constexpr.c (cxx_eval_builtin_function_call): Only set force_folding_builtin_constant_p if manifestly_const_eval. gcc/testsuite/ * g++.dg/pr85746.C: New file. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277292 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-222019-10-22 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92173 * tree-vect-loop.c (vectorizable_reduction): If vect_transform_reduction cannot handle code-generation try without the single-def-use-cycle optimization. Pass optab_vector to optab_for_tree_code to get vector shifts as that's what we'd generate. * gcc.dg/torture/pr92173.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277288 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-22Fix PR middle-end/90796Michael Matz
PR middle-end/90796 * gimple-loop-jam.c (any_access_function_variant_p): New function. (adjust_unroll_factor): Use it to constrain safety, new parameter. (tree_loop_unroll_and_jam): Adjust call and profitable unroll factor. testsuite/ * gcc.dg/unroll-and-jam.c: Add three invalid and one valid case. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277287 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-222019-10-22 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92173 * tree-vect-loop.c (vectorizable_reduction): If vect_transform_reduction cannot handle code-generation try without the single-def-use-cycle optimization. Pass optab_vector to optab_for_tree_code to get vector shifts as that's what we'd generate. * gcc.dg/torture/pr92173.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277286 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-22[C++] Avoid exposing internal details in aka typesRichard Sandiford
This patch extends r276951 to work for C++ too. 2019-10-22 Richard Sandiford <richard.sandiford@arm.com> gcc/cp/ * cp-tree.h (STF_USER_VISIBLE): New constant. (strip_typedefs, strip_typedefs_expr): Take a flags argument. * tree.c (strip_typedefs, strip_typedefs_expr): Likewise, updating mutual calls accordingly. When STF_USER_VISIBLE is true, only look through typedefs if user_facing_original_type_p. * error.c (dump_template_bindings, type_to_string): Pass STF_USER_VISIBLE to strip_typedefs. (dump_type): Likewise, unless pp_c_flag_gnu_v3 is set. gcc/testsuite/ * g++.dg/diagnostic/aka5.h: New test. * g++.dg/diagnostic/aka5a.C: Likewise. * g++.dg/diagnostic/aka5b.C: Likewise. * g++.target/aarch64/diag_aka_1.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277281 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-22[testsuite] Make the Wnonnull independent of system headers.Iain Sandoe
To avoid the result of this test depending on the implementation of the system 'string.h', provide prototypes for the two functions used in the test. gcc/testsuite/ChangeLog: 2019-10-22 Iain Sandoe <iain@sandoe.co.uk> * gcc.dg/Wnonnull.c: Provide prototypes for strlen and memcpy. Use __SIZE_TYPE__ instead of size_t. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277280 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21PR c++/83434 - typeinfo for noexcept function lacks noexcept informationKamlesh Kumar
2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com> * rtti.c (get_tinfo_decl_dynamic): Do not call TYPE_MAIN_VARIANT for function. (get_typeid): Likewise. * g++.dg/rtti/pr83534.C: New Test. Reviewed-by: Jason Merrill <jason@redhat.com> git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277270 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21/cpPaolo Carlini
2019-10-21 Paolo Carlini <paolo.carlini@oracle.com> * parser.c (cp_parser_class_head): Improve error recovery upon extra qualification error. /testsuite 2019-10-21 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/parse/qualified2.C: Tighten dg-error directive. * g++.old-deja/g++.other/decl5.C: Don't expect redundant error. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277268 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21 PR c++/92015Jakub Jelinek
* constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref): Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts. * g++.dg/cpp0x/constexpr-92015.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277267 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21PR c++/92062 - ODR-use ignored for static member of class template.Marek Polacek
has_value_dependent_address wasn't stripping location wrappers so it gave the wrong answer for "&x" in the static_assert. That led us to thinking that the expression isn't instantiation-dependent, and we skipped static initialization of A<0>::x. This patch adds stripping so that has_value_dependent_address gives the same answer as it used to before the location wrappers addition. * pt.c (has_value_dependent_address): Strip location wrappers. * g++.dg/cpp0x/constexpr-odr1.C: New test. * g++.dg/cpp0x/constexpr-odr2.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277266 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.Marek Polacek
* typeck.c (maybe_warn_about_returning_address_of_local): Avoid recursing on null initializer and return false instead. * g++.dg/cpp1z/decomp50.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277264 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-212019-10-21 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92162 * tree-vect-loop.c (vect_create_epilog_for_reduction): Lookup STMT_VINFO_REDUC_IDX in reduc_info. * tree-vect-stmts.c (vectorizable_condition): Likewise. * gcc.dg/pr92162.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277261 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-212019-10-21 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92161 * tree-vect-loop.c (vect_analyze_loop_2): Reset stmts def-type for reductions. * gfortran.dg/pr92161.f: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277240 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21[AArch64] Implement __rndr, __rndrrs intrinsicsKyrylo Tkachov
This patch implements the recently published[1] __rndr and __rndrrs intrinsics used to access the RNG in Armv8.5-A. The __rndrrs intrinsics can be used to reseed the generator too. They are guarded by the __ARM_FEATURE_RNG feature macro. A quirk with these intrinsics is that they store the random number in their pointer argument and return a status code if the generation succeeded. The instructions themselves write the CC flags indicating the success of the operation that we can then read with a CSET. Therefore this implementation makes use of the IGNORE indicator to the builtin expand machinery to avoid generating the CSET if its result is unused (the CC reg clobbering effect is still reflected in the pattern). I've checked that using unspec_volatile prevents undesirable CSEing of the instructions. [1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics * config/aarch64/aarch64.md (UNSPEC_RNDR, UNSPEC_RNDRRS): Define. (aarch64_rndr): New define_insn. (aarch64_rndrrs): Likewise. * config/aarch64/aarch64.h (AARCH64_ISA_RNG): Define. (TARGET_RNG): Likewise. * config/aarch64/aarch64.c (aarch64_expand_builtin): Use IGNORE argument. * config/aarch64/aarch64-protos.h (aarch64_general_expand_builtin): Add fourth argument in prototype. * config/aarch64/aarch64-builtins.c (enum aarch64_builtins): Add AARCH64_BUILTIN_RNG_RNDR, AARCH64_BUILTIN_RNG_RNDRRS. (aarch64_init_rng_builtins): Define. (aarch64_general_init_builtins): Call aarch64_init_rng_builtins. (aarch64_expand_rng_builtin): Define. (aarch64_general_expand_builtin): Use IGNORE argument, handle RNG builtins. * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define __ARM_FEATURE_RNG when TARGET_RNG. * config/aarch64/arm_acle.h (__rndr, __rndrrs): Define. * gcc.target/aarch64/acle/rng_1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277239 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-212019-10-21 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>Prathamesh Kulkarni
PR tree-optimization/91532 * gcc.target/aarch64/sve/fmla_2.c: Add dg-scan check for two st1d insns. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277237 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-21 Fix some fallout for small targets.Georg-Johann Lay
PR testsuite/52641 * gcc.dg/torture/pr86034.c: Use 32-bit base type for a bitfield of width > 16 bits. * gcc.dg/torture/pr90972.c [avr]: Add option "-w". * gcc.dg/torture/pr87693.c: Same. * gcc.dg/torture/pr91178.c: Add dg-require-effective-target size32plus. * gcc.dg/torture/pr91178-2.c: Same. * gcc.dg/torture/20181024-1.c * gcc.dg/torture/pr86554-1.c: Use 32-bit integers. * gcc.dg/tree-ssa/pr91091-1.c: Same. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277236 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-20 * tree-ssa-alias.c (nonoverlapping_refs_since_match_p): Do notJan Hubicka
skip non-zero array accesses. * gcc.c-torture/execute/alias-access-path-2.c: New testcase. * gcc.dg/tree-ssa/alias-access-path-11.c: xfail. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277214 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-19 * g++.dg/cpp2a/nodiscard-reason-only-one.C: In dg-error or dg-warningJakub Jelinek
remove (?n) uses and replace .* with \[^\n\r]*. * g++.dg/cpp2a/nodiscard-reason.C: Likewise. * g++.dg/cpp2a/nodiscard-once.C: Likewise. * g++.dg/cpp2a/nodiscard-reason-nonstring.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277205 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-19 PR target/92140Jakub Jelinek
* config/i386/predicates.md (int_nonimmediate_operand): New special predicate. * config/i386/i386.md (*add<mode>3_eq, *add<mode>3_ne, *add<mode>3_eq_0, *add<mode>3_ne_0, *sub<mode>3_eq, *sub<mode>3_ne, *sub<mode>3_eq_1, *sub<mode>3_eq_0, *sub<mode>3_ne_0): New define_insn_and_split patterns. * gcc.target/i386/pr92140.c: New test. * gcc.c-torture/execute/pr92140.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277203 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-19[Darwin, testsuite] Fix Wnonnull on Darwin.Iain Sandoe
Darwin does not mark entries in string.h with nonnull attributes so the test fails. Since the purpose of the test is to check that the warnings are issued for an inlined function, not that the target headers are marked up, we can provide marked up headers for Darwin. gcc/testsuite/ChangeLog: 2019-10-19 Iain Sandoe <iain@sandoe.co.uk> * gcc.dg/Wnonnull.c: Add attributed function declarations for memcpy and strlen for Darwin. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277202 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-19Implement C++20 P1301 [[nodiscard("should have a reason")]].JeanHeyd Meneide
2019-10-17 JeanHeyd Meneide <phdofthehouse@gmail.com> gcc/ * escaped_string.h (escaped_string): New header. * tree.c (escaped_string): Remove escaped_string class. gcc/c-family * c-lex.c (c_common_has_attribute): Update nodiscard value. gcc/cp/ * tree.c (handle_nodiscard_attribute) Added C++2a nodiscard string message. (std_attribute_table) Increase nodiscard argument handling max_length from 0 to 1. * parser.c (cp_parser_check_std_attribute): Add requirement that nodiscard only be seen once in attribute-list. (cp_parser_std_attribute): Check that empty parenthesis lists are not specified for attributes that have max_length > 0 (e.g. [[attr()]]). * cvt.c (maybe_warn_nodiscard): Add nodiscard message to output, if applicable. (convert_to_void): Allow constructors to be nodiscard-able (P1771). gcc/testsuite/g++.dg/cpp0x * gen-attrs-67.C: Test new error message for empty-parenthesis-list. gcc/testsuite/g++.dg/cpp2a * nodiscard-construct.C: New test. * nodiscard-once.C: New test. * nodiscard-reason-nonstring.C: New test. * nodiscard-reason-only-one.C: New test. * nodiscard-reason.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com> git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277200 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-18PR tree-optimization/92157 - incorrect strcmp() == 0 result for unknown stringsMartin Sebor
gcc/testsuite/ChangeLog: PR tree-optimization/92157 * gcc.dg/strlenopt-69.c: Disable test failing due to PR 92155. * gcc.dg/strlenopt-87.c: New test. gcc/ChangeLog: PR tree-optimization/92157 * tree-ssa-strlen.c (handle_builtin_string_cmp): Be prepared for compute_string_length to return a negative result. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277194 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-18[arm] Fix testsuite nit when compiling for thumb2Richard Earnshaw
In thumb2 we now generate a NEGS instruction rather than RSBS, so this test needs updating. * gcc.target/arm/negdi-3.c: Update expected output to allow NEGS. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277192 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-18[arm] Early split addvdi4Richard Earnshaw
This patch adds early splitting for addvdi4; it's very similar to the uaddvdi4 splitter, but the details are just different enough in places, especially for the patterns that match the splitting, where we have to compare against the non-widened version to detect if overflow occurred. I've also added a testcase to the testsuite for a couple of constants that caught me out during the development of this patch. They're probably arm-specific values, but the test is generic enough that I've included it for all targets. [gcc] * config/arm/arm.c (arm_select_cc_mode): Allow either the first or second operand of the PLUS inside a DImode equality test to be sign-extend when selecting CC_Vmode. * config/arm/arm.md (addvdi4): Early-split the operation into SImode instructions. (addsi3_cin_vout_reg, addsi3_cin_vout_imm, addsi3_cin_vout_0): New expand patterns. (addsi3_cin_vout_reg_insn, addsi3_cin_vout_imm_insn): New patterns. (addsi3_cin_vout_0): Likewise. (adddi3_compareV): Delete. [gcc/testsuite] * gcc.dg/builtin-arith-overflow-3.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277186 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-18[arm] Implement negscc using SBC when appropriate.Richard Earnshaw
When the carry flag is appropriately set by a comprison, negscc patterns can expand into a simple SBC of a register with itself. This means we can convert two conditional instructions into a single non-conditional instruction. Furthermore, in Thumb2 we can avoid the need for an IT instruction as well. This patch also fixes the remaining testcase that we initially XFAILed in the first patch of this series. gcc: * config/arm/arm.md (negscc_borrow): New pattern. (mov_negscc): Don't split if the insn would match negscc_borrow. * config/arm/thumb2.md (thumb2_mov_negscc): Likewise. (thumb2_mov_negscc_strict_it): Likewise. testsuite: * gcc.target/arm/negdi-3.c: Remove XFAIL markers. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277175 138bc75d-0d04-0410-961f-82ee72b054a4
2019-10-18[arm] Perform early splitting of adddi3.Richard Earnshaw
This patch causes the expansion of adddi3 to split the operation immediately for Arm and Thumb-2. This is desirable as it frees up the register allocator to pick what ever combination of registers suits best and reduces the number of auxiliary patterns that we need in the back-end. Three of the testcases that we disabled earlier are already fixed by this patch. Finally, we add a new pattern to match the canonicalization of add-with-carry when using an immediate of zero. gcc: * config/arm/arm-protos.h (arm_decompose_di_binop): New prototype. * config/arm/arm.c (arm_decompose_di_binop): New function. * config/arm/arm.md (adddi3): Also accept any const_int for op2. If not generating Thumb-1 code, decompose the operation into 32-bit pieces. * add0si_carryin_<optab>: New pattern. testsuite: * gcc.target/arm/pr53447-1.c: Remove XFAIL. * gcc.target/arm/pr53447-3.c: Remove XFAIL. * gcc.target/arm/pr53447-4.c: Remove XFAIL. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277165 138bc75d-0d04-0410-961f-82ee72b054a4