[Bug tree-optimization/120702] Extraneous string constant at -Os

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 2 08:23:06 GMT 2026


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

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:1d1b64a5bdcf2a9352479fb9f6f399ac2e5b8a98

commit r17-1164-g1d1b64a5bdcf2a9352479fb9f6f399ac2e5b8a98
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 29 09:19:43 2026 +0200

    tree-optimization/120702 - avoid folding loads to STRING_CSTs

    The following avoids (large) string duplication which can happen
    when folding aggregate reads to STRING_CSTs.  There's unlikely
    to be followup optimization opportunities.

            PR tree-optimization/120702
            * gimple-fold.cc (maybe_fold_reference): Only fold
            register type reads.

            * gcc.dg/tree-ssa/pr120702.c: New testcase.


More information about the Gcc-bugs mailing list