public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23102] New: extra XORs  generated on i686
@ 2005-07-27 22:00 dann at godzilla dot ics dot uci dot edu
  2005-07-27 22:22 ` [Bug target/23102] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-07-27 22:00 UTC (permalink / raw)
  To: gcc-bugs

Compiling the code below (extracted from xterm-202) with
 -fno-inline -O2 -march=i686

typedef unsigned int Cardinal;
typedef unsigned long Pixel;
typedef char *String;

typedef struct {
 String resource;
 Pixel value;
 int mode;
} ColorRes;

typedef struct {
 ColorRes Acolors[(256 +4)];
 int startHRow, startHCol,
   endHRow, endHCol,
   startHCoord, endHCoord;
 Cardinal selection_count;
} TScreen;

static void
ResetSelectionState(TScreen * screen)
{
    screen->selection_count = 0;
    screen->startHRow = screen->startHCol = 0;
    screen->endHRow = screen->endHCol = 0;
}

void foo (TScreen *scr)
{
  ResetSelectionState (scr);
}

generates: 
ResetSelectionState:
        pushl   %ebp
        xorl    %edx, %edx
        movl    %esp, %ebp
        xorl    %ecx, %ecx
        popl    %ebp
        movl    %edx, 3144(%eax)
        xorl    %edx, %edx
        movl    %ecx, 3124(%eax)
        xorl    %ecx, %ecx   ;; this is not needed, ecx is already 0 
        movl    %edx, 3120(%eax)
        xorl    %edx, %edx    ;; so is edx
        movl    %ecx, 3132(%eax)  
        movl    %edx, 3128(%eax)
        ret

when using -march=i386 the code looks better:

ResetSelectionState:
        pushl   %ebp
        movl    %esp, %ebp
        movl    $0, 3144(%eax)
        movl    $0, 3124(%eax)
        movl    $0, 3120(%eax)
        movl    $0, 3132(%eax)
        movl    $0, 3128(%eax)
        leave
        ret

-- 
           Summary: extra XORs  generated on i686
           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 host triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-23102-1008@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2005-10-06 12:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-27 22:00 [Bug rtl-optimization/23102] New: extra XORs generated on i686 dann at godzilla dot ics dot uci dot edu
2005-07-27 22:22 ` [Bug target/23102] " pinskia at gcc dot gnu dot org
2005-08-03 18:21 ` dann at godzilla dot ics dot uci dot edu
2005-08-04 11:55 ` rguenth at gcc dot gnu dot org
2005-08-04 17:06 ` dann at godzilla dot ics dot uci dot edu
2005-08-12  5:26 ` pinskia at gcc dot gnu dot org
     [not found] <bug-23102-1008@http.gcc.gnu.org/bugzilla/>
2005-10-06 12:48 ` pinskia 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).