2002-04-17 Nick Clifton <nickc@cambridge.redhat.com>
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2002 16:26:28 +0000 (16:26 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2002 16:26:28 +0000 (16:26 +0000)
    * gcc.c (read_specs): Detect and fail if an attempt is made to
    rename a spec string to an already existing string.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52426 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcc.c

index 9f6ec57..5e50e52 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-17  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * gcc.c (read_specs): Detect and fail if an attempt is made to
+       rename a spec string to an already existing string.
+
 2002-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.c (legitimize_pic_address): Do not generate
index 8fa6bb5..8e0106c 100644 (file)
--- 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);