aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-11Fix segfault on elaboration of empty 1-element array at -OEric Botcazou2-42/+25
This is a rather obscure case where the elaboration of an empty array whose base type is an array type of length at most 1 goes awry when the code is compiled with optimization. gcc/ada/ChangeLog: * gcc-interface/trans.c (can_be_lower_p): Remove. (Regular_Loop_to_gnu): Add ENTRY_COND unconditionally if BOTTOM_COND is non-zero. gcc/testsuite/ChangeLog: * gnat.dg/opt89.adb: New test.
2020-11-11Fix internal error on chain of constants with -gnatcEric Botcazou1-4/+7
gcc/ada/ChangeLog: * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: In case the constant is not being defined, get the expression in type annotation mode only if its type is elementary.
2020-11-11Fix internal error with Shift_Right operator on signed typeEric Botcazou3-1/+18
This is a regression present on the mainline and 10 branch in the form of an ICE with a shift operator applied to a variable of a signed type, and which is caused by a type mismatch. gcc/ada/ChangeLog: * gcc-interface/trans.c (gnat_to_gnu) <N_Op_Shift>: Also convert GNU_MAX_SHIFT if the type of the operation has been changed. * gcc-interface/utils.c (can_materialize_object_renaming_p): Add pair of missing parentheses. gcc/testsuite/ChangeLog: * gnat.dg/shift1.adb: New test.
2020-11-11testsuite/97797 - adjust GIMPLE tests for sizetypeRichard Biener2-8/+8
Tested on x86_64-unknown-linux-gnu, pushed. 2020-11-11 Richard Biener <rguenther@suse.de> PR testsuite/97797 * gcc.dg/torture/ssa-fre-5.c: Use __SIZETYPE__ where appropriate. * gcc.dg/torture/ssa-fre-6.c: Likewise.
2020-11-11tree-optimization/97623 - Avoid PRE hoist insertion iterationRichard Biener6-25/+26
The recent previous change in this area limited hoist insertion iteration via a param but the following is IMHO better since we are not really interested in PRE opportunities exposed by hoisting but only the other way around. So this moves hoist insertion after PRE iteration finished and removes hoist insertion iteration alltogether. 2020-11-11 Richard Biener <rguenther@suse.de> PR tree-optimization/97623 * params.opt (-param=max-pre-hoist-insert-iterations): Remove again. * doc/invoke.texi (max-pre-hoist-insert-iterations): Likewise. * tree-ssa-pre.c (insert): Move hoist insertion after PRE insertion iteration and do not iterate it. * gcc.dg/tree-ssa/ssa-hoist-3.c: Adjust. * gcc.dg/tree-ssa/ssa-hoist-7.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-30.c: Likewise.
2020-11-11aarch64: Support SVE comparisons for unpacked integersRichard Sandiford11-50/+216
This patch adds support for comparing unpacked SVE integer vectors, such as byte elements stored in the bottom bytes of halfword containers. It also adds support for selects between unpacked SVE vectors (both integer and floating-point), since selects and compares are closely tied via the vcond optab interface. gcc/ * config/aarch64/aarch64-sve.md (@vcond_mask_<mode><vpred>): Extend from SVE_FULL to SVE_ALL. (*vcond_mask_<mode><vpred>): Likewise. (@aarch64_sel_dup<mode>): Likewise. (vcond<SVE_FULL:mode><v_int_equiv>): Extend to... (vcond<SVE_ALL:mode><SVE_I:mode>): ...this, but requiring the sizes of the container modes to match. (vcondu<SVE_FULL:mode><v_int_equiv>): Extend to... (vcondu<SVE_ALL:mode><SVE_I:mode>): ...this. (vec_cmp<SVE_FULL_I:mode><vpred>): Extend to... (vec_cmp<SVE_I:mode><vpred>): ...this. (vec_cmpu<SVE_FULL_I:mode><vpred>): Extend to... (vec_cmpu<SVE_I:mode><vpred>): ...this. (@aarch64_pred_cmp<cmp_op><SVE_FULL_I:mode>): Extend to... (@aarch64_pred_cmp<cmp_op><SVE_I:mode>): ...this. (*cmp<cmp_op><SVE_FULL_I:mode>_cc): Extend to... (*cmp<cmp_op><SVE_I:mode>_cc): ...this. (*cmp<cmp_op><SVE_FULL_I:mode>_ptest): Extend to... (*cmp<cmp_op><SVE_I:mode>_ptest): ...this. (*cmp<cmp_op><SVE_FULL_I:mode>_and): Extend to... (*cmp<cmp_op><SVE_I:mode>_and): ...this. gcc/testsuite/ * gcc.target/aarch64/sve/cmp_1.c: New test. * gcc.target/aarch64/sve/cmp_2.c: Likewise. * gcc.target/aarch64/sve/cond_arith_1.c: Add --param aarch64-sve-compare-costs=0 * gcc.target/aarch64/sve/cond_arith_1_run.c: Likewise. * gcc.target/aarch64/sve/cond_arith_3.c: Likewise. * gcc.target/aarch64/sve/cond_arith_3_run.c: Likewise. * gcc.target/aarch64/sve/mask_gather_load_7.c: Likewise. * gcc.target/aarch64/sve/mask_load_slp_1.c: Likewise. * gcc.target/aarch64/sve/vcond_11.c: Likewise. * gcc.target/aarch64/sve/vcond_11_run.c: Likewise.
2020-11-11vect: Allow vconds between different vector sizesRichard Sandiford2-5/+3
The vcond code requires the compared vectors and the selected vectors to have both the same size and the same number of elements as each other. But the operation makes logical sense even for different vector sizes. E.g. you could compare two V4SIs and use the result to select between two V4DIs. The underlying optab already allows the compared mode and the selected mode to be specified separately. Since the vectoriser now also supports mixed vector sizes, I think we can simply remove the equal-size check and just keep the equal-lanes check. It's then up to the target to decide which (if any) mixtures of sizes it supports. gcc/ * optabs-tree.c (expand_vec_cond_expr_p): Allow the compared values and the selected values to have different mode sizes. * gimple-isel.cc (gimple_expand_vec_cond_expr): Likewise.
2020-11-11libstdc++: Assigning to a joinable std::jthread calls std::terminatePaul Scharnofske2-1/+25
Move assigning to a std::jthread that represents a thread of execution needs to send a stop request and join that running thread. Otherwise the std::thread data member will terminate in its assignment operator. Co-authored-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/std/thread (jthread::operator=(jthread&&)): Transfer any existing state to a temporary that will request a stop and then join. * testsuite/30_threads/jthread/jthread.cc: Test move assignment.
2020-11-11libstdc++: Use helper type for checking thread IDJonathan Wakely1-7/+13
This encapsulates the storing and checking of the thread ID into a class type, so that the macro _GLIBCXX_HAS_GTHREADS is only checked in one place. The code doing the checks just calls member functions of the new type, without caring whether that really does any work or not. libstdc++-v3/ChangeLog: * include/std/stop_token (_Stop_state_t::_M_requester): Define new struct with members to store and check the thread ID. (_Stop_state_t::_M_request_stop()): Use _M_requester._M_set(). (_Stop_state_t::_M_remove_callback(_Stop_cb*)): Use _M_requester._M_is_current_thread().
2020-11-11Support Intel AVX VNNIliuhongt47-116/+956
2020-10-13 Hongtao Liu <hongtao.liu@intel.com> Hongyu Wang <hongyu.wang@intel.com> gcc/ * common/config/i386/cpuinfo.h (get_available_features): Detect AVXVNNI. * common/config/i386/i386-common.c (OPTION_MASK_ISA2_AVXVNNI_SET, OPTION_MASK_ISA2_AVXVNNI_UNSET): New. (OPTION_MASK_ISA2_AVX2_UNSET): Add AVXVNNI. (ix86_hanlde_option): Handle -mavxvnni, unset avxvnni when avx2 is disabled. * common/config/i386/i386-cpuinfo.h (enum processor_features): Add FEATURE_AVXVNNI. * common/config/i386/i386-isas.h: Add ISA_NAMES_TABLE_ENTRY for avxvnni. * config.gcc: Add avxvnniintrin.h. * config/i386/avx512vnnivlintrin.h: Reimplement 128/256 bit non-mask intrinsics with macros to support unified interface. * config/i386/avxvnniintrin.h: New header file. * config/i386/cpuid.h (bit_AVXVNNI): New. * config/i386/i386-builtins.c (def_builtin): Handle AVXVNNI mask for unified builtin. * config/i386/i386-builtin.def (BDESC): Adjust AVX512VNNI builtins for AVXVNNI. * config/i386/i386-c.c (ix86_target_macros_internal): Define __AVXVNNI__. * config/i386/i386-expand.c (ix86_expand_builtin): Handle bisa for AVXVNNI to support unified intrinsic name, since there is no dependency between AVX512VNNI and AVXVNNI. * config/i386/i386-options.c (isa2_opts): Add -mavxvnni. (ix86_valid_target_attribute_inner_p): Handle avxnnni. (ix86_option_override_internal): Ditto. * config/i386/i386.h (TARGET_AVXVNNI, TARGET_AVXVNNI_P, TARGET_AVXVNNI_P, PTA_AVXVNNI): New. (PTA_SAPPHIRERAPIDS): Add AVX_VNNI. (PTA_ALDERLAKE): Likewise. * config/i386/i386.md ("isa"): Add avxvnni, avx512vnnivl. ("enabled"): Adjust for avxvnni and avx512vnnivl. * config/i386/i386.opt: Add option -mavxvnni. * config/i386/immintrin.h: Include avxvnniintrin.h. * config/i386/sse.md (vpdpbusd_<mode>): Adjust for AVXVNNI. (vpdpbusds_<mode>): Likewise. (vpdpwssd_<mode>): Likewise. (vpdpwssds_<mode>): Likewise. (vpdpbusd_v16si): New. (vpdpbusds_v16si): Likewise. (vpdpwssd_v16si): Likewise. (vpdpwssds_v16si): Likewise. * doc/invoke.texi: Document -mavxvnni. * doc/extend.texi: Document avxvnni. * doc/sourcebuild.texi: Document target avxvnni. gcc/testsuite/ * gcc.target/i386/avx512vl-vnni-1.c: Rename.. * gcc.target/i386/avx512vl-vnni-1a.c: To This. * gcc.target/i386/avx512vl-vnni-1b.c: New test. * gcc.target/i386/avx512vl-vnni-2.c: Ditto. * gcc.target/i386/avx512vl-vnni-3.c: Ditto. * gcc.target/i386/avx-vnni-1.c: Ditto. * gcc.target/i386/avx-vnni-2.c: Ditto. * gcc.target/i386/avx-vnni-3.c: Ditto. * gcc.target/i386/avx-vnni-4.c: Ditto. * gcc.target/i386/avx-vnni-5.c: Ditto. * gcc.target/i386/avx-vnni-6.c: Ditto. * gcc.target/i386/avx-vpdpbusd-2.c: Ditto. * gcc.target/i386/avx-vpdpbusds-2.c: Ditto. * gcc.target/i386/avx-vpdpwssd-2.c: Ditto. * gcc.target/i386/avx-vpdpwssds-2.c: Ditto. * gcc.target/i386/vnni_inline_error.c: Ditto. * gcc.target/i386/avx512vnnivl-builtin.c: Ditto. * gcc.target/i386/avxvnni-builtin.c: Ditto. * gcc.target/i386/funcspec-56.inc: Add new target attribute. * gcc.target/i386/sse-12.c: Add -mavxvnni. * gcc.target/i386/sse-13.c: Ditto. * gcc.target/i386/sse-14.c: Ditto. * gcc.target/i386/sse-22.c: Ditto. * gcc.target/i386/sse-23.c: Ditto. * g++.dg/other/i386-2.C: Ditto. * g++.dg/other/i386-3.C: Ditto. * lib/target-supports.exp (check_effective_target_avxvnni): New proc.
2020-11-11Fix spelling.Martin Liska1-1/+1
gcc/ChangeLog: * tree.c (copy_node): Fix spelling.
2020-11-11Drop topological sort for PRE phi-translationRichard Biener1-10/+7
The topological sort sorted_array_from_bitmap_set is supposed to provide isn't one since quite some time since value_ids are assigned first to SSA names in the order of SSA_NAME_VERSION and then to hashtable entries in the order they appear in the table. One can even argue that expression-ids provide a closer approximation of a topological sort since those are assigned during AVAIL_OUT computation which is done in a dominator walk. Now - phi-translation is not even depending on topological sorting but it essentially does a DFS walk, phi-translating expressions it depends on and relying on phi-translation caching to avoid doing redundant work. So this patch drops the use of sorted_array_from_bitmap_set from phi_translate_set because this function is quite expensive. 2020-11-11 Richard Biener <rguenther@suse.de> * tree-ssa-pre.c (phi_translate_set): Do not sort the expression set topologically.
2020-11-11Early exit on VR_VARYING from irange::set.Aldy Hernandez1-1/+3
gcc/ChangeLog: * value-range.cc (irange::set): Early exit on VR_VARYING.
2020-11-11AArch64: Add FLAG for arithmetic operation intrinsics [PR94442]zhengnannan1-22/+22
2020-11-11 Zhiheng Xie <xiezhiheng@huawei.com> Nannan Zheng <zhengnannan@huawei.com> gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Add proper FLAG for arithmetic operation intrinsics.
2020-11-11gfortran.dg/gomp/workshare-reduction-*.f90: Fix dumps for -m32Tobias Burnus18-40/+40
gcc/testsuite/ChangeLog: * gfortran.dg/gomp/workshare-reduction-26.f90: Add (?:_ull) to scan-tree-dump-times regex for -m32. * gfortran.dg/gomp/workshare-reduction-27.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-28.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-3.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-36.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-37.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-38.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-39.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-40.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-41.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-42.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-43.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-44.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-45.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-46.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-47.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-56.f90: Likewise. * gfortran.dg/gomp/workshare-reduction-57.f90: Likewise.
2020-11-11fortran: Fix up gfc_typename CHARACTER length handling [PR97768]Jakub Jelinek3-3/+103
The first testcase below ICEs when f951 is 32-bit (or 64-bit big-endian). The problem is that ex->ts.u.cl && ex->ts.u.cl->length are both non-NULL, but ex->ts.u.cl->length->expr_type is not EXPR_CONSTANT, but EXPR_FUNCTION. value.function.actual and value.function.name are in that case pointers, but value._mp_alloc and value._mp_size are 4 byte integers no matter what. So, in 64-bit little-endian the function returns most of the time incorrect CHARACTER(0) because the most significant 32 bits of the value.function.actual pointer are likely 0. Anyway, the following patch is an attempt to get all the cases right. Uses ex->value.character.length only for ex->expr_type == EXPR_CONSTANT (i.e. CHARACTER literals), handles the deferred lengths, assumed lengths, known constant lengths and finally if the length is something other, just doesn't print it, i.e. prints just CHARACTER (for default kind) or CHARACTER(KIND=4) (for e.g. kind 4). 2020-11-11 Jakub Jelinek <jakub@redhat.com> PR fortran/97768 gcc/fortran/ * misc.c (gfc_typename): Use ex->value.character.length only if ex->expr_type == EXPR_CONSTANT. If ex->ts.deferred, print : instead of length. If ex->ts.u.cl && ex->ts.u.cl->length == NULL, print * instead of length. Otherwise if character length is non-constant, print just CHARACTER or CHARACTER(KIND=N). gcc/testsuite/ * gfortran.dg/pr97768_1.f90: New test. * gfortran.dg/pr97768_2.f90: New test.
2020-11-11Re: Refactor copying decl section namesAlan Modra1-1/+1
* go-gcc.cc (Gcc_backend::global_variable_set_init): Cast NULL to avoid ambiguous overloaded call.
2020-11-10Improve efficiency of copying section from another treeStrager Neds2-7/+33
gcc/ * cgraph.h (symtab_node::set_section_for_node): Declare new overload. (symtab_node::set_section_from_string): Rename from set_section. (symtab_node::set_section_from_node): Declare. * symtab.c (symtab_node::set_section_for_node): Define new overload. (symtab_node::set_section_from_string): Rename from set_section. (symtab_node::set_section_from_node): Define. (symtab_node::set_section): Call renamed set_section_from_string. (symtab_node::set_section): Call new set_section_from_node.
2020-11-10Refactor section name ref countingStrager Neds1-19/+36
gcc/ * symtab.c (symtab_node::set_section_for_node): Extract reference counting logic into ... (retain_section_hash_entry): ... here (new function) and ... (release_section_hash_entry): ... here (new function).
2020-11-11Formatting, there should be a space between PTA_* and (.liuhongt1-6/+6
gcc/ChangeLog * config/i386/i386.h (PTA_MOVDIRI, PTA_MOVDIR64B, PTA_AMX_TILE, PTA_AMX_INT8, PTA_AMX_BF16, PTA_HRESET): Formatting.
2020-11-10Update MicroBlaze strings testNagaraju Mekala1-2/+3
gcc/testsuite * gcc.target/microblaze/others/strings1.c: Update to include $LC label.
2020-11-10testsuite: skip zero-scratch-regs on powerpc.David Edelsohn5-4/+5
These tests are unsupported on PowerPC. gcc/testsuite/ChangeLog: * c-c++-common/zero-scratch-regs-10.c: Skip on powerpc*-*-*. * c-c++-common/zero-scratch-regs-11.c: Skip on powerpc*-*-*. * c-c++-common/zero-scratch-regs-5.c: Skip on powerpc*-*-aix*. * c-c++-common/zero-scratch-regs-8.c: Skip on powerpc*-*-*. * c-c++-common/zero-scratch-regs-9.c: Skip on powerpc*-*-*.
2020-11-11libstdc++: Implement std::emit_on_flush etc.Jonathan Wakely4-81/+210
This adds the manipulators for use with basic_osyncstream. In order to detect when an arbitrary basic_ostream<C,T> is the base class of a basic_syncbuf<C,T,A> object, introduce a new intermediate base class that stores the data members. The new base class stores a pointer and two bools, which wastes (sizeof(void*) - 2) bytes of padding. It would be possible to use the two least significant bits of the pointer for the two bools, at least for targets where alignof(basic_streambuf) > 2, but that's left as a possible change for a future date. Also define basic_syncbuf::overflow to override the virtual function in the base class, so that single characters can be inserted into the stream buffer. Previously the default basic_streambuf::overflow implementation was used, which drops the character on the floor. libstdc++-v3/ChangeLog: * include/std/ostream (__syncbuf_base): New class template. (emit_on_flush, noemit_on_flush, flush_emit): New manipulators. * include/std/syncstream (basic_syncbuf): Derive from __syncbuf_base instead of basic_streambuf. (basic_syncbuf::operator=): Remove self-assignment check. (basic_syncbuf::swap): Remove self-swap check. (basic_syncbuf::emit): Do not skip pubsync() call if sequence is empty. (basic_syncbuf::sync): Remove no-op pubsync on stringbuf. (basic_syncbuf::overflow): Define override. * testsuite/27_io/basic_syncstream/basic_ops/1.cc: Test basic_osyncstream::put(char_type). * testsuite/27_io/basic_ostream/emit/1.cc: New test.
2020-11-11Daily bump.GCC Administrator13-1/+749
2020-11-11IBM Z: Fix bootstrap breakage due to HAVE_TF macroIlya Leoshkevich1-2/+3
Commit e627cda56865 ("IBM Z: Store long doubles in vector registers when possible") introduced HAVE_TF macro which expands to a logical "or" of HAVE_ constants. Not all of these constants are available in GENERATOR_FILE context, so a hack was used: simply expand to true in this case, because the actual value matters only during compiler runtime and not during generation. However, one aspect of this value matters during generation after all: whether or not it's a constant, which in this case it appears to be. This results in incorrect values in insn-flags.h and broken bootstrap for some configurations. Fix by using a dummy value that is not a constant. gcc/ChangeLog: 2020-11-10 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.h (HAVE_TF): Use opaque value when GENERATOR_FILE is defined.
2020-11-10libstdc++: Avoid bad_alloc exceptions when changing localesJonathan Wakely1-15/+34
For the --enable-clocale=generic configuration, the current code can fail with a bad_alloc exception. This patch uses the nothrow version of operator new and reports allocation failures by setting failbit in the iostate variable. * config/locale/generic/c_locale.cc (__set_C_locale()): New function to set the "C" locale and return the name of the previous locale. (__convert_to_v<float>, __convert_to_v<double>) (__convert_to_v<long double>): Use __set_C_locale and set failbit on error.
2020-11-10c++: Improve static_assert diagnostic [PR97518]Marek Polacek8-19/+167
Currently, when a static_assert fails, we only say "static assertion failed". It would be more useful if we could also print the expression that evaluated to false; this is especially useful when the condition uses template parameters. Consider the motivating example, in which we have this line: static_assert(is_same<X, Y>::value); if this fails, the user has to play dirty games to get the compiler to print the template arguments. With this patch, we say: error: static assertion failed note: 'is_same<int*, int>::value' evaluates to false which I think is much better. However, always printing the condition that evaluated to 'false' wouldn't be very useful: e.g. noexcept(fn) is always parsed to true/false, so we would say "'false' evaluates to false" which doesn't help. So I wound up only printing the condition when it was instantiation-dependent, that is, we called finish_static_assert from tsubst_expr. Moreover, this patch also improves the diagnostic when the condition consists of a logical AND. Say you have something like this: static_assert(fn1() && fn2() && fn3() && fn4() && fn5()); where fn4() evaluates to false and the other ones to true. Highlighting the whole thing is not that helpful because it won't say which clause evaluated to false. With the find_failing_clause tweak in this patch we emit: error: static assertion failed 6 | static_assert(fn1() && fn2() && fn3() && fn4() && fn5()); | ~~~^~ so you know right away what's going on. Unfortunately, when you combine both things, that is, have an instantiation-dependent expr and && in a static_assert, we can't yet quite point to the clause that failed. It is because when we tsubstitute something like is_same<X, Y>::value, we generate a VAR_DECL that doesn't have any location. It would be awesome if we could wrap it with a location wrapper, but I didn't see anything obvious. In passing, I've cleaned up some things: * use iloc_sentinel when appropriate, * it's nicer to call contextual_conv_bool instead of the rather verbose perform_implicit_conversion_flags, * no need to check for INTEGER_CST before calling integer_zerop. gcc/cp/ChangeLog: PR c++/97518 * cp-tree.h (finish_static_assert): Adjust declaration. * parser.c (cp_parser_static_assert): Pass false to finish_static_assert. * pt.c (tsubst_expr): Pass true to finish_static_assert. * semantics.c (find_failing_clause_r): New function. (find_failing_clause): New function. (finish_static_assert): Add a bool parameter. Use iloc_sentinel. Call contextual_conv_bool instead of perform_implicit_conversion_flags. Don't check for INTEGER_CST before calling integer_zerop. Call find_failing_clause and maybe use its location. Print the original condition or the failing clause if SHOW_EXPR_P. gcc/testsuite/ChangeLog: PR c++/97518 * g++.dg/diagnostic/pr87386.C: Adjust expected output. * g++.dg/diagnostic/static_assert1.C: New test. * g++.dg/diagnostic/static_assert2.C: New test. libcc1/ChangeLog: PR c++/97518 * libcp1plugin.cc (plugin_add_static_assert): Pass false to finish_static_assert.
2020-11-10c++: Add 5 unfixed tests.Marek Polacek5-0/+101
A couple of dg-ice tests. gcc/testsuite/ChangeLog: PR c++/52830 PR c++/88982 PR c++/90799 PR c++/87765 PR c++/89565 * g++.dg/cpp0x/constexpr-52830.C: New test. * g++.dg/cpp0x/vt-88982.C: New test. * g++.dg/cpp1z/class-deduction76.C: New test. * g++.dg/cpp1z/constexpr-lambda26.C: New test. * g++.dg/cpp2a/nontype-class39.C: New test.
2020-11-10libstdc++: Reorder constructors in <sstream>Jonathan Wakely1-100/+100
This groups all the constructors together, consistent with the synopses in the C++20 standard. libstdc++-v3/ChangeLog: * include/std/sstream (basic_stringbug, basic_istringstream) (basic_ostringstream, basic_stringstream): Reorder C++20 constructors to be declared next to other constructors.
2020-11-10libstdc++: Add remaining C++20 additions to <sstream> [P0408R7]Jonathan Wakely18-54/+1082
This adds the new overloads of basic_stringbuf::str, and the corresponding overloads to basic_istringstream, basic_ostringstream and basic_stringstream. libstdc++-v3/ChangeLog: * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Tighten patterns. (GLIBCXX_3.4.29): Export new symbols. * include/bits/alloc_traits.h (__allocator_like): New concept. * include/std/sstream (basic_stringbuf::swap): Add exception specification. (basic_stringbuf::str() const): Add ref-qualifier. Use new _M_high_mark function. (basic_stringbuf::str(const SAlloc&) const): Define new function. (basic_stringbuf::str() &&): Likewise. (basic_stringbuf::str(const basic_string<C,T,SAlloc>&)): Likewise. (basic_stringbuf::str(basic_string<C,T,Alloc>&&)): Likewise. (basic_stringbuf::view() const): Use _M_high_mark. (basic_istringstream::str, basic_ostringstream::str) (basic_stringstream::str): Define new overloads. * src/c++20/sstream-inst.cc (basic_stringbuf::str) (basic_istringstream::str, basic_ostringstream::str) (basic_stringstream::str): Explicit instantiation definitions for new overloads. * testsuite/27_io/basic_istringstream/view/char/1.cc: Add more checks. * testsuite/27_io/basic_istringstream/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/view/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_stringstream/view/char/1.cc: Likewise. * testsuite/27_io/basic_stringstream/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istringstream/str/char/2.cc: New test. * testsuite/27_io/basic_istringstream/str/wchar_t/2.cc: New test. * testsuite/27_io/basic_ostringstream/str/char/3.cc: New test. * testsuite/27_io/basic_ostringstream/str/wchar_t/3.cc: New test. * testsuite/27_io/basic_stringbuf/str/char/4.cc: New test. * testsuite/27_io/basic_stringbuf/str/wchar_t/4.cc: New test. * testsuite/27_io/basic_stringstream/str/char/5.cc: New test. * testsuite/27_io/basic_stringstream/str/wchar_t/5.cc.cc: New test.
2020-11-10libstdc++: Fix more unspecified comparisons to null pointer [PR 97415]Jonathan Wakely1-7/+10
This adds some more null checks to avoid a relational comparison with a null pointer, similar to 78198b6021a9695054dab039340202170b88423c. libstdc++-v3/ChangeLog: PR libstdc++/97415 * include/std/sstream (basic_stringbuf::_M_update_egptr) (basic_stringbuf::__xfer_bufptrs::__xfer_bufptrs): Check for null before comparing pointers.
2020-11-10Refactor copying decl section namesStrager Neds13-15/+52
gcc/ * cgraph.h (symtab_node::get_section): Constify. (symtab_node::set_section): Declare new overload. * symtab.c (symtab_node::set_section): Define new overload. (symtab_node::copy_visibility_from): Use new overload of symtab_node::set_section. (symtab_node::resolve_alias): Same. * tree.h (set_decl_section_name): Declare new overload. * tree.c (set_decl_section_name): Define new overload. * tree-emutls.c (get_emutls_init_templ_addr): Same. * cgraphclones.c (cgraph_node::create_virtual_clone): Use new overload of symtab_node::set_section. (cgraph_node::create_version_clone_with_body): Same. * trans-mem.c (ipa_tm_create_version): Same. gcc/c * c-decl.c (merge_decls): Use new overload of set_decl_section_name. gcc/cp * decl.c (duplicate_decls): Use new overload of set_decl_section_name. * method.c (use_thunk): Same. * optimize.c (maybe_clone_body): Same. * coroutines.cc (act_des_fn): Same. gcc/d * decl.cc (finish_thunk): Use new overload of set_decl_section_name
2020-11-10Early exit from irange::set for poly ints.Aldy Hernandez1-3/+5
My previous cleanups to irange::set moved the early exit when VARYING. This caused poly int varyings to be created with incorrect min/max. We can just set varying and exit for all poly ints. gcc/ChangeLog: * value-range.cc (irange::set): Early exit for poly ints.
2020-11-10analyzer: remove dead codeMartin Liska7-31/+23
gcc/analyzer/ChangeLog: * constraint-manager.cc (constraint_manager::merge): Remove unused code. * constraint-manager.h: Likewise. * program-state.cc (sm_state_map::sm_state_map): Likewise. (program_state::program_state): Likewise. (test_sm_state_map): Likewise. * program-state.h: Likewise. * region-model-reachability.cc (reachable_regions::reachable_regions): Likewise. * region-model-reachability.h: Likewise. * region-model.cc (region_model::handle_unrecognized_call): Likewise. (region_model::get_reachable_svalues): Likewise. (region_model::can_merge_with_p): Likewise.
2020-11-10Fortran: OpenMP 5.0 (in_,task_)reduction clause extensionsTobias Burnus67-172/+2349
gcc/fortran/ChangeLog: * dump-parse-tree.c (show_omp_clauses): Handle new reduction enums. * gfortran.h (OMP_LIST_REDUCTION_INSCAN, OMP_LIST_REDUCTION_TASK, OMP_LIST_IN_REDUCTION, OMP_LIST_TASK_REDUCTION): Add enums. * openmp.c (enum omp_mask1): Add OMP_CLAUSE_IN_REDUCTION and OMP_CLAUSE_TASK_REDUCTION. (gfc_match_omp_clause_reduction): Extend reduction handling; moved from ... (gfc_match_omp_clauses): ... here. Add calls to it. (OMP_TASK_CLAUSES, OMP_TARGET_CLAUSES, OMP_TASKLOOP_CLAUSES): Add OMP_CLAUSE_IN_REDUCTION. (gfc_match_omp_taskgroup): Add task_reduction matching. (resolve_omp_clauses): Update for new reduction clause changes; remove removed nonmonotonic-schedule restrictions. (gfc_resolve_omp_parallel_blocks): Add new enums to switch. * trans-openmp.c (gfc_omp_clause_default_ctor, gfc_trans_omp_reduction_list, gfc_trans_omp_clauses, gfc_split_omp_clauses): Handle updated reduction clause. gcc/ChangeLog: * gimplify.c (gimplify_scan_omp_clauses, gimplify_omp_loop): Use 'do' instead of 'for' in error messages for Fortran. * omp-low.c (check_omp_nesting_restrictions): Likewise gcc/testsuite/ChangeLog: * gfortran.dg/gomp/schedule-modifiers-2.f90: Remove some dg-error. * gfortran.dg/gomp/reduction4.f90: New test. * gfortran.dg/gomp/reduction5.f90: New test. * gfortran.dg/gomp/workshare-reduction-1.f90: New test. * gfortran.dg/gomp/workshare-reduction-2.f90: New test. * gfortran.dg/gomp/workshare-reduction-3.f90: New test. * gfortran.dg/gomp/workshare-reduction-4.f90: New test. * gfortran.dg/gomp/workshare-reduction-5.f90: New test. * gfortran.dg/gomp/workshare-reduction-6.f90: New test. * gfortran.dg/gomp/workshare-reduction-7.f90: New test. * gfortran.dg/gomp/workshare-reduction-8.f90: New test. * gfortran.dg/gomp/workshare-reduction-9.f90: New test. * gfortran.dg/gomp/workshare-reduction-10.f90: New test. * gfortran.dg/gomp/workshare-reduction-11.f90: New test. * gfortran.dg/gomp/workshare-reduction-12.f90: New test. * gfortran.dg/gomp/workshare-reduction-13.f90: New test. * gfortran.dg/gomp/workshare-reduction-14.f90: New test. * gfortran.dg/gomp/workshare-reduction-15.f90: New test. * gfortran.dg/gomp/workshare-reduction-16.f90: New test. * gfortran.dg/gomp/workshare-reduction-17.f90: New test. * gfortran.dg/gomp/workshare-reduction-18.f90: New test. * gfortran.dg/gomp/workshare-reduction-19.f90: New test. * gfortran.dg/gomp/workshare-reduction-20.f90: New test. * gfortran.dg/gomp/workshare-reduction-21.f90: New test. * gfortran.dg/gomp/workshare-reduction-22.f90: New test. * gfortran.dg/gomp/workshare-reduction-23.f90: New test. * gfortran.dg/gomp/workshare-reduction-24.f90: New test. * gfortran.dg/gomp/workshare-reduction-25.f90: New test. * gfortran.dg/gomp/workshare-reduction-26.f90: New test. * gfortran.dg/gomp/workshare-reduction-27.f90: New test. * gfortran.dg/gomp/workshare-reduction-28.f90: New test. * gfortran.dg/gomp/workshare-reduction-29.f90: New test. * gfortran.dg/gomp/workshare-reduction-30.f90: New test. * gfortran.dg/gomp/workshare-reduction-31.f90: New test. * gfortran.dg/gomp/workshare-reduction-32.f90: New test. * gfortran.dg/gomp/workshare-reduction-33.f90: New test. * gfortran.dg/gomp/workshare-reduction-34.f90: New test. * gfortran.dg/gomp/workshare-reduction-35.f90: New test. * gfortran.dg/gomp/workshare-reduction-36.f90: New test. * gfortran.dg/gomp/workshare-reduction-37.f90: New test. * gfortran.dg/gomp/workshare-reduction-38.f90: New test. * gfortran.dg/gomp/workshare-reduction-39.f90: New test. * gfortran.dg/gomp/workshare-reduction-40.f90: New test. * gfortran.dg/gomp/workshare-reduction-41.f90: New test. * gfortran.dg/gomp/workshare-reduction-42.f90: New test. * gfortran.dg/gomp/workshare-reduction-43.f90: New test. * gfortran.dg/gomp/workshare-reduction-44.f90: New test. * gfortran.dg/gomp/workshare-reduction-45.f90: New test. * gfortran.dg/gomp/workshare-reduction-46.f90: New test. * gfortran.dg/gomp/workshare-reduction-47.f90: New test. * gfortran.dg/gomp/workshare-reduction-48.f90: New test. * gfortran.dg/gomp/workshare-reduction-49.f90: New test. * gfortran.dg/gomp/workshare-reduction-50.f90: New test. * gfortran.dg/gomp/workshare-reduction-51.f90: New test. * gfortran.dg/gomp/workshare-reduction-52.f90: New test. * gfortran.dg/gomp/workshare-reduction-53.f90: New test. * gfortran.dg/gomp/workshare-reduction-54.f90: New test. * gfortran.dg/gomp/workshare-reduction-55.f90: New test. * gfortran.dg/gomp/workshare-reduction-56.f90: New test. * gfortran.dg/gomp/workshare-reduction-57.f90: New test. * gfortran.dg/gomp/workshare-reduction-58.f90: New test.
2020-11-10opts: Change `is incompatible with` messages to have standard parametrised formMatthew Malcomson2-57/+51
Hello, In a recent review for one of the hwasan patches Richard S. noticed there are quite a few errors of the form "%<someflag%> is incompatible with <otherflag%>". https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556137.html In order to avoid this creating extra work for translators we would like to change these error messages to use the form "%qs is incompatible with %qs" and pass the flag as format arguments. This patch implements that change. There is only one change in the output the compiler produces from this patch, an error message of "-fsanitize=address and -fsanitize=kernel-address are incompatible with -fsanitize=thread" has been changed to "-fsanitize=thread is incompatible with -fsanitize=address|kernel-address". This matches the similar error messages for live patching which use the messages "-f<something> is incompatible with -flive-patching=inline-only-static|inline-clone". Ok for trunk? gcc/ChangeLog: * opts.c (control_options_for_live_patching): Reform 'is incompatible with' error messages to use a standard message with differing format arguments. (finish_options): Likewise. gcc/testsuite/ChangeLog: * c-c++-common/ubsan/sanitize-recover-7.c: Update testcase.
2020-11-10Fix minor whitespace issuesJeff Law1-11/+11
libgcc/ * libgcc2.c: Fix whitespace issues in most recent change.
2020-11-10Improve generated code for various libgcc2.c routinesStefan Kanthak2-54/+30
libgcc/ * libgcc2.c (__addvSI3): Use overflow builtins. (__addvsi3, __addvDI3 ,__subvSI3, __subvsi3): Likewise. (__subvDI3 __mulvSI3, __mulvsi3, __negvSI2): Likewise. (__negvsi2, __negvDI2): Likewise. (__cmpdi2, __ucmpdi2): Adjust implementation to improve generated code. * libgcc2.h (__ucmpdi2): Adjust prototype.
2020-11-10libgo: update to Go 1.15.4 releaseIan Lance Taylor17-29/+267
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/268177
2020-11-10c, c++: Fix up -Wunused-value on COMPLEX_EXPRs [PR97748]Jakub Jelinek4-27/+59
The -Wunused-value warning in both C and C++ FEs (implemented significantly differently between the two) sees the COMPLEX_EXPRs created e.g. for complex pre/post increment and many other expressions as useless and warns about it. For the C warning implementation, on e.g. COMPLEX_EXPR < ++REALPART_EXPR <x>, IMAGPART_EXPR <x>>; would warn even on the IMAGPART_EXPR <x> there alone etc., so what works is check if we'd warn about both operands of COMPLEX_EXPR and if yes, warn on the whole COMPLEX_EXPR, otherwise don't warn. The C++ warning implementation is significantly different and for that one the only warn if both would be warned about doesn't really work, we then miss warnings e.g. about COMPLEX_EXPR <REALPART_EXPR <SAVE_EXPR <x>> + 1.0e+0, IMAGPART_EXPR <SAVE_EXPR <x>>> >>>>> The patch replaces the warning_at call with call to the c-family warn_if_unused_value function. On the testcase which after the initial new tests contains pretty much everything from gcc.dg/Wunused-value-1.c both approaches seem to work nicely. 2020-11-10 Jakub Jelinek <jakub@redhat.com> PR c/97748 gcc/c-family/ * c-common.h (warn_if_unused_value): Add quiet argument defaulted to false. * c-warn.c (warn_if_unused_value): Likewise. Pass it down recursively and just return true instead of warning if it is true. Handle COMPLEX_EXPR. gcc/cp/ * cvt.c (convert_to_void): Check (complain & tf_warning) in the outer if rather than twice times in the inner one. Use warn_if_unused_value. Formatting fix. gcc/testsuite/ * c-c++-common/Wunused-value-1.c: New test.
2020-11-10tree-optimization/97769 - fix assert in peeling for alignmentRichard Biener2-6/+33
The following removes an assert that can not easily be adjusted to cover the additional cases we now handle after the removal of the same-align DRs vector. 2020-11-10 Richard Biener <rguenther@suse.de> PR tree-optimization/97769 * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Remove assert. * gcc.dg/vect/pr97769.c: New testcase.
2020-11-10tree-optimization/97780 - fix ICE in fini_preRichard Biener1-1/+1
This deals with blocks elimination added. 2020-11-10 Richard Biener <rguenther@suse.de> PR tree-optimization/97780 * tree-ssa-pre.c (fini_pre): Deal with added basic blocks when freeing PHI_TRANS_TABLE.
2020-11-10AArch64: Add FLAG for tbl/tbx intrinsics [PR94442]zhengnannan1-12/+12
2020-11-10 Zhiheng Xie <xiezhiheng@huawei.com> Nannan Zheng <zhengnannan@huawei.com> gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Add proper FLAG for tbl/tbx intrinsics.
2020-11-10openmp: Implement OpenMP 5.0 base-pointer attachement and clause orderingChung-Lin Tang15-102/+615
This patch implements some parts of the target variable mapping changes specified in OpenMP 5.0, including base-pointer attachment/detachment behavior for array section list-items in map clauses, and ordering of map clauses according to map kind. 2020-11-10 Chung-Lin Tang <cltang@codesourcery.com> gcc/c-family/ChangeLog: * c-common.h (c_omp_adjust_map_clauses): New declaration. * c-omp.c (struct map_clause): Helper type for c_omp_adjust_map_clauses. (c_omp_adjust_map_clauses): New function. gcc/c/ChangeLog: * c-parser.c (c_parser_omp_target_data): Add use of new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as handled map clause kind. (c_parser_omp_target_enter_data): Likewise. (c_parser_omp_target_exit_data): Likewise. (c_parser_omp_target): Likewise. * c-typeck.c (handle_omp_array_sections): Adjust COMPONENT_REF case to use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. (c_finish_omp_clauses): Adjust bitmap checks to allow struct decl and same struct field access to co-exist on OpenMP construct. gcc/cp/ChangeLog: * parser.c (cp_parser_omp_target_data): Add use of new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as handled map clause kind. (cp_parser_omp_target_enter_data): Likewise. (cp_parser_omp_target_exit_data): Likewise. (cp_parser_omp_target): Likewise. * semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix interaction between reference case and attach/detach. (finish_omp_clauses): Adjust bitmap checks to allow struct decl and same struct field access to co-exist on OpenMP construct. gcc/ChangeLog: * gimplify.c (is_or_contains_p): New static helper function. (omp_target_reorder_clauses): New function. (gimplify_scan_omp_clauses): Add use of omp_target_reorder_clauses to reorder clause list according to OpenMP 5.0 rules. Add handling of GOMP_MAP_ATTACH_DETACH for OpenMP cases. * omp-low.c (is_omp_target): New static helper function. (scan_sharing_clauses): Add scan phase handling of GOMP_MAP_ATTACH/DETACH for OpenMP cases. (lower_omp_target): Add lowering handling of GOMP_MAP_ATTACH/DETACH for OpenMP cases. gcc/testsuite/ChangeLog: * c-c++-common/gomp/clauses-2.c: Remove dg-error cases now valid. * gfortran.dg/gomp/map-2.f90: Likewise. * c-c++-common/gomp/map-5.c: New testcase. libgomp/ChangeLog: * libgomp.h (enum gomp_map_vars_kind): Adjust enum values to be bit-flag usable. * oacc-mem.c (acc_map_data): Adjust gomp_map_vars argument flags to 'GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_ENTER_DATA'. (goacc_enter_datum): Likewise for call to gomp_map_vars_async. (goacc_enter_data_internal): Likewise. * target.c (gomp_map_vars_internal): Change checks of GOMP_MAP_VARS_ENTER_DATA to use bit-and (&). Adjust use of gomp_attach_pointer for OpenMP cases. (gomp_exit_data): Add handling of GOMP_MAP_DETACH. (GOMP_target_enter_exit_data): Add handling of GOMP_MAP_ATTACH. * testsuite/libgomp.c-c++-common/ptr-attach-1.c: New testcase.
2020-11-10IBM Z: Test long doubles in vector registersIlya Leoshkevich55-0/+808
gcc/testsuite/ChangeLog: 2020-11-05 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/vector/long-double-callee-abi-scan.c: New test. * gcc.target/s390/vector/long-double-caller-abi-run.c: New test. * gcc.target/s390/vector/long-double-caller-abi-scan.c: New test. * gcc.target/s390/vector/long-double-copysign.c: New test. * gcc.target/s390/vector/long-double-fprx2-constant.c: New test. * gcc.target/s390/vector/long-double-from-double.c: New test. * gcc.target/s390/vector/long-double-from-float.c: New test. * gcc.target/s390/vector/long-double-from-i16.c: New test. * gcc.target/s390/vector/long-double-from-i32.c: New test. * gcc.target/s390/vector/long-double-from-i64.c: New test. * gcc.target/s390/vector/long-double-from-i8.c: New test. * gcc.target/s390/vector/long-double-from-u16.c: New test. * gcc.target/s390/vector/long-double-from-u32.c: New test. * gcc.target/s390/vector/long-double-from-u64.c: New test. * gcc.target/s390/vector/long-double-from-u8.c: New test. * gcc.target/s390/vector/long-double-to-double.c: New test. * gcc.target/s390/vector/long-double-to-float.c: New test. * gcc.target/s390/vector/long-double-to-i16.c: New test. * gcc.target/s390/vector/long-double-to-i32.c: New test. * gcc.target/s390/vector/long-double-to-i64.c: New test. * gcc.target/s390/vector/long-double-to-i8.c: New test. * gcc.target/s390/vector/long-double-to-u16.c: New test. * gcc.target/s390/vector/long-double-to-u32.c: New test. * gcc.target/s390/vector/long-double-to-u64.c: New test. * gcc.target/s390/vector/long-double-to-u8.c: New test. * gcc.target/s390/vector/long-double-vec-duplicate.c: New test. * gcc.target/s390/vector/long-double-wf.h: New test. * gcc.target/s390/vector/long-double-wfaxb.c: New test. * gcc.target/s390/vector/long-double-wfcxb-0001.c: New test. * gcc.target/s390/vector/long-double-wfcxb-0111.c: New test. * gcc.target/s390/vector/long-double-wfcxb-1011.c: New test. * gcc.target/s390/vector/long-double-wfcxb-1101.c: New test. * gcc.target/s390/vector/long-double-wfdxb.c: New test. * gcc.target/s390/vector/long-double-wfixb.c: New test. * gcc.target/s390/vector/long-double-wfkxb-0111.c: New test. * gcc.target/s390/vector/long-double-wfkxb-1011.c: New test. * gcc.target/s390/vector/long-double-wfkxb-1101.c: New test. * gcc.target/s390/vector/long-double-wflcxb.c: New test. * gcc.target/s390/vector/long-double-wflpxb.c: New test. * gcc.target/s390/vector/long-double-wfmaxb-2.c: New test. * gcc.target/s390/vector/long-double-wfmaxb-3.c: New test. * gcc.target/s390/vector/long-double-wfmaxb-disabled.c: New test. * gcc.target/s390/vector/long-double-wfmaxb.c: New test. * gcc.target/s390/vector/long-double-wfmsxb-disabled.c: New test. * gcc.target/s390/vector/long-double-wfmsxb.c: New test. * gcc.target/s390/vector/long-double-wfmxb.c: New test. * gcc.target/s390/vector/long-double-wfnmaxb-disabled.c: New test. * gcc.target/s390/vector/long-double-wfnmaxb.c: New test. * gcc.target/s390/vector/long-double-wfnmsxb-disabled.c: New test. * gcc.target/s390/vector/long-double-wfnmsxb.c: New test. * gcc.target/s390/vector/long-double-wfsqxb.c: New test. * gcc.target/s390/vector/long-double-wfsxb-1.c: New test. * gcc.target/s390/vector/long-double-wfsxb.c: New test. * gcc.target/s390/vector/long-double-wftcixb-1.c: New test. * gcc.target/s390/vector/long-double-wftcixb.c: New test.
2020-11-10IBM Z: Store long doubles in vector registers when possibleIlya Leoshkevich8-134/+604
On z14+, there are instructions for working with 128-bit floats (long doubles) in vector registers. It's beneficial to use them instead of instructions that operate on floating point register pairs, because it allows to store 4 times more data in registers at a time, relieving register pressure. The raw performance of the new instructions is almost the same as that of the new ones. Implement by storing TFmode values in vector registers on z14+. Since not all operations are available with the new instructions, keep the old ones available using the new FPRX2 mode, and convert between it and TFmode when necessary (this is called "forwarder" expanders below). Change the existing TFmode expanders to call either new- or old-style ones depending on whether we are on z14+ or older machines ("dispatcher" expanders). gcc/ChangeLog: 2020-11-03 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390-modes.def (FPRX2): New mode. * config/s390/s390-protos.h (s390_fma_allowed_p): New function. * config/s390/s390.c (s390_fma_allowed_p): Likewise. (s390_build_signbit_mask): Support 128-bit masks. (print_operand): Support printing the second word of a TFmode operand as vector register. (constant_modes): Add FPRX2mode. (s390_class_max_nregs): Return 1 for TFmode on z14+. (s390_is_fpr128): New function. (s390_is_vr128): Likewise. (s390_can_change_mode_class): Use s390_is_fpr128 and s390_is_vr128 in order to determine whether mode refers to a FPR pair or to a VR. (s390_emit_compare): Force TFmode operands into registers on z14+. * config/s390/s390.h (HAVE_TF): New macro. (EXPAND_MOVTF): New macro. (EXPAND_TF): Likewise. * config/s390/s390.md (PFPO_OP_TYPE_FPRX2): PFPO_OP_TYPE_TF alias. (ALL): Add FPRX2. (FP_ALL): Add FPRX2 for z14+, restrict TFmode to z13-. (FP): Likewise. (FP_ANYTF): New mode iterator. (BFP): Add FPRX2 for z14+, restrict TFmode to z13-. (TD_TF): Likewise. (xde): Add FPRX2. (nBFP): Likewise. (nDFP): Likewise. (DSF): Likewise. (DFDI): Likewise. (SFSI): Likewise. (DF): Likewise. (SF): Likewise. (fT0): Likewise. (bt): Likewise. (_d): Likewise. (HALF_TMODE): Likewise. (tf_fpr): New mode_attr. (type): New mode_attr. (*cmp<mode>_ccz_0): Use type instead of mode with fsimp. (*cmp<mode>_ccs_0_fastmath): Likewise. (*cmptf_ccs): New pattern for wfcxb. (*cmptf_ccsfps): New pattern for wfkxb. (mov<mode>): Rename to mov<mode><tf_fpr>. (signbit<mode>2): Rename to signbit<mode>2<tf_fpr>. (isinf<mode>2): Renamed to isinf<mode>2<tf_fpr>. (*TDC_insn_<mode>): Use type instead of mode with fsimp. (fixuns_trunc<FP:mode><GPR:mode>2): Rename to fixuns_trunc<FP:mode><GPR:mode>2<FP:tf_fpr>. (fix_trunctf<mode>2): Rename to fix_trunctf<mode>2_fpr. (floatdi<mode>2): Rename to floatdi<mode>2<tf_fpr>, use type instead of mode with itof. (floatsi<mode>2): Rename to floatsi<mode>2<tf_fpr>, use type instead of mode with itof. (*floatuns<GPR:mode><FP:mode>2): Use type instead of mode for itof. (floatuns<GPR:mode><FP:mode>2): Rename to floatuns<GPR:mode><FP:mode>2<tf_fpr>. (trunctf<mode>2): Rename to trunctf<mode>2_fpr, use type instead of mode with fsimp. (extend<DSF:mode><BFP:mode>2): Rename to extend<DSF:mode><BFP:mode>2<BFP:tf_fpr>. (<FPINT:fpint_name><BFP:mode>2): Rename to <FPINT:fpint_name><BFP:mode>2<BFP:tf_fpr>, use type instead of mode with fsimp. (rint<BFP:mode>2): Rename to rint<BFP:mode>2<BFP:tf_fpr>, use type instead of mode with fsimp. (<FPINT:fpint_name><DFP:mode>2): Use type instead of mode for fsimp. (rint<DFP:mode>2): Likewise. (trunc<BFP:mode><DFP_ALL:mode>2): Rename to trunc<BFP:mode><DFP_ALL:mode>2<BFP:tf_fpr>. (trunc<DFP_ALL:mode><BFP:mode>2): Rename to trunc<DFP_ALL:mode><BFP:mode>2<BFP:tf_fpr>. (extend<BFP:mode><DFP_ALL:mode>2): Rename to extend<BFP:mode><DFP_ALL:mode>2<BFP:tf_fpr>. (extend<DFP_ALL:mode><BFP:mode>2): Rename to extend<DFP_ALL:mode><BFP:mode>2<BFP:tf_fpr>. (add<mode>3): Rename to add<mode>3<tf_fpr>, use type instead of mode with fsimp. (*add<mode>3_cc): Use type instead of mode with fsimp. (*add<mode>3_cconly): Likewise. (sub<mode>3): Rename to sub<mode>3<tf_fpr>, use type instead of mode with fsimp. (*sub<mode>3_cc): Use type instead of mode with fsimp. (*sub<mode>3_cconly): Likewise. (mul<mode>3): Rename to mul<mode>3<tf_fpr>, use type instead of mode with fsimp. (fma<mode>4): Restrict using s390_fma_allowed_p. (fms<mode>4): Restrict using s390_fma_allowed_p. (div<mode>3): Rename to div<mode>3<tf_fpr>, use type instead of mode with fdiv. (neg<mode>2): Rename to neg<mode>2<tf_fpr>. (*neg<mode>2_cc): Use type instead of mode with fsimp. (*neg<mode>2_cconly): Likewise. (*neg<mode>2_nocc): Likewise. (*neg<mode>2): Likeiwse. (abs<mode>2): Rename to abs<mode>2<tf_fpr>, use type instead of mode with fdiv. (*abs<mode>2_cc): Use type instead of mode with fsimp. (*abs<mode>2_cconly): Likewise. (*abs<mode>2_nocc): Likewise. (*abs<mode>2): Likewise. (*negabs<mode>2_cc): Likewise. (*negabs<mode>2_cconly): Likewise. (*negabs<mode>2_nocc): Likewise. (*negabs<mode>2): Likewise. (sqrt<mode>2): Rename to sqrt<mode>2<tf_fpr>, use type instead of mode with fsqrt. (cbranch<mode>4): Use FP_ANYTF instead of FP. (copysign<mode>3): Rename to copysign<mode>3<tf_fpr>, use type instead of mode with fsimp. * config/s390/s390.opt (flag_vx_long_double_fma): New undocumented option. * config/s390/vector.md (V_HW): Add TF for z14+. (V_HW2): Likewise. (VFT): Likewise. (VF_HW): Likewise. (V_128): Likewise. (tf_vr): New mode_attr. (tointvec): Add TF. (mov<mode>): Rename to mov<mode><tf_vr>. (movetf): New dispatcher. (*vec_tf_to_v1tf): Rename to *vec_tf_to_v1tf_fpr, restrict to z13-. (*vec_tf_to_v1tf_vr): New pattern for z14+. (*fprx2_to_tf): Likewise. (*mov_tf_to_fprx2_0): Likewise. (*mov_tf_to_fprx2_1): Likewise. (add<mode>3): Rename to add<mode>3<tf_vr>. (addtf3): New dispatcher. (sub<mode>3): Rename to sub<mode>3<tf_vr>. (subtf3): New dispatcher. (mul<mode>3): Rename to mul<mode>3<tf_vr>. (multf3): New dispatcher. (div<mode>3): Rename to div<mode>3<tf_vr>. (divtf3): New dispatcher. (sqrt<mode>2): Rename to sqrt<mode>2<tf_vr>. (sqrttf2): New dispatcher. (fma<mode>4): Restrict using s390_fma_allowed_p. (fms<mode>4): Likewise. (neg_fma<mode>4): Likewise. (neg_fms<mode>4): Likewise. (neg<mode>2): Rename to neg<mode>2<tf_vr>. (negtf2): New dispatcher. (abs<mode>2): Rename to abs<mode>2<tf_vr>. (abstf2): New dispatcher. (float<mode>tf2_vr): New forwarder. (float<mode>tf2): New dispatcher. (floatuns<mode>tf2_vr): New forwarder. (floatuns<mode>tf2): New dispatcher. (fix_trunctf<mode>2_vr): New forwarder. (fix_trunctf<mode>2): New dispatcher. (fixuns_trunctf<mode>2_vr): New forwarder. (fixuns_trunctf<mode>2): New dispatcher. (<FPINT:fpint_name><VF_HW:mode>2<VF_HW:tf_vr>): New pattern. (<FPINT:fpint_name>tf2): New forwarder. (rint<mode>2<tf_vr>): New pattern. (rinttf2): New forwarder. (*trunctfdf2_vr): New pattern. (trunctfdf2_vr): New forwarder. (trunctfdf2): New dispatcher. (trunctfsf2_vr): New forwarder. (trunctfsf2): New dispatcher. (extenddftf2_vr): New pattern. (extenddftf2): New dispatcher. (extendsftf2_vr): New forwarder. (extendsftf2): New dispatcher. (signbittf2_vr): New forwarder. (signbittf2): New dispatchers. (isinftf2_vr): New forwarder. (isinftf2): New dispatcher. * config/s390/vx-builtins.md (*vftci<mode>_cconly): Use VF_HW instead of VECF_HW, add missing constraint, add vw support. (vftci<mode>_intcconly): Use VF_HW instead of VECF_HW. (*vftci<mode>): Rename to vftci<mode>, use VF_HW instead of VECF_HW, and vw support. (vftci<mode>_intcc): Use VF_HW instead of VECF_HW.
2020-11-10Fix wrong code for boolean negation in condition at -O2Eric Botcazou2-14/+66
The problem is the bitwise/logical dichotomy for operators and the transition from the former to the latter for boolean types: if they are 1-bit, that's straightforward but, if they are larger, then you need to be careful because you cannot, on the one hand, turn a bitwise AND into a logical AND and, on the other hand, *not* turn e.g. a bitwise NOT into a logical NOT if they occur in the same computation, as the first change will drop the masking that may need to be applied after the bitwise NOT if it is not also changed. Given that the ranger turns bitwise AND/OR into logical AND/OR for booleans, the patch does the same for bitwise NOT. gcc/ChangeLog: * range-op.cc (operator_logical_not::fold_range): Tidy up. (operator_logical_not::op1_range): Call above method. (operator_bitwise_not::fold_range): If the type is compatible with boolean, call op_logical_not.fold_range. (operator_bitwise_not::op1_range): If the type is compatible with boolean, call op_logical_not.op1_range. gcc/testsuite/ChangeLog: * gnat.dg/opt88.adb: New test.
2020-11-10More PRE TLCRichard Biener1-94/+89
This makes get_expr_value_id cheap and completes the constant value-id simplification by turning the constant_value_expressions into a direct map instead of a set of pre_exprs for the value. 2020-11-10 Richard Biener <rguenther@suse.de> * tree-ssa-pre.c (pre_expr_d::value_id): Add. (constant_value_expressions): Turn into an array of pre_expr. (get_or_alloc_expr_for_nary): New function. (get_or_alloc_expr_for_reference): Likewise. (add_to_value): For constant values only ever add a single CONSTANT. (get_expr_value_id): Return the new value_id member. (vn_valnum_from_value_id): Split out and simplify constant value id handling. (get_or_alloc_expr_for_constant): Set the value_id member. (phi_translate_1): Use get_or_alloc_expr_for_*. (compute_avail): Likewise. (bitmap_find_leader): Simplify constant value id handling.
2020-11-10aarch64: Skip arm targets in vq*shr*n_high_n intrinsic testsDavid Candler4-0/+12
These tests should be skipped for arm targets as the instrinsics are only supported on aarch64. gcc/testsuite/ChangeLog 2020-11-10 David Candler <david.candler@arm.com> * gcc.target/aarch64/advsimd-intrinsics/vqrshrn_high_n.c: Added skip directive. * 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.
2020-11-10doc: Fix grammar in description of earlyclobberAlex Coplan1-1/+1
gcc/ChangeLog: * doc/md.texi (Modifiers): Fix grammar in description of earlyclobber constraint modifier.