Re: [RFC] LTO and debug information
On Sat, 12 Dec 2009, Richard Guenther wrote: > On Fri, 11 Dec 2009, Richard Guenther wrote: > > > > > The following draft patch disables the debuginfo disabling when using > > -flto or -fwhopr and fixes up things so that for C debugging (mostly) > > works. > > > > The main question I have is how to proceed further here (with the > > goal that simple debugging should be possible in 4.5). If we > > apply this patch then we expose ICEs when -flto is used in > > conjunction with -g because the patch doesn't fix all clashes > > between free-lang-data and dwarf2out. Now I was thinking of > > instead of ICEing to sorry () if we ICE, have debuginfo enabled > > and had run free-lang-data. Or to keep -g non-operational for > > LTO and add a -glto or -fi-really-want-to-debug option. > > > > Or of course hope I can reasonably fix the ICEs I run into and > > deal with the remaining cases as bugs? > > The following variant of the patch with only one non-mergeable > hunk (the gen_member_die one) allows me to build all of SPEC2006 > with LTO and debug information enabled. Running the C++ > testsuite with -g still reveals many ICEs mainly because we > free too many TYPE/DECL_CONTEXTs. > > But even in its current state it will probably be useful to > many people (not Fortran without the hack though - I'll see > to add support for streaming TYPE_DECLs). That was easy enough. So I'd like to commit the following. Bootstrapped and tested on x86_64-unknown-linux-gnu. SPEC 2006 built fine with -O3 -fwhole-program -flto -g. Ok? Thanks, Richard. 2009-12-12 Richard Guenther * tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD. (free_lang_data_in_type): Do not free TYPE_STUB_DECL if we generate debug information. (free_lang_data_in_decl): Do not free DECL_SIZE_UNIT, DECL_SIZE, DECL_FIELD_OFFSET and DECL_FCONTEXT. (free_lang_data): Do not disable debuginfo. * lto-streamer-out.c (write_symbol_vec): Deal with non-constant DECL_SIZE. (pack_ts_base_value_fields): Write types with false TREE_ASM_WRITTEN. (lto_output_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * lto-streamer-in.c (lto_input_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * dwarf2out.c (add_pure_or_virtual_attribute): Check for DECL_CONTEXT. (gen_type_die_for_member): Test for TYPE_STUB_DECL. * opts.c (decode_options): Do not disable var-tracking for lto. * doc/invoke.texi (-flto): Document -flto vs. -g experimental status. (-fwhopr): Document experimental status. lto/ * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET. (lto_post_options): Do not disable debuginfo. Index: gcc/tree.c === *** gcc/tree.c.orig 2009-12-12 01:14:07.0 +0100 --- gcc/tree.c 2009-12-13 17:31:30.0 +0100 *** free_lang_data_in_binfo (tree binfo) *** 4152,4164 gcc_assert (TREE_CODE (binfo) == TREE_BINFO); - BINFO_OFFSET (binfo) = NULL_TREE; BINFO_VTABLE (binfo) = NULL_TREE; - BINFO_VPTR_FIELD (binfo) = NULL_TREE; BINFO_BASE_ACCESSES (binfo) = NULL; BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE; BINFO_SUBVTT_INDEX (binfo) = NULL_TREE; - BINFO_VPTR_FIELD (binfo) = NULL_TREE; for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (binfo), i, t); i++) free_lang_data_in_binfo (t); --- 4152,4161 *** free_lang_data_in_type (tree type) *** 4253,4259 } TYPE_CONTEXT (type) = NULL_TREE; ! TYPE_STUB_DECL (type) = NULL_TREE; } --- 4250,4257 } TYPE_CONTEXT (type) = NULL_TREE; ! if (debug_info_level < DINFO_LEVEL_TERSE) ! TYPE_STUB_DECL (type) = NULL_TREE; } *** free_lang_data_in_decl (tree decl) *** 4380,4408 } } ! if (TREE_CODE (decl) == PARM_DECL ! || TREE_CODE (decl) == FIELD_DECL ! || TREE_CODE (decl) == RESULT_DECL) ! { ! tree unit_size = DECL_SIZE_UNIT (decl); ! tree size = DECL_SIZE (decl); ! if ((unit_size && TREE_CODE (unit_size) != INTEGER_CST) ! || (size && TREE_CODE (size) != INTEGER_CST)) ! { ! DECL_SIZE_UNIT (decl) = NULL_TREE; ! DECL_SIZE (decl) = NULL_TREE; ! } ! ! if (TREE_CODE (decl) == FIELD_DECL ! && DECL_FIELD_OFFSET (decl) ! && TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST) ! DECL_FIELD_OFFSET (decl) = NULL_TREE; ! ! /* DECL_FCONTEXT is only used for debug info generation. */ ! if (TREE_CODE (decl) == FIELD_DECL) ! DECL_FCONTEXT (decl) = NULL_TREE; ! } ! else if (TREE_CODE (decl) == FUNCTION_DECL) { if (gimple_has_body_p (decl)) { --- 4378,4384 } } ! if (TREE_CODE (decl) == FUNCTION_DECL) { if (gimple_has_body_p (dec
Re: [RFC] LTO and debug information
On Fri, 11 Dec 2009, Richard Guenther wrote: > > The following draft patch disables the debuginfo disabling when using > -flto or -fwhopr and fixes up things so that for C debugging (mostly) > works. > > The main question I have is how to proceed further here (with the > goal that simple debugging should be possible in 4.5). If we > apply this patch then we expose ICEs when -flto is used in > conjunction with -g because the patch doesn't fix all clashes > between free-lang-data and dwarf2out. Now I was thinking of > instead of ICEing to sorry () if we ICE, have debuginfo enabled > and had run free-lang-data. Or to keep -g non-operational for > LTO and add a -glto or -fi-really-want-to-debug option. > > Or of course hope I can reasonably fix the ICEs I run into and > deal with the remaining cases as bugs? The following variant of the patch with only one non-mergeable hunk (the gen_member_die one) allows me to build all of SPEC2006 with LTO and debug information enabled. Running the C++ testsuite with -g still reveals many ICEs mainly because we free too many TYPE/DECL_CONTEXTs. But even in its current state it will probably be useful to many people (not Fortran without the hack though - I'll see to add support for streaming TYPE_DECLs). Richard. 2009-12-12 Richard Guenther * tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD. (free_lang_data_in_decl): Do not free DECL_SIZE_UNIT, DECL_SIZE, DECL_FIELD_OFFSET and DECL_FCONTEXT. (free_lang_data): Do not disable debuginfo. * lto-streamer-out.c (write_symbol_vec): Deal with non-constant DECL_SIZE. (pack_ts_base_value_fields): Write types with false TREE_ASM_WRITTEN. * dwarf2out.c (add_pure_or_virtual_attribute): Check for DECL_CONTEXT. (gen_type_die_for_member): Test for TYPE_STUB_DECL. * opts.c (decode_options): Do not disable var-tracking for lto. * dwarf2out.c (gen_member_die): Work around us not streaming TYPE_STUB_DECL. lto/ * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET. (lto_post_options): Do not disable debuginfo. Index: gcc/tree.c === *** gcc/tree.c.orig 2009-12-12 01:14:07.0 +0100 --- gcc/tree.c 2009-12-12 02:14:01.0 +0100 *** free_lang_data_in_binfo (tree binfo) *** 4152,4164 gcc_assert (TREE_CODE (binfo) == TREE_BINFO); - BINFO_OFFSET (binfo) = NULL_TREE; BINFO_VTABLE (binfo) = NULL_TREE; - BINFO_VPTR_FIELD (binfo) = NULL_TREE; BINFO_BASE_ACCESSES (binfo) = NULL; BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE; BINFO_SUBVTT_INDEX (binfo) = NULL_TREE; - BINFO_VPTR_FIELD (binfo) = NULL_TREE; for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (binfo), i, t); i++) free_lang_data_in_binfo (t); --- 4152,4161 *** free_lang_data_in_decl (tree decl) *** 4380,4408 } } ! if (TREE_CODE (decl) == PARM_DECL ! || TREE_CODE (decl) == FIELD_DECL ! || TREE_CODE (decl) == RESULT_DECL) ! { ! tree unit_size = DECL_SIZE_UNIT (decl); ! tree size = DECL_SIZE (decl); ! if ((unit_size && TREE_CODE (unit_size) != INTEGER_CST) ! || (size && TREE_CODE (size) != INTEGER_CST)) ! { ! DECL_SIZE_UNIT (decl) = NULL_TREE; ! DECL_SIZE (decl) = NULL_TREE; ! } ! ! if (TREE_CODE (decl) == FIELD_DECL ! && DECL_FIELD_OFFSET (decl) ! && TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST) ! DECL_FIELD_OFFSET (decl) = NULL_TREE; ! ! /* DECL_FCONTEXT is only used for debug info generation. */ ! if (TREE_CODE (decl) == FIELD_DECL) ! DECL_FCONTEXT (decl) = NULL_TREE; ! } ! else if (TREE_CODE (decl) == FUNCTION_DECL) { if (gimple_has_body_p (decl)) { --- 4377,4383 } } ! if (TREE_CODE (decl) == FUNCTION_DECL) { if (gimple_has_body_p (decl)) { *** free_lang_data (void) *** 4977,4989 diagnostic_finalizer (global_dc) = default_diagnostic_finalizer; diagnostic_format_decoder (global_dc) = default_tree_printer; - /* FIXME. We remove sufficient language data that the debug - info writer gets completely confused. Disable debug information - for now. */ - debug_info_level = DINFO_LEVEL_NONE; - write_symbols = NO_DEBUG; - debug_hooks = &do_nothing_debug_hooks; - return 0; } --- 4952,4957 Index: gcc/lto-streamer-out.c === *** gcc/lto-streamer-out.c.orig 2009-12-12 01:14:07.0 +0100 --- gcc/lto-streamer-out.c 2009-12-12 14:58:07.0 +0100 *** pack_ts_base_value_fields (struct bitpac *** 342,348 bp_pack_value (bp, DECL_UNSIGNED (expr), 1); else if (TYPE_P (expr)) bp_pack_
Re: [RFC] LTO and debug information
Hi, On Sun, 13 Dec 2009, Richard Guenther wrote: > *** free_lang_data_in_decl (tree decl) > *** 4380,4408 > } > } > > ! if (TREE_CODE (decl) == PARM_DECL > ! || TREE_CODE (decl) == FIELD_DECL > ! || TREE_CODE (decl) == RESULT_DECL) > ! { > ! tree unit_size = DECL_SIZE_UNIT (decl); > ! tree size = DECL_SIZE (decl); > ! if ((unit_size && TREE_CODE (unit_size) != INTEGER_CST) > ! || (size && TREE_CODE (size) != INTEGER_CST)) > ! { > ! DECL_SIZE_UNIT (decl) = NULL_TREE; > ! DECL_SIZE (decl) = NULL_TREE; > ! } > ! > ! if (TREE_CODE (decl) == FIELD_DECL > ! && DECL_FIELD_OFFSET (decl) > ! && TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST) > ! DECL_FIELD_OFFSET (decl) = NULL_TREE; > ! > ! /* DECL_FCONTEXT is only used for debug info generation. */ > ! if (TREE_CODE (decl) == FIELD_DECL) > ! DECL_FCONTEXT (decl) = NULL_TREE; > ! } Ugh. If you remove this, add an 'FIXME' comment, in case we ever get the early-debuginfo generation. We do want to nullify these eventually, and it's sufficiently tricky to free the right things without introducing strange errors so that we don't want to invest the time to find out the details again. Right now we still remember, but in one year ... :) Ciao, Michael.
Re: [RFC] LTO and debug information
On Sun, 13 Dec 2009, Michael Matz wrote: > Hi, > > On Sun, 13 Dec 2009, Richard Guenther wrote: > > > *** free_lang_data_in_decl (tree decl) > > *** 4380,4408 > > } > > } > > > > ! if (TREE_CODE (decl) == PARM_DECL > > ! || TREE_CODE (decl) == FIELD_DECL > > ! || TREE_CODE (decl) == RESULT_DECL) > > ! { > > ! tree unit_size = DECL_SIZE_UNIT (decl); > > ! tree size = DECL_SIZE (decl); > > ! if ((unit_size && TREE_CODE (unit_size) != INTEGER_CST) > > ! || (size && TREE_CODE (size) != INTEGER_CST)) > > ! { > > ! DECL_SIZE_UNIT (decl) = NULL_TREE; > > ! DECL_SIZE (decl) = NULL_TREE; > > ! } > > ! > > ! if (TREE_CODE (decl) == FIELD_DECL > > ! && DECL_FIELD_OFFSET (decl) > > ! && TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST) > > ! DECL_FIELD_OFFSET (decl) = NULL_TREE; > > ! > > ! /* DECL_FCONTEXT is only used for debug info generation. */ > > ! if (TREE_CODE (decl) == FIELD_DECL) > > ! DECL_FCONTEXT (decl) = NULL_TREE; > > ! } > > Ugh. If you remove this, add an 'FIXME' comment, in case we ever get the > early-debuginfo generation. We do want to nullify these eventually, and > it's sufficiently tricky to free the right things without introducing > strange errors so that we don't want to invest the time to find out the > details again. Right now we still remember, but in one year ... :) I'll replace it with + /* ??? We could free non-constant DECL_SIZE, DECL_SIZE_UNIT +and DECL_FIELD_OFFSET. But it's cheap enough to not do +that and refrain from adding workarounds to dwarf2out.c */ + + /* DECL_FCONTEXT is only used for debug info generation. */ + if (TREE_CODE (decl) == FIELD_DECL + && debug_info_level < DINFO_LEVEL_TERSE) + DECL_FCONTEXT (decl) = NULL_TREE; + the non-constant sizes and offset are gimplified and thus only a single decl. IMHO it's not a good idea to make those types incomplete (even if nothing should really look at their sizes). We can deal with DECL_FCONTEXT like with TYPE_STUB_DECL. Richard.
GCC server is down?
Hello All, It seems to me that now (GMT time is Sun Dec 13 16:14:59 UTC 2009) the gcc.gnu.org server is down (unreachable, don't ping, don't answer HTTP requests). This seems to be the case for a couple of hours at least. Regards -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***
Re: GCC server is down?
On Sun, Dec 13, 2009 at 8:16 AM, Basile STARYNKEVITCH wrote: > Hello All, > > It seems to me that now (GMT time is Sun Dec 13 16:14:59 UTC 2009) the > gcc.gnu.org server is down (unreachable, don't ping, don't answer HTTP > requests). This seems to be the case for a couple of hours at least. It was down all of Saturday due to moving the physical machine. Thanks, Andrew Pinski
Re: GCC server is down?
Hi Basil, On 13.12.09 17:16, Basile STARYNKEVITCH wrote: It seems to me that now (GMT time is Sun Dec 13 16:14:59 UTC 2009) the gcc.gnu.org server is down (unreachable, don't ping, don't answer HTTP requests). This seems to be the case for a couple of hours at least. The servers were down due to movement, from one colo to another. Since 9PM Zurich time the servers are reachable again including svn with namespace resolution, iow, the DNS is also working again. This was announced here: http://gcc.gnu.org/ml/gcc/2009-12/msg00091.html Regards, Andreas
gcc-4.3-20091213 is now available
Snapshot gcc-4.3-20091213 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20091213/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.3 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch revision 155196 You'll find: gcc-4.3-20091213.tar.bz2 Complete GCC (includes all of below) gcc-core-4.3-20091213.tar.bz2 C front end and core compiler gcc-ada-4.3-20091213.tar.bz2 Ada front end and runtime gcc-fortran-4.3-20091213.tar.bz2 Fortran front end and runtime gcc-g++-4.3-20091213.tar.bz2 C++ front end and runtime gcc-java-4.3-20091213.tar.bz2 Java front end and runtime gcc-objc-4.3-20091213.tar.bz2 Objective-C front end and runtime gcc-testsuite-4.3-20091213.tar.bz2The GCC testsuite Diffs from 4.3-20091206 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-4.3 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.
GCC's data dependence analyse may inaccuracy
Hi, I unroll the following code one times in a gimpile pass. for(i=0; i< N ; i++) a[i] = b[i] + c[i]; And then I create the loops's ddg using build_intra_loop_deps ( ) in an RTL pass; I found the data dependence information: insn 54 TRUE_DEPENDENCE insn 53. insn 50 (set (reg:SF 243) (mem/s:SF (reg:SI 236 [ ivtmp.46 ]) // reg243 <-b[i] insn 51 (set (reg:SF 244) (mem/s:SF (reg:SI 235 [ ivtmp.49 ]) // reg244 <-c[i] insn 52 (set (reg:SF 245) (plus:SF (reg:SF 243) (reg:SF 244))) //reg245 <- reg243 + reg244 insn 53 (set (mem/s:SF (reg:SI 234 [ ivtmp.51 ]) (reg:SF 245)) //reg245->a[i] insn 54 (set (reg:SF 246) // reg246 <-b[i+1] (mem/s:SF (plus:SI (reg:SI 236 [ ivtmp.46 ]) (const_int 4 [0x4])) insn 55 (set (reg:SF 247) (mem/s:SF (plus:SI (reg:SI 235 [ ivtmp.49 ]) // reg247 <- c[i+ 1] (const_int 4 [0x4])) insn 56 (set (reg:SF 248) //reg248 <- reg246 + reg247 (plus:SF (reg:SF 246) (reg:SF 247))) insn 57 (set (mem/s:SF (plus:SI (reg:SI 234 [ ivtmp.51 ]) // reg248 -> a[i + 1] (const_int 4 [0x4])) [2 a S4 A32]) (reg:SF 248)) ... === (insn 50 49 51 3 loop.c:14 (set (reg:SF 243) (mem/s:SF (reg:SI 236 [ ivtmp.46 ]) [2 b S4 A32])) 320 {*movsf_hardfloat} (nil)) (insn 51 50 52 3 loop.c:14 (set (reg:SF 244) (mem/s:SF (reg:SI 235 [ ivtmp.49 ]) [2 c S4 A32])) 320 {*movsf_hardfloat} (nil)) (insn 52 51 53 3 loop.c:14 (set (reg:SF 245) (plus:SF (reg:SF 243) (reg:SF 244))) 7 {addsf3} (expr_list:REG_DEAD (reg:SF 244) (expr_list:REG_DEAD (reg:SF 243) (nil (insn 53 52 54 3 loop.c:14 (set (mem/s:SF (reg:SI 234 [ ivtmp.51 ]) [2 a S4 A32]) (reg:SF 245)) 320 {*movsf_hardfloat} (expr_list:REG_DEAD (reg:SF 245) (nil))) (insn 54 53 55 3 loop.c:14 (set (reg:SF 246) (mem/s:SF (plus:SI (reg:SI 236 [ ivtmp.46 ]) (const_int 4 [0x4])) [2 b S4 A32])) 320 {*movsf_hardfloat} (nil)) (insn 55 54 56 3 loop.c:14 (set (reg:SF 247) (mem/s:SF (plus:SI (reg:SI 235 [ ivtmp.49 ]) (const_int 4 [0x4])) [2 c S4 A32])) 320 {*movsf_hardfloat} (nil)) (insn 56 55 57 3 loop.c:14 (set (reg:SF 248) (plus:SF (reg:SF 246) (reg:SF 247))) 7 {addsf3} (expr_list:REG_DEAD (reg:SF 247) (expr_list:REG_DEAD (reg:SF 246) (nil (insn 57 56 58 3 loop.c:14 (set (mem/s:SF (plus:SI (reg:SI 234 [ ivtmp.51 ]) (const_int 4 [0x4])) [2 a S4 A32]) (reg:SF 248)) 320 {*movsf_hardfloat} (expr_list:REG_DEAD (reg:SF 248) (nil))) (insn 58 57 61 3 loop.c:7 (set (reg/v:SI 241 [ i ]) (plus:SI (reg/v:SI 241 [ i ]) (const_int 2 [0x2]))) 10 {*addsi3} (nil)) (insn 61 58 62 3 loop.c:7 (set (reg:SI 240 [ ivtmp.29 ]) (minus:SI (reg:SI 258) (reg/v:SI 241 [ i ]))) 23 {subsi3} (expr_list:REG_EQUAL (minus:SI (const_int 10240 [0x2800]) (reg/v:SI 241 [ i ])) (nil))) (insn 62 61 63 3 loop.c:7 (set (reg:SI 236 [ ivtmp.46 ]) (plus:SI (reg:SI 236 [ ivtmp.46 ]) (const_int 8 [0x8]))) 10 {*addsi3} (nil)) (insn 63 62 64 3 loop.c:7 (set (reg:SI 235 [ ivtmp.49 ]) (plus:SI (reg:SI 235 [ ivtmp.49 ]) (const_int 8 [0x8]))) 10 {*addsi3} (nil)) (insn 64 63 67 3 loop.c:7 (set (reg:SI 234 [ ivtmp.51 ]) (plus:SI (reg:SI 234 [ ivtmp.51 ]) (const_int 8 [0x8]))) 10 {*addsi3} (nil)) (jump_insn 67 64 68 3 loop.c:7 (set (pc) (if_then_else (ne (reg/v:SI 241 [ i ]) (reg:SI 259)) (label_ref:SI 116) (pc))) 415 {*branch_equalitysi} (expr_list:REG_EQUAL (if_then_else (ne (reg/v:SI 241 [ i ]) (const_int 10238 [0x27fe])) (label_ref:SI 116) (pc)) (expr_list:REG_BR_PROB (const_int 9800 [0x2648]) (nil Thanks -- Jianzhang Peng