This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix latent bug in optabs
- From: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Jan 2003 10:09:50 +0100
- Subject: Re: Fix latent bug in optabs
- References: <20030105151805.GA6720@artax.karlin.mff.cuni.cz>
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.