summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8fa6bb5979e..8e0106cdb5d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1862,8 +1862,9 @@ read_specs (filename, main_p)
{
int name_len;
struct spec_list *sl;
+ struct spec_list *newsl;
- /* Get original name */
+ /* Get original name. */
p1 += sizeof "%rename";
while (*p1 == ' ' || *p1 == '\t')
p1++;
@@ -1909,6 +1910,11 @@ read_specs (filename, main_p)
if (strcmp (p1, p2) == 0)
continue;
+ for (newsl = specs; newsl; newsl = newsl->next)
+ if (strcmp (newsl->name, p2) == 0)
+ fatal ("%s: attempt to rename spec '%s' to already defined spec '%s'",
+ filename, p1, p2);
+
if (verbose_flag)
{
notice ("rename spec %s to %s\n", p1, p2);