https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100509
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:cd712310edc2ffeec8982ba5f9aeaa0b14e93cf1 commit r10-9921-gcd712310edc2ffeec8982ba5f9aeaa0b14e93cf1 Author: Richard Biener <rguent...@suse.de> Date: Tue May 11 10:58:35 2021 +0200 middle-end/100509 - avoid folding constant to aggregate type When folding a constant initializer looking through aliases to incompatible types can lead to us trying to fold a constant to an aggregate type which can't work. Simply avoid trying to constant fold non-register typed symbols. 2021-05-11 Richard Biener <rguent...@suse.de> PR middle-end/100509 * gimple-fold.c (fold_gimple_assign): Only call get_symbol_constant_value on register type symbols. * gcc.dg/pr100509.c: New testcase. (cherry picked from commit ca8e8301180fa71de1a76769fc038df2ab85dfeb)