maybe fix vax casesi

Matt Thomas matt@3am-software.com
Wed Jun 19 11:56:00 GMT 2002


It works except the case when the loop is the last thing
in a void function.  The attached file shows this or you
if the gdb output below helps.

   note = last_loop_beg_note (e->src->end);
! note = NEXT_INSN (note);
!

At this point note can be NULL.

! /* ... and ADDR_VECs. */
! if (GET_CODE (note) == CODE_LABEL
! && NEXT_INSN (note)

Program received signal SIGSEGV, Segmentation fault.
0x80e246a in force_nonfallthru_and_redirect (e=0x83b8b48, target=0x83b8418)
     at /export/toolchain/gcc/gcc/cfgrtl.c:972
972           if (GET_CODE (note) == CODE_LABEL
(gdb) where
#0  0x80e246a in force_nonfallthru_and_redirect (e=0x83b8b48, target=0x83b8418)
     at /export/toolchain/gcc/gcc/cfgrtl.c:972
#1  0x80e2889 in force_nonfallthru (e=0x83b8b48)
     at /export/toolchain/gcc/gcc/cfgrtl.c:1040
#2  0x82b6320 in fixup_reorder_chain ()
     at /export/toolchain/gcc/gcc/cfglayout.c:506
#3  0x82b73e4 in cfg_layout_finalize ()
     at /export/toolchain/gcc/gcc/cfglayout.c:950
#4  0x82acb45 in reorder_basic_blocks ()
     at /export/toolchain/gcc/gcc/bb-reorder.c:276
#5  0x8271ea4 in rest_of_compilation (decl=0x484c9a80)
     at /export/toolchain/gcc/gcc/toplev.c:3392
#6  0x80707dd in c_expand_body (fndecl=0x484c9a80, nested_p=0, can_defer_p=1)
     at /export/toolchain/gcc/gcc/c-decl.c:6902
#7  0x8070353 in finish_function (nested=0, can_defer_p=1)
     at /export/toolchain/gcc/gcc/c-decl.c:6769
#8  0x804b276 in yyparse () at c-parse.y:396
#9  0x805700b in c_common_parse_file (set_yydebug=0)
     at /export/toolchain/gcc/gcc/c-lex.c:165
#10 0x826f5ff in compile_file () at /export/toolchain/gcc/gcc/toplev.c:2094
#11 0x82754ce in do_compile () at /export/toolchain/gcc/gcc/toplev.c:5185
#12 0x827553f in toplev_main (argc=4, argv=0xbfbfdafc)
     at /export/toolchain/gcc/gcc/toplev.c:5217
---Type <return> to continue, or q <return> to quit---
#13 0x80c317e in main (argc=4, argv=0xbfbfdafc)
     at /export/toolchain/gcc/gcc/main.c:35
#14 0x8049610 in ___start ()
(gdb) list
967           /* Position the new block correctly relative to loop notes.  */
968           note = last_loop_beg_note (e->src->end);
969           note = NEXT_INSN (note);
970
971           /* ... and ADDR_VECs.  */
972           if (GET_CODE (note) == CODE_LABEL
973               && NEXT_INSN (note)
974               && GET_CODE (NEXT_INSN (note)) == JUMP_INSN
975               && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC
976                   || GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_VEC))
(gdb)
977             note = NEXT_INSN (NEXT_INSN (note));
978
979           jump_block = create_basic_block (note, NULL, e->src);
980           jump_block->count = e->count;
981           jump_block->frequency = EDGE_FREQUENCY (e);
982           jump_block->loop_depth = target->loop_depth;
983
984           if (target->global_live_at_start)
985             {
986               jump_block->global_live_at_start
(gdb) print note
$1 = 0x0



-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cat.i
Type: application/octet-stream
Size: 43376 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020619/820811c5/attachment.obj>


More information about the Gcc-patches mailing list