https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121394

--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:14ad799ae1545569be158b00865f6f2f951657bd

commit r16-3117-g14ad799ae1545569be158b00865f6f2f951657bd
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Thu Aug 7 12:18:38 2025 -0700

    varasm: Redo mergeable section support [PR121438]

    We increased the switch conversion array decl alignment
    for better mergeability but it turns out that we increase
    the alignment on targets which don't support mergeable sections
    (e.g. NVPTX). Also after the fix for PR 121394, it becomes
    obvious that we can place any sized into the mergeable section
    instead of increasing the alignment.
    This implements that and now also fixes PR 121438 as we don't
    need to increase the alignment for the mergeable decls that
    were being created by the C++ front-end.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR middle-end/121438
            PR middle-end/121444
    gcc/ChangeLog:

            * output.h (MAX_ALIGN_MERGABLE): Rename to ...
            (MAX_MERGEABLE_BITSIZE): This.
            * tree-switch-conversion.cc (switch_conversion::build_one_array):
Don't
            increase the alignment.
            * varasm.cc (mergeable_string_section): Use MAX_MERGEABLE_BITSIZE
            instead of MAX_ALIGN_MERGABLE. Also replace `/ 8` with `/
BITS_PER_UNIT`.
            (mergeable_constant_section): Select the mergeable section based on
            the bitsize rather than the alignment. Make sure the align is less
            than the entity size.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Reply via email to