commit ff4f7890087f626f0b8fd50db02e7da96f799eda
Author: Jerome Lambourg <lambourg@adacore.com>
Date:   Tue Jun 14 10:57:06 2016 +0200

    P614-008: support e500v[12] configuration as PPC with cpu 854[08]
    
    toplevel/
    * config.sub: merge with gnu-config trunk. Accept e500v[12] cpu names, and
    canonicalize to powerpc, and add a "spe" suffix to the os name.
    * gcc/config.gcc: determine with_cpu from the non canonical target name, and
    make sure the powerpc-wrs-vxworks*spe is properly handled.
    * libgcc/config.host: accept vxworks*spe when configuring libgcc.

diff --git a/config.sub b/config.sub
index 6d86a1e..d85b3b2 100755
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2016 Free Software Foundation, Inc.
 
-timestamp='2016-05-10'
+timestamp='2016-06-17'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -643,6 +643,14 @@ case $basic_machine in
 		basic_machine=m68k-bull
 		os=-sysv3
 		;;
+	e500v[12])
+		basic_machine=powerpc-unknown
+                os=$os"spe"
+		;;
+	e500v[12]-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+                os=$os"spe"
+		;;
 	ebmon29k)
 		basic_machine=a29k-amd
 		os=-ebmon
diff --git a/gcc/config.gcc b/gcc/config.gcc
index e47535b..879487f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2468,7 +2468,7 @@ powerpc*-*-linux*)
 		tm_file="rs6000/secureplt.h ${tm_file}"
 	fi
 	;;
-powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
+powerpc-wrs-vxworks*)
 	tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
 	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
 	extra_options="${extra_options} rs6000/sysv4.opt"
@@ -3341,11 +3341,22 @@ if test x$with_cpu = x ; then
       esac
       ;;
     powerpc*-*-*spe*)
-      if test x$enable_e500_double = xyes; then
-         with_cpu=8548
-      else
-         with_cpu=8540
-      fi       
+      # e500 is canonicalized to powerpc, so test it first
+      case ${target_noncanonical} in
+        e500v1*)
+          with_cpu=8540
+          ;;
+        e500v2*)
+          with_cpu=8548
+          ;;
+        *)
+          if $enable_e500_double = xyes; then
+            with_cpu=8548
+          else
+            with_cpu=8540
+          fi
+      ;;
+      esac
       ;;
     sparc*-*-*)
       case ${target} in
diff --git a/libgcc/config.host b/libgcc/config.host
index 7899216..600ecbf 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1079,7 +1079,7 @@ powerpc*-*-linux*)
 	extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	md_unwind_header=rs6000/linux-unwind.h
 	;;
-powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
+powerpc-wrs-vxworks*)
 	tmake_file="$tmake_file rs6000/t-ppccomm rs6000/t-savresfgpr t-fdpbit"
 	;;
 powerpc-*-lynxos*)
