public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/33699]  New: regression, missing optimization on const addr area store
@ 2007-10-08 16:54 fshvaige at cisco dot com
  2007-12-03  3:43 ` [Bug middle-end/33699] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: fshvaige at cisco dot com @ 2007-10-08 16:54 UTC (permalink / raw)
  To: gcc-bugs

Same problem for
-0s/-02
version 4.1.0
etc...


[Code]

typedef unsigned * ptr_t;
void f (void) {
    ptr_t p = (ptr_t)0xFED0;
    p[0] = 0xDEAD;
    p[2] = 0xDEAD;
    p[4] = 0xDEAD;
    p[6] = 0xDEAD;
}


[Assembly generated by version gcc-4.3-20071005]

00000000 <f>:
   0:   3404dead        li      a0,0xdead
   4:   3402fee8        li      v0,0xfee8
   8:   3403fed0        li      v1,0xfed0
   c:   ac440000        sw      a0,0(v0)
  10:   ac640000        sw      a0,0(v1)
  14:   3402fed8        li      v0,0xfed8
  18:   3403fee0        li      v1,0xfee0
  1c:   ac440000        sw      a0,0(v0)
  20:   03e00008        jr      ra
  24:   ac640000        sw      a0,0(v1)


[Assembly generated by version 3.4.5 (seems better)]

00000000 <f>:
   0:   3403fed0        li      v1,0xfed0
   4:   3402dead        li      v0,0xdead
   8:   ac620018        sw      v0,24(v1)
   c:   ac620000        sw      v0,0(v1)
  10:   ac620008        sw      v0,8(v1)
  14:   03e00008        jr      ra
  18:   ac620010        sw      v0,16(v1)
  1c:   00000000        nop


[Version]

Using built-in specs.
Target: mips-elf
Configured with: ../gcc-4.3-20071005/configure --enable-languages=c,c++
--prefix=/auto/mipaproj/fshvaige/apps/Linux/gcc-4.3-20071005 --target=mips-elf
--program-suffix=.mips --without-headers --with-newlib
Thread model: single
gcc version 4.3.0 20071005 (experimental) (GCC) 


[Command line options]

gcc.mips -c -o main.o -v -save-temps -O3 -march=mips64 -mabi=eabi
-mexplicit-relocs main.c


-- 
           Summary: regression, missing optimization on const addr area
                    store
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fshvaige at cisco dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips-elf


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


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

* [Bug middle-end/33699] regression, missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
@ 2007-12-03  3:43 ` pinskia at gcc dot gnu dot org
  2007-12-26  1:34 ` [Bug middle-end/33699] [4.1/4.2/4.3 regression], " 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 @ 2007-12-03  3:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug middle-end/33699] [4.1/4.2/4.3 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
  2007-12-03  3:43 ` [Bug middle-end/33699] " pinskia at gcc dot gnu dot org
@ 2007-12-26  1:34 ` pinskia at gcc dot gnu dot org
  2008-01-02 23:42 ` mmitchel 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 @ 2007-12-26  1:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-12-26 01:33 -------
The issue here is that we are using constants as being free in the first place
and not being able to decompose them later on, in the RTL level.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.0.0 4.1.3 4.2.2 4.3.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-26 01:33:50
               date|                            |
            Summary|regression, missing         |[4.1/4.2/4.3 regression],
                   |optimization on const addr  |missing optimization on
                   |area store                  |const addr area store
   Target Milestone|---                         |4.1.3


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


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

