]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cobol: Eliminate strict-aliasing violations. [PR121499]
authorRobert Dubner <rdubner@symas.com>
Thu, 12 Feb 2026 20:18:23 +0000 (15:18 -0500)
committerRobert Dubner <rdubner@symas.com>
Thu, 12 Feb 2026 20:38:54 +0000 (15:38 -0500)
Code violating strict aliasing has been refactored.

libgcobol is now being built with
-fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3

Copyright boilerplate has been updated to the year 2026 throughout gcc/cobol
and libgcobol.

gcc/cobol/ChangeLog:

* cbldiag.h: Copyright updated to 2026.
* cdf-copy.cc: Likewise.
* cdf.y: Likewise.
* cdfval.h: Likewise.
* cobol-system.h: Likewise.
* convert.cc: Likewise.
* copybook.h: Likewise.
* except.cc: Likewise.
* exceptg.h: Likewise.
* genapi.cc: Likewise.
* genapi.h: Likewise.
* gengen.cc: Likewise.
* gengen.h: Likewise.
* genmath.cc: Likewise.
* genmath.h: Likewise.
* genutil.cc: Likewise.
* genutil.h: Likewise.
* inspect.h: Likewise.
* lang-specs.h: Likewise.
* lexio.cc: Likewise.
* lexio.h: Likewise.
* messages.cc: Likewise.
* parse.y: Likewise.
* parse_ante.h: Likewise.
* parse_util.h: Likewise.
* scan.l: Likewise.
* scan_ante.h: Likewise.
* scan_post.h: Likewise.
* show_parse.h: Likewise.
* structs.cc: Likewise.
* structs.h: Likewise.
* symbols.cc: Likewise.
* symbols.h: Likewise.
* symfind.cc: Likewise.
* util.cc: Likewise.
* util.h: Likewise.

libgcobol/ChangeLog:

PR cobol/121499
* LICENSE: Copyright updated to 2026.
* Makefile.am: Compile with -fstrict-aliasing.
* Makefile.in: Autoreconf.
* acinclude.m4: Copyright updated to 2026.
* charmaps.cc: Likewise.
* charmaps.h: Likewise.
* common-defs.h: Likewise.
* configure.tgt: Likewise.
* constants.cc: Likewise.
* ec.h: Likewise.
* encodings.h: Likewise.
* exceptl.h: Likewise.
* gcobolio.h: Likewise.
* gfileio.cc: Likewise.
* gfileio.h: Likewise.
* gmath.cc (multiply_int256_by_int64): Eliminate aliasing.
(divide_int256_by_int64): Likewise.
(multiply_int128_by_int128): Likewise.
(divide_int128_by_int128): Likewise.
* gmath.h: Copyright updated to 2026.
* intrinsic.cc: Likewise.
* io.cc: Likewise.
* io.h: Likewise.
* libgcobol.cc: Likewise.
* libgcobol.h: Likewise.
* stringbin.cc: Likewise.
* stringbin.h: Likewise.
* valconv.cc: Likewise.
* valconv.h: Likewise.
* xmlparse.cc: Likewise.

63 files changed:
gcc/cobol/cbldiag.h
gcc/cobol/cdf-copy.cc
gcc/cobol/cdf.y
gcc/cobol/cdfval.h
gcc/cobol/cobol-system.h
gcc/cobol/convert.cc
gcc/cobol/copybook.h
gcc/cobol/except.cc
gcc/cobol/exceptg.h
gcc/cobol/genapi.cc
gcc/cobol/genapi.h
gcc/cobol/gengen.cc
gcc/cobol/gengen.h
gcc/cobol/genmath.cc
gcc/cobol/genmath.h
gcc/cobol/genutil.cc
gcc/cobol/genutil.h
gcc/cobol/inspect.h
gcc/cobol/lang-specs.h
gcc/cobol/lexio.cc
gcc/cobol/lexio.h
gcc/cobol/messages.cc
gcc/cobol/parse.y
gcc/cobol/parse_ante.h
gcc/cobol/parse_util.h
gcc/cobol/scan.l
gcc/cobol/scan_ante.h
gcc/cobol/scan_post.h
gcc/cobol/show_parse.h
gcc/cobol/structs.cc
gcc/cobol/structs.h
gcc/cobol/symbols.cc
gcc/cobol/symbols.h
gcc/cobol/symfind.cc
gcc/cobol/util.cc
gcc/cobol/util.h
libgcobol/LICENSE
libgcobol/Makefile.am
libgcobol/Makefile.in
libgcobol/acinclude.m4
libgcobol/charmaps.cc
libgcobol/charmaps.h
libgcobol/common-defs.h
libgcobol/configure.tgt
libgcobol/constants.cc
libgcobol/ec.h
libgcobol/encodings.h
libgcobol/exceptl.h
libgcobol/gcobolio.h
libgcobol/gfileio.cc
libgcobol/gfileio.h
libgcobol/gmath.cc
libgcobol/gmath.h
libgcobol/intrinsic.cc
libgcobol/io.cc
libgcobol/io.h
libgcobol/libgcobol.cc
libgcobol/libgcobol.h
libgcobol/stringbin.cc
libgcobol/stringbin.h
libgcobol/valconv.cc
libgcobol/valconv.h
libgcobol/xmlparse.cc

