public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
@ 2013-12-18  9:04 trippels at gcc dot gnu.org
  2013-12-18 10:15 ` [Bug lto/59543] " trippels at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2013-12-18  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59543
           Summary: [4.9 Regression] lto1: fatal error: Cgraph edge
                    statement index out of range
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

During Firefox build I get:

markus@x4 shell % /var/tmp/gcc_test/usr/local/bin/g++ -flto=4 -o foofo -O2
Unified_cpp_shell0.o ../libjs_static.a
In member function ‘init’:
lto1: fatal error: Cgraph edge statement index out of range 9 < 10
compilation terminated.
make: *** [/tmp/cczchbUW.ltrans21.ltrans.o] Error 1
make: *** Waiting for unfinished jobs....
lto-wrapper: make returned 2 exit status
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status

markus@x4 shell % /var/tmp/gcc_test/usr/local/bin/g++ -flto=4 -O2
Unified_cpp_shell0.o ../libjs_static.a -rdynamic
In member function ‘extractBetween’:
lto1: fatal error: Cgraph edge statement index out of range 25 < 50
compilation terminated.
make: *** [/tmp/cchXDtH7.ltrans22.ltrans.o] Error 1

Here's a testcase:

 tmp % wget trippelsdorf.de/cceI2Nud.ltrans22.o.bz2
 tmp % bzip2 -d cceI2Nud.ltrans22.o.bz2
 tmp % g++ -xlto -fltrans cceI2Nud.ltrans22.o
In member function ‘extractBetween’:
lto1: fatal error: Cgraph edge statement index out of range
compilation terminated.
>From gcc-bugs-return-437958-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 18 09:14:46 2013
Return-Path: <gcc-bugs-return-437958-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10372 invoked by alias); 18 Dec 2013 09:14:46 -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 10326 invoked by uid 48); 18 Dec 2013 09:14:42 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/59541] [4.9 Regression] Revision 206070 breaks bootstrap on darwin
Date: Wed, 18 Dec 2013 09:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-59541-4-VsxHIs2an8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59541-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59541-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: 2013-12/txt/msg01613.txt.bz2
Content-length: 2973

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY541

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Comparing the test suite results between r206040 and r206072+my_fix, the test
gcc.dg/tree-prof/pr52027.c (see pr52794) passes now, but the tests

g++.dg/tree-prof/partition1.C
gcc.dg/tree-prof/20041218-1.c
gcc.dg/tree-prof/crossmodule-indircall-1.c
gcc.dg/tree-prof/pr49299-1.c
gcc.dg/tree-prof/pr49299-2.c

fails with -m64.

The typical failure is

spawn /opt/gcc/build_w/gcc/testsuite/g++/../../xg++
-B/opt/gcc/build_w/gcc/testsuite/g++/../../
/opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/pr57451.C
-fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++
-I/opt/gcc/build_w/x86_64-apple-darwin13.0.0/libstdc++-v3/include/x86_64-apple-darwin13.0.0
-I/opt/gcc/build_w/x86_64-apple-darwin13.0.0/libstdc++-v3/include
-I/opt/gcc/work/libstdc++-v3/libsupc++
-I/opt/gcc/work/libstdc++-v3/include/backward
-I/opt/gcc/work/libstdc++-v3/testsuite/util -fmessage-length=0 -O2
-freorder-blocks-and-partition -g -fprofile-use
-L/opt/gcc/build_w/x86_64-apple-darwin13.0.0/./libstdc++-v3/src/.libs
-B/opt/gcc/build_w/x86_64-apple-darwin13.0.0/./libstdc++-v3/src/.libs
-L/opt/gcc/build_w/x86_64-apple-darwin13.0.0/./libstdc++-v3/src/.libs
-multiply_defined suppress -lm -m64 -o
/opt/gcc/build_w/gcc/testsuite/g++/pr57451.x02^M
/pr57451.C
ld: Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function
parse, file
/SourceCache/ld64/ld64-224.1/src/ld/parsers/macho_relocatable_file.cpp, line
1639.^M
collect2: error: ld returned 1 exit status^M
compiler exited with status 1
output is:
0  0x10f507724  __assert_rtn + 144^M
1  0x10f52a55c
mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions
const&) + 1476^M
2  0x10f5113b6  mach_o::relocatable::Parser<x86_64>::parse(unsigned char
const*, unsigned long long, char const*, long, ld::File::Ordinal,
mach_o::relocatable::ParserOptions const&) + 328^M
3  0x10f50d776  mach_o::relocatable::parse(unsigned char const*, unsigned long
long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions
const&) + 310^M
4  0x10f54dd83  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool)
+ 571^M
5  0x10f54fa33  ld::tool::InputFiles::parseWorkerThread() + 285^M
6  0x7fff8d911899  _pthread_body + 138^M
7  0x7fff8d91172a  _pthread_struct_init + 0^M
A linker snapshot was created at:^M
        /tmp/pr57451.x02-2013-11-18-085025.ld-snapshot^M
ld: Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function
parse, file
/SourceCache/ld64/ld64-224.1/src/ld/parsers/macho_relocatable_file.cpp, line
1639.^M
collect2: error: ld returned 1 exit status^M

FAIL: g++.dg/tree-prof/pr57451.C compilation,  -fprofile-use
UNRESOLVED: g++.dg/tree-prof/pr57451.C execution,    -fprofile-use

At this point I cannot say if these new failures are due to may fix or to some
recent commit.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
@ 2013-12-18 10:15 ` trippels at gcc dot gnu.org
  2013-12-19 12:53 ` rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2013-12-18 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #1)
> Thank you,
> can you, please, check that the problem appears still after 
> 2013-12-17  Jan Hubicka  <hubicka@ucw.cz>
> 
>         * ipa-utils.h (possible_polymorphic_call_targets): Determine context
> of
>         the call.
>         * gimple-fold.c (gimple_fold_call): Use ipa-devirt to devirtualize.
> 
> this patch makes early passes to use same analysis for devirtualization as
> IPA passes and thus it should prevent from devirtualization to be discovered
> just after early passes but before IPA analysis.  I suspect those can bring
> LTO streaming out of sync. If this is the case, we need to chase away the
> unreachable code removal that should not be placed in between renumbering
> stmts and streaming.

Yes, it still happens after r206042.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
  2013-12-18 10:15 ` [Bug lto/59543] " trippels at gcc dot gnu.org
