This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Regimplify during inlining whenever some ADDR_EXPR loses TREE_INVARIANT because of inlining substitutions (PR middle-end/34018)

On 11/9/07, Jakub Jelinek <> wrote:
> Hi!
> When &<result>.something is inlined, the <result> in there can
> be replaced by something else which is no longer TREE_INVARIANT
> and thus the whole becomes no longer GIMPLE.  copy_bb
> handles one case of this (and recently also copy_his_for_bb),
> but as can be seen on the attached testcase the problem can be seen
> on arbitrary places within GIMPLE expressions.
> Regimplifying everything would be too costly, so fixed by adding
> a floag where copy_body_r can tell the caller copy_bb if regimplification
> should be attempted.
> Tested on x86_64-linux, ok for trunk?

This is ok.


> 2007-11-08  Jakub Jelinek  <>
>         PR middle-end/34018
>         * tree-inline.h (copy_body_data): Add regimplify field.
>         * tree-inline.c (copy_body_r): Set id->regimplify to true
>         if an TREE_INVARIANT ADDR_EXPR is no longer invariant after
>         substitutions.
>         (copy_bb): Clear id->regimplify before walk_tree, if it is
>         set afterwards, regimplify the whole statement.
>         * g++.dg/opt/inline14.C: New test.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]