public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields
@ 2004-05-23 21:09 pinskia at gcc dot gnu dot org
  2004-05-23 21:48 ` [Bug tree-optimization/15596] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-23 21:09 UTC (permalink / raw)
  To: gcc-bugs

Source:
typedef struct {
  int a : 20;
  int b : 1;
  int c : 1;
  int d : 1;
} bitstr;

bitstr fun(int s, int l)
{
  bitstr res;
  res.a  = s;
  res.b  = 1;
  res.c  = 0;
  res.d  = l;
  return res;
}

This is caused by the nrv optimization.

-- 
           Summary: [3.5 Regression] Missed optimization with bitfields
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: critical
          Priority: P2
         Component: tree-optimization
        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
GCC target triplet: powerpc-apple-darwin


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


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

* [Bug tree-optimization/15596] [3.5 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
@ 2004-05-23 21:48 ` pinskia at gcc dot gnu dot org
  2004-05-28  7:11 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-23 21:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-22 22:38 -------
Here is the asm after the tree-ssa merge:
        lwz r0,0(r3)
        rlwimi r0,r4,12,0,19
        ori r0,r0,2048
        rlwinm r0,r0,0,22,20
        rlwimi r0,r5,9,22,22
        stw r0,0(r3)
        blr

Before the tree-ssa merge:
        slwi r4,r4,12
        ori r4,r4,2048
        rlwimi r4,r5,9,22,22
        stw r4,0(r3)
        blr

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


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


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

