public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hongjiu.lu@intel.com>
To: gcc-patches@gcc.gnu.org
Cc: jason@redhat.com
Subject: PATCH: PR debug/52857: DW_OP_GNU_regval_type is generated with INVALID_REGNUM
Date: Wed, 04 Apr 2012 01:01:00 -0000	[thread overview]
Message-ID: <20120404010123.GA25327@intel.com> (raw)

Hi,

As the testcase in

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

shows, for

(subreg:SI (plus:DI (reg/f:DI 16 argp)
        (const_int -128 [0xffffffffffffff80])) 0)

we generates DW_OP_GNU_regval_type with INVALID_REGNUM.  This patch
checks dbx_reg_number for INVALID_REGNUM before using it.  OK for
trunk and 4.7?

Thanks.

H.J.
---
2012-04-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR debug/52857
	* dwarf2out.c (mem_loc_descriptor): Don't generate
	DW_OP_GNU_regval_type with INVALID_REGNUM.

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ca88fc5..935c86f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11664,7 +11664,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
 
 	  if (dwarf_strict)
 	    break;
-	  if (REGNO (rtl) > FIRST_PSEUDO_REGISTER)
+	  if (REGNO (rtl) > FIRST_PSEUDO_REGISTER
+	      || dbx_reg_number (rtl) == INVALID_REGNUM)
 	    break;
 	  type_die = base_type_for_mode (mode,
 					 GET_MODE_CLASS (mode) == MODE_INT);

             reply	other threads:[~2012-04-04  1:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04  1:01 H.J. Lu [this message]
2012-04-06 13:31 H.J. Lu
2012-04-06 17:40 ` H.J. Lu
2012-04-25 14:00 H.J. Lu
2012-04-25 18:52 ` Richard Henderson

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=20120404010123.GA25327@intel.com \
    --to=hongjiu.lu@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jason@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: 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).