This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: quetion for gcc on hpux
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: dai yiyang <daiyiyang at hotmail dot com>, gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: Wed, 23 Feb 2005 06:28:40 -0600
- Subject: Re: quetion for gcc on hpux
- References: <BAY21-F27404C6DF603092380AD97A2630@phx.gbl>
Hi Dai,
If you choose not to change the bad code that is causing a SIGBUS, I
believe you cannot use GCC since (as far as I am aware) GCC does not
provide a mechanism *IN THE COMPILE/LINK* to catch the SIGBUS signal and do
the byte-by-byte manipulation to complete the action.
Such handling of a SIGBUS slows down the performance of the application
significantly. If the SIGBUS is happening on a data structure that is
often used, such as in a tight loop, you can expect to see a degradation of
performance on the order of two or three magnitudes.
You could write your own SIGBUS handler (as such, in that sense, GCC
provide a mechanism -- i.e., the building blocks to do it yourself), so you
wouldn't have to change the rest of your code other than in main to put in
your SIGBUS handler, and the SIGBUS handler itself.
My recommendation is to fix the bad code, not surround the application with
a inevitably inefficient SIGBUS handler that masks bad programming*.
* "bad" in the sense of "violates system architecture constraints".
HTH,
--Eljay
PS: I ran into the same issue on DEC Alpha Tru64 machines.