Mail Archives: djgpp-workers/2000/07/17/19:32:21
This patch has been installed in gcc. Should the DJGPP take advantage of
this change in its target macro file?
> Over a year ago, Dimitris Michailidis <dimitris AT darkside DOT engr DOT sgi DOT com>
> pointed out that -pg and -mregparm cannot be used together on x86.
> The profiling hook at function entry clobbers %edx, which has an
> argument in it when -mregparm is used. Modern implementations of
> mcount do not need the value we load into %edx; it's for the ancient
> non-graph profiler. ("Ancient" here means "before 1982".) We also
> waste a word in the data segment for each function to cater to the old
> profiler.
>
> I'm resurrecting this issue because I'd like to reduce the profiling
> overhead, not particularly because of -mregparm. GCC doesn't make any
> distinction between -p and -pg and I do not propose to introduce one
> now. Instead, I'd like to introduce a new target macro which
> indicates that the target does not need the call-count slot. With
> that, and suitable modifications to FUNCTION_PROFILER, each target can
> decide whether or not to support non-graph profiling. The appended
> patch has the machine-independent change and the target tweak for
> x86/linux, which has never had a non-graph profiler.
>
> The patch shaves a percentage point or so off runtime of profiled
> executables, and makes a hefty reduction in the size of the data
> section (at least 10%).
>
- Raw text -