re PR debug/77773 (Segfault when compiling __simd64_float16_t using arm-none-eabi...
authorAldy Hernandez <aldyh@redhat.com>
Fri, 28 Oct 2016 16:41:29 +0000 (16:41 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Fri, 28 Oct 2016 16:41:29 +0000 (16:41 +0000)
PR debug/77773
* c-pretty-print.c (simple_type_specifier): Do not dereference `t'
if NULL.

From-SVN: r241653

gcc/c-family/ChangeLog
gcc/c-family/c-pretty-print.c

index 15d7488..6e96761 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-28  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR debug/77773
+       * c-pretty-print.c (simple_type_specifier): Do not dereference `t'
+       if NULL.
+
 2016-10-25  Jakub Jelinek  <jakub@redhat.com>
 
        * c-common.h (enum rid): Add RID_BUILTIN_LAUNDER.
index 90428ca..7ad5900 100644 (file)
@@ -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);