Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Dave Korn
Hi everyone, Although I'm seeing this on 3.3.3, it appears to be determined by the backend, so I think it's still reasonable to ask: I have some code that calls __builtin_ffs, but entirely on compile-time constants. When I compile it (using an inhouse custom ELF-target backend) with

Re: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Ian Lance Taylor
Dave Korn [EMAIL PROTECTED] writes: Although I'm seeing this on 3.3.3, it appears to be determined by the backend, so I think it's still reasonable to ask: I have some code that calls __builtin_ffs, but entirely on compile-time constants. When I compile it (using an inhouse custom

RE: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Dave Korn
On 24 April 2007 15:34, Ian Lance Taylor wrote: Dave Korn writes: Although I'm seeing this on 3.3.3, it appears to be determined by the backend, so I think it's still reasonable to ask: I have some code that calls __builtin_ffs, but entirely on compile-time constants. When I compile

Re: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Paul Brook
.file stdin foo.global _ffs Is this really a reference? It just looks like a declaration. A typical ELF assembler will not generate an undefined symbol merely because it sees a .global pseudo-op. I think gas 2.17 counts as a typical ELF assembler. It does create undefined

RE: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Dave Korn
On 24 April 2007 15:50, Dave Korn wrote: On 24 April 2007 15:34, Ian Lance Taylor wrote: It looks like this comes from an inappropriate call to assemble_external. You should find out what is calling that for _ffs. Heh, surely you mean You should find out what is calling that, ffs! ;-)

RE: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Dave Korn
On 24 April 2007 15:52, Paul Brook wrote: .file stdin foo.global _ffs Is this really a reference? It just looks like a declaration. A typical ELF assembler will not generate an undefined symbol merely because it sees a .global pseudo-op. I think gas 2.17 counts as a

Re: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Ian Lance Taylor
Paul Brook [EMAIL PROTECTED] writes: .file stdin foo.global _ffs Is this really a reference? It just looks like a declaration. A typical ELF assembler will not generate an undefined symbol merely because it sees a .global pseudo-op. I think gas 2.17 counts as a

RE: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference

2007-04-24 Thread Dave Korn
On 24 April 2007 16:00, Dave Korn wrote: I'd say that I've inherited a thinko-fied version of ASM_OUTPUT_EXTERNAL Wrong, wrong, wrong. I don't have an ASM_OUTPUT_EXTERNAL at all. What I do have, however, is TARGET_ASM_GLOBALIZE_LABEL, which appears to somehow be equated with