This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix regparm testcases


Richard Henderson <rth@redhat.com> writes:

> On Wed, Feb 25, 2004 at 12:06:45PM -0800, Zack Weinberg wrote:
>> Do we *want* to require people to write the regparm attribute in both
>> places?
>
> I think we have to, simply because 
>
>   static void foo(int x);
>   void bar()
>   {
>     foo(x);
>   }
>   static void __attribute__((regparm(1))) foo(int x)
>   {
>     printf("%d", x);
>   }
>
> fails at -O0 without such checks.

I was thinking of the other way round ...

   static void __attribute((regparm(1))) foo(int x);
   void bar()
   {
     foo(x);
   }
   static void foo(int x)
   {
     printf("%d", x);
   }

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]