------- Comment #6 from hubicka at gcc dot gnu dot org  2010-08-17 16:42 -------
We are not removing write only vars because richi told me that there is no
convenient way to tell aliasing that variable is write only.  It is easy to
detect for me, but bit harder to get rid of them, since at IPA pass I can't
modify body so I need to pass it down to local optimization and remove only
then.
I guess I will add the feature (detecting them and removing the statements in
transform pass). It just seemed not worth the hassle when I was looking into it
originally.

Concerning Mark's question, we briefly discussed this on IRC

So we now have

1) C++ frontend probably should not produce static constructor for empty struct
at all
2) We should be able to get rid of writes to empty structs in backend
3) Middle end should take away pure constructors
4) We should be able to optimize away write only variables

I will work on 3) and probably 4) later.

Mark, why C++ is not doing 1)? 


-- 

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal
           Keywords|missed-optimization         |


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

Reply via email to