aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-pretty-print.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2016-10-28 16:41:29 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2016-10-28 16:41:29 +0000
commit52e1b91e7156bff9cfdb553eabb4acfb64ecaec6 (patch)
tree57f0e6995a01567e1c4587d2b02e241704c80b34 /gcc/c-family/c-pretty-print.c
parenta563e6e9a1e3e7b3378b5f1e1596b6810f51942c (diff)
downloadgcc-52e1b91e7156bff9cfdb553eabb4acfb64ecaec6.zip
gcc-52e1b91e7156bff9cfdb553eabb4acfb64ecaec6.tar.gz
gcc-52e1b91e7156bff9cfdb553eabb4acfb64ecaec6.tar.bz2
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
Diffstat (limited to 'gcc/c-family/c-pretty-print.c')
-rw-r--r--gcc/c-family/c-pretty-print.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 90428ca..7ad5900 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);