This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Handle __builtin_setjmp etc. in special_function_p like setjmp (PR tree-optimization/38977, PR gcov-profile/38292)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Feb 2009 20:45:50 +0100
- Subject: Re: [PATCH] Handle __builtin_setjmp etc. in special_function_p like setjmp (PR tree-optimization/38977, PR gcov-profile/38292)
- References: <20090204163957.GT5690@tyan-ft48-01.lab.bos.redhat.com>
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
>