Re: quetion for gcc on hpux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



well , Tru64 can catch & handle unaligned access by OS itself . the unaligned access only cause a system warning , but the code can be running only with performance penalty . there is a command to turn off the unaligned access message by OS ( I can forgot the name ).

HPUX can not handle unaligned access by default , for me , maybe use libunalign.so on IA64 is the best way .I really don't want to change the code .


Regards, Yiyang

From: Eljay Love-Jensen <eljay@xxxxxxxxx>
To: dai yiyang <daiyiyang@xxxxxxxxxxx>, gcc@xxxxxxxxxxx,
gcc-help@xxxxxxxxxxx
Subject: Re: quetion for gcc on hpux
Date: Wed, 23 Feb 2005 06:28:40 -0600

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.


_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux