public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan
@ 2004-12-16 21:15 austern at apple dot com
  2004-12-16 23:35 ` [Bug c++/19044] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: austern at apple dot com @ 2004-12-16 21:15 UTC (permalink / raw)
  To: gcc-bugs

For atan (and other functions like it), calling __builtin_atan is sometimes supposed to fall back to the 
library version of atan.  In the C++ front end, this interacts poorly with alternate asm names.

Consider the following test case:
#ifdef __cplusplus
extern "C"
#endif
double atan(double x) __asm("_fancy_atan");
double foo(double x) { return __builtin_atan(x); }

When it's compiled as C, it gives the behavior I expect: foo calls _fancy_atan.  The C++ front end, 
however, gets it wrong: we call _atan, ignoring the fact that this function is supposed to have a different 
assembler name.

-- 
           Summary: Alternate asm name for atan ignored when calling
                    __builtin_atan
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.6.0
  GCC host triplet: powerpc-apple-darwin7.6.0
GCC target triplet: powerpc-apple-darwin7.6.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19044] Alternate asm name for atan ignored when calling __builtin_atan
  2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
@ 2004-12-16 23:35 ` pinskia at gcc dot gnu dot org
  2004-12-18  1:17 ` austern at apple dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-16 23:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-16 23:35 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-16 23:35:31
               date|                            |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19044] Alternate asm name for atan ignored when calling __builtin_atan
  2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
  2004-12-16 23:35 ` [Bug c++/19044] " pinskia at gcc dot gnu dot org
@ 2004-12-18  1:17 ` austern at apple dot com
  2004-12-18 18:35 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: austern at apple dot com @ 2004-12-18  1:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2004-12-18 01:17 -------
The code in the C front end that handles this is in finish_decl, in c-decl.c:
  if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
    {
      if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
	{
	  tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
	  set_user_assembler_name (builtin, asmspec);
	   if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
	     init_block_move_fn (asmspec);
	   else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
	     init_block_clear_fn (asmspec);
	 }
      set_user_assembler_name (decl, asmspec);
    }

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19044] Alternate asm name for atan ignored when calling __builtin_atan
  2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
  2004-12-16 23:35 ` [Bug c++/19044] " pinskia at gcc dot gnu dot org
  2004-12-18  1:17 ` austern at apple dot com
@ 2004-12-18 18:35 ` pinskia at gcc dot gnu dot org
  2004-12-20 20:12 ` cvs-commit at gcc dot gnu dot org
  2004-12-20 20:40 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-18 18:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-18 18:35 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01351.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19044] Alternate asm name for atan ignored when calling __builtin_atan
  2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
                   ` (2 preceding siblings ...)
  2004-12-18 18:35 ` pinskia at gcc dot gnu dot org
@ 2004-12-20 20:12 ` cvs-commit at gcc dot gnu dot org
  2004-12-20 20:40 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-20 20:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-20 20:11 -------
Subject: Bug 19044

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	austern@gcc.gnu.org	2004-12-20 20:11:42

Modified files:
	gcc            : ChangeLog c-common.c c-common.h c-decl.c 
	gcc/cp         : ChangeLog decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: builtin6.C 

Log message:
	PR c++/19044
	
	* c-common.c (set_builtin_user_assembler_name): New.
	* c-common.h (set_builtin_user_assembler_name): Declare.
	* c-decl.c (finish_decl): Use set_builtin_user_assembler_name
	
	* decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name
	
	* g++.dg/ext/builtin6.C: New

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6900&r2=2.6901
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.594&r2=1.595
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&r1=1.272&r2=1.273
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.616&r2=1.617
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4543&r2=1.4544
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1342&r2=1.1343
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4785&r2=1.4786
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/builtin6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/19044] Alternate asm name for atan ignored when calling __builtin_atan
  2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
                   ` (3 preceding siblings ...)
  2004-12-20 20:12 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-20 20:40 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-20 20:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-20 20:40 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-12-20 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-16 21:15 [Bug c++/19044] New: Alternate asm name for atan ignored when calling __builtin_atan austern at apple dot com
2004-12-16 23:35 ` [Bug c++/19044] " pinskia at gcc dot gnu dot org
2004-12-18  1:17 ` austern at apple dot com
2004-12-18 18:35 ` pinskia at gcc dot gnu dot org
2004-12-20 20:12 ` cvs-commit at gcc dot gnu dot org
2004-12-20 20:40 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).