aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-10-28 18:00:53 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-10-28 18:00:53 +0000
commit829245be1bfefcd312479e94752c35c7b2cb3348 (patch)
tree42470feb11450cf3a835fa2970afa3051887c4e2
parentb5bd3b3c46692ddb40a623b2728c65164f59fed3 (diff)
downloadgcc-829245be1bfefcd312479e94752c35c7b2cb3348.zip
gcc-829245be1bfefcd312479e94752c35c7b2cb3348.tar.gz
gcc-829245be1bfefcd312479e94752c35c7b2cb3348.tar.bz2
Warning fixes:
* gcc.c (EXTRA_SPECS, extra_specs): Introduce an intermediate structure which has exactly the members provided by EXTRA_SPECS. Xmalloc() the real `extra_specs', and initialize it from this intermediate structure. * alpha.h (EXTRA_SPECS): Revert change for missing initializers. * mips.h (EXTRA_SPECS): Likewise. * sparc.h (EXTRA_SPECS): Likewise. From-SVN: r23406
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/alpha/alpha.h30
-rw-r--r--gcc/config/mips/mips.h24
-rw-r--r--gcc/config/sparc/sparc.h28
-rw-r--r--gcc/gcc.c21
5 files changed, 73 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 19085ed..5cf0728 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+Wed Oct 28 20:52:47 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.c (EXTRA_SPECS, extra_specs): Introduce an intermediate
+ structure which has exactly the members provided by EXTRA_SPECS.
+ Xmalloc() the real `extra_specs', and initialize it from this
+ intermediate structure.
+
+ * alpha.h (EXTRA_SPECS): Revert change for missing initializers.
+
+ * mips.h (EXTRA_SPECS): Likewise.
+
+ * sparc.h (EXTRA_SPECS): Likewise.
+
Wed Oct 28 16:46:07 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* function.c (purge_addressof_1): Instead of aborting when a
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index d9efa59..1105bca 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -308,21 +308,21 @@ extern char *alpha_mlat_string; /* For -mmemory-latency= */
#define SUBTARGET_EXTRA_SPECS
#endif
-#define EXTRA_SPECS \
- { "cpp_am_bwx", CPP_AM_BWX_SPEC, 0, 0, 0, 0 }, \
- { "cpp_am_max", CPP_AM_MAX_SPEC, 0, 0, 0, 0 }, \
- { "cpp_am_cix", CPP_AM_CIX_SPEC, 0, 0, 0, 0 }, \
- { "cpp_im_ev4", CPP_IM_EV4_SPEC, 0, 0, 0, 0 }, \
- { "cpp_im_ev5", CPP_IM_EV5_SPEC, 0, 0, 0, 0 }, \
- { "cpp_im_ev6", CPP_IM_EV6_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu", CPP_CPU_SPEC, 0, 0, 0, 0 }, \
- { "cpp_subtarget", CPP_SUBTARGET_SPEC, 0, 0, 0, 0 }, \
+#define EXTRA_SPECS \
+ { "cpp_am_bwx", CPP_AM_BWX_SPEC }, \
+ { "cpp_am_max", CPP_AM_MAX_SPEC }, \
+ { "cpp_am_cix", CPP_AM_CIX_SPEC }, \
+ { "cpp_im_ev4", CPP_IM_EV4_SPEC }, \
+ { "cpp_im_ev5", CPP_IM_EV5_SPEC }, \
+ { "cpp_im_ev6", CPP_IM_EV6_SPEC }, \
+ { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC }, \
+ { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC }, \
+ { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC }, \
+ { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC }, \
+ { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC }, \
+ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+ { "cpp_cpu", CPP_CPU_SPEC }, \
+ { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
SUBTARGET_EXTRA_SPECS
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 129624f..538838b 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -950,18 +950,18 @@ while (0)
Do not define this macro if it does not need to do anything. */
#define EXTRA_SPECS \
- { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_cpp_size_spec", SUBTARGET_CPP_SIZE_SPEC, 0, 0, 0, 0 }, \
- { "long_max_spec", LONG_MAX_SPEC, 0, 0, 0, 0 }, \
- { "mips_as_asm_spec", MIPS_AS_ASM_SPEC, 0, 0, 0, 0 }, \
- { "gas_asm_spec", GAS_ASM_SPEC, 0, 0, 0, 0 }, \
- { "target_asm_spec", TARGET_ASM_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC, 0, 0, 0, 0 }, \
- { "subtarget_asm_spec", SUBTARGET_ASM_SPEC, 0, 0, 0, 0 }, \
- { "linker_endian_spec", LINKER_ENDIAN_SPEC, 0, 0, 0, 0 }, \
+ { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, \
+ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
+ { "subtarget_cpp_size_spec", SUBTARGET_CPP_SIZE_SPEC }, \
+ { "long_max_spec", LONG_MAX_SPEC }, \
+ { "mips_as_asm_spec", MIPS_AS_ASM_SPEC }, \
+ { "gas_asm_spec", GAS_ASM_SPEC }, \
+ { "target_asm_spec", TARGET_ASM_SPEC }, \
+ { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC }, \
+ { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \
+ { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \
+ { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \
+ { "linker_endian_spec", LINKER_ENDIAN_SPEC }, \
SUBTARGET_EXTRA_SPECS
#ifndef SUBTARGET_EXTRA_SPECS
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 5b50c2e..8bcabc5 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -316,20 +316,20 @@ Unrecognized value in TARGET_CPU_DEFAULT.
Do not define this macro if it does not need to do anything. */
#define EXTRA_SPECS \
- { "cpp_cpu", CPP_CPU_SPEC, 0, 0, 0, 0 }, \
- { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC, 0, 0, 0, 0 }, \
- { "cpp_arch32", CPP_ARCH32_SPEC, 0, 0, 0, 0 }, \
- { "cpp_arch64", CPP_ARCH64_SPEC, 0, 0, 0, 0 }, \
- { "cpp_arch_default", CPP_ARCH_DEFAULT_SPEC, 0, 0, 0, 0 }, \
- { "cpp_arch", CPP_ARCH_SPEC, 0, 0, 0, 0 }, \
- { "cpp_endian", CPP_ENDIAN_SPEC, 0, 0, 0, 0 }, \
- { "cpp_subtarget", CPP_SUBTARGET_SPEC, 0, 0, 0, 0 }, \
- { "asm_cpu", ASM_CPU_SPEC, 0, 0, 0, 0 }, \
- { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC, 0, 0, 0, 0 }, \
- { "asm_arch32", ASM_ARCH32_SPEC, 0, 0, 0, 0 }, \
- { "asm_arch64", ASM_ARCH64_SPEC, 0, 0, 0, 0 }, \
- { "asm_arch_default", ASM_ARCH_DEFAULT_SPEC, 0, 0, 0, 0 }, \
- { "asm_arch", ASM_ARCH_SPEC, 0, 0, 0, 0 }, \
+ { "cpp_cpu", CPP_CPU_SPEC }, \
+ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+ { "cpp_arch32", CPP_ARCH32_SPEC }, \
+ { "cpp_arch64", CPP_ARCH64_SPEC }, \
+ { "cpp_arch_default", CPP_ARCH_DEFAULT_SPEC },\
+ { "cpp_arch", CPP_ARCH_SPEC }, \
+ { "cpp_endian", CPP_ENDIAN_SPEC }, \
+ { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
+ { "asm_cpu", ASM_CPU_SPEC }, \
+ { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
+ { "asm_arch32", ASM_ARCH32_SPEC }, \
+ { "asm_arch64", ASM_ARCH64_SPEC }, \
+ { "asm_arch_default", ASM_ARCH_DEFAULT_SPEC },\
+ { "asm_arch", ASM_ARCH_SPEC }, \
SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1e95b04..28322e1 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1179,7 +1179,16 @@ static struct spec_list static_specs[] = {
};
#ifdef EXTRA_SPECS /* additional specs needed */
-static struct spec_list extra_specs[] = { EXTRA_SPECS };
+/* Structure to keep track of just the first two args of a spec_list.
+ That is all that the EXTRA_SPECS macro gives us. */
+struct spec_list_1
+{
+ char *name;
+ char *ptr;
+};
+
+static struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
+static struct spec_list * extra_specs = (struct spec_list *)0;
#endif
/* List of dynamically allocates specs that have been defined so far. */
@@ -1203,9 +1212,17 @@ init_spec ()
fprintf (stderr, "Using builtin specs.\n");
#ifdef EXTRA_SPECS
- for (i = (sizeof (extra_specs) / sizeof (extra_specs[0])) - 1; i >= 0; i--)
+ extra_specs = (struct spec_list *)
+ xmalloc (sizeof(struct spec_list) *
+ (sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
+ bzero ((PTR) extra_specs, sizeof(struct spec_list) *
+ (sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
+
+ for (i = (sizeof(extra_specs_1) / sizeof(extra_specs_1[0])) - 1; i >= 0; i--)
{
sl = &extra_specs[i];
+ sl->name = extra_specs_1[i].name;
+ sl->ptr = extra_specs_1[i].ptr;
sl->next = next;
sl->name_len = strlen (sl->name);
sl->ptr_spec = &sl->ptr;