https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78201
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 40015 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40015&action=edit gcc7-pr78201.patch Untested fix. The primary bug here is in the FEs/gimplifier, they shouldn't create a TREE_STATIC artificial var with variable length size. I believe we have PRs for that though, and I think it is desirable to do the right thing even in this target hook though. There is no need to test decl != NULL again, this is all in a block guarded with if (decl && DECL_P (decl)). Furthermore, I think we shouldn't put the odd-sized stuff into section anchors. And, while max_anchor_offset is HOST_WIDE_INT, the other uses cast those to unsigned HOST_WIDE_INT anyway. Plus using DECL_SIZE and comparing against max_anchor_offset * BITS_PER_UNIT is too ugly, we already have DECL_SIZE_UNIT in bytes.