I386 strlen "fix" (giveup)

Richard Henderson rth@cygnus.com
Fri Mar 10 14:39:00 GMT 2000


On Fri, Mar 10, 2000 at 11:48:04AM -0800, Jason Merrill wrote:
> This broke tiomisc.cc on Linux/x86, since we end up here at the very
> beginning of a sequence, when last_insn is null.  Here's a patch; does
> this seem like the way to fix this problem?

How about this?  I don't like NOTE_INSN_DELETED if I can avoid it.


r~



Index: builtins.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/builtins.c,v
retrieving revision 1.34
diff -c -p -d -r1.34 builtins.c
*** builtins.c	2000/03/08 19:21:13	1.34
--- builtins.c	2000/03/10 22:38:09
*************** expand_builtin_strlen (exp, target, mode
*** 1407,1413 ****
  	emit_move_insn (src_reg, pat);
        pat = gen_sequence ();
        end_sequence ();
!       emit_insn_after (pat, before_strlen);
  
        /* Return the value in the proper mode for this function.  */
        if (GET_MODE (result) == value_mode)
--- 1407,1417 ----
  	emit_move_insn (src_reg, pat);
        pat = gen_sequence ();
        end_sequence ();
! 
!       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)


More information about the Gcc-patches mailing list