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]

Re: Patch to expand_end_bindings


Jason Merrill wrote:
> 
> Avoids spurious warnings about falling off the end of the function in
> the presence of automatic arrays with cleanups.  g++.warn/flow1.C.
> 
> 2000-05-24  Jason Merrill  <jason@casey.soma.redhat.com>
> 
>         * stmt.c (expand_end_bindings): Look through NOTEs to find a
>         BARRIER.
This ICE's in g++.jason/destruct.C, as it has a region has no non-NOTE
isns, and insn endsup being NULL. Attached is a patch, which fixes it.
Looks obvious, ok? tested on i686-pc-linux-gnu

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-05-25  Nathan Sidwell  <nathan@codesourcery.com>

	* stmt.c (expand_end_bindings): Cope with no non-NOTE insts.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
retrieving revision 1.145
diff -c -3 -p -r1.145 stmt.c
*** stmt.c	2000/05/25 00:36:28	1.145
--- stmt.c	2000/05/25 16:34:29
*************** expand_end_bindings (vars, mark_ends, do
*** 3688,3694 ****
        insn = get_last_insn ();
        if (GET_CODE (insn) == NOTE)
  	insn = prev_nonnote_insn (insn);
!       reachable = GET_CODE (insn) != BARRIER;
        
        /* Do the cleanups.  */
        expand_cleanups (thisblock->data.block.cleanups, NULL_TREE, 0, reachable);
--- 3688,3694 ----
        insn = get_last_insn ();
        if (GET_CODE (insn) == NOTE)
  	insn = prev_nonnote_insn (insn);
!       reachable = !insn || GET_CODE (insn) != BARRIER;
        
        /* Do the cleanups.  */
        expand_cleanups (thisblock->data.block.cleanups, NULL_TREE, 0, reachable);

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