On 11/10/2016 10:00 AM, Jakub Jelinek wrote:
Hi!

On arm/aarch64 we ICE because some decls that make it here has non-NULL
DECL_SIZE, which is a VAR_DECL rather than CONST_INT (or DECL_SIZE that
doesn't fit into shwi would ICE similarly).  While it is arguably a FE bug
that it creates for VLA initialization from STRING_CST such a decl,
I believe we have some PRs about it already open.
I think it won't hurt to check for the large sizes properly even in this
function though, and punt on unexpected cases, or even extremely large ones.

Bootstrapped/regtested on x86_64-linux and i686-linux, Yvan said he is going
to test on arm and/or aarch64.  Ok for trunk if the testing there passes
too?

2016-11-10  Jakub Jelinek  <ja...@redhat.com>

        PR middle-end/78201
        * varasm.c (default_use_anchors_for_symbol_p): Fix a comment typo.
        Don't test decl != NULL.  Don't look at DECL_SIZE, but DECL_SIZE_UNIT
        instead, return false if it is NULL, or doesn't fit into uhwi, or
        is larger or equal to targetm.max_anchor_offset.

        * g++.dg/opt/pr78201.C: New test.
OK.
jeff

Reply via email to