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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jamborm at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-07-20 
19:59:02 UTC ---
(In reply to comment #6)
> This has nothing to do with LTO - with a single compilation unit you can
> use -fwhole-program.  The issue is that Fortran passes parameters by reference
> and our interprocedural constant-propagation pass does not know how to deal
> with that.  The IPA SRA pass which is supposed to "fix" that decides that
> init cannot have its signature changed.  Martin, can you check why?
> I think we ought to optimize this with -O3 -fwhole-program -fno-inline.

IPA-SRA is not really an IPA pass and even with -fwhole-program it
cannot change signatures of functions which might be called from other
compilation units (without creating clones).

In the testcase, _init is called by MAIN in the following way:

  integer(kind=4) n;

  <bb 2>:
  n = 10;
  init_ (&x, &n);

Now if we could somehow propagate &10 into the actual argument of the
call statement, IPA-CP should pick it up and propagate it into the
caller.  Another alternative is to construct an aggregate jump
function for it when we have them.  I'll keep this testcase in mind
when working on them.

Reply via email to