aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1994-11-06 21:32:11 +0000
committerBruce Evans <bde@FreeBSD.org>1994-11-06 21:32:11 +0000
commit374047c149ddd5d2a98dbc4d6a218685bfa39e5f (patch)
tree89aa403cf9b1bf11b33a14284792314c9f6eb0ac
parent3dfc7586e5e6371845bec073d83ff681c9a0df61 (diff)
downloadsrc-374047c149ddd5d2a98dbc4d6a218685bfa39e5f.tar.gz
src-374047c149ddd5d2a98dbc4d6a218685bfa39e5f.zip
Restore my fixes to 2.6.0. The changes should not affect anything except
profiling and wchar_t. Profiled libraries will shrink. tm.h: Our wchar_t is int, not unsigned short. Always link statically if profiling. Define all the SPECs together. final.c, tm.h: Don't emit unused profiling code and data. aux-output.c: Always preserve the PIC register if profiling. aux-output.c, tm.h: Implement FUNCTION_PROFILER_EPILOGUE (currently not used). New: tm.h: Set the target defaults in the correct way.
Notes
Notes: svn path=/head/; revision=4215
-rw-r--r--gnu/usr.bin/cc/cc_int/aux-output.c23
-rw-r--r--gnu/usr.bin/cc/cc_int/final.c4
-rw-r--r--gnu/usr.bin/cc/include/tm.h34
3 files changed, 37 insertions, 24 deletions
diff --git a/gnu/usr.bin/cc/cc_int/aux-output.c b/gnu/usr.bin/cc/cc_int/aux-output.c
index 830f3dd975f8..de569b6cf138 100644
--- a/gnu/usr.bin/cc/cc_int/aux-output.c
+++ b/gnu/usr.bin/cc/cc_int/aux-output.c
@@ -1097,7 +1097,8 @@ function_prologue (file, size)
int limit;
rtx xops[4];
int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+ || current_function_uses_const_pool
+ || profile_flag || profile_block_flag);
xops[0] = stack_pointer_rtx;
xops[1] = frame_pointer_rtx;
@@ -1158,8 +1159,16 @@ simple_386_epilogue ()
int nregs = 0;
int reglimit = (frame_pointer_needed
? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+
+#ifdef FUNCTION_PROFILER_EPILOGUE
+ if (profile_flag)
+ return 0;
+#endif
+
+ if (flag_pic && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool
+ || profile_flag || profile_block_flag))
+ return 0;
#ifdef NON_SAVING_SETJMP
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
@@ -1170,8 +1179,7 @@ simple_386_epilogue ()
return 0;
for (regno = reglimit - 1; regno >= 0; regno--)
- if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ if (regs_ever_live[regno] && ! call_used_regs[regno])
nregs++;
return nregs == 0 || ! frame_pointer_needed;
@@ -1194,6 +1202,11 @@ function_epilogue (file, size)
int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
|| current_function_uses_const_pool);
+#ifdef FUNCTION_PROFILER_EPILOGUE
+ if (profile_flag)
+ FUNCTION_PROFILER_EPILOGUE (file);
+#endif
+
/* Compute the number of registers to pop */
limit = (frame_pointer_needed
diff --git a/gnu/usr.bin/cc/cc_int/final.c b/gnu/usr.bin/cc/cc_int/final.c
index 61a90a95eff5..b1f4e879a6cd 100644
--- a/gnu/usr.bin/cc/cc_int/final.c
+++ b/gnu/usr.bin/cc/cc_int/final.c
@@ -957,14 +957,18 @@ static void
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, POINTER_SIZE);
+#endif /* not NO_PROFILE_DATA */
int sval = current_function_returns_struct;
int cxt = current_function_needs_context;
+#ifndef NO_PROFILE_DATA
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
text_section ();
diff --git a/gnu/usr.bin/cc/include/tm.h b/gnu/usr.bin/cc/include/tm.h
index a6d42181ef94..1f88ceb0537d 100644
--- a/gnu/usr.bin/cc/include/tm.h
+++ b/gnu/usr.bin/cc/include/tm.h
@@ -19,9 +19,6 @@ You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* This goes away when the math-emulator is fixed */
-#define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
-
/* This is tested by i386gas.h. */
#define YES_UNDERSCORES
@@ -39,9 +36,19 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
{ 0, 0} \
}
+#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
+
/* Like the default, except no -lg. */
#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+#define LINK_SPEC \
+ "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*} \
+ %{p:-Bstatic} %{pg:-Bstatic} %{Z}"
+
+/* This goes away when the math emulator is fixed. */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301)
+
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
@@ -49,12 +56,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
-#define WCHAR_TYPE "short unsigned int"
+#define WCHAR_TYPE "int"
-#define WCHAR_UNSIGNED 1
+#define WCHAR_UNSIGNED 0
#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 16
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
#define HAVE_ATEXIT
@@ -68,16 +75,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
- { \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
- } \
+ fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
else \
- { \
- fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
- } \
+ fprintf (FILE, "\tcall mcount\n"); \
}
#if 0 /* not ready for this; it should be decided at compile time */
@@ -234,10 +234,6 @@ do { \
} \
} while (0)
-#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
-#define LINK_SPEC \
- "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
-
/* This is defined when gcc is compiled in the BSD-directory-tree, and must
* make up for the gap to all the stuff done in the GNU-makefiles.
*/