This is the mail archive of the
mailing list for the GCC project.
Re: [bfin] Don't load the address of counter variable before calling _mcount ()
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: Jie Zhang <jzhang918 at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 07 Nov 2006 15:56:29 +0100
- Subject: Re: [bfin] Don't load the address of counter variable before calling _mcount ()
- References: <email@example.com>
Jie Zhang wrote:
To load the address of counter variable may clobber the value of P1,
which is set up in function prologue, since the instrument code is
inserted after prologue. To fix it, we could save P1 on stack before
loading the address of counter variable into P1 and pop it from stack
after _mcount return. But there is only one project using -pg on
Blackfin and it does not require the address of counter variable, so the
simpler way is not to load the address into P1 at all.
Maybe we could just define PROFILE_BEFORE_PROLOGUE?