aboutsummaryrefslogtreecommitdiff
path: root/gcc/cobol
AgeCommit message (Collapse)AuthorFilesLines
2025-03-18cobol: Avoid a use of auto.Iain Sandoe1-1/+1
In this case the deduction for Darwin's implementation is 'char *' which then conflicts with the second use of data.initial in the find_if callback. Let's just specify it as 'const char *'. gcc/cobol/ChangeLog: * util.cc (cbl_field_t::report_invalid_initial_value): Avoid auto here and specify const char *. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-18cobol: use ldirname in cdf-copy.ccJose E. Marchesi1-8/+16
This patch changes gcc/cobol/cdf-copy.cc to use the new ldirname from libibertay rather than the host's dirname. This removes an include for libgen.h. Regtested in x86_64-linux-gnu by running make check-cobol. gcc/cobol/ChangeLog * cdf-copy.cc (copybook_elem_t::open_file): Use ldirname rather than dirname.
2025-03-18cobol: Do not include C++ headers after system.h.Iain Sandoe1-6/+0
The headers mentioned in parse.y are already unconditionally included by system.h (via cobol-system.h). gcc/cobol/ChangeLog: * parse.y: Remove c++ header includes appearing after system.h. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-18Daily bump.GCC Administrator1-0/+19
2025-03-17cobol: Eliminate CPPFLAGS assignment from Make-lang.in [PR119213].Bob Dubner15-80/+82
A number of gcc/cobol files had to be modified to '#include "../../libgcobol/xxx.h" instead of "xxx.h" gcc/cobol PR cobol/119213 * Make-lang.in: Eliminate CPPFLAGS= assignment. * cdf.y: Modify #includes that reference libgcobol. * cobol1.cc: Modify #includes that reference libgcobol. * except.cc: Modify #includes that reference libgcobol. * gcobolspec.cc: Modify #includes that reference libgcobol. * genapi.cc: Modify #includes that reference libgcobol. * gengen.cc: Modify #includes that reference libgcobol. * genmath.cc: Modify #includes that reference libgcobol. * genutil.cc: Modify #includes that reference libgcobol. * parse.y: Modify #includes that reference libgcobol. * scan.l: Modify #includes that reference libgcobol. * structs.cc: Modify #includes that reference libgcobol. * symbols.cc: Modify #includes that reference libgcobol. * symfind.cc: Modify #includes that reference libgcobol. * util.cc: Modify #includes that reference libgcobol.
2025-03-15Daily bump.GCC Administrator1-0/+5
2025-03-14Prevent use of ASM_EXPR for optimized COBOL compilations [PR119214]Robert Dubner1-25/+30
The creation of assembler labels using ASM_EXPR causes name collisions in the assembly language because some optimizations repeat code, and those labels can get repeated. Use of "if( !optimize )" prevents (at least) that problem when it cropped up with "-O -ftrace" gcc/cobol: PR cobol/119214 * gengen.cc: applies if( !optimize ) test
2025-03-14Daily bump.GCC Administrator1-0/+11
2025-03-13Honor prefix and suffix when installing cobol binaries and man page.Matthias Klose1-6/+8
2025-03-13 Matthias Klose <doko@ubuntu.com> gcc/cobol/ * Make-lang.in (cobol.install-common, cobol.install-man): Honor GCOBOL_INSTALL_NAME.
2025-03-13cobol/119229 - fix external variable declarationRichard Biener1-5/+1
The following makes vs_external_reference behave like documented, declare a variable defined elsewhere which means not setting TREE_STATIC but DECL_EXTERNAL. Built on x86_64-unknown-linux-gnu, tested with the cobol.dg testsuite (which doesn't mean much). The removed comment mentions 'stderr', possibly the NIST testsuite has coverage. OK for trunk? Thanks, Richard. PR cobol/119229 * gengen.cc (gg_declare_variable): Use DECL_EXTERNAL and drop TREE_STATIC for vs_external_reference. * cobol.dg/pr119229.cob: New testcase.
2025-03-13Daily bump.GCC Administrator1-0/+12
2025-03-12Regenerate cobol/lang.opt.urlsMark Wielaard1-4/+11
With the COBOL: Frontend (commit 3c5ed996a) came a lang.opt.urls, which is different from what regenerate-opt-urls.py generates. Make the CI bot happy by regenerating it. Longer term, the COBOL docs need to be sorted out (see e.g. PR119227) and then perhaps regenerate-opt-urls.py adjusted so that it can deal with the COBOL docs. gcc/cobol/ChangeLog: * lang.opt.urls: Regenerated.
2025-03-12cobol: Remove unnecesssary CPPFLAGS update and restore MacOS buildSimon Martin1-1/+0
The build currently fails on MacOS even when the Cobol front-end and libgcobol builds are disabled. The problem is that gcc/cobol/Make-lang.in adds -Iinclude to CPPFLAGS, which somehow makes clang unhappy about the include order: error: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. This usually means that your header search paths are not configured properly. It turns out that this addition is unnecessary: simply removing it fixes the build on MacOS, without impacting the build x86_64-pc-linux-gnu when configured with --enable-languages=default,cobol. It feels like there might be more cleanup opportunities there, but they can be taken care of later. gcc/cobol/ChangeLog: * Make-lang.in: Remove unnecessary CPPFLAGS update.
2025-03-12Simple cobol.dg testsuiteRichard Biener1-0/+2
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-12Daily bump.GCC Administrator1-0/+76
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-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-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.
2025-03-10Add empty ChangeLog files for GCC COBOL.Jakub Jelinek1-0/+6