public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57361] New: Remove self memory assignment
@ 2013-05-21 19:10 glisse at gcc dot gnu.org
  2013-05-22  8:35 ` [Bug tree-optimization/57361] " rguenth at gcc dot gnu.org
  2013-06-13 19:47 ` glisse at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-05-21 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57361
           Summary: Remove self memory assignment
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

Hello,

as noticed in PR 57303, tree level optimizations don't remove self memory
assignments:

typedef struct A{long l,m,n,o,p;} A;
void f(A*x){
  *x=*x;
}

compiled with -O3 still has the assignment in the .optimized dump.

I suggested removing statements where rhs is tcc_reference and
operand_equal_p(lhs,rhs), but Richard warns: "The obvious place would be dead
store elimination.  But beware that the above, if not _literally_ being *p = *p
can be changing the effective type of the memory location and thus might be not
dead in terms of type-based aliasing rules (which basically means that we need
to do sth more clever than just removing the store)."


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-13 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 19:10 [Bug tree-optimization/57361] New: Remove self memory assignment glisse at gcc dot gnu.org
2013-05-22  8:35 ` [Bug tree-optimization/57361] " rguenth at gcc dot gnu.org
2013-06-13 19:47 ` glisse at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).