@ 2013-12-19 12:53 ` rguenth at gcc dot gnu.org
  2013-12-28 10:26 ` trippels at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto
           Priority|P3                          |P1
   Target Milestone|---                         |4.9.0


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
  2013-12-18 10:15 ` [Bug lto/59543] " trippels at gcc dot gnu.org
  2013-12-19 12:53 ` rguenth at gcc dot gnu.org
@ 2013-12-28 10:26 ` trippels at gcc dot gnu.org
  2013-12-28 12:33 ` trippels at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2013-12-28 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
It turned out to be a problem with debugging information.
Some files in libjs_static.a are build with "-g", even when
Firefox is configured with --disable-debug --disable-debug-symbols.

If I add -g to the g++ invocation above, or build the object files
in libjs_static.a without -g, the issue goes away.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-12-28 10:26 ` trippels at gcc dot gnu.org
@ 2013-12-28 12:33 ` trippels at gcc dot gnu.org
  2014-01-16 11:43 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2013-12-28 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 31527
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31527&action=edit
testcase

Here's a small testcase:

  % cat check.sh
g++ -g -fprofile-use -fPIC -flto -fno-exceptions -O2 -std=c++11 -c uniset.ii
g++ -fPIC -flto -fno-exceptions -O2 -std=c++11 -c unistr.ii
g++ -fPIC -flto -fno-exceptions -O2 -std=c++11 -c unorm.ii
gcc -O3 -c -fPIC unorm_it.i
g++ -flto -O2 uniset.o unistr.o unorm_it.o unorm.o
  % ./check.sh
In member function ‘extractBetween’:
lto1: fatal error: Cgraph edge statement index out of range 25 < 50
compilation terminated.
>From gcc-bugs-return-438640-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Dec 28 13:30:20 2013
Return-Path: <gcc-bugs-return-438640-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25185 invoked by alias); 28 Dec 2013 13:30:19 -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 25122 invoked by uid 48); 28 Dec 2013 13:30:14 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59612] iso_fortran_env segfaults with -fdump-fortran-original
Date: Sat, 28 Dec 2013 13:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: keywords bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-59612-4-silBZAcSNo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59612-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59612-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: 2013-12/txt/msg02295.txt.bz2
Content-length: 1052

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY612

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-12-28
                 CC|                            |janus at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org ---
Straightforward patch:

