public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: vmakarov@gcc.gnu.org To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, vmakarov@gcc.gnu.org, vmakarov@redhat.com Subject: Re: c/6875: IA64 compiler crash when -O3 Date: Thu, 30 May 2002 16:12:00 -0000 [thread overview] Message-ID: <20020530231015.30308.qmail@sources.redhat.com> (raw) Synopsis: IA64 compiler crash when -O3 State-Changed-From-To: open->analyzed State-Changed-By: vmakarov State-Changed-When: Thu May 30 16:10:13 2002 State-Changed-Why: The problem occurs because tree inliner creates a label in expand_call_inline (tp, walk_subtrees, data) { ... /* Return statements in the function body will be replaced by jumps to the RET_LABEL. */ id->ret_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); ... } The label is expanded twice in expand_call for normal call and sibling call. The corresponding RTL CODE_LABEL is generated only once for sibling call because of the standard code: rtx label_rtx (label) tree label; { if (TREE_CODE (label) != LABEL_DECL) abort (); if (!DECL_RTL_SET_P (label)) SET_DECL_RTL (label, gen_label_rtx ()); return DECL_RTL (label); } So we have usage of the RTL label in two code sequences and the CODE_LABEL (29) only definitio in sibling call. Here the code for sibling code: (note 11 0 13 0x20000000006e6c80 NOTE_INSN_BLOCK_BEG) (insn 13 11 14 (set (reg:SI 343) (const_int 1 [0x1])) -1 (nil) (expr_list:REG_EQUAL (const_int 1 [0x1]) (nil))) (insn 14 13 15 (set (mem/f:SI (addressof:DI (reg/v:SI 342) 341 0x20000000006edfb0) [2 x+0 S4 A32]) (reg:SI 343)) -1 (nil) (nil)) (note 15 14 16 NOTE_INSN_DELETED) (note 16 15 18 NOTE_INSN_DELETED) (insn 18 16 20 (set (reg:DI 120 out0) (addressof:DI (reg/v:SI 342) 341 0x20000000006edfb0)) -1 (nil) (nil)) (insn 20 18 21 (set (reg:DI 345) (reg:DI 1 r1)) -1 (nil) (nil)) (call_insn 21 20 23 (parallel[ (set (reg:SI 8 r8) (call (mem:DI (symbol_ref/v:DI ("nothing")) [0 S8 A64]) (const_int 1 [0x1]))) (use (unspec[ (reg:DI 1 r1) ] 9)) (clobber (reg:DI 320 b0)) ] ) -1 (nil) (nil) (expr_list (use (reg:DI 120 out0)) (nil))) (insn 23 21 24 (set (reg:DI 1 r1) (reg:DI 345)) -1 (nil) (nil)) (insn 24 23 25 (set (reg:DI 346) (plus:DI (reg:DI 1 r1) (symbol_ref/v:DI ("fi")))) -1 (nil) (nil)) (insn 25 24 26 (set (reg/v/f:DI 344) (mem/u:DI (reg:DI 346) [0 S8 A64])) -1 (nil) (nil)) (jump_insn 26 25 27 (set (pc) (label_ref 29)) -1 (nil) (nil)) (barrier 27 26 28) (note 28 27 29 0x20000000006e6c80 NOTE_INSN_BLOCK_END) (code_label 29 28 31 2 "" "" [0 uses]) ^^^^^^^^^^^^^^^^^^^ (insn 31 29 33 (set (reg:SI 120 out0) (const_int 2 [0x2])) -1 (nil) (nil)) (insn 33 31 35 (set (reg:DI 345) (reg:DI 1 r1)) -1 (nil) (nil)) (insn 35 33 37 (set (reg:DI 347) (mem:DI (reg/v/f:DI 344) [0 S8 A64])) -1 (nil) (nil)) (insn 37 35 38 (set (reg:DI 348) (reg/v/f:DI 344)) -1 (nil) (nil)) (insn 38 37 40 (set (reg/f:DI 349) (plus:DI (reg/v/f:DI 344) (const_int 8 [0x8]))) -1 (nil) (nil)) (insn 40 38 41 (set (reg:DI 1 r1) (mem:DI (reg/f:DI 349) [0 S8 A64])) -1 (nil) (nil)) (call_insn 41 40 43 (parallel[ (set (reg:SI 8 r8) (call (mem:DI (reg:DI 347) [0 S8 A64]) (const_int 1 [0x1]))) (use (unspec[ (reg:DI 1 r1) ] 9)) (clobber (reg:DI 320 b0)) ] ) -1 (nil) (nil) (expr_list (use (reg:SI 120 out0)) (nil))) (insn 43 41 45 (set (reg:DI 1 r1) (reg:DI 345)) -1 (nil) (nil)) (insn 45 43 0 (set (reg:SI 350) (reg:SI 8 r8)) -1 (nil) (nil)) Here the code for normal call is: (note 50 0 52 0x20000000006e6c80 NOTE_INSN_BLOCK_BEG) (insn 52 50 53 (set (reg:SI 351) (const_int 1 [0x1])) -1 (nil) (expr_list:REG_EQUAL (const_int 1 [0x1]) (nil))) (insn 53 52 54 (set (mem/f:SI (addressof:DI (reg/v:SI 342) 341 0x20000000006edfb0) [2 x+0 S4 A32]) (reg:SI 351)) -1 (nil) (nil)) (note 54 53 55 NOTE_INSN_DELETED) (note 55 54 57 NOTE_INSN_DELETED) (insn 57 55 59 (set (reg:DI 120 out0) (addressof:DI (reg/v:SI 342) 341 0x20000000006edfb0)) -1 (nil) (nil)) (insn 59 57 60 (set (reg:DI 345) (reg:DI 1 r1)) -1 (nil) (nil)) (call_insn 60 59 62 (parallel[ (set (reg:SI 8 r8) (call (mem:DI (symbol_ref/v:DI ("nothing")) [0 S8 A64]) (const_int 1 [0x1]))) (use (unspec[ (reg:DI 1 r1) ] 9)) (clobber (reg:DI 320 b0)) ] ) -1 (nil) (nil) (expr_list (use (reg:DI 120 out0)) (nil))) (insn 62 60 63 (set (reg:DI 1 r1) (reg:DI 345)) -1 (nil) (nil)) (insn 63 62 64 (set (reg:DI 352) (plus:DI (reg:DI 1 r1) (symbol_ref/v:DI ("fi")))) -1 (nil) (nil)) (insn 64 63 65 (set (reg/v/f:DI 344) (mem/u:DI (reg:DI 352) [0 S8 A64])) -1 (nil) (nil)) (jump_insn 65 64 66 (set (pc) (label_ref 29)) -1 (nil) (nil)) ^^^^^^^^^^^^^^^^^^^^ There is no corresponding label_code. (barrier 66 65 67) (note 67 66 69 0x20000000006e6c80 NOTE_INSN_BLOCK_END) (insn 69 67 71 (set (reg:SI 120 out0) (const_int 2 [0x2])) -1 (nil) (nil)) (insn 71 69 73 (set (reg:DI 345) (reg:DI 1 r1)) -1 (nil) (nil)) (insn 73 71 75 (set (reg:DI 353) (mem:DI (reg/v/f:DI 344) [0 S8 A64])) -1 (nil) (nil)) (insn 75 73 76 (set (reg:DI 354) (reg/v/f:DI 344)) -1 (nil) (nil)) (insn 76 75 78 (set (reg/f:DI 355) (plus:DI (reg/v/f:DI 344) (const_int 8 [0x8]))) -1 (nil) (nil)) (insn 78 76 79 (set (reg:DI 1 r1) (mem:DI (reg/f:DI 355) [0 S8 A64])) -1 (nil) (nil)) (call_insn 79 78 81 (parallel[ (set (reg:SI 8 r8) (call (mem:DI (reg:DI 353) [0 S8 A64]) (const_int 1 [0x1]))) (use (unspec[ (reg:DI 1 r1) ] 9)) (clobber (reg:DI 320 b0)) ] ) -1 (nil) (nil) (expr_list (use (reg:SI 120 out0)) (nil))) (insn 81 79 83 (set (reg:DI 1 r1) (reg:DI 345)) -1 (nil) (nil)) (insn 83 81 0 (set (reg:SI 356) (reg:SI 8 r8)) -1 (nil) (nil)) After that the normal call code is choosen in sibling optimization and the compiler crashes in cfg.c Program received signal SIGSEGV, Segmentation fault. cached_make_edge (edge_cache=0x0, src=0x600000000010a670, dst=0x0, flags=0) at /home/vmakarov/build/gcc-31-branch/gcc/gcc/cfg.c:307 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6875
next reply other threads:[~2002-05-30 23:10 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-05-30 16:12 vmakarov [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-04-15 16:18 ehrhardt 2003-01-01 18:36 Nathanael Nerode 2002-05-30 16:16 vmakarov 2002-05-30 16:10 vmakarov 2002-05-30 16:08 vmakarov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020530231015.30308.qmail@sources.redhat.com \ --to=vmakarov@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ --cc=gcc-gnats@gcc.gnu.org \ --cc=gcc-prs@gcc.gnu.org \ --cc=vmakarov@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).