aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-28libstdc++: Fix noexcept on dtors in <experimental/scope> [PR114152]Jonathan Wakely2-3/+27
The PR points out that the destructors all have incorrect noexcept-specifiers. libstdc++-v3/ChangeLog: PR libstdc++/114152 * include/experimental/scope (scope_exit scope_fail): Make destructor unconditionally noexcept. (scope_sucess): Fix noexcept-specifier. * testsuite/experimental/scopeguard/114152.cc: New test.
2024-02-28libstdc++: Change some URLs in the manual to use httpsJonathan Wakely3-12/+12
libstdc++-v3/ChangeLog: * doc/xml/manual/appendix_contributing.xml: Change URLs to use https. * doc/html/manual/*: Regenerate.
2024-02-28libstdc++: Update outdated docs on contributingJonathan Wakely2-14/+18
We don't want a separate ChangeLog submission now. libstdc++-v3/ChangeLog: * doc/xml/manual/appendix_contributing.xml: Replace outdated info on ChangeLog entries. * doc/html/manual/appendix_contributing.html: Regenerate.
2024-02-28tree-optimization/113831 - revert original fixRichard Biener2-135/+1
This reverts the original fix for PR113831 which is better fixed by the PR114121 fix. I've XFAILed instead of removing the PR108355 testcase again. PR tree-optimization/113831 PR tree-optimization/108355 * tree-ssa-sccvn.cc (copy_reference_ops_from_ref): Revert PR113831 fix. * gcc.dg/tree-ssa/ssa-fre-104.c: XFAIL.
2024-02-28tree-optimization/114121 - wrong VN with context sensitive range infoRichard Biener4-7/+91
When VN ends up exploiting range-info specifying the ao_ref offset and max_size we have to make sure to reflect this in the hashtable entry for the recorded expression. The PR113831 fix handled the case where we can encode this in the operands themselves but this bug shows the issue is more widespread. So instead of altering the operands the following instead records this extra info that's possibly used, only throwing it away when the value-numbering didn't come up with a non-VARYING value which is an important detail to preserve CSE as opposed to constant folding which is where all cases currently known popped up. With this the original PR113831 fix can be reverted. PR tree-optimization/114121 * tree-ssa-sccvn.h (vn_reference_s::offset, vn_reference_s::max_size): New fields. (vn_reference_insert_pieces): Adjust prototype. * tree-ssa-pre.cc (phi_translate_1): Preserve offset/max_size. * tree-ssa-sccvn.cc (vn_reference_eq): Compare offset and size, allow using "don't know" state. (vn_walk_cb_data::finish): Pass along offset/max_size. (vn_reference_lookup_or_insert_for_pieces): Take offset and max_size as argument and use it. (vn_reference_lookup_3): Properly adjust offset and max_size according to the adjusted ao_ref. (vn_reference_lookup_pieces): Initialize offset and max_size. (vn_reference_lookup): Likewise. (vn_reference_lookup_call): Likewise. (vn_reference_insert): Likewise. (visit_reference_op_call): Likewise. (vn_reference_insert_pieces): Take offset and max_size as argument and use it. * gcc.dg/torture/pr114121.c: New testcase.
2024-02-28libstdc++: Add more nodiscard uses in <vector>Jonathan Wakely4-12/+171
Add [[nodiscard]] to vector::at and to comparison operators. libstdc++-v3/ChangeLog: * include/bits/stl_bvector.h (vector<bool, A>::at): Add nodiscard. * include/bits/stl_vector.h (vector<T, A>::at): Likewise. (operator==, operator<=>, operator<, operator!=, operator>) (operator<=, operator>=): Likewise. * include/debug/vector (operator==, operator<=>, operator<) (operator!=, operator>, operator<=, operator>=): Likewise. * testsuite/23_containers/vector/nodiscard.cc: New test.
2024-02-28libstdc++: Consistently use noexcept, constexpr, nodiscard on bitmask opsJonathan Wakely11-58/+194
The bitwise operators for combining bitmask types such as std::launch are not consistently annotated with noexcept, constexpr, and nodiscard. This is the subject of LWG 3977, although the proposed resolution doesn't work. We can make the changes in libstdc++ anyway though. libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (operator|, operator&): Add noexcept. * include/bits/fs_fwd.h (operator&, operator|, operator^) (operator~): Add nodiscard to overloads for copy_options, perms, perm_options, and directory_options. * include/bits/ios_base.h (operator&, operator|, operator^) (operator~): Add nodiscard and noexcept to overloads for _Ios_Fmtflags, _Ios_Openmode, and _Ios_Iostate. (operator|=, operator&=, operator^=): Add constexpr for C++14. * include/bits/regex_constants.h (operator&, operator|, operator^) (operator~): Add nodiscard and noexcept to overloads for syntax_option_type and match_flag_type. (operator|=, operator&=, operator^=): Add noexcept. * include/std/charconv (operator&, operator|, operator^) (operator~): Add nodiscard to overloads for chars_format. * include/std/future (operator&, operator|, operator^) (operator~): Add nodiscard for overloads for launch. (operator&=, operator|=, operator^=): Add constexpr for C++14. * include/experimental/bits/fs_fwd.h (operator&, operator|) (operator^, operator~): Add nodiscard to overloads for copy_options, perms, and directory_options. * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: Add dg-warning for nodiscard warnings. * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: Likewise. * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: Likewise. * testsuite/27_io/filesystem/operations/bitmask_types.cc: New test.
2024-02-28libstdc++: Test error handling in std::printJonathan Wakely2-0/+51
The standard requires an exception if std::print fails to write to a FILE*. When writing to a std::ostream, failure to format the arguments doesn't affect the stream state, but failure to write to the streadm sets badbit. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_ostream/print/1.cc: Check error handling. * testsuite/27_io/print/1.cc: Likewise.
2024-02-28libstdc++: Fix std::print for CygwinJonathan Wakely4-5/+5
Cygwin should use std::fwrite, not WriteConsoleW. And the -lstdc++exp library is only needed when running the tests on *-*-mingw*. libstdc++-v3/ChangeLog: * include/std/ostream (vprint_unicode) [__CYGWIN__]: Use POSIX code path for Cygwin instead of Windows. * include/std/print (vprint_unicode) [__CYGWIN__]: Likewise. * testsuite/27_io/basic_ostream/print/1.cc: Only add -lstdc++exp for *-*-mingw* targets. * testsuite/27_io/print/1.cc: Likewise.
2024-02-28libstdc++: Include <bits/stl_iterator.h> in <bits/alloc_traits.h>Jonathan Wakely1-0/+3
libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h: Include <bits/stl_iterator.h> for __make_move_if_noexcept_iterator.
2024-02-28libstdc++: Add more [[nodiscard]] to <stacktrace>Jonathan Wakely1-5/+31
libstdc++-v3/ChangeLog: * include/std/stacktrace: Add nodiscard attribute to all functions without side effects.
2024-02-28testsuite: XFAIL ssa-sink-18.c also on powerpc64 [PR111462]Jakub Jelinek1-2/+2
powerpc64-linux apparently (not very surprisingly) behaves the same way as powerpc64le-linux and has 4 sunk statements rather than 5, so we should xfail it on powerpc64*-*-* rather than just powerpc64le-*-*. powerpc-linux has 3 sunk statements, but the scan pattern is done for lp64 only as the comment explains. 2024-02-28 Jakub Jelinek <jakub@redhat.com> PR testsuite/111462 * gcc.dg/tree-ssa/ssa-sink-18.c: XFAIL also on powerpc64.
2024-02-28testsuite: Fix gcc.dg/tree-ssa/builtin-snprintf-6.c XPASS on i?86 -m64 [PR91567]Rainer Orth1-1/+1
gcc.dg/tree-ssa/builtin-snprintf-6.c currently XPASSes on i?86-*-* configurations with -m64: XPASS: gcc.dg/tree-ssa/builtin-snprintf-6.c scan-tree-dump-times optimized "Function test_assign_aggregate" 1 (seen e.g. on i386-pc-solaris2.11, i686-pc-linux-gnu, or i386-apple-darwin*). The problem is that the xfail only handles x86_64, ignoring that i?86 configurations can also be multilibbed. This patch fixes the by handling both forms alike. Tested on i386-pc-solaris2.11, amd64-pc-solaris2.11, sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11. 2024-02-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/testsuite: PR tree-optimization/91567 * gcc.dg/tree-ssa/builtin-snprintf-6.c (scan-tree-dump-times): Treat i?86-*-* like x86_64-*-*.
2024-02-28testsuite: Add testcase for recently fixed PR [PR114075]Jakub Jelinek1-0/+31
This adds testcase from PR114075 which has been fixed by the r14-9205 change on s390x-linux with -march=z13. 2024-02-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/114075 * gcc.dg/gomp/pr114075.c: New test.
2024-02-28Only emulate integral vectors.Juergen Christ1-1/+2
The emulation via word mode tries to perform integer arithmetic on floating point values instead of floating point arithmetic. This leads to mis-compilations. Failure occured on s390x on these existing test cases: gcc.dg/vect/tsvc/vect-tsvc-s112.c gcc.dg/vect/tsvc/vect-tsvc-s113.c gcc.dg/vect/tsvc/vect-tsvc-s119.c gcc.dg/vect/tsvc/vect-tsvc-s121.c gcc.dg/vect/tsvc/vect-tsvc-s131.c gcc.dg/vect/tsvc/vect-tsvc-s132.c gcc.dg/vect/tsvc/vect-tsvc-s2233.c gcc.dg/vect/tsvc/vect-tsvc-s421.c gcc.dg/vect/vect-alias-check-14.c gcc.target/s390/vector/partial/s390-vec-length-epil-run-1.c gcc.target/s390/vector/partial/s390-vec-length-epil-run-3.c gcc.target/s390/vector/partial/s390-vec-length-full-run-3.c gcc/ChangeLog: PR tree-optimization/114075 * tree-vect-stmts.cc (vectorizable_operation): Don't emulate floating point vectors Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2024-02-28graphite: Fix non-INTEGER_TYPE integral comparison handling [PR114041]Jakub Jelinek3-2/+53
The following testcases are miscompiled, because graphite ignores boolean, enumerated or _BitInt comparisons, rewrites the code as if the comparisons were always true or always false. The INTEGER_TYPE checks were initially added in r6-2239 but at that point it was both in add_conditions_to_domain and in parameter_index_in_region. Later on the check was also added to stmt_simple_for_scop_p, and finally r8-3931 changed the stmt_simple_for_scop_p check to INTEGRAL_TYPE_P and turned the parameter_index_in_region -> assign_parameter_index_in_region into INTEGRAL_TYPE_P assertion, but the add_conditions_to_domain check for INTEGER_TYPE remained. The following patch uses INTEGRAL_TYPE_P to complete the change. 2024-02-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/114041 * graphite-sese-to-poly.cc (add_conditions_to_domain): Check for INTEGRAL_TYPE_P check rather than INTEGER_TYPE. * gcc.dg/graphite/run-id-pr114041-1.c: New test. * gcc.dg/graphite/run-id-pr114041-2.c: New test.
2024-02-28gimple-fold: Use bitwise vector types rather than barely supported huge ↵Jakub Jelinek4-4/+73
integral types in memcpy etc. folding [PR113988] The following patch changes the memcpy etc. folding to use bitwise vector types rather than huge INTEGER_TYPEs for copying of > MAX_FIXED_MODE_SIZE lengths. The problem with the huge INTEGER_TYPEs is that they aren't supported very much, usually there are just optabs to handle moves of them, perhaps misaligned moves and that is it, so they pose problems e.g. to BITINT_TYPE lowering. 2024-02-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/113988 * stor-layout.h (bitwise_mode_for_size): Declare. * stor-layout.cc (bitwise_mode_for_size): New function. * gimple-fold.cc (gimple_fold_builtin_memory_op): Use it. Use bitwise_type_for_mode instead of build_nonstandard_integer_type. Use BITS_PER_UNIT instead of 8. * gcc.dg/bitint-91.c: New test.
2024-02-28testsuite: Add c23-stdarg-4.c test variant where all functions return large ↵Jakub Jelinek1-0/+217
struct I think we have no coverage for the case where structure_value_addr_parm and TYPE_NO_NAMED_ARGS_STDARG_P are both true. The if (type_arg_types != 0) n_named_args = (list_length (type_arg_types) /* Count the struct value address, if it is passed as a parm. */ + structure_value_addr_parm); else if (TYPE_NO_NAMED_ARGS_STDARG_P (funtype)) n_named_args = 0; else /* If we know nothing, treat all args as named. */ n_named_args = num_actuals; code should probably have n_named_args = structure_value_addr_parm; instead of n_named_args = 0;, this testcase is an attempt to see if it is broken on any target. 2024-02-28 Jakub Jelinek <jakub@redhat.com> * gcc.dg/c23-stdarg-6.c: New test.
2024-02-28c++: Revert deferring emission of inline variables [PR114013]Nathaniel Shead2-4/+33
This is a (partial) reversion of r14-8987-gdd9d14f7d53 to return to eagerly emitting inline variables to the middle-end when they are declared. 'import_export_decl' will still continue to accept them, as allowing this is a pure extension and doesn't seem to cause issues with modules, but otherwise deferring the emission of inline variables appears to cause issues on some targets and prevents some code using inline variable templates from correctly linking. There might be a more targetted way to support this, but due to the complexity of handling linkage and emission I'd prefer to wait till GCC 15 to explore our options. PR c++/113970 PR c++/114013 gcc/cp/ChangeLog: * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline variables. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/inline-var10.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2024-02-28Daily bump.GCC Administrator5-1/+117
2024-02-27analyzer: use correct format code for string literal indices [PR110483,PR111802]David Malcolm1-1/+1
On e.g. gcc211 the use of "%li" with unsigned HOST_WIDE_INT led to this warning: ../../src/gcc/analyzer/access-diagram.cc: In member function ‘void ana::string_literal_spatial_item::add_column_for_byte(text_art::table&, const ana::bit_to_table_map&, text_art::style_manager&, ana::byte_offset_t, ana::byte_offset_t, int, int) const’: ../../src/gcc/analyzer/access-diagram.cc:1909:40: warning: format ‘%li’ expects argument of type ‘long int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=] byte_idx_within_string.ulow ())); ^ and to all values being erroneously printed as "0". Fixed thusly. gcc/analyzer/ChangeLog: PR analyzer/110483 PR analyzer/111802 * access-diagram.cc (string_literal_spatial_item::add_column_for_byte): Use %wu for printing unsigned HOST_WIDE_INT. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-02-27i386: psrlq is not used for PERM<a,{0},1,2,3,4> [PR113871]Uros Bizjak3-2/+40
Also handle V2BF mode. PR target/113871 gcc/ChangeLog: * config/i386/mmx.md (V248FI): Add V2BF mode. (V24FI_32): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/pr113871-5a.c: New test. * gcc.target/i386/pr113871-5b.c: New test.
2024-02-27Fix internal error on non-byte-aligned reference in GIMPLE DSEEric Botcazou3-24/+89
This is a regression present on the mainline, 13 and 12 branches. For the attached Ada case, it's a tree checking failure on the mainline at -O: +===========================GNAT BUG DETECTED==============================+ | 14.0.1 20240226 (experimental) [master r14-9171-g4972f97a265] GCC error:| | tree check: expected tree that contains 'decl common' structure, | | have 'component_ref' in tree_could_trap_p, at tree-eh.cc:2733 | | Error detected around /home/eric/cvs/gcc/gcc/testsuite/gnat.dg/opt104.adb: Time is a 10-byte record and Packed_Rec.T is placed at bit-offset 65 because of the packing. so tree-ssa-dse.cc:setup_live_bytes_from_ref has computed a const_size of 88 from ref->offset of 65 and ref->max_size of 80. Then in tree-ssa-dse.cc:compute_trims: 411 int last_live = bitmap_last_set_bit (live); (gdb) next 412 if (ref->size.is_constant (&const_size)) (gdb) 414 int last_orig = (const_size / BITS_PER_UNIT) - 1; (gdb) 418 *trim_tail = last_orig - last_live; (gdb) call debug_bitmap (live) n_bits = 256, set = {0 1 2 3 4 5 6 7 8 9 10 } (gdb) p last_live $33 = 10 (gdb) p const_size $34 = 80 (gdb) p last_orig $35 = 9 (gdb) p *trim_tail $36 = -1 In other words, compute_trims is overlooking the alignment adjustments that setup_live_bytes_from_ref applied earlier. Moveover it reads: /* We use sbitmaps biased such that ref->offset is bit zero and the bitmap extends through ref->size. So we know that in the original bitmap bits 0..ref->size were true. We don't actually need the bitmap, just the REF to compute the trims. */ but setup_live_bytes_from_ref used ref->max_size instead of ref->size. It appears that all the callers of compute_trims assume that ref->offset is byte aligned and that the trimmed bytes are relative to ref->size, so the patch simply adds an early return if either condition is not fulfilled. gcc/ * tree-ssa-dse.cc (compute_trims): Fix description. Return early if either ref->offset is not byte aligned or ref->size is not known to be equal to ref->max_size. (maybe_trim_complex_store): Fix description. (maybe_trim_constructor_store): Likewise. (maybe_trim_partially_dead_store): Likewise. gcc/testsuite/ * gnat.dg/opt104.ads, gnat.dg/opt104.adb: New test.
2024-02-27OpenACC: Add Fortran routines ↵Tobias Burnus9-56/+446
acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} These routines map simply to the C counterpart and are meanwhile defined in OpenACC 3.3. (There are additional routine changes, including the Fortran addition of acc_attach/acc_detach, that require more work than a simple addition of an interface and are therefore excluded.) libgomp/ChangeLog: * libgomp.texi (OpenACC Runtime Library Routines): Document new 3.3 routines that simply map to their C counterpart. * openacc.f90 (openacc): Add them. * openacc_lib.h: Likewise. * testsuite/libgomp.oacc-fortran/acc_host_device_ptr.f90: New test. * testsuite/libgomp.oacc-fortran/acc-memcpy.f90: New test. * testsuite/libgomp.oacc-fortran/acc-memcpy-2.f90: New test. * testsuite/libgomp.oacc-c-c++-common/lib-59.c: Crossref to f90 test. * testsuite/libgomp.oacc-c-c++-common/lib-60.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-95.c: Likewise.
2024-02-27analyzer: fix ICE on floating-point bounds [PR111881]David Malcolm2-0/+14
gcc/analyzer/ChangeLog: PR analyzer/111881 * constraint-manager.cc (bound::ensure_closed): Assert that m_constant has integral type. (range::add_bound): Bail out on floating point constants. gcc/testsuite/ChangeLog: PR analyzer/111881 * c-c++-common/analyzer/conditionals-pr111881.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-02-27arm: warn about deprecation of iwmmx in mmintrin.hRichard Earnshaw1-0/+3
GCC 13's changes file documents that iwmmx is deprecated. Raise the bar by warning when the mmintrin.h header is included by users, but provide a way to suppress the warning. gcc: * config/arm/mmintrin.h: Warn if this header is included without defining __ENABLE_DEPRECATED_IWMMXT.
2024-02-27tree-optimization/114074 - CHREC multiplication and undefined overflowRichard Biener5-16/+74
When folding a multiply CHRECs are handled like {a, +, b} * c is {a*c, +, b*c} but that isn't generally correct when overflow invokes undefined behavior. The following uses unsigned arithmetic unless either a is zero or a and b have the same sign. I've used simple early outs for INTEGER_CSTs and otherwise use a range-query since we lack a tree_expr_nonpositive_p and get_range_pos_neg isn't a good fit. PR tree-optimization/114074 * tree-chrec.h (chrec_convert_rhs): Default at_stmt arg to NULL. * tree-chrec.cc (chrec_fold_multiply): Canonicalize inputs. Handle poly vs. non-poly multiplication correctly with respect to undefined behavior on overflow. * gcc.dg/torture/pr114074.c: New testcase. * gcc.dg/pr68317.c: Adjust expected location of diagnostic. * gcc.dg/vect/vect-early-break_119-pr114068.c: Do not expect loop to be vectorized.
2024-02-27expand: Add trivial folding for bit query builtins at expansion time [PR114044]Jakub Jelinek4-5/+110
While it seems a lot of places in various optimization passes fold bit query internal functions with INTEGER_CST arguments to INTEGER_CST when there is a lhs, when lhs is missing, all the removals of such dead stmts are guarded with -ftree-dce, so with -fno-tree-dce those unfolded ifn calls remain in the IL until expansion. If they have large/huge BITINT_TYPE arguments, there is no BLKmode optab and so expansion ICEs, and bitint lowering doesn't touch such calls because it doesn't know they need touching, functions only containing those will not even be further processed by the pass because there are no non-small BITINT_TYPE SSA_NAMEs + the 2 exceptions (stores of BITINT_TYPE INTEGER_CSTs and conversions from BITINT_TYPE INTEGER_CSTs to floating point SSA_NAMEs) and when walking there is no special case for calls with BITINT_TYPE INTEGER_CSTs either, those are for normal calls normally handled at expansion time. So, the following patch adjust the expansion of these 6 ifns, by doing nothing if there is no lhs, and also just in case and user disabled all possible passes that would fold this handles the case of setting lhs to ifn call with INTEGER_CST argument. 2024-02-27 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/114044 * internal-fn.def (CLRSB, CLZ, CTZ, FFS, PARITY): Use DEF_INTERNAL_INT_EXT_FN macro rather than DEF_INTERNAL_INT_FN. * internal-fn.h (expand_CLRSB, expand_CLZ, expand_CTZ, expand_FFS, expand_PARITY): Declare. * internal-fn.cc (expand_bitquery, expand_CLRSB, expand_CLZ, expand_CTZ, expand_FFS, expand_PARITY): New functions. (expand_POPCOUNT): Use expand_bitquery. * gcc.dg/bitint-95.c: New test.
2024-02-27tree-optimization/114081 - dominator update for prologue peelingRichard Biener2-22/+95
The following implements manual update for multi-exit loop prologue peeling during vectorization. PR tree-optimization/114081 * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): Perform manual dominator update for prologue peeling. (vect_do_peeling): Properly update dominators after adding the prologue-around guard. * gcc.dg/vect/vect-early-break_121-pr114081.c: New testcase.
2024-02-27testsuite: Fix gcc.dg/attr-weakref-1.c on Solaris/x86 with as [PR70582]Rainer Orth1-0/+6
gcc.dg/attr-weakref-1.c FAILs on 32 and 64-bit Solaris/x86 with the native assembler: FAIL: gcc.dg/attr-weakref-1.c (test for excess errors) UNRESOLVED: gcc.dg/attr-weakref-1.c compilation failed to produce executable Excess errors: Assembler: attr-weakref-1.c "/var/tmp//ccUSaysF.s", line 171 : Multiply defined symbol: "Wv3a" This is a bug in the native as, which isn't seeing fixes recently. Since only a single subtest is affected, this patch omits that one. Tested on i386-pc-solaris2.11 (as and gas) and x86_64-pc-linux-gnu. 2024-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/testsuite: PR ipa/70582 * gcc.dg/attr-weakref-1.c (dg-additional-options): Define SOLARIS_X86_AS as appropriate. (lv3, Wv3a, pv3a): Wrap in !SOLARIS_X86_AS. (main): Likewise for chk (pv3a).
2024-02-27Daily bump.GCC Administrator8-1/+195
2024-02-26AVR: Tag optimization options as "Optimization".Georg-Johann Lay1-4/+4
Some options that are pure optimizations where not tagged as such. gcc/ * config/avr/avr.opt (mcall-prologues, mrelax, maccumulate-args) (mstrict-X): Tag as "Optimization".
2024-02-26AVR: Dead code removal.Georg-Johann Lay1-7/+2
gcc/ * config/avr/avr.cc (avr_out_compare) [AVR_TINY]: Remove code in an "if avr_adiw_reg_p()" block that's dead for AVR_TINY.
2024-02-26Fortran: do not evaluate polymorphic functions twice in assignment [PR114012]Harald Anlauf2-0/+85
PR fortran/114012 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial arguments just once before assigning to an unlimited polymorphic dummy variable. gcc/testsuite/ChangeLog: * gfortran.dg/pr114012.f90: New test.
2024-02-26varasm: Handle private COMDAT function symbol reference in readonly data ↵Jakub Jelinek4-1/+215
section [PR113617] If default_elf_select_rtx_section is called to put a reference to some local symbol defined in a comdat section into memory, which happens more often since the r14-4944 RA change, linking might fail. default_elf_select_rtx_section puts such constants into .data.rel.ro.local etc. sections and if linker chooses comdat sections from some other TU and discards the one to which a relocation in .data.rel.ro.local remains, linker diagnoses error. References to private comdat symbols can only appear from functions or data objects in the same comdat group, so the following patch arranges using .data.rel.ro.local.pool.<comdat_name> and similar sections. 2024-02-26 Jakub Jelinek <jakub@redhat.com> H.J. Lu <hjl.tools@gmail.com> PR rtl-optimization/113617 * varasm.cc (default_elf_select_rtx_section): For references to private symbols in comdat sections use .data.relro.local.pool.<comdat>, .data.relro.pool.<comdat> or .rodata.<comdat> comdat sections. * g++.dg/other/pr113617.C: New test. * g++.dg/other/pr113617.h: New test. * g++.dg/other/pr113617-aux.cc: New test.
2024-02-26c: Improve some diagnostics for __builtin_stdc_bit_* [PR114042]Jakub Jelinek2-42/+63
The PR complains that for the __builtin_stdc_bit_* "builtins" the diagnostics doesn't mention the name of the builtin the user used, but instead __builtin_{clz,ctz,popcount}g instead (which is what the FE immediately lowers it to). The following patch repeats the checks from check_builtin_function_arguments which are there done on BUILT_IN_{CLZ,CTZ,POPCOUNT}G, such that they diagnose it with the name of the "builtin" user actually used before it is gone. 2024-02-26 Jakub Jelinek <jakub@redhat.com> PR c/114042 * c-parser.cc (c_parser_postfix_expression): Diagnose __builtin_stdc_bit_* argument with ENUMERAL_TYPE or BOOLEAN_TYPE type or if signed here rather than on the replacement builtins in check_builtin_function_arguments. * gcc.dg/builtin-stdc-bit-2.c: Adjust testcase for actual builtin names rather than names of builtin replacements.
2024-02-26Update gcc sv.po, zh_CN.poJoseph Myers2-263/+211
* sv.po, zh_CN.po: Update.
2024-02-26tree-optimization/114099 - virtual LC PHIs and early exit vectRichard Biener2-22/+33
In some cases exits can lack LC PHI nodes for the virtual operand. We have to create them when the epilog loop requires them which also allows us to remove some only halfway correct fixups. This is the variant triggering for alternate exits. PR tree-optimization/114099 * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): Create and fill in a needed virtual LC PHI for the alternate exits. Remove code dealing with that missing. * gcc.dg/vect/vect-early-break_120-pr114099.c: New testcase.
2024-02-26tree-optimization/114068 - missed virtual LC PHI after vect peelingRichard Biener3-13/+87
When we choose the IV exit to be one leading to no virtual use we fail to have a virtual LC PHI even though we need it for the epilog entry. The following makes sure to create it so that later updating works. PR tree-optimization/114068 * tree-vect-loop-manip.cc (get_live_virtual_operand_on_edge): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add a virtual LC PHI on the main exit if needed. Remove band-aid for the case it was missing. * gcc.dg/vect/vect-early-break_118-pr114068.c: New testcase. * gcc.dg/vect/vect-early-break_119-pr114068.c: Likewise.
2024-02-26Add myself to write after approval and DCO.Juergen Christ1-0/+2
ChangeLog: * MAINTAINERS: Add myself to write after approval and DCO. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2024-02-26Finalization of object allocated by anonymous access designating local typeEric Botcazou4-12/+88
The finalization of objects dynamically allocated through an anonymous access type is deferred to the enclosing library unit in the current implementation and a warning is given on each of them. However this cannot be done if the designated type is local, because this would generate dangling references to the local finalization routine, so the finalization needs to be dropped in this case and the warning adjusted. gcc/ada/ PR ada/113893 * exp_ch7.adb (Build_Anonymous_Master): Do not build the master for a local designated type. * exp_util.adb (Build_Allocate_Deallocate_Proc): Force Needs_Fin to false if no finalization master is attached to an access type and assert that it is anonymous in this case. * sem_res.adb (Resolve_Allocator): Mention that the object might not be finalized at all in the warning given when the type is an anonymous access-to-controlled type. gcc/testsuite/ * gnat.dg/access10.adb: New test.
2024-02-26x86: Check interrupt instead of noreturn attributeH.J. Lu2-3/+31
ix86_set_func_type checks noreturn attribute to avoid incompatible attribute error in LTO1 on interrupt functions. Since TREE_THIS_VOLATILE is set also for _Noreturn without noreturn attribute, check interrupt attribute for interrupt functions instead. gcc/ PR target/114097 * config/i386/i386-options.cc (ix86_set_func_type): Check interrupt instead of noreturn attribute. gcc/testsuite/ PR target/114097 * gcc.target/i386/pr114097-1.c: New test.
2024-02-26i386: Enable _BitInt support on ia32Jakub Jelinek1-3/+1
Given the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113837#c9 comment, the following patch just attempts to implement what I think is best for ia32. Compared to https://gitlab.com/x86-psABIs/i386-ABI/-/issues/5 , like that patch for _BitInt(64) or smaller it uses the smallest containing {,un}signed {char,short,int,long long} for passing/returning and layout of variables including in structures for alignment/size, with any extra bits unspecified. Unlike the above proposal, for larger _BitInt (i.e. _BitInt(65)+), it uses passing/returning/layout/alignment of structure containing minimum needed number of 32-bit limbs, again with the extra bits unspecified. This is because most operations (except copy or bitwise ops) on _BitInts aren't really vectorizable and will be under the hood implemented in loops over 32-bit limbs anyway (using 64-bit limbs under the hood would mean often using library implementation for the basic operations) and because ia32 doesn't align even long long/double in structures to 64-bit I think it is better to just use 32-bit alignment for that. And I don't see a reason to waste 32-bit bits say for _BitInt(224) or _BitInt(288) on ia32. So, effectively it is like the x86-64 _BitInt ABI with everything divided by 2, the only exception is that in x86-64 psABI _BitInt(128) is said to be already a structure of 2 limbs, which happens to be passed mostly the same as __int128 (except for alignment). 2024-02-26 Jakub Jelinek <jakub@redhat.com> * config/i386/i386.cc (ix86_bitint_type_info): Add support for !TARGET_64BIT.
2024-02-26testsuite: xfail gcc.c-torture/compile/pr61159.c on Solaris/x86 with as ↵Rainer Orth1-1/+1
[PR61159] gcc.c-torture/compile/pr61159.c currently FAILs on 32 and 64-bit Solaris/x86 with the native assembler: FAIL: gcc.c-torture/compile/pr61159.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -O2 -flto (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -O2 -flto -flto-partition=none (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr61159.c -Os (test for excess errors) Excess errors: Assembler: pr61159.c "/var/tmp//ccRtFPva.s", line 5 : Cannot set a weak symbol to a common symbol This is a bug/limitation in the native assembler. Given that this hasn't seen fixes for a long time, this patch xfails the test. Tested on i386-pc-solaris2.11 (as and gas) and x86_64-pc-linux-gnu. 2024-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/testsuite: PR ipa/61159 * gcc.c-torture/compile/pr61159.c: xfail on Solaris/x86 with as.
2024-02-26match.pd: Guard 2 simplifications on integral TYPE_OVERFLOW_UNDEFINED [PR114090]Jakub Jelinek2-4/+44
These 2 patterns are incorrect on floating point, or for -fwrapv, or for -ftrapv, or the first one for unsigned types (the second one is mathematically correct, but we ought to just fold that to 0 instead). So, the following patch properly guards this. I think we don't need && !TYPE_OVERFLOW_SANITIZED (type) because in both simplifications there would be UB before and after on signed integer minimum. 2024-02-26 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/114090 * match.pd ((x >= 0 ? x : 0) + (x <= 0 ? -x : 0) -> abs x): Restrict pattern to ANY_INTEGRAL_TYPE_P and TYPE_OVERFLOW_UNDEFINED types. ((x <= 0 ? -x : 0) -> max(-x, 0)): Likewise. * gcc.dg/pr114090.c: New test.
2024-02-26fold-const: Avoid infinite recursion in +-*&|^minmax reassociation [PR114084]Jakub Jelinek2-10/+53
In the following testcase we infinitely recurse during BIT_IOR_EXPR reassociation. One operand is (unsigned _BitInt(31)) a << 4 and another operand 2147483647 >> 1 | 80 where both the right shift and the | 80 trees have TREE_CONSTANT set, but weren't folded because of delayed folding, where some foldings are apparently done even in that case unfortunately. Now, the fold_binary_loc reassocation code splits both operands into variable part, minus variable part, constant part, minus constant part, literal part and minus literal parts, to prevent infinite recursion punts if there are just 2 parts altogether from the 2 operands and then goes on with reassociation, merges first the corresponding parts from both operands and then some further merges. The problem with the above expressions is that we get 3 different objects, var0 (the left shift), con1 (the right shift) and lit1 (80), so the infinite recursion prevention doesn't trigger, and we eventually merge con1 with lit1, which effectively reconstructs the original op1 and then associate that with var0 which is original op0, and associate_trees for that case calls fold_binary. There are some casts involved there too (the T typedef type and the underlying _BitInt type which are stripped with STRIP_NOPS). The following patch attempts to prevent this infinite recursion by tracking the origin (if certain var comes from nothing - 0, op0 - 1, op1 - 2 or both - 3) and propagates it through all the associate_tree calls which merge the vars. If near the end we'd try to merge what comes solely from op0 with what comes solely from op1 (or vice versa), the patch punts, because then it isn't any kind of reassociation between the two operands, if anything it should be handled when folding the suboperands. 2024-02-26 Jakub Jelinek <jakub@redhat.com> PR middle-end/114084 * fold-const.cc (fold_binary_loc): Avoid the final associate_trees if all subtrees of var0 come from one of the op0 or op1 operands and all subtrees of con0 come from the other one. Don't clear variables which are never used afterwards. * gcc.dg/bitint-94.c: New test.
2024-02-26middle-end/114070 - folding breaking VEC_COND expansionRichard Biener3-7/+26
The following properly guards the simplifications that move operations into VEC_CONDs, in particular when that changes the type constraints on this operation. This needed a genmatch fix which was recording spurious implicit fors when tcc_comparison is used in a C expression. PR middle-end/114070 * genmatch.cc (parser::parse_c_expr): Do not record operand lists but only mark operators used. * match.pd ((c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e)): Properly guard the case of tcc_comparison changing the VEC_COND value operand type. * gcc.dg/torture/pr114070.c: New testcase.
2024-02-26i386: Fix up x86_function_profiler -masm=intel support [PR114094]Jakub Jelinek2-1/+11
In my r14-8214 changes I apparently forgot one \n at the end of an instruction. The corresponding AT&T line looks like: "1:\tcall\t*%s@GOTPCREL(%%rip)\n" but the Intel variant was "1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]" Fixed thusly. 2024-02-26 Jakub Jelinek <jakub@redhat.com> PR target/114094 * config/i386/i386.cc (x86_function_profiler): Add missing new-line to printed instruction. * gcc.target/i386/pr114094.c: New test.
2024-02-25x86: Properly implement AMX-TILE load/store intrinsicsH.J. Lu5-2/+101
ldtilecfg and sttilecfg take a 512-byte memory block. With _tile_loadconfig implemented as extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _tile_loadconfig (const void *__config) { __asm__ volatile ("ldtilecfg\t%X0" :: "m" (*((const void **)__config))); } GCC sees: (parallel [ (asm_operands/v ("ldtilecfg %X0") ("") 0 [(mem/f/c:DI (plus:DI (reg/f:DI 77 virtual-stack-vars) (const_int -64 [0xffffffffffffffc0])) [1 MEM[(const void * *)&tile_data]+0 S8 A128])] [(asm_input:DI ("m"))] (clobber (reg:CC 17 flags))]) and the memory operand size is 1 byte. As the result, the rest of 511 bytes is ignored by GCC. Implement ldtilecfg and sttilecfg intrinsics with a pointer to XImode to honor the 512-byte memory block. gcc/ChangeLog: PR target/114098 * config/i386/amxtileintrin.h (_tile_loadconfig): Use __builtin_ia32_ldtilecfg. (_tile_storeconfig): Use __builtin_ia32_sttilecfg. * config/i386/i386-builtin.def (BDESC): Add __builtin_ia32_ldtilecfg and __builtin_ia32_sttilecfg. * config/i386/i386-expand.cc (ix86_expand_builtin): Handle IX86_BUILTIN_LDTILECFG and IX86_BUILTIN_STTILECFG. * config/i386/i386.md (ldtilecfg): New pattern. (sttilecfg): Likewise. gcc/testsuite/ChangeLog: PR target/114098 * gcc.target/i386/amxtile-4.c: New test.
2024-02-26Daily bump.GCC Administrator7-1/+119