This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a bug: -mregparm=0 doesn't work with -O3?
- From: pinskia at gmail dot com
- To: Wei Li <limijd at gmail dot com>
- Cc: "gcc-bugs at gcc dot gnu dot org" <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 28 Aug 2013 15:40:55 -0700
- Subject: Re: Is this a bug: -mregparm=0 doesn't work with -O3?
- Authentication-results: sourceware.org; auth=none
- References: <CAFNwwBfr4MWPb4mU5ouCRqQX=OzgrRgQC72Q-BaeF+d0THJG9A at mail dot gmail dot com> <79C80BE9-2F0C-4166-8CF8-C1A2FEAE085E at gmail dot com> <CAFNwwBc7ZbAbTqMN=23_etpzgV_nuwyP1uoi-UNreVS_hGwTjQ at mail dot gmail dot com> <98CA9E92-C7DF-48B2-BCCD-6A4B348FDF4B at gmail dot com> <CAFNwwBdRJRPXOYbv3NoERWcMkQLyR+iH9NwXFOJW90ykqGQkEg at mail dot gmail dot com>
Sent from my iPad
On Aug 28, 2013, at 3:15 PM, Wei Li <limijd@gmail.com> wrote:
> I am actually doing some instrumentation on the binary code generated
> by gcc. I did it successfully for class methods and external functions
> but failed on the static functions.
Well that is not supported and is undefined.
>
> On Wed, Aug 28, 2013 at 3:12 PM, <pinskia@gmail.com> wrote:
>>
>> On Aug 28, 2013, at 3:02 PM, Wei Li <limijd@gmail.com> wrote:
>>
>>> It's a static function. 32bit x86. I tried both gcc4.5.2 and gcc4.7.2,
>>> the behavior is same.
>>
>> Then this is not a bug. Why would you care about the abi? Are you using some inline asm also?
>>
>> Andrew
>>
>>
>>
>>
>>>
>>> On Wed, Aug 28, 2013 at 3:00 PM, <pinskia@gmail.com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On Aug 28, 2013, at 2:57 PM, Wei Li <limijd@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to disable pass arguments by register in my project. I
>>>>> suppose -mregparm=0 can do this but unfortunately it doesn't work with
>>>>> -O3. The arguments are still through registers even I specified
>>>>> -mregparm=0.
>>>>>
>>>>> I am not sure if this intentional or a bug? -mregparm is a specific
>>>>> option. In general the priority should be higher than -O3 which is a
>>>>> group option, right?
>>>>
>>>> Is this a static local only function?
>>>> If so then there Is code which changes the abi to use the registers. Also is this 32 or 64 bit x86?
>>>>
>>>> Thanks,
>>>> Andrew Pinski
>>>>
>>>>>
>>>>> Thanks,
>>>>> Wei