Hi, Attached are two patches in gcc 4.7 trunk that we request to backport to 4.6 branch. There are all related to -mvzerupper
1) 0001-Save-the-initial-options-after-checking-vzeroupper.patch This patch fixes bug 47315, ICE: in extract_insn, at recog.c:2109 (unrecognizable insn) with -mvzeroupper and __attribute__((target("avx"))) The patch was committed to trunk: 2011-05-23 H.J. Lu <hongjiu...@intel.com> The bug still exists in gcc 4.6.1. Backporting this patches would fix it. 2). 0001--config-i386-i386.c-ix86_reorg-Run-move_or_dele.patch This patch Run move_or_delete_vzeroupper first, and was committed to trunk: 2011-05-04 Uros Bizjak <ubiz...@gmail.com> Is It OK to commit to 4.6 branch? Thanks, Changpeng
From 0b70e1e33afa25536305f4a228409cf9b4e0eaad Mon Sep 17 00:00:00 2001 From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> 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 <hongjiu...@intel.com> 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 <hongjiu...@intel.com> PR target/47315 * gcc.target/i386/pr47315.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174078 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 a3cb0f1..1d46b04 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-23 H.J. Lu <hongjiu...@intel.com> + + PR target/47315 + * config/i386/i386.c (ix86_option_override_internal): Save the + initial options after checking vzeroupper. + 2011-05-23 David Li <davi...@google.com> PR tree-optimization/48988 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0709be8..854e376 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 72aae61..85137d0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-23 H.J. Lu <hongjiu...@intel.com> + + PR target/47315 + * gcc.target/i386/pr47315.c: New test. + 2011-05-23 Jason Merrill <ja...@redhat.com> * 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 0000000..871d3f1 --- /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); +} -- 1.6.0.2
From 343f07cbec2d66bebe71e4f48b0403f52ebfe8f9 Mon Sep 17 00:00:00 2001 From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 4 May 2011 17:07:03 +0000 Subject: [PATCH] * config/i386/i386.c (ix86_reorg): Run move_or_delete_vzeroupper first. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173383 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 16 ++++++++++------ gcc/config/i386/i386.c | 8 ++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5412506..ca85616 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-05-04 Uros Bizjak <ubiz...@gmail.com> + + * config/i386/i386.c (ix86_reorg): Run move_or_delete_vzeroupper first. + 2011-05-04 Eric Botcazou <ebotca...@adacore.com> * stor-layout.c (variable_size): Do not issue errors. @@ -263,9 +267,9 @@ 2011-05-03 Stuart Henderson <shend...@gcc.gnu.org> - From Mike Frysinger: - * config/bfin/bfin.c (bfin_cpus[]): Add 0.4 for - bf542/bf544/bf547/bf548/bf549. + From Mike Frysinger: + * config/bfin/bfin.c (bfin_cpus[]): Add 0.4 for + bf542/bf544/bf547/bf548/bf549. 2011-05-03 Uros Bizjak <ubiz...@gmail.com> @@ -575,9 +579,9 @@ 2011-05-02 Stuart Henderson <shend...@gcc.gnu.org> - PR target/47951 - * config/bfin/bfin.md (loop_end): Use matching constraints to ensure - inputs match the output. + PR target/47951 + * config/bfin/bfin.md (loop_end): Use matching constraints to ensure + inputs match the output. 2011-05-02 Andreas Schwab <sch...@linux-m68k.org> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 79dd5da..786bc6d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -30444,6 +30444,10 @@ ix86_reorg (void) with old MDEP_REORGS that are not CFG based. Recompute it now. */ compute_bb_for_insn (); + /* Run the vzeroupper optimization if needed. */ + if (TARGET_VZEROUPPER) + move_or_delete_vzeroupper (); + if (optimize && optimize_function_for_speed_p (cfun)) { if (TARGET_PAD_SHORT_FUNCTION) @@ -30455,10 +30459,6 @@ ix86_reorg (void) ix86_avoid_jump_mispredicts (); #endif } - - /* Run the vzeroupper optimization if needed. */ - if (TARGET_VZEROUPPER) - move_or_delete_vzeroupper (); } /* Return nonzero when QImode register that must be represented via REX prefix -- 1.6.0.2