]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Avoid duplicate streaming and Put_Image subprograms.
authorSteve Baird <baird@adacore.com>
Wed, 8 Oct 2025 22:50:58 +0000 (15:50 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 13 Nov 2025 15:36:10 +0000 (16:36 +0100)
commitd293478b7dd2ae950c06deaebc35e9aa362d2992
treede5d8c49bfe829d29bf86e516156ca40070cfe4d
parent093c03fcd015b163bf5d86dd1e7eeb08737d58fe
ada: Avoid duplicate streaming and Put_Image subprograms.

Duplicate streaming and Put_Image subprograms were being generated in some
cases where this was not intended. In most cases this only resulted in unwanted
code duplication (which, of course, is not good), but in some cases it resulted
in compilation failures with spurious "duplicate body" error messages.

gcc/ada/ChangeLog:

* exp_attr.adb: Rewrite the spec and implementation of package
Cached_Attribute_Ops so that the saved value associated with a
type in a given map is not a single subprogram but instead a
set of subprograms. Thus, the correct generation of a second subprogram
for given type for use in some other context no longer causes the
first subprogram to be forgotten. This allows more reuse and,
in particular, allows reuse in the case where generating another
copy of the subprogram would result in a compilation failure.
Update Cached_Attribute_Ops clients correspondingly.
gcc/ada/exp_attr.adb