public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14814] New: Dead stores not eliminated
@ 2004-04-01 22:58 dalej at gcc dot gnu dot org
  2004-04-01 23:35 ` [Bug optimization/14814] " pinskia at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: dalej at gcc dot gnu dot org @ 2004-04-01 22:58 UTC (permalink / raw)
  To: gcc-bugs

The dead stores to the stack in foo are not eliminated until the RTL optimizers.
This is derived from the eon SPECmark, and similar constructs are common in C++.
13952 is related, but not the same.

class YY { public:
  YY(const YY &v) { e[0] = v.e[0]; e[1] = v.e[1]; e[2] = v.e[2]; }
  double &y() { return e[1]; }
  double e[3];  };

class XX { public:
  YY direction() const { return v; }
  YY v;  };

int foo(XX& r) {
  if (r.direction().y() < 0.000001) return 0;
  return 1; }

Here is a C variant (from Andrew Pinski) where the RTL optimizers aren't good enough:

struct YY {
  double e[3];  };

static inline double *y(struct YY* this_1) { return &this_1->e[1]; }

struct XX {
  struct YY v;
 };

static inline struct YY direction (const struct  XX* this_1) { return this_1->v;}

int foo(const struct XX* r) {
  struct YY t = direction(r);
  if (*y(&t) < 0.000001) return 0;
  return 1;
}

-- 
           Summary: Dead stores not eliminated
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: dnovillo at gcc dot gnu dot org
        ReportedBy: dalej at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.2.0
  GCC host triplet: powerpc-apple-darwin7.2.0
                    powerpc-apple-darwin7.2.0
GCC target triplet: powerpc-apple-darwin7.2.0


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


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

end of thread, other threads:[~2005-05-18 21:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-01 22:58 [Bug optimization/14814] New: Dead stores not eliminated dalej at gcc dot gnu dot org
2004-04-01 23:35 ` [Bug optimization/14814] " pinskia at gcc dot gnu dot org
2004-05-24 20:00 ` [Bug rtl-optimization/14814] SRA does not happen on arrays in structs pinskia at gcc dot gnu dot org
2004-08-23  1:29 ` [Bug rtl-optimization/14814] no folding back to ARRAY_REF for COMPONENT_REF pinskia at gcc dot gnu dot org
2004-08-23  3:21 ` [Bug tree-optimization/14814] " pinskia at gcc dot gnu dot org
2004-08-23  4:13 ` pinskia at gcc dot gnu dot org
2004-08-25 22:19 ` pinskia at gcc dot gnu dot org
2004-09-01  0:50 ` [Bug tree-optimization/14814] no folding back to ARRAY_REF pinskia at gcc dot gnu dot org
2004-09-03  9:34 ` pinskia at gcc dot gnu dot org
2004-09-15  4:47 ` pinskia at gcc dot gnu dot org
2005-05-17 16:35 ` law at redhat dot com
2005-05-18 20:37 ` jsm28 at gcc dot gnu dot org
2005-05-18 20:44 ` pinskia at gcc dot gnu dot org
2005-05-18 20:51 ` joseph at codesourcery dot com
2005-05-18 21:01 ` pinskia at physics dot uc dot edu
2005-05-18 21:18 ` law at redhat dot com

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).