aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06rs6000: Use the correct minimized testcasePeter Bergner1-222/+43
Use the correct minimized test case source rather than the large test source. gcc/testsuite/ * gcc.target/powerpc/pr64505.c: Run everywhere. Use correct minimized test case.
2020-11-06rs6000: Fix default alignment ABI break caused by MMA base supportPeter Bergner3-2/+47
As part of the MMA base support, we incremented BIGGEST_ALIGNMENT in order to align the __vector_pair and __vector_quad types to 256 and 512 bytes respectively. This had the unintended effect of changing the default alignment used by __attribute__ ((__aligned__)) which causes an ABI break because of some dodgy code in GLIBC's struct pthread. The fix is to revert the BIGGEST_ALIGNMENT change and to force the alignment on the type itself rather than the mode used by the type. 2020-11-06 Peter Bergner <bergner@linux.ibm.com> gcc/ * config/rs6000/rs6000.h (BIGGEST_ALIGNMENT): Revert previous commit so as not to break the ABI. * config/rs6000/rs6000-call.c (rs6000_init_builtins): Set the ABI mandated alignment for __vector_pair and __vector_quad types. gcc/testsuite/ * gcc.target/powerpc/mma-alignment.c: New test.
2020-11-06Fix stack pointer handling in ms_hook_prologue functions for i386 target.Jeff Law4-2/+20
gcc/ PR target/91489 * config/i386/i386.md (simple_return): Also check for ms_hook_prologue function attribute. * config/i386/i386.c (ix86_can_use_return_insn_p): Also check for ms_hook_prologue function attribute. * config/i386/i386-protos.h (ix86_function_ms_hook_prologue): Declare. gcc/testsuite PR target/91489 * gcc.target/i386/ms_hook_prologue.c: Expand testcase to reproduce PR target/91489 issue.
2020-11-06rs6000: Fix TARGET_POWERPC64 vs. TARGET_64BIT confusionSegher Boessenkool1-2/+2
I gave Ke Wen bad advice, luckily David corrected me: it is true that we cannot use TARGET_POWERPC64 on many 32-bit OSes, since either the kernel or userland does not save the top half of the 64-bit integer registers, but we do not have to care about that in separate patterns or related code. The flag is automatically not enabled by default on targets that do not handle this correctly. This patch fixes it. Segher 2020-11-06 Segher Boessenkool <segher@kernel.crashing.org> PR target/96933 * config/rs6000/rs6000.c (rs6000_expand_vector_init): Use TARGET_POWERPC64 instead of TARGET_64BIT.
2020-11-06builtins: Add DFP signaling NaN built-in functionsJoseph Myers7-0/+128
Add built-in functions __builtin_nansd32, __builtin_nansd64 and __builtin_nansd128 to return signaling NaNs of decimal floating-point types, analogous to the functions already present for binary floating-point types. This patch, independent of <https://gcc.gnu.org/pipermail/gcc-patches/2020-October/557136.html> (pending review), is in preparation for adding the <float.h> macros for such signaling NaNs that are in C2x, analogous to the macros for other types that are in that patch. Bootstrapped with no regressions for x86_64-pc-linux-gnu. Also ran the new tests for powerpc64le-linux-gnu to confirm they do work in the case (hardware DFP) where floating-point exceptions are supported for DFP. gcc/ 2020-11-06 Joseph Myers <joseph@codesourcery.com> * builtins.def (BUILT_IN_NANSD32, BUILT_IN_NANSD64) (BUILT_IN_NANSD128): New built-in functions. * fold-const-call.c (fold_const_call): Handle the new built-in functions. * doc/extend.texi (__builtin_nansd32, __builtin_nansd64) (__builtin_nansd128): Document. * doc/sourcebuild.texi (Effective-Target Keywords): Document fenv_exceptions_dfp. gcc/testsuite/ 2020-11-06 Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp (check_effective_target_fenv_exceptions_dfp): New. * gcc.dg/dfp/builtin-snan-1.c, gcc.dg/dfp/builtin-snan-2.c: New tests.
2020-11-06c++: Small tweak to can_convert_eh [PR81660]Marek Polacek4-8/+39
While messing with check_handlers_1, I spotted this bug report which complains that we don't warn about the case when we have two duplicated handlers of type int. can_convert_eh implements [except.handle] and that says: A handler is a match for an exception object of type E if - The handler is of type cv T or cv T& and E and T are the same type (ignoring the top-level cv-qualifiers), or [...] but we don't implement this bullet properly for non-class types. The fix therefore seems pretty obvious. Also change the return type to bool when we're only returning yes/no. gcc/cp/ChangeLog: PR c++/81660 * except.c (can_convert_eh): Change the return type to bool. If the type TO and FROM are the same, return true. gcc/testsuite/ChangeLog: PR c++/81660 * g++.dg/warn/Wexceptions3.C: New test. * g++.dg/eh/pr42859.C: Add dg-warning. * g++.dg/torture/pr81659.C: Likewise.
2020-11-06Improve uninitialized warning with value range infoBin Cheng1-63/+129
Function use_pred_not_overlap_with_undef_path_pred of pass_late_warn_uninitialized checks if predicate of variable use overlaps with predicate of undefined control flow path. For now, it only checks ssa_var comparing against constant, this can be improved where ssa_var compares against another ssa_var with value range info, as described in comment: + /* Check value range info of rhs, do following transforms: + flag_var < [min, max] -> flag_var < max + flag_var > [min, max] -> flag_var > min + + We can also transform LE_EXPR/GE_EXPR to LT_EXPR/GT_EXPR: + flag_var <= [min, max] -> flag_var < [min, max+1] + flag_var >= [min, max] -> flag_var > [min-1, max] + if no overflow/wrap. */ gcc/ * tree-ssa-uninit.c (find_var_cmp_const): New function. (use_pred_not_overlap_with_undef_path_pred): Call above.
2020-11-06Objective-C/C++ : Allow visibility prefix attributes on interfaces.Iain Sandoe1-2/+4
This passes visibiliy through without warning (so that, for example, __attribute__((__visibility("default"))) does not result in any diagnostic). gcc/objc/ChangeLog: * objc-act.c (start_class): Accept visibility attributes without warning.
2020-11-06Objective-C/C++ (parsers) : Update @property attribute parsing.Iain Sandoe14-394/+598
At present, we are missing parsing and checking for around half of the property attributes in use. The existing ad hoc scheme for the parser's communication with the Objective C validation is not suitable for extending to cover all the missing cases. Additionally: 1/ We were declaring errors in two cases that the reference implementation warns (or is silent). I've elected to warn for both those cases, (Wattributes) it could be that we should implement Wobjc-xxx-property warning masks (TODO). 2/ We were emitting spurious complaints about missing property attributes when these were not being parsed because we gave up on the first syntax error. 3/ The quality of the diagnostic locations was poor (that's true for much of Objective-C, we will have to improve it as we modernise areas). We continue to attempt to keep the code, warning and error output similar (preferably identical output) between the C and C++ front ends. The interface to the Objective-C-specific parts of the parsing is simplified to a vector of parsed (but not fully-checked) property attributes, this will simplify the addition of new attributes. gcc/c-family/ChangeLog: * c-objc.h (enum objc_property_attribute_group): New (enum objc_property_attribute_kind): New. (OBJC_PROPATTR_GROUP_MASK): New. (struct property_attribute_info): Small class encapsulating parser output from property attributes. (objc_prop_attr_kind_for_rid): New (objc_add_property_declaration): Simplify interface. * stub-objc.c (enum rid): Dummy type. (objc_add_property_declaration): Simplify interface. (objc_prop_attr_kind_for_rid): New. gcc/c/ChangeLog: * c-parser.c (c_parser_objc_at_property_declaration): Improve parsing fidelity. Associate better location info with @property attributes. Clean up the interface to objc_add_property_declaration (). gcc/cp/ChangeLog: * parser.c (cp_parser_objc_at_property_declaration): Improve parsing fidelity. Associate better location info with @property attributes. Clean up the interface to objc_add_property_declaration (). gcc/objc/ChangeLog: * objc-act.c (objc_prop_attr_kind_for_rid): New. (objc_add_property_declaration): Adjust to consume the parser output using a vector of parsed attributes. gcc/testsuite/ChangeLog: * obj-c++.dg/property/at-property-1.mm: Adjust expected diagnostics. * obj-c++.dg/property/at-property-29.mm: Likewise. * obj-c++.dg/property/at-property-4.mm: Likewise. * obj-c++.dg/property/property-neg-2.mm: Likewise. * objc.dg/property/at-property-1.m: Likewise. * objc.dg/property/at-property-29.m: Likewise. * objc.dg/property/at-property-4.m: Likewise. * objc.dg/property/at-property-5.m: Likewise. * objc.dg/property/property-neg-2.m: Likewise.
2020-11-06c++: Propagate attributes to clones in duplicate_decls [PR67453]Jakub Jelinek2-0/+25
On the following testcase where the cdtor attributes aren't on the in-class declaration but on an out-of-class definition, the cdtors have their clones created from the in-class declaration, and later on duplicate_decls updates attributes on the abstract cdtors, but nothing propagates them to the clones. 2020-11-06 Jakub Jelinek <jakub@redhat.com> PR c++/67453 * decl.c (duplicate_decls): Propagate DECL_ATTRIBUTES and DECL_PRESERVE_P from olddecl to its clones if any. * g++.dg/ext/attr-used-2.C: New test.
2020-11-06Darwin: Darwin 20 is to be macOS 11 (Big Sur).Iain Sandoe3-12/+18
As per Nigel Tufnel's assertion "... this one goes to 11". The various parts of the code that deal with mapping Darwin versions to macOS (X) versions need updating to deal with a major version of 11. So now we have, for example: Darwin 4 => macOS (X) 10.0 … Darwin 14 => macOS (X) 10.10 ... Darwin 19 => macOS (X) 10.15 Darwin 20 => macOS 11.0 Because of the historical duplication of the "10" in macOSX 10.xx and the number of tools that expect this, it is likely that system tools will allow macos11.0 and/or macosx11.0 (despite that the latter makes little sense). Update the link test to cover Catalina (Darwin19/10.15) and Big Sur (Darwin20/11.0). gcc/ChangeLog: * config/darwin-c.c: Allow for Darwin20 to correspond to macOS 11. * config/darwin-driver.c: Likewise. gcc/testsuite/ChangeLog: * gcc.dg/darwin-minversion-link.c: Allow for Darwin19 (macOS 10.15) and Darwin20 (macOS 11.0).
2020-11-06rework PRE PHI translation cacheRichard Biener1-36/+68
Turns out its size and time requirements can be stripped down dramatically. 2020-11-06 Richard Biener <rguenther@suse.de> * tree-ssa-pre.c (expr_pred_trans_d): Modify so elements are embedded rather than allocated. Remove hashval member, make all members integers. (phi_trans_add): Adjust accordingly. (phi_translate): Likewise. Deal with re-allocation of the table.
2020-11-06Combine new calculated ranges with existing range.Andrew MacLeod3-2/+41
When a range is recalculated, retain what was previously known as IL changes can produce different results from un-executed code. This also paves the way for external injection of ranges. gcc/ PR tree-optimization/97737 PR tree-optimization/97741 * gimple-range.cc: (gimple_ranger::range_of_stmt): Intersect newly calculated ranges with the existing known global range. gcc/testsuite/ * gcc.dg/pr97737.c: New. * gcc.dg/pr97741.c: New.
2020-11-06Add PC as control registerDarius Galis2-0/+9
gcc/ * config/rx/rx.md (CTRLREG_PC): Add. * config/rx/rx.c (CTRLREG_PC): Add (rx_expand_builtin_mvtc): Add warning: PC register cannot be used as dest.
2020-11-06core: Rename DECL_IS_BUILTIN -> DECL_IS_UNDECLARED_BUILTINNathan Sidwell22-63/+62
In cleaning up C++'s handling of hidden decls, I renamed its DECL_BUILTIN_P, which checks for loc == BUILTINS_LOCATION to DECL_UNDECLARED_BUILTIN_P, because the location gets updated, if user source declares the builtin, and the predicate no longer holds. The original name was confusing me. (The builtin may still retain builtin properties in the redeclaration, and other predicates can still detect that.) I discovered that tree.h had its own variant 'DECL_IS_BUILTIN', which behaves in (almost) the same manner. And therefore has the same mutating behaviour. This patch deletes the C++ one, and renames tree.h's to DECL_IS_UNDECLARED_BUILTIN, to emphasize its non-constantness. I guess _IS_ wins over _P gcc/ * tree.h (DECL_IS_BUILTIN): Rename to ... (DECL_IS_UNDECLARED_BUILTIN): ... here. No need to use SOURCE_LOCUS. * calls.c (maybe_warn_alloc_args_overflow): Adjust for rename. * cfgexpand.c (pass_expand::execute): Likewise. * dwarf2out.c (base_type_die, is_naming_typedef_decl): Likewise. * godump.c (go_decl, go_type_decl): Likewise. * print-tree.c (print_decl_identifier): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise. * xcoffout.c (xcoff_assign_fundamental_type_number): Likewise. gcc/c-family/ * c-ada-spec.c (collect_ada_nodes): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (collect_ada_node): Likewise. (dump_forward_type): Likewise. * c-common.c (set_underlying_type): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (user_facing_original_type, c_common_finalize_early_debug): Likewise. gcc/c/ * c-decl.c (diagnose_mismatched_decls): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (warn_if_shadowing, implicitly_declare, names_builtin_p) (collect_source_refs): Likewise. * c-typeck.c (inform_declaration, inform_for_arg) (convert_for_assignment): Likewise. gcc/cp/ * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete. * cp-objcp-common.c (names_bultin_p): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. * decl.c (decls_match): Likewise. Replace DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN. (duplicate_decls): Likewise. * decl2.c (collect_source_refs): Likewise. * name-lookup.c (anticipated_builtin_p, print_binding_level) (do_nonmember_using_decl): Likewise. * pt.c (builtin_pack_fn_p): Likewise. * typeck.c (error_args_num): Likewise. gcc/lto/ * lto-symtab.c (lto_symtab_merge_decls_1): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. gcc/go/ * go-gcc.cc (Gcc_backend::call_expression): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. libcc1/ * libcc1plugin.cc (address_rewriter): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. * libcp1plugin.cc (supplement_binding): Likewise.
2020-11-06aarch64: Use intrinsics for upper saturating shift rightDavid Candler9-258/+854
The use of vqshrn_high_n_s32 was triggering an unneeded register move, because sqshrn2 is destructive but was declared as inline assembly in arm_neon.h. This patch implements sqshrn2 and uqshrn2 as actual intrinsics which do not trigger the unnecessary move, along with new tests to cover them. gcc/ChangeLog 2020-11-06 David Candler <david.candler@arm.com> * config/aarch64/aarch64-builtins.c (TYPES_SHIFT2IMM): Add define. (TYPES_SHIFT2IMM_UUSS): Add define. (TYPES_USHIFT2IMM): Add define. * config/aarch64/aarch64-simd.md (aarch64_<sur>q<r>shr<u>n2_n<mode>): Add new insn for upper saturating shift right. * config/aarch64/aarch64-simd-builtins.def: Add intrinsics. * config/aarch64/arm_neon.h: (vqrshrn_high_n_s16): Expand using intrinsic rather than inline asm. (vqrshrn_high_n_s32): Likewise. (vqrshrn_high_n_s64): Likewise. (vqrshrn_high_n_u16): Likewise. (vqrshrn_high_n_u32): Likewise. (vqrshrn_high_n_u64): Likewise. (vqrshrun_high_n_s16): Likewise. (vqrshrun_high_n_s32): Likewise. (vqrshrun_high_n_s64): Likewise. (vqshrn_high_n_s16): Likewise. (vqshrn_high_n_s32): Likewise. (vqshrn_high_n_s64): Likewise. (vqshrn_high_n_u16): Likewise. (vqshrn_high_n_u32): Likewise. (vqshrn_high_n_u64): Likewise. (vqshrun_high_n_s16): Likewise. (vqshrun_high_n_s32): Likewise. (vqshrun_high_n_s64): Likewise. gcc/testsuite/ChangeLog 2020-11-06 David Candler <david.candler@arm.com> * gcc.target/aarch64/advsimd-intrinsics/vqrshrn_high_n.c: New testcase. * gcc.target/aarch64/advsimd-intrinsics/vqrshrun_high_n.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/vqshrn_high_n.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/vqshrun_high_n.c: Likewise. * gcc.target/aarch64/narrow_high-intrinsics.c: Update expected assembler for sqshrun2, sqrshrun2, sqshrn2, uqshrn2, sqrshrn2 and uqrshrn2.
2020-11-06aarch64: Support permutes on unpacked SVE vectorsRichard Sandiford17-60/+3685
This patch adds support for permuting unpacked SVE vectors using: - DUP - EXT - REV[BHW] - REV - TRN[12] - UZP[12] - ZIP[12] This involves rewriting the REV[BHW] permute code so that the inputs and outputs of the insn pattern have the same mode as the vectors being permuted. This is different from the ACLE form, where the reversal happens within individual elements rather than within groups of multiple elements. The patch does not add a conditional version of REV[BHW]. I'll come back to that once we have partial-vector comparisons and selects. The patch is really just enablement, adding an extra tool to the toolbox. It doesn't bring any significant vectorisation opportunities on its own. However, the patch does have one artificial example that is now vectorised in a better way than before. gcc/ * config/aarch64/aarch64-modes.def (VNx2BF, VNx4BF): Adjust nunits and alignment based on the current VG. * config/aarch64/iterators.md (SVE_ALL, SVE_24, SVE_2, SVE_4): Add partial SVE BF modes. (UNSPEC_REVBHW): New unspec. (Vetype, Vesize, Vctype, VEL, Vel, vwcore, V_INT_CONTAINER) (v_int_container, VPRED, vpred): Handle partial SVE BF modes. (container_bits, Vcwtype): New mode attributes. * config/aarch64/aarch64-sve.md (@aarch64_sve_revbhw_<SVE_ALL:mode><PRED_HSD:mode>): New pattern. (@aarch64_sve_dup_lane<mode>): Extended from SVE_FULL to SVE_ALL. (@aarch64_sve_rev<mode>, @aarch64_sve_<perm_insn><mode>): Likewise. (@aarch64_sve_ext<mode>): Likewise. * config/aarch64/aarch64.c (aarch64_classify_vector_mode): Handle E_VNx2BFmode and E_VNx4BFmode. (aarch64_evpc_rev_local): Base the analysis on the container size instead of the element size. Use the new aarch64_sve_revbhw patterns for SVE. (aarch64_evpc_dup): Handle partial SVE data modes. Use the container size instead of the element size when applying the SVE immediate limit. Fix a previously incorrect bounds check. (aarch64_expand_vec_perm_const_1): Handle partial SVE data modes. gcc/testsuite/ * gcc.target/aarch64/sve/dup_lane_2.c: New test. * gcc.target/aarch64/sve/dup_lane_3.c: Likewise. * gcc.target/aarch64/sve/ext_4.c: Likewise. * gcc.target/aarch64/sve/rev_2.c: Likewise. * gcc.target/aarch64/sve/revhw_1.c: Likewise. * gcc.target/aarch64/sve/revhw_2.c: Likewise. * gcc.target/aarch64/sve/slp_perm_8.c: Likewise. * gcc.target/aarch64/sve/trn1_2.c: Likewise. * gcc.target/aarch64/sve/trn2_2.c: Likewise. * gcc.target/aarch64/sve/uzp1_2.c: Likewise. * gcc.target/aarch64/sve/uzp2_2.c: Likewise. * gcc.target/aarch64/sve/zip1_2.c: Likewise. * gcc.target/aarch64/sve/zip2_2.c: Likewise.
2020-11-06Add -fbit-tests option.Martin Liska5-1/+45
gcc/ChangeLog: * common.opt: Add new -fbit-tests option. * doc/invoke.texi: Document the option. * tree-switch-conversion.c (bit_test_cluster::find_bit_tests): Use the option. * tree-switch-conversion.h (is_enabled): New function. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/switch-4.c: New test.
2020-11-06make PRE constant value IDs negativeRichard Biener3-34/+69
This separates constant and non-constant value-ids to allow for a more efficient constant_value_id_p and for more efficient bit-packing inside the bitmap sets which never contain any constant values. There's further optimization opportunities but at this stage I'll do small refactorings. 2020-11-06 Richard Biener <rguenther@suse.de> * tree-ssa-sccvn.h (get_max_constant_value_id): Declare. (get_next_constant_value_id): Likewise. (value_id_constant_p): Inline and simplify. * tree-ssa-sccvn.c (constant_value_ids): Remove. (next_constant_value_id): Add. (get_or_alloc_constant_value_id): Adjust. (value_id_constant_p): Remove definition. (get_max_constant_value_id): Define. (get_next_value_id): Add assert for overflow. (get_next_constant_value_id): Define. (run_rpo_vn): Adjust. (free_rpo_vn): Likewise. (do_rpo_vn): Initialize next_constant_value_id. * tree-ssa-pre.c (constant_value_expressions): New. (add_to_value): Split into constant/non-constant value handling. Avoid exact re-allocation. (vn_valnum_from_value_id): Adjust. (phi_translate_1): Remove spurious exact re-allocation. (bitmap_find_leader): Adjust. Make sure we return a CONSTANT value for a constant value id. (do_pre_regular_insertion): Use 2 auto-elements for avail. (do_pre_partial_partial_insertion): Likewise. (init_pre): Allocate constant_value_expressions. (fini_pre): Release constant_value_expressions.
2020-11-06tree-optimization/97706 - handle PHIs in pattern recog mask precisonRichard Biener2-35/+135
This adds handling of PHIs to mask precision compute which is eventually needed to detect a bool pattern when the def chain contains such a PHI node. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97706 * tree-vect-patterns.c (possible_vector_mask_operation_p): PHIs are possible mask operations. (vect_determine_mask_precision): Handle PHIs. (vect_determine_precisions): Walk PHIs in BB analysis. * gcc.dg/vect/bb-slp-pr97706.c: New testcase.
2020-11-06c++: Parser tweaksNathan Sidwell1-3/+7
We need to adjust the wording for 'export'. Between c++11 and c++20 it is deprecated. Outside those ranges it is unsupported (at the moment). While here, there's also an unneeded setting of a bool -- it's inside an if block that just checked it was true. gcc/cp/ * parser.c (cp_parser_template_declaration): Adjust 'export' warning. (cp_parser_explicit_specialization): Remove unneeded bool setting.
2020-11-06testsuite: fix malloc alignment in testKewen Lin1-1/+7
gcc/testsuite/ChangeLog: PR gcov-profile/97461 * gcc.dg/tree-prof/pr97461.c: Return aligned memory.
2020-11-06[Fortran] Remove OpenACC 'loop' inside 'parallel' special-case codeThomas Schwinge2-49/+12
Instead, use the generic middle-end code, like already used for Fortran OpenACC 'loop' inside other compute constructs, orphaned 'loop' constructs, and C, C++ generally. gcc/fortran/ * openmp.c (oacc_is_parallel, resolve_oacc_params_in_parallel): Remove. (resolve_oacc_loop_blocks): Don't call the former. gcc/testsuite/ * gfortran.dg/goacc/loop-2-parallel-3.f95: Adjust.
2020-11-06Remove 'gfortran.dg/goacc/loop-6.f95'Thomas Schwinge1-74/+0
What it's testing is adequately covered in other 'gfortran.dg/goacc/loop-2-parallel-*.f95' testcases. gcc/testsuite/ * gfortran.dg/goacc/loop-6.f95: Remove.
2020-11-06Remove 'gfortran.dg/goacc/loop-5.f95'Thomas Schwinge1-357/+0
What it's testing is adequately covered in other 'gfortran.dg/goacc/loop-2-*-tile.f95' testcases. gcc/testsuite/ * gfortran.dg/goacc/loop-5.f95: Remove.
2020-11-06refactor SLP analysisRichard Biener1-60/+45
This passes down the graph entry kind down to vect_analyze_slp_instance which simplifies it and makes it a shallow wrapper around vect_build_slp_instance. 2020-11-06 Richard Biener <rguenther@suse.de> * tree-vect-slp.c (vect_analyze_slp): Pass down the SLP graph entry kind. (vect_analyze_slp_instance): Simplify. (vect_build_slp_instance): Adjust. (vect_slp_check_for_constructors): Perform more eligibility checks here.
2020-11-06Move ipa-refs from ggc to heap.Jan Hubicka5-29/+24
gcc/ChangeLog: * ipa-ref.h (enum ipa_ref_use): Remove GTY marker. (struct ipa_ref): Remove GTY marker; reorder for better packing. (struct ipa_ref_list): Remove GTY marker; turn references nad referring to va_heap, vl_ptr vectors; update accesors. * cgraph.h (symtab_node::iterate_reference): Update. * ipa-ref.c (ipa_ref::remove_reference): Update. * symtab.c (symtab_node::create_reference): Update. (symtab_node::remove_all_references): Update. (symtab_node::resolve_alias): Update. gcc/cp/ChangeLog: * tree.c (cp_fix_function_decl_p): Do not access ipa_ref_list dirrectly.
2020-11-06ipa-modref: Fix comment typosJakub Jelinek2-19/+19
2020-11-06 Jakub Jelinek <jakub@redhat.com> * ipa-modref-tree.h: Fix comment typos. * ipa-modref.c: Likewise.
2020-11-06IBM Z: Remove override of inline paramsAndreas Krebbel1-7/+0
We have pretty aggressive values for inline-min-speedup and max-inline-insns-auto. This unfortunately made more maybe uninitialized warnings to appear when building on Z. With the patch we go back to the default values. gcc/ChangeLog: * config/s390/s390.c (s390_option_override_internal): Remove override of inline params.
2020-11-06tree-optimization/97706 - part one, refactor vect_determine_mask_precisionRichard Biener1-80/+81
This computes vect_determine_mask_precision in a RPO forward walk rather than in a backward walk and using a worklist. It will make fixing PR97706 easier but for bisecting I wanted it to be separate. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97706 * tree-vect-patterns.c (vect_determine_mask_precision): Remove worklist operation. (vect_determine_stmt_precisions): Do not call vect_determine_mask_precision here. (vect_determine_precisions): Compute mask precision in a forward walk.
2020-11-06OpenACC/Fortran: Reject '!$acc atomic update capture'Tobias Burnus4-5/+122
gcc/fortran/ChangeLog: * openmp.c (gfc_match_oacc_atomic): No longer accept 'update capture'. gcc/testsuite/ChangeLog: * gfortran.dg/goacc-gomp/goacc-gomp.exp: New. * gfortran.dg/goacc-gomp/atomic.f90: New test. * gfortran.dg/goacc/atomic.f90: New test.
2020-11-06OpenACC (C/C++): Fix 'acc atomic' parsingTobias Burnus4-10/+110
gcc/c/ChangeLog: * c-parser.c (c_parser_omp_atomic): Add openacc parameter and update OpenACC matching. (c_parser_omp_construct): Update call. gcc/cp/ChangeLog: * parser.c (cp_parser_omp_atomic): Add openacc parameter and update OpenACC matching. (cp_parser_omp_construct): Update call. gcc/testsuite/ChangeLog: * c-c++-common/goacc-gomp/atomic.c: New test. * c-c++-common/goacc/atomic.c: New test.
2020-11-06tree-optimization/97732 - fix init of SLP induction vectorizationRichard Biener3-1/+16
This PR exposes two issues - one that the vector builder treats &x as eligible for VECTOR_CST elements and one that SLP induction vectorization forgets to convert init elements to the vector component type which makes a difference for pointer vs. integer. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97732 * tree-vect-loop.c (vectorizable_induction): Convert the init elements to the vector component type. * gimple-fold.c (gimple_build_vector): Use CONSTANT_CLASS_P rather than TREE_CONSTANT to determine if elements are eligible for VECTOR_CSTs. * gcc.dg/vect/bb-slp-pr97732.c: New testcase.
2020-11-06Add dg-require-profiling directives to gcc.target/i386 testsOlivier Hainque6-0/+6
This patch adds /* { dg-require-profiling "-pg" } */ to a few tests in gcc.target/i386 that use -pg explicitly, to prevent them from failing during runs for VxWorks targets. 2020-10-29 Olivier Hainque <hainque@adacore.com> gcc/testsuite/ * gcc.target/i386/fentryname1.c: Add dg-require-profiling. * gcc.target/i386/fentryname2.c: Likewise. * gcc.target/i386/fentryname3.c: Likewise. * gcc.target/i386/returninst1.c: Likewise. * gcc.target/i386/returninst2.c: Likewise. * gcc.target/i386/returninst3.c: Likewise.
2020-11-06Add dg-require-effective-target fpic to g++ testsOlivier Hainque5-0/+5
Add missing dg-require-effective-target fpic to few g++.dg tests. 2020-11-02 Olivier Hainque <hainque@adacore.com> gcc/testsuite/ * g++.dg/pr57878.C: Add dg-require-effective-target fpic. * g++.dg/pr65032.C: Likewise. * g++.dg/pr84279.C: Likewise. * g++.dg/inherit/thunk8.C: Likewise. * g++.dg/opt/pr64411.C: Likewise.
2020-11-06Add fnspec handling to ipa mode of ipa-modef.Jan Hubicka6-148/+501
gcc/: * attr-fnspec.h (attr_fnspec::get_str): New accessor * ipa-fnsummary.c (read_ipa_call_summary): Store also parm info for builtins. * ipa-modref.c (class fnspec_summary): New type. (class fnspec_summaries_t): New type. (modref_summary::modref_summary): Initialize writes_errno. (struct modref_summary_lto): Add writes_errno. (modref_summary_lto::modref_summary_lto): Initialize writes_errno. (modref_summary::dump): Check for NULL pointers. (modref_summary_lto::dump): Dump writes_errno. (collapse_loads): Move up in source file. (collapse_stores): New function. (process_fnspec): Handle also internal calls. (analyze_call): Likewise. (analyze_stmt): Store fnspec string if needed. (analyze_function): Initialize fnspec_sumarries. (modref_summaries_lto::duplicate): Copy writes_errno. (modref_write): Store writes_errno and fnspec summaries. (read_section): Read writes_errno and fnspec summaries. (modref_read): Initialize fnspec summaries. (update_signature): Fix formating. (compute_parm_map): Return true if sucessful. (get_parm_type): New function. (get_access_for_fnspec): New function. (propagate_unknown_call): New function. (modref_propagate_in_scc): Use it. (pass_ipa_modref::execute): Delete fnspec_summaries. (ipa_modref_c_finalize): Delete fnspec_summaries. * ipa-prop.c: Include attr-fnspec.h. (ipa_compute_jump_functions_for_bb): Also compute jump functions for functions with fnspecs. (ipa_read_edge_info): Read jump functions for builtins. gcc/testsuite/ChangeLog: * gcc.dg/ipa/modref-2.c: New test. * gcc.dg/lto/modref-2_0.c: New test.
2020-11-06Move size time tables from GGC to heapJan Hubicka2-44/+44
this patch moves size time tables out of ggc allocated memory. This makes sources bit cleaner and saves about 60MB of GGC memory that turns to about 45MB of heap memory for cc1plus LTO build. * ipa-fnsummary.h (class size_time_entry): Do not GTY annotate. (class ipa_fnsummary): Turn size_time_table to auto_vec and call_size_time_table to effecient vec; update constructors. * ipa-fnsummary.c (ipa_fn_summary::account_size_time): Update. (ipa_fn_summary::~ipa_fn_summary): Update. (ipa_fn_summary_t::duplicate): Update. (ipa_dump_fn_summary): Update. (set_switch_stmt_execution_predicate): Update. (analyze_function_body): Update. (estimate_calls_size_and_time): Update. (ipa_call_context::estimate_size_and_time): Update. (ipa_merge_fn_summary_after_inlining): Update. (ipa_update_overall_fn_summary): Update. (inline_read_section): Update. (ipa_fn_summary_write): Update.
2020-11-06c-common: Remove DEBUG_FUNCTION from verify_sequence_pointsJakub Jelinek1-1/+1
While perhaps the function name might suggest that it is a verification/debugging only routine, it is actually implementation of the -Wsequence-point warning and so doesn't need the DEBUG_FUNCTION macro on it. 2020-11-06 Jakub Jelinek <jakub@redhat.com> * c-common.c (verify_sequence_points): Remove DEBUG_FUNCTION.
2020-11-06tree-optimization/97733 - fix SLP of reductions with zero relevantRichard Biener1-0/+3
This adds a missing check. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97733 * tree-vect-slp.c (vect_analyze_slp_instance): If less than two reductions were relevant or live do nothing.
2020-11-06Fortran: Fix type-decl for PDT / wrong-code pdt_14.f03 issue [PR97652]Tobias Burnus1-0/+3
Parameterized derived types are handled in a special way and start with 'Pdt'. If the 'P' is not uppercase, gfc_get_derived_type (which calls gfc_get_module_backend_decl) does not find the existing declaration and builds a new type. The middle end then sees those types as being different and nonalising, creating an endless loop for pdt_14.f03. gcc/fortran/ChangeLog: PR fortran/97652 * module.c (mio_symbol): Fix symbol name for pdt_type.
2020-11-05Improve overflow checkJeff Law2-8/+13
Convert x < (short) ((unsigned short)x + const) to x <= SHORT_MAX – const (and similarly for other integral types) if const is not 0. gcc/ PR tree-optimization/97223 * match.pd (overflow detection and optimization): Handle conversions. gcc/testsuite/ * gcc.dg/no-strict-overflow-4.c: Adjust expected output.
2020-11-05Simplify x >> x to 0. This fixes PR96701.Eugene Rozenfeld2-0/+17
gcc/ * match.pd (x >> x): New pattern. gcc/testsuite * gcc.dg/self-right-shift.c: New test.
2020-11-06RISC-V: Mark non-export symbol static and const in riscv-common.cKito Cheng1-2/+2
gcc/ChangeLog: * common/config/riscv/riscv-common.c (riscv_implied_info): Add static and const. (riscv_subset_list::handle_implied_ext): Add const due to riscv_implied_info changed to const.
2020-11-06PR target/96307: Fix KASAN option checking.Kito Cheng5-1/+38
- Disable kasan if target is unsupported and -fasan-shadow-offset= is not given, no matter `--param asan-stack=1` is given or not. - Moving KASAN option checking testcase to gcc.dg, those testcase could be useful for all other target which not support asan. - Verifed on riscv and x86. gcc/ChangeLog: PR target/96307 * toplev.c (process_options): Remove param_asan_stack checking for kasan option checking. gcc/testsuite/ChangeLog: PR target/96307 * gcc.dg/pr96307.c: New. * gcc.target/riscv/pr96260.c: Move this test case from here to ... * gcc.dg/pr96260.c: ... here. * gcc.target/riscv/pr91441.c: Move this test case from here to ... * gcc.dg/pr91441.c: ... here. * lib/target-supports.exp (check_effective_target_no_fsanitize_address): New proc.
2020-11-06Daily bump.GCC Administrator6-1/+256
2020-11-05c++: Add auto_diagnostic_group to check_handlers_1.Marek Polacek1-0/+1
This was missing. gcc/cp/ChangeLog: * except.c (check_handlers_1): Add auto_diagnostic_group.
2020-11-05c++: Fix decltype(auto) deduction with rvalue ref [PR78209]Marek Polacek2-0/+10
Here's a small deficiency in decltype(auto). [dcl.type.auto.deduct]/5: If the placeholder-type-specifier is of the form decltype(auto), [...] the type deduced for T is determined [...] as though E had been the operand of the decltype. So: int &&i = 0; decltype(auto) j = i; // should behave like int &&j = i; error We deduce j's type in do_auto_deduction via finish_decltype_type which takes an 'id' argument. Currently we compute 'id' as false, because stripped_init is *i (a REFERENCE_REF_P). But it seems to me we should rather set 'id' to true here, by looking through the REFERENCE_REF_P, so that finish_decltype_type DTRT. gcc/cp/ChangeLog: PR c++/78209 * pt.c (do_auto_deduction): If init is REFERENCE_REF_P, use its first operand. gcc/testsuite/ChangeLog: PR c++/78209 * g++.dg/cpp1y/decltype-auto1.C: New test.
2020-11-05c++: Add -Wexceptions warning option [PR97675]Marek Polacek6-8/+36
This PR asks that we add a warning option for an existing (very old) warning, so that it can be disabled selectively. clang++ uses -Wexceptions for this, so I added this new option rather than using e.g. -Wnoexcept. gcc/c-family/ChangeLog: PR c++/97675 * c.opt (Wexceptions): New option. gcc/cp/ChangeLog: PR c++/97675 * except.c (check_handlers_1): Use OPT_Wexceptions for the warning. Use inform for the second part of the warning. gcc/ChangeLog: PR c++/97675 * doc/invoke.texi: Document -Wexceptions. gcc/testsuite/ChangeLog: PR c++/97675 * g++.old-deja/g++.eh/catch10.C: Adjust dg-warning. * g++.dg/warn/Wexceptions1.C: New test. * g++.dg/warn/Wexceptions2.C: New test.
2020-11-05c++: Implement -Wvexing-parse [PR25814]Marek Polacek25-21/+615
This patch implements the -Wvexing-parse warning to warn about the sneaky most vexing parse rule in C++: the cases when a declaration looks like a variable definition, but the C++ language requires it to be interpreted as a function declaration. This warning is on by default (like clang++). From the docs: void f(double a) { int i(); // extern int i (void); int n(int(a)); // extern int n (int); } Another example: struct S { S(int); }; void f(double a) { S x(int(a)); // extern struct S x (int); S y(int()); // extern struct S y (int (*) (void)); S z(); // extern struct S z (void); } You can find more on this in [dcl.ambig.res]. I spent a fair amount of time on fix-it hints so that GCC can recommend various ways to resolve such an ambiguity. Sometimes that's tricky. E.g., suggesting default-initialization when the class doesn't have a default constructor would not be optimal. Suggesting {}-init is also not trivial because it can use an initializer-list constructor if no default constructor is available (which ()-init wouldn't do). And of course, pre-C++11, we shouldn't be recommending {}-init at all. I also uncovered a bug in cp_parser_declarator, where we were setting *parenthesized_p to true despite the comment saying the exact opposite. gcc/c-family/ChangeLog: PR c++/25814 * c.opt (Wvexing-parse): New option. gcc/cp/ChangeLog: PR c++/25814 * cp-tree.h (enum cp_tree_index): Add CPTI_EXPLICIT_VOID_LIST. (explicit_void_list_node): Define. (PARENTHESIZED_LIST_P): New macro. (struct cp_declarator): Add function::parens_loc. * decl.c (cxx_init_decl_processing): Initialize explicit_void_list_node. (grokparms): Also break when explicit_void_list_node. * parser.c (make_call_declarator): New location_t parameter. Use it to set declarator->u.function.parens_loc. (cp_parser_lambda_declarator_opt): Pass UNKNOWN_LOCATION to make_call_declarator. (warn_about_ambiguous_parse): New function. (cp_parser_init_declarator): Call warn_about_ambiguous_parse. (cp_parser_declarator): Set *parenthesized_p to false rather than to true. (cp_parser_direct_declarator): Create a location for the function's parentheses and pass it to make_call_declarator. (cp_parser_parameter_declaration_clause): Return explicit_void_list_node for (void). (cp_parser_parameter_declaration_list): Set PARENTHESIZED_LIST_P in the parameters tree. gcc/ChangeLog: PR c++/25814 * doc/invoke.texi: Document -Wvexing-parse. gcc/testsuite/ChangeLog: PR c++/25814 * g++.dg/cpp2a/fn-template16.C: Add a dg-warning. * g++.dg/cpp2a/fn-template7.C: Likewise. * g++.dg/lookup/pr80891-5.C: Likewise. * g++.dg/lto/pr79050_0.C: Add extern. * g++.dg/lto/pr84805_0.C: Likewise. * g++.dg/parse/pr58898.C: Add a dg-warning. * g++.dg/template/scope5.C: Likewise. * g++.old-deja/g++.brendan/recurse.C: Likewise. * g++.old-deja/g++.jason/template4.C: Likewise. * g++.old-deja/g++.law/arm4.C: Likewise. * g++.old-deja/g++.mike/for2.C: Likewise. * g++.old-deja/g++.other/local4.C: Likewise. * g++.old-deja/g++.pt/crash3.C: Likewise. * g++.dg/warn/Wvexing-parse.C: New test. * g++.dg/warn/Wvexing-parse2.C: New test. * g++.dg/warn/Wvexing-parse3.C: New test. * g++.dg/warn/Wvexing-parse4.C: New test. * g++.dg/warn/Wvexing-parse5.C: New test. * g++.dg/warn/Wvexing-parse6.C: New test. * g++.dg/warn/Wvexing-parse7.C: New test. libstdc++-v3/ChangeLog: PR c++/25814 * testsuite/20_util/reference_wrapper/lwg2993.cc: Add a dg-warning. * testsuite/25_algorithms/generate_n/87982_neg.cc: Likewise.
2020-11-05Pass multi-range from range_query::value_* routinesAndrew MacLeod3-9/+37
fix range-ops equal/not_equal to not reuse the result range as intermediary. value_query::value routines should pasa multi-range in as some other rangeop routines build into this result, so we may need better precision. gcc/ PR tree-optimization/97725 * range-op.cc (operator_equal::fold_range): Use new tmp value. (operator_not_equal::fold_range): Ditto. * value-query.cc (range_query::value_of_expr): Use int_range_max not a value_range. (range_query::value_on_edge): Ditto. (range_query::value_of_stmt): Ditto. gcc/testsuite/ * gcc.dg/pr97725.c: New.