public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/99562] Invalid debug info: objdump: Warning: Location list starting at offset 0x9c3 is not terminated.
Date: Mon, 22 Mar 2021 07:53:31 +0000	[thread overview]
Message-ID: <bug-99562-4-sIbWCDcpiL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99562-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99562

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:fc9c4e5fc50c7fcbd27d6cb3dd372f7da8216954

commit r11-7757-gfc9c4e5fc50c7fcbd27d6cb3dd372f7da8216954
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Mar 22 08:52:04 2021 +0100

    debug: Fix __int128 handling in dwarf2out [PR99562]

    The PR66728 changes broke __int128 handling.
    It emits wide_int numbers in their minimum unsigned precision
    rather than in their full precision.
    The problem is then that e.g. the DW_OP_implicit_value path:
              int_mode = as_a <scalar_int_mode> (mode);
              loc_result = new_loc_descr (DW_OP_implicit_value,
                                          GET_MODE_SIZE (int_mode), 0);
              loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int;
              loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> ();
              *loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl,
int_mode);
    emits invalid DWARF.  In particular this patch fixes there multiple
    occurences of:
            .byte   0x9e    # DW_OP_implicit_value
            .uleb128 0x10
            .quad   0xffffffffffffffff
    +       .quad   0
            .quad   .LVL46  # Location list begin address (*.LLST40)
            .quad   .LFE14  # Location list end address (*.LLST40)
    where we said the value has 16 byte size but then only emitted 8 byte
value.
    My understanding is that most of the places that use val_wide expect
    the precision they chose (the one of the mode they want etc.), the only
    exception is the add_const_value_attribute case where it deals with
    VOIDmode CONST_WIDE_INTs, for that I agree when we don't have a mode
    we need to fallback to minimum precision (not sure if maximum of
    min_precision UNSIGNED and SIGNED wouldn't be better, then consumers
    would know if it is signed or unsigned by looking at the MSB),
    but that code already computes the precision, just decided to
    create the wide_int with much larger precision (e.g. 512 bit
    on x86_64).

    2021-03-22  Jakub Jelinek  <jakub@redhat.com>

            PR debug/99562
            PR debug/66728
            * dwarf2out.c (get_full_len): Use get_precision rather than
            min_precision.
            (add_const_value_attribute): Make sure add_AT_wide argument has
            precision prec rather than some very wide one.

      parent reply	other threads:[~2021-03-22  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 15:40 [Bug debug/99562] New: " marxin at gcc dot gnu.org
2021-03-12 15:47 ` [Bug debug/99562] " marxin at gcc dot gnu.org
2021-03-12 15:48 ` jakub at gcc dot gnu.org
2021-03-12 16:31 ` jakub at gcc dot gnu.org
2021-03-12 16:44 ` jakub at gcc dot gnu.org
2021-03-22  7:53 ` cvs-commit at gcc dot gnu.org [this message]

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=bug-99562-4-sIbWCDcpiL@http.gcc.gnu.org/bugzilla/ \
    --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).