From 74ef65a0257a7a4b38c685a38c8f42b5c251a870 Mon Sep 17 00:00:00 2001 From: Bill Seurer Date: Tue, 10 Jan 2017 19:11:55 +0000 Subject: [PATCH] backport: re PR sanitizer/65479 (sanitizer stack trace missing frames past #0 on powerpc64) 2017-01-10 Bill Seurer Backport from mainline 2016-12-21 Bill Seurer PR sanitizer/65479 * config/rs6000/rs6000.c (rs6000_option_override_internal): Add -fasynchronous-unwind-tables option when -fsanitize=address is specified. From-SVN: r244284 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/rs6000/rs6000.c | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce2f7286e304..099cbe97bc20 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-01-10 Bill Seurer + + Backport from mainline + 2016-12-21 Bill Seurer + + PR sanitizer/65479 + * config/rs6000/rs6000.c (rs6000_option_override_internal): Add + -fasynchronous-unwind-tables option when -fsanitize=address is + specified. + 2017-01-10 Martin Liska Backport from mainline diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c66bfb0b5e5e..5bba64e9c07d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3268,6 +3268,13 @@ rs6000_option_override_internal (bool global_init_p) && !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) { -- 2.47.2