diff mbox

[0/4] PowerPC64 Linux split stack support

Message ID 87k2v4pzn0.fsf@igel.home
State New
Headers show

Commit Message

Andreas Schwab June 15, 2015, 6:58 p.m. UTC
* go-lang.c (go_langhook_init_options_struct): Don't set
	x_flag_split_stack.
	(go_langhook_post_options): Set it here instead.
---
 gcc/go/go-lang.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Andreas Schwab June 19, 2015, 12:58 p.m. UTC | #1
> 	* go-lang.c (go_langhook_init_options_struct): Don't set
> 	x_flag_split_stack.
> 	(go_langhook_post_options): Set it here instead.
> ---
>  gcc/go/go-lang.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
> index ce4dd9b..d952e0f 100644
> --- a/gcc/go/go-lang.c
> +++ b/gcc/go/go-lang.c
> @@ -158,10 +158,6 @@ go_langhook_init_options_struct (struct gcc_options *opts)
>    opts->x_flag_errno_math = 0;
>    opts->frontend_set_flag_errno_math = true;
>  
> -  /* We turn on stack splitting if we can.  */
> -  if (targetm_common.supports_split_stack (false, opts))
> -    opts->x_flag_split_stack = 1;
> -
>    /* Exceptions are used to handle recovering from panics.  */
>    opts->x_flag_exceptions = 1;
>    opts->x_flag_non_call_exceptions = 1;
> @@ -295,6 +291,11 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>        && global_options.x_write_symbols == NO_DEBUG)
>      global_options.x_write_symbols = PREFERRED_DEBUGGING_TYPE;
>  
> +  /* We turn on stack splitting if we can.  */
> +  if (!global_options_set.x_flag_split_stack
> +      && targetm_common.supports_split_stack (false, &global_options))
> +    global_options.x_flag_split_stack = 1;
> +
>    /* Returning false means that the backend should be used.  */
>    return false;
>  }

This fixes the bootstrap error, and probably makes it possible to use
DEFAULT_ABI in rs6000_supports_split_stack.

Andreas.
Lynn A. Boger July 1, 2015, 2:08 p.m. UTC | #2
If further testing is needed on this patch I can do it, but I need more 
information what variations need to be tested?

It's not clear to me what distro/gcc/glibc versions and type of build 
causes the error.  I have not been able to reproduce the
original problem.

On 06/15/2015 01:58 PM, Andreas Schwab wrote:
> 	* go-lang.c (go_langhook_init_options_struct): Don't set
> 	x_flag_split_stack.
> 	(go_langhook_post_options): Set it here instead.
> ---
>   gcc/go/go-lang.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
> index ce4dd9b..d952e0f 100644
> --- a/gcc/go/go-lang.c
> +++ b/gcc/go/go-lang.c
> @@ -158,10 +158,6 @@ go_langhook_init_options_struct (struct gcc_options *opts)
>     opts->x_flag_errno_math = 0;
>     opts->frontend_set_flag_errno_math = true;
>
> -  /* We turn on stack splitting if we can.  */
> -  if (targetm_common.supports_split_stack (false, opts))
> -    opts->x_flag_split_stack = 1;
> -
>     /* Exceptions are used to handle recovering from panics.  */
>     opts->x_flag_exceptions = 1;
>     opts->x_flag_non_call_exceptions = 1;
> @@ -295,6 +291,11 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>         && global_options.x_write_symbols == NO_DEBUG)
>       global_options.x_write_symbols = PREFERRED_DEBUGGING_TYPE;
>
> +  /* We turn on stack splitting if we can.  */
> +  if (!global_options_set.x_flag_split_stack
> +      && targetm_common.supports_split_stack (false, &global_options))
> +    global_options.x_flag_split_stack = 1;
> +
>     /* Returning false means that the backend should be used.  */
>     return false;
>   }
Andreas Schwab July 1, 2015, 2:15 p.m. UTC | #3
"Lynn A. Boger" <laboger@linux.vnet.ibm.com> writes:

> It's not clear to me what distro/gcc/glibc versions and type of build
> causes the error.  I have not been able to reproduce the
> original problem.

The failure mode is quite obvious: go_langhook_init_options_struct is
called before the options are parsed, so -m32 hasn't been acted upon and
supports_split_stack falsely returns true.

