aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-09-05 02:17:56 +0000
committerJim Wilson <wilson@gcc.gnu.org>1997-09-04 19:17:56 -0700
commitf4da78811e4cfecc28779c94a861c305b6ac078d (patch)
tree5e88a112196e8740cec41ec1b21a62e8217591dd /gcc/profile.c
parentc1090daa150d8d2120c60c83b0d400eb4944d80b (diff)
downloadgcc-f4da78811e4cfecc28779c94a861c305b6ac078d.zip
gcc-f4da78811e4cfecc28779c94a861c305b6ac078d.tar.gz
gcc-f4da78811e4cfecc28779c94a861c305b6ac078d.tar.bz2
Fix another -fprofile-arcs bug from Joseph Myers <jsm28@cam.ac.uk>.
* profile.c (output_arc_profiler): Check next_insert_after for non NULL before deferencing it. From-SVN: r15090
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index 5360090..b2b65b5 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -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));