* [Bug tree-optimization/15596] [3.5 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
  2004-05-23 21:48 ` [Bug tree-optimization/15596] " pinskia at gcc dot gnu dot org
@ 2004-05-28  7:11 ` pinskia at gcc dot gnu dot org
  2004-06-29 18:17 ` steven at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-28  7:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-27 17:48 -------
It is much worse for x86.
(-O3 -fomit-frame-pointer)
After:
fun:
        movl    4(%esp), %eax
        movl    8(%esp), %ecx
        movl    (%eax), %edx
        andl    $1048575, %ecx
        andl    $-1048576, %edx
        orl     %ecx, %edx
        movl    %edx, (%eax)
        movzbl  2(%eax), %edx
        orb     $16, %dl
        andb    $-33, %dl
        movb    %dl, 2(%eax)
        movl    12(%esp), %ecx
        movl    (%eax), %edx
        andl    $1, %ecx
        sall    $22, %ecx
        andl    $-4194305, %edx
        orl     %ecx, %edx
        movl    %edx, (%eax)
        ret     $4
Before:
        pushl   %ebp
        andl    $-1048576, %ecx
        movl    %esp, %ebp
        movl    12(%ebp), %edx
        movl    8(%ebp), %eax
        andl    $1048575, %edx
        orl     %edx, %ecx
        movl    16(%ebp), %edx
        orl     $1048576, %ecx
        andl    $-6291457, %ecx
        andl    $1, %edx
        sall    $22, %edx
        orl     %edx, %ecx
        movl    %ecx, (%eax)
        popl    %ebp
        ret     $4

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
 GCC target triplet|powerpc-apple-darwin        |
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-27 17:48:51
               date|                            |


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


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

* [Bug tree-optimization/15596] [3.5 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
  2004-05-23 21:48 ` [Bug tree-optimization/15596] " pinskia at gcc dot gnu dot org
  2004-05-28  7:11 ` pinskia at gcc dot gnu dot org
@ 2004-06-29 18:17 ` steven at gcc dot gnu dot org
  2004-06-29 18:33 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-06-29 18:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-06-29 18:10 -------
This seems to have been fixed, somewhere, somehow. 

-- 


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


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

* [Bug tree-optimization/15596] [3.5 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-29 18:17 ` steven at gcc dot gnu dot org
@ 2004-06-29 18:33 ` pinskia at gcc dot gnu dot org
  2005-02-11 13:50 ` [Bug tree-optimization/15596] [4.0 " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-29 18:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-29 18:19 -------
Yes and fixed on powerpc-apple-darwin too. hmm seems like nrv not working on some structs or 
something else going funny.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug tree-optimization/15596] [4.0 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-06-29 18:33 ` pinskia at gcc dot gnu dot org
@ 2005-02-11 13:50 ` pinskia at gcc dot gnu dot org
  2005-02-11 14:12 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 13:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-11 05:39 -------
We are now back to what we were with the tree-ssa.  Darn.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug tree-optimization/15596] [4.0 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-02-11 13:50 ` [Bug tree-optimization/15596] [4.0 " pinskia at gcc dot gnu dot org
@ 2005-02-11 14:12 ` pinskia at gcc dot gnu dot org
  2005-02-13  0:59 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 14:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-11 05:42 -------
On PPC we get now:
        lwz r0,0(r3)
        rlwimi r0,r5,9,22,22
        rlwinm r0,r0,0,22,20
        ori r0,r0,2048
        rlwimi r0,r4,12,0,19
        stw r0,0(r3)
        blr

(but note it was much worse a little while back with 20050113:
_fun:
        lwz r0,0(r3)
        slwi r5,r5,7
        extsb r5,r5
        slwi r4,r4,12
        rlwimi r0,r5,10,22,22
        rlwinm r0,r0,0,22,20
        ori r0,r0,2048
        rlwimi r0,r4,0,0,19
        stw r0,0(r3)
        blr
)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
           Priority|P2                          |P3
   Last reconfirmed|2004-05-27 17:48:51         |2005-02-11 05:42:10
               date|                            |


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


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

* [Bug tree-optimization/15596] [4.0 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-02-11 14:12 ` pinskia at gcc dot gnu dot org
@ 2005-02-13  0:59 ` pinskia at gcc dot gnu dot org
  2005-04-21  5:00 ` [Bug tree-optimization/15596] [4.0/4.1 " mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-13  0:59 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW


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


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-02-13  0:59 ` pinskia at gcc dot gnu dot org
@ 2005-04-21  5:00 ` mmitchel at gcc dot gnu dot org
  2005-04-25  1:09 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-21  5:00 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-04-21  5:00 ` [Bug tree-optimization/15596] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2005-04-25  1:09 ` pinskia at gcc dot gnu dot org
  2005-06-24 20:08 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-25  1:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-25 01:09 -------
*** Bug 21198 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matt at 3am-software dot com


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


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2005-04-25  1:09 ` pinskia at gcc dot gnu dot org
@ 2005-06-24 20:08 ` pinskia at gcc dot gnu dot org
  2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-24 20:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-24 20:08 -------
Actually this is another SRA issue.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-04-16 17:01:49         |2005-06-24 20:08:01
               date|                            |


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


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2005-06-24 20:08 ` pinskia at gcc dot gnu dot org
@ 2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
  2005-09-25 11:37 ` bonzini at gcc dot gnu dot org
  2005-09-27 16:16 ` mmitchel at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-08  1:34 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=15596


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
@ 2005-09-25 11:37 ` bonzini at gcc dot gnu dot org
  2005-09-27 16:16 ` mmitchel at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-09-25 11:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-09-25 11:37 -------
Does this mean that 22156 is a dup of this (or viceversa)?

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


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


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

* [Bug tree-optimization/15596] [4.0/4.1 Regression] Missed optimization with bitfields
  2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2005-09-25 11:37 ` bonzini at gcc dot gnu dot org
@ 2005-09-27 16:16 ` mmitchel at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:16 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=15596


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

end of thread, other threads:[~2005-09-27 16:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-23 21:09 [Bug tree-optimization/15596] New: [3.5 Regression] Missed optimization with bitfields pinskia at gcc dot gnu dot org
2004-05-23 21:48 ` [Bug tree-optimization/15596] " pinskia at gcc dot gnu dot org
2004-05-28  7:11 ` pinskia at gcc dot gnu dot org
2004-06-29 18:17 ` steven at gcc dot gnu dot org
2004-06-29 18:33 ` pinskia at gcc dot gnu dot org
2005-02-11 13:50 ` [Bug tree-optimization/15596] [4.0 " pinskia at gcc dot gnu dot org
2005-02-11 14:12 ` pinskia at gcc dot gnu dot org
2005-02-13  0:59 ` pinskia at gcc dot gnu dot org
2005-04-21  5:00 ` [Bug tree-optimization/15596] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-04-25  1:09 ` pinskia at gcc dot gnu dot org
2005-06-24 20:08 ` pinskia at gcc dot gnu dot org
2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
2005-09-25 11:37 ` bonzini at gcc dot gnu dot org
2005-09-27 16:16 ` mmitchel 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).