index 9167c563821d3b6fc79d956c0c262d7d840ad9af..07d92c0b48da6c732763748c2d530e8c19aa0857 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 11be9b818efaf1513addeb6389b11d451a793b23..304360d52570f0993e7e7bf93e783c5a54d3efff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 11dfcf5b6dbd2b82d19a6bda671c0259449c6dcf..e4f69b1627cf772c9919d37779d3ffad17c18a08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index cc474a22a48273c377fffe996708b8675c34bb4b..b9d660023700b36969233a01a153ce01478148df 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 828f4f53ec8b7b58503662f8e19b170adb8bde9a..d0a7659a2f1fee19a0c62f42e9492439de7e7925 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index a0ef9d5388d376fe34c549c95e6c618f8e603a25..7d4bf9e16e7b0f83b20a5aed74334f9770fc961b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index ff8c6d0ca27618872ae98b7dc0ad9ed62ec0f894..2b3f0a205347f713d15159fccaedd25d1b099560 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 31112d1274a4d8026ab7f08f65a7601296ac7a13..7003673d75f14e3c61a50e5493eb097821341782 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6869f220417adb99ec403d4ccb808f76496324d7..80432a04eb7e55d9f681e11436fe9b9936a4ca50 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 108fb7f38f4bd451a3da8ad315eafa380f0fc777..6f8ce1889bda9b7df7acd76de0c2354307dccbf2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 162cb572ed732061126b32f4b15d2f7de79a7242..1ae7d96bfbd2b2a78fe682e950544a9a0a92d927 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 208d49105276d0fb81bd88aca337d59504be0580..922d9844cfcb10586652db8e5bbab92e013904f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index e785ac7819af278805778c236825c016137ca6c5..0a716449d0798e23067f16a57d87878046605dce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 535a7740c093cab58824bfd0438017c4d4247711..18ba682f30b51cfe465e73b64167dfb5bf1ba120 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 9fc2fc3bdb28ac7aea2680f596a579bbefa164df..5c52381c06253ed41370c4ac0c0df01486139309 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index b384cd14939b8936f7a895d025d9d4ea10b7762b..a143080542da08f0245be04abd728e462726ee3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 251b1c11631ba7c2d29570fe23ca4db2d02fa2dc..f456f203ba577718c2ccbfcf1b17ce3deeaf4238 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 96399f5dc0103e313cb681e84f542e143b8625ee..fd2db6cef84ac4849990722f83c49f110eb81ed4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index cd27cdf68cd49d83e1146163e037b7a63d7c4e72..b84b6666e78abdb273f202b5c92ee84f3480169c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 3911dd0fc3e0ba77921fc70e40fcbe2d045c4d3e..fe4343e5d1dd1725b137d35716a7f10e857e6d6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index ba4ef0adb8e60606e91bde877576347939606498..03d97550f2b472f5dcd18a7e533c0d6acd22613a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 3f9b7735bf01420c9356520e1fb94aead7354108..9dd73e0155c8f68d9d5bc53c6ea44f81a5b2c25f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 1311797f03df8b7a281d4bd9991da9c4bf3e8354..875f7cfa23dc02bda8315d3d5783a096f6353eb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 88950a95995284bab70dbd3a5b72c81099517a3e..a89237de98855851590122703d745ee94f5df1ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 20847e3ef4692b135a3592c376d5bffbd6a52982..463ade3242c94d7c33309e4ee675602d35a56799 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index f730fc2dda917e42505ba427906ed756bc2633f2..d5ec34a468571e1e98b8462d68f71bf8bd713476 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index d2db44b13038e09281deb1890a33a13871f38aa0..2f87b1a5d6d9b9e619128a5c41d68ed5ef95ae8e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index cb729b3f9aaae0d5ed7b796b777ddbcc45e997c8..71025a220e52528be0483b84e4d5300a11dc5cbf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 3b4adad180adfd4b76d7774b32ae6a7ce44113db..e1a84dcf5ced97620d15770b3bd9ed63394a203b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 37875d22ae0440184320f3b1cf0aea5a280f9676..69cfe9bf30d0d2af059a52ea84ce51b59bd09131 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 47a78b45e9a81f78451797e98f5e54c8826fc382..d26f13f7e1de6c244b47e651740f408d1ac3d8d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 731f51afbdb09eaef1df41c86eb6f261606a6be0..ea686ab9c4ef37a5b94709776aa574c8207e6a74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 511198a870e4a2a344d41e9e7d26e27558506891..398be73f0e1430f49840ecae9f48bbbefa16453e 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 472d37a20b912ec4773d11a634f82817730ba72e..cefc560bf31b686e5491b55961563a106d47b2a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 42c67cafca80dfeeca4cfab151aa6dc5f9809247..d9978e42da14566e2d380a995d4ddcbd390109b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index d457e3ee41bcd156a0aa7d5940575d9742d5f2e6..2a4e6b7091fa836db9858e7951447f438adf7f61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 3937993c56a2cb4d086853dcc6b18c5c1857fed8..50d27a12f47dd6e5bd9deb10aa5d38fc6fa91865 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (c) 2021-2025 Symas Corporation
+Copyright (c) 2021-2026 Symas Corporation
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
index ab4cb0c3908f4d59fa82bde19b56b366c10147f4..79310647b3e62c4079f12da5f6d08fb2391914d5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2025 Free Software Foundation, Inc.
+# Copyright (C) 2026 Free Software Foundation, Inc.
 # Contributed by the Symas Corporation, 2025
 
 # This file is part of GCC.
