GCC-3.2.2 pre-release [and PR 9493]
Joe Buck
jbuck@synopsys.com
Wed Jan 29 22:50:00 GMT 2003
On Wed, Jan 29, 2003 at 09:07:44PM +0100, Eric Botcazou wrote:
> The following one-liner certainly makes the segfault go away, but I don't
> know if the assembly output is valid (I don't speak PA-RISC).
>
> Index: gcc/cfgcleanup.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
> retrieving revision 1.38.2.4.2.1
> diff -u -p -r1.38.2.4.2.1 cfgcleanup.c
> --- gcc/cfgcleanup.c 16 Nov 2002 01:55:47 -0000 1.38.2.4.2.1
> +++ gcc/cfgcleanup.c 29 Jan 2003 19:56:17 -0000
> @@ -469,7 +469,7 @@ try_forward_edges (mode, b)
> && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
> break;
>
> - if (GET_CODE (insn) == NOTE)
> + if (insn && GET_CODE (insn) == NOTE)
> break;
> }
It would appear that a null-pointer check can't make things worse, but
it does raise a question as to whether this merely masks a bug that is
somewhere else: is the compiler legitimately expecting a non-null pointer
here?
> --
> Eric Botcazou
--
Q. What's more of a headache than a bug in a compiler.
A. Bugs in six compilers. -- Mark Johnson
More information about the Gcc
mailing list