[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf markus at trippelsdorf dot de changed:



   What|Removed |Added



 CC||rguenther at suse dot de



--- Comment #16 from Markus Trippelsdorf markus at trippelsdorf dot de 
2012-11-24 09:18:19 UTC ---

The issue from comment 5 onward started with:



Author: rguenth rguenth@138bc75d-0d04-0410-961f-82ee72b054a4

Date:   Thu Nov 3 14:46:26 2011 +



2011-11-03  Richard Guenther  rguent...@suse.de



PR lto/44965

* lto-opts.c: Re-implement.

* lto-streamer.h (lto_register_user_option): Remove.

(lto_read_file_options): Likewise.

(lto_reissue_options): Likewise.

(lto_clear_user_options): Likewise.

(lto_clear_file_options): Likewise.

* opts-global.c (post_handling_callback): Remove.

(set_default_handlers): Do not set post_handling_callback.

(decode_options): Remove LTO specific code.

* lto-wrapper.c (merge_and_complain): New function.

(run_gcc): Read all input file options and

prepend a merged set before the linker driver options.

* gcc.c (driver_post_handling_callback): Remove.

(set_option_handlers): Do not set post_handling_callback.

* opts-common.c (handle_option): Do not call post_handling_callback.

* opts.h (struct cl_option_handlers): Remove post_handling_callback.



lto/

* lto-lang.c (lto_post_options): Do not read file options.

* lto.c (lto_read_all_file_options): Remove.

(lto_init): Call lto_set_in_hooks here.





git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180827

138bc75d-0d04-0410-961f-82ee72b054a4


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #17 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 16:39:00 
UTC ---

LTO miscompiled:



  /* Skip frontend and driver specific options here.  */

  if (!(cl_options[option-opt_index].flags 

(CL_COMMON|CL_TARGET|CL_LTO)))continue;



with



extern const struct cl_option cl_options[];



Stage 1 GCC shows



Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/stage1-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s



Breakpoint 6, main (argc=14, argv=0x7fffe0f8)

at /export/gnu/import/git/gcc/gcc/main.c:36

36  return toplev_main (argc, argv);

(gdb) p cl_options_count

$6 = 1246

(gdb) p ((struct cl_option *) cl_options)[0]

$7 = {opt_text = 0x13ef100 -###, help = 0x0, missing_argument_error = 0x0, 

  warn_message = 0x0, alias_arg = 0x0, neg_alias_arg = 0x0, 

  alias_target = 1246, back_chain = 1246, opt_len = 3 '\003', neg_index = -1, 

  flags = 524288, cl_disabled = 0, cl_separate_nargs = 0, 

  cl_separate_alias = 0, cl_negative_alias = 0, cl_no_driver_arg = 0, 

  cl_reject_driver = 0, cl_reject_negative = 0, cl_missing_ok = 0, 

  cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 0, cl_report = 0, 

  flag_var_offset = 65535, var_enum = 0, var_type = CLVC_BOOLEAN, 

  var_value = 0}

(gdb) p cl_options[0]

$8 = {opt_text = 0x13ef100 -###, help = 0x0, missing_argument_error = 0x0, 

  warn_message = 0x0, alias_arg = 0x0, neg_alias_arg = 0x0, 

  alias_target = 1246, back_chain = 1246, opt_len = 3 '\003', neg_index = -1, 

  flags = 524288, cl_disabled = 0, cl_separate_nargs = 0, 

  cl_separate_alias = 0, cl_negative_alias = 0, cl_no_driver_arg = 0, 

  cl_reject_driver = 0, cl_reject_negative = 0, cl_missing_ok = 0, 

  cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 0, cl_report = 0, 

  flag_var_offset = 65535, var_enum = 0, var_type = CLVC_BOOLEAN, 

  var_value = 0}

(gdb) 



Stage 2 GCC shows



Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s

[Thread debugging using libthread_db enabled]

Using host libthread_db library /lib64/libthread_db.so.1.



Breakpoint 6, main (argc=14, argv=0x7fffe108)

at /export/gnu/import/git/gcc/gcc/main.c:36

36  return toplev_main (argc, argv);

(gdb) p ((struct cl_option *) cl_options)[0]

$24 = {

  opt_text = 0x432d2d002323232d Address 0x432d2d002323232d out of bounds, 

  help = 0x485441505353414c Address 0x485441505353414c out of bounds, 

  missing_argument_error = 0x772d6c6c612d2d00 Address 0x772d6c6c612d2d00 out

of bounds, 

  warn_message = 0x73676e696e7261 Address 0x73676e696e7261 out of bounds, 

  alias_arg = 0x2d0069736e612d2d Address 0x2d0069736e612d2d out of bounds, 

  neg_alias_arg = 0x6c626d657373612d Address 0x6c626d657373612d out of

bounds, alias_target = 101, back_chain = 11565, opt_len = 97 'a', 

  neg_index = 1627419762, flags = 1919251315, cl_disabled = 0, 

  cl_separate_nargs = 2, cl_separate_alias = 0, cl_negative_alias = 1, 

  cl_no_driver_arg = 1, cl_reject_driver = 1, cl_reject_negative = 0, 

  cl_missing_ok = 1, cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 1, 

  cl_report = 0, flag_var_offset = 28271, var_enum = 27936, 

  var_type = 1735289203, var_value = 3242718661498139237}

(gdb)


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #18 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 16:49:43 
UTC ---

I think LTO is confused



extern const struct cl_option cl_options[];



with



extern const struct cl_option cl_options*;


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #19 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 17:03:13 
UTC ---

The same issue can be reproduced with this patch:



diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c

index a235f41..cd3730b 100644

--- a/gcc/lto-opts.c

+++ b/gcc/lto-opts.c

@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public

License

 along with GCC; see the file COPYING3.  If not see

 http://www.gnu.org/licenses/.  */



+#define BAD_LTO

 #include config.h

 #include system.h

 #include coretypes.h

diff --git a/gcc/opts.h b/gcc/opts.h

index b6a4361..14a31e4 100644

--- a/gcc/opts.h

+++ b/gcc/opts.h

@@ -122,7 +122,11 @@ struct cl_option_state {

   char ch;

 };



+#ifdef BAD_LTO

+extern const struct cl_option *cl_options;

+#else

 extern const struct cl_option cl_options[];

+#endif

 extern const unsigned int cl_options_count;

 extern const char *const lang_names[];

 extern const unsigned int cl_lang_count;


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-23 Thread hjl.tools at gmail dot com


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



--- Comment #15 from H.J. Lu hjl.tools at gmail dot com 2012-11-23 20:32:35 
UTC ---

I still got the same failure as in comment #13 with revision

193763.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-21 Thread markus at trippelsdorf dot de


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



--- Comment #14 from Markus Trippelsdorf markus at trippelsdorf dot de 
2012-11-21 21:52:26 UTC ---

LTO gets miscompiled.



If I configure with:

~/gcc/configure --disable-bootstrap --disable-werror --disable-multilib

--enable-languages=c,c++ --enable-checking=yes,valgrind

and build with gcc-4.7, then the bad memory access in LTO vanishes.



This could be a dup of Bug 55430 (LRA miscompilation issue).


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-19 Thread hjl.tools at gmail dot com


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



--- Comment #13 from H.J. Lu hjl.tools at gmail dot com 2012-11-19 21:04:12 
UTC ---

On hjl/asan branch, I got



(gdb) r

Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s

[Thread debugging using libthread_db enabled]

Using host libthread_db library /lib64/libthread_db.so.1.

GNU C (GCC) version 4.8.0 20121117 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.8.0 20121117 (experimental), GMP version 5.0.2,

MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

GNU C (GCC) version 4.8.0 20121117 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.8.0 20121117 (experimental), GMP version 5.0.2,

MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Compiler executable checksum: 0e1eacd90672aa3f29692f9d3d99b1be

=



Breakpoint 5, __asan_report_error (pc=25644090, bp=140737488345632, 

sp=140737488345624, addr=34167900, is_write=optimized out, access_size=4)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_report.cc:464

464 bug_descr, (void*)addr, pc, bp, sp);

