Bug 46546 - ix86_pad_returns may leave BB_END (bb) pointing to deleted insn
Summary: ix86_pad_returns may leave BB_END (bb) pointing to deleted insn
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Uroš Bizjak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 19:49 UTC by H.J. Lu
Modified: 2010-11-19 00:20 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-11-18 22:09:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2010-11-18 19:49:14 UTC
ix86_pad_returns has

    rtx ret = BB_END (bb);
...
          emit_jump_insn_before (gen_return_internal_long (), ret); 
          delete_insn (ret);
...

It may leave BB_END (bb) pointing to deleted insn. A patch is posed at

http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01930.html
Comment 1 Uroš Bizjak 2010-11-18 22:09:38 UTC
I have a fix.
Comment 2 uros 2010-11-18 23:46:16 UTC
Author: uros
Date: Thu Nov 18 23:46:13 2010
New Revision: 166921

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166921
Log:
	PR target/46546
	* config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
Comment 3 H.J. Lu 2010-11-19 00:20:38 UTC
Fixed.