public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59371] New: Performance regression in GCC 4.8 and later versions.
@ 2013-12-02 17:59 sje at gcc dot gnu.org
  2013-12-03  9:37 ` [Bug target/59371] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: sje at gcc dot gnu.org @ 2013-12-02 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59371
           Summary: Performance regression in GCC 4.8 and later versions.
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sje at gcc dot gnu.org
            Target: mips*-*-*

If I compile this program with -O2 on MIPS:

int foo(int *p, unsigned short c)
{
    signed short i;
    int x = 0;
    for (i = 0; i < c; i++) {
        x = x + *p; p++;
    }
    return x;
}

With GCC 4.7.* or earlier I get loop code that looks like:

$L3:
    lw    $5,0($4)
    addiu    $3,$3,1
    seh    $3,$3
    addu    $2,$2,$5
    bne    $3,$6,$L3
    addiu    $4,$4,4

With GCC 4.8 and later I get:

$L3:
    lw    $7,0($4)
    addiu    $3,$3,1
    seh    $3,$3
    slt    $6,$3,$5
    addu    $2,$2,$7
    bne    $6,$0,$L3
    addiu    $4,$4,4

This loop has one more instruction in it and is slower.
A version of this bug appears in EEMBC 1.1.  If I change the loop
index to be unsigned then I get the better code but I can't change
the benchmark I am testing so I am trying to figure out what changed
in GCC and how to generate the faster code.


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

end of thread, other threads:[~2023-07-07 10:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-02 17:59 [Bug target/59371] New: Performance regression in GCC 4.8 and later versions sje at gcc dot gnu.org
2013-12-03  9:37 ` [Bug target/59371] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-12-03 16:42 ` sje at gcc dot gnu.org
2013-12-03 23:10 ` pinskia at gcc dot gnu.org
2013-12-04  1:49 ` macro@linux-mips.org
2013-12-04  1:52 ` pinskia at gcc dot gnu.org
2013-12-05 11:12 ` rguenth at gcc dot gnu.org
2013-12-05 23:43 ` macro@linux-mips.org
2013-12-17 10:33 ` jakub at gcc dot gnu.org
2013-12-19 15:37 ` rguenth at gcc dot gnu.org
2014-01-09 20:40 ` macro@linux-mips.org
2014-05-22  9:07 ` [Bug target/59371] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:34 ` [Bug target/59371] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-03-13 20:18 ` sje at gcc dot gnu.org
2015-06-23  8:28 ` [Bug target/59371] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 20:02 ` [Bug target/59371] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:32 ` jakub at gcc dot gnu.org
2021-05-14  9:47 ` [Bug target/59371] [9/10/11/12 Regression] Performance regression in GCC 4.8/9/10/11/12 " jakub at gcc dot gnu.org
2021-05-17  2:57 ` guojiufu at gcc dot gnu.org
2021-05-17  3:11 ` guojiufu at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug target/59371] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-07-07 10:30 ` [Bug target/59371] [11/12/13/14 " rguenth at gcc dot gnu.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).