Index: gcc/fortran/dump-parse-tree.c
==================================================================--- gcc/fortran/dump-parse-tree.c    (revision 206176)
+++ gcc/fortran/dump-parse-tree.c    (working copy)
@@ -110,7 +110,8 @@ show_typespec (gfc_typespec *ts)
       break;

     case BT_CHARACTER:
-      show_expr (ts->u.cl->length);
+      if (ts->u.cl)
+    show_expr (ts->u.cl->length);
       fprintf(dumpfile, " %d", ts->kind);
       break;


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-12-28 12:33 ` trippels at gcc dot gnu.org
@ 2014-01-16 11:43 ` trippels at gcc dot gnu.org
  2014-02-17 15:28 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-01-16 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31527|0                           |1
        is obsolete|                            |

--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 31851
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31851&action=edit
smaller testcase

Here's a smaller testcase, that just needs two input files
(but uniset.ii still needs its gcda file):

markus@x4 lto_pgo_testcase % cat unorm.ii
namespace icu_50 {
class UnicodeString {
 public:
  UnicodeString();
  void extractBetween(int, int, unsigned short *, int = 0) const;
  void doExtract(int, unsigned short *, int) const;
  void pinIndex(int &) const;
};
inline void UnicodeString::extractBetween(int p1, int p2, unsigned short *p3,
                                          int p4) const {
  pinIndex(p1);
  doExtract(p2 - p1, p3, p4);
}
UnicodeString::UnicodeString() { extractBetween(0, 0, 0); }
UnicodeString a;
}

markus@x4 lto_pgo_testcase % g++ -g -fPIC -flto -fno-exceptions -O2 -std=c++11
-c unorm.ii
markus@x4 lto_pgo_testcase % g++ -w -g -fprofile-use -fPIC -flto
-fno-exceptions -O2 -std=c++11 -c uniset.ii
markus@x4 lto_pgo_testcase % g++ -flto -O2 uniset.o unorm.o
In member function ‘extractBetween’:
lto1: fatal error: Cgraph edge statement index out of range 28 < 46
compilation terminated.
>From gcc-bugs-return-440536-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 11:58:29 2014
Return-Path: <gcc-bugs-return-440536-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23953 invoked by alias); 16 Jan 2014 11:58:29 -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 23930 invoked by uid 48); 16 Jan 2014 11:58:26 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/59830] std::packaged_task throws exception
Date: Thu, 16 Jan 2014 11:58:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.7.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
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_status resolution
Message-ID: <bug-59830-4-CAv7FRHkBB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59830-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59830-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: 2014-01/txt/msg01678.txt.bz2
Content-length: 568

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY830

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It should print the error code returned by the underlying pthread_once() call,
which is -1

I don't know why it's printing (unsigned long)-1 instead.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-01-16 11:43 ` trippels at gcc dot gnu.org
@ 2014-02-17 15:28 ` jakub at gcc dot gnu.org
  2014-03-02 22:35 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-17 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-17
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Isn't it an ODR violation if UnicodeString::extractBetween inline has different
definition between unorm.ii and uniset.ii?  In any case, the bug reported here
seems to be unrelated to that.

Anyway, from what I see, here is what happens:
1) uniset.ii UnicodeString::extractBetween is being streamed by cc1plus,
including debug stmts, so gets high uid (in my case uid 45 and lto_stmt_uid for
the corresponding edge is streamed as 46 (+1)).

2) now, when the first lto1 invocation happens (is that WPA pass, right), it
first reads all the stmts, then drop debug stmts after assinging uids (ok)

3) next:
#3  0x000000000064790c in build_function_decl_skip_args
(orig_decl=0x7ffff1a1ac00, args_to_skip=0x7ffff1a2d240, skip_return=false)
    at ../../gcc/cgraphclones.c:375
#4  0x0000000000647bef in cgraph_create_virtual_clone (old_node=0x7ffff1a2b668,
redirect_callers=..., tree_map=0x7ffff1a33488, 
    args_to_skip=0x7ffff1a2d240, suffix=0x1590c10 "constprop") at
../../gcc/cgraphclones.c:433
#5  0x00000000011579d9 in create_specialized_node (node=0x7ffff1a2b668,
known_vals=..., aggvals=0x0, callers=...) at ../../gcc/ipa-cp.c:2790
#6  0x0000000001159755 in decide_whether_version_node (node=0x7ffff1a2b668) at
../../gcc/ipa-cp.c:3545
versions the UnicodeString::extractBetween function, but nothing allocates
DECL_STRUCT_FUNCTION for it - it supposedly inherits the body of the master