(gdb) bt

#0  __asan_report_error (pc=25644090, bp=140737488345632, sp=140737488345624, 

addr=34167900, is_write=optimized out, access_size=4)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_report.cc:464

#1  0x01f6bc04 in __asan::__asan_report_load4 (addr=optimized out)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_rtl.cc:194

#2  0x01874c3a in lto_write_options ()

at /export/gnu/import/git/gcc/gcc/lto-opts.c:92

#3  0x0135e932 in produce_asm_for_decls ()

at /export/gnu/import/git/gcc/gcc/lto-streamer-out.c:1407

#4  0x012a3458 in ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

[clone .565573] (pass=0x2689880 pass_ipa_lto_finish_out, 

state=0x718cce40) at /export/gnu/import/git/gcc/gcc/passes.c:2430

#5  0x0135b2a0 in ipa_write_summaries_1 (encoder=0x77d6c5c0)

at /export/gnu/import/git/gcc/gcc/passes.c:2460

#6  ipa_write_summaries () at /export/gnu/import/git/gcc/gcc/passes.c:2514

#7  0x00b16399 in ipa_passes ()

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1908

#8  compile () at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1994

#9  0x00b16d2a in finalize_compilation_unit ()

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:2122

#10 0x00b17271 in c_write_global_declarations ()

