public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* middle-end/9703: Accessing data through constant pool more times could be solved in less instructions
@ 2003-02-14  9:46 lac
  0 siblings, 0 replies; only message in thread
From: lac @ 2003-02-14  9:46 UTC (permalink / raw)
  To: gcc-gnats

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


>Number:         9703
>Category:       middle-end
>Synopsis:       Accessing data through constant pool more times could be solved in less instructions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 14 09:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     László Vidács
>Release:        gcc version 3.3 20030210 (prerelease)
>Organization:
>Environment:
BUILD & HOST: Linux 2.4.20 i686 unknown
TARGET: arm-unknown-elf
>Description:
Each data access through constant pool requires 2 instructions: (1) to access constant pool element (data address) and (2) to access the data. Storing the constant pool base address in a register could save one instruction per subsequent data accesses. (See attached files.)
>How-To-Repeat:
Use the command line below to compile the specified source code:
arm-elf-gcc -S -g0 -Os -o 02.s ./02.c

Attached is the original assembly output where accessing globalvar1 can be solved in one less instructions as shown in the manually edited assembly file.

// 01.c:

# 1 "01.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "01.c"
unsigned int globvar1=0;
unsigned int globvar2=0;
+C1
int f1()
{
    globvar1=11;
    globvar2=12;
    return globvar1;
}

int main ()
{
  return f1();
}
>Fix:

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

H4sIADKwTD4AA+2YUW/TMBCA+5pI/Q+nDqRNNMF201TaGELaw3iY4AHxhFDlJk5kSOzKcTYG4r9j
p0m0FrpJoGZo8vcS++7ss8+5S12EQz46MAgjFMdohBDCi3lknwhHm6dlFs1HaBETsojnhMTWPpqT
EaBDL8xSV5oqgFHOlJblfjtasGSI9QzMEWCYIBwmk7HftF+tal7ogIvXvSSRZUlFCgUXrJe2Y2pR
8VywFLjQkBdydU0VPkdnf9aQRjP2rSjDxydj/8fYB0M/EuOzLQk5x6SVKKZrJXpTI/3ZzVVSLqCf
rjW0DjZGjx3k/xhzjNXhfdyb/zie4Tb/5zi2cpP/scv/QfDCjBfM69LZC2160cLrssyKVlW1R0ML
k+IesU19u2a9bgrP5eoLS7TVVPz7XU009rvOaaNe04R50e8eyB7RHqdkr1Ny1ynZdarZN70zbes0
w72PzG4pq0WiuRRjP2uW/gaoyis4BzSFtSk6zNTIppMpWjLbbIya3lIwlrJWX1esWlIhxW0pa9Nq
Z2msTZH9aipYzivNFFT0mgEreMkF1SwNjUmRKk/NphBe2bWW8tqzGzzCtldp1fQ+WYMj9Hnb/EXU
DUB2AN74U9AuLZPKbEMWMq9ZNxfamsuOXSdTM2bsh1ez062wGQeN4EaqdOu87gpwfzY2omGQ7b5G
behtQe+Dbztb4beCxzuAe2K2at+ZZoebZYdBtxeeMqG9yeXFxSkcX777eAKzcAbE/P5BBCM4NjtQ
rGC0YieTwb5ZCC9LmfKMm70d6kPwYP3Hff03gTB2mMxQ5Or/ELj6/8Tr/1/W+8jV+ydZ73dRjKYl
O6yPh+7/KF509388j+39H5PI1f9BeCtvQEvz/q8Z1SbHnpkUKwNWZEGeJBB8gCBHELyvIJBg74oQ
vkQD/GXkcDgcDofD4XA4HA6Hw+FwOByOf+QXPFt8ggAoAAA=


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

only message in thread, other threads:[~2003-02-14  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-14  9:46 middle-end/9703: Accessing data through constant pool more times could be solved in less instructions lac

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