Fix another -fprofile-arcs bug from Joseph Myers <jsm28@cam.ac.uk>.
authorJim Wilson <wilson@cygnus.com>
Fri, 5 Sep 1997 02:17:56 +0000 (02:17 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 5 Sep 1997 02:17:56 +0000 (19:17 -0700)
* profile.c (output_arc_profiler): Check next_insert_after for non
NULL before deferencing it.

From-SVN: r15090

gcc/ChangeLog
gcc/profile.c

index 430ecb1a444b511f6c3e6292787da4de1c17508d..039e40816933fd7f37aecf0dfac7c1270583b4af 100644 (file)
@@ -1,5 +1,8 @@
 Thu Sep  4 15:02:27 1997  Jim Wilson  <wilson@cygnus.com>
 
+       * profile.c (output_arc_profiler): Check next_insert_after for non
+       NULL before deferencing it.
+
        * i386/t-sol2 (TARGET_LIBGCC2_CFLAGS): Define to -fPIC.
 
 Thu Sep  4 14:51:57 1997  Jeffrey A Law  (law@cygnus.com)
index 5360090ee847b3cc24c4a9f8e6ad0a55a37f080b..b2b65b598ac89a8d2473244ed9294cc030100731 100644 (file)
@@ -1537,12 +1537,14 @@ output_arc_profiler (arcno, insert_after)
       rtx next_insert_after = next_nonnote_insn (insert_after);
 
       /* The first insn after the call may be a stack pop, skip it.  */
-      if (GET_CODE (next_insert_after) == INSN
+      if (next_insert_after
+         && GET_CODE (next_insert_after) == INSN
          && GET_CODE (PATTERN (next_insert_after)) == SET
          && SET_DEST (PATTERN (next_insert_after)) == stack_pointer_rtx)
        next_insert_after = next_nonnote_insn (next_insert_after);
 
-      if (GET_CODE (next_insert_after) == INSN)
+      if (next_insert_after
+         && GET_CODE (next_insert_after) == INSN)
        {
          if (GET_CODE (PATTERN (insert_after)) == SET)
            return_reg = SET_DEST (PATTERN (insert_after));