This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
profiling (-pg) breaks regparm() attribute
- To: gcc-bugs at gcc dot gnu dot org, proton at c64 dot org
- Subject: profiling (-pg) breaks regparm() attribute
- From: proton <proton at c64 dot org>
- Date: Thu, 02 Mar 2000 00:16:08 +0100
I found this out while trying to optimize my software with regparm.
First I thought ``oh well maybe it doesnt work like I thought it would''
but then I recalled that Im currently compiling with -pg (gprof
profiling).
Seems like noone thought of what registers would be trashed because of
the added profiling code. Maybe time to think this over again?
Since it might not be possible to work out a simple(tm) sollution to
this problem, a #define like ``__profiling__'' and/or a compiler
warning/error when it encounters ``regparm'' attributes when profiling
is active might be a good quick fix?
I havent had time to try much gcc versions but this blows up in
my face with both egcs-2.91.66 and pgcc-2.95.2 so I assume its in
all gcc versions.
Keep up the good work =)
/proton