Branch: undefined reference to `__builtin_cos'

Mark Mitchell mark@codesourcery.com
Wed Mar 14 19:39:00 GMT 2001


This patch fixes a latent bug uncovered by my recent changes to
DECL_RTL, and spotted by Loren.  The C++ front-end, unlike the C
front-end, was trying to emit debugging information for __FUNCTION__,
which doesn't work well.

Tested on i686-pc-linux-gnu, applied on the mainline and the branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-03-14  Mark Mitchell  <mark@codesourcery.com>

	* decl.c (cp_make_fnname_decl): Set DECL_IGNORED_P on __FUNCTION__
	and its ilk.

Index: testsuite/g++.old-deja/g++.other/fnname1.C
===================================================================
RCS file: fnname1.C
diff -N fnname1.C
*** /dev/null	Tue May  5 13:32:27 1998
--- fnname1.C	Wed Mar 14 19:11:30 2001
***************
*** 0 ****
--- 1,8 ----
+ // Build don't run:
+ // Origin: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+ // Special g++ Options: -g
+ 
+ int main ()
+ {
+   const char *s = __FUNCTION__;
+ }
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.747.2.8
diff -c -p -r1.747.2.8 decl.c
*** decl.c	2001/03/14 18:26:43	1.747.2.8
--- decl.c	2001/03/15 03:11:40
*************** cp_make_fname_decl (id, name, type_dep)
*** 6608,6613 ****
--- 6608,6614 ----
    DECL_SOURCE_LINE (decl) = 0;
    DECL_ARTIFICIAL (decl) = 1;
    DECL_IN_SYSTEM_HEADER (decl) = 1;
+   DECL_IGNORED_P (decl) = 1;
    pushdecl (decl);
    if (processing_template_decl)
      decl = push_template_decl (decl);



More information about the Gcc-patches mailing list