removing virtual function assembler code

kenneth.ljunggren@itech.se
18 Jul 2000 12:58:59 -0400

          From comp.compilers

Related articles
removing virtual function assembler code kenneth.ljunggren@itech.se (2000-07-18)
| List of all articles for this month |
From: kenneth.ljunggren@itech.se
Newsgroups: comp.compilers
Date: 18 Jul 2000 12:58:59 -0400
Organization: Deja.com - Before you buy.
Keywords: question, C++

I wonder if there is any way of minimizing the assembled code using
GCC.


We have a C++ application running on a 68360 and we want to minimize
the memory usage in all possible ways.


And I noticed that there are a lot for function defintions in the
assembled code that takes a lot of memory.


These functions do not do any useful as can be seen from the code
below, but I understand that they are generated as they are needed,
but in this case I wonder, can calls to theses method not be removed
at compilation time as they do not do anything?


Or can the link, ulnk instructions be removed to atleast minimize the
function.


.globl _initB__11SupervisorB
_initB__11SupervisorB:
link a6,#0
unlk a6
rts
.even
.globl _initA__11SupervisorB
_initA__11SupervisorB:
link a6,#0
unlk a6
rts
.even
_initB__18AbstractCyclicTask:
link a6,#0
unlk a6
rts
.even
Br
Kenneth
[These look to me like code expanded from a template, where it happens
that the argument is ignored so the code is all the same. Depending
on your linker, it should be possible to collapse these identical routines
together. Or failing that, it should be easy enough to write a perl
script that looks for known patterns and collapses them together. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.