[Bug objc/44140] ObjC lto/whopr fails

2010-07-27 Thread iains at gcc dot gnu dot org


--- Comment #19 from iains at gcc dot gnu dot org  2010-07-27 12:03 ---
Subject: Bug 44140

Author: iains
Date: Tue Jul 27 12:02:50 2010
New Revision: 162563

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

re-enable tls and lto tests for ObjC/C++

PR ObjC/44140
* obj-c++.dg/torture/tls/thr-init-1.mm: Re-enable test.
* obj-c++.dg/torture/tls/thr-init-2.mm: Ditto.
* obj-c++.dg/torture/tls/thr-init-3.mm: Ditto.
* obj-c++.dg/torture/trivial.mm: Ditto.
* objc.dg/torture/tls/thr-init-2.m: Ditto.
* objc.dg/torture/tls/thr-init-3.m: Ditto.
* objc.dg/torture/tls/thr-init.m: Ditto.
* objc.dg/torture/trivial.m: Ditto.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm
trunk/gcc/testsuite/obj-c++.dg/torture/trivial.mm
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init.m
trunk/gcc/testsuite/objc.dg/torture/trivial.m


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-07-13 Thread iains at gcc dot gnu dot org


--- Comment #18 from iains at gcc dot gnu dot org  2010-07-13 11:01 ---
fixed


-- 

iains at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug objc/44140] ObjC lto/whopr fails

2010-07-09 Thread iains at gcc dot gnu dot org


--- Comment #17 from iains at gcc dot gnu dot org  2010-07-10 00:22 ---
Subject: Bug 44140

Author: iains
Date: Sat Jul 10 00:22:35 2010
New Revision: 162030

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

make ObjC do LTO.

gcc/
PR objc/44140
* config/darwin.c (output_objc_section_asm_op): Save and restore
section when outputting ObjC section list.

testsuite/

PR objc/44140
* objc.dg/lto/trivial-1_0.m: New.
* objc.dg/lto/lto.exp: New.
* obj-c++.dg/lto/trivial-1_0.mm: New.
* obj-c++.dg/lto/lto.exp: New.
* objc.dg/symtab-1.m: Adjust sizes.
* objc.dg/image-info.m: Do not run for gnu-runtime.

gcc/objc/

PR objc/44140
* objc-act.c: build_objc_string_decl() remove declaration.
(finish_var_decl): Remove forcing of var output and marking
as Used. 
(init_def_list): Use integer_zero_node. 
(init_objc_symtab): Use integer_zero_node, make the short
integer type specific on relevant nodes.
(generate_objc_symtab_decl): Remove call to 
forward_declare_categories().  Use null_pointer_node where
appropriate.  
(build_module_descriptor): Comment and mark this item as 
DECL_PRESERVE_P. 
(generate_static_references): Use gcc_unreachable instead of
abort (). 
(diagnose_missing_method): New.
(build_next_selector_translation_table): New.
(build_gnu_selector_translation_table): New.
(add_objc_string): Merge code from build_objc_string_decl...
... and delete build_objc_string_decl().
(generate_dispatch_table): Make integer types explicit.
(generate_category): Pass implent and arrange for the data
to be extracted within the routine.  Do not start new vars, 
but finish the ones collcted during parsing.
(generate_shared_structures): Likewise.
(finish_objc):  Reorder code so that we finish variables before
referencing them.  Save the global data before calling meta-data
creation routines, and pass the current reference to the two 
main routines.  Only call generate_objc_image_info () for the 
NeXT runtime.
(generate_classref_translation_entry): Comment on and make this
item DECL_PRESERVE_P.
(handle_class_ref): Use varpool interfaces, comment on and make
this item DECL_PRESERVE_P.
(handle_impent): Likewise.
(generate_objc_image_info): Only generate when the content is 
non-zero.  Make integer types explict.


Added:
trunk/gcc/testsuite/obj-c++.dg/lto/
trunk/gcc/testsuite/obj-c++.dg/lto/lto.exp
trunk/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm
trunk/gcc/testsuite/objc.dg/lto/
trunk/gcc/testsuite/objc.dg/lto/lto.exp
trunk/gcc/testsuite/objc.dg/lto/trivial-1_0.m
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/darwin.c
trunk/gcc/objc/ChangeLog
trunk/gcc/objc/objc-act.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/objc.dg/image-info.m
trunk/gcc/testsuite/objc.dg/symtab-1.m


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-30 Thread iains at gcc dot gnu dot org


--- Comment #13 from iains at gcc dot gnu dot org  2010-05-30 12:25 ---
In a bid to remove cases where the FE is bypassing varpool/cgraph and going
directly to asm

I've replaced the (2) instances of mark_decl_referenced () with DECL_PRESERVE_P
() =1 (Honza's suggestion)

I've removed the code in handle_class_ref () entirely [via an intermediate step
where I got it to emit code without using the asm def].
I've removed the code that outputs a class ref in handle_impent () [also via n
intermediate step].

none of these actions makes any difference to the testsuite results, nor to the
failure with -flto.

Adding Mike .. 

HJ - would you prefer this to be closed and for me to open a new bug to track
the real issue?


-- 

iains at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||mrs at gcc dot gnu dot org


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-30 Thread iains at gcc dot gnu dot org


--- Comment #14 from iains at gcc dot gnu dot org  2010-05-30 13:42 ---
Created an attachment (id=20779)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20779action=view)
patch to add LTO tests to OobjC


