This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

middle-end/9703: Accessing data through constant pool more times could be solved in less instructions


>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=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]