From 52e1b91e7156bff9cfdb553eabb4acfb64ecaec6 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Fri, 28 Oct 2016 16:41:29 +0000 Subject: [PATCH] re PR debug/77773 (Segfault when compiling __simd64_float16_t using arm-none-eabi-g++ with debug information) PR debug/77773 * c-pretty-print.c (simple_type_specifier): Do not dereference `t' if NULL. From-SVN: r241653 --- gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-pretty-print.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 15d7488ba04..6e967619263 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-10-28 Aldy Hernandez + + PR debug/77773 + * c-pretty-print.c (simple_type_specifier): Do not dereference `t' + if NULL. + 2016-10-25 Jakub Jelinek * c-common.h (enum rid): Add RID_BUILTIN_LAUNDER. diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 90428cac183..7ad59003456 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -344,14 +344,17 @@ c_pretty_printer::simple_type_specifier (tree t) else { int prec = TYPE_PRECISION (t); + tree common_t; if (ALL_FIXED_POINT_MODE_P (TYPE_MODE (t))) - t = c_common_type_for_mode (TYPE_MODE (t), TYPE_SATURATING (t)); + common_t = c_common_type_for_mode (TYPE_MODE (t), + TYPE_SATURATING (t)); else - t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t)); - if (TYPE_NAME (t)) + common_t = c_common_type_for_mode (TYPE_MODE (t), + TYPE_UNSIGNED (t)); + if (common_t && TYPE_NAME (common_t)) { - simple_type_specifier (t); - if (TYPE_PRECISION (t) != prec) + simple_type_specifier (common_t); + if (TYPE_PRECISION (common_t) != prec) { pp_colon (this); pp_decimal_int (this, prec); -- 2.30.2