From: "Mark E." To: djgpp-workers AT delorie DOT com Date: Mon, 17 Jul 2000 19:32:23 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Fw: x86: Not clobbering %edx at function entry when profiling Message-ID: <39735F47.4999.174596@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com 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 > 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%). >