at /export/gnu/import/git/gcc/gcc/c/c-decl.c:10128

#11 0x00b2c258 in compile_file ()

---Type return to continue, or q return to quit---

at /export/gnu/import/git/gcc/gcc/toplev.c:559

#12 0x00b2e4b0 in do_compile ()

at /export/gnu/import/git/gcc/gcc/toplev.c:1881

#13 toplev_main (argc=14, argv=0x7fffe108)

at /export/gnu/import/git/gcc/gcc/toplev.c:1957

#14 0x0038f3a21675 in __libc_start_main () from /lib64/libc.so.6

#15 0x0056df51 in _start ()

(gdb) c

Continuing.

==1834== ERROR: AddressSanitizer global-buffer-overflow on address

0x02095c5c at pc 0x1874c3a bp 0x7fffda20 sp 0x7fffda18

READ of size 4 at 0x02095c5c thread T0

#0 0x1874c39

(/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1+0x1874c39)

0x02095c5c is located 4 bytes to the left of global variable '__FUNCTION__

(/tmp/ccHvMX0o.ltrans5.o)' (0x2095c60) of size 22

  '__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' is ascii string

'c_parser_if_statement'

0x02095c5c is located 30 bytes to the right of global variable

'__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' (0x2095c20) of size 30

  '__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' is ascii string

'c_parser_declaration_or_fndef'

Shadow byte and word:

  0x10412b8b: f9

  0x10412b88: f9 f9 f9 f9 00 00 06 f9

More shadow bytes:

  0x10412b68: f9 f9 f9 f9 00 00 03 f9

  0x10412b70: f9 f9 f9 f9 00 00 06 f9

  0x10412b78: f9 f9 f9 f9 00 00 03 f9

  0x10412b80: f9 f9 f9 f9 00 00 00 06

=0x10412b88: f9 f9 f9 f9 00 00 06 f9

  0x10412b90: f9 f9 f9 f9 00 00 00 02

  0x10412b98: f9 f9 f9 f9 00 00 00 01

  0x10412ba0: f9 f9 f9 f9 00 00 06 f9

  0x10412ba8: f9 f9 f9 f9 00 00 04 f9

Stats: 2M malloced (2M for red zones) by 3332 calls

Stats: 0M realloced by 285 calls

Stats: 1M freed by 1187 calls

Stats: 0M really freed by 0 calls

Stats: 8M (2059 full pages) mmaped in 16 calls

  mmaps   by size class: 7:4095; 8:2047; 9:1023; 10:511; 11:255; 12:128; 13:64;

14:32; 15:16; 16:8; 17:20; 18:2; 

  mallocs by size class: 7:2075; 8:747; 9:65; 10:95; 11:226; 12:52; 13:44;

14:1; 15:5; 16:1; 17:20; 18:1; 

  frees   by size class: 7:457; 8:359; 9:46; 10:80; 11:154; 12:46; 

[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-18 Thread hjl.tools at gmail dot com

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

--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 13:15:59 
UTC ---
I got

/tmp/cc5sWfOD.s: Assembler messages:
/tmp/cc5sWfOD.s:824391: Error: invalid character (0xf7) in mnemonic
make[7]: *** [/tmp/ccpgVF41.ltrans24.ltrans.o] Error 1
lto-wrapper: make returned 2 exit status
/usr/local/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[6]: *** [cc1] Error 1
make[6]: *** Waiting for unfinished jobs

In .section .debug_info,,@progbits, there are

 824390 .byte   0x30
 824391 ÷ÿÿè^H¨=:
 824392 .uleb128 0x7


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #6 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 15:47:56 
UTC ---

[hjl@gnu-mic-2 gcc]$ cat /tmp/x.c

int

main ()

{

}

[hjl@gnu-mic-2 gcc]$ ./xgcc -B./ -c -flto /tmp/x.c

==17373== Invalid read of size 8

==17373==at 0x8E3FE6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17373==by 0x71FA5F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17373==by 0x71F06B: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17373==by 0x721798: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17373==by 0x74A477: ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

(passes.c:2430)

==17373==by 0x74B34D: ipa_write_summaries() (passes.c:2460)

==17373==by 0x5ACA9B: compile() (cgraphunit.c:1908)

==17373==by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)

