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

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Ramana Radhakrishnan from comment #4)

Setting -march=armv7-a doesn't make a difference.

The root cause is that initializers of locally defined aggregates such as

  struct { char a[N]; } S s = { "12345" };

are represented in one of two ways in GIMPLE:

a) as an assignment of the string to s.a, or
b) as a copy from a label (e.g., 's = *.LC0')

and the strlen pass only knows how to deal with (a) but not (b).

AFAICS, whether form (a) or form (b) is chosen depends on the size of the size
of the aggregate.  Some targets use a lower threshold for (b) than others.  As
far as I can see, x86_64 appears to cut over at 257 bytes, while arm-none-eabi
always uses (b).

Reply via email to