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]
Other format: [Raw text]

Re: GCC-3.2.2 pre-release [and PR 9493]


> 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?

No, I guess the fix is correct - it is merely looking for loop preheader
and should crash when there is empty block at the end of insn stream.

Honza
>   
> > -- 
> > Eric Botcazou
> 
> -- 
> Q. What's more of a headache than a bug in a compiler.
> A. Bugs in six compilers.  -- Mark Johnson


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