public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates
@ 2011-06-30 22:18 jamborm at gcc dot gnu.org
  2011-12-16  0:46 ` [Bug tree-optimization/49599] " pinskia at gcc dot gnu.org
  2011-12-16  9:20 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jamborm at gcc dot gnu.org @ 2011-06-30 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: FRE/DSE not performing well on aggregates
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jamborm@gcc.gnu.org


In the following testcase:

struct S
{
  int i;
  unsigned short f1;
  char f2;
  unsigned short f3[2], f4;
};

int foo (struct S *p)
{
  struct S l;

  l = *p;
  l.i++;
  *p = l;
}

in which SRA does not do total scalarization because of the array in
the aggregate (we do it only for structures), the optimized dump looks
like this:

foo (struct S * p)
{
  int l$i;
  struct S l;
  int D.1967;

<bb 2>:
  l = *p_1(D);
  l$i_6 = p_1(D)->i;
  D.1967_3 = l$i_6 + 1;
  *p_1(D) = l;
  p_1(D)->i = D.1967_3;
  return;
}

The loads and stores from and to l should be eliminated, probably by
FRE and DSE.


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

* [Bug tree-optimization/49599] FRE/DSE not performing well on aggregates
  2011-06-30 22:18 [Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates jamborm at gcc dot gnu.org
@ 2011-12-16  0:46 ` pinskia at gcc dot gnu.org
  2011-12-16  9:20 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-16  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization, TREE
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-16
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-16 00:43:05 UTC ---
Confirmed.


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

* [Bug tree-optimization/49599] FRE/DSE not performing well on aggregates
  2011-06-30 22:18 [Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates jamborm at gcc dot gnu.org
  2011-12-16  0:46 ` [Bug tree-optimization/49599] " pinskia at gcc dot gnu.org
@ 2011-12-16  9:20 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-16  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-16 09:18:40 UTC ---
FRE does not handle removal of redundant aggregate stores, so it does not
remove the aggregate assignment

  *p_1(D) = l;

DSE does not handle redundant store removal either, and the store is
obviously not dead.

I think SRA should remove the aggregate store.


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

end of thread, other threads:[~2011-12-16  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 22:18 [Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates jamborm at gcc dot gnu.org
2011-12-16  0:46 ` [Bug tree-optimization/49599] " pinskia at gcc dot gnu.org
2011-12-16  9:20 ` rguenth 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).