This is the mail archive of the
mailing list for the GCC project.
Re: gcc feature request / RFC: extra clobbered regs
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Andy Lutomirski <luto at kernel dot org>, gcc at gcc dot gnu dot org, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>, Linus Torvalds <torvalds at linux-foundation dot org>, "H. Peter Anvin" <hpa at zytor dot com>, Ingo Molnar <mingo at kernel dot org>, Thomas Gleixner <tglx at linutronix dot de>
- Date: Wed, 01 Jul 2015 14:12:26 -0400
- Subject: Re: gcc feature request / RFC: extra clobbered regs
- Authentication-results: sourceware.org; auth=none
- References: <CALCETrX6j9vBZR7RirXf8usz1Y4f-1TnVaYTVg0_PgQCeWZnRg at mail dot gmail dot com> <20150630213736 dot GQ10247 at tucnak dot redhat dot com> <559405E5 dot 7000405 at redhat dot com> <20150701153133 dot GY10247 at tucnak dot redhat dot com> <559424D4 dot 6010908 at redhat dot com> <20150701174333 dot GA10247 at tucnak dot redhat dot com>
On 07/01/2015 01:43 PM, Jakub Jelinek wrote:
On Wed, Jul 01, 2015 at 01:35:16PM -0400, Vladimir Makarov wrote:
Actually it raise a question for me. If we describe that a function
clobbers more than calling convention and then use it as a value (assigning
a variable or passing as an argument) and loosing a track of it and than
call it. How can RA know what the call clobbers actually. So for the
function with the attributes we should prohibit use it as a value or make
the attributes as a part of the function type, or at least say it is unsafe.
So now I see this as a *bigger problem* with this extension. Although I
guess it already exists as we have description of different ABI as an
Unfortunately target attribute is function decl attribute rather than
function type. And having more attributes affect switchable targets will be
Making attributes a part of type probably creates a lot issues too.
Although I am not a front-end developer, still I think it is hard to
implement in front-end. Sticking fully to this approach, it would be
logical to describe this as a debug info (I am not sure it is even
Portability would be an issue too. It is hard to prevent for a regular
C developer to assign such function to variable because it is ok on his
system while the compilation of such code may fail on another system.