==17373==by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)

==17373==by 0x7D7F4C: compile_file() (toplev.c:559)

==17373==by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)

==17373==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17373==  Address 0xb57c9da is not stack'd, malloc'd or (recently) free'd

==17373== 

==17373== Invalid read of size 8

==17373==at 0x8E4103: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:271)

==17373==by 0x71FA5F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17373==by 0x71F06B: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17373==by 0x721798: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17373==by 0x74A477: ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

(passes.c:2430)

==17373==by 0x74B34D: ipa_write_summaries() (passes.c:2460)

==17373==by 0x5ACA9B: compile() (cgraphunit.c:1908)

==17373==by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)

==17373==by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)

==17373==by 0x7D7F4C: compile_file() (toplev.c:559)

==17373==by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)

==17373==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17373==  Address 0xb57c9db is not stack'd, malloc'd or (recently) free'd

==17373== 

[hjl@gnu-mic-2 gcc]$


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:15:50 
UTC ---

When I add --db-attach=yes, valgrind doesn't report any

error.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:30:20 
UTC ---

==17631== Invalid read of size 8

==17631==at 0x6B2522: output_symtab() (lto-cgraph.c:589)

==17631==by 0x6B87B5: lto_output() (lto-streamer-out.c:1000)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5caccc is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BDA6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5afeda is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BEC3: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:271)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5afedb is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BFFE: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:230)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5c8f69 is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BDA6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B951F: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5c55da is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BEC3: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) 

