On 07/16/2018 09:36 AM, Bernd Edlinger wrote:
Hi,
this fixes PR middle-end/86528.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?
Thanks -- the string_constant change also fixes bug 86532.
There is another problem in the subsequent handling of
the CONSTRUCTOR -- it ignores the non-constant VARIDX. Fixing
that is easy but unfortunately prevents many strlen calls that
could be folded from folding (and makes the newly added tests
fail). For instance:
static const char a[2][3] = { "1", "12" };
if (strlen (&a[1][i]) > 2)
abort ();
That needs some other changes to handle. Let me take care of
that.
Martin