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 target/37610] [4.4 Regression] FAIL: g++.dg/eh/pr29166.C execution test
Date: Tue, 18 Nov 2008 02:33:00 -0000	[thread overview]
Message-ID: <20081118023157.6516.qmail@sourceware.org> (raw)
In-Reply-To: <bug-37610-276@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from danglin at gcc dot gnu dot org  2008-11-18 02:31 -------
The hppa gas target currently defines DWARF2_LINE_MIN_INSN_LENGTH to 4 in
tc-hppa.h.  I can fix this failure by changing DWARF2_LINE_MIN_INSN_LENGTH
to 1.  However, the failure appears to be caused by an inconsistency in
the handling of DW_CFA_advance_loc1, DW_CFA_advance_loc2 and
DW_CFA_advance_loc4
in dw2gencfi.c and unwind-dw2.c.

In dw2gencfi.c, we have:

            addressT delta = S_GET_VALUE (to) - S_GET_VALUE (from);
            addressT scaled = delta / DWARF2_LINE_MIN_INSN_LENGTH;

            if (scaled <= 0x3F)
              out_one (DW_CFA_advance_loc + scaled);
            else if (delta <= 0xFF)
              {
                out_one (DW_CFA_advance_loc1);
                out_one (delta);
              }
            else if (delta <= 0xFFFF)
              {
                out_one (DW_CFA_advance_loc2);
                out_two (delta);
              }
            else
              {
                out_one (DW_CFA_advance_loc4);
                out_four (delta);
              }

In unwind-dw2.c, we have:

        case DW_CFA_advance_loc1:
          fs->pc += read_1u (insn_ptr) * fs->code_align;
          insn_ptr += 1;
          break;
        case DW_CFA_advance_loc2:
          fs->pc += read_2u (insn_ptr) * fs->code_align;
          insn_ptr += 2;
          break;
        case DW_CFA_advance_loc4:
          fs->pc += read_4u (insn_ptr) * fs->code_align;
          insn_ptr += 4;
          break;

The code in binutils/dwarf.c also scales the file values by the code
alignment factor.  So two against one says the dw2gencfi.c code is wrong.


-- 

danglin at gcc dot gnu dot org changed:

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


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


  parent reply	other threads:[~2008-11-18  2:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21 16:08 [Bug target/37610] New: " danglin at gcc dot gnu dot org
2008-09-28 23:47 ` [Bug target/37610] " pinskia at gcc dot gnu dot org
2008-10-22  3:11 ` mmitchel at gcc dot gnu dot org
2008-11-18  1:23 ` danglin at gcc dot gnu dot org
2008-11-18  2:33 ` danglin at gcc dot gnu dot org [this message]
2008-11-18  9:05 ` jakub at gcc dot gnu dot org
2008-11-18  9:21 ` jakub at gcc dot gnu dot org
2008-11-18 14:08 ` dave at hiauly1 dot hia dot nrc dot ca
2008-11-18 14:57 ` danglin at gcc dot gnu dot org
2008-11-18 18:50 ` ebotcazou at gcc dot gnu dot org
2008-11-18 18:52 ` ebotcazou at gcc dot gnu dot org
2008-11-29 21:07 ` jakub at gcc dot gnu dot org
2008-12-02 15:49 ` jakub at gcc dot gnu dot org
2008-12-03  9:12 ` jakub at gcc dot gnu dot org
2008-12-03  9:18 ` jakub at gcc dot gnu dot org
2008-12-20 22:35 ` ebotcazou 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=20081118023157.6516.qmail@sourceware.org \
    --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).