This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Fix latent bug in optabs


Cau,

muzu to commitnout do hammer branche?
Melo by to opravit segfault pri buildovani ipv6calc na beta-i386

Pepa

> when emiting a libcall whose parameter is large
> (for example "struct { unsigned char b[128]; } bitvec;" )
> the loop is created to copy the parameter.
> 
> When compiling my testcase, the REG_LIBCALL note was tried to attach to
> NOTE_INSN_LOOP_BEG  which of course did not success and the missing
> REG_LIBCALL note caused a segfault in gcse.
> However if the REG_LIBCALL note was attached to some "normal" instruction
> it would be wrong because the block between REG_LIBCALL and REG_RETVAL
> must be in a single basic block
> but the loop copying the parameters  was inside too.
> 
> This patch checks whether the insns between REG_LIBCALL and REG_RETVAL
> will be contained in a single basic block (by checking whether all
> instructions are not control_flow_insn_p) and
> if the insns will not be in a single basic block
> the REG_LIBCALL and REG_RETVAL notes will not be emitted.
> This fixes the problem with a source which made gcse to segfault.
> 
> Bootstrapped/regtested mainline i386 (athlon).
> OK for mainline and 3_3-branch?
> 
> Josef
> 
> 
> Sun Jan  5 15:47:06 CET 2003  Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
> 
> 	* Makefile.in (optabs.o): Add dependencies on basic-block.h and
> 	hard-reg-set.h.
> 	* basic-block.h (control_flow_insn_p): Fuction was exported.
> 	* cfgbuild.c (control_flow_insn_p): Fuction was made non-static.
> 	* optabs.c (emit_libcall_block): Emit REG_LIBCALL and REG_RETVAL
> 	notes only when the region is contained in a single basic block.


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