------- Comment #2 from jakub at gcc dot gnu dot org  2010-01-27 08:39 -------
The question is why we can't inline it, when clearly 4.4 branch can inline it
just fine.
The 4.4 comment says:
      /* We cannot inline a function of the form

           void F (int i) { struct S { int ar[i]; } s; }

         Attempting to do so produces a catch-22.
         If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
         UNION_TYPE nodes, then it goes into infinite recursion on a
         structure containing a pointer to its own type.  If it doesn't,
         then the type node for S doesn't get adjusted properly when
         F is inlined.

         ??? This is likely no longer true, but it's too late in the 4.0
         cycle to try to find out.  This should be checked for 4.1.  */
As 4.4 walk_tree didn't end up with endless recursion on it, I wonder whether
we just can't remove this.  Note that inlining functions that return variably
modified type might still be problematic, but that's order of magnitude rarer
(especially because I think most of GCCs so far ICEd on such code).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42874

Reply via email to