[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||hubicka at gcc dot gnu.org



--- Comment #9 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:47:54 
UTC ---

==17715== Invalid read of size 8

==17715==at 0x6B2522: output_symtab() (lto-cgraph.c:589)

==17715==by 0x6B87B5: lto_output() (lto-streamer-out.c:1000)

==17715==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17715==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17715==by 0x4EA5AA: lto_main() (lto.c:2693)

==17715==by 0x76FC45: compile_file() (toplev.c:545)

==17715==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17715==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17715==  Address 0xb5caccc is not stack'd, malloc'd or (recently) free'd



 588   bp = bitpack_create (ob-main_stream);

 589   bp_pack_value (bp, ref-use, 2);

 590   streamer_write_bitpack (bp);

 591   nref = lto_symtab_encoder_lookup (encoder, ref-referred);

 592   gcc_assert (nref != LCC_NOT_FOUND);

 593   streamer_write_hwi_stream (ob-main_stream, nref);



(gdb) p ref

$1 = (ipa_ref *) 0xb5cacb0

(gdb) p ref-use

$2 = IPA_REF_LOAD

(gdb) p ref-use

$3 = (ipa_ref_use *) 0xb5caccc

(gdb)


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #10 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 17:20:19 
UTC ---

There is a bad memory access in LTO.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #11 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 17:30:25 
UTC ---

It can be reproduced with LTO bootstrap on hjl/valgrind branch at



http://gcc.gnu.org/git/?p=gcc.git;a=summary



with --enable-checking=valgrind.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-16 Thread markus at trippelsdorf dot de


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



--- Comment #5 from Markus Trippelsdorf markus at trippelsdorf dot de 
2012-11-16 19:36:26 UTC ---

I'm not sure if it's related, but with gcc built with clang's

-fsanitize=address I get:



markus@x4 ~ % /var/tmp/gcc_sani_clang/usr/local/bin/g++ -flto t.cpp 21 |

asan_symbolize.py | c++filt

=

==15267== ERROR: AddressSanitizer: global-buffer-overflow on address

0x02d16424 at pc 0x12ca07a bp 0x7fff5db28190 sp 0x7fff5db28188

READ of size 4 at 0x02d16424 thread T0

#0 0x12ca079 in lto_write_options() /home/markus/gcc/gcc/lto-opts.c:97

#1 0x12c076a in produce_asm_for_decls()

/home/markus/gcc/gcc/lto-streamer-out.c:1407

#2 0x135a74f in ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

/home/markus/gcc/gcc/passes.c:2430

0x02d16424 is located 28 bytes to the left of global variable '.str2184

(options.c)' (0x2d16440) of size 4

  '.str2184 (options.c)' is ascii string 'gnu'

0x02d16424 is located 25 bytes to the right of global variable '.str2183

(options.c)' (0x2d16400) of size 11

  '.str2183 (options.c)' is ascii string 'local-exec'

Shadow byte and word:

  0x105a2c84: f9

  0x105a2c80: 00 03 f9 f9 f9 f9 f9 f9

More shadow bytes:

  0x105a2c60: 00 00 00 02 f9 f9 f9 f9

  0x105a2c68: 00 07 f9 f9 f9 f9 f9 f9

  0x105a2c70: 00 05 f9 f9 f9 f9 f9 f9

  0x105a2c78: 00 06 f9 f9 f9 f9 f9 f9

=0x105a2c80: 00 03 f9 f9 f9 f9 f9 f9

  0x105a2c88: 04 f9 f9 f9 f9 f9 f9 f9

  0x105a2c90: 05 f9 f9 f9 f9 f9 f9 f9

  0x105a2c98: 00 f9 f9 f9 f9 f9 f9 f9

  0x105a2ca0: 07 f9 f9 f9 f9 f9 f9 f9

Stats: 3M malloced (2M for red zones) by 3820 calls

Stats: 0M realloced by 288 calls

Stats: 2M freed by 1635 calls

Stats: 0M really freed by 0 calls

Stats: 9M (2317 full pages) mmaped in 18 calls

  mmaps   by size class: 7:4095; 8:2047; 9:1023; 10:511; 11:255; 12:384; 13:64;

14:32; 15:16; 16:8; 17:20; 18:2;

  mallocs by size class: 7:2233; 8:820; 9:69; 10:96; 11:228; 12:297; 13:49;

14:1; 15:5; 16:1; 17:20; 18:1;

  frees   by size class: 7:523; 8:492; 9:47; 10:80; 11:156; 12:291; 13:21;

14:1; 15:4; 17:20;

  rfrees  by size class:

Stats: malloc large: 27 small slow: 88

==15267== ABORTING



markus@x4 ~ % cat t.cpp

int main () {}


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-15 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 00:34:07 
UTC ---

Revision 193543 gave:



lto1: internal compiler error: Segmentation fault

0xb37547 crash_signal

../../src-trunk/gcc/toplev.c:334

0x6c0763 resolve_addr_in_expr

../../src-trunk/gcc/dwarf2out.c:22440

0x6eb6e2 resolve_addr

../../src-trunk/gcc/dwarf2out.c:22636

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6ec76b dwarf2out_finish

../../src-trunk/gcc/dwarf2out.c:23309

Please submit a full bug report,

with preprocessed source if appropriate.

Please include the complete backtrace with any bug report.

See http://gcc.gnu.org/bugs.html for instructions.

make[7]: *** [/tmp/ccAUJBBj.ltrans24.ltrans.o] Error 1

make[7]: *** Waiting for unfinished jobs

lto-wrapper: make returned 2 exit status

/usr/local/x86_64-unknown-linux-gnu/bin/ld: lto-wrapper failed

collect2: error: ld returned 1 exit status

make[6]: *** [cc1plus] Error 1


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-10-11 Thread ubizjak at gmail dot com


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



--- Comment #1 from Uros Bizjak ubizjak at gmail dot com 2012-10-11 17:41:30 
UTC ---

(In reply to comment #0)



 It happens at random.



Maybe --enable-checking=valgrind can help here?


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-10-11 Thread hjl.tools at gmail dot com


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



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-10-11 17:54:11 
UTC ---

(In reply to comment #1)

 (In reply to comment #0)

 

  It happens at random.

 

 Maybe --enable-checking=valgrind can help here?



I will give it a try.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-10-11 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf markus at trippelsdorf dot de changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #3 from Markus Trippelsdorf markus at trippelsdorf dot de 
2012-10-11 17:54:57 UTC ---

(In reply to comment #1)

 (In reply to comment #0)

 

  It happens at random.

 

 Maybe --enable-checking=valgrind can help here?



It could if it would build, see Bug 54691.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-10-04 Thread rguenth at gcc dot gnu.org


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



Richard Guenther rguenth at gcc dot gnu.org changed:



   What|Removed |Added



Version|4.7.3   |4.8.0

   Target Milestone|--- |4.8.0