https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119229
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:d109ad5e96ee9d31cbab0bba385fb490275a9937 commit r15-8020-gd109ad5e96ee9d31cbab0bba385fb490275a9937 Author: Richard Biener <rguent...@suse.de> Date: Wed Mar 12 13:46:14 2025 +0100 cobol/119229 - fix external variable declaration 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.