public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13827] New: Missed reassociation optimization
@ 2004-01-23  9:32 nathan at gcc dot gnu dot org
  2004-01-23  9:33 ` [Bug c/13827] " nathan at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-01-23  9:32 UTC (permalink / raw)
  To: gcc-bugs

The compiler doesn't appear to convert
  (a & MASK) != (b & MASK)
into
  ((a ^ b) & MASK) != 0

The former occurs a lot in flag comparisons, and (I'd expect) bitfield
comparisons.

Here is the -O2 code I get
foo:
        pushl   %ebp
        movl    %esp, %ebp
        movl    8(%ebp), %edx
        movl    12(%ebp), %eax
        andl    $65280, %eax
        andl    $65280, %edx
        cmpl    %eax, %edx
        setne   %al
        movzbl  %al, %eax
        leave
        ret

-- 
           Summary: Missed reassociation optimization
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nathan at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c/13827] Missed reassociation optimization
  2004-01-23  9:32 [Bug c/13827] New: Missed reassociation optimization nathan at gcc dot gnu dot org
@ 2004-01-23  9:33 ` nathan at gcc dot gnu dot org
  2004-01-23 16:43 ` [Bug optimization/13827] " pinskia at gcc dot gnu dot org
  2004-05-31  6:49 ` [Bug tree-optimization/13827] " pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-01-23  9:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2004-01-23 09:33 -------
Created an attachment (id=5561)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5561&action=view)
test case


-- 


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


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

* [Bug optimization/13827] Missed reassociation optimization
  2004-01-23  9:32 [Bug c/13827] New: Missed reassociation optimization nathan at gcc dot gnu dot org
  2004-01-23  9:33 ` [Bug c/13827] " nathan at gcc dot gnu dot org
@ 2004-01-23 16:43 ` pinskia at gcc dot gnu dot org
  2004-05-31  6:49 ` [Bug tree-optimization/13827] " pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-23 16:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-23 16:43 -------
Confirmed, happens on i686 but not PowerPC.  I have not looked into why yet.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |optimization
     Ever Confirmed|                            |1
           Keywords|                            |pessimizes-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-23 16:43:03
               date|                            |


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


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

* [Bug tree-optimization/13827] Missed reassociation optimization
  2004-01-23  9:32 [Bug c/13827] New: Missed reassociation optimization nathan at gcc dot gnu dot org
  2004-01-23  9:33 ` [Bug c/13827] " nathan at gcc dot gnu dot org
  2004-01-23 16:43 ` [Bug optimization/13827] " pinskia at gcc dot gnu dot org
@ 2004-05-31  6:49 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-31  6:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-30 05:12 -------
Fold should be able to do this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
          Component|rtl-optimization            |tree-optimization


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


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

end of thread, other threads:[~2004-05-30  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-23  9:32 [Bug c/13827] New: Missed reassociation optimization nathan at gcc dot gnu dot org
2004-01-23  9:33 ` [Bug c/13827] " nathan at gcc dot gnu dot org
2004-01-23 16:43 ` [Bug optimization/13827] " pinskia at gcc dot gnu dot org
2004-05-31  6:49 ` [Bug tree-optimization/13827] " 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).