This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH c++/19044
On Dec 18, 2004, at 10:34 AM, Andrew Pinski wrote:
On Dec 18, 2004, at 1:32 PM, Matt Austern wrote:
Bootstrapped and tested on powerpc-apple-darwin. OK to commit to
mainline?
Aren't we in regression only mode now?
That's a good point, unfortunately. I'll have to hold this until we
cut the 4.0 release branch. (In the mean time I'll have to check it in
as a local change on Apple's vendor branch, because this bug will have
pretty serious customer impact for us.)
Also, here's a small correction to my patch: I left out a line in the
test case, so I wasn't testing everything I should have been.
--Matt
Index: gcc/cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1342
diff -p -r1.1342 decl.c
*** gcc/cp/decl.c 16 Dec 2004 11:03:21 -0000 1.1342
--- gcc/cp/decl.c 18 Dec 2004 23:54:08 -0000
*************** make_rtl_for_nonlocal_decl (tree decl, t
*** 4644,4650 ****
DECL_HARD_REGISTER (decl) = 1;
}
else
! set_user_assembler_name (decl, asmspec);
}
/* Handle non-variables up front. */
--- 4644,4658 ----
DECL_HARD_REGISTER (decl) = 1;
}
else
! {
! if (TREE_CODE (decl) == FUNCTION_DECL
! && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
! {
! tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
! set_user_assembler_name (builtin, asmspec);
! }
! set_user_assembler_name (decl, asmspec);
! }
}
/* Handle non-variables up front. */
Index: gcc/testsuite/g++.dg/ext/builtin6.C
===================================================================
RCS file: gcc/testsuite/g++.dg/ext/builtin6.C
diff -N gcc/testsuite/g++.dg/ext/builtin6.C
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/g++.dg/ext/builtin6.C 18 Dec 2004 23:54:09 -0000
***************
*** 0 ****
--- 1,11 ----
+ // PR c++/19044
+ // Verify that alternate asm name for builtin named "foo" also gets
+ // applied to its sibling "__builtin_foo".
+
+ // { dg-do compile }
+ // { dg-final { scan-assembler "fancy_sin" } }
+
+ extern "C" double sin(double) __asm("_fancy_sin");
+
+ double foo(double x) { return __builtin_sin(x); }
+