From: Richard Biener <richard.guenther@gmail.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: Joseph Myers <joseph@codesourcery.com>,
GCC Development <gcc@gcc.gnu.org>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Advice sought for debugging a lto1 ICE (was: Implement C _FloatN, _FloatNx types [version 6])
Date: Wed, 14 Sep 2016 10:24:00 -0000 [thread overview]
Message-ID: <CAFiYyc1Hg152YooKjy4wUSoVo8+aOnsbPhtxoeRLvv4zq+H1DA@mail.gmail.com> (raw)
In-Reply-To: <87d1kefwgt.fsf@hertz.schwinge.homeip.net>
On Thu, Sep 8, 2016 at 1:43 PM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> Hi!
>
> On Wed, 7 Sep 2016 14:23:18 +0200, Richard Biener <richard.guenther@gmail.com> wrote:
>> On Wed, Sep 7, 2016 at 1:52 PM, Thomas Schwinge <thomas@codesourcery.com> wrote:
>> > I trimmed the CC list -- I'm looking for advice about debugging a lto1
>> > ICE.
>> >
>> > On Fri, 19 Aug 2016 11:05:59 +0000, Joseph Myers <joseph@codesourcery.com> wrote:
>> >> On Fri, 19 Aug 2016, Richard Biener wrote:
>> >> > Can you quickly verify if LTO works with the new types? I don't see anything
>> >> > that would prevent it but having new global trees and backends initializing them
>> >> > might come up with surprises (see tree-streamer.c:preload_common_nodes)
>> >>
>> >> Well, the execution tests are in gcc.dg/torture, which is run with various
>> >> options including -flto (and I've checked the testsuite logs to confirm
>> >> these tests are indeed run with such options). Is there something else
>> >> you think should be tested?
>> >
>> > As I noted in <https://gcc.gnu.org/PR77458>:
>> >
>> > As of the PR32187 commit r239625 "Implement C _FloatN, _FloatNx types", nvptx
>> > offloading is broken, ICEs in LTO stream-in. Probably some kind of data-type
>> > mismatch that is not visible with Intel MIC offloading (using the same data
>> > types) but explodes with nvptx. I'm having a look.
>> >
>> > I know how to use "-save-temps -v" to re-run the ICEing lto1 in GDB; a
>> > backtrace of the ICE looks as follows:
>> >
>> > #0 fancy_abort (file=file@entry=0x10d61d0 "[...]/source-gcc/gcc/vec.h", line=line@entry=727, function=function@entry=0x10d6e3a <_ZZN3vecIP9tree_node7va_heap8vl_embedEixEjE12__FUNCTION__> "operator[]") at [...]/source-gcc/gcc/diagnostic.c:1414
>> > #1 0x000000000058c9ef in vec<tree_node*, va_heap, vl_embed>::operator[] (this=0x16919c0, ix=ix@entry=185) at [...]/source-gcc/gcc/vec.h:727
>> > #2 0x000000000058ca33 in vec<tree_node*, va_heap, vl_ptr>::operator[] (this=this@entry=0x1691998, ix=ix@entry=185) at [...]/source-gcc/gcc/vec.h:1211
>>
>> so it wants tree 185 which is (given the low number) likely one streamed by
>> preload_common_nodes. This is carefully crafted to _not_ diverge by
>> frontend (!) it wasn't even designed to cope with global trees being present
>> or not dependent on target (well, because the target is always the
>> same! mind you!)
>
> Scary. ;-/
>
>> Now -- in theory it should deal with NULLs just fine (resulting in
>> error_mark_node), but it can diverge when there are additional
>> compount types (like vectors, complex
>> or array or record types) whose element types are not in the set of
>> global trees.
>> The complex _FloatN types would be such a case given they appear before their
>> components. That mixes up the ordering at least.
>
> ACK, but that's also an issue for "regular" float/complex float, which
> also is in "reverse" order. But that's "fixed" by the recursion in
> gcc/tree-streamer.c:record_common_node for "TREE_CODE (node) ==
> COMPLEX_TYPE". This likewise seems to work for the _FloatN types. (I've
> put "fixed" in quotes -- doesn't that recursion mean that we're thus
> putting "complex float", "float", [...], "float" (again) into the cache?
> Anyway that's for later...)
>
>> So I suggest to add a print_tree to where it does the streamer_tree_cache_append
>> and compare cc1 and lto1 outcome.
>
> Thanks for all your suggestions!
>
> As far as I can tell, tree 185 is in fact among the first trees just
> after the preloaded ones... (See record_common_node followed by
> streamer_tree_cache_append with "ix == hash" vs., from "ix=180" onwards,
> streamer_tree_cache_append called from elsewhere with "ix != hash".)
> (I'm also noticing that this cache first is built from "ix=0" through
> "ix=179", then apparently discarded, and rebuilt again, which seems
> surprising but which I've not yet looked into; hopefully unrelated
> issue.) I'll continue to poke at this, but wanted to given an update
> here at least.
Ok - so the only other suggestion is to do lock-step debugging of the
cc1 / lto1 process
starting from the last known "equal" tree we put into the cache...
Richard.
> [...]
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:272:record_common_node
> <fixed_point_type 0x7ffff68e23f0 unsigned UDA
> size <integer_cst 0x7ffff68cd378 type <integer_type 0x7ffff68d2150 bitsizetype> constant 64>
> unit size <integer_cst 0x7ffff68cd390 type <integer_type 0x7ffff68d20a8 sizetype> constant 8>
> align 64 symtab 0 alias set -1 canonical type 0x7ffff68e23f0 precision 64>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=178 hash=178 tree=0x7ffff68e23f0
> <fixed_point_type 0x7ffff68e23f0 unsigned UDA
> size <integer_cst 0x7ffff68cd378 type <integer_type 0x7ffff68d2150 bitsizetype> constant 64>
> unit size <integer_cst 0x7ffff68cd390 type <integer_type 0x7ffff68d20a8 sizetype> constant 8>
> align 64 symtab 0 alias set -1 canonical type 0x7ffff68e23f0 precision 64>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:272:record_common_node
> <fixed_point_type 0x7ffff68e2690 unsigned UTA
> size <integer_cst 0x7ffff68cd6a8 type <integer_type 0x7ffff68d2150 bitsizetype> constant 128>
> unit size <integer_cst 0x7ffff68cd6c0 type <integer_type 0x7ffff68d20a8 sizetype> constant 16>
> align 64 symtab 0 alias set -1 canonical type 0x7ffff68e2690 precision 128>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=179 hash=179 tree=0x7ffff68e2690
> <fixed_point_type 0x7ffff68e2690 unsigned UTA
> size <integer_cst 0x7ffff68cd6a8 type <integer_type 0x7ffff68d2150 bitsizetype> constant 128>
> unit size <integer_cst 0x7ffff68cd6c0 type <integer_type 0x7ffff68d20a8 sizetype> constant 16>
> align 64 symtab 0 alias set -1 canonical type 0x7ffff68e2690 precision 128>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=180 hash=1889092561 tree=0x7ffff68cc930
> <optimization_node 0x7ffff68cc930
> flag_fp_contract_mode (0)
> flag_ira_algorithm (0)
> flag_ira_region (0)
> flag_reorder_blocks_algorithm (0)
> flag_simd_cost_model (0)
> flag_stack_reuse (0)
> flag_vect_cost_model (0)
> >
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=181 hash=2721827057 tree=0x7ffff6993708
> <target_option_node 0x7ffff6993708
> >
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=182 hash=3212777296 tree=0x7ffff6993730
> <identifier_node 0x7ffff6993730 _ZL5placev>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=183 hash=1511527171 tree=0x7ffff6993758
> <identifier_node 0x7ffff6993758 noinline>
> PID=12052 [...]/source-gcc/gcc/tree-streamer.c:214:streamer_tree_cache_append
> ix=184 hash=4086308758 tree=0x7ffff6993780
> <tree_list 0x7ffff6993780>
>
> Breakpoint 1, fancy_abort (file=file@entry=0x10df3d0 "[...]/source-gcc/gcc/vec.h", line=line@entry=727, function=function@entry=0x10e003a <_ZZN3vecIP9tree_node7va_heap8vl_embedEixEjE12__FUNCTION__> "operator[]") at [...]/source-gcc/gcc/diagnostic.c:1414
> 1414 {
> (gdb) bt
> #0 fancy_abort (file=file@entry=0x10df3d0 "[...]/source-gcc/gcc/vec.h", line=line@entry=727, function=function@entry=0x10e003a <_ZZN3vecIP9tree_node7va_heap8vl_embedEixEjE12__FUNCTION__> "operator[]") at [...]/source-gcc/gcc/diagnostic.c:1414
> #1 0x000000000059103f in vec<tree_node*, va_heap, vl_embed>::operator[] (this=0x16aba30, ix=ix@entry=185) at [...]/source-gcc/gcc/vec.h:727
> #2 0x0000000000591083 in vec<tree_node*, va_heap, vl_ptr>::operator[] (this=this@entry=0x169c868, ix=ix@entry=185) at [...]/source-gcc/gcc/vec.h:1211
> #3 0x0000000000c7d464 in streamer_tree_cache_get_tree (cache=0x169c860, ix=ix@entry=185) at [...]/source-gcc/gcc/tree-streamer.h:98
> #4 0x0000000000c7d4c9 in streamer_get_pickled_tree (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880) at [...]/source-gcc/gcc/tree-streamer-in.c:1112
> #5 0x00000000008fca6b in lto_input_tree_1 (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, tag=tag@entry=LTO_tree_pickle_reference, hash=hash@entry=0) at [...]/source-gcc/gcc/lto-streamer-in.c:1404
> #6 0x00000000008fce94 in lto_input_tree (ib=0x7fffffffceb0, data_in=0x169f880) at [...]/source-gcc/gcc/lto-streamer-in.c:1444
> #7 0x0000000000c7b6e2 in lto_input_ts_list_tree_pointers (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, expr=expr@entry=0x7ffff6993780) at [...]/source-gcc/gcc/tree-streamer-in.c:861
> #8 0x0000000000c7da5e in streamer_read_tree_body (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, expr=expr@entry=0x7ffff6993780) at [...]/source-gcc/gcc/tree-streamer-in.c:1077
> #9 0x00000000008faa78 in lto_read_tree_1 (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, expr=expr@entry=0x7ffff6993780) at [...]/source-gcc/gcc/lto-streamer-in.c:1285
> #10 0x00000000008fab6b in lto_read_tree (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, tag=tag@entry=4, hash=hash@entry=4086308758) at [...]/source-gcc/gcc/lto-streamer-in.c:1315
> #11 0x00000000008fcc2b in lto_input_tree_1 (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, tag=tag@entry=4, hash=hash@entry=4086308758) at [...]/source-gcc/gcc/lto-streamer-in.c:1427
> #12 0x00000000008fccc3 in lto_input_scc (ib=ib@entry=0x7fffffffceb0, data_in=data_in@entry=0x169f880, len=len@entry=0x7fffffffceac, entry_len=entry_len@entry=0x7fffffffcea8) at [...]/source-gcc/gcc/lto-streamer-in.c:1339
> #13 0x000000000058d747 in lto_read_decls (decl_data=decl_data@entry=0x7ffff7fc0000, data=data@entry=0x16b0750, resolutions=...) at [...]/source-gcc/gcc/lto/lto.c:1693
> #14 0x000000000058df18 in lto_file_finalize (file_data=file_data@entry=0x7ffff7fc0000, file=file@entry=0x15f9db0) at [...]/source-gcc/gcc/lto/lto.c:2037
> #15 0x000000000058df78 in lto_create_files_from_ids (file=file@entry=0x15f9db0, file_data=file_data@entry=0x7ffff7fc0000, count=count@entry=0x7fffffffd054) at [...]/source-gcc/gcc/lto/lto.c:2047
> #16 0x000000000058e0ca in lto_file_read (file=0x15f9db0, resolution_file=resolution_file@entry=0x0, count=count@entry=0x7fffffffd054) at [...]/source-gcc/gcc/lto/lto.c:2088
> #17 0x000000000058e4d4 in read_cgraph_and_symbols (nfiles=1, fnames=0x1619990) at [...]/source-gcc/gcc/lto/lto.c:2798
> #18 0x000000000058ebc2 in lto_main () at [...]/source-gcc/gcc/lto/lto.c:3299
> #19 0x0000000000a5208f in compile_file () at [...]/source-gcc/gcc/toplev.c:466
> #20 0x0000000000554f93 in do_compile () at [...]/source-gcc/gcc/toplev.c:2010
> #21 toplev::main (this=this@entry=0x7fffffffd180, argc=argc@entry=20, argv=0x15e5f20, argv@entry=0x7fffffffd288) at [...]/source-gcc/gcc/toplev.c:2144
> #22 0x0000000000556d67 in main (argc=20, argv=0x7fffffffd288) at [...]/source-gcc/gcc/main.c:39
>
>
> Grüße
> Thomas
next prev parent reply other threads:[~2016-09-14 10:19 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 12:07 Implement C _FloatN, _FloatNx types Joseph Myers
2016-06-21 15:17 ` FX
2016-06-21 15:38 ` Joseph Myers
2016-06-21 15:21 ` Bill Schmidt
2016-06-21 15:43 ` Joseph Myers
2016-06-21 17:42 ` Implement C _FloatN, _FloatNx types [version 2] Joseph Myers
2016-06-21 20:53 ` Michael Meissner
2016-06-21 21:18 ` Joseph Myers
2016-06-22 20:43 ` Joseph Myers
2016-06-22 21:45 ` FX
2016-06-23 14:20 ` Implement C _FloatN, _FloatNx types [version 3] Joseph Myers
2016-06-27 17:31 ` Ping " Joseph Myers
2016-06-27 21:20 ` Bill Schmidt
2016-06-27 21:24 ` Joseph Myers
2016-06-27 21:38 ` Segher Boessenkool
2016-07-19 13:54 ` Implement C _FloatN, _FloatNx types [version 4] Joseph Myers
2016-07-22 21:59 ` Implement C _FloatN, _FloatNx types [version 5] Joseph Myers
2016-07-29 17:37 ` Ping " Joseph Myers
2016-07-29 22:09 ` Michael Meissner
2016-08-04 23:54 ` Michael Meissner
2016-08-05 0:12 ` Joseph Myers
2016-08-10 11:33 ` Ping^2 " Joseph Myers
2016-08-10 17:14 ` Paul Richard Thomas
2016-08-11 7:05 ` FX
2016-08-15 22:21 ` Ping^3 " Joseph Myers
2016-08-17 15:43 ` James Greenhalgh
2016-08-17 16:44 ` Joseph Myers
2016-08-17 20:17 ` Implement C _FloatN, _FloatNx types [version 6] Joseph Myers
[not found] ` <CAFiYyc3xqcqJ1rK2X0rC+wwpx3akHbULVG1G47PRmtk4wTk=7A@mail.gmail.com>
2016-08-19 11:06 ` Joseph Myers
2016-08-19 11:11 ` Richard Biener
2016-08-19 14:40 ` Joseph Myers
2016-08-19 15:52 ` David Malcolm
2016-08-19 16:51 ` Joseph Myers
2016-08-19 17:21 ` David Malcolm
2016-09-07 12:18 ` Advice sought for debugging a lto1 ICE (was: Implement C _FloatN, _FloatNx types [version 6]) Thomas Schwinge
2016-09-07 12:28 ` Richard Biener
2016-09-08 11:53 ` Thomas Schwinge
2016-09-14 10:24 ` Richard Biener [this message]
2016-09-16 7:21 ` [PR lto/77458] Avoid ICE in offloading with differing _FloatN, _FloatNx types (was: Advice sought for debugging a lto1 ICE (was: Implement C _FloatN, _FloatNx types [version 6])) Thomas Schwinge
2016-09-16 9:02 ` Richard Biener
2016-09-16 14:00 ` Thomas Schwinge
2016-09-16 18:02 ` Joseph Myers
2016-09-19 8:40 ` Richard Biener
2016-09-19 11:04 ` Thomas Schwinge
2016-09-19 13:22 ` Joseph Myers
2016-09-19 8:53 ` Richard Biener
2016-09-19 11:57 ` Thomas Schwinge
2016-09-19 12:07 ` Richard Biener
2016-09-29 13:26 ` [PR lto/77458] Avoid ICE in offloading with differing _FloatN, _FloatNx types Thomas Schwinge
2016-10-17 15:59 ` Thomas Schwinge
2016-10-19 10:58 ` Thomas Schwinge
2016-09-29 14:55 ` Explicitly list all tree codes in gcc/tree-streamer.c:record_common_node (was: [PR lto/77458] Avoid ICE in offloading with differing _FloatN, _FloatNx types) Thomas Schwinge
2016-09-30 8:10 ` Richard Biener
2016-10-17 15:57 ` Explicitly list all tree codes in gcc/tree-streamer.c:record_common_node Thomas Schwinge
2016-09-16 17:57 ` [PR lto/77458] Avoid ICE in offloading with differing _FloatN, _FloatNx types (was: Advice sought for debugging a lto1 ICE (was: Implement C _FloatN, _FloatNx types [version 6])) Joseph Myers
2016-08-19 15:28 ` Implement C _FloatN, _FloatNx types [version 6] Szabolcs Nagy
2016-08-19 16:24 ` Joseph Myers
2016-08-31 16:58 ` James Greenhalgh
2016-08-31 17:26 ` Joseph Myers
2016-09-01 10:52 ` Szabolcs Nagy
2016-09-01 15:40 ` Joseph Myers
2016-08-21 9:50 ` Andreas Schwab
2016-08-22 10:46 ` Joseph Myers
2016-08-22 8:09 ` [BUILDROBOT] x86_64: Segmentation fault during -fself-test (was: " Jan-Benedict Glaw
2016-08-22 11:23 ` Joseph Myers
2016-08-22 10:48 ` Matthew Wahab
2016-08-22 11:48 ` Joseph Myers
2016-08-22 17:52 ` Joseph Myers
2016-09-03 19:46 ` Andreas Schwab
2016-09-05 11:45 ` Joseph Myers
2016-09-06 9:02 ` Richard Biener
2016-09-06 11:18 ` Joseph Myers
2016-07-19 11:29 ` Implement C _FloatN, _FloatNx types [version 3] James Greenhalgh
2016-07-28 22:43 ` Joseph Myers
2016-08-09 15:26 ` James Greenhalgh
2016-08-09 20:44 ` Joseph Myers
2016-08-05 0:09 ` Implement C _FloatN, _FloatNx types Michael Meissner
2016-08-05 0:35 ` Joseph Myers
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=CAFiYyc1Hg152YooKjy4wUSoVo8+aOnsbPhtxoeRLvv4zq+H1DA@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=thomas@codesourcery.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).