* [Bug middle-end/33699] [4.1/4.2/4.3 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
  2007-12-03  3:43 ` [Bug middle-end/33699] " pinskia at gcc dot gnu dot org
  2007-12-26  1:34 ` [Bug middle-end/33699] [4.1/4.2/4.3 regression], " pinskia at gcc dot gnu dot org
@ 2008-01-02 23:42 ` mmitchel at gcc dot gnu dot org
  2008-01-07 19:30 ` steven at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-01-02 23:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug middle-end/33699] [4.1/4.2/4.3 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (2 preceding siblings ...)
  2008-01-02 23:42 ` mmitchel at gcc dot gnu dot org
@ 2008-01-07 19:30 ` steven at gcc dot gnu dot org
  2008-01-15 15:23 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-01-07 19:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from steven at gcc dot gnu dot org  2008-01-07 18:24 -------
This is related to some work done in the past for auto-increment addressing
modes (even though there are no auto-inc/dec modes in the reporter's assembly).
 See one of Joern's old patches:
http://gcc.gnu.org/ml/gcc-patches/2005-02/msg01612.html

Look at the comment before optimize_related_value() to understand what this
patch is supposed to achieve.  Let's not talk about how it achieved this -- it
suffices to say that the patch is not in the trunk -- but we really do need a
pass over RTL to optimize this kind of thing.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-12-26 01:33:50         |2008-01-07 18:24:00
               date|                            |


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


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

* [Bug middle-end/33699] [4.1/4.2/4.3 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (3 preceding siblings ...)
  2008-01-07 19:30 ` steven at gcc dot gnu dot org
@ 2008-01-15 15:23 ` rguenth at gcc dot gnu dot org
  2008-07-04 22:19 ` [Bug middle-end/33699] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-15 15:23 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal


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


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

* [Bug middle-end/33699] [4.2/4.3/4.4 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (4 preceding siblings ...)
  2008-01-15 15:23 ` rguenth at gcc dot gnu dot org
@ 2008-07-04 22:19 ` jsm28 at gcc dot gnu dot org
  2009-02-08 12:49 ` amylaar at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jsm28 at gcc dot gnu dot org  2008-07-04 22:18 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3/4.4            |[4.2/4.3/4.4 regression],
                   |regression], missing        |missing optimization on
                   |optimization on const addr  |const addr area store
                   |area store                  |
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug middle-end/33699] [4.2/4.3/4.4 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (5 preceding siblings ...)
  2008-07-04 22:19 ` [Bug middle-end/33699] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2009-02-08 12:49 ` amylaar at gcc dot gnu dot org
  2009-03-31 20:12 ` [Bug middle-end/33699] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2009-02-08 12:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from amylaar at gcc dot gnu dot org  2009-02-08 12:49 -------
(In reply to comment #2)
> This is related to some work done in the past for auto-increment addressing
> modes

Actually, the problem with constants that are loaded into registers -
and in the same basic block, at that - is much simpler.
If the targets rtx_cost works properly, then reload_cse_move2add should
fix up this code.

We need, however, some way to deal with the case where constants are expensive
addresses; this is completely broken at the moment.  Complete unrolling of
loops accessing static arrays can create oodles of constant addresses; I've
managed to split these up with LEGITIMIZE_ADDRESS, the movsi expander, and
a patch to momory_address, however, gcse just recombines the costly constants,
irrespective of what rtx_cost and address_cost says.
And the havoc that gcse can wreak transcends basic blocks, so any attempt to
clean up after if with lesser scope is bound to be inferior.


-- 

amylaar at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/33699] [4.3/4.4/4.5 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (6 preceding siblings ...)
  2009-02-08 12:49 ` amylaar at gcc dot gnu dot org
@ 2009-03-31 20:12 ` jsm28 at gcc dot gnu dot org
  2009-05-28  7:43 ` nemet at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 20:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jsm28 at gcc dot gnu dot org  2009-03-31 20:12 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4/4.5            |[4.3/4.4/4.5 regression],
                   |regression], missing        |missing optimization on
                   |optimization on const addr  |const addr area store
                   |area store                  |
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug middle-end/33699] [4.3/4.4/4.5 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (7 preceding siblings ...)
  2009-03-31 20:12 ` [Bug middle-end/33699] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-05-28  7:43 ` nemet at gcc dot gnu dot org
  2009-05-28  7:49 ` nemet at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nemet at gcc dot gnu dot org @ 2009-05-28  7:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from nemet at gcc dot gnu dot org  2009-05-28 07:43 -------
Subject: Bug 33699

Author: nemet
Date: Thu May 28 07:42:52 2009
New Revision: 147944

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147944
Log:
        PR middle-end/33699
        * target.h (struct gcc_target): Fix indentation.  Add
        const_anchor.
        * target-def.h (TARGET_CONST_ANCHOR): New macro.
        (TARGET_INITIALIZER): Use it.
        * cse.c (CHEAPER): Move it up to the other macros.
        (insert): Rename this ...
        (insert_with_costs): ... to this.  Add cost parameters.  Update
        function comment.
        (insert): New function.  Call insert_with_costs.
        (compute_const_anchors, insert_const_anchor, insert_const_anchors,
        find_reg_offset_for_const, try_const_anchors): New functions.
        (cse_insn): Call try_const_anchors.  Adjust cost of src_related
        when using a const-anchor.  Call insert_const_anchors.
        * config/mips/mips.c (mips_set_mips16_mode): Set
        targetm.const_anchor.
        * doc/tm.texi (Misc): Document TARGET_CONST_ANCHOR.

testsuite/
        * gcc.target/mips/const-anchor-1.c: New test.
        * gcc.target/mips/const-anchor-2.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/mips/const-anchor-1.c
    trunk/gcc/testsuite/gcc.target/mips/const-anchor-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/mips/mips.c
    trunk/gcc/cse.c
    trunk/gcc/doc/tm.texi
    trunk/gcc/target-def.h
    trunk/gcc/target.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/33699] [4.3/4.4/4.5 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (8 preceding siblings ...)
  2009-05-28  7:43 ` nemet at gcc dot gnu dot org
@ 2009-05-28  7:49 ` nemet at gcc dot gnu dot org
  2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nemet at gcc dot gnu dot org @ 2009-05-28  7:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from nemet at gcc dot gnu dot org  2009-05-28 07:49 -------
Note that the above patch does not yet fix the testcase.  Besides this patch we
need some more cost adjustments and also some changes in fwprop to propagate
into the address expression.


-- 


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


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

* [Bug middle-end/33699] [4.3/4.4/4.5 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (9 preceding siblings ...)
  2009-05-28  7:49 ` nemet at gcc dot gnu dot org
@ 2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
  2010-03-12 23:56 ` pinskia at gcc dot gnu dot org
  2010-05-22 18:19 ` [Bug middle-end/33699] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2009-08-04 12:28 -------
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=33699


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

* [Bug middle-end/33699] [4.3/4.4/4.5 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (10 preceding siblings ...)
  2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
@ 2010-03-12 23:56 ` pinskia at gcc dot gnu dot org
  2010-05-22 18:19 ` [Bug middle-end/33699] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-12 23:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2010-03-12 23:56 -------
PowerPC has the same issue.  X86 does not because it's move instruction can
take a constant address.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|mips-elf                    |mips*-* powerpc*-*-*
   Last reconfirmed|2008-01-07 18:24:00         |2010-03-12 23:56:39
               date|                            |


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


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

* [Bug middle-end/33699] [4.3/4.4/4.5/4.6 regression], missing optimization on const addr area store
  2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
                   ` (11 preceding siblings ...)
  2010-03-12 23:56 ` pinskia at gcc dot gnu dot org
@ 2010-05-22 18:19 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2010-05-22 18:11 -------
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=33699


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-08 16:54 [Bug target/33699] New: regression, missing optimization on const addr area store fshvaige at cisco dot com
2007-12-03  3:43 ` [Bug middle-end/33699] " pinskia at gcc dot gnu dot org
2007-12-26  1:34 ` [Bug middle-end/33699] [4.1/4.2/4.3 regression], " pinskia at gcc dot gnu dot org
2008-01-02 23:42 ` mmitchel at gcc dot gnu dot org
2008-01-07 19:30 ` steven at gcc dot gnu dot org
2008-01-15 15:23 ` rguenth at gcc dot gnu dot org
2008-07-04 22:19 ` [Bug middle-end/33699] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-02-08 12:49 ` amylaar at gcc dot gnu dot org
2009-03-31 20:12 ` [Bug middle-end/33699] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-05-28  7:43 ` nemet at gcc dot gnu dot org
2009-05-28  7:49 ` nemet at gcc dot gnu dot org
2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
2010-03-12 23:56 ` pinskia at gcc dot gnu dot org
2010-05-22 18:19 ` [Bug middle-end/33699] [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).