public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/9832: ARM: Arithmetic and move could be combined using liveness information
@ 2003-02-24 15:26 lac
  0 siblings, 0 replies; 2+ messages in thread
From: lac @ 2003-02-24 15:26 UTC (permalink / raw)
  To: gcc-gnats

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


>Number:         9832
>Category:       target
>Synopsis:       ARM: Arithmetic and move could be combined using liveness information
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 15:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     László Vidács
>Release:        gcc version 3.3 20030217 (prerelease)
>Organization:
>Environment:
BUILD & HOST: Linux 2.4.20 i686 unknown
TARGET: arm-unknown-elf
>Description:
Arithmetic and move instructions are replaced by a combined arithmetic in ARM target. The combine cannot be done if the destination of the arithmetic is also used. However, if based on liveness information this destination is never used the combine could be safely applied.

For example, in file ... if r4 is not used after the and instruction, the combine can be applied as in the modified file.
>How-To-Repeat:
gcc -S -Os 01.i

// 01.i

# 1 "01.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "01.c"
void func(char c, int t)
{
  ;
}
void foo(int u)
{
  func ( 8, (u >> 24) & 0xffL );
  func ( 8, (u >> 16) & 0xffL );
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip; name="combine-using-liveness.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="combine-using-liveness.tar.gz"

H4sIAC00Wj4AA+2WUWvbMBDH82pDv8OtYSOB1Ei245R2K4M+9KXsbc/BseVMTLaCJJd2pd99JzvO
1q3rYJB0lPtBkHT6+3SSfOcwHsnRnmGcsSxjI8YYX8xT3zKe9q0nzpIRW2RxliYxS7jXp0k2Arbv
wDytdbkBGK2Fcbr+sy5XojhEPAdmDByOGY+K47Drvl+1UrkT2VwMhkLXdd6UoGQjBmP/wI2WJVRt
U0yKL3iGxQxk48BNw/sQ4Dx82Aq0nnh729u9HiZwOoNJCxcXEKdTeAfstqquYXr+hIBnjwQP4Usf
2asCb9Luf41n85/HWbzNf54uFqzLfzRR/h+AIKqkEkGf0UdhEDlx63ybK7lugth310qvchX4xOwU
dxvRDWbw1jdO6uYo9L0znP4IuVlb+ABsBhsjnMDS0Q0qk9fCdztRN1o2QpRiO99aYZd5o5u7WrfY
23rp1Fh7voIRa2mdMGDzGwFCyVo2uRNl1EsMbL1V2uDKWul1K3Cq1jfBBmNVxgdv5bch+Ohk2NET
e9X6x1a1frxTrf99o/y5jfpQ5WYGdoMD6+qqDOzmzQzuTYpuccJPKoPrFQ9buUGHBhdV1sA4Tv1z
7SoYtON0kKVeNgxQPz7FwWp3qTsN/nLvimdoxbK/s47j+fznNdNfnamyFnm38i5c24XrQ13t3p7+
AvyR4vn3pyxL0bjg+Ory8gwmV58+TyGJEogZS1jMFzDB0zVCidyKKb6iL50xrwvGl7UuZSUxj/b1
Ifhr/U/nQ/2fswztPMY/glT/DwHVf6r/z9d//nv9p5JPEARBEARBEARBEARBEARBEATx3/IdCdjt
dAAoAAA=


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

* Re: target/9832: ARM: Arithmetic and move could be combined using liveness information
@ 2003-03-03 14:14 rearnsha
  0 siblings, 0 replies; 2+ messages in thread
From: rearnsha @ 2003-03-03 14:14 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, lac, nobody, rearnsha

Synopsis: ARM: Arithmetic and move could be combined using liveness information

Responsible-Changed-From-To: unassigned->rearnsha
Responsible-Changed-By: rearnsha
Responsible-Changed-When: Mon Mar  3 14:14:27 2003
Responsible-Changed-Why:
    .
State-Changed-From-To: open->closed
State-Changed-By: rearnsha
State-Changed-When: Mon Mar  3 14:14:27 2003
State-Changed-Why:
    The analysis for the reasons behind this are mistaken.  GCC does get the liveness correct, but combine prevented from doing the combine into a hard register.  The current register allocator fails to spot that the move can be eliminated and thus generates sub-optimal code.  Compiling the same code with -fnew-ra shows that the new register allocator does a much better job in this area and eliminates the redundant move.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9832


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

end of thread, other threads:[~2003-03-03 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-24 15:26 target/9832: ARM: Arithmetic and move could be combined using liveness information lac
2003-03-03 14:14 rearnsha

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