[AArch64] Set TREE_TARGET_GLOBALS in aarch64_set_current_function when new tree is the default node to recalculate optab availability

PR target/69245
	* config/aarch64/aarch64.c (aarch64_set_current_function):
	Save/restore target globals when switching to
	target_option_default_node.

	* gcc.target/aarch64/pr69245_1.c: New test.

From-SVN: r233745
This commit is contained in:
Kyrylo Tkachov 2016-02-26 16:02:21 +00:00 committed by Kyrylo Tkachov
parent ac59ad4efc
commit 6cfccbb231
4 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69245
* config/aarch64/aarch64.c (aarch64_set_current_function):
Save/restore target globals when switching to
target_option_default_node.
2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69613

View File

@ -8576,7 +8576,7 @@ aarch64_set_current_function (tree fndecl)
if (old_tree == new_tree)
;
else if (new_tree && new_tree != target_option_default_node)
else if (new_tree)
{
cl_target_option_restore (&global_options,
TREE_TARGET_OPTION (new_tree));

View File

@ -1,3 +1,8 @@
2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69245
* gcc.target/aarch64/pr69245_1.c: New test.
2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69613

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=armv8-a+fp -fomit-frame-pointer" } */
#pragma GCC target "arch=armv8-a+nofp"
long a;
static void
fn1 ()
{
}
#pragma GCC target "arch=armv8-a+fp"
float
fn2 (float a)
{
return a + 2.0;
}
/* { dg-final { scan-assembler-not "__addsf3" } } */