diff mbox

[v2,rs6000] pr65479 Add -fasynchronous-unwind-tables when the -fsanitize=address option is seen

Message ID 651abb40-e071-781c-35c3-87b30ba2da0b@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bill Seurer Dec. 21, 2016, 3:29 p.m. UTC
[PATCH, v2, rs6000] pr65479 Add -fasynchronous-unwind-tables when the -fsanitize=address option is seen.

All feedback from the earlier version has been taken into account now.

This patch adds the -fasynchronous-unwind-tables option to compilations when
the -fsanitize=address option is seen but not if any
-fasynchronous-unwind-tables options were already specified.
-fasynchronous-unwind-tables causes a full strack trace to be produced when
the sanitizer detects an error.  Without the full trace several of the asan
test cases fail on powerpc.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65479 for more information.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu,
powerpc64be-unknown-linux-gnu, and x86_64-pc-linux-gnu with no regressions.
Is this ok for trunk?

[gcc]

2016-12-21  Bill Seurer  <seurer@linux.vnet.ibm.com>

	PR sanitizer/65479
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Add 
	-fasynchronous-unwind-tables option when -fsanitize=address is
	specified.

Comments

Segher Boessenkool Dec. 21, 2016, 6:12 p.m. UTC | #1
On Wed, Dec 21, 2016 at 09:29:26AM -0600, Bill Seurer wrote:
> [PATCH, v2, rs6000] pr65479 Add -fasynchronous-unwind-tables when the -fsanitize=address option is seen.
> 
> All feedback from the earlier version has been taken into account now.
> 
> This patch adds the -fasynchronous-unwind-tables option to compilations when
> the -fsanitize=address option is seen but not if any
> -fasynchronous-unwind-tables options were already specified.
> -fasynchronous-unwind-tables causes a full strack trace to be produced when
> the sanitizer detects an error.  Without the full trace several of the asan
> test cases fail on powerpc.
> 
> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65479 for more information.
> 
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu,
> powerpc64be-unknown-linux-gnu, and x86_64-pc-linux-gnu with no regressions.
> Is this ok for trunk?

That looks fine.  One super-minor comment.  Thanks!

Segher


> 2016-12-21  Bill Seurer  <seurer@linux.vnet.ibm.com>
> 
> 	PR sanitizer/65479
> 	* config/rs6000/rs6000.c (rs6000_option_override_internal): Add 

Trailing space here.

> 	-fasynchronous-unwind-tables option when -fsanitize=address is
> 	specified.
> 
> Index: gcc/config/rs6000/rs6000.c
> ===================================================================
> --- gcc/config/rs6000/rs6000.c	(revision 243830)
> +++ gcc/config/rs6000/rs6000.c	(working copy)
> @@ -3858,6 +3858,13 @@ rs6000_option_override_internal (bool global_init_
>        && !global_options_set.x_flag_ira_loop_pressure)
>      flag_ira_loop_pressure = 1;
>  
> +  /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in order
> +     for tracebacks to be complete but not if any -fasynchronous-unwind-tables
> +     options were already specified.  */
> +  if (flag_sanitize & SANITIZE_USER_ADDRESS
> +      && !global_options_set.x_flag_asynchronous_unwind_tables)
> +    flag_asynchronous_unwind_tables = 1;
> +
>    /* Set the pointer size.  */
>    if (TARGET_64BIT)
>      {
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 243830)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -3858,6 +3858,13 @@  rs6000_option_override_internal (bool global_init_
       && !global_options_set.x_flag_ira_loop_pressure)
     flag_ira_loop_pressure = 1;
 
+  /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in order
+     for tracebacks to be complete but not if any -fasynchronous-unwind-tables
+     options were already specified.  */
+  if (flag_sanitize & SANITIZE_USER_ADDRESS
+      && !global_options_set.x_flag_asynchronous_unwind_tables)
+    flag_asynchronous_unwind_tables = 1;
+
   /* Set the pointer size.  */
   if (TARGET_64BIT)
     {