On Fri, Jan 12, 2018 at 09:16:35AM +0100, Richard Biener wrote:
> Or another workaround would be to make sure non-constant sizepos
> stay non-constant by doing sth like the following?  FEs can mark
> expressions as TREE_CONSTANT if they don't want this behavior
> for things that might optimize to constants during gimplification.

Not against that, though in that case perhaps it can be even just
+  if (is_gimple_constant (*expr_p))
+    *expr_p = get_initialized_tmp_var (*expr_p, stmt_p, NULL, false);
with a comment, because the function has an early exit for:
  if (is_gimple_sizepos (expr))
    return;

Would you be ok with that?  In that case I'd probably do a bootstrap/regtest
with statistics gathering on when this happens, dunno about Ada and other
FEs how often they do this kind of thing.

        Jakub

Reply via email to