* 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
+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.
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'))