diff mbox

PATCH: Fix split_stack_return

Message ID mcrhbg8qs0f.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 27, 2010, 2:38 a.m. UTC
"H.J. Lu" <hjl.tools@gmail.com> 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?

Ian

Comments

H.J. Lu Oct. 27, 2010, 2:51 a.m. UTC | #1
On Tue, Oct 26, 2010 at 7:38 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> 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?
>

It should fix my problem. Thanks.

BTW, I have reverted my checkin.
H.J. Lu Oct. 27, 2010, 1:15 p.m. UTC | #2
On Tue, Oct 26, 2010 at 7:38 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> 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.

Thanks.
diff mbox

Patch

Index: gcc/config/i386/i386.md
===================================================================
--- gcc/config/i386/i386.md	(revision 165994)
+++ gcc/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
@@ -11751,8 +11752,8 @@ 
 ;; In order to support the call/return predictor, we use a return
 ;; instruction which the middle-end doesn't see.
 (define_insn "split_stack_return"
-  [(unspec [(match_operand:SI 0 "const_int_operand" "")]
-	    UNSPEC_STACK_CHECK)]
+  [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "")]
+		    UNSPECV_SPLIT_STACK_RETURN)]
   ""
 {
   if (operands[0] == const0_rtx)