From 34a061bed589449b2bf2efb42e017805bc173be7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 23 May 2011 16:51:42 +0000 Subject: [PATCH] Save the initial options after checking vzeroupper. gcc/ 2011-05-23 H.J. Lu PR target/47315 * config/i386/i386.c (ix86_option_override_internal): Save the initial options after checking vzeroupper. gcc/testsuite/ 2011-05-23 H.J. Lu PR target/47315 * gcc.target/i386/pr47315.c: New test. From-SVN: r174078 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 11 ++++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr47315.c | 10 ++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr47315.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3cb0f1087a..1d46b04b630 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-23 H.J. Lu + + PR target/47315 + * config/i386/i386.c (ix86_option_override_internal): Save the + initial options after checking vzeroupper. + 2011-05-23 David Li PR tree-optimization/48988 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0709be819fd..854e376b58e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4191,11 +4191,6 @@ ix86_option_override_internal (bool main_args_p) #endif } - /* Save the initial options in case the user does function specific options */ - if (main_args_p) - target_option_default_node = target_option_current_node - = build_target_option_node (); - if (TARGET_AVX) { /* When not optimize for size, enable vzeroupper optimization for @@ -4217,6 +4212,12 @@ ix86_option_override_internal (bool main_args_p) /* Disable vzeroupper pass if TARGET_AVX is disabled. */ target_flags &= ~MASK_VZEROUPPER; } + + /* Save the initial options in case the user does function specific + options. */ + if (main_args_p) + target_option_default_node = target_option_current_node + = build_target_option_node (); } /* Return TRUE if VAL is passed in register with 256bit AVX modes. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72aae61f3ef..85137d00056 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-23 H.J. Lu + + PR target/47315 + * gcc.target/i386/pr47315.c: New test. + 2011-05-23 Jason Merrill * g++.dg/cpp0x/lambda/lambda-eh2.C: New. diff --git a/gcc/testsuite/gcc.target/i386/pr47315.c b/gcc/testsuite/gcc.target/i386/pr47315.c new file mode 100644 index 00000000000..871d3f1bd90 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr47315.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mvzeroupper" } */ + +__attribute__ ((__target__ ("avx"))) +float bar (float f) {} + +void foo (float f) +{ + bar (f); +} -- 2.30.2