[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-27 Thread hjl at gcc dot gnu.org


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



--- Comment #27 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org 2012-11-27 
13:56:37 UTC ---

Author: hjl

Date: Tue Nov 27 13:56:31 2012

New Revision: 193848



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=193848

Log:

Handle OPT_SPECIAL_XXX in LTO



PR lto/54795

* lto-opts.c (lto_write_options): Also handle

OPT_SPECIAL_unknown, OPT_SPECIAL_ignore and

OPT_SPECIAL_program_name.



PR lto/55474

* lto-wrapper.c (merge_and_complain): Handle

OPT_SPECIAL_unknown, OPT_SPECIAL_ignore,

OPT_SPECIAL_program_name and OPT_SPECIAL_input_file.



Modified:

trunk/gcc/ChangeLog

trunk/gcc/lto-opts.c

trunk/gcc/lto-wrapper.c


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-26 Thread rguenth at gcc dot gnu.org


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



--- Comment #25 from Richard Biener rguenth at gcc dot gnu.org 2012-11-26 
12:24:30 UTC ---

(In reply to comment #23)

 Another problem with revision 191466 is we lost

 debug info on cl_options.  With revision 191465,

 I got

 

 (gdb) whatis cl_options

 type = const struct cl_option [1221]

 (gdb) 

 

 After revision 191466, I got

 

 (gdb) whatis cl_option

 type = cl_option

 (gdb)



This means that somewhere there is a cl_option definition that may prevail

that has size 1.  lto_symtab_resolve_symbols is supposed to pick the

largest one.  The cl_options definition that matters is in options.c,

created



const struct cl_option cl_options[] = { ... }



maybe it's size isn't finished?



Also



  || (DECL_SIZE (prevailing-symbol.decl) == DECL_SIZE (e-symbol.decl)



is fragile - use tree_int_cst_eq.  I suppose we don't have anything

like a testcase?


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

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


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



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

(In reply to comment #25)

 This means that somewhere there is a cl_option definition that may prevail

 that has size 1.  lto_symtab_resolve_symbols is supposed to pick the

 largest one.  The cl_options definition that matters is in options.c,

 created

 

 const struct cl_option cl_options[] = { ... }

 

 maybe it's size isn't finished?



Isn't just we lost debug info on arrays. We lost debug

info on all data variables.  You can pick one and verify

it.



 Also

 

   || (DECL_SIZE (prevailing-symbol.decl) == DECL_SIZE 
 (e-symbol.decl)

 

 is fragile - use tree_int_cst_eq.  I suppose we don't have anything

 like a testcase?



I don't have a testcase, except for GCC itself.


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-25 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



  Component|bootstrap   |lto



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

This is caused by revision 191466:



http://gcc.gnu.org/ml/gcc-cvs/2012-09/msg00623.html


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

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


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



--- Comment #23 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:36:48 
UTC ---

Another problem with revision 191466 is we lost

debug info on cl_options.  With revision 191465,

I got



(gdb) whatis cl_options

type = const struct cl_option [1221]

(gdb) 



After revision 191466, I got



(gdb) whatis cl_option

type = cl_option

(gdb)


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

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


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



--- Comment #24 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:39:57 
UTC ---

(In reply to comment #23)

 Another problem with revision 191466 is we lost

 debug info on cl_options.  With revision 191465,

 I got

 

 (gdb) whatis cl_options

 type = const struct cl_option [1221]

 (gdb) 

 

 After revision 191466, I got

 

 (gdb) whatis cl_option

 type = cl_option

 (gdb)



It was



(gdb) whatis cl_options

type = data variable, no debug info

(gdb) whatis cl_enums

type = data variable, no debug info

(gdb)  whatis cl_enums_count

type = data variable, no debug info

(gdb)