public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/15184] [3.4/4.0/4.1 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
@ 2005-10-14 17:44 ` wilson at gcc dot gnu dot org
  2005-10-30 22:26 ` mmitchel at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-10-14 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from wilson at gcc dot gnu dot org  2005-10-14 17:44 -------
The cause of this problem is the following two lines in the i386.c file
const int x86_himode_math = ~(m_PPRO);
const int x86_promote_hi_regs = m_PPRO;

They were added here:
    http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00890.html

The reason for this is, as a previous comment mentioned, that HImode
instructions are slow on the pentiumpro and should be avoided.  Doing this
gives better performance in general, but unfortunately, for this particular
testcase, it causes us to miss an optimization.

The issue in this case is a combiner limit.  If you compile for Pentium, you
get
  (set (reg:HI 61) (and:HI (mem/c/i:HI (symbol_ref:SI ("y")))
                           (const_int -256)))
  (set (reg:HI 63) (ior:HI (reg:HI 61)
                           (reg:HI 62)))
  (set (mem/c/i:HI (symbol_ref:SI ("y"))
       (reg:HI 63))
The combiner combines these 3 instructions to get
  (set (mem/c/i:QI (const:SI (plus:SI (symbol_ref:SI ("x"))
                                      (const_int 1 [0x1]))))
       (subreg:QI (reg:SI 59 [ c ])))

However, for pentium pro, we end up with 4 instructions due to the HImode
promotion.
  (set (reg:HI 61 [ y ])
       (mem/c/i:HI (symbol_ref:SI ("y"))))
  (set (reg:SI 62) (and:SI (subreg:SI (reg:HI 61 [ y ]) 0)
                           (const_int -256 [0xffffffffffffff00])))
  (set (reg:SI 65) (ior:SI (reg:SI 62)
                           (subreg:SI (reg:HI 63 [ c ]) 0)))                    
  (set (mem/c/i:HI (symbol_ref:SI ("y"))
        (subreg:HI (reg:SI 65) 0))

The combiner combines at most 3 instructions, to avoid combinatorial explosion,
and hence we are not able to optimize this.

I'll look at this a bit more, but at the moment, I'm skeptical that there is
any easy solution.


-- 


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


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

* [Bug target/15184] [3.4/4.0/4.1 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
  2005-10-14 17:44 ` [Bug target/15184] [3.4/4.0/4.1 Regression] Direct access to byte inside word not working with -march=pentiumpro wilson at gcc dot gnu dot org
@ 2005-10-30 22:26 ` mmitchel at gcc dot gnu dot org
  2006-03-11  3:20 ` [Bug target/15184] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-30 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from mmitchel at gcc dot gnu dot org  2005-10-30 22:26 -------
Downgraded to P5.

I don't think this missed-optimization on the Pentium Pro (now a relatively old
CPU) is release-critical, especially since we think that the change that caused
the problem was generally beneficial.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5


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


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

* [Bug target/15184] [3.4/4.0/4.1/4.2 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
  2005-10-14 17:44 ` [Bug target/15184] [3.4/4.0/4.1 Regression] Direct access to byte inside word not working with -march=pentiumpro wilson at gcc dot gnu dot org
  2005-10-30 22:26 ` mmitchel at gcc dot gnu dot org
@ 2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
  2006-06-08  8:42 ` [Bug target/15184] [4.0/4.1/4.2 " bonzini at gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug target/15184] [4.0/4.1/4.2 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-03-11  3:20 ` [Bug target/15184] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
@ 2006-06-08  8:42 ` bonzini at gnu dot org
  2007-01-18  2:55 ` [Bug target/15184] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2006-06-08  8:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from bonzini at gnu dot org  2006-06-08 08:36 -------
I would note, however, that Pentium Pro also means Pentium 2/3/M, Core, etc. 
In practice every Intel chip after the Pentium Pro, except the P4 and Nocona,
is based on that pipeline.


-- 


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


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

* [Bug target/15184] [4.0/4.1/4.2/4.3 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-06-08  8:42 ` [Bug target/15184] [4.0/4.1/4.2 " bonzini at gnu dot org
@ 2007-01-18  2:55 ` gdr at gcc dot gnu dot org
  2007-01-21 21:18 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-01-18  2:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from gdr at gcc dot gnu dot org  2007-01-18 02:55 -------
Won't fix for GCC-4.0.x


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.4                       |---


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


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

* [Bug target/15184] [4.0/4.1/4.2/4.3 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2007-01-18  2:55 ` [Bug target/15184] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
@ 2007-01-21 21:18 ` pinskia at gcc dot gnu dot org
  2007-02-14  9:28 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-21 21:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


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


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

* [Bug target/15184] [4.0/4.1/4.2/4.3 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2007-01-21 21:18 ` pinskia at gcc dot gnu dot org
@ 2007-02-14  9:28 ` mmitchel at gcc dot gnu dot org
  2007-07-01 19:52 ` rask at sygehus dot dk
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:28 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


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

* [Bug target/15184] [4.0/4.1/4.2/4.3 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2007-02-14  9:28 ` mmitchel at gcc dot gnu dot org
@ 2007-07-01 19:52 ` rask at sygehus dot dk
  2008-07-04 16:32 ` [Bug target/15184] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rask at sygehus dot dk @ 2007-07-01 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rask at sygehus dot dk  2007-07-01 19:52 -------
   This has regressed quite badly. Here's what we get with
-O2 -fomit-frame-pointer -m32 -march=pentium4:

fl:
        movzbl  %al, %eax       # 21    *zero_extendqisi2_movzbw        [length
= 3]
        movl    x, %edx # 8     *movsi_1/1      [length = 6]
        xorb    %dl, %dl        # 27    *movstrictqi_xor        [length = 2]
        orl     %edx, %eax      # 10    *iorsi_1/1      [length = 2]
        movl    %eax, x # 11    *movsi_1/2      [length = 5]
        ret     # 25    return_internal [length = 1]
fu:
        movzbl  %al, %eax       # 22    *zero_extendqisi2_movzbw        [length
= 3]
        sall    $8, %eax        # 8     *ashlsi3_1/1    [length = 3]
        movl    x, %edx # 9     *movsi_1/1      [length = 6]
        xorb    %dh, %dh        # 23    *xorqi_ext_2    [length = 2]
        orl     %edx, %eax      # 11    *iorsi_1/1      [length = 2]
        movl    %eax, x # 12    *movsi_1/2      [length = 5]
        ret     # 26    return_internal [length = 1]
gl:
        movzbl  %al, %eax       # 21    *zero_extendqihi2_movzbl        [length
= 3]
        movzwl  y, %edx # 8     *movhi_1/3      [length = 7]
        xorb    %dl, %dl        # 28    *movstrictqi_xor        [length = 2]
        orl     %edx, %eax      # 23    *iorsi_1/1      [length = 2]
        movw    %ax, y  # 11    *movhi_1/4      [length = 6]
        ret     # 26    return_internal [length = 1]
gu:
        sall    $8, %eax        # 22    *ashlsi3_1/1    [length = 3]
        movzbl  y, %edx # 23    *zero_extendqihi2_movzbl        [length = 7]
        orl     %edx, %eax      # 24    *iorsi_1/1      [length = 2]
        movw    %ax, y  # 12    *movhi_1/4      [length = 6]
        ret     # 27    return_internal [length = 1]

Likewise for -march=pentium:

fl:
        movl    x, %edx # 8     *movsi_1/1      [length = 6]
        andl    $255, %eax      # 21    *andsi_1/1      [length = 6]
        xorb    %dl, %dl        # 27    *movstrictqi_xor        [length = 2]
        orl     %edx, %eax      # 10    *iorsi_1/1      [length = 2]
        movl    %eax, x # 11    *movsi_1/2      [length = 5]
        ret     # 25    return_internal [length = 1]
fu:
        movl    x, %edx # 9     *movsi_1/1      [length = 6]
        andl    $255, %eax      # 22    *andsi_1/1      [length = 6]
        sall    $8, %eax        # 8     *ashlsi3_1/1    [length = 3]
        xorb    %dh, %dh        # 23    *xorqi_ext_2    [length = 2]
        orl     %edx, %eax      # 11    *iorsi_1/1      [length = 2]
        movl    %eax, x # 12    *movsi_1/2      [length = 5]
        ret     # 26    return_internal [length = 1]
gl:
        movw    y, %dx  # 8     *movhi_1/3      [length = 7]
        andl    $255, %eax      # 22    *andsi_1/1      [length = 6]
        xorb    %dl, %dl        # 29    *movstrictqi_xor        [length = 2]
        orl     %edx, %eax      # 24    *iorsi_1/1      [length = 2]
        movw    %ax, y  # 11    *movhi_1/4      [length = 6]
        ret     # 27    return_internal [length = 1]
gu:
        movb    %al, y+1        # 12    *movqi_1/7      [length = 5]
        ret     # 24    return_internal [length = 1]

        .ident  "GCC: (GNU) 4.3.0 20070628 (experimental)"


-- 


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


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

* [Bug target/15184] [4.2/4.3/4.4 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2007-07-01 19:52 ` rask at sygehus dot dk
@ 2008-07-04 16:32 ` jsm28 at gcc dot gnu dot org
  2009-03-31 16:18 ` [Bug target/15184] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jsm28 at gcc dot gnu dot org  2008-07-04 16:31 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3/4.4 Regression]|[4.2/4.3/4.4 Regression]
                   |Direct access to byte inside|Direct access to byte inside
                   |word not working with -     |word not working with -
                   |march=pentiumpro            |march=pentiumpro
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug target/15184] [4.3/4.4/4.5 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2008-07-04 16:32 ` [Bug target/15184] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2009-03-31 16:18 ` jsm28 at gcc dot gnu dot org
  2009-08-04 12:27 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:13 ` [Bug target/15184] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 16:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jsm28 at gcc dot gnu dot org  2009-03-31 16:17 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4/4.5 Regression]|[4.3/4.4/4.5 Regression]
                   |Direct access to byte inside|Direct access to byte inside
                   |word not working with -     |word not working with -
                   |march=pentiumpro            |march=pentiumpro
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug target/15184] [4.3/4.4/4.5 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2009-03-31 16:18 ` [Bug target/15184] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:27 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:13 ` [Bug target/15184] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2009-08-04 12:26 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug target/15184] [4.3/4.4/4.5/4.6 Regression] Direct access to byte inside word not working with -march=pentiumpro
       [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2009-08-04 12:27 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:13 ` rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2010-05-22 18:10 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


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


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

end of thread, other threads:[~2010-05-22 18:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-15184-1037@http.gcc.gnu.org/bugzilla/>
2005-10-14 17:44 ` [Bug target/15184] [3.4/4.0/4.1 Regression] Direct access to byte inside word not working with -march=pentiumpro wilson at gcc dot gnu dot org
2005-10-30 22:26 ` mmitchel at gcc dot gnu dot org
2006-03-11  3:20 ` [Bug target/15184] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-06-08  8:42 ` [Bug target/15184] [4.0/4.1/4.2 " bonzini at gnu dot org
2007-01-18  2:55 ` [Bug target/15184] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-01-21 21:18 ` pinskia at gcc dot gnu dot org
2007-02-14  9:28 ` mmitchel at gcc dot gnu dot org
2007-07-01 19:52 ` rask at sygehus dot dk
2008-07-04 16:32 ` [Bug target/15184] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-03-31 16:18 ` [Bug target/15184] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:27 ` rguenth at gcc dot gnu dot org
2010-05-22 18:13 ` [Bug target/15184] [4.3/4.4/4.5/4.6 " 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).