Patchwork PATCH: Fix split_stack_return

login
register
mail settings
Submitter H.J. Lu
Date Oct. 27, 2010, 1:34 p.m.
Message ID <AANLkTikCzuNHrgsg6AneUa1xffXqt8Hu+df4xtjCXO95@mail.gmail.com>
Download mbox | patch
Permalink /patch/69356/
State New
Headers show

Comments

H.J. Lu - Oct. 27, 2010, 1:34 p.m.
On Wed, Oct 27, 2010 at 6:15 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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.
>

I checked in this patch.

Thanks.
Ian Taylor - Oct. 27, 2010, 2:10 p.m.
"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Wed, Oct 27, 2010 at 6:15 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> 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.
>>
>
> I checked in this patch.

OK I suppose, but, seriously: please do wait for approval.  The system
doesn't work when people just commit patches themselves.

I've been running the testsuite on the patch, and I was going to commit
it if the testsuite passed.

Ian
H.J. Lu - Oct. 27, 2010, 2:36 p.m.
On Wed, Oct 27, 2010 at 7:10 AM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Wed, Oct 27, 2010 at 6:15 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> 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.
>>>
>>
>> I checked in this patch.
>
> OK I suppose, but, seriously: please do wait for approval.  The system
> doesn't work when people just commit patches themselves.
>

Without the fix, "gcc -mavx -O3" generates garbage. That change only affects
-fsplit-stack. Even if it isn't completely correct, at least it won't
generate garbage.

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 166000)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@ 
+2010-10-27  Ian Lance Taylor  <iant@google.com>
+
+	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  <hongjiu.lu@intel.com>

 	* 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)