https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66448

--- Comment #5 from Aldy Hernandez <aldyh at redhat dot com> ---
I don't have access to a Darwin box. Could you provide a preprocessed file so I
can try to reproduce the defined but not used problem on a cross build?

Also, what triplet?

Thanks.

On Jun 7, 2015 4:09 AM, "iains at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org>
wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66448 
>
> --- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> --- 
> Created attachment 35710 
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35710&action=edit 
> declare "extern int __CFConstantStringClassReference" lazily 
>
> There seem to be three issues triggered by 224161 
>
> 1.  Debug is not initialised when the built-ins are initialised, therefore 
> any 
> attempt to declare a variable at that time causes the segv. (hash table is 
> not 
> present). 
>
> * at present, *darwin* declares "extern int 
> __CFConstantStringClassReference[]" at the time that the CFString built-in is 
> initialised. 
>
> - on the basis that it's not clear *if* such early declarations are allowed, 
> I've made a patch that makes the declaration lazily (when the fist use of the 
> built-in occurs). 
>
> This works around the reported crash (one could also use DECL_SOURCE_LOCATION 
> != BUILTINS_LOCATION as an additional test at passes.c:338, if built-ins 
> *are* 
> supposed to be allowed to declare variables. 
>
> … however ... 
>
> ==== 
>
> 2. Once (1) is fixed, bootstrap then fails with: 
>
> /GCC/gcc-trunk/gcc/ipa-pure-const.c:1640:1: error: 
> ‘{anonymous}::pass_ipa_pure_const::pass_ipa_pure_const(gcc::context*)’ 
> defined 
> but not used [-Werror=unused-function] 
> pass_ipa_pure_const:: 
>
> A --disable-werror boostrap completes, but there are a number of constructors 
> and destructors that report "declared but not used". AFAICT, it's only 
> constructors/destructors. 
>
> This is occurring at stage #2, and I thought maybe that the stage#1 compiler 
> could have been mis-compiled by the bootstrap; however, gcc-4.9, 5.1 and 
> clang 
> (xcode 5.1.1) bootstraps all give the same result. 
>
> … additional info … 
>
> ===== 
>
> 3. During bootstrap (and in the test suite on the --disable-werror build) 
> there 
> are a large number of warnings from ld64 (of course, this might be a 
> limitation 
> of ld64, but for the record): 
>
> warning: invalid DWARF generated by the compiler: DIE 0x000002f7 has multiple 
> AT_location attributes in 
> '/GCC/ml/gcc-trunk-xtools/x86_64-apple-darwin12/libgcc/enable-execute-stack_s.o'.
>  
> warning: invalid DWARF generated by the compiler: DIE 0x00000317 has multiple 
> AT_location attributes in 
> '/GCC/ml/gcc-trunk-xtools/x86_64-apple-darwin12/libgcc/enable-execute-stack_s.o'.
>  
>
> -- 
> You are receiving this mail because: 
> You are on the CC list for the bug.

Reply via email to