public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Richard Sandiford <richard.sandiford@arm.com>
Cc: Bernd Schmidt <bschmidt@redhat.com>,
	Ulrich Weigand <uweigand@de.ibm.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [ping] Fix PR debug/66728
Date: Mon, 02 Nov 2015 23:29:00 -0000	[thread overview]
Message-ID: <A6732F72-4484-45B8-8232-7B5BF8DE4949@comcast.net> (raw)
In-Reply-To: <871tc8unnx.fsf@e105548-lin.cambridge.arm.com>

On Nov 2, 2015, at 12:55 PM, Richard Sandiford <richard.sandiford@arm.com> wrote:
> This was:
> 
>  ... Sometimes structure decls
>  have BLKmode but are assigned an integer-mode rtl (e.g. when passing
>  3-byte structures by value to functions).
>  [...]
>  loc_descriptor refuses to use CONST_INT for BLKmode decls (which aren't
>  actually integers at the source level).  That seems like the right
>  behaviour

I’ll plead ignorance here, but why do you think that?  The dwarf standard says:

There are six forms of constants. There are
fixed length constant data forms for one, two,
four and eight byte values (respec
tively, DW_FORM_data1, DW_FORM_data2,
DW_FORM_data4, and DW_FORM_data8). There ar
e also variable length constant data
forms encoded using LEB128 numbers (see below). Both signed (DW_FORM_sdata) and
unsigned (DW_FORM_udata) variable
length constants are available
The data in DW_FORM_data1, DW
_FORM_data2, DW_FORM_data4 and
DW_FORM_data8 can be anything. Depending on c
ontext, it may be a signed integer, an
unsigned integer, a floating-point
constant, or anything else. A
consumer must use context to
know how to interpret the bits, wh
ich if they are target machine
data (such as an integer or
floating point constant) will be in target machine byte-order.

Certainly supplying the known byte values of a constant is preferable to throwing up our hands and saying, I know, but I’m not telling.  Given the text above, it seems like these forms can be used for content where the compiler knows the values of the bits that comprise the content.  I’d ask, is the backing of your position supported by the dwarf standard?  If yes, what part?

I think you think that this describes the type, these do not.  There is a separate system to describe the type.  For example, DW_ATE_UTF describes the bytes as forming a UTF value.  A wide int (or a CONST_INT) can be used to describe a unicode character, and it would have a DW_ATE_UTF encoding on it for the debugger to use to formulate an idea of how to display those bytes.  Further, a mythical front end could have a 3 byte unicode character, and these can be modeless as there is no 3 byte machine mode for them.  Code-gen would be BLKmode, the type would be DW_ATE_UTF, and one could form constants with CONST_INT.  In a 152 bit UTF character in that front end, CONST_INT, generally speaking, isn’t big enough, so a CONST_WIDE_INT would be formed.   The argument is the same.  That a machine has a native 3 byte type or not, is of no consequence, so _any_ decision based upon the mode in this way is flawed.  Then again, I don’t even pretend to be a language lawyer for the dwarf standard.  :-)

  reply	other threads:[~2015-11-02 23:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 14:24 Richard Sandiford
2015-08-21 16:20 ` Jeff Law
2015-10-28 12:04 ` [ping] " Ulrich Weigand
2015-10-28 13:14   ` Richard Sandiford
2015-10-28 14:25     ` Bernd Schmidt
2015-10-28 14:58       ` Ulrich Weigand
2015-11-02 15:30       ` Richard Sandiford
2015-11-02 16:29         ` Richard Sandiford
2015-11-02 20:34           ` [ping] " Mike Stump
2015-11-02 20:55             ` Richard Sandiford
2015-11-02 23:29               ` Mike Stump [this message]
2015-11-03  8:46                 ` Richard Sandiford
2015-11-03 21:59                   ` Mike Stump
2015-11-04  9:43                     ` Richard Biener
2015-11-04 11:58                       ` Mike Stump
2015-11-04 12:15                         ` Richard Biener
2015-11-04 19:36                           ` Mike Stump
2015-11-04 20:51                             ` Richard Sandiford
2015-11-04 23:45                               ` Mike Stump
2015-11-05 12:32                                 ` Richard Biener
2015-11-06  1:35                                   ` Mike Stump
2015-11-06 13:06                                     ` Richard Biener
2015-11-09 18:47                                       ` Mike Stump

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=A6732F72-4484-45B8-8232-7B5BF8DE4949@comcast.net \
    --to=mikestump@comcast.net \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    --cc=uweigand@de.ibm.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).