@@ -91,8 +91,7 @@ AM_CFLAGS = $(XCFLAGS)
 AM_CXXFLAGS = $(XCFLAGS)
 AM_CXXFLAGS += $(WARN_CFLAGS)
 AM_CXXFLAGS += -DIN_TARGET_LIBS
-AM_CXXFLAGS += -fno-strict-aliasing
-#AM_CXXFLAGS += -fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3
+AM_CXXFLAGS += -fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3
 
 if ENABLE_DARWIN_AT_RPATH
 # Handle embedded rpaths for Darwin.
index a72c50f1034adc084ae3306cf5d7c6554eac80ef..fa8b7bdf4ebf8655b5978f59e853b0498847e8e4 100644 (file)
@@ -14,7 +14,7 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2025 Free Software Foundation, Inc.
+# Copyright (C) 2026 Free Software Foundation, Inc.
 # Contributed by the Symas Corporation, 2025
 
 # This file is part of GCC.
@@ -112,7 +112,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-#AM_CXXFLAGS += -fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3
 
 # Handle embedded rpaths for Darwin.
 @BUILD_LIBGCOBOL_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -Wc,-nodefaultrpaths \
@@ -459,7 +458,8 @@ gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 @BUILD_LIBGCOBOL_TRUE@ /usr/include/libxml2
 @BUILD_LIBGCOBOL_TRUE@AM_CFLAGS = $(XCFLAGS)
 @BUILD_LIBGCOBOL_TRUE@AM_CXXFLAGS = $(XCFLAGS) $(WARN_CFLAGS) \
-@BUILD_LIBGCOBOL_TRUE@ -DIN_TARGET_LIBS -fno-strict-aliasing
+@BUILD_LIBGCOBOL_TRUE@ -DIN_TARGET_LIBS -fstrict-aliasing \
+@BUILD_LIBGCOBOL_TRUE@ -Wstrict-aliasing -Wstrict-aliasing=3
 
 # We want to link with the c++ runtime.
 @BUILD_LIBGCOBOL_TRUE@libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
index 0e81b10838632f2ccad3b414a990545f9823cf35..3b03ecff2a4dc9d55807b5aef71f9197e2c6cf32 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2021-2025 Free Software Foundation, Inc.
+dnl Copyright (C) 2021-2026 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 001e29142bee6d5fa6c11c4572ee98162faab61a..8aa42e3234e9747c8f7a719de30d9b682bb710e2 100644 (file)
@@ -1,6 +1,6 @@
 // This file is included in both the libgcobol and gcc/cobol compilations
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 44e327227b6dcd6767fe79cb22b13429c46e59af..c8fa82264d1801bf3e50b648a612f40ae2b6d5c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index f4f4fca1d089c8b8a4dd8f5c5e823edbe9a1bf49..5cc341c4669c9da0cb5199639a41ec148d35858d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index a23925295b6fb0a5def242f06a636280fbed5970..310d7e0cdc4e654540234fcdcac2c0f09cbca19c 100644 (file)
@@ -1,5 +1,5 @@
 # -*- shell-script -*-
