aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-12testsuite: Add testcase for already fixed PR [PR119226]Jakub Jelinek1-0/+12
This was fixed in PR119219 r15-7981 commit. 2025-03-12 Jakub Jelinek <jakub@redhat.com> PR middle-end/119226 * gcc.c-torture/compile/pr119226.c: New test.
2025-03-12aarch64: Make latency account for synthetic VEC_PERM_EXPRs [PR116901]Richard Sandiford1-19/+28
Another problem in pr110625_[24].c was that the latency calculations were ignoring VEC_PERM_EXPRs that had no associated stmt_vec_info. Such VEC_PERM_EXPRs are common and expected for SLP these days. After this change, the number of general ops in the testcases seems to be accurate apart from one remaining detail: we assume that the extension in a permuted extending load is free, even though the extension happens after the permutation. Fixing that would require more information from the vectoriser and so isn't GCC 15 material. It also should cease to be a problem if we do end up moving the permutation to its own node, rather than keeping it as part of the load. gcc/ PR target/116901 * config/aarch64/aarch64.cc (aarch64_vector_costs::count_ops): Allow stmt_info to be null. (aarch64_vector_costs::add_stmt_cost): Call count_ops even if stmt_info is null.
2025-03-12vect: Fix ncopies when costing SLP reductions [PR116901]Richard Sandiford3-9/+9
pr110625_[24].c started failing after r15-1329-gd66b820f392aa9a7, which switched to single def-use cycles for single-lane SLP. The problem is that we only costed one vector accumulator operation for an N-vector cycle. The problem seems to have been latent, and meant that we also only costed one FADDA for reduc_strict_4.c and reduc_strict_5.c, even though they need 4 and 6 FADDAs respectively. I'm not sure why: if ((double_reduc || reduction_type != TREE_CODE_REDUCTION) && ncopies > 1) was previously only necessary for non-SLP, but the patch preserves that for safety. gcc/ PR tree-optimization/116901 * tree-vect-loop.cc (vectorizable_reduction): Set ncopies to SLP_TREE_NUMBER_OF_VEC_STMTS for SLP. gcc/testsuite/ PR tree-optimization/116901 * gcc.target/aarch64/sve/reduc_strict_4.c: Turn off costing. * gcc.target/aarch64/sve/reduc_strict_5.c: Likewise.
2025-03-12aarch64: Tighten pr110625_1.c regexpRichard Sandiford1-1/+1
Before r14-2877-gbf67bf4880ce5be0, the aarch64 code assumed that every multi-vector reduction would use single def-use cycles. The patch fixed it to test what the vectoriser actually planned to do, using newly provided information. At the time, we didn't try to use single def-use cycles for any costed variant in the associated testcase (gcc.target/aarch64/pr110625_1.c), so it was enough to check that the single-def-use latency was never printed to the dump file. However, we do now consider using single def-use cycles for the single-lane SLP fallback. This patch therefore switches to a positive test of the non-single-def-use latency. I checked that the test still failed in this form before r14-2877-gbf67bf4880ce5be0. gcc/testsuite/ * gcc.target/aarch64/pr110625_1.c: Turn into a positive test for a vector latency of 2, rather than a negative test for a vector latency of 8.
2025-03-12tree.def: Improve RAW_DATA_CST documentationJakub Jelinek1-1/+11
In PR117262 David was asking for better documentation of RAW_DATA_CST and in the review of the PR119076 patch Jason was asking for that as well. Here is an attempt to do so. 2025-03-12 Jakub Jelinek <jakub@redhat.com> * tree.def (RAW_DATA_CST): Document meaning of NULL RAW_DATA_OWNER. (CONSTRUCTOR): Document meaning of RAW_DATA_CST used as element value.
2025-03-12Simple cobol.dg testsuiteRichard Biener7-0/+440
The following adds a simple cobol.dg test harness, based on gfortran.dg. It's invoked by make check-cobol, has three tests, two execution test and one test exercising dg-error. The existing FAIL is due to an assembling error, tracked by PR119214. Running /home/rguenther/src/gcc/gcc/testsuite/cobol.dg/dg.exp ... FAIL: cobol.dg/pass.cob -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: cobol.dg/fail.cob -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) === cobol Summary === # of expected passes 12 # of unexpected failures 1 # of unresolved testcases 1 gcc/cobol/ * Make-lang.in (lang_checks): Add check-cobol. gcc/testsuite/ * lib/cobol-dg.exp: New, based on gfortran-dg.exp. * lib/cobol.exp: New, based on gfortran.exp. * cobol.dg/dg.exp: New. * cobol.dg/pass.cob: New test. * cobol.dg/fail.cob: Likewise. * cobol.dg/error-1.cob: Likewise.
2025-03-12builtins: Fix up strspn/strcspn folding [PR119219]Jakub Jelinek1-11/+9
The PR119204 r15-7955 fix caused some regressions. The problem is that the fold_builtin* APIs document that expr is either a CALL_EXPR of the call or NULL, so using TREE_TYPE (expr) can crash e.g. during constexpr evaluation etc. As can be seen in the surrounding patch, for the neighbouring builtins (both modf and strpbrk) fold_builtin_2 passes down type, which is the result type, TREE_TYPE (TREE_TYPE (fndecl)) and those builtins use it to build the return value, while strspn was always building size_type_node and strcspn had this change from that to TREE_TYPE (expr). The patch passes type to these two and uses it there as well. The patch keeps passing expr because it is used in the check_nul_terminated_array calls done for both strspn and strcspn, those calls clearly can deal with NULL expr but prefer if it is non-NULL for some warning. 2025-03-12 Jakub Jelinek <jakub@redhat.com> PR middle-end/119204 PR middle-end/119219 * builtins.cc (fold_builtin_2): Pass type as another argument to fold_builtin_strspn and fold_builtin_strcspn. (fold_builtin_strspn): Add type argument, use it instead of size_type_node. (fold_builtin_strcspn): Add type argument, use it instead of TREE_TYPE (expr).
2025-03-12c++: Handle RAW_DATA_CST in modules.cc [PR119076]Jakub Jelinek5-0/+195
The following testcases (one with #embed, one with large initializer turned into RAW_DATA_CST) show that I forgot to handle RAW_DATA_CST in module streaming. Similar to the PCH case we need to stream out RAW_DATA_CST with NULL RAW_DATA_OWNER (i.e. a tree which has data owned by libcpp buffer) so that it will be streamed back in as STRING_CST which owns the data, but because the data can be really large (hopefully not so much for header modules though), without actually trying to build a STRING_CST on the module writing side because that would mean another large allocation and copying of the large data. RAW_DATA_CST with RAW_DATA_OWNER then needs to be streamed out and in by streaming the owner and offset from owner's data and length. 2025-03-12 Jakub Jelinek <jakub@redhat.com> PR c++/119076 * module.cc (trees_out::start): Handle RAW_DATA_CST. (trees_in::start): Likewise. (trees_out::core_vals): Likewise. (trees_in::core_vals): Likewise. * g++.dg/modules/pr119076-1_a.H: New test. * g++.dg/modules/pr119076-1_b.C: New test. * g++.dg/modules/pr119076-2_a.H: New test. * g++.dg/modules/pr119076-2_b.C: New test.
2025-03-12preprocessor: Fix up diagnostic typo in convert_oct [PR119202]Jakub Jelinek1-1/+1
In r15-4286 I've introduced a typo, part of the change was - cpp_error (pfile, CPP_DL_ERROR, "'\\o' not followed by '{'"); + cpp_error (pfile, CPP_DL_ERROR, "%<\\o%> not followed by %<}%>"); which turned { into }. This patch fixes it back. 2025-03-12 Jakub Jelinek <jakub@redhat.com> PR preprocessor/119202 * charset.cc (convert_oct): Fix up typo in diagnostics about \o not followed by {.
2025-03-12Daily bump.GCC Administrator12-1/+430
2025-03-11Revert "[rtl-optimization/117467] Avoid unnecessarily marking things live in ↵Jeff Law1-12/+0
ext-dce" This reverts commit 4ed07a11ee2845c2085a3cd5cff043209a452441.
2025-03-11c: Don't emit -Wunterminated-string-initialization warning for ↵Jakub Jelinek2-1/+125
multi-dimensional nonstring array initializers [PR117178] My/Kees' earlier patches adjusted -Wunterminated-string-initialization warning so that it doesn't warn about initializers of nonstring decls and that nonstring attribute is allowed on multi-dimensional arrays. Unfortunately as this testcase shows, we still warn about initializers of multi-dimensional array nonstring decls. The problem is that in that case field passed to output_init_element is actually INTEGER_CST, index into the array. For RECORD_OR_UNION_TYPE_P (constructor_type) field is a FIELD_DECL which we want to use, but otherwise (in arrays) IMHO we want to use constructor_fields (which is the innermost FIELD_DECL whose part is being initialized), or - if that is NULL - constructor_decl, the whole decl being initialized with multi-dimensional array type. 2025-03-11 Jakub Jelinek <jakub@redhat.com> PR c/117178 * c-typeck.cc (output_init_element): Pass field to digest_init only for record/union types, otherwise pass constructor_fields if non-NULL and constructor_decl if constructor_fields is NULL. * gcc.dg/Wunterminated-string-initialization-2.c: New test.
2025-03-11cobol: Regenerate libgcobol/config.h.hJakub Jelinek1-0/+3
I forgot to regenerate config.h.in when changing configure.ac. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * config.h.in: Regenerate.
2025-03-11aarch64: Fix DFP constants [PR119131]Andrew Pinski3-12/+43
After r15-6660-g45d306a835cb3f865, in some cases DFP constants would cause an ICE. This is due to do a mismatch of a few things. The predicate of the move uses aarch64_valid_fp_move to say if the constant is valid or not. But after reload/LRA when can_create_pseudo_p returns false; aarch64_valid_fp_move would return false for constants that were valid for the constraints of the instruction. A strictor predicate compared to the constraint is wrong. In this case `Uvi` is the constraint while aarch64_valid_fp_move allows it via aarch64_can_const_movi_rtx_p for !DECIMAL_FLOAT_MODE_P, there is no such check for DECIMAL_FLOAT_MODE_P. The fix is to remove the check !DECIMAL_FLOAT_MODE_P in aarch64_valid_fp_move and in the define_expand. As now the predicate allows a superset of what is allowed by the constraints. aarch64_float_const_representable_p should be rejecting DFP modes as they can't be used with instructions like `mov s0, 1.0`. Changes since v1: * v2: Add check to aarch64_float_const_representable_p for DFP. Built and tested on aarch64-linux-gnu with no regressions. PR target/119131 gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_valid_fp_move): Remove check for !DECIMAL_FLOAT_MODE_P. (aarch64_float_const_representable_p): Reject decimal floating modes. * config/aarch64/aarch64.md (mov<mode>): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/torture/pr119131-1.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2025-03-11c++: constexpr caching deleted pointer [PR119162]Jason Merrill2-2/+40
In this testcase, we pass the checks for mismatched new/delete because the pointer is deleted before it is returned. And then a subsequent evaluation uses the cached value, but the deleted heap var isn't in ctx->global->heap_vars anymore, so cxx_eval_outermost_constant_expr doesn't run find_heap_var_refs, and ends up with garbage. Fixed by not caching a reference to deleted. I considered rejecting such a reference immediately as non-constant, but I don't think that's valid; an invalid pointer value isn't UB until we try to do something with it or it winds up in the final result of constant evaluation. I also considered not caching other heap references (i.e. using find_heap_var_refs instead of adding find_deleted_heap_var), which would include heap pointers passed in from the caller, but those don't have the same heap_vars problem. We might want cxx_eval_outermost_constant_expr to prune constexpr_call entries that refer to objects created during the evaluation, but that applies to local variables and temporaries just as much as heap "variables". PR c++/119162 gcc/cp/ChangeLog: * constexpr.cc (find_deleted_heap_var): New. (cxx_eval_call_expression): Don't cache a reference to heap_deleted. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/constexpr-new26.C: New test.
2025-03-11MAINTAINERS: Add myselfBob Dubner1-0/+3
ChangeLog: * MAINTAINERS: Add myself.
2025-03-11OpenMP/C: Store location in cp_parser_omp_var_list for kind=0 [PR118579]Sandra Loosemore2-22/+39
This patch is the C equivalent of commit r15-6512-gcf94ba812ca496 for C++, to improve the location information for individual items in an OpenMP variable list. gcc/c/ChangeLog PR c/118579 * c-parser.cc (c_parser_omp_variable_list): Capture location information when KIND is OMP_CLAUSE_ERROR. (c_parser_oacc_data_clause_deviceptr): Use the improved location for diagnostics, and remove the FIXME. (c_finish_omp_declare_variant): Likewise. (c_parser_omp_threadprivate): Likewise. gcc/testsuite/ChangeLog PR c/118579 * c-c++-common/gomp/pr118579.c: New testcase.
2025-03-11doc: Fix minor grammar nit in -ftrivial-auto-var-init docsJonathan Wakely1-1/+1
gcc/ChangeLog: * doc/extend.texi (Common Variable Attributes): Fix grammar in final sentence of -ftrivial-auto-var-init description.
2025-03-11contrib: Clean up outdated parts of gcc-git-customization.shJonathan Wakely1-46/+0
It's very unlikely that anybody is still using the old remotes/$user Git repo setup and still needs this script to be able to migrate it to the remotes/users/$user structure. Simplify the script by removing those parts. This fixes an error that gets displayed in some circumstances: fatal: no such section: remote.me contrib/ChangeLog: * gcc-git-customization.sh: Delete outdated commands for migrating from very old git setups.
2025-03-11d: Fix regression returning from function with invariants [PR119139]Iain Buclaw2-1/+25
An optimization was added in GDC-12 which sets the TREE_READONLY flag on all local variables with the storage class `const' assigned. For some reason, const is also being added by the front-end to `__result' variables in non-virtual functions, which ends up getting wrong code by the gimplify pass promoting the local to static storage. A bug has been raised upstream, as this looks like an error in the AST. For now, turn off setting TREE_READONLY on all result variables. PR d/119139 gcc/d/ChangeLog: * decl.cc (get_symbol_decl): Don't set TREE_READONLY for __result declarations. gcc/testsuite/ChangeLog: * gdc.dg/pr119139.d: New test.
2025-03-11testsuite: Improve builtin-bswap-5.cOscar Gustafsson1-3/+3
gcc/testsuite/ChangeLog * gcc.dg/builtin-bswap-5.c: Improve test vector to avoid nibble swaps passing.
2025-03-11Fortran: reject SAVE of a COMMON in a BLOCK construct [PR119199]Harald Anlauf4-1/+35
PR fortran/119199 gcc/fortran/ChangeLog: * decl.cc (gfc_match_save): Reject SAVE statement of a COMMON block when in a BLOCK construct. * trans-common.cc (translate_common): Avoid NULL pointer dereference. gcc/testsuite/ChangeLog: * gfortran.dg/common_30.f90: New test. * gfortran.dg/common_31.f90: New test.
2025-03-11aarch64: XFAIL pred-not-gen-[14].c [PR118956]Richard Sandiford2-4/+4
gcc.target/aarch64/sve/pred-not-gen-[14].c started failing after r15-268-g9dbff9c05520a74e, but we didn't look at it in time for GCC 15. This patch marks the failures as expected for now. We should revisit for GCC 16. See the PR for some discussion about what a GCC 16 fix might look like. gcc/testusite/ PR target/118956 * gcc.target/aarch64/sve/pred-not-gen-1.c: Add XFAILs. * gcc.target/aarch64/sve/pred-not-gen-4.c: Likewise.
2025-03-11Abstract interfaces and dummy arguments are not global.Thomas Koenig3-3/+44
The attached patch makes sure that procedures from abstract interfaces and dummy arguments are not put into the global symbol table, and are not checked against global symbols. gcc/fortran/ChangeLog: PR fortran/119078 * frontend-passes.cc (check_against_globals): Do not check for abstract interfaces or dummy arguments. * resolve.cc (gfc_verify_binding_labels): Adjust comment. Do not put abstract interfaces or dummy argument into global namespace. gcc/testsuite/ChangeLog: PR fortran/119078 * gfortran.dg/interface_58.f90: New test.
2025-03-11aarch64: Generalise tbz_2.cRichard Sandiford1-9/+9
For many functions in tbz_2.c, it doesn't matter whether the code tests a 32-bit or a 64-bit register. g6-g8 have started testing 32-bit registers, but the others could in future too. gcc/testsuite/ * gcc.target/aarch64/tbz_2.c: Accept both 32-bit and 64-bit registers.
2025-03-11s390: fix delegitimization of addressesJuergen Christ2-0/+37
In legitimize_pic_address we create a (const (unspec ... UNSPEC_GOTENT)) in the GOT offset might be >= 4k. However, the s390_delegitimize_address does not contain a case for this scenario. gcc/ChangeLog: * config/s390/s390.cc (s390_delegitimize_address): Add missing case. gcc/testsuite/ChangeLog: * gcc.target/s390/delegitimize-1.c: New test. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2025-03-11Fix a pasto in ao_compare::compare_ao_refsMartin Jambor1-1/+2
When reading the function ao_compare::compare_ao_refs I came accross what I believe to ba a copy-and-paste error which this patch fixes. gcc/ChangeLog: 2025-03-10 Martin Jambor <mjambor@suse.cz> * tree-ssa-alias.cc (ao_compare::compare_ao_refs): Fix a copy-and-paste error.
2025-03-11cobol: Fix up libgcobol configure [PR119216]Jakub Jelinek7-16/+245
Sorry, seems I've screwed up the earlier libgcobol/configure.tgt change. Looking in more detail, the way e.g. libsanitizer/configure.tgt works is that it is sourced twice, once at toplevel and there it just sets UNSUPPORTED=1 for fully unsupported triplets, and then inside of libsanitizer/configure where it decides to include or not include the various sublibraries depending on the *_SUPPORTED flags. So, the following patch attempts to do the same for libgcobol as well. The BIULD_LIBGCOBOL automake conditional was unused, this patch guards it on LIBGCOBOL_SUPPORTED as well and guards with it toolexeclib_LTLIBRARIES = libgcobol.la Also, AM_CFLAGS has been changed to AM_CXXFLAGS as there are just C++ sources in the library. 2025-03-11 Jakub Jelinek <jakub@redhat.com> PR cobol/119216 * configure.ac: Check for UNSUPPORTED set by libgcobol/configure.tgt rather than LIBGCOBOL_SUPPORTED. * configure: Regenerate. libgcobol/ * configure.tgt: On fully unsupported targets set UNSUPPORTED=1. * configure.ac: Add AC_CHECK_SIZEOF([void *]), source in configure.tgt and set BUILD_LIBGCOBOL also based on LIBGCOBOL_SUPPORTED. * Makefile.am (toolexeclib_LTLIBRARIES): Conditionalize on BUILD_LIBGCOBOL. (AM_CFLAGS): Rename to ... (AM_CXXFLAGS): ... this. (%.lo: %.cc): Use $(AM_CXXFLAGS) rather than $(AM_CFLAGS). * configure: Regenerate. * Makefile.in: Regenerate.
2025-03-11contrib: Add cobol to bug_components.Jakub Jelinek1-0/+1
Without this we can't commit anything refering to cobol/NNNNNN PRs. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * gcc-changelog/git_commit.py (bug_components): Add cobol.
2025-03-11cobol: libgcobol/Makefile.am cleanupsJakub Jelinek2-146/+5
Looking at libgcobol.la, I see a lot of cruft, stuff that just shouldn't be there because automake generates it otherwise right, but also stuff using undefined variables etc. libgcobol.{a,so*} seems to build and install the same as before. Note, I stull see DT_RUNPATH in the installed libgcobol.so.1 before/after this patch and I'd prefer not to see it, not seeing it in other libraries like libstdc++.so.6 etc. Dunno if that is because of the dependency on libstdc++ (but e.g. libstdc++ has dependency on libgcc_s and doesn't do that). 2025-03-11 Jakub Jelinek <jakub@redhat.com> * Makefile.am: Remove tons of VAR = @VAR@ style lines. (libgcobol.la): Remove. (libgcobol_la_LFLAGS): Remove. (all): Remove. (.PHONY): Remove. (install): Remove. (%.lo: %.c): Remove. (doc): Remove. (install-html install-pdf install-info): Remove. * Makefile.in: Regenerate.
2025-03-11i386: Verify that argument registers are spilled properlyH.J. Lu2-0/+27
While working on a local x86 patch, which passed the GCC testsuite, I got a compiler error: In function ‘paravirt_read_msr’, inlined from ‘perf_ibs_handle_irq’ at arch/x86/events/amd/ibs.c:1055:2: ./arch/x86/include/asm/paravirt_types.h:397:17: error: ‘asm’ operand has impossible constraints or there are not enough registers 397 | asm volatile(ALTERNATIVE(PARAVIRT_CALL, ALT_CALL_INSTR, \ | ^~~ when building x86-64 Linux kernel. RDI, RSI, RDX and RCX registers are used to pass arguments in 64-bit mode. EAX, EDX and ECX registers are used to pass arguments in 32-bit mode. But there is no coverage in the GCC testsuite. Add tests to verify that argument registers are spilled properly. PR target/119171 * gcc.target/i386/pr119171-1.c: New test. * gcc.target/i386/pr119171-2.c: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-03-11dwarf2out: Fix up DW_AT_language for COBOLJakub Jelinek1-1/+1
Seems the LANG_HOOKS_NAME change for COBOL broke debug info, in particular instead of DW_LANG_Cobol85 it is now DW_LANG_C. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * dwarf2out.cc (gen_compile_unit_die): Use DW_LANG_Cobol85 if language_string is "GCC COBOL" rather than "Cobol".
2025-03-11middle-end/119204 - ICE with strcspn foldingRichard Biener2-2/+16
The following makes sure to convert the folded expression to the original expression type. PR middle-end/119204 * builtins.cc (fold_builtin_strcspn): Preserve the original expression type. * gcc.dg/pr119204.c: New testcase.
2025-03-11arm: testsuite: fix arm_neon_h checks with conflicting cpu/archRichard Earnshaw1-1/+2
GCC will complain if the -mcpu flag specifies a different architecture to that specified in -march, but if the floating-point ABI is "soft", then differences in the floating-point architecture features are ignored. However, the arm_libc_fp_abi checks whether we change the FP ABI by adding -mfloat-abi=hard/softfp to override the defaults. If that fails it won't add anything. Unfortunately arm_neon_h_ok wasn't correctly checking whether the libc check had worked and just assumed that it would always add something to enable FP. That's insufficient and we need to consider this failure. We simply mark tests as unsupported in this case. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_arm_neon_h_ok_nocache): Return zero if check_effective_target_arm_libc_fp_abi_ok reports failure.
2025-03-11One more libgcobol/configure.tgt tweakJakub Jelinek1-3/+0
On Tue, Mar 11, 2025 at 10:45:09AM +0100, Andreas Schwab wrote: > I think that makes the x32 match obsolete. You're right. I've already committed the patch, so here is incremental one. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * configure.tgt: Remove x86_64-*-linux*x32 special case.
2025-03-11Fixup gcobol driver handling of -print-* optionsRichard Biener1-0/+12
We are not supposed to diagnose missing input files. gcc/cobol/ * gcobolspec.cc (lang_specific_driver): For OPT_print_* do not error on no input files.
2025-03-11configure, Darwin: Require explicit selection of COBOL.Iain Sandoe2-2/+8
By defult, Darwin does not have sufficient tools to build COBOL so we do not want to include it in --enable-languages=all since this will break regular testing of all supported languages. However, we do want to be able to build it on demand (where the build system has sufficiently new tools) and so do not want to disable it permanently. ChangeLog: * configure: Regenerate. * configure.ac: Do not build COBOL on Darwin by default, even for --enable-languages=all. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-11cobol: Fix --enable-link-serialization buildJakub Jelinek1-6/+9
--enable-link-serialization relies on each FE participating properly, setting <lang>.serial, depending on $(<lang>.prev) and printing progress. The configure option is mainly for LTO bootstraps when we don't want to link all the FEs at once because that can consume too much memory. The comment changes are unrelated, just something I've spotted while working on this. .exe is a Windows suffix, so either we shouldn't talk about suffixes in the comments or use there $(exeext) as well to make it clear that it is dependent on the host/build. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * Make-lang.in: Remove .exe extension from comments. (cobol.serial): Set to cobol1$(exeext). (cobol1$(exeext)): Depend on $(cobol.prev). Add LINK_PROGRESS calls before/after the link command.
2025-03-11cobol: Use *.cc suffix for bison/flex generated C++ filesJakub Jelinek1-10/+10
In GCC 12 we've switched to using *.cc suffixes for C++ sources in GCC sources, including generated files, instead of using *.c suffixes and compiling them as C++ anyway (that was the case since we've switched GCC to C++ in GCC 4.8). I've noticed gcc/cobol has 3 generated files still with c extension despite clearly having C++ code in it and being compiled as C++. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * Make-lang.in (cobol/parse.c, cobol/cdf.c, cobol/scan.c): Remove. (cobol/parse.cc, cobol/cdf.cc, cobol/scan.cc): New goals. (cobol/cdf.o): Depend on cobol/cdf.cc rather than cobol/cdf.c. (cobol/parse.o): Depend on cobol/parse.cc rather than cobol/parse.c. (cobol/scan.o): Depend on cobol/scan.cc rather than cobol/scan.c, on cobol/cdf.cc rather than cobol/cdf.c and on cobol/parse.cc rather than cobol/parse.c. (cobol.srcextra): Depend on cobol/parse.cc cobol/cdf.cc cobol/scan.cc rather than cobol/parse.c cobol/cdf.c cobol/scan.c.
2025-03-11Make libgcobol/configure.tgt more similar to other librariesJakub Jelinek1-3/+7
When we know libgcobol is unsupported on 32-bit arches, we should just say so in configure.tgt, the same way as on other targets. 2025-03-11 Jakub Jelinek <jakub@redhat.com> * configure.tgt: Only set LIBGCOBOL_SUPPORTED for lp64 multilibs of powerpc64le-*-linux* and x86_64-*-linux*. Handle i?86-*-linux* the same as x86_64-*-linux*.
2025-03-11tree: Improve skip_simple_arithmetic [PR119183]Jakub Jelinek2-1/+25
The following testcase takes very long time to compile, because skip_simple_arithmetic decides to first call tree_invariant_p on the second argument (and indirectly recurse there). I think before canonicalization of operands for commutative binary expressions (and for non-commutative ones always) it is pretty common that the first operand is a constant, something which tree_invariant_p handles immediately, so the following patch special cases that; I've added there a tree_invariant_p call too after the checks, while it is not really needed currently, tree_invariant_p has the same checks, I wanted to be prepared in case tree_invariant_p changes. But if you think I should avoid it, I can drop it too. This is just a partial fix, I think one can certainly construct a testcase which will still have horrible compile time complexity (but I've tried and haven't managed to do so), so perhaps we should just limit the recursion depth through skip_simple_arithmetic/tree_invariant_p with some defaulted argument. 2025-03-11 Jakub Jelinek <jakub@redhat.com> PR c/119183 * tree.cc (skip_simple_arithmetic): If first operand of binary expr is TREE_CONSTANT or TREE_READONLY with no side-effects, call tree_invariant_p on that operand first instead of on the second. * gcc.dg/pr119183.c: New test.
2025-03-11complex: Don't DCE unused COMPLEX_EXPRs for -O0 [PR119190]Jakub Jelinek2-4/+22
The PR116463 r15-3128 change regressed the following testcase at -O0. While for -O1+ we can do -fvar-tracking-assignments, for -O0 we don't (partly because it is compile time expensive and partly because at -O0 most of the vars live most of their lifetime in memory slots), so if we DCE some statements, it can mean that DW_AT_location for some vars won't be available or even it won't be possible to put a breakpoint at some particular line in the source. We normally perform dce just in the subpasses of pass_local_optimization_passes or pass_all_optimizations or pass_all_optimizations_g, so don't do that at all for -O0. So the complex change is an exception. And it was described as a way to help forwprop and reassoc, neither applies to -O0. This regresses PR119120 again though, I'll post a patch for that momentarily. 2025-03-11 Jakub Jelinek <jakub@redhat.com> PR debug/119190 * tree-complex.cc (update_complex_assignment, tree_lower_complex): Perform simple dce on dce_worklist only if optimize. * gfortran.dg/guality/pr119190.f90: New test.
2025-03-11s390: Deprecate ESA/390 supportStefan Schulze Frielinghaus26-10/+34
Deprecate support for the ESA/390 architecture which will be eventually removed, and encourage the usage of the z/Architecture instead. Furthermore, default for -m31 to -mzarch whereas previously we defaulted to -mesa. gcc/ChangeLog: * config.gcc: Fail in case of option --with-mode=esa. * config/s390/s390.cc (s390_option_override_internal): Default to z/Architecture mode. * config/s390/s390.h (DRIVER_SELF_SPECS): Ditto. * config/s390/s390.opt: Emit a warning for option -mesa. * doc/invoke.texi: Document the change. gcc/testsuite/ChangeLog: * gcc.target/s390/20020926-1.c: Deal with deprecation warning. * gcc.target/s390/dwarfregtable-1.c: Ditto. * gcc.target/s390/fp2int1.c: Ditto. * gcc.target/s390/pr102222.c: Ditto. * gcc.target/s390/pr106355-3.c: Ditto. * gcc.target/s390/pr61078.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-10.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-12.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-14.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-18.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-2.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-20.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-22.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-24.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-26.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-28.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-30.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-32.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-4.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-6.c: Ditto. * gcc.target/s390/target-attribute/tattr-m31-8.c: Ditto.
2025-03-11s390: Implement TARGET_INSN_COST [PR115835]Stefan Schulze Frielinghaus1-0/+22
Currently insn_cost() only considers the source part of a SET. Implement TARGET_INSN_COST in order to also take the destination into account. This may make a difference in case of a MEM where the address is a SYMBOL_REF. Fixes testsuite/gcc.target/s390/section-anchors.c. gcc/ChangeLog: PR target/115835 * config/s390/s390.cc (s390_insn_cost): Implement. (TARGET_INSN_COST): Define.
2025-03-11tree-optimization/119166 - ICE with --param vect-force-slp=0Richard Biener1-1/+1
The following fixes a missing guard on slp_node in get_load_store_type. PR tree-optimization/119166 * tree-vect-stmts.cc (get_load_store_type): Guard SLP tree access.
2025-03-11Update update_web_docs_git for cobolJames K. Lowden1-0/+29
maintainer-scripts/ * update_web_docs_git: Add libgcobol module and cobol language.
2025-03-11COBOL: config and build machineryJames K. Lowden4-4/+631
* Makefile.def: Add libgcobol module and cobol language. * Makefile.in: Regenerate. * configure.ac: Add libgcobol module and cobol language. * configure: Regenerate.
2025-03-11COBOL: documentation updates for gcobolJames K. Lowden6-22/+84
gcc/ * doc/contrib.texi: Update for gcobol. * doc/frontends.texi: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Likewise. * doc/sourcebuild.texi: Likewise. * doc/standards.texi: Likewise.
2025-03-11COBOL: miscJames K. Lowden3-0/+12
gcc/ * Makefile.in (installdirs): Create man3 directory. * common.opt (static-libgcobol): New driver option. * dwarf2out.cc (gen_compile_unit_die): Support Cobol as source language.
2025-03-11COBOL: FrontendJames K. Lowden49-0/+68539
gcc/cobol/ * LICENSE: New file. * Make-lang.in: New file. * config-lang.in: New file. * lang.opt: New file. * lang.opt.urls: New file. * cbldiag.h: New file. * cdfval.h: New file. * cobol-system.h: New file. * copybook.h: New file. * dts.h: New file. * exceptg.h: New file. * gengen.h: New file. * genmath.h: New file. * genutil.h: New file. * inspect.h: New file. * lang-specs.h: New file. * lexio.h: New file. * parse_ante.h: New file. * parse_util.h: New file. * scan_ante.h: New file. * scan_post.h: New file. * show_parse.h: New file. * structs.h: New file. * symbols.h: New file. * token_names.h: New file. * util.h: New file. * cdf-copy.cc: New file. * lexio.cc: New file. * scan.l: New file. * parse.y: New file. * genapi.cc: New file. * genapi.h: New file. * gengen.cc: New file. * genmath.cc: New file. * genutil.cc: New file. * cdf.y: New file. * cobol1.cc: New file. * convert.cc: New file. * except.cc: New file. * gcobolspec.cc: New file. * structs.cc: New file. * symbols.cc: New file. * symfind.cc: New file. * util.cc: New file. * gcobc: New file. * gcobol.1: New file. * gcobol.3: New file. * help.gen: New file. * udf/stored-char-length.cbl: New file.