This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix attribute in gmon-sol2.c


The interesting lines read

static void internal_mcount (char *, unsigned short *)
     __attribute__ ((__unused__));

/* Solaris 2 libraries use _mcount.  */
asm(".global _mcount; _mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount");
/* This is for compatibility with old versions of gcc which used mcount.  */
asm(".global mcount; mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount");


The correct attribute in this case is of course ((used)).  Tested on 
sparc-sun-solaris2.8, applied to all active branches.  This fixes:

FAIL: g++.old-deja/g++.law/profile1.C (test for excess errors)
WARNING: g++.old-deja/g++.law/profile1.C compilation failed to produce 
executable

FAIL: gcc.dg/nest.c (test for excess errors)
WARNING: gcc.dg/nest.c compilation failed to produce executable

on mainline.


2005-10-09  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* config/sparc/gmon-sol2.c (internal_mcount): Mark as used.


-- 
Eric Botcazou
Index: config/sparc/gmon-sol2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/gmon-sol2.c,v
retrieving revision 1.13
diff -u -p -r1.13 gmon-sol2.c
--- config/sparc/gmon-sol2.c	13 Jan 2003 16:23:31 -0000	1.13
+++ config/sparc/gmon-sol2.c	9 Oct 2005 10:44:18 -0000
@@ -267,8 +267,7 @@ _mcleanup(void)
  * -- [eichin:19920702.1107EST]
  */
 
-static void internal_mcount (char *, unsigned short *)
-     __attribute__ ((__unused__));
+static void internal_mcount (char *, unsigned short *) __attribute__ ((used));
 
 /* i7 == last ret, -> frompcindex */
 /* o7 == current ret, -> selfpc */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]