public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/66415] New: ice in location_column_from_byte_offset
@ 2015-06-04  8:05 dcb314 at hotmail dot com
  2015-06-04  8:42 ` [Bug c/66415] [6 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2015-06-04  8:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66415
           Summary: ice in location_column_from_byte_offset
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 35695
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35695&action=edit
C source code

gcc trunk dated 20150603 does this with the attached code

ctfCompress.c: In function ‘ctfCompress2’:
ctfCompress.c:271:4: internal compiler error: Segmentation fault
0xbcea5f crash_signal
        ../../src/trunk/gcc/toplev.c:380
0x58af2b location_column_from_byte_offset
        ../../src/trunk/gcc/c-family/c-format.c:89
0x58af2b location_from_offset
        ../../src/trunk/gcc/c-family/c-format.c:148
0x58b126 format_type_warning
        ../../src/trunk/gcc/c-family/c-format.c:2683
0x58bb8c check_format_types
        ../../src/trunk/gcc/c-family/c-format.c:2627

c-format.c:89 is

  if (*c != '"')

so maybe a reasonable bodge is to ensure c != NULL before use.
>From gcc-bugs-return-488068-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 04 08:17:37 2015
Return-Path: <gcc-bugs-return-488068-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 82525 invoked by alias); 4 Jun 2015 08:17:37 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 82510 invoked by uid 48); 4 Jun 2015 08:17:33 -0000
From: "neleai at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/66416] New: Regression: string::find 3.5 times slower than memrchr
Date: Thu, 04 Jun 2015 08:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: neleai at seznam dot cz
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-66416-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg00400.txt.bz2
Content-length: 1172

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf416

            Bug ID: 66416
           Summary: Regression: string::find 3.5 times slower than memrchr
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: neleai at seznam dot cz
  Target Milestone: ---

Same problem as with strstr also applies here. As we know length we could
compare that to memrchr. Again instead simply calling that an implementation is
3.5 times slower on my sandy_bridge.

#include <cstring>
#include <cstdlib>
#include <string>
using namespace std;

int
main()
{
  int i;
  char s[10000];
  for (i = 0; i < 10000; i++)
    s[i] = ((unsigned) rand() % 128) + 1;
  s[9999] = 0;
  int sum = 0;
  std::string foo = s;
  std::string bar;
  char *needle = strdup("needle");

  for (i = 0; i < 5000000; i++)
    {
      needle[0] = ((unsigned) rand() % 128) + 1;
#ifdef MEMRCHR
      sum += (long) memrchr(s, needle[0],9999);
#else
      sum += foo.find_last_of(needle[0]);
#endif
    }
  return sum;
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-21 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04  8:05 [Bug c/66415] New: ice in location_column_from_byte_offset dcb314 at hotmail dot com
2015-06-04  8:42 ` [Bug c/66415] [6 Regression] " mpolacek at gcc dot gnu.org
2015-06-04  8:50 ` mpolacek at gcc dot gnu.org
2015-06-04  9:07 ` mpolacek at gcc dot gnu.org
2015-06-04  9:15 ` manu at gcc dot gnu.org
2015-06-04  9:35 ` mpolacek at gcc dot gnu.org
2015-06-08 15:16 ` mpolacek at gcc dot gnu.org
2015-06-08 15:17 ` mpolacek at gcc dot gnu.org
2015-09-21 14:52 ` manu at gcc dot gnu.org

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).