This bug is exposed on the ppc64le platform. The expression
parser P3Build.bnf (and PHBuild.bnf) BuiltNot omitted to record
the current token position on the quad stack. The patch changes
all occurances of NEW to newBoolFrame to ensure that the tokenno
recorded in the bool frame is set to a sensible value.
BuildNot is fixed and improved to generate a virtual token
recording the position of the subexpression.
gcc/m2/ChangeLog:
* gm2-compiler/M2LexBuf.mod (isSrcToken): Add block comment.
Remove dead code.
* gm2-compiler/M2Quads.def (BuildNot): Add notTokPos parameter.
* gm2-compiler/M2Quads.mod (BuildNot): Add notTokPos parameter.
Create and push virtual token.
(PopBooltok): New procedure.
(PushBooltok): New procedure.
(PushBool): Re-implement using PushBooltok.
(PopBool): Re-implement using PopBooltok.
* gm2-compiler/P3Build.bnf (ConstFactor): Record token
position of NOT.
(Factor): Record token position of NOT.
* gm2-compiler/PHBuild.bnf (ConstFactor): Record token
position of NOT.
(Relation): Push token position.
(UnaryOrConstTerm): Push token position.
(AddOperator): Push token position.
(MulOperator): Push token position.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
For a port with signed char and unsigned wchar_t initializing a wchar_t
array with a char is a narrowing conversion. The code is wrong for
assuming that (int)'a' == (int)L'a' anyway, so fix it properly by using
ctype<wchar_t>::widen(char).
libstdc++-v3/ChangeLog:
* testsuite/std/time/clock/utc/io.cc: Use ctype to widen char.
__cxa_demangle is only to demangle C++ names, for all C functions,
extern "C" functions, and including main it returns -2, in that case
just adapt the given name. Otherwise it's kept empty, which doesn't look
nice in the stacktrace.
libstdc++-v3/ChangeLog:
* include/std/stacktrace (stacktrace_entry::_S_demangle): Use
raw __name if __cxa_demangle could not demangle it.
Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
This allows most of the tzdb functionality to be disabled by
configuring with --with-libstdcxx-zoneinfo=no. This might be desirable
for small targets that don't need the time zone support.
libstdc++-v3/ChangeLog:
* src/c++20/tzdb.cc (TZDB_DISABLED): Disable all code for
loading tzdb.
* testsuite/std/time/tzdb/leap_seconds.cc: Require tzdb
effective target.
* testsuite/std/time/tzdb_list/1.cc: Likewise.
This adds a copy of the tzdata.zi file to the library, and allows
configuring to use it instead of a copy read from disk at runtime.
The content of the file is in the public domain, but will need to be
updated to the latest upstream file before making GCC releases.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ZONEINFO_DIR): Replace the
--with-libstdcxx-zoneinfo-dir configure option with
--with-libstdcxx-zoneinfo with yes/no/static choices as well as
a directory.
* config.h.in: Regenerate.
* configure: Regenerate.
* doc/xml/manual/configure.xml: Document configure option.
* doc/html/manual/configure.html: Regenerate.
* src/c++20/Makefile.am: Generate tzdata.zi.h header.
* src/c++20/Makefile.in: Regenerate.
* src/c++20/tzdb.cc (__gnu_cxx::zoneinfo_dir_override): Return a
null pointer if no directory is configured.
(zoneinfo_dir): Replace with ...
(zoneinfo_file): New function.
(tzdata_stream): New istream class.
(remote_version, reload_tzdb): Use tzdata_stream.
* testsuite/lib/libstdc++.exp (check_effective_target_tzdb):
Check new _GLIBCXX_STATIC_TZDATA macro and ignore presence of
tzdata.zi file in default location.
* src/c++20/tzdata.zi: New file.
In the before-IRA era, ORDER_REGS_FOR_LOCAL_ALLOC was called for each
function in Xtensa, and there was register allocation table reordering
for leaf functions to compensate for the poor performance of local-alloc.
Today the adjustment hook is still called via its alternative
ADJUST_REG_ALLOC_ORDER, but it is only called once at the start of the IRA,
and leaf_function_p() erroneously returns true and also gives no argument
count.
That straightforwardly misleads register allocation that all functions are
always leaves with no arguments, which leads to inefficiencies in allocation
results.
Fortunately, IRA is smart enough than local-alloc to not need such assistance.
This patch does away with the antiquated by removing the wreckage that no
longer works.
gcc/ChangeLog:
* config/xtensa/xtensa-protos.h (order_regs_for_local_alloc):
Rename to xtensa_adjust_reg_alloc_order.
* config/xtensa/xtensa.cc (xtensa_adjust_reg_alloc_order):
Ditto. And also remove code to reorder register numbers for
leaf functions, rename the tables, and adjust the allocation
order for the call0 ABI to use register A0 more.
(xtensa_leaf_regs): Remove.
* config/xtensa/xtensa.h (REG_ALLOC_ORDER): Cosmetics.
(order_regs_for_local_alloc): Rename as the above.
(LEAF_REGISTERS, LEAF_REG_REMAP, leaf_function): Remove.
libstdc++-v3/ChangeLog:
* include/bits/chrono_io.h (operator<<): Fix syntax errors.
* testsuite/std/time/month_day/io.cc: New test.
* testsuite/std/time/month_day_last/io.cc: New test.
* testsuite/std/time/month_weekday/io.cc: New test.
* testsuite/std/time/month_weekday_last/io.cc: New test.
* testsuite/std/time/weekday_indexed/io.cc: New test.
* testsuite/std/time/weekday_last/io.cc: New test.
* testsuite/std/time/year_month/io.cc: New test.
* testsuite/std/time/year_month_day_last/io.cc: New test.
* testsuite/std/time/year_month_weekday/io.cc: New test.
* testsuite/std/time/year_month_weekday_last/io.cc: New test.
The following testcase is miscompiled, because we shorten the division
in a case where it should not be shortened.
Divisions (and modulos) can be shortened if it is unsigned division/modulo,
or if it is signed division/modulo where we can prove the dividend will
not be the minimum signed value or divisor will not be -1, because e.g.
on sizeof(long long)==sizeof(int)*2 && __INT_MAX__ == 0x7fffffff targets
(-2147483647 - 1) / -1 is UB
but
(int) (-2147483648LL / -1LL) is not, it is -2147483648.
The primary aim of both the C and C++ FE division/modulo shortening I assume
was for the implicit integral promotions of {,signed,unsigned} {char,short}
and because at this point we have no VRP information etc., the shortening
is done if the integral promotion is from unsigned type for the divisor
or if the dividend is an integer constant other than -1.
This works fine for char/short -> int promotions when char/short have
smaller precision than int - unsigned char -> int or unsigned short -> int
will always be a positive int, so never the most negative.
Now, the C FE checks whether orig_op0 is TYPE_UNSIGNED where op0 is either
the same as orig_op0 or that promoted to int, I think that works fine,
if it isn't promoted, either the division/modulo common type will have the
same precision as op0 but then the division/modulo is unsigned and so
without UB, or it will be done in wider precision (e.g. because op1 has
wider precision), but then op0 can't be minimum signed value. Or it has
been promoted to int, but in that case it was again from narrower type and
so never minimum signed int.
But the C++ FE was checking if op0 is a NOP_EXPR from TYPE_UNSIGNED.
First of all, not sure if the operand of NOP_EXPR couldn't be non-integral
type where TYPE_UNSIGNED wouldn't be meaningful, but more importantly,
even if it is a cast from unsigned integral type, we only know it can't be
minimum signed value if it is a widening cast, if it is same precision or
narrowing cast, we know nothing.
So, the following patch for the NOP_EXPR cases checks just in case that
it is from integral type and more importantly checks it is a widening
conversion, and then next to it also allows op0 to be just unsigned,
promoted or not, as that is what the C FE will do for those cases too
and I believe it must work - either the division/modulo common type
will be that unsigned type, then we can shorten and don't need to worry
about UB, or it will be some wider signed type but then it can't be most
negative value of the wider type.
And changes both the C and C++ FEs to do the same thing, using a helper
function in c-family.
2023-01-14 Jakub Jelinek <jakub@redhat.com>
PR c++/108365
* c-common.h (may_shorten_divmod): New static inline function.
* c-typeck.cc (build_binary_op): Use may_shorten_divmod for integral
division or modulo.
* typeck.cc (cp_build_binary_op): Use may_shorten_divmod for integral
division or modulo.
* c-c++-common/pr108365.c: New test.
* g++.dg/opt/pr108365.C: New test.
* g++.dg/warn/pr108365.C: New test.
Existing hash_table traits that use the same representation for empty
and deleted slots reject marking slots as deleted, and to not pass
is_deleted for slots that pass is_empty.
Nevertheless, nearly everywhere, we only test for is_deleted after
checking that !is_empty first. The one exception was the copy
constructor, that would fail if traits recognized is_empty slots as
is_deleted, but then refused to mark_deleted.
This asymmetry is neither necessary nor desirable, and there is a
theoretical risk that traits might not only fail to refuse to
mark_deleted, but also return is_deleted for is_empty slots.
This patch introduces checks that detect these potentially problematic
situations, and reorders the tests in the copy constructor so as to
use the conventional testing order and thus avoid them.
for gcc/ChangeLog
* hash-table.h (is_deleted): Precheck !is_empty.
(mark_deleted): Postcheck !is_empty.
(copy constructor): Test is_empty before is_deleted.
CD-DCE introduces blocks to share common PHI nodes, which replaces a
backwards branch that used to prevent the thumb2 jump table shortening
that PR42093 tested for. In order to keep on testing that the
backward branch prevents the jumptable shortening, disable tree-dce.
for gcc/testsuite/ChangeLog
PR target/42093
* gcc.target/arm/pr42093.c: Disable tree-dce.
When expanding a misaligned DImode move, emit aligned SImode moves if
the parts are sufficiently aligned. This enables neighboring stores
to be peephole-combined into stm, as expected by the PR40457 testcase,
even after SLP vectorizes the originally aligned SImode stores into a
misaligned DImode store.
for gcc/ChangeLog
PR target/40457
* config/arm/arm.md (movmisaligndi): Prefer aligned SImode
moves.
Assume that switch on an enum doesn't follow an implicit default
skipping all cases when all enum values are covered by cases.
Fixes various false positives from -Wanalyzer-use-of-uninitialized-value
such as this one seen in Doom:
p_maputl.c: In function 'P_BoxOnLineSide':
p_maputl.c:151:8: warning: use of uninitialized value 'p1' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
151 | if (p1 == p2)
| ^
'P_BoxOnLineSide': events 1-5
|
| 115 | int p1;
| | ^~
| | |
| | (1) region created on stack here
| | (2) capacity: 4 bytes
|......
| 118 | switch (ld->slopetype)
| | ~~~~~~
| | |
| | (3) following 'default:' branch...
|......
| 151 | if (p1 == p2)
| | ~
| | |
| | (4) ...to here
| | (5) use of uninitialized value 'p1' here
|
where "ld->slopetype" is a "slopetype_t" enum, and for every value of
that enum the switch has a case that initializes "p1".
gcc/analyzer/ChangeLog:
PR analyzer/105273
* region-model.cc (has_nondefault_case_for_value_p): New.
(has_nondefault_cases_for_all_enum_values_p): New.
(region_model::apply_constraints_for_gswitch): Skip
implicitly-created "default" when switching on an enum
and all enum values have non-default cases.
(rejected_default_case::dump_to_pp): New.
* region-model.h (region_model_context::possibly_tainted_p): New
decl.
(class rejected_default_case): New.
* sm-taint.cc (region_model_context::possibly_tainted_p): New.
* supergraph.cc (switch_cfg_superedge::dump_label_to_pp): Dump
when implicitly_created_default_p.
(switch_cfg_superedge::implicitly_created_default_p): New.
* supergraph.h
(switch_cfg_superedge::implicitly_created_default_p): New decl.
gcc/testsuite/ChangeLog:
PR analyzer/105273
* gcc.dg/analyzer/switch-enum-1.c: New test.
* gcc.dg/analyzer/switch-enum-2.c: New test.
* gcc.dg/analyzer/switch-enum-pr105273-git-vreportf-2.c: New test.
* gcc.dg/analyzer/switch-enum-taint-1.c: New test.
* gcc.dg/analyzer/switch-wrong-enum.c: New test.
* gcc.dg/analyzer/torture/switch-enum-pr105273-doom-p_floor.c: New
test.
* gcc.dg/analyzer/torture/switch-enum-pr105273-doom-p_maputl.c:
New test.
* gcc.dg/analyzer/torture/switch-enum-pr105273-git-vreportf-1.c:
New test.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This is needed to support the _Float32 and _Float64 types.
gcc/c-family/
* c-ada-spec.cc (is_float32): New function.
(is_float64): Likewise.
(is_float128): Tweak.
(dump_ada_node) <REAL_TYPE>: Call them to recognize more types.
Unlike other IPA passes, the ICF pass can be run at -O0 and some testcases
rely on this in the testsuite. Now it effectively creates a tail call so
the DF information needs be updated in this case after epilogue creation.
gcc/
PR rtl-optimization/108274
* function.cc (thread_prologue_and_epilogue_insns): Also update the
DF information for calls in a few more cases.
Somehow this setting had been missed, and we really need the verbose
flag to enable useful debug output.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/m2/ChangeLog:
* gm2-gcc/m2options.h (M2Options_SetVerbose): Export the
function.
* gm2-lang.cc: Handle OPT_v, passing it to the compiler.
* lang-specs.h: Pass -v to cc1gm2.
This change updates the atomic libcall support to fix the following
issues:
1) A internal compiler error with -fno-sync-libcalls.
2) When sync libcalls are disabled, we don't generate libcalls for
libatomic.
3) There is no sync libcall support for targets other than linux.
As a result, non-atomic stores are silently emitted for types
smaller or equal to the word size. There are now a few atomic
libcalls in the libgcc code, so we need sync support on all
targets.
2023-01-13 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
* config/pa/pa-linux.h (TARGET_SYNC_LIBCALL): Delete define.
* config/pa/pa.cc (pa_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE
define.
* config/pa/pa.h (TARGET_SYNC_LIBCALLS): Use flag_sync_libcalls.
(MAX_SYNC_LIBFUNC_SIZE): Define.
(TARGET_CPU_CPP_BUILTINS): Define __SOFTFP__ when soft float is
enabled.
* config/pa/pa.md (atomic_storeqi): Emit __atomic_exchange_1
libcall when sync libcalls are disabled.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.
(atomic_loaddi): Emit __atomic_load_8 libcall when sync libcalls
are disabled on 32-bit target.
* config/pa/pa.opt (matomic-libcalls): New option.
* doc/invoke.texi (HPPA Options): Update.
libgcc/ChangeLog:
* config.host (hppa*64*-*-linux*): Adjust tmake_file to use
pa/t-pa64-linux.
(hppa*64*-*-hpux11*): Adjust tmake_file to use pa/t-pa64-hpux
instead of pa/t-hpux and pa/t-pa64.
* config/pa/linux-atomic.c: Define u32 type.
(ATOMIC_LOAD): Define new macro to implement atomic_load_1,
atomic_load_2, atomic_load_4 and atomic_load_8. Update sync
defines to use atomic_load calls for type.
(SYNC_LOCK_LOAD_2): New macro to implement __sync_lock_load_8.
* config/pa/sync-libfuncs.c: New file.
* config/pa/t-netbsd (LIB2ADD_ST): Define.
* config/pa/t-openbsd (LIB2ADD_ST): Define.
* config/pa/t-pa64-hpux: New file.
* config/pa/t-pa64-linux: New file.
Scheduling across calls in the pre-RA scheduler is problematic: we do
not take liveness info into account, and are thus prone to extending
lifetime of a pseudo over the loop, requiring a callee-saved hardreg
or causing a spill.
If current function called a setjmp, lifting an assignment over a call
may be incorrect if a longjmp would happen before the assignment.
Thanks to Jose Marchesi for testing on AArch64.
gcc/ChangeLog:
PR rtl-optimization/108117
PR rtl-optimization/108132
* sched-deps.cc (deps_analyze_insn): Do not schedule across
calls before reload.
gcc/testsuite/ChangeLog:
PR rtl-optimization/108117
PR rtl-optimization/108132
* gcc.dg/pr108117.c: New test.
This needs to be included explicitly now that we don't include all of
<system_error> here.
libstdc++-v3/ChangeLog:
* include/bits/std_mutex.h: Include <errno.h>.
On the following testcase trunk emits a false positive warning on ia32.
convert_like_internal is there called with type of double and
expr EXCESS_PRECISION_EXPR with float type with long double operand
2.L * (long double) x.
Now, for the code generation we do the right thing, cp_convert
to double from that 2.L * (long double) x, but we call even
cp_convert_and_check with that and that emits the -Wfloat-conversion
warning. Looking at what the C FE does in this case, it calls
convert_and_check with the EXCESS_PRECISION_EXPR expression rather
than its operand, and essentially uses the operand for code generation
and EXCESS_PRECISION_EXPR itself for warnings.
The following patch does that too for the C++ FE.
2023-01-13 Jakub Jelinek <jakub@redhat.com>
PR c++/108285
* cvt.cc (cp_convert_and_check): For EXCESS_PRECISION_EXPR
use its operand except that for warning purposes use the original
EXCESS_PRECISION_EXPR.
* call.cc (convert_like_internal): Only look through
EXCESS_PRECISION_EXPR when calling cp_convert, not when calling
cp_convert_and_check.
* g++.dg/warn/pr108285.C: New test.
Some of the larger code tests timeout when -O3 is given.
This patch increase the map and pimlib-base-run-pass tests.
gcc/testsuite/ChangeLog:
* gm2/examples/map/pass/examples-map-pass.exp:
Call gm2_push_timeout 30 before foreach testcase.
Call gm2_pop_timeout after the foreach statement.
* gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp:
Call gm2_push_timeout 20 before foreach testcase.
Call gm2_pop_timeout after the foreach statement.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
This one is hand reduced to problematic code from optimized dump
that used to be miscompiled during combine starting with
r12-303 and fixed with r13-3530 aka PR107172 fix.
2023-01-13 Jakub Jelinek <jakub@redhat.com>
PR target/107131
* gcc.c-torture/execute/pr107131.c: New test.
Clang found an exit path from function with non-void return type
that has missing return statement [missingReturn].
gcc/m2/ChangeLog:
* mc-boot-ch/GRTco.c (RTco_select): Add return 0.
* pge-boot/GRTco.c (RTco_select): Add return 0.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
This patch adds cde feature (optional) support for Cortex-M55 CPU, please refer
[1] for more details. To use this feature we need to specify +cdecpN
(e.g. -mcpu=cortex-m55+cdecp<N>), where N is the coprocessor number 0 to 7.
gcc/ChangeLog:
2023-01-13 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* common/config/arm/arm-common.cc (arm_canon_arch_option_1): Ignore cde
options for -mlibarch.
* config/arm/arm-cpus.in (begin cpu cortex-m55): Add cde options.
* doc/invoke.texi (CDE): Document options for Cortex-M55 CPU.
gcc/testsuite/ChangeLog:
2023-01-13 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* gcc.target/arm/multilib.exp: Add multilib tests for Cortex-M55 CPU.
We should not directly check flag_strict_flex_arrays in the
middle end. Instead, check DECL_NOT_FLEXARRAY(array_field_decl) which is set
by C/C++ FEs according to -fstrict-flex-arrays and the corresponding
attribute attached to the array_field.
As a result, We will lose the LEVEL information of -fstrict-flex-arrays in
the middle end. -Wstrict-flex-arrays will not be able to issue such
information. update the testing cases accordingly.
gcc/ChangeLog:
* attribs.cc (strict_flex_array_level_of): Move this function to ...
* attribs.h (strict_flex_array_level_of): Remove the declaration.
* gimple-array-bounds.cc (array_bounds_checker::check_array_ref):
replace the referece to strict_flex_array_level_of with
DECL_NOT_FLEXARRAY.
* tree.cc (component_ref_size): Likewise.
gcc/c/ChangeLog:
* c-decl.cc (strict_flex_array_level_of): ... here.
gcc/testsuite/ChangeLog:
* gcc.dg/Warray-bounds-flex-arrays-1.c: Delete the level information
from the message issued by -Wstrict-flex-arrays.
* gcc.dg/Warray-bounds-flex-arrays-2.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-3.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-4.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-5.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-6.c: Likewise.
* gcc.dg/Wstrict-flex-arrays-2.c: Likewise.
* gcc.dg/Wstrict-flex-arrays-3.c: Likewise.
* gcc.dg/Wstrict-flex-arrays.c: Likewise.
libstdc++-v3/ChangeLog:
* testsuite/20_util/to_chars/version.cc: Mark hosted-only.
* testsuite/20_util/uses_allocator/lwg3677.cc: Ditto.
* testsuite/20_util/weak_ptr/cons/self_move.cc: Ditto.
* testsuite/std/ranges/adaptors/as_rvalue/1.cc: Replace usage of
std::make_unique with a freestanding-compatible wrapper around
unique_ptr.
* testsuite/21_strings/basic_string_view/operations/contains/char.cc:
Don't test for presence of __cpp_lib_string_contains on !HOSTED.
* testsuite/21_strings/basic_string_view/operations/contains/char/2.cc:
Ditto.
* testsuite/std/ranges/version_c++23.cc: Don't test for presence
of __cpp_lib_ranges in !HOSTED.
Fixes the conversion from UTF-8 to UTF-16 to properly return partial
instead ok.
Fixes the conversion from UTF-16 to UTF-8 to properly return partial
instead ok.
Fixes the conversion from UTF-8 to UCS-2 to properly return partial
instead error.
Fixes the conversion from UTF-8 to UCS-2 to treat 4-byte UTF-8 sequences
as error just by seeing the leading byte.
Fixes UTF-8 decoding for all codecvts so they detect error at the end of
the input range when the last code point is also incomplete.
libstdc++-v3/ChangeLog:
PR libstdc++/86419
* src/c++11/codecvt.cc (read_utf8_code_point): Correctly detect
errors in incomplete multibyte sequences.
(utf16_in): Remove surrogates parameter. Fix conditions for
returning partial.
(utf16_out): Fix condition for returning partial.
(ucs2_in): Do not pass surrogates argument to utf16_in.
* testsuite/22_locale/codecvt/codecvt_unicode.cc: New test.
* testsuite/22_locale/codecvt/codecvt_unicode.h: New header for
tests.
* testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: New
test.
GCC 13 has a new implementation of gthr-win32.h which supports C++11
mutexes, threads etc. but this causes an unintended ABI break. The
__gthread_mutex_t type is always used in std::basic_filebuf even in
C++98, so independent of whether C++11 sync primitives work or not.
Because that type changed for the win32 thread model, we have a layout
change in std::basic_filebuf. The member is completely unused, it just
gets passed to the std::__basic_file constructor and ignored. So we
don't need that mutex to actually work, we just need its layout to not
change.
Introduce a new __gthr_win32_legacy_mutex_t struct in gthr-win32.h with
the old layout, and conditionally use that in std::basic_filebuf.
PR libstdc++/108331
libgcc/ChangeLog:
* config/i386/gthr-win32.h (__gthr_win32_legacy_mutex_t): New
struct matching the previous __gthread_mutex_t struct.
(__GTHREAD_LEGACY_MUTEX_T): Define.
libstdc++-v3/ChangeLog:
* config/io/c_io_stdio.h (__c_lock): Define as a typedef for
__GTHREAD_LEGACY_MUTEX_T if defined.
The patch to convert all thumb1 code in libgcc to unified syntax
omitted changing all swi instructions to the current name: svc.
libgcc/ChangeLog:
* config/arm/lib1funcs.S (clear_cache): Use SVC to conform to
unified syntax.
Don't add crtfastmath.o for -shared to avoid altering the FP
environment when loading a shared library.
PR target/55522
* config/arm/linux-eabi.h (ENDFILE_SPEC): Don't add
crtfastmath.o for -shared.
* config/arm/unknown-elf.h (STARTFILE_SPEC): Likewise.
The following testcase is probably latent since r13-3217-gc4d15dddf6b9e.
Adding testcase so that it doesn't silently reappear.
2023-01-13 Jakub Jelinek <jakub@redhat.com>
PR target/107131
* gcc.dg/pr107131.c: New test.
Jakub pointed out that __builtin_init_dwarf_reg_size_table
set the size of predicate registers to their current runtime
size when compiled with +sve, but to 8 bytes otherwise.
As explained in the comment, both behaviours are wrong.
Predicates change size with VL and should never need to be
restored during unwinding.
In contrast, the call-saved FP&SIMD frame registers are 8 bytes
(even though the hardware registers are at least 16 bytes) and
the call-clobbered registers have zero size. A zero size seems
correct for predicates too.
gcc/
* config/aarch64/aarch64.cc (aarch64_dwarf_frame_reg_mode): New
function.
(TARGET_DWARF_FRAME_REG_MODE): Define.
gcc/testsuite/
* gcc.target/aarch64/dwarf_reg_size_1.c: New test.
* gcc.target/aarch64/dwarf_reg_size_2.c: Likewise.
The AArch64 folders tried to update EH info on the fly, bypassing
the folder's attempts to remove dead EH edges later. This triggered
an ICE when folding a potentially-trapping call to a constant.
gcc/
PR target/107209
* config/aarch64/aarch64.cc (aarch64_gimple_fold_builtin): Don't
update EH info on the fly.
gcc/testsuite/
* gcc.target/aarch64/pr107209.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
The following fixes unexpected simplification of x << C as
x * (1<<C) to a constant.
PR tree-optimization/108387
* tree-ssa-sccvn.cc (visit_nary_op): Check for SSA_NAME
value before inserting expression into the tables.
* gcc.dg/pr108387.c: New testcase.
The following adds _FloatN mode support to the LTO copy of
c_common_type_for_mode and also implements the fix for PR94072.
gcc/lto/
* lto-lang.cc (lto_type_for_mode): Sync with
c_common_type_for_mode.
Add timeout capability to gm2-torture.exp. Also add a simple
gm2_push_timeout/gm2_pop timeout facility and calibrate all
tests to use the default of 10 seconds. 15 seconds (for the
coroutine tests) and 60 seconds for whole program optimization.
gcc/testsuite/ChangeLog:
* gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
(timeout-dg.exp): Load.
Call gm2_push_timeout 15.
Call gm2_pop_timeout at the end.
* gm2/link/min/pass/link-min-pass.exp: Set path
argument to "".
* gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp:
Call gm2_push_timeout 60.
Call gm2_pop_timeout at the end.
* lib/gm2-torture.exp (gm2_previous_timeout): Set to 10 or
individual_timeout.
Configure dejagnu to timeout for 10 seconds.
(gm2_push_timeout): New proc.
(gm2_pop_timeout): New proc.
* lib/gm2.exp (gm2_previous_timeout): Set to 10 or
individual_timeout.
Configure dejagnu to timeout for 10 seconds.
(gm2_push_timeout): New proc.
(gm2_pop_timeout): New proc.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
The new symbols need to be exported, as well as some of the
std::locale::facet::id globals, which are not new but were presumably
not needed by any inline functions before now.
libstdc++-v3/ChangeLog:
PR libstdc++/108327
* config/os/gnu-linux/ldbl-extra.ver (GLIBCXX_LDBL_3.4.31):
Export __try_use_facet specializations for facets in namespace
__gnu_cxx_ldbl128.
* config/os/gnu-linux/ldbl-ieee128-extra.ver
(GLIBCXX_IEEE128_3.4.31): Likewise for facets in namespace
__gnu_cxx_ieee128.
* testsuite/util/testsuite_abi.cc: Add to lists of known and
latest versions.
The <condition_variable>, <mutex>, and <shared_mutex> headers use
std::errc constants, but don't use std::system_error itself. They only
use the __throw_system_error(int) function, which is defined in
<bits/functexcept.h>.
By including the header for the errc constants instead of the whole of
<system_error> we avoid depending on the whole std::string definition.
libstdc++-v3/ChangeLog:
* include/bits/std_mutex.h: Remove <system_error> include.
* include/std/condition_variable: Add <bits/error_constants.h>
include.
* include/std/mutex: Likewise.
* include/std/shared_mutex: Likewise.
Committing a patch authored by: Jason Merrill <jason@redhat.com>
which enables timeouts in the gm2 regression script library gm2.exp.
gcc/testsuite/ChangeLog:
* lib/gm2.exp: Use timeout.exp.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
The gm2 minimal libraries do not have exception handler
capability. Therefore we want the front end to suppress
generation of runtime exception code.
gcc/testsuite/ChangeLog:
* lib/gm2.exp (gm2_init_min): Append -fno-exceptions
to args.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
This patch is an update/tweak of Andrew Pinski's two patches for
PR tree-optimization/92342, that were originally posted by in November:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585111.htmlhttps://gcc.gnu.org/pipermail/gcc-patches/2021-November/585112.html
Technically, the first of those was approved by Richard Biener, though
never committed, and my first thought was to simply push it for Andrew,
but the review of the second piece expressed concerns over comparisons
in non-integral modes, where the result may not be zero-one valued.
Indeed both transformations misbehave in the presence of vector mode
comparisons (these transformations are already implemented for
vec_cond elsewhere in match.pd), so my minor contribution is to limit
these new transformations to scalars, by testing that both the operands
and results are INTEGRAL_TYPE_P.
2023-01-12 Andrew Pinski <apinski@marvell.com>
Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog:
PR tree-optimization/92342
* match.pd ((m1 CMP m2) * d -> (m1 CMP m2) ? d : 0):
Use tcc_comparison and :c for the multiply.
(b & -(a CMP c) -> (a CMP c)?b:0): New pattern.
gcc/testsuite/ChangeLog:
PR tree-optimization/92342
* gcc.dg/tree-ssa/andnegcmp-1.c: New test.
* gcc.dg/tree-ssa/andnegcmp-2.c: New test.
* gcc.dg/tree-ssa/multcmp-1.c: New test.
* gcc.dg/tree-ssa/multcmp-2.c: New test.