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: [PATCH] Handle __builtin_setjmp etc. in special_function_p like setjmp (PR tree-optimization/38977, PR gcov-profile/38292)


On Wed, Feb 4, 2009 at 5:39 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> special_function_p says that setjmp etc. ECF_RETURNS_TWICE,
> but doesn't do that for __builtin_setjmp.  The following patch
> handles the __builtin_ prefixed functions the same as non-prefixed.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Thanks,
Richard.

> 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
>
>        PR tree-optimization/38977
>        PR gcov-profile/38292
>        * calls.c (special_function_p): Disregard __builtin_
>        prefix.
>
> --- gcc/calls.c.jj      2009-01-28 12:57:50.000000000 +0100
> +++ gcc/calls.c 2009-02-04 15:54:53.000000000 +0100
> @@ -498,10 +498,14 @@ special_function_p (const_tree fndecl, i
>               && ! strcmp (name, "__builtin_alloca"))))
>        flags |= ECF_MAY_BE_ALLOCA;
>
> -      /* Disregard prefix _, __ or __x.  */
> +      /* Disregard prefix _, __, __x or __builtin_.  */
>       if (name[0] == '_')
>        {
> -         if (name[1] == '_' && name[2] == 'x')
> +         if (name[1] == '_'
> +             && name[2] == 'b'
> +             && !strncmp (name + 3, "uiltin_", 7))
> +           tname += 10;
> +         else if (name[1] == '_' && name[2] == 'x')
>            tname += 3;
>          else if (name[1] == '_')
>            tname += 2;
>
>        Jakub
>


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