This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix gcc.dg/torture/pr26565.c at -O0 on SPARC/SH
- From: Roger Sayle <roger at eyesopen dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 4 May 2006 23:04:33 -0600 (MDT)
- Subject: Re: [PATCH] Fix gcc.dg/torture/pr26565.c at -O0 on SPARC/SH
Hi Eric,
On Wed, 3 May 2006, Eric Botcazou wrote:
> Regtesting on SPARC/Solaris and AMD64/Linux indeed reveals a few problems:
>
> FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O0
> eric@linux:~/build/gcc/native> gcc/xgcc -Bgcc -c memops-asm.c
> memops-asm.c:12: warning: asm declaration ignored due to conflict with
> previousrename
>
> extern void *memcpy (void *, const void *, size_t)
> __asm (ASMNAME ("my_memcpy"));
>
> doesn't cause a call to my_memcpy to be emitted anymore.
Hmm. I think that this is still the best way to go, but that we'll
also need to tweak c-pragma:maybe_apply_renaming_pragma to avoid the
above fallout; complaining about DECL_ASSEMBLER_SET_P.
Something like
if (DECL_ASSEMBLER_NAME_SET_P (decl)
&& !DECL_BUILT_IN (decl))
Ideally, we'd continue to issue the renaming warning if we could
determine whether the built-in had been explicitly prototyped or
defined earlier. Unfortunately, this information is front-end
specific.
So for C it looks like:
|| C_DECL_DECLARED_BUILTIN (decl)))
...
and for C++ it looks like:
|| !DECL_ANTICIPATED (decl))
which is a real pain for maybe_apply_renaming_pragma which is
shared between the C family front-ends. It might be easiest to
just allow builtins to be renamed without warnings, unless someone
has a better idea as how to solve this. I thought we used to
use DECL_ARTIFICIAL for this, but it doesn't look like there's
any language-independent way to check whether a buitlin has been
explicitly prototyped. Perhaps we could strcmp the assembler
name with the function's name, i.e. test "memcmp" == "memcmp"?
Thoughts?
Roger
--