Merge dg-extract-results.{sh,py} from GCC upstream
It has been a while since we don't sync this file with GCC upstream,
and in the meantime some interesting things have happened.  The most
interesting is the inclusion of a new dg-extract-results.py which is
apparently faster than its shell equivalent.
This merge will probably fix the bug described in
  <https://sourceware.org/ml/gdb-patches/2014-12/msg00421.html>
Though I am still proposing the patch for upstream GCC.  Once it gets
accepted, I will merge it too.
OK to apply?
gdb/testsuite/ChangeLog:
2014-12-15  Sergio Durigan Junior  <sergiodj@redhat.com>
	Merge dg-extract-results.{sh,py} from GCC upstream (r210243,
	r210637, r210913, r211666, r215400, r215817).
	2014-05-08  Richard Sandiford  <rdsandiford@googlemail.com>
		* dg-extract-results.py: New file.
		* dg-extract-results.sh: Use it if the environment seems
		suitable.
	2014-05-20  Richard Sandiford  <rdsandiford@googlemail.com>
		* dg-extract-results.py (parse_run): Handle warnings that
		are printed before a test harness is run.
	2014-05-25  Richard Sandiford  <rdsandiford@googlemail.com>
		* dg-extract-results.py (Named): Remove __cmp__ method.
		(output_variation): Use a key to sort variation.harnesses.
	2014-06-14  Richard Sandiford  <rdsandiford@googlemail.com>
		* dg-extract-results.py: For Python 3, force sys.stdout to
		handle surrogate escape sequences.
		(safe_open): New function.
		(output_segment, main): Use it.
	2014-09-19  Segher Boessenkool  <segher@kernel.crashing.org>
		* dg-extract-results.py (Prog.result_re): Include options
		in test name.
	2014-10-02  Segher Boessenkool  <segher@kernel.crashing.org>
		* dg-extract-results.py (output_variation): Always sort if
		do_sum.