This adds an LTO directory to objc.dg and a single test (trivial_0.m) which is
the code at comment #5 (with the object renamed to 'myRootObject' so that it
doesn't clash with the root 'Object' provided in libobjc.)


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-30 Thread iains at gcc dot gnu dot org


--- Comment #15 from iains at gcc dot gnu dot org  2010-05-30 14:51 ---
we emit the meta-data [mostly tabular] for the runtime on the basis of
DECL_PRESERVE_P (or mark_decl_referenced () in the trunk version). 

The initlist for these decls contains references to the classes and methods.  
I wonder if this is hiding the relationship from lto?  


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-30 Thread hjl dot tools at gmail dot com


--- Comment #16 from hjl dot tools at gmail dot com  2010-05-30 14:58 
---
(In reply to comment #13)

 HJ - would you prefer this to be closed and for me to open a new bug to track
 the real issue?
 

I opened this bug to report

objc.dg/torture/tls/thr-init-3.m

Since it is XFAILED, I have no issues now.


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-29 Thread iains at gcc dot gnu dot org


--- Comment #10 from iains at gcc dot gnu dot org  2010-05-30 00:56 ---
Created an attachment (id=20775)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20775action=view)
with -lto 

the code @ comment # compiled with -flto -dA -fverbose-asm


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-29 Thread iains at gcc dot gnu dot org


--- Comment #11 from iains at gcc dot gnu dot org  2010-05-30 00:57 ---
Created an attachment (id=20776)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20776action=view)
without lto

code from comment #5 compiled with -dA -fverbose-asm


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-29 Thread iains at gcc dot gnu dot org


--- Comment #12 from iains at gcc dot gnu dot org  2010-05-30 01:00 ---
OK, so I've patch obj-act.c to remove the two cases where ASM_ was called. 
The test code compiles and runs without -flto and produces the errors as per
comment #9 when -flto is given.

The required content is present, it's just that the elements have become
disconnected - it looks like the reference has been updated, but not what it
refers too.  


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-27 Thread iains at gcc dot gnu dot org


--- Comment #8 from iains at gcc dot gnu dot org  2010-05-27 16:28 ---
Subject: Bug 44140

Author: iains
Date: Thu May 27 16:28:13 2010
New Revision: 159929

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159929
Log:
2010-05-27  Iain Sandoe  ia...@gcc.gnu.org

PR ObjC/44140
* objc.dg/torture/tls/thr-init-2.m: Skip for -flto, -fwhopr.
* objc.dg/torture/tls/thr-init-3.m: Ditto.
* objc.dg/torture/tls/thr-init.m: Ditto.
* objc.dg/torture/trivial.m: Ditto.
* obj-c++.dg/torture/tls/thr-init-1.mm: Ditto.
* obj-c++.dg/torture/tls/thr-init-2.mm: Ditto.
* obj-c++.dg/torture/tls/thr-init-3.mm: Ditto.
* obj-c++.dg/torture/trivial.mm: Ditto.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm
trunk/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm
trunk/gcc/testsuite/obj-c++.dg/torture/trivial.mm
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m
trunk/gcc/testsuite/objc.dg/torture/tls/thr-init.m
trunk/gcc/testsuite/objc.dg/torture/trivial.m


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-27 Thread iains at gcc dot gnu dot org


--- Comment #9 from iains at gcc dot gnu dot org  2010-05-27 23:34 ---
using the example at #5 

apollo:gcc-4-6-trunk-build$ ./gcc/xgcc -B gcc ../tests/trivial.m -flto -o t
-lobjc -save-temps
trivial.s:unknown:Undefined local symbol L_OBJC_CLASS_myRootObject.2084
trivial.s:unknown:Undefined local symbol L_OBJC_METACLASS_myRootObject.2083

looking at the asm with lto:

L_OBJC_SYMBOLS.2087:
.long   0
.long   0
.word   1
.word   0
.long   L_OBJC_CLASS_myRootObject.2084
.no_dead_strip L_OBJC_METH_VAR_NAME_12.2082
.objc_meth_var_names
L_OBJC_METH_VAR_NAME_12.2082:
.ascii class\0
.no_dead_strip L_OBJC_CLASS_myRootObject.2088
.objc_class
.align 5
L_OBJC_CLASS_myRootObject.2088:
.long   L_OBJC_METACLASS_myRootObject.2083

it seems that there's a later edition of the variable which becomes the label
for the table and the reference fails.

similarly with metaclass table.

.no_dead_strip L_OBJC_METACLASS_myRootObject.2092
.objc_meta_class
.align 5
L_OBJC_METACLASS_myRootObject.2092:
.long   L_OBJC_CLASS_NAME_0.2080
.long   0
.long   L_OBJC_CLASS_NAME_0.2080
.long   0


I must confess, I haven't got much idea where to look for the problem at this
juncture.. 


-- 


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



[Bug objc/44140] ObjC lto/whopr fails

2010-05-25 Thread iains at gcc dot gnu dot org


--- Comment #7 from iains at gcc dot gnu dot org  2010-05-25 09:22 ---
This bug has nothing to do with the TLS check, so renaming
A non-tls testcase exhibiting the same fail is shown as comment #5


-- 

iains at gcc dot gnu dot org changed:

   What|Removed |Added

Summary|objc.dg/torture/tls/thr-|ObjC lto/whopr fails
   |init-3.m failure|


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