public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/19201] New: [m68k] Inefficient code for array accesses  (from old PROBLEMS)
@ 2004-12-30 12:15 steven at gcc dot gnu dot org
  2004-12-31 13:32 ` [Bug target/19201] " schwab at suse dot de
  2004-12-31 14:58 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 16+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-12-30 12:15 UTC (permalink / raw)
  To: gcc-bugs

Item 10 from the old PROBLEMS file (no test case available):

----------------------------------------
        movl a3@,a0
        movl a3@(16),a1
        clrb a0@(a1:l)

is generated and may be worse than

        movl a3@,a0
        addl a3@(16),a0
        clrb a0@

If ordering of operands is improved, many more such cases will be
generated from typical array accesses.
----------------------------------------

-- 
           Summary: [m68k] Inefficient code for array accesses  (from old
                    PROBLEMS)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
  2004-12-30 12:15 [Bug target/19201] New: [m68k] Inefficient code for array accesses (from old PROBLEMS) steven at gcc dot gnu dot org
@ 2004-12-31 13:32 ` schwab at suse dot de
  2004-12-31 14:58 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 16+ messages in thread
From: schwab at suse dot de @ 2004-12-31 13:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-12-31 13:32 -------
Test case (see also 
<http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01109.html>): 
 
struct X { 
  char *a; 
  /* other members */ 
  int b; 
}; 
 
void f (struct X *x) 
{ 
  x->a[x->b] = 0; 
} 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schwab at suse dot de


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
  2004-12-30 12:15 [Bug target/19201] New: [m68k] Inefficient code for array accesses (from old PROBLEMS) steven at gcc dot gnu dot org
  2004-12-31 13:32 ` [Bug target/19201] " schwab at suse dot de
@ 2004-12-31 14:58 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-31 14:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-31 14:58 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
 GCC target triplet|                            |m68k-*-*
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-31 14:58:01
               date|                            |


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-02-26 12:33 ` mikpe at it dot uu.se
@ 2011-02-28 12:37 ` mikpe at it dot uu.se
  4 siblings, 0 replies; 16+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-28 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-28 12:04:32 UTC ---
(In reply to comment #14)
> I'll try Kazu's patch in my next 4.4 bootstrap/regtest.

Kazu's patch appears to have been for a 4.2 code base.  I forward-ported it to
4.4.5, where it fixed the test case in a cross compiler, but unfortunately
broke native bootstrap:

gengtype-lex.c: In function 'yy_get_next_buffer':
gengtype-lex.c:1663: warning: old-style function definition
gengtype-lex.c: In function 'yy_get_previous_state':
gengtype-lex.c:1795: warning: old-style function definition
gengtype-lex.c: In function 'yylex':
gengtype-lex.c:1652: error: unrecognizable insn:
(insn 2783 2782 1738 243 gengtype-lex.c:1784 (set (mem:QI (reg:SI 1 %d1
[orig:121 yy_n_chars.68 ] [121]) [0 S1 A8])
        (const_int 0 [0x0])) -1 (nil))
gengtype-lex.c:1652: internal compiler error: in extract_insn, at recog.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [build/gengtype-lex.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir44/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir44'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir44'
make: *** [bootstrap] Error 2


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-02-26  3:44 ` steven at gcc dot gnu.org
@ 2011-02-26 12:33 ` mikpe at it dot uu.se
  2011-02-28 12:37 ` mikpe at it dot uu.se
  4 siblings, 0 replies; 16+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-26 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #14 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-26 11:35:50 UTC ---
