public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/65536] LTO line number information garbled
Date: Wed, 25 Mar 2015 21:40:00 -0000	[thread overview]
Message-ID: <bug-65536-4-DxlWglM17h@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65536-4@http.gcc.gnu.org/bugzilla/>

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-25
     Ever confirmed|0                           |1

--- Comment #36 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Manuel,
I returned back looking for reason lines are going out wrong when we get short
on locators.  I do not understand the following code:

  if (line_delta < 0
      || (line_delta > 10
          && line_delta * ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) > 1000)
      || (max_column_hint >= (1U << ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map)))
      || (max_column_hint <= 80
          && ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) >= 10)
      || (highest > 0x60000000
          && (set->max_column_hint || highest > 0x70000000)))
    add_map = true;
  else
    max_column_hint = set->max_column_hint;

here we seem to decide about adding new map and we always do that when we are
running tight on locators...

then
  if (add_map)
    {
      int column_bits;
      if (max_column_hint > 100000 || highest > 0x60000000)
        {
          /* If the column number is ridiculous or we've allocated a huge
             number of source_locations, give up on column numbers. */
          max_column_hint = 0;
          if (highest > 0x70000000)
            return 0;

I will add abort to highest and check if we reach it for chromium.
We probably can starting slowing down and allocating new linemap for every new
line, not try the heuristics with 1000 above.
However...

          column_bits = 0;
        }
      else
        {
          column_bits = 7;
          while (max_column_hint >= (1U << column_bits))
            column_bits++;
          max_column_hint = 1U << column_bits;
        }
      /* Allocate the new line_map.  However, if the current map only has a
         single line we can sometimes just increase its column_bits instead. */
      if (line_delta < 0
          || last_line != ORDINARY_MAP_STARTING_LINE_NUMBER (map)
          || SOURCE_COLUMN (map, highest) >= (1U << column_bits))
        map = (struct line_map *) linemap_add (set, LC_RENAME,
                                               ORDINARY_MAP_IN_SYSTEM_HEADER_P
                                               (map),
                                               ORDINARY_MAP_FILE_NAME (map),
                                               to_line);
      ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) = column_bits;
      r = (MAP_START_LOCATION (map)
           + ((to_line - ORDINARY_MAP_STARTING_LINE_NUMBER (map))
              << column_bits));

Here we seem to sometimes affect ORDINARY_MAP_NUMBER_OF_COLUMN_BITS of an
existing line map.  How that can work?  We already have locators that do
depends on the previous COLUMN_BITS value.
I would expect the ORDINARY_MPA_NUMBER_OF_COLUMN_BITS set to be part of the
conditional and the computation bellow use map's column_bits.
Also I think the conditoinal guarding creation may want to check how far r will
be bumped and force creation when we are running short of locators.

Honza


  parent reply	other threads:[~2015-03-25 20:58 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24  7:42 [Bug lto/65536] New: [5 regression] " hubicka at gcc dot gnu.org
2015-03-24 10:15 ` [Bug lto/65536] " rguenth at gcc dot gnu.org
2015-03-24 10:15 ` [Bug lto/65536] " rguenth at gcc dot gnu.org
2015-03-24 12:52 ` manu at gcc dot gnu.org
2015-03-24 13:32 ` rguenth at gcc dot gnu.org
2015-03-24 14:34 ` manu at gcc dot gnu.org
2015-03-24 14:42 ` manu at gcc dot gnu.org
2015-03-24 14:54 ` manu at gcc dot gnu.org
2015-03-24 16:22 ` jakub at gcc dot gnu.org
2015-03-24 16:44 ` manu at gcc dot gnu.org
2015-03-24 17:23 ` hubicka at ucw dot cz
2015-03-24 19:39 ` jakub at gcc dot gnu.org
2015-03-24 19:41 ` hubicka at gcc dot gnu.org
2015-03-24 19:51 ` manu at gcc dot gnu.org
2015-03-24 19:58 ` manu at gcc dot gnu.org
2015-03-24 20:22 ` manu at gcc dot gnu.org
2015-03-25  3:11 ` hubicka at gcc dot gnu.org
2015-03-25  3:22 ` manu at gcc dot gnu.org
2015-03-25  7:21 ` hubicka at ucw dot cz
2015-03-25  7:24 ` hubicka at ucw dot cz
2015-03-25  9:18 ` marxin at gcc dot gnu.org
2015-03-25  9:54 ` marxin at gcc dot gnu.org
2015-03-25 10:12 ` rguenth at gcc dot gnu.org
2015-03-25 10:45 ` rguenth at gcc dot gnu.org
2015-03-25 13:30 ` manu at gcc dot gnu.org
2015-03-25 18:13 ` hubicka at ucw dot cz
2015-03-25 21:40 ` hubicka at gcc dot gnu.org [this message]
2015-03-25 22:04 ` manu at gcc dot gnu.org
2015-03-25 23:36 ` manu at gcc dot gnu.org
2015-03-26  0:08 ` hubicka at gcc dot gnu.org
2015-03-26  0:19 ` manu at gcc dot gnu.org
2015-03-26  2:29 ` hubicka at ucw dot cz
2015-03-26  2:45 ` manu at gcc dot gnu.org
2015-03-26 17:49 ` manu at gcc dot gnu.org
2015-03-27  7:26 ` hubicka at gcc dot gnu.org
2015-03-27  8:11 ` hubicka at gcc dot gnu.org
2015-03-27  8:36 ` hubicka at gcc dot gnu.org
2015-03-27 15:47 ` manu at gcc dot gnu.org
2015-03-27 15:53 ` hubicka at ucw dot cz
2015-03-27 16:32 ` hubicka at ucw dot cz
2015-03-27 16:50 ` manu at gcc dot gnu.org
2015-03-27 19:39 ` hubicka at gcc dot gnu.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=bug-65536-4-DxlWglM17h@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).