- Mar 14, 2024
-
-
Thomas Schwinge authored
Our dear friend '-Wuninitialized' reported: [...]/libgomp.oacc-fortran/acc-memcpy.f90:18:27: 18 | char(j) = int (j, int8) | ^ Warning: ‘j’ may be used uninitialized [-Wmaybe-uninitialized] [...]/libgomp.oacc-fortran/acc-memcpy.f90:14:20: 14 | integer(int8) :: j | ^ note: ‘j’ was declared here ..., but actually there were other issues. libgomp/ * testsuite/libgomp.oacc-fortran/acc-memcpy.f90: Fix 'char' initialization, copy, check.
-
Jakub Jelinek authored
The following testcase ICEs with LSE atomics. The problem is that the @atomic_compare_and_swap<mode> expander uses aarch64_reg_or_zero predicate for the desired operand, which is fine, given that for most of the modes and even for TImode in some cases it can handle zero immediate just fine, but the TImode @aarch64_compare_and_swap<mode>_lse just uses register_operand for that operand instead, again intentionally so, because the casp, caspa, caspl and caspal instructions need to use a pair of consecutive registers for the operand and xzr is just one register and we can't just store zero into the link register to emulate pair of zeros. So, the following patch fixes that by forcing the newval operand into a register for the TImode LSE case. 2024-03-14 Jakub Jelinek <jakub@redhat.com> PR target/114310 * config/aarch64/aarch64.cc (aarch64_expand_compare_and_swap): For TImode force newval into a register. * gcc.dg/pr114310.c: New test.
-
Juergen Christ authored
Transactional and non-transactional stores to the same cache line cause transactions to abort on newer generations. Add sufficient padding to make sure another cache line is used. Tested on s390. gcc/testsuite/ChangeLog: * gcc.target/s390/htm-builtins-1.c: Fix. * gcc.target/s390/htm-builtins-2.c: Fix. Signed-off-by:
Juergen Christ <jchrist@linux.ibm.com>
-
Jonathan Wakely authored
The bug with exceptions thrown during a std::call_once call affects all targets, so fix the docs that say it only affects non-Linux targets. libstdc++-v3/ChangeLog: PR libstdc++/66146 * doc/xml/manual/status_cxx2011.xml: Remove mention of Linux in note about std::call_once. * doc/xml/manual/status_cxx2014.xml: Likewise. * doc/xml/manual/status_cxx2017.xml: Likewise. * doc/html/manual/status.html: Regenerate.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * doc/xml/manual/status_cxx2023.xml: Update C++23 status table. * doc/html/manual/status.html: Regenerate. * include/bits/version.def: Fix typo in comment.
-
Lewis Hyatt authored
When the file name for a #include directive is the result of stringifying a macro argument, libcpp needs to take some care to get the whitespace correct; in particular stringify_arg() needs to see a CPP_PADDING token between macro tokens so that it can figure out when to output space between tokens. The CPP_PADDING tokens are not normally generated when handling a preprocessor directive, but for #include-like directives, libcpp sets the state variable pfile->state.directive_wants_padding to TRUE so that the CPP_PADDING tokens will be output, and then everything works fine for computed includes. As the PR points out, things do not work fine for __has_include. Fix that by setting the state variable the same as is done for #include. libcpp/ChangeLog: PR preprocessor/110558 * macro.cc (builtin_has_include): Set pfile->state.directive_wants_padding prior to lexing the file name, in case it comes from macro expansion. gcc/testsuite/ChangeLog: PR preprocessor/110558 * c-c++-common/cpp/has-include-2.c: New test. * c-c++-common/cpp/has-include-2.h: New test.
-
Lewis Hyatt authored
In libcpp/files.cc, the function _cpp_has_header(), which implements __has_include and __has_include_next, does not check for a NULL return value from search_path_head(), leading to an ICE tripping an assert when _cpp_find_file() tries to use it. Fix it by checking for that case and silently returning false instead. As suggested by the PR author, it is easiest to make a testcase by using the -idirafter option. To enable that, also modify the dg-additional-options testsuite procedure to make the global $srcdir available, since -idirafter requires the full path. libcpp/ChangeLog: PR preprocessor/80755 * files.cc (search_path_head): Add SUPPRESS_DIAGNOSTIC argument defaulting to false. (_cpp_has_header): Silently return false if the search path has been exhausted, rather than issuing a diagnostic and then hitting an assert. gcc/testsuite/ChangeLog: * lib/gcc-defs.exp (dg-additional-options): Make $srcdir usable in a dg-additional-options directive. * c-c++-common/cpp/has-include-next-2-dir/has-include-next-2.h: New test. * c-c++-common/cpp/has-include-next-2.c: New test.
-
Gaius Mulley authored
The type checker M2Check.mod needs extending to detect if a set, array or record is in either operand at the end of the cascaded test list. gcc/m2/ChangeLog: PR modula2/114333 * gm2-compiler/M2Check.mod (checkUnbounded): New procedure function. (checkArrayTypeEquivalence): Extend checking to cover unbounded arrays, arrays and constants. (IsTyped): Simplified the expression and corrected a test for IsConstructor. (checkTypeKindViolation): New procedure function. (doCheckPair): Call checkTypeKindViolation. * gm2-compiler/M2GenGCC.mod (CodeStatement): Remove parameters to CodeEqu and CodeNotEqu. (PerformCodeIfEqu): New procedure. (CodeIfEqu): Rewrite. (PerformCodeIfNotEqu): New procedure. (CodeIfNotEqu): Rewrite. * gm2-compiler/M2Quads.mod (BuildRelOpFromBoolean): Correct comment. gcc/testsuite/ChangeLog: PR modula2/114333 * gm2/cse/pass/testcse54.mod: New test. * gm2/iso/run/pass/array9.mod: New test. * gm2/iso/run/pass/strcons3.mod: New test. * gm2/iso/run/pass/strcons4.mod: New test. * gm2/pim/fail/badset1.mod: New test. * gm2/pim/fail/badset2.mod: New test. * gm2/pim/fail/badset3.mod: New test. * gm2/pim/fail/badset4.mod: New test. Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
-
Chung-Lin Tang authored
This patch implements the front-end support for the 'readonly' modifier for the OpenACC 'copyin' clause and 'cache' directive. This currently only includes front-end parsing for C/C++/Fortran and setting of new bits OMP_CLAUSE_MAP_READONLY, OMP_CLAUSE__CACHE__READONLY. Further linking of these bits to points-to analysis and/or utilization of read-only memory in accelerator target are for later patches. gcc/c/ChangeLog: * c-parser.cc (c_parser_oacc_data_clause): Add parsing support for 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier found, update comments. (c_parser_oacc_cache): Add parsing support for 'readonly' modifier, set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update comments. gcc/cp/ChangeLog: * parser.cc (cp_parser_oacc_data_clause): Add parsing support for 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier found, update comments. (cp_parser_oacc_cache): Add parsing support for 'readonly' modifier, set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update comments. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_namelist): Print "readonly," for OMP_LIST_MAP and OMP_LIST_CACHE if n->u.map.readonly is set. Adjust 'n->u.map_op' to 'n->u.map.op'. * gfortran.h (typedef struct gfc_omp_namelist): Adjust map_op as 'ENUM_BITFIELD (gfc_omp_map_op) op:8', add 'bool readonly' field, change to named struct field 'map'. * openmp.cc (gfc_match_omp_map_clause): Adjust 'n->u.map_op' to 'n->u.map.op'. (gfc_match_omp_clause_reduction): Likewise. (gfc_match_omp_clauses): Add readonly modifier parsing for OpenACC copyin clause, set 'n->u.map.op' and 'n->u.map.readonly' for parsed clause. Adjust 'n->u.map_op' to 'n->u.map.op'. (gfc_match_oacc_declare): Adjust 'n->u.map_op' to 'n->u.map.op'. (gfc_match_oacc_cache): Add readonly modifier parsing for OpenACC cache directive. (resolve_omp_clauses): Adjust 'n->u.map_op' to 'n->u.map.op'. * trans-decl.cc (add_clause): Adjust 'n->u.map_op' to 'n->u.map.op'. (finish_oacc_declare): Likewise. * trans-openmp.cc (gfc_trans_omp_clauses): Set OMP_CLAUSE_MAP_READONLY, OMP_CLAUSE__CACHE__READONLY to 1 when readonly is set. Adjust 'n->u.map_op' to 'n->u.map.op'. (gfc_add_clause_implicitly): Adjust 'n->u.map_op' to 'n->u.map.op'. gcc/ChangeLog: * tree.h (OMP_CLAUSE_MAP_READONLY): New macro. (OMP_CLAUSE__CACHE__READONLY): New macro. * tree-core.h (struct GTY(()) tree_base): Adjust comments for new uses of readonly_flag bit in OMP_CLAUSE_MAP_READONLY and OMP_CLAUSE__CACHE__READONLY. * tree-pretty-print.cc (dump_omp_clause): Add support for printing OMP_CLAUSE_MAP_READONLY and OMP_CLAUSE__CACHE__READONLY. gcc/testsuite/ChangeLog: * c-c++-common/goacc/readonly-1.c: New test. * gfortran.dg/goacc/readonly-1.f90: New test.
-
Andreas Krebbel authored
With this fix we make sure that only symbols with a natural alignment smaller than 2 are considered misaligned with -munaligned-symbols. Background is that -munaligned-symbols is only supposed to affect symbols whose natural alignment wouldn't be enough to fulfill our ABI requirement of having all symbols at even addresses. Because only these are the cases where we differ from other architectures. gcc/ChangeLog: * config/s390/s390.cc (s390_encode_section_info): Adjust the check for misaligned symbols. * config/s390/s390.opt: Improve documentation. gcc/testsuite/ChangeLog: * gcc.target/s390/aligned-1.c: Add weak and void variables incorporating the cases from unaligned-2.c. * gcc.target/s390/unaligned-1.c: Likewise. * gcc.target/s390/unaligned-2.c: Removed.
-
Jakub Jelinek authored
When trying to use the gsi_safe_insert*before APIs in bitint lowering, I've discovered 3 issues and the following patch addresses those: 1) both split_block and split_edge update CDI_DOMINATORS if they are available, but because edge_before_returns_twice_call first splits and then adds an extra EDGE_ABNORMAL edge and then removes another one, the immediate dominators of both the new bb and the bb with returns_twice call need to change 2) the new EDGE_ABNORMAL edge had uninitialized probability; this patch copies the probability from the edge that is going to be removed and similarly copies other flags (EDGE_EXECUTABLE, EDGE_DFS_BACK, EDGE_IRREDUCIBLE_LOOP etc.) 3) if edge_before_returns_twice_call splits a block, then the bb with returns_twice call changes, so the gimple_stmt_iterator for it is no longer accurate, it points to the right statement, but gsi_bb and gsi_seq are no longer correct; the patch updates it 2024-03-14 Jakub Jelinek <jakub@redhat.com> * gimple-iterator.cc (edge_before_returns_twice_call): Copy all flags and probability from ad_edge to e edge. If CDI_DOMINATORS are computed, recompute immediate dominator of other_edge->src and other_edge->dest. (gsi_safe_insert_before, gsi_safe_insert_seq_before): Update *iter for the returns_twice call case to the gsi_for_stmt (stmt) to deal with update it for bb splitting.
-
liuhongt authored
When we split (insn 37 36 38 10 (set (reg:DI 104 [ _18 ]) (mem:DI (reg/f:SI 98 [ CallNative_nclosure.0_1 ]) [6 MEM[(struct SQRefCounted *)CallNative_nclosure.0_1]._uiRef+0 S8 A32])) "test.C":22:42 84 {*movdi_internal} (expr_list:REG_EH_REGION (const_int -11 [0xfffffffffffffff5]) into (insn 104 36 37 10 (set (subreg:V2DI (reg:DI 124) 0) (vec_concat:V2DI (mem:DI (reg/f:SI 98 [ CallNative_nclosure.0_1 ]) [6 MEM[(struct SQRefCounted *)CallNative_nclosure.0_1]._uiRef+0 S8 A32]) (const_int 0 [0]))) "test.C":22:42 -1 (nil))) (insn 37 104 105 10 (set (subreg:V2DI (reg:DI 104 [ _18 ]) 0) (subreg:V2DI (reg:DI 124) 0)) "test.C":22:42 2024 {movv2di_internal} (expr_list:REG_EH_REGION (const_int -11 [0xfffffffffffffff5]) (nil))) we must copy the REG_EH_REGION note to the first insn and split the block after the newly added insn. The REG_EH_REGION on the second insn will be removed later since it no longer traps. gcc/ChangeLog: * config/i386/i386-features.cc (general_scalar_chain::convert_op): Handle REG_EH_REGION note. (convert_scalars_to_vector): Ditto. * config/i386/i386-features.h (class scalar_chain): New memeber control_flow_insns. gcc/testsuite/ChangeLog: * g++.target/i386/pr111822.C: New test.
-
GCC Administrator authored
-
- Mar 13, 2024
-
-
Jonathan Wakely authored
A recent GDB change causes this test to fail due to missing RTTI for the custom_cast type. This is presumably because the custom_cat type was defined as a local class, so has no linkage. Moving it to local scope seems to fix the test regressions, and probably makes the test more realistic as a local class with no linkage isn't practical to use as an error category that almost certainly needs to be referred to in other scopes. libstdc++-v3/ChangeLog: * testsuite/libstdc++-prettyprinters/cxx11.cc: Move custom_cat to namespace scope.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * doc/xml/manual/debug.xml: Improve docs on debug builds and using ASan. Mention _GLIBCXX_ASSERTIONS. Reorder sections to put the most relevant ones first. * doc/xml/manual/using.xml: Add comma. * doc/html/*: Regenerate.
-
Jonathan Wakely authored
The macro-based concept checks are unmaintained and do not support C++11 or later, so reject valid code. If nobody plans to update them we should consider removing them. Alternatively, we could ignore the macro for C++11 and later, so they have no effect and don't reject valid code. libstdc++-v3/ChangeLog: * doc/xml/manual/debug.xml: Document that concept checking might be removed in future. * doc/xml/manual/extensions.xml: Likewise.
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/114001 * expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS symbols are also handled. gcc/testsuite/ChangeLog: PR fortran/114001 * gfortran.dg/is_contiguous_4.f90: New test.
-
Jakub Jelinek authored
gimple-ssa-store-merging.cc tests bswap_optab in 3 different places, in 2 of them it has special exception for double-word bswap using pair of word-mode bswap optabs, but in the last one it doesn't. The following patch changes even the last spot. We don't handle 128-bit bswaps in the passes at all, because currently we just use uint64_t to represent the byte reshuffling (we'd need to use offset_int or something like that instead) and we don't have __builtin_bswap128 nor type-generic __builtin_bswap, so there is nothing for 64-bit targets there. 2024-03-13 Jakub Jelinek <jakub@redhat.com> PR middle-end/114319 * gimple-ssa-store-merging.cc (imm_store_chain_info::try_coalesce_bswap): For 32-bit targets allow matching __builtin_bswap64 if there is bswapsi2 optab. * gcc.target/i386/pr114319.c: New test.
-
Torbjörn SVENSSON authored
On arm-none-eabi, the test case fails with below warning on GCC13 .../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:63:65: warning: converting a packed 'enum obj_type' pointer (alignment 1) to a 'struct connection' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member] Add a dg-bogus to ensure that the warning is not reintroduced. gcc/testsuite/ChangeLog: * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c: Added dg-bogus with target on offending line for short_enums. Signed-off-by:
Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
-
Stefan Schulze Frielinghaus authored
RTX X need not necessarily be a SYMBOL_REF and may e.g. be an UNSPEC_GOTENT for which SYMBOL_FLAG_NOTALIGN2_P fails. gcc/ChangeLog: * config/s390/s390.cc (s390_secondary_reload): Guard SYMBOL_FLAG_NOTALIGN2_P.
-
Stefan Schulze Frielinghaus authored
Starting with r14-2047-gd0e891406b16dc two SI mode tests are optimized into DI mode. Thus, the scan-assembler directives fail. For example RTL expression (ior:SI (subreg:SI (lshiftrt:DI (reg:DI 69) (const_int 2 [0x2])) 4) (subreg:SI (reg:DI 68) 4)) is optimized into (ior:DI (lshiftrt:DI (reg:DI 69) (const_int 2 [0x2])) (reg:DI 68)) Fixed by moving operands into memory in order to enforce SI mode computation. Furthermore, in r9-6056-g290dfd9bc7bea2 the starting bit position of the scan-assembler directive for rosbg was incorrectly set to 32 which actually should be 32+SHIFT_AMOUNT, i.e., in this particular case 34. gcc/testsuite/ChangeLog: * gcc.target/s390/md/rXsbg_mode_sXl.c: Fix tests rosbg_si_srl and rxsbg_si_srl.
-
Stefan Schulze Frielinghaus authored
Similar as to s390_lcbb, s390_vll, s390_vstl, et al. make use of a signed vector type for vlbb. Furthermore, a const void pointer seems more common and an integer for the mask. For s390_vfi(s,d)b make use of integers for masks, too. Use unsigned integers for all s390_vlbr/vstbr variants. Make use of type UV16QI for the length operand of s390_vstrs(,z)(h,f). Following the Principles of Operation, change from signed to unsigned type for s390_va(c,cc,ccc)q and s390_vs(,c,bc)biq and s390_vmslg. Make use of scalar type UINT128 instead of UV16QI for s390_vgfm(,a)g, and s390_vsumq(f,g). gcc/ChangeLog: * config/s390/s390-builtin-types.def: Update to reflect latest changes. * config/s390/s390-builtins.def: Streamline vector builtins with LLVM.
-
Stefan Schulze Frielinghaus authored
According to IBM Open XL C/C++ for z/OS version 1.1 builtins - vec_permi - vec_ctd - vec_ctsl - vec_ctul - vec_ld2f - vec_st2f are deprecated. Also deprecate helper builtins vec_ctd_s64 and vec_ctd_u64. Furthermore, the overloads of vec_insert which make use of a bool vector are deprecated, too. gcc/ChangeLog: * config/s390/s390-builtins.def (vec_permi): Deprecate. (vec_ctd): Deprecate. (vec_ctd_s64): Deprecate. (vec_ctd_u64): Deprecate. (vec_ctsl): Deprecate. (vec_ctul): Deprecate. (vec_ld2f): Deprecate. (vec_st2f): Deprecate. (vec_insert): Deprecate overloads with bool vectors.
-
Jakub Jelinek authored
The following testcase ICEs, because for large/huge _BitInt bitfield loads/stores we use the DECL_BIT_FIELD_REPRESENTATIVE as the underlying "var" and indexes into it can be larger than the precision of the bitfield might normally allow. The following patch fixes that by passing NULL_TREE type in that case to limb_access, so that we always return m_limb_type type and don't do the extra assertions, after all, the callers expect that too. I had to add the first hunk to avoid ICE, it was using type in one place even when it was NULL. But TYPE_SIZE (TREE_TYPE (var)) seems like the right size to use anyway because the code uses VIEW_CONVERT_EXPR on it. 2024-03-13 Jakub Jelinek <jakub@redhat.com> PR middle-end/114313 * gimple-lower-bitint.cc (bitint_large_huge::limb_access): Use TYPE_SIZE of TREE_TYPE (var) rather than TYPE_SIZE of type. (bitint_large_huge::handle_load): Pass NULL_TREE rather than rhs_type to limb_access for the bitfield load cases. (bitint_large_huge::lower_mergeable_stmt): Pass NULL_TREE rather than lhs_type to limb_access if nlhs is non-NULL. * gcc.dg/torture/bitint-62.c: New test.
-
Tobias Burnus authored
Dummy procedures look similar to variables but aren't - neither in Fortran nor in OpenMP. As the middle end sees PARM_DECLs, mark them as predetermined firstprivate for mapping (as already done in gfc_omp_predetermined_sharing). This does not address the isses related to procedure pointers, which are still discussed on spec level [see PR]. PR fortran/114283 gcc/fortran/ChangeLog: * trans-openmp.cc (gfc_omp_predetermined_mapping): Map dummy procedures as firstprivate. libgomp/ChangeLog: * testsuite/libgomp.fortran/declare-target-indirect-4.f90: New test.
-
Jakub Jelinek authored
The following patch on top of the previously posted ubsan/gimple-iterator one handles asan the same. While the case of returning by hidden reference is handled differently because of the first recently posted asan patch, this deals with instrumentation of the aggregates returned in registers case as well as instrumentation of loads from aggregate memory in the function arguments of returns_twice calls. 2024-03-13 Jakub Jelinek <jakub@redhat.com> PR sanitizer/112709 * asan.cc (maybe_create_ssa_name, maybe_cast_to_ptrmode, build_check_stmt, maybe_instrument_call, asan_expand_mark_ifn): Use gsi_safe_insert_before instead of gsi_insert_before. * gcc.dg/asan/pr112709-2.c: New test.
-
Jakub Jelinek authored
ubsan, asan (both PR112709) and _BitInt lowering (PR113466) want to insert some instrumentation or adjustment statements before some statement. This unfortunately creates invalid IL if inserting before a returns_twice call, because we require that such calls are the first statement in a basic block and that we have an edge from the .ABNORMAL_DISPATCHER block to the block containing the returns_twice call (in addition to other edge(s)). The following patch adds helper functions for such insertions and uses it for now in ubsan (I'll post a follow up which uses it in asan and will work later on the _BitInt lowering PR). In particular, if the bb with returns_twice call at the start has just 2 edges, one EDGE_ABNORMAL from .ABNORMAL_DISPATCHER and another (non-EDGE_ABNORMAL/EDGE_EH) from some other bb, it just inserts the statement or sequence on that other edge. If the bb has more predecessor edges or the one not from .ABNORMAL_DISPATCHER is e.g. an EH edge (this latter case likely shouldn't happen, one would need labels or something like that), the patch splits the block with returns_twice call such that there is just one edge next to .ABNORMAL_DISPATCHER edge and adjusts PHIs as needed to make it happen. The functions also replace uses of PHIs from the returns_twice bb with the corresponding PHI arguments, because otherwise it would be invalid IL. E.g. in ubsan/pr112709-2.c (qux) we have before the ubsan pass <bb 10> : # .MEM_5(ab) = PHI <.MEM_4(9), .MEM_25(ab)(11)> # _7(ab) = PHI <_20(9), _8(ab)(11)> # .MEM_21(ab) = VDEF <.MEM_5(ab)> _22 = bar (*_7(ab)); where bar is returns_twice call and bb 11 has .ABNORMAL_DISPATCHER call, this patch instruments it like: <bb 9> : # .MEM_4 = PHI <.MEM_17(ab)(4), .MEM_10(D)(5), .MEM_14(ab)(8)> # DEBUG BEGIN_STMT # VUSE <.MEM_4> _20 = p; # .MEM_27 = VDEF <.MEM_4> .UBSAN_NULL (_20, 0B, 0); # VUSE <.MEM_27> _2 = __builtin_dynamic_object_size (_20, 0); # .MEM_28 = VDEF <.MEM_27> .UBSAN_OBJECT_SIZE (_20, 1024, _2, 0); <bb 10> : # .MEM_5(ab) = PHI <.MEM_28(9), .MEM_25(ab)(11)> # _7(ab) = PHI <_20(9), _8(ab)(11)> # .MEM_21(ab) = VDEF <.MEM_5(ab)> _22 = bar (*_7(ab)); The edge from .ABNORMAL_DISPATCHER is there just to represent the returning for 2nd and later times, the instrumentation can't be done at that point as there is no code executed during that point. The ubsan/pr112709-1.c testcase includes non-virtual PHIs to cover the handling of those as well. 2024-03-13 Jakub Jelinek <jakub@redhat.com> PR sanitizer/112709 * gimple-iterator.h (gsi_safe_insert_before, gsi_safe_insert_seq_before): Declare. * gimple-iterator.cc: Include gimplify.h. (edge_before_returns_twice_call, adjust_before_returns_twice_call, gsi_safe_insert_before, gsi_safe_insert_seq_before): New functions. * ubsan.cc (instrument_mem_ref, instrument_pointer_overflow, instrument_nonnull_arg, instrument_nonnull_return): Use gsi_safe_insert_before instead of gsi_insert_before. (maybe_instrument_pointer_overflow): Use force_gimple_operand, gimple_seq_add_seq_without_update and gsi_safe_insert_seq_before instead of force_gimple_operand_gsi. (instrument_object_size): Likewise. Use gsi_safe_insert_before instead of gsi_insert_before. * gcc.dg/ubsan/pr112709-1.c: New test. * gcc.dg/ubsan/pr112709-2.c: New test.
-
GCC Administrator authored
-
- Mar 12, 2024
-
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/110826 * array.cc (gfc_array_dimen_size): When walking the ref chain of an array and the ultimate component is a procedure pointer, do not try to figure out its dimension even if it is a array-valued function. gcc/testsuite/ChangeLog: PR fortran/110826 * gfortran.dg/proc_ptr_comp_53.f90: New test.
-
Tobias Burnus authored
While texinfo 7.0.3 does not warn, an older texinfo did complain about: libgomp.texi:1964: warning: node next `omp_target_memcpy' in menu `omp_target_memcpy_rect' and in sectioning `omp_target_memcpy_async' differ libgomp/ * libgomp.texi (Device Memory Routines): Swap item order to match the order of the '@node's of the '@subsection's.
-
Richard Biener authored
The following addresses endless recursion in the chrec_fold_{plus,multiply} functions when handling sign-conversions. We only need to apply tricks when we'd fail (there's a chrec in the converted operand) and we need to make sure to not turn the other operand into something worse (for the chrec-vs-chrec case). PR tree-optimization/114121 * tree-chrec.cc (chrec_fold_plus_1): Guard recursion with converted operand properly. (chrec_fold_multiply): Likewise. Handle missed recursion. * gcc.dg/torture/pr114312.c: New testcase.
-
Nathaniel Shead authored
Some targets make use of POLY_INT_CSTs and other custom builtin types, which currently violate some assumptions when streaming. This patch adds support for them, such as types like Aarch64 __fp16, PowerPC __ibm128, and vector types thereof. This patch doesn't provide "full" support of AArch64 SVE, however, since for that we would need to support 'target' nodes (tracked in PR108080). Adding the new builtin types means that on Aarch64 we now have 217 global trees created on initialisation (up from 191), so this patch also slightly bumps the initial size of the fixed_trees allocation to 250. PR c++/98645 PR c++/98688 PR c++/111224 gcc/cp/ChangeLog: * module.cc (enum tree_tag): Add new tag for builtin types. (trees_out::start): POLY_INT_CSTs can be emitted. (trees_in::start): Likewise. (trees_out::core_vals): Stream POLY_INT_CSTs. (trees_in::core_vals): Likewise. (trees_out::type_node): Handle vectors with multiple coeffs. (trees_in::tree_node): Likewise. (init_modules): Register target-specific builtin types. Bump initial capacity slightly. gcc/testsuite/ChangeLog: * g++.dg/modules/target-aarch64-1_a.C: New test. * g++.dg/modules/target-aarch64-1_b.C: New test. * g++.dg/modules/target-powerpc-1_a.C: New test. * g++.dg/modules/target-powerpc-1_b.C: New test. * g++.dg/modules/target-powerpc-2_a.C: New test. * g++.dg/modules/target-powerpc-2_b.C: New test. Signed-off-by:
Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by:
Patrick Palka <ppalka@redhat.com>
-
Jakub Jelinek authored
asan currently instruments since PR69276 r6-6758 fix calls which store the return value into memory on the caller side, before the call it verifies the memory is writable. Now PR112709 where we ICE on trying to instrument such calls made me think about whether that is what we want to do. There are 3 different cases. One is when a function returns an aggregate which is passed e.g. in registers, say like struct S { int a[4]; }; returning on x86_64. That would be ideally instrumented in between the actual call and storing of the aggregate into memory, but asan currently mostly works as a GIMPLE pass and arranging for the instrumentation to happen at that spot would be really hard. We could diagnose after the call but generally asan attempts to diagnose stuff before something is overwritten rather than after, or keep the current behavior (that is what this patch does, which has the disadvantage that it can complain about UB even for functions which never return and so never actually store, and doesn't check whether the memory wasn't e.g. poisoned during the call) or could e.g. instrument both before and after the call (that would have the disadvantage the current state has but at least would check post-factum the store again afterwards). Another case is when a function returns an aggregate through a hidden reference, struct T { int a[128]; }; on x86_64 or even the above struct S on ia32 as example. In the actual program such stores happen when storing something to <retval> or its parts in the callee, because <retval> there expands to *hidden_retval. So, IMHO we should instrument those in the callee rather than caller, that is where the writes are and we can do that easily. This is what the patch below does. And the last case is for builtins/internal functions. Usually those don't return aggregates, but in case they'd do and can be expanded inline, it is better to instrument them in the caller (as before) rather than not instrumenting the return stores at all. I had to tweak the expected output on the PR69276 testcase, because with the patch it keeps previous behavior on x86_64 (structure returned in registers, stored in the caller, so reported as UB in A::A()), while on i686 it changed the behavior and is reported as UB in the vnull::operator vec which stores the structure, A::A() is then a frame above it in the backtrace. 2024-03-12 Jakub Jelinek <jakub@redhat.com> PR sanitizer/112709 * asan.cc (has_stmt_been_instrumented_p): Don't instrument call stores on the caller side unless it is a call to a builtin or internal function or function doesn't return by hidden reference. (maybe_instrument_call): Likewise. (instrument_derefs): Instrument stores to RESULT_DECL if returning by hidden reference. * gcc.dg/asan/pr112709-1.c: New test. * g++.dg/asan/pr69276.C: Adjust expected output for some targets.
-
Jakub Jelinek authored
This PR is similar to PR110603 fixed with r14-8487, except in a different spot. From the memset with -1 size of non-zero value we determine minimum of (size_t) -1 and the code uses PTRDIFF_MAX - 2 (not really sure I understand why it is - 2 and not - 1, e.g. heap allocated array with PTRDIFF_MAX char elements which contain '\0' in the last element should be fine, no? One can still represent arr[PTRDIFF_MAX] - arr[0] and arr[0] - arr[PTRDIFF_MAX] in ptrdiff_t and strlen (arr) == PTRDIFF_MAX - 1) as the maximum, so again invalid range. As in the other case, it is just UB that can lead to that, and we have choice to only keep the min and use +inf for max, or only keep max and use 0 for min, or not set the range at all, or use [min, min] or [max, max] etc. The following patch uses [min, +inf]. 2024-03-12 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/114293 * tree-ssa-strlen.cc (strlen_pass::handle_builtin_strlen): If max is smaller than min, set max to ~(size_t)0. * gcc.dg/pr114293.c: New test.
-
Pan Li authored
Notice some code style issue(s) when add __riscv_v_fixed_vlen, includes: * Meanless empty line. * Line greater than 80 chars. * Indent with 3 space(s). * Argument unalignment. gcc/ChangeLog: * config/riscv/riscv-c.cc (riscv_ext_version_value): Fix code style greater than 80 chars. (riscv_cpu_cpp_builtins): Fix useless empty line, indent with 3 space(s) and argument unalignment. Signed-off-by:
Pan Li <pan2.li@intel.com>
-
Richard Biener authored
The following makes sure to pass in the SLP node for the live stmts we are generating the reduction epilogue for to vect_create_epilog_for_reduction. This follows the previous fix for the non-SLP path. PR tree-optimization/114297 * tree-vect-loop.cc (vectorizable_live_operation): Pass in the live stmts SLP node to vect_create_epilog_for_reduction. * gcc.dg/vect/vect-early-break_123-pr114297.c: New testcase.
-
Andrew Pinski authored
When -fmultiflags option support was added in r13-3693-g6b1a2474f9e422, it accidently allowed -fno-multiflags which then would pass on to cc1. This fixes that oversight. Committed as obvious after bootstrap/test on x86_64-linux-gnu. gcc/ChangeLog: PR driver/114314 * common.opt (fmultiflags): Add RejectNegative. Signed-off-by:
Andrew Pinski <quic_apinski@quicinc.com>
-
GCC Administrator authored
-
- Mar 11, 2024
-
-
Jerry DeLisle authored
PR libfortran/105437 PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Remove check for decimal point mode and semicolon used as a seprator. Removes the regression. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Add additional checks to address the case of semicolon at the end of a line.
-
Joseph Myers authored
* sv.po: Update.
-