-# Copyright (C) 2025 Free Software Foundation, Inc.
+# Copyright (C) 2026 Free Software Foundation, Inc.
 #
 # GCC is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
index 75ae497be32826d9dcda7c97f0624707753a34c5..8db6e9a38e813f058be3697d4c7573395ba54f30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 4315d19ac9d0d002a552cd7ea30aa5c30a8e2166..cf92f958911551b9c014d8bb6f7344dc577adabb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7d92f2d7a0d8ea9c01074a4fc157b4d26807ce28..3a7e40cef83c17c34692dff4a946183d367162e7 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2021_2025 Symas Corporation
+ * Copyright (c) 2021_2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index dcad545912d6676a7809c1ba39659ba546c410c9..96cba8ba8473b274bf8f531e693d783f56a3b571 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 064af5bad54045a3acd32361ef1eb2b6a2b4b3cc..731b41079f70714e8e5864f2cf7e569caa0c0bad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index c6813be6ef1939318dbcb27b783a890e09d52e2f..144111ac0a650faee3e796b8d3ec16992a63434b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 36df81bb2eab6e65fefab146e8581dd62395270b..1174198be4e820ce864698148783e6cca3eba68f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index be98f7eb522c9ba7be3b7c21f24a5bcb60baca81..2078dbedca5a4aa5bc6c38ee3e353e8f36385e21 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -361,6 +361,15 @@ typedef struct int256
     };
   }int256;
 
