aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-08-30c++: Add warning about missing 'requires'Jason Merrill4-2/+47
I noticed that concepts-lambda14.C had two useless requires-expressions: static_assert(requires { C<T>; }); always succeeds, because C<T> is always a valid expression for any type, regardless of whether C is satisfied for a particular type. Presumably the user means static_assert(requires { requires C<T>; }); to make the C<T> a nested-requirement. Of course, static_assert(C<T>); is much simpler and means the same thing; this is more relevant in the middle of a longer requires-expression, such as the bug this warning found in cmcstl2: template<class I> META_CONCEPT input_iterator = input_or_output_iterator<I> && readable<I> && requires(I& i, const I& ci) { typename iterator_category_t<I>; derived_from<iterator_category_t<I>, input_iterator_tag>; i++; }; where 'requires' is missing before 'derived_from'. gcc/ChangeLog: * doc/invoke.texi: Document -Wmissing-requires. gcc/c-family/ChangeLog: * c.opt: Add -Wmissing-requires. gcc/cp/ChangeLog: * parser.c (cp_parser_simple_requirement): Warn about missing requires. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-lambda14.C: Add expected warnings.
2021-08-30Fortran - correct check for constraint F2008:C628 / F2018:C932Harald Anlauf2-2/+21
gcc/fortran/ChangeLog: PR fortran/101349 * resolve.c (resolve_allocate_expr): An unlimited polymorphic argument to ALLOCATE must be ALLOCATABLE or a POINTER. Fix the corresponding check. gcc/testsuite/ChangeLog: PR fortran/101349 * gfortran.dg/unlimited_polymorphic_33.f90: New test.
2021-08-30rs6000: Always initialize vector_pair and vector_quad nodesBill Schmidt1-26/+23
2021-08-24 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (rs6000_init_builtins): Remove TARGET_EXTRA_BUILTINS guard.
2021-08-30rs6000: Add sanity to V2DI_type_node definitionsBill Schmidt1-7/+24
2021-08-30 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (rs6000_init_builtins): Change initialization of V2DI_type_node and unsigned_V2DI_type_node.
2021-08-30rs6000: Darwin builtin supportBill Schmidt2-2/+12
2021-03-04 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): Use the new decl when new_builtins_are_live. * config/rs6000/rs6000-builtin-new.def (__builtin_cfstring): New built-in.
2021-08-30Update gcc sv.po.Joseph Myers1-3/+3
* sv.po: Update.
2021-08-30Enable store fusion on Power10.Pat Haugen5-1/+163
gcc/ChangeLog: * config/rs6000/rs6000-cpus.def (ISA_3_1_MASKS_SERVER): Add OPTION_MASK_P10_FUSION_2STORE. (POWERPC_MASKS): Likewise. * config/rs6000/rs6000.c (rs6000_option_override_internal): Enable store fusion for Power10. (is_fusable_store): New. (power10_sched_reorder): Likewise. (rs6000_sched_reorder): Do Power10 specific reordering. (rs6000_sched_reorder2): Likewise. * config/rs6000/rs6000.opt: Add new option. gcc/testsuite/ChangeLog: * gcc.target/powerpc/fusion-p10-stst.c: New test. * gcc.target/powerpc/fusion-p10-stst2.c: New test.
2021-08-30tree-optimization/102128 - rework if-converted BB vect heuristicRichard Biener1-54/+58
This reworks the previous attempt to avoid leaving around if-converted scalar code in BB vectorized loop bodies to keep costing independent subgraphs which should address the observed regression with 519.lbm_r. For this to work we now first cost all subgraphs and only after doing that proceed to emit vectorized code. 2021-08-30 Richard Biener <rguenther@suse.de> PR tree-optimization/102128 * tree-vect-slp.c (vect_bb_vectorization_profitable_p): Move scanning for if-converted scalar code to the caller and instead delay clearing the visited flag for profitable subgraphs. (vect_slp_region): Cost all subgraphs before scheduling. For if-converted BB vectorization scan for scalar COND_EXPRs and do not vectorize if any found and the cost model is very-cheap.
2021-08-30Make sure -fexceptions is enabled when -fnon-call-exceptions isRichard Biener2-2/+3
This makes -fexceptions enabled by -fnon-call-exceptions, removing the odd state of !flag_exceptions && flag_non_call_exceptions from middle-end consideration. 2021-08-30 Richard Biener <rguenther@suse.de> * common.opt (fexceptions): Mark EnabledBy(fnon-call-exceptions). * doc/invoke.texi (fnon-call-exceptions): Document this enables -fexceptions.
2021-08-30Use __builtin_trap() for abort() if inhibit_libcSebastian Huber1-1/+1
abort() is used in gcc_assert() and gcc_unreachable() which is used by target libraries such as libgcov.a. This patch changes the abort() definition under certain conditions. If inhibit_libc is defined and abort is not already defined, then abort() is defined to __builtin_trap(). The inhibit_libc define is usually defined if GCC is built for targets running in embedded systems which may optionally use a C standard library. If inhibit_libc is defined, then there may be still a full featured abort() available. abort() is a heavy weight function which depends on signals and file streams. For statically linked applications, this means that a dependency on gcc_assert() pulls in the support for signals and file streams. This could prevent using gcov to test low end targets for example. Using __builtin_trap() avoids these dependencies if the target implements a "trap" instruction. The application or operating system could use a trap handler to react to failed GCC runtime checks which caused a trap. gcc/ * tsystem.h (abort): Define abort() if inhibit_libc is defined and it is not already defined.
2021-08-30Make sure we're playing with integral modes before call ↵liuhongt1-25/+78
extract_integral_bit_field. gcc/ChangeLog: * expmed.c (extract_bit_field_1): Make sure we're playing with integral modes before call extract_integral_bit_field. (extract_integral_bit_field): Add a parameter of type scalar_int_mode which corresponds to of tmode. And call extract_and_convert_fixed_bit_field instead of extract_fixed_bit_field and convert_extracted_bit_field. (extract_and_convert_fixed_bit_field): New function, it's a combination of extract_fixed_bit_field and convert_extracted_bit_field.
2021-08-30Daily bump.GCC Administrator4-1/+86
2021-08-29Darwin: Fixes for darwin_libc_has_function.Iain Sandoe1-5/+9
Firstly, the checks for availability need not be run for any currently supported Darwin version (or for any version of Darwin on x86). In fact, the only test that is needed that differs from the default is for the availbaility of sincos. Test that and then fall back to the default implementation. Secondly, the funtion appears to be called from the Jit library before the value of darwin_macosx_version_min has been set up - at present we work around this by guarding the checks on having a non-null pointer for darwin_macosx_version_min. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.c (darwin_libc_has_function): Do not run the checks for x86 or modern Darwin. Make sure that there is a value set for darwin_macosx_version_min before testing.
2021-08-29d: Call the assertp and boundsp variants for assert and array contract failures.Iain Buclaw6-109/+173
gcc/d/ChangeLog: * d-codegen.cc: Include dmd/module.h. (build_filename_from_loc): New function. (d_assert_call): Rename to... (build_assert_call): ...this. (build_array_bounds_call): Call arrayboundsp variant of the array bounds failure callback. (build_bounds_condition): Rename to... (build_bounds_index_condition): ...this. Update signature. (build_bounds_slice_condition): New function. (checkaction_trap_p): New function. (d_assert_call): Call assertp variant of assert failure callback. * d-tree.h (class IndexExp): Declare. (class SliceExp): Declare. (build_bounds_condition): Remove. (build_assert_call): Declare. (build_bounds_index_condition): Declare. (build_bounds_slice_condition): Declare. (checkaction_trap_p): Declare. (d_assert_call): Remove. * expr.cc (ExprVisitor::visit(IndexExp *)): Call build_bounds_index_condition. (ExprVisitor::visit(SliceExp *)): Call build_bounds_slice_condition. (ExprVisitor::visit(AssertExp *)): Update setting of libcall. * runtime.cc (enum d_libcall_type): Add LCT_IMMUTABLE_CHARPTR. (get_libcall_type): Handle LCT_IMMUTABLE_CHARPTR. * runtime.def (ASSERT): Rename to... (ASSERTP): ...this. Update signature. (UNITTEST): Rename to... (UNITTESTP): ...this. Update signature. (ARRAY_BOUNDS): Rename to... (ARRAYBOUNDSP): ...this. Updates signature. * toir.cc (IRVisitor::visit(SwitchErrorStatement *)): Update call.
2021-08-29d: Update comment for TypeInfoVisitor::layout_baseIain Buclaw1-2/+1
gcc/d/ChangeLog: * typeinfo.cc (class TypeInfoVisitor::layout_base): Update comment.
2021-08-29d: Use `int` to store class and struct flagsIain Buclaw1-3/+3
gcc/d/ChangeLog: * typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration *)): Use int to store type flags. (TypeInfoVisitor::visit(TypeInfoStructDeclaration *)): Likewise.
2021-08-29d: Get __c_wchar_t type from build_frontend_typeIain Buclaw1-1/+2
gcc/d/ChangeLog: * types.cc (TypeVisitor::visit(TypeEnum*)): Get wchar_t type from build_frontend_type.
2021-08-29d: Convert convert_for_rvalue switch statement into if conditionIain Buclaw1-3/+1
gcc/d/ChangeLog: * d-convert.cc (convert_for_rvalue): Convert switch statement into if condition.
2021-08-29d: Use POINTER_SIZE for testing whether to predefine D_LP64Iain Buclaw1-1/+1
gcc/d/ChangeLog: * d-builtins.cc (d_init_versions): Use POINTER_SIZE for testing whether to predefine D_LP64.
2021-08-29d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094)Iain Buclaw2-0/+19
User defined types have the TYPE_CXX_ODR_P flag set, but closure frames did not. This mismatch led to an ICE in the conflict detection for ODR and interoperable non-ODR types. As a given closure frame is tied explicitly to a function, it already conforms to ODR. PR d/102094 gcc/d/ChangeLog: * d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P. gcc/testsuite/ChangeLog: * gdc.dg/lto/pr102094_0.d: New test.
2021-08-29testsuite, Darwin : Skip a test requiring strndup in libc.Iain Sandoe1-0/+1
Before Darwin11 there is no strndup in libc. This test fails with warning output because of that - so skip it on these versions (since they are not able to use strndup anyway). gcc/testsuite/ChangeLog: * gcc.dg/analyzer/strndup-1.c: Skip for Darwin versions without strndup support in libc.
2021-08-29Darwin, X86 : Implement __cache_clear.Iain Sandoe1-0/+5
We had a NOP cache clear, but there is a suitable mechanism provided by a system call. This connects it up. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/i386/darwin.h (CLEAR_INSN_CACHE): New.
2021-08-29Daily bump.GCC Administrator4-1/+38
2021-08-28Improve handling of table overflows in modref_ref_nodeJan Hubicka2-49/+264
gcc/ChangeLog: * ipa-modref-tree.h (modref_access_node::merge): Break out logic combining offsets and logic merging ranges to ... (modref_access_node::combined_offsets): ... here (modref_access_node::update2): ... here (modref_access_node::closer_pair_p): New member function. (modref_access_node::forced_merge): New member function. (modre_ref_node::insert): Do merging when table is full. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/modref-9.c: New test.
2021-08-28Fortran - reject function entries with mismatched characteristicsHarald Anlauf2-0/+29
gcc/fortran/ChangeLog: PR fortran/87737 * resolve.c (resolve_entries): For functions of type CHARACTER tighten the checks for matching characteristics. gcc/testsuite/ChangeLog: PR fortran/87737 * gfortran.dg/entry_24.f90: New test.
2021-08-28MIPS: use N64 ABI by default if the triple end with -gnuabi64YunQiang Su1-0/+14
gcc/ChangeLog: PR target/102089 * config.gcc: MIPS: use N64 ABI by default if the triple end with -gnuabi64, which is used by Debian since 2013.
2021-08-28fix latent bootstrap-debug issueAlexandre Oliva2-3/+4
I've hit a bootstrap-debug error involving large subprograms in gcc/ada/sem_ch12.adb. I'm afraid I couldn't narrow it down to a reasonable testcase. thread1 made different decisions about a block containing a builtin_eh_filter call because in one compilation, estimate_num_insns found a cgraph_node for the builtin and could thus get to the is_simple_builtin test, but in the other it didn't. With different insn counts, one stage jump-threaded and the other didn't, and the resulting code diverged quite a bit. The reason the builtin had a cgraph_node in one case but not the other was that modref got a chance to analyze the builtin call when it was the first stmt in the block, and that created the cgraph_node. However, when it was preceded by debug stmts, the loop in analyze_function was cut short after the first debug stmt, because the summary so far was not useful. This patch fixes both issues: skip debug stmts in the analyze_function loop, so as to prevent them from affecting any decisions in the loop, and enable the insn count estimator to get to the is_simple_builtin test when a cgraph_node has not been created for the builtin. for gcc/ChangeLog * ipa-modref.c (analyze_function): Skip debug stmts. * tree-inline.c (estimate_num_insn): Consider builtins even without a cgraph_node.
2021-08-28Daily bump.GCC Administrator4-1/+137
2021-08-27c++: Set type on dependent ARROW_EXPRJason Merrill1-3/+9
Even if the operand of -> has dependent type, if it's a pointer we know that the result will be the target type of that pointer. This should avoid some unnecessary TYPEOF_EXPR when looking up a name after ->. gcc/cp/ChangeLog: * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is a dependent pointer.
2021-08-27Support limited setcc for H8Jeff Law5-35/+89
gcc/ * config/h8300/bitfield.md (cstore<mode>4): Remove expander. * config/h8300/h8300.c (h8300_expand_branch): Remove function. * config/h8300/h8300-protos.h (h8300_expadn_branch): Remove prototype. * config/h8300/h8300.md (eqne): New code iterator. (geultu, geultu_to_c): Similarly. * config/h8300/testcompare.md (cstore<mode>4): Dummy expander. (store_c_<mode>, store_c_i_<mode>): New define_insn_and_splits (cmp<mode>_c): New pattern
2021-08-27Update comments in float128-call.c test.Michael Meissner1-5/+7
Segher asked that I update the comments to include the d-form vector stores (even though they wouldn't be generated by this test). 2021-08-25 Michael Meissner <meissner@linux.ibm.com> gcc/testsuite/ * gcc.target/powerpc/float128-call.c: Update comments.
2021-08-27Reduce vector comparison of uniform vectors to a scalar comparisonJeff Law1-0/+65
gcc/ * tree-ssa-dom.c (reduce_vector_comparison_to_scalar_comparison): New function. (dom_opt_dom_walker::optimize_stmt): Use it.
2021-08-27Fix float128-call.c test for power8 IEEE 128 and power10.Michael Meissner1-8/+19
I built a compiler on a little endian power8 system where the default long double was IEEE 128-bit instead of IBM 128-bit. I discovered that on power8, we would generate a lxvd2x and xxpermdi to deal with the endianess instead of the Altivec lxv. In addition, I noticed the constant that was being loaded (1.0q) could be loaded by the lxvkq instruction. I rewrote the test to handle all forms of vector load and store that can be generated. 2021-08-27 Michael Meissner <meissner@linux.ibm.com> gcc/testsuite/ * gcc.target/powerpc/float128-call.c: Fix test for IEEE 128-bit long double and power10.
2021-08-27Darwin : Mark the mod init/term section starts with a linker-visible sym.Iain Sandoe2-5/+35
Some newer assemblers emit section start temp symbols for mod init and term sections if there is no suitable symbol present already. The temp symbols are linker visible and therefore appear in the symbol tables. Since the temp symbol number can vary when debug is enabled, that causes compare-debug fails. The solution is to provide a stable linker-visible symbol. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.c (finalize_ctors): Add a section-start linker- visible symbol. (finalize_dtors): Likewise. * config/darwin.h (MIN_LD64_INIT_TERM_START_LABELS): New.
2021-08-27rs6000: Execute the automatic built-in initialization codeBill Schmidt2-2/+14
2021-08-27 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (rs6000-builtins.h): New #include. (rs6000_init_builtins): Call rs6000_init_generated_builtins. Skip the old initialization logic when new builtins are enabled. * config/rs6000/rs6000-gen-builtins.c (write_decls): Rename rs6000_autoinit_builtins to rs6000_init_generated_builtins. (write_init_file): Likewise.
2021-08-27testsuite, Darwin : Do not claim 'GAS' for cctools assembler.Iain Sandoe1-1/+8
Although the cctools assembler is based of GNU GAS, it is from a very old version (1.38) which does not support many of the features that the target supports test is expecting. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Exclude cctools assembler based on GAS 1.38.
2021-08-27configure: Adjust several assembler checks to remove an unused parm.Iain Sandoe1-5/+5
In r12-3048-ge0b6d0b39c6, the GAS version parameter was removed from the gcc_GAS_CHECK_FEATURE macro. It seems that overlapping comit/test cycles resulted in several AMDGCN and one Darwin commit with the now extra parameter still present. This causes wrong configure code to be generated when autoreconf is used in the gcc directory. Fixed by removing the extraneous parm from the AMDGCN and Darwin cases. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * configure.ac (darwin2[[0-9]]* | darwin19*): Alter use of gcc_GAS_CHECK_FEATURE to remove an extraneous parameter. (amdgcn-* | gcn-*) Likewise.
2021-08-27call_summary: add missing template keywordAnthony Sharp1-2/+2
Without the 'template', this function template compares 'traverse' to 'f', and then compares the result to 'a'. Evidently it hasn't been instantiated yet. gcc/ChangeLog: * symbol-summary.h: Added missing template keyword.
2021-08-27tree-optimization/45178 - DCE of dead control flow in infinite loopRichard Biener2-9/+14
This fixes DCE to be able to elide dead control flow in an infinite loop without an exit edge. This special situation is handled well by the code finding an edge to preserve since there's no chance it will find the exit edge and make the loop finite. 2021-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/45178 * tree-ssa-dce.c (find_obviously_necessary_stmts): For infinite loops without exit do not mark control dependent edges of the latch necessary. * gcc.dg/tree-ssa/ssa-dce-3.c: Adjust testcase.
2021-08-27i386: Fix wrong optimization for consecutive masked scatters [PR 101472]konglin13-8/+140
gcc/ChangeLog: PR target/101472 * config/i386/sse.md: (<avx512>scattersi<mode>): Add mask operand to UNSPEC_VSIBADDR. (<avx512>scattersi<mode>): Likewise. (*avx512f_scattersi<VI48F:mode>): Merge mask operand to set_dest. (*avx512f_scatterdi<VI48F:mode>): Likewise gcc/testsuite/ChangeLog: PR target/101472 * gcc.target/i386/avx512f-pr101472.c: New test. * gcc.target/i386/avx512vl-pr101472.c: New test.
2021-08-26rs6000: Make some BIFs vectorized on P10Kewen Lin10-0/+335
This patch is to add the support to make vectorizer able to vectorize some built-in function scalar versions on Power10. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_builtin_md_vectorized_function): Add support for built-in functions MISC_BUILTIN_DIVWE, MISC_BUILTIN_DIVWEU, MISC_BUILTIN_DIVDE, MISC_BUILTIN_DIVDEU, P10_BUILTIN_CFUGED, P10_BUILTIN_CNTLZDM, P10_BUILTIN_CNTTZDM, P10_BUILTIN_PDEPD and P10_BUILTIN_PEXTD on Power10. gcc/testsuite/ChangeLog: * gcc.target/powerpc/dive-vectorize-1.c: New test. * gcc.target/powerpc/dive-vectorize-1.h: New test. * gcc.target/powerpc/dive-vectorize-2.c: New test. * gcc.target/powerpc/dive-vectorize-2.h: New test. * gcc.target/powerpc/dive-vectorize-run-1.c: New test. * gcc.target/powerpc/dive-vectorize-run-2.c: New test. * gcc.target/powerpc/p10-bifs-vectorize-1.c: New test. * gcc.target/powerpc/p10-bifs-vectorize-1.h: New test. * gcc.target/powerpc/p10-bifs-vectorize-run-1.c: New test.
2021-08-26rs6000: Add missing unsigned info for some P10 bifsKewen Lin1-0/+5
This patch is to make prototypes of some Power10 built-in functions consistent with what's in the documentation, as well as the vector version. Otherwise, useless conversions can be generated in gimple IR, and the vectorized versions will have inconsistent types. gcc/ChangeLog: * config/rs6000/rs6000-call.c (builtin_function_type): Add unsigned signedness for some Power10 bifs.
2021-08-26aix: packed struct alignment [PR102068]David Edelsohn1-1/+1
Further fixes to structure alignment when the structure is packed and contains double. This patch checks for packed attribute at the top level. gcc/ChangeLog: PR target/102068 * config/rs6000/rs6000.c (rs6000_adjust_field_align): Use computed alignment if the entire struct has attribute packed.
2021-08-27Fold more shuffle builtins to VEC_PERM_EXPR.liuhongt4-24/+88
A follow-up to https://gcc.gnu.org/pipermail/gcc-patches/2019-May/521983.html gcc/ PR target/98167 PR target/43147 * config/i386/i386.c (ix86_gimple_fold_builtin): Fold IX86_BUILTIN_SHUFPD512, IX86_BUILTIN_SHUFPS512, IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS, IX86_BUILTIN_SHUFPS256. (ix86_masked_all_ones): New function. gcc/testsuite/ * gcc.target/i386/avx512f-vshufpd-1.c: Adjust testcase. * gcc.target/i386/avx512f-vshufps-1.c: Adjust testcase. * gcc.target/i386/pr43147.c: New test.
2021-08-27Daily bump.GCC Administrator3-1/+109
2021-08-26[i386] Call force_reg unconditionally.Uros Bizjak2-13/+8
There is no point to check RTXes before calling force_reg, force_reg checks for REG RTX by itself. 2021-08-26 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/i386.md (*btr<mode>_1): Call force_reg unconditionally. (conditional moves with memory inputs splitters): Ditto. * config/i386/sse.md (one_cmpl<mode>2): Simplify.
2021-08-26Fix ipa-modref verification icesJan Hubicka1-9/+24
* ipa-modref-tree.h (modref_access_node::try_merge_with): Restart search after merging.
2021-08-26rs6000: Add remaining overloadsBill Schmidt1-0/+6083
2021-08-26 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-overload.def: Add remaining overloads.
2021-08-26rs6000: Add Cell builtinsBill Schmidt1-0/+27
2021-06-07 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-builtin-new.def: Add cell stanza.
2021-08-26rs6000: Add miscellaneous builtinsBill Schmidt1-0/+215
2021-06-15 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-builtin-new.def: Add ieee128-hw, dfp, crypto, and htm stanzas.