public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug optimization/14838] [3.3/3.4/3.5 Regression] ICE when building with -O2 -g
Date: Sun, 04 Apr 2004 20:54:00 -0000	[thread overview]
Message-ID: <20040404205415.10474.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040403221640.14838.tausq@debian.org>


------- Additional Comments From danglin at gcc dot gnu dot org  2004-04-04 20:54 -------
The ICE is generated by a call to insn_default_length in 
pa_output_function_epilogue.  It does a call to get_last_nonnote_insn
to get the last nonnote insn.  However, in this case, get_last_nonnote_insn
doesn't actually return the last nonnote insn.  It returns the next to
last nonnote insn which is the `use' insn which insn_default_length
doesn't like.

The code in get_last_nonnote_insn assumes that the last insn in the
current sequence or current function is a note.  However, when
get_last_nonnote_insn is called, the last insn is

(jump_insn 55 31 0 (parallel [
            (return)
            (use (reg:SI 2 %r2))
            (const_int 0 [0x0])
        ]) 184 {return} (insn_list:REG_DEP_ANTI 31 (insn_list 41 (nil)))
    (expr_list:REG_BR_PRED (const_int 12 [0xc])
        (expr_list:REG_DEAD (reg:SI 2 %r2)
            (nil))))

We did have the following note:

(note 71 55 0 NOTE_INSN_DELETED)

However, it is removed by a call to remove_insn:

Breakpoint 13, remove_insn (insn=0x40196580) at ../../gcc/gcc/emit-rtl.c:3578
3578      rtx next = NEXT_INSN (insn);
(gdb) bt
#0  remove_insn (insn=0x40196580) at ../../gcc/gcc/emit-rtl.c:3578
#1  0x0011bb8c in delete_insn (insn=0x40196580) at ../../gcc/gcc/cfgrtl.c:149
#2  0x00113f5c in reemit_insn_block_notes () at ../../gcc/gcc/cfglayout.c:559
#3  0x001ebef0 in final_start_function (first=0x401961a0, file=0x66ddd0,
    optimize=2) at ../../gcc/gcc/final.c:1374
#4  0x00470108 in rest_of_handle_final (decl=0x4021af50, insns=0x401961a0)
    at ../../gcc/gcc/passes.c:447

The comment for NOTE_INSN_DELETED says

  /* This note is used to get rid of an insn
     when it isn't safe to patch the insn out of the chain.  */

So, I don't think delete_insn should be trying to remove this note.  If
the note isn't removed, then get_last_nonnote_insn will work correctly
and we shouldn't get the ICE.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14838


  parent reply	other threads:[~2004-04-04 20:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-03 22:16 [Bug debug/14838] New: [hppa-linux 3.3/3.4/3.5 " tausq at debian dot org
2004-04-03 22:17 ` [Bug debug/14838] " tausq at debian dot org
2004-04-04  3:03 ` pinskia at gcc dot gnu dot org
2004-04-04  6:53 ` [Bug optimization/14838] [3.3/3.4/3.5 " pinskia at gcc dot gnu dot org
2004-04-04  8:56 ` debian-gcc at lists dot debian dot org
2004-04-04 16:50 ` danglin at gcc dot gnu dot org
2004-04-04 20:54 ` danglin at gcc dot gnu dot org [this message]
2004-04-06  0:28 ` pinskia at gcc dot gnu dot org
2004-06-11 22:22 ` [Bug rtl-optimization/14838] " pinskia at gcc dot gnu dot org
2004-08-05  6:26 ` pinskia at gcc dot gnu dot org
2004-08-05  6:58 ` giovannibajo at libero dot it
2004-08-29 18:16 ` mmitchel at gcc dot gnu dot org
2004-08-29 18:25 ` mmitchel at gcc dot gnu dot org
2004-10-06 11:31 ` [Bug rtl-optimization/14838] [3.3/3.4/4.0 " pinskia at gcc dot gnu dot org
2004-11-01  0:45 ` mmitchel at gcc dot gnu dot org
2004-11-21 14:26 ` pinskia at gcc dot gnu dot org
2004-11-23  2:15 ` cvs-commit at gcc dot gnu dot org
2004-11-23  3:02 ` cvs-commit at gcc dot gnu dot org
2004-11-23  3:38 ` cvs-commit at gcc dot gnu dot org
2004-11-23  3:40 ` danglin at gcc dot gnu dot org
2004-11-23  3:42 ` pinskia at gcc dot gnu dot org
2004-11-24 14:07 ` pinskia at gcc dot gnu dot org
2005-02-02 14:33 ` pinskia at gcc dot gnu dot org

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=20040404205415.10474.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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: link
Be 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).