- Mar 22, 2023
-
-
Jonathan Wakely authored
We actually defined this macro in <utility> at one point, but I removed it in r10-7901-g2025db692e9ed1. libstdc++-v3/ChangeLog: * include/std/utility (__cpp_lib_constexpr_algorithms): Define, as per LWG 3792. * testsuite/20_util/exchange/constexpr.cc: Check for it.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * include/std/version (__cpp_lib_format): Define. * testsuite/std/format/functions/format.cc: Check it.
-
Jonathan Wakely authored
Previously the C++23 draft required that the callback arguments were lvalues, which was overvable by the callback. LWG 3645 removes that overspecification, so we can pass rvalues and the user can't modify our local variables. I've used auto(p) to produce rvalues, which is only supported since Clang 15, but I think that's OK for a C++23 feature. While making this change I noticed that we weren't correctly enforcing the requirement that the callback returns an integer-like type. Add better assertions for the type and value. libstdc++-v3/ChangeLog: * include/bits/basic_string.tcc (basic_string::resize_and_overwrite): Pass rvalues to the callback, as now allowed by LWG 3645. Enforce preconditions on the return value. * testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc: Adjust.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * include/std/format: Add a comment noting that the resolution of LWG 3720 has been applied..
-
Jonathan Wakely authored
This was approved in Issaquah last month. libstdc++-v3/ChangeLog: * include/bits/regex.h (match_results): Add allocator-extended copy and move constructors, as per LWG 2195. * testsuite/28_regex/match_results/ctors/char/alloc.cc: New test.
-
Jonathan Wakely authored
As explained in LWG 3600, we never implemented a C++0x change that made the copy constructor of std::istream_iterator defined as defaulted. That would be an ABI break, so the resolution of LWG 3600 is to not require it to be trivial, but just constexpr and conditionally noexcept. This applies that resolution. libstdc++-v3/ChangeLog: * include/bits/stream_iterator.h (istream_iterator): Add constexpr to copy constructor, as per LWG 3600. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: Check copy construction.
-
Vladimir N. Makarov authored
LRA was trying to do live range splitting again and again as there were no enough regs for asm. This patch solves the problem. PR target/109137 gcc/ChangeLog: * lra.cc (lra): Do not repeat inheritance and live range splitting when asm error is found. gcc/testsuite/ChangeLog: * gcc.target/i386/pr109137.c: New.
-
Gaius Mulley authored
The driver should default to include the current working directory in the module search path. This patch adds . to the search path provided -fm2-pathname has not been specified. The patch also reorders the pim libraries so that the m2cor directory is searched before m2pim. Coroutine support is visible by default for both -fpim and -fiso (from their respective SYSTEM modules). gcc/m2/ChangeLog: PR modula2/109248 * Make-lang.in (m2/pge-boot/%.o): Add CFLAGS and CXXFLAGS for C and C++ compiles. * gm2spec.cc (add_m2_I_path): Indentation. (lang_specific_driver): New variable seen_pathname. Detect -fm2-pathname. If not seen then push_back_Ipath ("."). Change non iso library path to "m2cor,m2log,m2pim,m2iso". Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
Jason Merrill authored
Since r7-2549 we were throwing away the explicit C:: when we found that ~C has an attribute that we treat as making its type dependent. PR c++/108795 gcc/cp/ChangeLog: * semantics.cc (finish_id_expression_1): Check scope before returning id_expression. gcc/testsuite/ChangeLog: * g++.dg/ext/attr-tsafe1.C: New test.
-
Alex Coplan authored
As the PR shows, we currently emit duplicate diagnostics for calls to functions marked with __attribute__((unavailable)). This patch fixes that. gcc/cp/ChangeLog: PR c++/109177 * call.cc (build_over_call): Use make_temp_override to suppress both unavailable and deprecated warnings when calling build_addr_func. gcc/testsuite/ChangeLog: PR c++/109177 * g++.dg/ext/pr109177.C: New test.
-
David Malcolm authored
The patch has this effect on my integration tests of -fanalyzer: Comparison: GOOD: 129 (17.70% -> 17.92%) BAD: 600 -> 591 (-9) which is purely due to improvements to -Wanalyzer-deref-before-check on the Linux kernel: -Wanalyzer-deref-before-check: GOOD: 1 (4.55% -> 7.69%) BAD: 21 -> 12 (-9) Known false positives: 16 -> 10 (-6) linux-5.10.162: 7 -> 1 (-6) Suspected false positives: 3 -> 0 (-3) linux-5.10.162: 3 -> 0 (-3) gcc/analyzer/ChangeLog: PR analyzer/109239 * program-point.cc: Include "analyzer/inlining-iterator.h". (program_point::effectively_intraprocedural_p): New function. * program-point.h (program_point::effectively_intraprocedural_p): New decl. * sm-malloc.cc (deref_before_check::emit): Use it when rejecting interprocedural cases, so that we reject interprocedural cases that have become intraprocedural due to inlining. gcc/testsuite/ChangeLog: PR analyzer/109239 * gcc.dg/analyzer/deref-before-check-pr109239-linux-bus.c: New test. Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
-
Andrew Jenner authored
gcc/ChangeLog: * config/gcn/gcn-protos.h (gcn_expand_dpp_swap_pairs_insn) (gcn_expand_dpp_distribute_even_insn) (gcn_expand_dpp_distribute_odd_insn): Declare. * config/gcn/gcn-valu.md (@dpp_swap_pairs<mode>) (@dpp_distribute_even<mode>, @dpp_distribute_odd<mode>) (cmul<conj_op><mode>3, cml<addsub_as><mode>4, vec_addsub<mode>3) (cadd<rot><mode>3, vec_fmaddsub<mode>4, vec_fmsubadd<mode>4) (fms<mode>4<exec>, fms<mode>4_negop2<exec>, fms<mode>4) (fms<mode>4_negop2): New patterns. * config/gcn/gcn.cc (gcn_expand_dpp_swap_pairs_insn) (gcn_expand_dpp_distribute_even_insn) (gcn_expand_dpp_distribute_odd_insn): New functions. * config/gcn/gcn.md: Add entries to unspec enum. gcc/testsuite/ChangeLog: * gcc.target/gcn/complex.c: New test.
-
Tobias Burnus authored
ChangeLog: * MAINTAINERS: Add myself as OpenMP and libgomp maintainer.
-
Aldy Hernandez authored
This patch implements a nan_state class, that allows us to query or pass around the NANness of an frange. We can store +NAN, -NAN, +-NAN, or not-a-NAN with it. I tried to touch as little as possible, leaving other cleanups to the next release. For example, we should replace the m_*_nan fields in frange with nan_state, and provide relevant accessors to nan_state (isnan, etc). PR tree-optimization/109008 gcc/ChangeLog: * value-range.cc (frange::set): Add nan_state argument. * value-range.h (class nan_state): New. (frange::get_nan_state): New.
-
Martin Liska authored
gcc/ChangeLog: * configure: Regenerate.
-
Gaius Mulley authored
Remove M2LINK.def. Pass the user forced module initialization string as a parameter to M2RTS.ConstructModules. This patch allows -fm2-whole-program to link successfully using dynamic libraries. gcc/m2/ChangeLog: PR modula2/107630 * Make-lang.in (m2/stage2/cc1gm2$(exeext)): Remove m2/gm2-libs-boot/M2LINK.o. (m2/stage1/cc1gm2$(exeext)): Ditto. (GM2-LIBS-BOOT-DEFS): Remove M2LINK.def. (GM2-LIBS-DEFS): Ditto. (m2/mc-boot/$(SRC_PREFIX)%.o): Replace CXX_FLAGS with CXXFLAGS. (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto. (m2/mc-boot/main.o): Ditto. (mcflex.o): Add $(CFLAGS). (m2/gm2-libs-boot/M2LINK.o): Remove rule. * gm2-compiler/M2GCCDeclare.def (DeclareM2linkGlobals): Remove. * gm2-compiler/M2GCCDeclare.mod: (M2LinkEntry): Remove. (M2LinkIndex): Remove. (DoVariableDeclaration): Remove initial and call to AddEntryM2Link. (AddEntryM2Link): Remove. (GetEntryM2Link): Remove. (DeclareM2linkGlobals): Remove. (DetectM2LinkInitial): Remove. (InitM2LinkModule): Remove. * gm2-compiler/M2GenGCC.mod (CodeFinallyEnd): Remove call to DeclareM2linkGlobals. * gm2-compiler/M2Quads.mod (BuildM2InitFunction): Add extra parameter containing runtime module override to ConstructModules. * gm2-compiler/M2Scaffold.mod: Update comment describing ConstructModules. * gm2-gcc/m2decl.cc (m2decl_DeclareM2linkForcedModuleInitOrder): Remove. * gm2-libs-iso/M2RTS.def (ConstructModules): Add overrideliborder parameter. * gm2-libs-iso/M2RTS.mod: Add overrideliborder parameter. * gm2-libs/M2Dependent.def (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2Dependent.mod (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2RTS.def (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2RTS.mod (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2LINK.def: Removed. libgm2/ChangeLog: * libm2pim/Makefile.am (M2DEFS): Remove M2LINK.def. * libm2pim/Makefile.in: Rebuild. Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
GCC Administrator authored
-
- Mar 21, 2023
-
-
Joseph Myers authored
I've observed an LTO wrong-code bug with a large testcase in GCC 12, that results from TYPE_TYPELESS_STORAGE not being set consistently on type variants. Specifically, in the LTO stage of compilation, there is an aggregate type passed to get_alias_set, whose TYPE_MAIN_VARIANT does not have TYPE_TYPELESS_STORAGE set. However, the TYPE_CANONICAL of that main variant *does* have have TYPE_TYPELESS_STORAGE set; note that the use of TYPE_CANONICAL in get_alias_set comes after the check of TYPE_TYPELESS_STORAGE. The effect is that when (one-argument) record_component_aliases is called, the recursive call to get_alias_set gives alias set 0, and the aggregate type ends up not being considered to alias its members, with wrong-code consequences. I haven't managed to produce a self-contained executable testcase to demonstrate this, but it clearly seems appropriate for TYPE_TYPELESS_STORAGE to be consistent on type variants, so this patch makes it so, which appears to be sufficient to resolve the bug. I've attached a reduced test to <https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614278.html> that does at least demonstrate main-variant versions of a type (SB in this test) being written out to LTO IR both with and without TYPE_TYPELESS_STORAGE, although not the subsequent consequences of a type without TYPE_TYPELESS_STORAGE with a TYPE_CANONICAL (as constructed after LTO type merging) with TYPE_TYPELESS_STORAGE and following wrong-code. Bootstrapped with no regressions for x86_64-pc-linux-gnu. * stor-layout.cc (finalize_type_size): Copy TYPE_TYPELESS_STORAGE to variants.
-
Matthias Kretz authored
Signed-off-by:
Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0 with __RECIPROCAL_MATH__.
-
Matthias Kretz authored
Clang ICEs on _SimdImplX86::_S_divides. The function is only working around a missed optimization and not necessary for correctness. Therefore, don't use it for Clang. Signed-off-by:
Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * include/experimental/bits/simd_detail.h: Don't define _GLIBCXX_SIMD_WORKAROUND_PR90993 for Clang. * include/experimental/bits/simd_x86.h (_S_divides): Remove check for __clang__.
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/99036 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a generic module interface. gcc/testsuite/ChangeLog: PR fortran/99036 * gfortran.dg/pr99036.f90: New test.
-
Matthias Kretz authored
Clang fails to compile some constant expressions involving simd. Therefore, just disable this non-conforming extension for clang. Fix AVX512 blend implementation for Clang. It was converting the bitmask to bool before, which is obviously wrong. Instead use a Clang builtin to convert the bitmask to vector-mask before using a vector blend ?:. A similar change is required for the masked unary implementation, because the GCC builtins do not exist on Clang. Signed-off-by:
Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * include/experimental/bits/simd_detail.h: Don't declare the simd API as constexpr with Clang. * include/experimental/bits/simd_x86.h (__movm): New. (_S_blend_avx512): Resolve FIXME. Implement blend using __movm and ?:. (_SimdImplX86::_S_masked_unary): Clang does not implement the same builtins. Implement the function using __movm, ?:, and - operators on vector_size types instead.
-
Jason Merrill authored
When parsing a default member init we just build a CONVERT_EXPR for converting to a virtual base, and then expand that into the more complex form when we actually use the DMI in a constructor. But that wasn't working for the template case where we are considering the conversion at the point that the constructor needs the DMI instantiation, so it seemed like we were in a constructor already. And then when the other constructor tries to reuse the instantiation, it sees uses of the first constructor's parameters, and dies. So ensure that we get the CONVERT_EXPR in this case, too. PR c++/106890 gcc/cp/ChangeLog: * init.cc (maybe_instantiate_nsdmi_init): Don't leave current_function_decl set to a constructor. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template25.C: New test.
-
Andrew MacLeod authored
We currently allow VARYING lhs GORI calculations to continue if there is a relation present in the hope it will eventually better refine a result. This adds a check that the relation is relevant to the outgoing range calculation first. If it is not relevant, stop calculating. PR tree-optimization/109192 * gimple-range-gori.cc (gori_compute::compute_operand_range): Terminate gori calculations if a relation is not relevant. * value-relation.h (value_relation::set_relation): Allow equality between op1 and op2 if they are the same.
-
Richard Biener authored
The following avoids looking at STMT_SLP_TYPE apart from the only place needing it - transform and analysis of non-SLP loop stmts. In particular it doesn't have a reliable meaning on SLP representatives which are also passed as stmt_vinfo to vectorizable_* routines. The proper way to check in those is to look for the slp_node argument instead. PR tree-optimization/109219 * tree-vect-loop.cc (vectorizable_reduction): Check slp_node, not STMT_SLP_TYPE. * tree-vect-stmts.cc (vectorizable_condition): Likewise. * tree-vect-slp.cc (vect_slp_analyze_node_operations_1): Remove assertion on STMT_SLP_TYPE. * gcc.dg/torture/pr109219.c: New testcase.
-
Jakub Jelinek authored
On Tue, Mar 21, 2023 at 12:35:19PM +0000, Andrew Stubbs wrote: > > /* Ensure the the in-branch simd clones are used on targets that support them. > > Some targets use another call for the epilogue loops. */ > > -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! aarch64*-*-* } } } } */ > > -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target aarch64*-*-* } } } */ > > +/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" } } */ > > I suppose those comments are now obsolete. Oops, fixed thusly. 2023-03-21 Jakub Jelinek <jakub@redhat.com> PR testsuite/108898 * gcc.dg/vect/vect-simd-clone-16.c: Remove parts of comment mentioning epilogue loops. * gcc.dg/vect/vect-simd-clone-17.c: Likewise. * gcc.dg/vect/vect-simd-clone-18.c: Likewise.
-
Jakub Jelinek authored
As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake, there are 3 matches for the calls rather than expected two. As suggested by Richi, this patch changes those tests to use --param vect-epilogues-nomask=0 such that it is more predictable on how many calls will show up. In the non-[a-f] suffixed tests, the scan-tree-dump-times patterns were expecting 2 for non-aarch64 and 3 for aarch64, which is a puzzle for me, because vect_simd_clones effective target is apparently never true on aarch64 (just on x86 in some cases and on amdgcn; perhaps something to change for GCC14, but I guess too late for stage4). That said, I have looked at aarch64 dumps and see only 2 calls with --param vect-epilogues-nomask=0 and 3 with --param vect-epilogues-nomask=1 or without it, so I have tweaked those to always expect the same thing. Another thing is some tests uselessly had -fdump-tree-optimized in dg-options even when they don't scan anything there. Tested on x86_64-linux with make -j32 -k check-gcc RUNTESTFLAGS="vect.exp=gcc.dg/vect/vect-simd-clone-*.c \ --target_board='unix{-m64/-march=x86-64,-m64/-march=cascadelake,-m32/-march=i686,-m32/-march=cascadelake}'" and aarch64-linux (where all tests are UNSUPPORTED before/after). 2023-03-21 Jakub Jelinek <jakub@redhat.com> PR testsuite/108898 * gcc.dg/vect/vect-simd-clone-16.c: Add --param vect-epilogues-nomask=0 to dg-additional-options. Always expect just 2 foo.simdclone calls. * gcc.dg/vect/vect-simd-clone-16f.c: Add --param vect-epilogues-nomask=0 to dg-additional-options. * gcc.dg/vect/vect-simd-clone-17.c: Likewise. Always expect just 2 foo.simdclone calls. * gcc.dg/vect/vect-simd-clone-17d.c: Remove -fdump-tree-optimized from dg-additional-options. * gcc.dg/vect/vect-simd-clone-17e.c: Likewise. * gcc.dg/vect/vect-simd-clone-17f.c: Likewise. Add --param vect-epilogues-nomask=0 to dg-additional-options. * gcc.dg/vect/vect-simd-clone-18.c: Add --param vect-epilogues-nomask=0 to dg-additional-options. Always expect just 2 foo.simdclone calls. * gcc.dg/vect/vect-simd-clone-18f.c: Add --param vect-epilogues-nomask=0 to dg-additional-options.
-
Matthias Kretz authored
Signed-off-by:
Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/operators.cc: Clang doesn't define __GCC_IEC_559. Use __STDC_IEC_559__ instead.
-
Jakub Jelinek authored
Our documentation sadly talks about elt_type arr[0]; as zero-length arrays, not arrays with zero elements. Unfortunately, those aren't the only arrays which can have zero size, the same size can be also result of zero-length element, like in GNU C struct whatever {} or in GNU C/C++ if the element type is [0] array or combination thereof (dunno if Ada doesn't allow something similar too). One can't do much with them, taking address of their elements, (no-op) copying of the elements in and out. But they behave differently from arr[0] arrays e.g. in that using non-zero indexes in them (as long as they are within bounds as for normal arrays) is valid. I think this naming inaccuracy resulted in Martin designing special_array_member in an inconsistent way, mixing size zero array members with array members of one or two or more elements and then using the size zero interchangeably with zero elements. The following patch changes that (but doesn't do any documentation/diagnostics renaming, as this is really a corner case), such that int_0/trail_0 for consistency is just about [0] arrays plus [] for the latter, not one or more zero sized elements case. The testcase has one xfailed case for where perhaps in later GCC versions we could add extra code to handle it, for some reason we don't diagnose out of bounds accesses for the zero sized elements cases. It will be harder because e.g. FRE will canonicalize &var.fld[0] and &var.fld[10] to just one of them because they are provably the same address. But the important thing is to fix this regression (where we warn on completely valid code in the Linux kernel). Anyway, for further work on this we don't really need any extra help from special_array_member, all code can just check integer_zerop (TYPE_SIZE_UNIT (TREE_TYPE (type))), it doesn't depend on the position of the members etc. 2023-03-21 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/109215 * tree.h (enum special_array_member): Adjust comments for int_0 and trail_0. * tree.cc (component_ref_sam_type): Clear zero_elts if memtype has zero sized element type and the array has variable number of elements or constant one or more elements. (component_ref_size): Adjust comments, formatting fix. * gcc.dg/Wzero-length-array-bounds-3.c: New test.
-
Arsen Arsenović authored
This flag allows us to restore old (pre-6.8) behavior of the @{summary,}content commands, so that texi2any continues to emit summarycontents first. maintainer-scripts/ChangeLog: * update_web_docs_git: Set CONTENTS_OUTPUT_LOCATION=inline in order to put @shortcontents above contents. gcc/ChangeLog: * configure.ac: Add check for the Texinfo 6.8 CONTENTS_OUTPUT_LOCATION customization variable and set it if supported. * configure: Regenerate. * Makefile.in (MAKEINFO_TOC_INLINE_FLAG): New variable. Set by configure.ac to -c CONTENTS_OUTPUT_LOCATION=inline if CONTENTS_OUTPUT_LOCATION support is detected, empty otherwise. ($(build_htmldir)/%/index.html): Pass MAKEINFO_TOC_INLINE_FLAG.
-
Arsen Arsenović authored
This commit fixes up an instance of the index entry mis-ordering that occurred between the formulation and application of commit r13-6310-gf33d7a88d069d1. gcc/ChangeLog: * doc/extend.texi: Associate use_hazard_barrier_return index entry with its attribute. * doc/invoke.texi: Associate -fcanon-prefix-map index entry with its attribute
-
Arsen Arsenović authored
maintainer-scripts/ChangeLog: * update_web_docs_git (CSS): Update CSS reference to point to /texinfo-manuals.css.
-
Arsen Arsenović authored
The @gol macro appears to have existed as a workaround for a bug in old versions of makeinfo and/or texinfo.tex, where they would, in some types of output, fail to emit line breaks in @gccoptlists. After updating texinfo.tex, I noticed that this behavior appears to no longer be exhibited, instead, both acted correctly and inserted newlines. The (groff) manual output also appears unaffected. gcc/ChangeLog: * doc/implement-c.texi: Remove usage of @gol. * doc/invoke.texi: Ditto. * doc/sourcebuild.texi: Ditto. * doc/include/gcc-common.texi: Remove @gol. In new Makeinfo and texinfo.tex versions, the bug it was working around appears to be gone. gcc/fortran/ChangeLog: * invoke.texi: Remove usages of @gol. * intrinsic.texi: Ditto.
-
Arsen Arsenović authored
gcc/ChangeLog: * doc/include/texinfo.tex: Update to 2023-01-17.19.
-
Arsen Arsenović authored
The @defbuiltin{,x} macros are convenience macros for the often-repeated task of defining a built-in function in extend.texi. Usage of this macro should lead to a higher degree of consistency across pieces of text written by different people, and provide a better reading experience, as they prevent easy-to-make errors, like forgetting index entries for these functions. gcc/ChangeLog: * doc/include/gcc-common.texi: Add @defbuiltin{,x} and @enddefbuiltin for defining built-in functions. * doc/extend.texi: Apply @defbuiltin{,x} to many, but not all, places where it should be used.
-
Arsen Arsenović authored
This commit addresses a few minor errors that were spotted while testing the GCC manual with a few people, and while working on wider changes. gcc/ChangeLog: * doc/extend.texi (Formatted Output Function Checking): New subsection for grouping together printf et al. (Exception handling) Fix missing @ sign before copyright header, which lead to the copyright line leaking into '(gcc)Exception handling'. * doc/gcc.texi: Set document language to en_US. (@copying): Wrap front cover texts in quotations, move in manual description text.
-
Arsen Arsenović authored
The GCC manual has multiple indices. By creating an appendix which lists them, we help makeinfo present a more accessible way for the reader to see all the indices. gcc/ChangeLog: * doc/gcc.texi: Add the Indices appendix, to make texinfo generate nice indices overview page.
-
Richard Biener authored
The following adds a missing range-op for __builtin_expect which helps -Wuse-after-free to detect the case a realloc original pointer is used when the result was NULL. The implementation should handle all argument one pass-through builtins we handle in the fnspec machinery, but that's defered to GCC 14. The gcc.dg/tree-ssa/ssa-lim-21.c testcase needs adjustment because for (int j = 0; j < m; j++) if (__builtin_expect (m, 0)) for (int i = 0; i < m; i++) is now correctly optimized to a unconditional jump by EVRP - m cannot be zero when the outer loop is entered. I've adjusted the outer loop to iterate 'n' times which makes us apply store-motion to 'count' and 'q->data1' but only out of the inner loop and as expected not apply store motion to 'q->data' at all. The gcc.dg/predict-20.c testcase relies on broken behavior of profile estimation when trying to handle __builtin_expect values flowing into PHI nodes. I have opened PR109210 and removed the expected matching from the testcase. PR tree-optimization/109170 * gimple-range-op.cc (cfn_pass_through_arg1): New. (gimple_range_op_handler::maybe_builtin_call): Handle __builtin_expect via cfn_pass_through_arg1. * gcc.dg/Wuse-after-free-pr109170.c: New testcase. * gcc.dg/tree-ssa/ssa-lim-21.c: Adjust. * gcc.dg/predict-20.c: Likewise.
-
Paul Thomas authored
2023-03-21 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/109206 * trans-array.cc (gfc_trans_array_constructor_value): Correct incorrect setting of typespec.
-
Paul Thomas authored
2023-03-21 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/109209 * resolve.cc (generate_component_assignments): Restore the exclusion of allocatable components from the loop. gcc/testsuite/ PR fortran/109209 * gfortran.dg/pr109209.f90: New test.
-