From patchwork Wed Oct 27 13:34:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 69356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 06BA9B70EB for ; Thu, 28 Oct 2010 00:35:20 +1100 (EST) Received: (qmail 1035 invoked by alias); 27 Oct 2010 13:35:14 -0000 Received: (qmail 952 invoked by uid 22791); 27 Oct 2010 13:35:12 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_AV, TW_VZ X-Spam-Check-By: sourceware.org Received: from mail-gw0-f47.google.com (HELO mail-gw0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Oct 2010 13:35:05 +0000 Received: by gwaa11 with SMTP id a11so389069gwa.20 for ; Wed, 27 Oct 2010 06:35:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.163.67 with SMTP id o3mr1821577hbd.194.1288186498924; Wed, 27 Oct 2010 06:34:58 -0700 (PDT) Received: by 10.220.112.65 with HTTP; Wed, 27 Oct 2010 06:34:58 -0700 (PDT) In-Reply-To: References: <20101026211731.GA3834@intel.com> Date: Wed, 27 Oct 2010 06:34:58 -0700 Message-ID: Subject: Re: PATCH: Fix split_stack_return From: "H.J. Lu" To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Wed, Oct 27, 2010 at 6:15 AM, H.J. Lu wrote: > On Tue, Oct 26, 2010 at 7:38 PM, Ian Lance Taylor wrote: >> "H.J. Lu" writes: >> >>> I found the problem when I am working on my vzeroupper change. >>> The bad "split_stack_return" pattern makes it impossible for me >>> to work on vzeroupper since gcc kept generating "ret $2" >>> for my vzeroupper pattern. The split_stack_return issue wasted >>> my time and blocked my vzeroupper change, which I want to finish during >>> gcc summit. That is why I committed my change. >> >> I'm sorry for blocking your change.  Still, we have an approval system >> for a reason. >> >> Does this patch fix your problem? >> > > I opened a bug: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46197 > > Ian, could you please took into it? Right now, "gcc -mavx -O3" generates > garbage. > I checked in this patch. Thanks. Index: ChangeLog =================================================================== --- ChangeLog (revision 166000) +++ ChangeLog (working copy) @@ -1,3 +1,10 @@ +2010-10-27 Ian Lance Taylor + + PR target/46197 + * config/i386/i386.md (UNSPECV_SPLIT_STACK_RETURN): New. + (split_stack_return): Replace UNSPEC_STACK_CHECK with + UNSPECV_SPLIT_STACK_RETURN. + 2010-10-27 H.J. Lu * config/i386/i386-protos.h (init_cumulative_args): Add an int. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 166000) +++ config/i386/i386.md (working copy) @@ -261,6 +261,7 @@ UNSPECV_WRFSBASE UNSPECV_WRGSBASE UNSPECV_RDRAND + UNSPECV_SPLIT_STACK_RETURN ]) ;; Constants to represent pcomtrue/pcomfalse variants @@ -11752,7 +11753,7 @@ ;; instruction which the middle-end doesn't see. (define_insn "split_stack_return" [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "")] - UNSPEC_STACK_CHECK)] + UNSPECV_SPLIT_STACK_RETURN)] "" { if (operands[0] == const0_rtx)