This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Use the new f*open_unlocked functions
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Apr 2005 01:40:10 -0400 (EDT)
- Subject: [PATCH]: Use the new f*open_unlocked functions
This patch makes GCC use the new f*open_unlocked functions I propose
adding to libiberty here:
http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01128.html
On top of the existing speedup I get from this patch:
http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00453.html
with the patch below I get an additional 0.25% - 0.5% speedup
compiling dwarf2out.c -> dwarf2out.s at -g -O0 on
i686-unknown-linux-gnu. I believe we see the additional speedup
because glibc has no fprintf_unlocked and we have quite a few fprintf
statements.
Bootstrapped in conjuction with the above two patches on
x86_64-unknown-linux-gnu, minus java because it dies building libgcj
both with and without my patches. No regressions.
Okay for mainline?
Thanks,
--Kaveh
2005-04-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
fixincludes:
* system.h (fopen, fdopen, freopen): Define these to the unlocked
libiberty functions.
gcc:
* system.h (fopen, fdopen, freopen): Define these to the unlocked
libiberty functions.
libcpp:
* system.h (fopen, fdopen, freopen): Define these to the unlocked
libiberty functions.
diff -rup orig/egcc-CVS20050409/fixincludes/system.h egcc-CVS20050409/fixincludes/system.h
--- orig/egcc-CVS20050409/fixincludes/system.h 2005-04-10 09:22:16.463854288 -0400
+++ egcc-CVS20050409/fixincludes/system.h 2005-04-10 10:00:52.484765592 -0400
@@ -38,6 +38,11 @@ Software Foundation, 59 Temple Place - S
#define NULL 0
#endif
+/* Use the unlocked open routines from libiberty. */
+#define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
+#define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
+#define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
+
/* fixincludes is not a multi-threaded application and therefore we
do not have to use the locking functions. In fact, using the locking
functions can cause the compiler to be significantly slower under
diff -rup orig/egcc-CVS20050409/gcc/system.h egcc-CVS20050409/gcc/system.h
--- orig/egcc-CVS20050409/gcc/system.h 2005-04-10 09:22:16.464854136 -0400
+++ egcc-CVS20050409/gcc/system.h 2005-04-10 10:00:35.768306880 -0400
@@ -46,6 +46,11 @@ Software Foundation, 59 Temple Place - S
#define NULL 0
#endif
+/* Use the unlocked open routines from libiberty. */
+#define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
+#define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
+#define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
+
/* The compiler is not a multi-threaded application and therefore we
do not have to use the locking functions. In fact, using the locking
functions can cause the compiler to be significantly slower under
diff -rup orig/egcc-CVS20050409/libcpp/system.h egcc-CVS20050409/libcpp/system.h
--- orig/egcc-CVS20050409/libcpp/system.h 2005-04-10 09:22:16.465853984 -0400
+++ egcc-CVS20050409/libcpp/system.h 2005-04-10 10:01:01.194441520 -0400
@@ -38,6 +38,11 @@ Software Foundation, 59 Temple Place - S
#define NULL 0
#endif
+/* Use the unlocked open routines from libiberty. */
+#define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
+#define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
+#define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
+
/* The compiler is not a multi-threaded application and therefore we
do not have to use the locking functions. In fact, using the locking
functions can cause the compiler to be significantly slower under