------- Comment #9 from pinskia at gcc dot gnu dot org  2006-09-25 17:03 -------
(In reply to comment #8)
> I think the real problem is in this example a is written to the stack and not
> optimised away. For the original test case the lazy stack cleanup would 
> explain
> the multiple assignments.

You are partly correct.  What is happening is that we don't optimize memcpy at
the tree level.  So we expand to have a always in a stack slot and then we
optimize the memcpy at the rtl level (by inlining it) and the later passes are
there to do constant prop but we don't rememove the store to a even though it
is dead.  3.4.0 and before used to do this via the addressof rtl which fixed
the problem by not committing a into the stack until later.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
      Known to fail|                            |4.0.0 4.1.0 4.2.0
      Known to work|                            |3.4.0
            Summary|Unnecessary use of stack    |[4.0/4.1/4.2 Regression]
                   |space                       |memcpy is not fully
                   |                            |optimized any more
   Target Milestone|---                         |4.0.4


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

Reply via email to