From fca9f642280728a9a473e755571b76219a368aea Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 10 Mar 2000 16:30:06 -0800 Subject: [PATCH] builtins.c (expand_builtin_strlen): Revert last change. * builtins.c (expand_builtin_strlen): Revert last change. Use emit_insn_before if we're at the beginning of a sequence. From-SVN: r32476 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e56848c5937..222f6aa0a46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-03-10 Richard Henderson + + * builtins.c (expand_builtin_strlen): Revert last change. + Use emit_insn_before if we're at the beginning of a sequence. + 2000-03-10 Jason Merrill * builtins.c (expand_builtin_strlen): Make sure that we have something diff --git a/gcc/builtins.c b/gcc/builtins.c index 14dddf1a9db..7da5161aa9b 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1381,8 +1381,6 @@ expand_builtin_strlen (exp, target, mode) /* Mark the beginning of the strlen sequence so we can emit the source operand later. */ before_strlen = get_last_insn(); - if (before_strlen == NULL_RTX) - before_strlen = emit_note (0, NOTE_INSN_DELETED); /* Check the string is readable and has an end. */ if (current_function_check_memory_usage) @@ -1409,7 +1407,11 @@ expand_builtin_strlen (exp, target, mode) emit_move_insn (src_reg, pat); pat = gen_sequence (); end_sequence (); - emit_insn_after (pat, before_strlen); + + if (before_strlen) + emit_insn_after (pat, before_strlen); + else + emit_insn_before (pat, get_insns ()); /* Return the value in the proper mode for this function. */ if (GET_MODE (result) == value_mode)