public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45214]  New: Poor initial RTL for bitfield operations
@ 2010-08-06 21:21 bernds at gcc dot gnu dot org
  2010-08-06 21:22 ` [Bug tree-optimization/45214] " bernds at gcc dot gnu dot org
  2010-08-06 21:49 ` rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: bernds at gcc dot gnu dot org @ 2010-08-06 21:21 UTC (permalink / raw)
  To: gcc-bugs

The attached testcase, from gcc's own gimplify.c, is optimized poorly at the
tree stage.  Initial RTL has

;; t_1->gsbase.plf = D.2014_8;

(insn 8 6 9 (set (reg:QI 65)
        (mem/s:QI (plus:SI (reg/v/f:SI 58 [ t ])
                (const_int 1 [0x1])) [0+1 S1 A8])) gimplify.i:48 -1
     (nil))

(insn 9 8 10 (parallel [
            (set (reg:QI 64)
                (lshiftrt:QI (reg:QI 65)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (expr_list:REG_EQUAL (lshiftrt:QI (mem/s:QI (plus:SI (reg/v/f:SI 58 [ t ])
                    (const_int 1 [0x1])) [0+1 S1 A8])
            (const_int 3 [0x3]))
        (nil)))

(insn 10 9 11 (parallel [
            (set (reg:QI 66)
                (and:QI (reg:QI 64)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 11 10 13 (parallel [
            (set (reg:QI 67)
                (ior:QI (reg:QI 66)
                    (const_int 1 [0x1])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 13 11 14 (parallel [
            (set (reg:QI 69)
                (and:QI (reg:QI 67)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 14 13 15 (parallel [
            (set (reg:QI 70)
                (ashift:QI (reg:QI 69)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 15 14 16 (set (reg:QI 71)
        (mem/s/j:QI (plus:SI (reg/v/f:SI 58 [ t ])
                (const_int 1 [0x1])) [0+1 S1 A8])) gimplify.i:48 -1
     (nil))

(insn 16 15 17 (parallel [
            (set (reg:QI 72)
                (and:QI (reg:QI 71)
                    (const_int -25 [0xffffffe7])))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 17 16 18 (parallel [
            (set (reg:QI 73)
                (ior:QI (reg:QI 72)
                    (reg:QI 70)))
            (clobber (reg:CC 17 flags))
        ]) gimplify.i:48 -1
     (nil))

(insn 18 17 0 (set (mem/s/j:QI (plus:SI (reg/v/f:SI 58 [ t ])
                (const_int 1 [0x1])) [0+1 S1 A8])
        (reg:QI 73)) gimplify.i:48 -1
     (nil))

This is not optimized by anything unless the combiner is extended to handle
four insns.  This PR should stay open even if the combiner is improved, until
the tree optimizers handle this better.


-- 
           Summary: Poor initial RTL for bitfield operations
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernds at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/45214] Poor initial RTL for bitfield operations
  2010-08-06 21:21 [Bug tree-optimization/45214] New: Poor initial RTL for bitfield operations bernds at gcc dot gnu dot org
@ 2010-08-06 21:22 ` bernds at gcc dot gnu dot org
  2010-08-06 21:49 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bernds at gcc dot gnu dot org @ 2010-08-06 21:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bernds at gcc dot gnu dot org  2010-08-06 21:21 -------
Created an attachment (id=21427)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21427&action=view)
A testcase which shows the problem.


-- 


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


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

* [Bug tree-optimization/45214] Poor initial RTL for bitfield operations
  2010-08-06 21:21 [Bug tree-optimization/45214] New: Poor initial RTL for bitfield operations bernds at gcc dot gnu dot org
  2010-08-06 21:22 ` [Bug tree-optimization/45214] " bernds at gcc dot gnu dot org
@ 2010-08-06 21:49 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-06 21:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-08-06 21:48 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|richard dot guenther at     |rguenth at gcc dot gnu dot
                   |gmail dot com               |org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-06 21:48:55
               date|                            |


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


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

end of thread, other threads:[~2010-08-06 21:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06 21:21 [Bug tree-optimization/45214] New: Poor initial RTL for bitfield operations bernds at gcc dot gnu dot org
2010-08-06 21:22 ` [Bug tree-optimization/45214] " bernds at gcc dot gnu dot org
2010-08-06 21:49 ` rguenth 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).