This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix x86 #pragma GCC target and target attribute handling (PR target/61925)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Feb 2015 10:41:12 +0100
- Subject: Re: [PATCH] Fix x86 #pragma GCC target and target attribute handling (PR target/61925)
- Authentication-results: sourceware.org; auth=none
- References: <20150128200540 dot GZ1746 at tucnak dot redhat dot com>
On Wed, Jan 28, 2015 at 9:05 PM, Jakub Jelinek <email@example.com> wrote:
> This patch rewrites the target pragma and target attribute handling in the
> i386 backend, so that outside of functions global_options and target globals
> reflect the currently active #pragma GCC target (if none active, obviously
> the default options) and inside of functions (in between set_cfun to that
> function and set_cfun to another function or NULL) the target state of the
> Without this patch, that state often was wherever last set_cfun left it
> (consider e.g. function with target attribute inside of #pragma GCC target
> region), and furthermore #pragma GCC target without any function definition
> before #pragma GCC pop_options confused it altogether, plus there has been
> confusion between when should be the default options active and when should
> be the currently active #pragma GCC target activated.
> The last hunk in i386.c also attempts to save some compile time cycles, I
> think it is pointless to add currently active #pragma GCC target as
> attributes to all the target builtins that are activated in the call,
> we certainly don't do that e.g. for target attribute.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 2015-01-28 Jakub Jelinek <firstname.lastname@example.org>
> PR target/61925
> * config/i386/i386.c (ix86_reset_to_default_globals): Removed.
> (ix86_reset_previous_fndecl): Restore it here, unconditionally.
> (ix86_set_current_function): Rewritten.
> (ix86_add_new_builtins): Temporarily clear current_target_pragma
> when creating builtin fndecls.
> * gcc.target/i386/pr61925-1.c: New test.
> * gcc.target/i386/pr61925-2.c: New test.
> * gcc.target/i386/pr61925-3.c: New test.
LGTM as far as I can review this, so if there are no objections from
Honza, the patch is OK.