2013-11-26 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
authoreager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Feb 2014 01:34:03 +0000 (01:34 +0000)
committereager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Feb 2014 01:34:03 +0000 (01:34 +0000)
 * gcc/config/microblaze/microblaze.c: Extend mcpu version format

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

gcc/ChangeLog
gcc/config/microblaze/microblaze.c

index 08ef8dd..8198a5f 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-26  Nagaraju Mekala <nagaraju.mekala@xilinx.com>
+
+       * config/microblaze/microblaze.c: Extend mcpu version format
+
 2014-02-10  David Holsgrove <david.holsgrove@xilinx.com>
 
        * config/microblaze/microblaze.h: Define SIZE_TYPE and PTRDIFF_TYPE.
index 45da3c8..cd2a788 100644 (file)
@@ -1612,21 +1612,28 @@ static int
 microblaze_version_to_int (const char *version)
 {
   const char *p, *v;
-  const char *tmpl = "vX.YY.Z";
+  const char *tmpl = "vXX.YY.Z";
   int iver = 0;
 
   p = version;
   v = tmpl;
 
-  while (*v)
+  while (*p)
     {
       if (*v == 'X')
        {                       /* Looking for major  */
-         if (!(*p >= '0' && *p <= '9'))
-           return -1;
-         iver += (int) (*p - '0');
-         iver *= 10;
-       }
+          if (*p == '.')
+            {
+              *v++;
+            }
+          else
+            {
+             if (!(*p >= '0' && *p <= '9'))
+               return -1;
+             iver += (int) (*p - '0');
+              iver *= 10;
+            }
+        }
       else if (*v == 'Y')
        {                       /* Looking for minor  */
          if (!(*p >= '0' && *p <= '9'))