public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27799]  New: adding unused char field inhibits optimization
@ 2006-05-29 17:49 dann at godzilla dot ics dot uci dot edu
  2006-05-29 18:50 ` [Bug tree-optimization/27799] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2006-05-29 17:49 UTC (permalink / raw)
  To: gcc-bugs

For this code:

struct X {double m; int x;};
struct Y {int y; short d;};
struct YY {int y; short d; char c;};

int foo(struct X *x,  struct Y *y)
{
  x->x =  0;
  y->y =  1;
  if (x->x != 0)
    abort ();
}

int foo_no(struct X *x,  struct YY *y)
{
  x->x =  0;
  y->y =  1;
  if (x->x != 0)
    abort ();
}

the "if" does not get optimized away (by the dom1 pass) for the "foo_no"
function, but it is optimized for "foo" 
The only difference between the 2 functions is that foo_no takes as a parameter
a pointer to a struct that has a "char" field that is not accessed in this
function.

It would be nice if both functions were optimized in the same way.


-- 
           Summary: adding unused char field inhibits optimization
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2008-04-23 14:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 17:49 [Bug tree-optimization/27799] New: adding unused char field inhibits optimization dann at godzilla dot ics dot uci dot edu
2006-05-29 18:50 ` [Bug tree-optimization/27799] " pinskia at gcc dot gnu dot org
2006-05-30 12:41 ` rguenth at gcc dot gnu dot org
2008-03-04 20:36 ` rguenth at gcc dot gnu dot org
2008-03-04 21:00 ` rguenth at gcc dot gnu dot org
2008-03-04 21:20 ` dann at godzilla dot ics dot uci dot edu
2008-03-04 21:23 ` rguenth at gcc dot gnu dot org
2008-03-04 21:33 ` dann at godzilla dot ics dot uci dot edu
2008-03-04 21:35 ` rguenther at suse dot de
2008-03-04 21:43 ` dann at godzilla dot ics dot uci dot edu
2008-04-23 14:10 ` rguenth at gcc dot gnu dot org
2008-04-23 14:10 ` rguenth at gcc dot gnu dot 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).