public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23302] New: extra move generated on x86
@ 2005-08-09 22:05 dann at godzilla dot ics dot uci dot edu
  2005-08-10  0:06 ` [Bug target/23302] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-09 22:05 UTC (permalink / raw)
  To: gcc-bugs

Compiling:

typedef char Boolean;
typedef unsigned char Char;
typedef Char *ScrnPtr;
typedef ScrnPtr *ScrnBuf;

typedef struct _WidgetRec *Widget;


typedef struct {
  int foo [1000];
  int max_col;
  int max_row;
  Widget scrollWidget;
  int savelines;
  ScrnBuf visbuf;
  ScrnBuf allbuf;
  Char *sbuf_address;
} TScreen;

typedef struct _XtermWidgetRec {
  TScreen screen;
  int num_ptrs;
}  *XtermWidget;


extern ScrnBuf Allocate (int nrow, int ncol, Char **addr);

extern XtermWidget term;

void
VTallocbuf(void)
{
  TScreen *screen = &term->screen;
  int nrows = screen->max_row + 1;

  if (screen->scrollWidget)
    nrows += screen->savelines;
  screen->allbuf = Allocate(nrows, screen->max_col + 1,
			    &screen->sbuf_address);
  if (screen->scrollWidget)
    screen->visbuf = &screen->allbuf[term->num_ptrs * screen->savelines];
  else
    screen->visbuf = screen->allbuf;
  return;
}

with 4.0 and 4.1 -march=i686 -O2 generates: (the significant part of the sdiff 
is shown) 

        movl    term, %edx                                    |         movl   
term, %eax
        movl    4012(%ebx), %eax                              |         movl   
4012(%ebx), %ecx
        imull   4028(%edx), %eax                              |         movl   
4028(%eax), %eax
        leal    (%ecx,%eax,4), %eax                           |         imull  
%ecx, %eax
                                                              >         leal   
(%edx,%eax,4), %eax


note that 4.1 generates an extra movl instruction. 
This is one of the reasons for 4.1 the code size regression in PR23153.

-- 
           Summary: extra move generated on x86
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2005-10-31 18:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23302-1008@http.gcc.gnu.org/bugzilla/>
2005-10-17  9:31 ` [Bug target/23302] [4.1 Regression] extra move generated on x86 steven at gcc dot gnu dot org
2005-10-31  4:43 ` mmitchel at gcc dot gnu dot org
2005-10-31 18:15 ` hubicka at gcc dot gnu dot org
2005-08-09 22:05 [Bug rtl-optimization/23302] New: " dann at godzilla dot ics dot uci dot edu
2005-08-10  0:06 ` [Bug target/23302] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-28 16:52 ` hubicka at gcc dot gnu dot org
2005-09-28 16:52 ` hubicka at gcc dot gnu dot org
2005-09-28 17:30 ` dann at godzilla dot ics dot uci dot edu

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