public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/9663: gcc-20030127 misses an optimization opportunity
@ 2003-02-11 17:06 gertom
  0 siblings, 0 replies; only message in thread
From: gertom @ 2003-02-11 17:06 UTC (permalink / raw)
  To: gcc-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]


>Number:         9663
>Category:       target
>Synopsis:       gcc-20030127 misses an optimization opportunity
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 11 17:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Tamás Gergely
>Release:        gcc version 3.3 20030127 (prerelease)
>Organization:
>Environment:
Built on: Linux 2.4.20 i686 unknown
Configured with: /home/gertom/gcc/src/gcc-20030127/configure --target=arm-elf --prefix=/home/gertom/gcc/build/install-20030127-arm-elf-orgn --enable-target-optspace --with-newlib --with-headers --disable-nls --disable-threads --disable-shared --disable-libgcj --disable-multilib --with-gnu-as --with-gnu-ld --enable-languages=c,c++
Thread model: single
>Description:
The following two lines:

cmp r0, #0
mov lr, r0

should be replaced with:

subs lr, r0, #0

in the asm output.

20020503-1.i:
---
# 1 "20020503-1.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "20020503-1.c"



 
void abort (void);
static char *
inttostr (long i, char buf[128])
{
  unsigned long ui = i;
  char *p = buf + 127;
  *p = '\0';
  if (i < 0)
    ui = -ui;
  do
    *--p = '0' + ui % 10;
  while ((ui /= 10) != 0);
  if (i < 0)
    *--p = '-';
  return p;
}

int
main ()
{
  char buf[128], *p;

  p = inttostr (-1, buf);
  if (*p != '-')
    abort ();
  return 0;
}
>How-To-Repeat:
just compile with -O2
>Fix:
See "PATCH: new peephole2 in arm.md" at http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00204.html
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-11 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 17:06 target/9663: gcc-20030127 misses an optimization opportunity gertom

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