- Aug 22, 2023
-
-
xuli authored
his patch fixes this issue happens on GCC-13. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111074 This patch should be backported to GCC-13. GCC-14 has rewritten propagate_avl function, so there is no issue. PR target/111074 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (extract_single_source): Fix bug.
-
GCC Administrator authored
-
- Aug 21, 2023
-
-
liuhongt authored
Alderlake-N is E-core only, add it as an alias of Alderlake. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Detect Alderlake-N. * common/config/i386/i386-common.cc (alias_table): Support -march=gracemont as an alias of -march=alderlake. (cherry picked from commit f847e019)
-
GCC Administrator authored
-
- Aug 20, 2023
-
-
GCC Administrator authored
-
- Aug 19, 2023
-
-
Guo Jie authored
gcc/ChangeLog: * config/loongarch/t-loongarch: Add loongarch-driver.h into TM_H. Add loongarch-def.h and loongarch-tune.h into OPTIONS_H_EXTRA. Co-authored-by:
Lulu Cheng <chenglulu@loongson.cn> (cherry picked from commit 3e315736)
-
GCC Administrator authored
-
- Aug 18, 2023
-
-
GCC Administrator authored
-
- Aug 17, 2023
-
-
GCC Administrator authored
-
- Aug 16, 2023
-
-
Patrick Palka authored
Here we're incorrectly rejecting the first type-requirement at parse time with concepts-requires35.C:14:56: error: ‘typename A<T>::B’ is not a template [-fpermissive] We also incorrectly reject the second type-requirement at satisfaction time with concepts-requires35.C:17:34: error: ‘typename A<int>::B’ names ‘template<class U> struct A<int>::B’, which is not a type and similarly for the third type-requirement. This seems to happen only within a type-requirement; if we instead use e.g. an alias template then it works as expected. The difference ultimately seems to be that during parsing of a using-decl, we pass check_dependency_p=true to cp_parser_nested_name_specifier_opt whereas for a type-requirement we pass check_dependency_p=false. Passing =false causes cp_parser_template_id for the dependently-scoped template-id B<bool> to create a TYPE_DECL of TYPENAME_TYPE (with TYPENAME_IS_CLASS_P unexpectedly set in the last two cases) whereas passing =true causes it to return a TEMPLATE_ID_EXPR. We then call make_typename_type on this TYPE_DECL which does the wrong thing. Since there seems to be no justification for using check_dependency_p=false here, the simplest fix seems to be to pass check_dependency_p=true instead, matching the behavior of cp_parser_elaborated_type_specifier. PR c++/110927 gcc/cp/ChangeLog: * parser.cc (cp_parser_type_requirement): Pass check_dependency_p=true instead of =false. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires35.C: New test. (cherry picked from commit 63bd36be)
-
liuhongt authored
Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions Rename original use_gather to use_gather_8parts, Support -mtune-ctrl={,^}use_gather to set/clear tune features use_gather_{2parts, 4parts, 8parts}. Support the new option -mgather as alias of -mtune-ctrl=, use_gather, ^use_gather. Similar for use_scatter. gcc/ChangeLog: * config/i386/i386-builtins.cc (ix86_vectorize_builtin_gather): Adjust for use_gather_8parts. * config/i386/i386-options.cc (parse_mtune_ctrl_str): Set/Clear tune features use_{gather,scatter}_{2parts, 4parts, 8parts} for -mtune-crtl={,^}{use_gather,use_scatter}. * config/i386/i386.cc (ix86_vectorize_builtin_scatter): Adjust for use_scatter_8parts * config/i386/i386.h (TARGET_USE_GATHER): Rename to .. (TARGET_USE_GATHER_8PARTS): .. this. (TARGET_USE_SCATTER): Rename to .. (TARGET_USE_SCATTER_8PARTS): .. this. * config/i386/x86-tune.def (X86_TUNE_USE_GATHER): Rename to (X86_TUNE_USE_GATHER_8PARTS): .. this. (X86_TUNE_USE_SCATTER): Rename to (X86_TUNE_USE_SCATTER_8PARTS): .. this. * config/i386/i386.opt: Add new options mgather, mscatter. (cherry picked from commit b2a927fb)
-
liuhongt authored
For more details of GDS (Gather Data Sampling), refer to https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/gather-data-sampling.html After microcode update, there's performance regression. To avoid that, the patch disables gather generation in autovectorization but uses gather scalar emulation instead. gcc/ChangeLog: * config/i386/i386-options.cc (m_GDS): New macro. * config/i386/x86-tune.def (X86_TUNE_USE_GATHER_2PARTS): Don't enable for m_GDS. (X86_TUNE_USE_GATHER_4PARTS): Ditto. (X86_TUNE_USE_GATHER): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx2-gather-2.c: Adjust options to keep gather vectorization. * gcc.target/i386/avx2-gather-6.c: Ditto. * gcc.target/i386/avx512f-pr88464-1.c: Ditto. * gcc.target/i386/avx512f-pr88464-5.c: Ditto. * gcc.target/i386/avx512vl-pr88464-1.c: Ditto. * gcc.target/i386/avx512vl-pr88464-11.c: Ditto. * gcc.target/i386/avx512vl-pr88464-3.c: Ditto. * gcc.target/i386/avx512vl-pr88464-9.c: Ditto. * gcc.target/i386/pr88531-1b.c: Ditto. * gcc.target/i386/pr88531-1c.c: Ditto. (cherry picked from commit 3064d1f5)
-
GCC Administrator authored
-
- Aug 15, 2023
-
-
Jonathan Wakely authored
This backported patch was from Paul Dreik.
-
GCC Administrator authored
-
- Aug 14, 2023
-
-
Jonathan Wakely authored
If abs(__v) is smaller than one, the result will be of the form 0.xxxxx. It is only if the magnitude is large that more digits are needed before the decimal dot. This uses frexp instead of log10 which should be less expensive and have sufficient precision for the desired purpose. It removes the problematic cases where log10 will be negative or not fit in an int. Signed-off-by:
Paul Dreik <gccpatches@pauldreik.se> libstdc++-v3/ChangeLog: PR libstdc++/110860 * include/std/format (__formatter_fp::format): Use frexp instead of log10. (cherry picked from commit 2d2b05f0)
-
Jonathan Wakely authored
When writing to a contiguous iterator, std::format_to_n(out, n, ...) always returns out + n, even if it wrote fewer than n characters to the iterator. The problem is in the _M_finish() member function of the _Iter_sink specialization for contiguous iterators. _M_finish() calls _M_overflow() to update its count of characters written, so it can return the count of characters that would be written if there was room. But _M_overflow() assumes it's only called when the buffer is full, and so switches to the internal buffer. _M_finish() then thinks that if the internal buffer is in use, we already wrote at least n characters and so returns out+n as the output position. We can fix the problem by adding a check in _M_overflow() so that we don't update the count and switch to the internal buffer unless we've run out of room, i.e. _M_unused().size() is zero. The caller then needs to be prepared for _M_count not being the final total, and so add _M_used.size() to it. However, there's not actually any need for _M_finish() to call _M_overflow() to get the count. We now need to use _M_count and _M_used.size() to get the total anyway so _M_overflow() doesn't help with that. And we don't need to use _M_overflow() to flush unwritten characters to the output, because the specialization for contiguous iterators always writes directly to the output without buffering (except when we've exceeded the maximum number of characters, in which case we want to discard the buffered characters anyway). So _M_finish() can be simplified and can avoid calling _M_overflow(). This change also fixes some member functions of other sink classes to only call _M_overflow() when there are characters in the buffer, which is needed to meet _M_overflow's precondition that _M_used().size()!=0. libstdc++-v3/ChangeLog: PR libstdc++/110990 * include/std/format (_Seq_sink::get): Only call _M_overflow if its precondition is met. (_Iter_sink::_M_finish): Likewise. (_Iter_sink<C, ContigIter>::_M_overflow): Only switch to the internal buffer after running out of space. (_Iter_sink<C, ContigIter>::_M_finish): Do not use _M_overflow. (_Counting_sink::count): Likewise. * testsuite/std/format/functions/format_to_n.cc: Check cases where the output fits into the buffer. (cherry picked from commit 003016a4)
-
Cui, Lili authored
Update model values for Raptorlake according to SDM. gcc/ChangeLog * common/config/i386/cpuinfo.h (get_intel_cpu): Add model value 0xba to Raptorlake.
-
GCC Administrator authored
-
- Aug 13, 2023
-
-
Iain Sandoe authored
This corrects some typos in the suffix of the m2rte pluing that lead to a bootstrap fail on Darwin, where the suffix is not '.so'. On some versions of Darwin, the linker complains if libSystem is not linked, so we disable all the default libs, but add libc back. Signed-off-by:
Iain Sandoe <iain@sandoe.co.uk> gcc/m2/ChangeLog: * Make-lang.in: Update suffix spellings to use 'soext'. Add libc to the plugin link. (cherry picked from commit 25be11e9)
-
GCC Administrator authored
-
- Aug 12, 2023
-
-
Gaius Mulley authored
This patch adds corrections to defensively check against glibc functions, structures and contains fallbacks. These fixes were required under Darwin. gcc/m2/ChangeLog: PR modula2/110779 * gm2-libs-iso/SysClock.mod (EpochTime): New procedure. (GetClock): Call EpochTime if the C time functions are unavailable. * gm2-libs-iso/wrapclock.def (istimezone): New function definition. libgm2/ChangeLog: PR modula2/110779 * configure: Regenerate. * configure.ac: Provide special case test for Darwin cross configuration. (GLIBCXX_CONFIGURE): New statement. (GLIBCXX_CHECK_GETTIMEOFDAY): New statement. (GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement. * libm2iso/wrapclock.cc: New sys/time.h conditional include. (sys/syscall.h): Conditional include. (unistd.h): Conditional include. (GetTimeRealtime): Re-implement. (SetTimeRealtime): Re-implement. (timezone): Re-implement. (istimezone): New function. (daylight): Re-implement. (isdst): Re-implement. (tzname): Re-implement. Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
Gaius Mulley authored
This patch disables the m2rte plugin by default. The driver will only append the -fplugin=m2rte command line option for cc1gm2 if -fm2-plugin is present. It only enabled providing ENABLE_PLUGIN is defined. gcc/m2/Make-file.in will only build and install m2rte if enable_plugin is yes. gcc/m2/ChangeLog: PR modula2/108119 * Make-lang.in (M2RTE_PLUGIN_SO): Assigned to plugin/m2rte$(exeext).so if enable_plugin is yes. (m2.all.cross): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2.all.encap): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2.install-plugin): Add dummy rule when enable_plugin is not yes. (plugin/m2rte$(exeext).so): Add dummy rule when enable_plugin is not yes. (m2/stage2/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2/stage1/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). * gm2spec.cc (lang_specific_driver): Set need_plugin to false by default. gcc/testsuite/ChangeLog: PR modula2/108119 * gm2/iso/check/fail/iso-check-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/auto-init/fail/switches-auto-init-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp (gm2_init_pim2): Add -fm2-plugin. * gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp (gm2_init_pim2): Add -fm2-plugin. Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
GCC Administrator authored
-
- Aug 11, 2023
-
-
Jason Merrill authored
Here, when dealing with a class with a complex subobject structure, we would try and fail to find the relevant FIELD_DECL for an empty base before giving up. And we would do this at each level, in a combinatorially problematic way. Instead, we should check for an empty base first. PR c++/109678 gcc/cp/ChangeLog: * constexpr.cc (cxx_fold_indirect_ref_1): Handle empty base first. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/variant1.C: New test.
-
Jason Merrill authored
For backward compatibility we still want to allow patterns like this->A<T>::foo, but the template keyword in a qualified name is specifically to specify that a dependent name is a template, so don't look in the enclosing scope at all. Also fix handling of dependent bases: if member lookup in the current instantiation fails and we have dependent bases, the lookup is dependent. We were already handling that for the case where lookup in the enclosing scope also fails, but we also want it to affect that lookup itself. PR c++/106310 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_name): Skip non-member lookup after the template keyword. (cp_parser_lookup_name): Pass down template_keyword_p. gcc/testsuite/ChangeLog: * g++.dg/template/template-keyword4.C: New test.
-
Jonathan Wakely authored
This avoids an IndexError exception when printing invalid chrono::month or chrono::weekday values. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdChronoCalendarPrinter): Check for out-of-range month an weekday indices. * testsuite/libstdc++-prettyprinters/chrono.cc: Check invalid month and weekday values. (cherry picked from commit c19b542a)
-
Jonathan Wakely authored
This renames __iterator_category_t to __iter_category_t, for consistency with std::iter_value_t, std::iter_difference_t and std::iter_reference_t in C++20. Then use __iter_category_t in <bits/stl_iterator.h>, which fixes the problem of the missing 'typename' that Clang 15 incorrectly still requires. libstdc++-v3/ChangeLog: PR libstdc++/110970 * include/bits/stl_iterator.h (__detail::__move_iter_cat): Use __iter_category_t. (iterator_traits<common_iterator<I, S>>::_S_iter_cat): Likewise. (__detail::__basic_const_iterator_iter_cat): Likewise. * include/bits/stl_iterator_base_types.h (__iterator_category_t): Rename to __iter_category_t. (cherry picked from commit 9cb2a7c8)
-
Thomas Neumann authored
Original bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110956 Rainer Orth successfully tested the patch on Solaris with a full bootstrap. Some uncommon unwinding table encodings need to access the base pointer for address computations. We do not have that information in calls to __deregister_frame_info_bases, and previously simply used nullptr as base pointer. That is usually fine, but for some Solaris i386 shared libraries that results in wrong address computations. To fix this problem we now associate the unwinding object with the table pointer itself, which is always known, in addition to the PC range. When deregistering a frame, we first locate the object using the table pointer, and then use the base pointer stored within the object to compute the PC range. libgcc/ChangeLog: PR libgcc/110956 * unwind-dw2-fde.c: Associate object with address of unwinding table.
-
GCC Administrator authored
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: PR libstdc++/110974 * include/std/format (_Spec::_M_parse_precision): Check for empty range before dereferencing iterator. * testsuite/std/format/string.cc: Check for expected exception. Fix expected exception message in test_pr110862() and actually call it. (cherry picked from commit ecfd8c7f)
-
Jonathan Wakely authored
The __formatter_fp::_M_localize function just returns an empty string if the formatting locale is the C locale, as there is nothing to do. But the caller was assuming that the returned string contains the localized string. The caller should use the original string if _M_localize returns an empty string. libstdc++-v3/ChangeLog: PR libstdc++/110968 * include/std/format (__formatter_fp::format): Check return value of _M_localize. * testsuite/std/format/functions/format.cc: Check classic locale. (cherry picked from commit f48a5423)
-
- Aug 10, 2023
-
-
Juzhe-Zhong authored
Realize we have a bug in VSETVL PASS which is triggered by strided_load_run-1.c in RV32 system. FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test This is because VSETVL PASS incorrect hoist vsetvl instruction: ... 10156: 0d9075d7 vsetvli a1,zero,e64,m2,ta,ma ---> pollute 'a1' register which will be used by following insns. 1015a: 01d586b3 add a3,a1,t4 --------> use 'a1' 1015e: 5e070257 vmv.v.v v4,v14 10162: b7032257 vmacc.vv v4,v6,v16 10166: 26440257 vand.vv v4,v4,v8 1016a: 22880227 vs2r.v v4,(a6) 1016e: 00b6b7b3 sltu a5,a3,a1 10172: 22888227 vs2r.v v4,(a7) 10176: 9e60b157 vmv2r.v v2,v6 1017a: 97ba add a5,a5,a4 1017c: a6a62157 vmadd.vv v2,v12,v10 10180: 26240157 vand.vv v2,v2,v8 10184: 22830127 vs2r.v v2,(t1) 10188: 873e mv a4,a5 1018a: 982a add a6,a6,a0 1018c: 98aa add a7,a7,a0 1018e: 932a add t1,t1,a0 10190: 85b6 mv a1,a3 -----> set 'a1' ... gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (anticipatable_occurrence_p): Fix incorrect anticipate info. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-1.c: Adjust tests. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-2.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-24.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-25.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-26.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-3.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-36.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-4.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-7.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-14.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-15.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-16.c: Ditto.
-
GCC Administrator authored
-
- Aug 09, 2023
-
-
Paul Thomas authored
2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu> gcc/fortran PR fortran/109684 * resolve.cc (resolve_types): Exclude contained procedures with the artificial attribute from test for pureness.
-
Gaius Mulley authored
This patch defensively checks for every C function and every struct used in wrapclock.cc. It adds return values to GetTimespec and SetTimespec to allow the module to return a code representing unavailable. gcc/m2/ChangeLog: PR modula2/110779 * gm2-libs-iso/SysClock.mod (GetClock): Test GetTimespec return value. (SetClock): Test SetTimespec return value. * gm2-libs-iso/wrapclock.def (GetTimespec): Add integer return type. (SetTimespec): Add integer return type. libgm2/ChangeLog: PR modula2/110779 * config.h.in: Regenerate. * configure: Regenerate. * configure.ac (AC_CACHE_CHECK): Check for tm_gmtoff field in struct tm. (GM2_CHECK_LIB): Check for daylight, timezone and tzname. * libm2iso/wrapclock.cc (timezone): Guard against absence of struct tm and tm_gmtoff. (daylight): Check for daylight. (timezone): Check for timezone. (isdst): Check for isdst. (tzname): Check for tzname. (GetTimeRealtime): Check for struct timespec. (SetTimeRealtime): Check for struct timespec. (InitTimespec): Check for struct timespec. (KillTimespec): Check for struct timespec. (SetTimespec): Check for struct timespec. (GetTimespec): Check for struct timespec. Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
liuhongt authored
Don't access leaf 7 subleaf 1 unless subleaf 0 says it is supported via EAX. Intel documentation says invalid subleaves return 0. We had been relying on that behavior instead of checking the max sublef number. It appears that some Sandy Bridge CPUs return at least the subleaf 0 EDX value for subleaf 1. Best guess is that this is a bug in a microcode patch since all of the bits we're seeing set in EDX were introduced after Sandy Bridge was originally released. This is causing avxvnniint16 to be incorrectly enabled with -march=native on these CPUs. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Check max_subleaf_level for valid subleaf before use CPUID.
-
GCC Administrator authored
-
- Aug 08, 2023
-
-
Jonathan Wakely authored
The std::formatter implementation for floating-point types uses __builtin_abs and __builtin_log10 to avoid including all of <cmath>, but those functions are not generic. The result of abs(2e304) is -INT_MIN which is undefined, and then log10(INT_MIN) is NaN. As well as being undefined, we fail to grow the buffer correctly, and then loop more times than needed to allocate a buffer and try formatting the value into it again. We can use if-constexpr to choose the correct form of log10 to use for the type, and avoid using abs entirely. This avoids the undefined behaviour and should mean we only reallocate and retry std::to_chars once. libstdc++-v3/ChangeLog: PR libstdc++/110860 * include/std/format (__formatter_fp::format): Do not use __builtin_abs and __builtin_log10 with arbitrary floating-point types. (cherry picked from commit bb3ceeb6)
-