This is the mail archive of the gcc-patches@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]

exception-section patch, part 0



Hi,

g++ still emits exception handling code to the normal text section, thus
clobbering upto 50% of the CPU's instruction cache with normally useless
instructions. The following patch enables gcc to emit exception handling
code to another section.

This time, I've splitted the patch into small pieces. This may make it
easier for Jeff to review it.

The patches are organized in bottom-up manner. If patch N is rejected,
patches 1..N-1 can still be put in (except for patch #9 which goes with #10).

The overall structure is as follows. The optimization is triggered by
the -fexception-section command-line option. (For the moment, it has
to be set manually, but it is planned to be included in -O2.) The
exception handler sections are marked by NOTE_INSN_EH_HANDLER_{BEG,END}
notes. Everything enclosed within such notes is emitted to the eh_text
section. When creating an executable or shared library, the linker
concatenates all the "text" segments from various object files on one side,
all the "eh_text" segments on the other side, and concatenates both to
give the executable's text segment. This achieves the desired
compactification of normal (non-exception-handling) code.

When "-fexception-section" and "-g" are both given, the debugging
facilities have to suffer, because debuggers are not prepared to a
function's code being non contiguous. Hence no debugging information
is output for code that goes into the eh_text section.

I haven't implemented a general multi-purpose multi-section facility
because exception handling is the only domain where multiple code sections
are useful.

Patches #1 to #10 follow. They cause no testsuite failures on i486-linux,
and they pass "make bootstrap" on sparc-sun-solaris2.4.

Regards,
                            Bruno


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