sysv4.h (ASM_OUTPUT_SECTION_NAME): Check to make sure DECL is non-null before trying...
authorBrendan Kehoe <brendan@gcc.gnu.org>
Mon, 13 Feb 1995 06:11:50 +0000 (01:11 -0500)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Mon, 13 Feb 1995 06:11:50 +0000 (01:11 -0500)
Sun Feb 12 20:20:28 1995  Brendan Kehoe  (brendan@lisa.cygnus.com)

        * config/sparc/sysv4.h (ASM_OUTPUT_SECTION_NAME): Check to make
        sure DECL is non-null before trying to reference it.
        * config/mips/elf64.h (ASM_OUTPUT_SECTION_NAME): Likewise.

From-SVN: r8915

gcc/config/mips/elf64.h
gcc/config/sparc/sysv4.h

index 76d8459..33c8872 100644 (file)
@@ -80,9 +80,9 @@ do {                                                  \
 #define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME) \
 do {                                                           \
   extern FILE *asm_out_text_file;                              \
-  if (TREE_CODE (DECL) == FUNCTION_DECL)                       \
+  if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)             \
     fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
-  else if (TREE_READONLY (DECL))                               \
+  else if ((DECL) && TREE_READONLY (DECL))                     \
     fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));    \
   else                                                         \
     fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));   \
index 96035f3..8d71501 100644 (file)
@@ -183,9 +183,9 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3);            \
 #undef ASM_OUTPUT_SECTION_NAME /* Override svr4.h's definition.  */
 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
 do {                                                                   \
-  if (TREE_CODE (DECL) == FUNCTION_DECL)                               \
+  if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)                     \
     fprintf (FILE, ".section\t\"%s\",#alloc,#execinstr\n", (NAME));    \
-  else if (TREE_READONLY (DECL))                                       \
+  else if ((DECL) && TREE_READONLY (DECL))                             \
     fprintf (FILE, ".section\t\"%s\",#alloc\n", (NAME));               \
   else                                                                 \
     fprintf (FILE, ".section\t\"%s\",#alloc,#write\n", (NAME));                \