This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFC expand_builtin_strlen ()



  In message <389ADF4C.9141B73F@rcp.co.uk>you write:
  > All
  > 
  > The following code exits in expand_builtin_strlen() builtins.c
  > 
  > 	emit_insn (GEN_FCN (icode)(result, ...));
  > 
  > This calls gen_strlensi () which is generated from the 
  > define_expand "strlensi" pattern in the MD file.
  > 
  > On the x86 (latest CVS) this expander may fail and exit using
  > the FAIL macro this results in gen_strlensi () returning a NULL_RTX.
  > This NULL_RTX result is passed to emit_insn () which is obviously 
  > ther wrong thing to do. 
  > 
  > I think the above should be written so that if the expander
  > fails the compiler falls back to the strlen() library call
  > and pass the bogus NULL_RTX to emit_insn ().
  > 
  > 	expanded_rtx = GEN_FCN (icode)(result, ...);
  > 	if (!expanded_rtx)
  >   	   return NULL_RTX;
  > 
  > 	emit_insn (expanded_rtx);
Agreed.  cmpstrsi has the same problem.  I'll post a patch shortly.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]