(In reply to comment #13)
> Also fine, not closed. Great to see that you pay enough attention to stop the
> reporter from closing his own PRs. I wish you would be just as fast with
> actually doing something about them. It is not even clear whether these
> problems still exist!

The missed optimization still occurs with gcc-4.6, which generates:

f:
        move.l 4(%sp),%a0
        move.l (%a0),%a1
        move.l 4(%a0),%d0
        clr.b (%a1,%d0.l)
        rts
        .size   f, .-f
        .ident  "GCC: (GNU) 4.6.0 20110219 (experimental)"

I'll try Kazu's patch in my next 4.4 bootstrap/regtest.


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
  2011-02-25 23:13 ` steven at gcc dot gnu.org
  2011-02-25 23:58 ` schwab@linux-m68k.org
@ 2011-02-26  3:44 ` steven at gcc dot gnu.org
  2011-02-26 12:33 ` mikpe at it dot uu.se
  2011-02-28 12:37 ` mikpe at it dot uu.se
  4 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu.org @ 2011-02-26  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED

--- Comment #13 from Steven Bosscher <steven at gcc dot gnu.org> 2011-02-26 00:17:54 UTC ---
Also fine, not closed. Great to see that you pay enough attention to stop the
reporter from closing his own PRs. I wish you would be just as fast with
actually doing something about them. It is not even clear whether these
problems still exist!

If this still not OK with you, I suggest you do something about these 15+ years
old problems, or close these and re-file under your own account. They may not
bother you but I don't want them anymore in my list.


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
  2011-02-25 23:13 ` steven at gcc dot gnu.org
@ 2011-02-25 23:58 ` schwab@linux-m68k.org
  2011-02-26  3:44 ` steven at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2011-02-25 23:58 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

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

--- Comment #12 from Andreas Schwab <schwab@linux-m68k.org> 2011-02-25 23:58:09 UTC ---
Not a reason to close them.


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
@ 2011-02-25 23:13 ` steven at gcc dot gnu.org
  2011-02-25 23:58 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu.org @ 2011-02-25 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #11 from Steven Bosscher <steven at gcc dot gnu.org> 2011-02-25 23:12:26 UTC ---
No response from m68k maintainers for almost 2.5 years.
This just clutters my bug searches. WONTFIX seems the most logical "way out".


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2008-09-21 13:22 ` steven at gcc dot gnu dot org
@ 2010-02-12 22:01 ` steven at gcc dot gnu dot org
  7 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-02-12 22:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from steven at gcc dot gnu dot org  2010-02-12 22:01 -------
Waiting for a m68k maintainer to do something here...


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2008-09-03  2:06 ` pinskia at gcc dot gnu dot org
@ 2008-09-21 13:22 ` steven at gcc dot gnu dot org
  2010-02-12 22:01 ` steven at gcc dot gnu dot org
  7 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-09-21 13:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from steven at gcc dot gnu dot org  2008-09-21 13:21 -------
Andreas, could you adopt the patch of comment #4 and see if it still fixes this
bug?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|kazu at gcc dot gnu dot org |unassigned at gcc dot gnu
                   |                            |dot org


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2007-12-17  8:12 ` steven at gcc dot gnu dot org
@ 2008-09-03  2:06 ` pinskia at gcc dot gnu dot org
  2008-09-21 13:22 ` steven at gcc dot gnu dot org
  2010-02-12 22:01 ` steven at gcc dot gnu dot org
  7 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-03  2:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2008-09-03 02:05 -------
This should not have been in waiting as it was waiting on a developer response
and not the reporter.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Last reconfirmed|2006-02-26 19:52:26         |2008-09-03 02:05:25
               date|                            |


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-11-22 17:43 ` kazu at gcc dot gnu dot org
@ 2007-12-17  8:12 ` steven at gcc dot gnu dot org
  2008-09-03  2:06 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-12-17  8:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from steven at gcc dot gnu dot org  2007-12-17 08:12 -------
Kazu, plans with this bug, and your patch for it?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-11-21 23:07 ` schwab at suse dot de
@ 2005-11-22 17:43 ` kazu at gcc dot gnu dot org
  2007-12-17  8:12 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-11-22 17:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from kazu at gcc dot gnu dot org  2005-11-22 17:42 -------
Andreas,

Thanks for spotting the typo.  I also updated the patch to ensure that
we are giving an address register indirect to clr.


-- 


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
  2005-11-19 21:52 ` kazu at gcc dot gnu dot org
  2005-11-20  0:22 ` kazu at gcc dot gnu dot org
@ 2005-11-21 23:07 ` schwab at suse dot de
  2005-11-22 17:43 ` kazu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: schwab at suse dot de @ 2005-11-21 23:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from schwab at suse dot de  2005-11-21 23:07 -------
The comment in the patch has a typo: clr.b (%a0) should be clr.b (%a1).


-- 


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
  2005-11-19 21:52 ` kazu at gcc dot gnu dot org
@ 2005-11-20  0:22 ` kazu at gcc dot gnu dot org
  2005-11-21 23:07 ` schwab at suse dot de
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-11-20  0:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kazu at gcc dot gnu dot org  2005-11-20 00:22 -------
Created an attachment (id=10299)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10299&action=view)
Patch

With this patch, I get:

f:
        move.l 4(%sp),%a0
        move.l (%a0),%a1
        add.l 4(%a0),%a1
        clr.b (%a1)
        rts


-- 

kazu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |kazu at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug target/19201] [m68k] Inefficient code for array accesses  (from old PROBLEMS)
       [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
@ 2005-11-19 21:52 ` kazu at gcc dot gnu dot org
  2005-11-20  0:22 ` kazu at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-11-19 21:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kazu at gcc dot gnu dot org  2005-11-19 21:52 -------
FWIW, the mainline gcc with -O2 -fomit-frame-pointer produces

f:
        move.l 4(%sp),%a0
        move.l (%a0),%a1
        move.l 4(%a0),%a0
        clr.b (%a0,%a1.l)
        rts


-- 

kazu at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2011-02-28 12:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-30 12:15 [Bug target/19201] New: [m68k] Inefficient code for array accesses (from old PROBLEMS) steven at gcc dot gnu dot org
2004-12-31 13:32 ` [Bug target/19201] " schwab at suse dot de
2004-12-31 14:58 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19201-280@http.gcc.gnu.org/bugzilla/>
2005-11-19 21:52 ` kazu at gcc dot gnu dot org
2005-11-20  0:22 ` kazu at gcc dot gnu dot org
2005-11-21 23:07 ` schwab at suse dot de
2005-11-22 17:43 ` kazu at gcc dot gnu dot org
2007-12-17  8:12 ` steven at gcc dot gnu dot org
2008-09-03  2:06 ` pinskia at gcc dot gnu dot org
2008-09-21 13:22 ` steven at gcc dot gnu dot org
2010-02-12 22:01 ` steven at gcc dot gnu dot org
     [not found] <bug-19201-4@http.gcc.gnu.org/bugzilla/>
2011-02-25 23:13 ` steven at gcc dot gnu.org
2011-02-25 23:58 ` schwab@linux-m68k.org
2011-02-26  3:44 ` steven at gcc dot gnu.org
2011-02-26 12:33 ` mikpe at it dot uu.se
2011-02-28 12:37 ` mikpe at it dot uu.se

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).