Andreas.
Lynn A. Boger July 17, 2015, 12:10 p.m. UTC | #4
I have tested this and it fixes the problem.

On 07/01/2015 09:15 AM, Andreas Schwab wrote:
> "Lynn A. Boger" <laboger@linux.vnet.ibm.com> writes:
>
>> It's not clear to me what distro/gcc/glibc versions and type of build
>> causes the error.  I have not been able to reproduce the
>> original problem.
> The failure mode is quite obvious: go_langhook_init_options_struct is
> called before the options are parsed, so -m32 hasn't been acted upon and
> supports_split_stack falsely returns true.
>
> Andreas.
>
Lynn A. Boger July 30, 2015, 5:46 p.m. UTC | #5
Can this patch be submitted to fix the ppc 32 bootstrap error?

On 06/19/2015 07:58 AM, Andreas Schwab wrote:
>> 	* go-lang.c (go_langhook_init_options_struct): Don't set
>> 	x_flag_split_stack.
>> 	(go_langhook_post_options): Set it here instead.
>> ---
>>   gcc/go/go-lang.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
>> index ce4dd9b..d952e0f 100644
>> --- a/gcc/go/go-lang.c
>> +++ b/gcc/go/go-lang.c
>> @@ -158,10 +158,6 @@ go_langhook_init_options_struct (struct gcc_options *opts)
>>     opts->x_flag_errno_math = 0;
>>     opts->frontend_set_flag_errno_math = true;
>>   
>> -  /* We turn on stack splitting if we can.  */
>> -  if (targetm_common.supports_split_stack (false, opts))
>> -    opts->x_flag_split_stack = 1;
>> -
>>     /* Exceptions are used to handle recovering from panics.  */
>>     opts->x_flag_exceptions = 1;
>>     opts->x_flag_non_call_exceptions = 1;
>> @@ -295,6 +291,11 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>>         && global_options.x_write_symbols == NO_DEBUG)
>>       global_options.x_write_symbols = PREFERRED_DEBUGGING_TYPE;
>>   
>> +  /* We turn on stack splitting if we can.  */
>> +  if (!global_options_set.x_flag_split_stack
>> +      && targetm_common.supports_split_stack (false, &global_options))
>> +    global_options.x_flag_split_stack = 1;
>> +
>>     /* Returning false means that the backend should be used.  */
>>     return false;
>>   }
> This fixes the bootstrap error, and probably makes it possible to use
> DEFAULT_ABI in rs6000_supports_split_stack.
>
> Andreas.
>
Ian Lance Taylor July 30, 2015, 10:41 p.m. UTC | #6
On Thu, Jul 30, 2015 at 10:46 AM, Lynn A. Boger
<laboger@linux.vnet.ibm.com> wrote:
> Can this patch be submitted to fix the ppc 32 bootstrap error?
>
> On 06/19/2015 07:58 AM, Andreas Schwab wrote:
>>>
>>>         * go-lang.c (go_langhook_init_options_struct): Don't set
>>>         x_flag_split_stack.
>>>         (go_langhook_post_options): Set it here instead.

This is OK.

Thanks.

Ian
diff mbox

Patch

diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index ce4dd9b..d952e0f 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -158,10 +158,6 @@  go_langhook_init_options_struct (struct gcc_options *opts)
   opts->x_flag_errno_math = 0;
   opts->frontend_set_flag_errno_math = true;
 
-  /* We turn on stack splitting if we can.  */
-  if (targetm_common.supports_split_stack (false, opts))
-    opts->x_flag_split_stack = 1;
-
   /* Exceptions are used to handle recovering from panics.  */
   opts->x_flag_exceptions = 1;
   opts->x_flag_non_call_exceptions = 1;
@@ -295,6 +291,11 @@  go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
       && global_options.x_write_symbols == NO_DEBUG)
     global_options.x_write_symbols = PREFERRED_DEBUGGING_TYPE;
 
+  /* We turn on stack splitting if we can.  */
+  if (!global_options_set.x_flag_split_stack
+      && targetm_common.supports_split_stack (false, &global_options))
+    global_options.x_flag_split_stack = 1;
+
   /* Returning false means that the backend should be used.  */
   return false;
 }