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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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 ` pinskia at gcc dot gnu dot org
  2005-06-23  5:11 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-23  5:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-23 05:04 -------
Note this also effects PPC, though not as badly as there is only one load:
in 3.3.3:
_f:
        lwz r0,0(r4)
        stw r0,0(r3)
        blr

in 4.0.0 and above:
_f:
        lwz r11,0(r4)
        lwz r0,0(r3)
        slwi r2,r11,2
        slwi r9,r11,1
        rlwimi r0,r2,30,2,2
        rlwimi r0,r9,31,1,1
        rlwimi r0,r11,0,0,0
        stw r0,0(r3)
        blr

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.1


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-23  5:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-23 05:11 -------
The main difference between the C++ front-end and the C front-end in this respect is how they 
repesent bit-fields.
for the C++ front-end we get the following output from SRA:
Cannot scalarize variable D.1693 because its type cannot be decomposed

but for the C front-end we get:
Scan results:
D.1237: n_uses=0 n_copies=2

Initial instantiation for D.1237
Using element-copy for D.1237
  D.1237.i1 -> SR.12
  D.1237.i2 -> SR.13
  D.1237.i3 -> SR.14

So to me this looks like a SRA bug in that it should be using BIT_FIELD_REF instead if it can.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-23  5:34 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |22157


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (2 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-06-23 13:09 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kazu at cs dot umass dot edu


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (3 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pluto at agmk dot net @ 2005-06-23 13:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pluto at agmk dot net


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (4 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-23 19:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-23 19:49 -------
I have a fix, it does what I recommended in 22157.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-23 19:49:18
               date|                            |


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (5 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-04 10:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-04 10:26 -------
I am no longer working on this, this is a much harder problem than I sugested.  This is basically the 
same as PR 18268.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |18268


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (6 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-04 10:32 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (7 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-08  1:44 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.1                       |4.0.2


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (8 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-05 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-05 20:45 -------
If we add more bit-fields, that is now fixed in 4.0.2 and 4.1.0 by:
2005-08-04  Richard Henderson  <rth@redhat.com>

        PR 21529
        * params.def (PARAM_SRA_MAX_STRUCTURE_COUNT): New.
        * params.h (SRA_MAX_STRUCTURE_COUNT): New.
        * tree-sra.c (decide_block_copy): Use it.  Disable element copy
        if we'd have to instantiate too many members.

But the orginal code is not fixed as we don't have too many members.

-- 


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (9 preceding siblings ...)
  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
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-14 17:35 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 22156 depends on bug 18268, which changed state.

Bug 18268 Summary: structure copy propagation not done
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18268

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (10 preceding siblings ...)
  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
  12 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 14:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-15 14:27 -------
*** Bug 22157 has been marked as a duplicate of this bug. ***

-- 
Bug 22156 depends on bug 22157, which changed state.

Bug 22157 Summary: [4.0/4.1 Regression] struct copying code gen
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22157

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
  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
                   ` (11 preceding siblings ...)
  2005-09-15 14:27 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
  12 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:25 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
       [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
  2 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-30 23:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
   Target Milestone|4.2.0                       |4.1.0


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
       [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
  2 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-27 20:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2005-10-27 20:31 -------
Nothing can happen until 4.2.0 for this issue really as we need a real copy
prop for structs.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.2.0


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


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

* [Bug middle-end/22156] [4.0/4.1 Regression] bit-field copying regressed
       [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
  2 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-13 21:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Last reconfirmed|2005-06-23 19:49:18         |2005-10-13 21:06:28
               date|                            |


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


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

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