+typedef struct int128
+  {
+  union
+    {
+    uint64_t       i64 [2];
+    uint128        i128;
+    };
+  }int128;
+
 static int
 multiply_int256_by_int64(int256 &product, const uint64_t multiplier)
   {
@@ -368,11 +377,13 @@ multiply_int256_by_int64(int256 &product, const uint64_t multiplier)
   // a factor of ten.  This is effectively left-shifting by decimal
   // digits.  See scale_int256_by_digits
   uint64_t overflows[5] = {};
+  int128 temp;
   for(int i=0; i<4; i++)
     {
-    uint128 temp = (uint128)product.i64[i] * multiplier;
-    product.i64[i] = *PTRCAST(uint64_t, &temp);
-    overflows[i+1] = *PTRCAST(uint64_t, PTRCAST(uint8_t, &temp) + 8);
+    //  cppcheck-suppress unreadVariable  // cppcheck is dumb about unions???
+    temp.i128 = (uint128)product.i64[i] * multiplier;
+    product.i64[i] = temp.i64[0];
+    overflows[i+1] = temp.i64[1];
     }
 
   for(int i=1; i<4; i++)
@@ -450,21 +461,20 @@ static void
 divide_int256_by_int64(int256 &val, uint64_t divisor)
   {
   // val needs to be a positive number
-  uint128 temp = 0;
+  int128 temp = {};
   for( int i=3; i>=0; i-- )
     {
     // Left shift temp 64 bits:
-    *PTRCAST(uint64_t, ((PTRCAST(uint8_t, &temp))+8))
-                          = *PTRCAST(uint64_t, ((PTRCAST(uint8_t, &temp))+0));
+    temp.i64[1] = temp.i64[0];
 
     // Put the high digit of val into the bottom of temp
-    *PTRCAST(uint64_t, ((PTRCAST(uint8_t, &temp))+0)) = val.i64[i];
+    temp.i64[0] = val.i64[i];
 
     // Divide that combinary by divisor to get the new digits
-    val.i64[i] = temp / divisor;
+    val.i64[i] = temp.i128 / divisor;
 
     // And the new temp is that combination modulo divisor
-    temp = temp % divisor;
+    temp.i128 = temp.i128 % divisor;
     }
   }
 
@@ -1287,10 +1297,10 @@ void multiply_int128_by_int128(int256 &ABCD,
   uint128 BD;
 
   // Let's extract the digits.
-  uint64_t a = *PTRCAST(uint64_t, (PTRCAST(unsigned char, (&ab_value))+8));
-  uint64_t b = *PTRCAST(uint64_t, (PTRCAST(unsigned char, (&ab_value))+0));
-  uint64_t c = *PTRCAST(uint64_t, (PTRCAST(unsigned char, (&cd_value))+8));
-  uint64_t d = *PTRCAST(uint64_t, (PTRCAST(unsigned char, (&cd_value))+0));
+  uint64_t a = ab_value>>64;
+  uint64_t b = ab_value;
+  uint64_t c = cd_value>>64;
+  uint64_t d = cd_value;
 
   // multiply (a0 + b) * (c0 + d)
 
@@ -1703,27 +1713,28 @@ divide_int128_by_int128(int256   &quotient,
 
       // Now we multiply our 64-bit guess by the 128-bit CD to get the
       // three-place value we are going to subtract from the numerator area.
-
-      uint64_t subber[3];
-      subber[2] = 0;
+      // We use the bottom three i64[] places of an int256 structure to hold
+      // that three-place value
+      int256 subber;
+      subber.i64[2] = 0;
 
       // Start with the bottom 128 bits of the "subber"
-      *PTRCAST(uint128, subber) = (uint128) divisor64[0] * quotient.i64[q_place];
+      subber.i128[0] = (uint128) divisor64[0] * quotient.i64[q_place];
 
       // Get the next 128 bits of subber
       temp = (uint128) divisor64[1] * quotient.i64[q_place];
 
       // Add the top of the first product to the bottom of the second:
-      subber[1] += temp64[0];
+      subber.i64[1] += temp64[0];
 
       // See if there was an overflow:
-      if( subber[1] < temp64[0] )
+      if( subber.i64[1] < temp64[0] )
         {
         // There was an overflow
-        subber[2] = 1;
+        subber.i64[2] = 1;
         }
       // And now put the top of the second product into place:
-      subber[2] += temp64[1];
+      subber.i64[2] += temp64[1];
 
       // "subber" is now the three-place product of the two-place divisor times
       // the one-place guess
@@ -1738,13 +1749,13 @@ divide_int128_by_int128(int256   &quotient,
           {
           // We are subtracting from zero and we have a borrow.  Leave the
           // borrow on and just do the subtraction:
-          numerator.i64[q_place + j] -= subber[j];
+          numerator.i64[q_place + j] -= subber.i64[j];
           }
         else
           {
           uint64_t stash = numerator.i64[q_place + j];
           numerator.i64[q_place + j] -= borrow;
-          numerator.i64[q_place + j] -= subber[j];
+          numerator.i64[q_place + j] -= subber.i64[j];
           if( numerator.i64[q_place + j] > stash )
             {
             // After subtracting, the value got bigger, which means we have
@@ -1775,14 +1786,14 @@ divide_int128_by_int128(int256   &quotient,
             {
             // We are at the top and have a carry.  Just leave the carry on
             // and do the addition:
-            numerator.i64[q_place + ii] += subber[ii];
+            numerator.i64[q_place + ii] += subber.i64[ii];
             }
           else
             {
             // We are not at the top.
             uint64_t stash = numerator.i64[q_place + ii];
             numerator.i64[q_place + ii] += carry;
-            numerator.i64[q_place + ii] += subber[ii];
+            numerator.i64[q_place + ii] += subber.i64[ii];
             if( numerator.i64[q_place + ii] < stash )
               {
               // The addition caused the result to get smaller, meaning that
index 9aa8f635f4a414bda70a4084c253d2b01b54480d..4c022cacacac1085b35af4c6d7176ee712fc7b3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index af8f3ac42c0e35e75cbfbd577da0208cce4a2122..680db5a5289993cd67f99a104adb92f3457dfd6f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 9b07309b90e95c9536c3b2fb023ccbd3b1aa300f..e5ce01d2ca2c2771bb25b35eeb095e3e9329619b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 0c89ad6d0c927cc3a4ad4b16af08673f8ce391c6..77cae1f3ab897fc697b538c250601b2455fa9232 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 3cc13e3458927804b2e1ecc3f811b7b4a6170748..81accd93f71fc2de813986fbb84968bfc5d48989 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index e4d0ab9fd78a7ae6e867cfd0aba29168303509da..4c2a26d7eff9c2653492f428342d9ba2de4794d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 713bc59f8634de8992bb507f0898537657aa493d..ed762507a65ffb870935ff7e01719fa470816c38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 0f30a9ff701c75824f37801465d08e4725ebff38..b4b2238884f15ac4b9125bf7187f205f9cbf11e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index ef5faae576c6b47b96245852a2aa554ba2b31d64..388db5aee0c10ed4a75180764751490971bde936 100644 (file)
@@ -1,6 +1,6 @@
 // This file is included in both the libgcobol and gcc/cobol compilations
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index 7b2c415830d9f128714facf1801db22419473a5d..d9c4b11a44a54296b1e6ac37e741187d3d4ddbcf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
index f1e0794fee79fddcfd4127dc468853f1f15f4051..8ad189d102a09fecc8c88c8049a16e7b28e4e079 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2025 Symas Corporation
+ * Copyright (c) 2021-2026 Symas Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are