public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/22156] New: [4.0/4.1 Regression] bit-field copying regressed
@ 2005-06-23  5:02 pinskia at gcc dot gnu dot org
  2005-06-23  5:04 ` [Bug middle-end/22156] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-23  5:02 UTC (permalink / raw)
  To: gcc-bugs

Take the following code:
struct s
{
  int i1:1;
  int i2:1;
  int i3:1;
};
void f(struct s *x, struct s *y) { *x = *y; }

In 3.4.0 (and currently with the C++ compiler too), we were able to get optimal code:
        movl    8(%esp), %eax
        movl    (%eax), %edx
        movl    4(%esp), %eax
        movl    %edx, (%eax)
        ret

But in (and after) 4.0.0 and the C compiler we get:
f:
        pushl   %esi
        pushl   %ebx
        movl    16(%esp), %eax
        movl    12(%esp), %esi
        movzbl  (%eax), %eax
        movb    %al, %dl
        movb    %al, %bl
        salb    $5, %al
        sarb    $7, %al
        movzbl  %al, %ecx
        movl    (%esi), %eax
        salb    $6, %dl
        andl    $1, %ecx
        sarb    $7, %dl
        movzbl  %dl, %edx
        salb    $7, %bl
        andl    $-7, %eax
        sall    $2, %ecx
        andl    $1, %edx
        sarb    $7, %bl
        addl    %edx, %edx
        orl     %ecx, %eax
        orl     %edx, %eax
        movzbl  %bl, %edx
        andl    $1, %edx
        andl    $-2, %eax
        orl     %edx, %eax
        movl    %eax, (%esi)
        popl    %ebx
        popl    %esi
        ret

Which is much worse

-- 
           Summary: [4.0/4.1 Regression] bit-field copying regressed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 19466
             nThis:


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


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

end of thread, other threads:[~2005-10-30 23:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-23  5:02 [Bug middle-end/22156] New: [4.0/4.1 Regression] bit-field copying regressed pinskia at gcc dot gnu dot org
2005-06-23  5:04 ` [Bug middle-end/22156] " pinskia at gcc dot gnu dot org
2005-06-23  5:11 ` pinskia at gcc dot gnu dot org
2005-06-23  5:34 ` pinskia at gcc dot gnu dot org
2005-06-23 13:09 ` kazu at cs dot umass dot edu
2005-06-23 13:18 ` pluto at agmk dot net
2005-06-23 19:49 ` pinskia at gcc dot gnu dot org
2005-07-04 10:26 ` pinskia at gcc dot gnu dot org
2005-07-04 10:32 ` pinskia at gcc dot gnu dot org
2005-07-08  1:44 ` mmitchel at gcc dot gnu dot org
2005-08-05 20:45 ` pinskia at gcc dot gnu dot org
2005-09-14 17:35 ` pinskia at gcc dot gnu dot org
2005-09-15 14:27 ` pinskia at gcc dot gnu dot org
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-22156-6528@http.gcc.gnu.org/bugzilla/>
2005-10-13 21:06 ` pinskia at gcc dot gnu dot org
2005-10-27 20:32 ` pinskia at gcc dot gnu dot org
2005-10-30 23:32 ` 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).