4) then output_function is called on the original UnicodeString::extractBetween
(not the clone), this reassigns stmt uids, and as 2) dropped the debug stmts
already, the call stmt in there gets much smaller uid (25)

5) finally, lto_output_edge is called, and does:
      uid = (!gimple_has_body_p (edge->caller->decl)
         ? edge->lto_stmt_uid : gimple_uid (edge->call_stmt) + 1);
but here edge->caller->decl is the clone of UnicodeString::extractBetween,
rather than original, it has NULL DECL_STRUCT_FUNCTION and thus
gimple_has_body_p returns false for it and it happily uses the now completely
out of bound lto_stmt_uid (46), rather than the right one (25+1).

Now, I wonder if it isn't always safe to use gimple_uid (edge->call_stmt) + 1
here if edge->call_stmt is non-NULL, or e.g. if we need to look through
clone_of pointers to find ultimate clone and check gimple_has_body_p on that,
or loop through clone_of pointers and stop on the first one where
gimple_has_body_p returns true, something else?

Honza?


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-02-17 15:28 ` jakub at gcc dot gnu.org
@ 2014-03-02 22:35 ` hubicka at gcc dot gnu.org
  2014-03-18 14:31 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-03-02 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
We need to handle functions whose bodies was read back as if they were created
internally, that is trnaslate stmt uids into stmt pointers.  I will try to look
into this.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-03-02 22:35 ` hubicka at gcc dot gnu.org
@ 2014-03-18 14:31 ` rguenth at gcc dot gnu.org
  2014-03-18 14:44 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-18 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think 2) is the issue, so does

Index: lto-streamer-in.c
===================================================================
--- lto-streamer-in.c   (revision 208642)
+++ lto-streamer-in.c   (working copy)
@@ -988,7 +988,7 @@ input_function (tree fn_decl, struct dat
             We can't remove them earlier because this would cause uid
             mismatches in fixups, but we can do it at this point, as
             long as debug stmts don't require fixups.  */
-         if (!MAY_HAVE_DEBUG_STMTS && is_gimple_debug (stmt))
+         if (!MAY_HAVE_DEBUG_STMTS && !flag_wpa && is_gimple_debug (stmt))
            {
              gimple_stmt_iterator gsi = bsi;
              gsi_next (&bsi);

fix it?

Not sure why we output the original function again.


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-03-18 14:31 ` rguenth at gcc dot gnu.org
@ 2014-03-18 14:44 ` rguenth at gcc dot gnu.org
  2014-03-19  9:23 ` rguenth at gcc dot gnu.org
  2014-03-19  9:25 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-18 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm doing a LTO profiledbootstrap with this - Markus, can you check if this
fixes your problem?


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-03-18 14:44 ` rguenth at gcc dot gnu.org
@ 2014-03-19  9:23 ` rguenth at gcc dot gnu.org
  2014-03-19  9:25 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-19  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Mar 19 09:22:15 2014
New Revision: 208677

URL: http://gcc.gnu.org/viewcvs?rev=208677&root=gcc&view=rev
Log:
2014-03-19  Richard Biener  <rguenther@suse.de>

    PR lto/59543
    * lto-streamer-in.c (input_function): In WPA stage do not drop
    debug stmts.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-in.c


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

* [Bug lto/59543] [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range
  2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-03-19  9:23 ` rguenth at gcc dot gnu.org
@ 2014-03-19  9:25 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-19  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-03-19  9:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18  9:04 [Bug lto/59543] New: [4.9 Regression] lto1: fatal error: Cgraph edge statement index out of range trippels at gcc dot gnu.org
2013-12-18 10:15 ` [Bug lto/59543] " trippels at gcc dot gnu.org
2013-12-19 12:53 ` rguenth at gcc dot gnu.org
2013-12-28 10:26 ` trippels at gcc dot gnu.org
2013-12-28 12:33 ` trippels at gcc dot gnu.org
2014-01-16 11:43 ` trippels at gcc dot gnu.org
2014-02-17 15:28 ` jakub at gcc dot gnu.org
2014-03-02 22:35 ` hubicka at gcc dot gnu.org
2014-03-18 14:31 ` rguenth at gcc dot gnu.org
2014-03-18 14:44 ` rguenth at gcc dot gnu.org
2014-03-19  9:23 ` rguenth at gcc dot gnu.org
2014-03-19  9:25 ` rguenth 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).