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=0x7fffffffe0f8)

    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=0x7fffffffe108)

    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)

Reply via email to