re PR target/83514 (ABRT in arm_declare_function_name passing a null pointer to std...
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Thu, 11 Jan 2018 12:13:42 +0000 (12:13 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Thu, 11 Jan 2018 12:13:42 +0000 (12:13 +0000)
2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/83514
* config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
targ_options->x_arm_arch_string is non NULL.

From-SVN: r256529

gcc/ChangeLog
gcc/config/arm/arm.c

index 48e2def073f89f6d695e66fa8e1b40936e168ccb..7ff69030e1ad989bf2973cc049b10de82e63de30 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
+
+       PR target/83514
+       * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
+       targ_options->x_arm_arch_string is non NULL.
+
 2018-01-11  Tamar Christina  <tamar.christina@arm.com>
 
        * config/aarch64/aarch64.h
index 196aa6de1ac34293232828c455949771b3d9c2a2..978c44af327b6769c161eeee20ca08300e41d033 100644 (file)
@@ -30953,8 +30953,13 @@ arm_declare_function_name (FILE *stream, const char *name, tree decl)
   gcc_assert (targ_options);
 
   /* Only update the assembler .arch string if it is distinct from the last
-     such string we printed.  */
-  std::string arch_to_print = targ_options->x_arm_arch_string;
+     such string we printed. arch_to_print is set conditionally in case
+     targ_options->x_arm_arch_string is NULL which can be the case
+     when cc1 is invoked directly without passing -march option.  */
+  std::string arch_to_print;
+  if (targ_options->x_arm_arch_string)
+    arch_to_print = targ_options->x_arm_arch_string;
+
   if (arch_to_print != arm_last_printed_arch_string)
     {
       std::string arch_name