~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/f5/f5256aefb2a2326bacbed8e3822706d5656ae78c.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: updates from the 4.8 branch upto 20140606 (r211339).
 
2
 
 
3
last_updated()
 
4
{
 
5
        cat > ${dir}LAST_UPDATED <<EOF
 
6
Sat Jun  7 02:24:56 CEST 2014
 
7
Sat Jun  7 00:24:56 UTC 2014 (revision 211339)
 
8
EOF
 
9
}
 
10
 
 
11
LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_3_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch \
 
12
        | sed -r 's,^--- (\S+)\t(\S+)(.*)$,--- a/src/\1\t\2,;s,^\+\+\+ (\S+)\t(\S+)(.*)$,+++ b/src/\1\t\2,' \
 
13
        | awk '/^Index:.*\.(class|texi)/ {skip=1; next} /^Index:/ { skip=0 } skip==0'
 
14
 
 
15
Index: libstdc++-v3/scripts/run_doxygen
 
16
===================================================================
 
17
--- a/src/libstdc++-v3/scripts/run_doxygen      (.../tags/gcc_4_8_3_release)
 
18
+++ b/src/libstdc++-v3/scripts/run_doxygen      (.../branches/gcc-4_8-branch)
 
19
@@ -193,8 +193,15 @@
 
20
 if $do_latex; then
 
21
     cd ${outdir}/${mode}
 
22
 
 
23
-    # Also drop in the header file and style sheet
 
24
-    doxygen -w latex header.tex doxygen.sty
 
25
+    # Grrr, Doxygen 1.8.x changed the -w latex options.
 
26
+    need_footer=`doxygen -h | sed -n -e '/-w latex/s=.*footer.*=true=p'`
 
27
+
 
28
+    # Also drop in the header file (maybe footer file) and style sheet
 
29
+    if $need_footer; then
 
30
+      doxygen -w latex header.tex footer.tex doxygen.sty
 
31
+    else
 
32
+      doxygen -w latex header.tex doxygen.sty
 
33
+    fi
 
34
     
 
35
     echo ::
 
36
     echo :: LaTeX pages begin with
 
37
Index: libstdc++-v3/include/std/future
 
38
===================================================================
 
39
--- a/src/libstdc++-v3/include/std/future       (.../tags/gcc_4_8_3_release)
 
40
+++ b/src/libstdc++-v3/include/std/future       (.../branches/gcc-4_8-branch)
 
41
@@ -351,12 +351,14 @@
 
42
       void
 
43
       _M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
 
44
       {
 
45
-        bool __set = __ignore_failure;
 
46
+        bool __set = false;
 
47
         // all calls to this function are serialized,
 
48
         // side-effects of invoking __res only happen once
 
49
         call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
 
50
             ref(__set));
 
51
-        if (!__set)
 
52
+       if (__set)
 
53
+         _M_cond.notify_all();
 
54
+       else if (!__ignore_failure)
 
55
           __throw_future_error(int(future_errc::promise_already_satisfied));
 
56
       }
 
57
 
 
58
@@ -471,7 +473,6 @@
 
59
           lock_guard<mutex> __lock(_M_mutex);
 
60
           _M_result.swap(__res);
 
61
         }
 
62
-        _M_cond.notify_all();
 
63
         __set = true;
 
64
       }
 
65
 
 
66
@@ -983,22 +984,25 @@
 
67
       void
 
68
       set_value(const _Res& __r)
 
69
       {
 
70
+       auto __future = _M_future;
 
71
         auto __setter = _State::__setter(this, __r);
 
72
-        _M_future->_M_set_result(std::move(__setter));
 
73
+        __future->_M_set_result(std::move(__setter));
 
74
       }
 
75
 
 
76
       void
 
77
       set_value(_Res&& __r)
 
78
       {
 
79
+       auto __future = _M_future;
 
80
         auto __setter = _State::__setter(this, std::move(__r));
 
81
-        _M_future->_M_set_result(std::move(__setter));
 
82
+        __future->_M_set_result(std::move(__setter));
 
83
       }
 
84
 
 
85
       void
 
86
       set_exception(exception_ptr __p)
 
87
       {
 
88
+       auto __future = _M_future;
 
89
         auto __setter = _State::__setter(__p, this);
 
90
-        _M_future->_M_set_result(std::move(__setter));
 
91
+        __future->_M_set_result(std::move(__setter));
 
92
       }
 
93
     };
 
94
 
 
95
@@ -1081,15 +1085,17 @@
 
96
       void
 
97
       set_value(_Res& __r)
 
98
       {
 
99
+       auto __future = _M_future;
 
100
         auto __setter = _State::__setter(this, __r);
 
101
-        _M_future->_M_set_result(std::move(__setter));
 
102
+        __future->_M_set_result(std::move(__setter));
 
103
       }
 
104
 
 
105
       void
 
106
       set_exception(exception_ptr __p)
 
107
       {
 
108
+       auto __future = _M_future;
 
109
         auto __setter = _State::__setter(__p, this);
 
110
-        _M_future->_M_set_result(std::move(__setter));
 
111
+        __future->_M_set_result(std::move(__setter));
 
112
       }
 
113
     };
 
114
 
 
115
@@ -1166,8 +1172,9 @@
 
116
       void
 
117
       set_exception(exception_ptr __p)
 
118
       {
 
119
+       auto __future = _M_future;
 
120
         auto __setter = _State::__setter(__p, this);
 
121
-        _M_future->_M_set_result(std::move(__setter));
 
122
+        __future->_M_set_result(std::move(__setter));
 
123
       }
 
124
     };
 
125
 
 
126
@@ -1193,8 +1200,9 @@
 
127
   inline void
 
128
   promise<void>::set_value()
 
129
   {
 
130
+    auto __future = _M_future;
 
131
     auto __setter = _State::__setter(this);
 
132
-    _M_future->_M_set_result(std::move(__setter));
 
133
+    __future->_M_set_result(std::move(__setter));
 
134
   }
 
135
 
 
136
 
 
137
Index: libstdc++-v3/include/bits/stl_tree.h
 
138
===================================================================
 
139
--- a/src/libstdc++-v3/include/bits/stl_tree.h  (.../tags/gcc_4_8_3_release)
 
140
+++ b/src/libstdc++-v3/include/bits/stl_tree.h  (.../branches/gcc-4_8-branch)
 
141
@@ -510,11 +510,11 @@
 
142
 
 
143
       _Link_type
 
144
       _M_end()
 
145
-      { return static_cast<_Link_type>(&this->_M_impl._M_header); }
 
146
+      { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
 
147
 
 
148
       _Const_Link_type
 
149
       _M_end() const
 
150
-      { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
 
151
+      { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
 
152
 
 
153
       static const_reference
 
154
       _S_value(_Const_Link_type __x)
 
155
Index: libstdc++-v3/include/tr2/bool_set
 
156
===================================================================
 
157
--- a/src/libstdc++-v3/include/tr2/bool_set     (.../tags/gcc_4_8_3_release)
 
158
+++ b/src/libstdc++-v3/include/tr2/bool_set     (.../branches/gcc-4_8-branch)
 
159
@@ -44,7 +44,7 @@
 
160
    *  bool_set
 
161
    *
 
162
    *  See N2136, Bool_set: multi-valued logic
 
163
-   *  by Herv� Br�nnimann, Guillaume Melquiond, Sylvain Pion.
 
164
+   *  by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
 
165
    *
 
166
    *  The implicit conversion to bool is slippery!  I may use the new
 
167
    *  explicit conversion.  This has been specialized in the language
 
168
Index: libstdc++-v3/ChangeLog
 
169
===================================================================
 
170
--- a/src/libstdc++-v3/ChangeLog        (.../tags/gcc_4_8_3_release)
 
171
+++ b/src/libstdc++-v3/ChangeLog        (.../branches/gcc-4_8-branch)
 
172
@@ -1,3 +1,27 @@
 
173
+2014-06-03  Jonathan Wakely  <jwakely@redhat.com>
 
174
+
 
175
+       Backport from mainline
 
176
+       2014-04-15  Jonathan Wakely  <jwakely@redhat.com>
 
177
+
 
178
+       PR libstdc++/60734
 
179
+       * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
 
180
+
 
181
+       Backport from mainline
 
182
+       2014-05-16  Jonathan Wakely  <jwakely@redhat.com>
 
183
+
 
184
+       PR libstdc++/60966
 
185
+       * include/std/future (__future_base::_State_baseV2::_M_set_result):
 
186
+       Signal condition variable after call_once returns.
 
187
+       (__future_base::_State_baseV2::_M_do_set): Do not signal here.
 
188
+       (promise::set_value, promise::set_exception): Increment the reference
 
189
+       count on the shared state until the function returns.
 
190
+       * testsuite/30_threads/promise/60966.cc: New.
 
191
+
 
192
+2014-05-29  Jonathan Wakely  <jwakely@redhat.com>
 
193
+
 
194
+       * include/tr2/bool_set: Use UTF-8 for accented characters.
 
195
+       * scripts/run_doxygen: Handle Doxygen 1.8.x change.
 
196
+
 
197
 2014-05-22  Release Manager
 
198
 
 
199
        * GCC 4.8.3 released.
 
200
Index: libstdc++-v3/testsuite/30_threads/promise/60966.cc
 
201
===================================================================
 
202
--- a/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc    (.../tags/gcc_4_8_3_release)
 
203
+++ b/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc    (.../branches/gcc-4_8-branch)
 
204
@@ -0,0 +1,67 @@
 
205
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
 
206
+// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
 
207
+// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
 
208
+// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
 
209
+// { dg-require-cstdint "" }
 
210
+// { dg-require-gthreads "" }
 
211
+// { dg-require-atomic-builtins "" }
 
212
+
 
213
+// Copyright (C) 2014 Free Software Foundation, Inc.
 
214
+//
 
215
+// This file is part of the GNU ISO C++ Library.  This library is free
 
216
+// software; you can redistribute it and/or modify it under the
 
217
+// terms of the GNU General Public License as published by the
 
218
+// Free Software Foundation; either version 3, or (at your option)
 
219
+// any later version.
 
220
+
 
221
+// This library is distributed in the hope that it will be useful,
 
222
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
223
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
224
+// GNU General Public License for more details.
 
225
+
 
226
+// You should have received a copy of the GNU General Public License along
 
227
+// with this library; see the file COPYING3.  If not see
 
228
+// <http://www.gnu.org/licenses/>.
 
229
+
 
230
+// libstdc++/60966
 
231
+// This test hangs if std::promise::~promise() destroys the
 
232
+// shared state before std::promise::set_value() finishes using it.
 
233
+
 
234
+#include <future>
 
235
+#include <thread>
 
236
+#include <vector>
 
237
+
 
238
+const int THREADS = 10;
 
239
+
 
240
+void run_task(std::promise<void>* pr)
 
241
+{
 
242
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
 
243
+  pr->set_value();
 
244
+}
 
245
+
 
246
+int main()
 
247
+{
 
248
+  std::vector<std::promise<void>*> tasks(THREADS);
 
249
+  std::vector<std::thread> threads(THREADS);
 
250
+  std::vector<std::future<void>> futures(THREADS);
 
251
+
 
252
+  for (int i = 0; i < THREADS; ++i)
 
253
+  {
 
254
+    std::promise<void>* task = new std::promise<void>;
 
255
+    tasks[i] = task;
 
256
+    futures[i] = task->get_future();
 
257
+    threads[i] = std::thread(run_task, task);
 
258
+  }
 
259
+
 
260
+  for (int i = 0; i < THREADS; ++i)
 
261
+  {
 
262
+    // the temporary future releases the state as soon as wait() returns
 
263
+    std::future<void>(std::move(futures[i])).wait();
 
264
+    // state is ready, should now be safe to delete promise, so it
 
265
+    // releases the shared state too
 
266
+    delete tasks[i];
 
267
+  }
 
268
+
 
269
+  for (auto& t : threads)
 
270
+    t.join();
 
271
+}
 
272
Index: gcc/DATESTAMP
 
273
===================================================================
 
274
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
 
275
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
 
276
@@ -1 +1 @@
 
277
-20140522
 
278
+20140607
 
279
Index: gcc/ipa-cp.c
 
280
===================================================================
 
281
--- a/src/gcc/ipa-cp.c  (.../tags/gcc_4_8_3_release)
 
282
+++ b/src/gcc/ipa-cp.c  (.../branches/gcc-4_8-branch)
 
283
@@ -447,6 +447,8 @@
 
284
   else if (!opt_for_fn (node->symbol.decl, optimize)
 
285
           || !opt_for_fn (node->symbol.decl, flag_ipa_cp))
 
286
     reason = "non-optimized function";
 
287
+  else if (node->tm_clone)
 
288
+    reason = "transactional memory clone";
 
289
 
 
290
   if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
 
291
     fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
 
292
Index: gcc/ChangeLog
 
293
===================================================================
 
294
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
 
295
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
 
296
@@ -1,3 +1,114 @@
 
297
+2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
298
+
 
299
+       Back port from trunk
 
300
+       2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
301
+
 
302
+       PR target/61431
 
303
+       * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
 
304
+       iterators, VSX_D that handles 64-bit types, and VSX_LE that
 
305
+       handles swapping the two 64-bit double words on little endian
 
306
+       systems.  Include V1TImode and optionally TImode in VSX_LE so that
 
307
+       these types are properly swapped.  Change all of the insns and
 
308
+       splits that do the 64-bit swaps to use VSX_LE.
 
309
+       (vsx_le_perm_load_<mode>): Likewise.
 
310
+       (vsx_le_perm_store_<mode>): Likewise.
 
311
+       (splitters for little endian memory operations): Likewise.
 
312
+       (vsx_xxpermdi2_le_<mode>): Likewise.
 
313
+       (vsx_lxvd2x2_le_<mode>): Likewise.
 
314
+       (vsx_stxvd2x2_le_<mode>): Likewise.
 
315
+
 
316
+2014-06-05  Martin Jambor  <mjambor@suse.cz>
 
317
+
 
318
+       PR ipa/61393
 
319
+       * ipa-cp.c (determine_versionability): Pretend that tm_clones are
 
320
+       not versionable.
 
321
+
 
322
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
323
+
 
324
+       PR tree-optimization/61383
 
325
+       * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
 
326
+       stmts can't trap.
 
327
+
 
328
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
329
+
 
330
+       Backport from mainline
 
331
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
332
+
 
333
+       PR rtl-optimization/60866
 
334
+       * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
 
335
+       Default it to -1.  Pass it down to init_simplejump_data.
 
336
+       (init_simplejump_data): New parameter old_seqno.  Pass it down
 
337
+       to get_seqno_for_a_jump.
 
338
+       (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
 
339
+       initializing new jump seqno as a last resort.  Add comment.
 
340
+       (sel_redirect_edge_and_branch): Save old seqno of the conditional
 
341
+       jump and pass it down to sel_init_new_insn.
 
342
+       (sel_redirect_edge_and_branch_force): Likewise.
 
343
+
 
344
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
345
+
 
346
+       Backport from mainline
 
347
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
348
+
 
349
+       PR rtl-optimization/60901
 
350
+       * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
 
351
+       bb predecessor belongs to the same scheduling region.  Adjust comment.
 
352
+
 
353
+2014-06-03  Uros Bizjak  <ubizjak@gmail.com>
 
354
+
 
355
+       Backport from mainline
 
356
+       2014-06-02  Uros Bizjak  <ubizjak@gmail.com>
 
357
+
 
358
+       PR target/61239
 
359
+       * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
 
360
+       GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
 
361
+
 
362
+2014-05-28  Guozhi Wei  <carrot@google.com>
 
363
+
 
364
+       PR target/61202
 
365
+       * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
 
366
+       constraint.
 
367
+       (vqdmulhq_n_s16): Likewise.
 
368
+
 
369
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
370
+
 
371
+       Backport from mainline
 
372
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
373
+
 
374
+       * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
 
375
+       predicate to detect a negative quotient.
 
376
+
 
377
+2014-05-28  Georg-Johann Lay  <avr@gjlay.de>
 
378
+
 
379
+       PR target/61044
 
380
+       * doc/extend.texi (Local Labels): Note that label differences are
 
381
+       not supported for AVR.
 
382
+
 
383
+2014-05-26  Michael Tautschnig  <mt@debian.org>
 
384
+
 
385
+       PR target/61249
 
386
+       * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
 
387
+       __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
 
388
+
 
389
+2014-05-23  Alan Modra  <amodra@gmail.com>
 
390
+
 
391
+       PR target/61231
 
392
+       * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
 
393
+       * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
 
394
+       Use "Y" constraint rather than "m".
 
395
+
 
396
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
397
+
 
398
+       Backport from mainline
 
399
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
400
+
 
401
+       * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
 
402
+
 
403
+2014-05-22  Richard Earnshaw  <rearnsha@arm.com>
 
404
+
 
405
+       PR target/61208
 
406
+       * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
 
407
+
 
408
 2014-05-22  Release Manager
 
409
 
 
410
        * GCC 4.8.3 released.
 
411
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
 
412
===================================================================
 
413
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../tags/gcc_4_8_3_release)
 
414
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c  (.../branches/gcc-4_8-branch)
 
415
@@ -0,0 +1,14 @@
 
416
+/* { dg-do compile { target { powerpc*-*-* } } } */
 
417
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 
418
+/* { dg-require-effective-target powerpc_htm_ok } */
 
419
+/* { dg-options "-O2 -mhtm" } */
 
420
+
 
421
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
 
422
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
 
423
+
 
424
+#include <htmintrin.h>
 
425
+long
 
426
+ttest (void)
 
427
+{
 
428
+  return _HTM_STATE(__builtin_ttest());
 
429
+}
 
430
Index: gcc/testsuite/gcc.target/i386/pr60901.c
 
431
===================================================================
 
432
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../tags/gcc_4_8_3_release)
 
433
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c       (.../branches/gcc-4_8-branch)
 
434
@@ -0,0 +1,17 @@
 
435
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts"  } */
 
436
+
 
437
+extern int n;
 
438
+extern void bar (void);
 
439
+extern int baz (int);
 
440
+
 
441
+void
 
442
+foo (void)
 
443
+{
 
444
+  int i, j;
 
445
+  for (j = 0; j < n; j++)
 
446
+    {
 
447
+      for (i = 1; i < j; i++)
 
448
+       bar ();
 
449
+      baz (0);
 
450
+    }
 
451
+}
 
452
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
 
453
===================================================================
 
454
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../tags/gcc_4_8_3_release)
 
455
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb      (.../branches/gcc-4_8-branch)
 
456
@@ -0,0 +1,19 @@
 
457
+-- { dg-do run }
 
458
+-- { dg-options "-gnato -O" }
 
459
+
 
460
+procedure Overflow_Fixed is
 
461
+
 
462
+  type Unsigned_8_Bit is mod 2**8;
 
463
+
 
464
+  procedure Fixed_To_Eight (Value : Duration) is
 
465
+    Item : Unsigned_8_Bit;
 
466
+  begin
 
467
+    Item := Unsigned_8_Bit(Value);
 
468
+    raise Program_Error;
 
469
+  exception
 
470
+    when Constraint_Error => null; -- expected case
 
471
+  end;
 
472
+
 
473
+begin
 
474
+  Fixed_To_Eight (-0.5);
 
475
+end;
 
476
Index: gcc/testsuite/gnat.dg/aliasing1.adb
 
477
===================================================================
 
478
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../tags/gcc_4_8_3_release)
 
479
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb   (.../branches/gcc-4_8-branch)
 
480
@@ -18,5 +18,5 @@
 
481
 
 
482
 end Aliasing1;
 
483
 
 
484
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
 
485
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
 
486
 -- { dg-final { cleanup-tree-dump "optimized" } }
 
487
Index: gcc/testsuite/gcc.dg/pr60866.c
 
488
===================================================================
 
489
--- a/src/gcc/testsuite/gcc.dg/pr60866.c        (.../tags/gcc_4_8_3_release)
 
490
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c        (.../branches/gcc-4_8-branch)
 
491
@@ -0,0 +1,18 @@
 
492
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
 
493
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns"  } */
 
494
+
 
495
+int n;
 
496
+
 
497
+void
 
498
+foo (int w, int **dnroot, int **dn)
 
499
+{
 
500
+  int *child;
 
501
+  int *xchild = xchild;
 
502
+  for (; w < n; w++)
 
503
+    if (!dnroot)
 
504
+      {
 
505
+       dnroot = dn;
 
506
+       for (child = *dn; child; child = xchild)
 
507
+         ;
 
508
+      }
 
509
+}
 
510
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
 
511
===================================================================
 
512
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../tags/gcc_4_8_3_release)
 
513
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c      (.../branches/gcc-4_8-branch)
 
514
@@ -0,0 +1,35 @@
 
515
+/* { dg-do run } */
 
516
+
 
517
+int a, b = 1, c, d, e, f, g;
 
518
+
 
519
+int
 
520
+fn1 ()
 
521
+{
 
522
+  int h;
 
523
+  for (;;)
 
524
+    {
 
525
+      g = b;
 
526
+      g = g ? 0 : 1 % g;
 
527
+      e = a + 1;
 
528
+      for (; d < 1; d = e)
 
529
+       {
 
530
+         if (f == 0)
 
531
+           h = 0;
 
532
+         else
 
533
+           h = 1 % f;
 
534
+         if (f < 1)
 
535
+           c = 0;
 
536
+         else if (h)
 
537
+           break;
 
538
+       }
 
539
+      if (b)
 
540
+       return 0;
 
541
+    }
 
542
+}
 
543
+
 
544
+int
 
545
+main ()
 
546
+{
 
547
+  fn1 ();
 
548
+  return 0;
 
549
+}
 
550
Index: gcc/testsuite/ChangeLog
 
551
===================================================================
 
552
--- a/src/gcc/testsuite/ChangeLog       (.../tags/gcc_4_8_3_release)
 
553
+++ b/src/gcc/testsuite/ChangeLog       (.../branches/gcc-4_8-branch)
 
554
@@ -1,3 +1,42 @@
 
555
+2014-06-04  Richard Biener  <rguenther@suse.de>
 
556
+
 
557
+       PR tree-optimization/61383
 
558
+       * gcc.dg/torture/pr61383-1.c: New testcase.
 
559
+
 
560
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
561
+
 
562
+       Backport from mainline
 
563
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
564
+
 
565
+       PR rtl-optimization/60866
 
566
+       * gcc.dg/pr60866.c: New test.
 
567
+
 
568
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
 
569
+
 
570
+       Backport from mainline
 
571
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
 
572
+
 
573
+       PR rtl-optimization/60901
 
574
+       * gcc.target/i386/pr60901.c: New test.
 
575
+
 
576
+2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
577
+
 
578
+       Backport from mainline
 
579
+       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
580
+
 
581
+       * gnat.dg/overflow_fixed.adb: New test.
 
582
+
 
583
+2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
 
584
+
 
585
+       * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
 
586
+
 
587
+2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
588
+
 
589
+       Backport from mainline
 
590
+       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
 
591
+
 
592
+       * gcc.target/powerpc/htm-ttest.c: New test.
 
593
+
 
594
 2014-05-22  Release Manager
 
595
 
 
596
        * GCC 4.8.3 released.
 
597
Index: gcc/double-int.c
 
598
===================================================================
 
599
--- a/src/gcc/double-int.c      (.../tags/gcc_4_8_3_release)
 
600
+++ b/src/gcc/double-int.c      (.../branches/gcc-4_8-branch)
 
601
@@ -616,7 +616,7 @@
 
602
                 == (unsigned HOST_WIDE_INT) htwice)
 
603
                && (labs_den <= ltwice)))
 
604
          {
 
605
-           if (*hquo < 0)
 
606
+           if (quo_neg)
 
607
              /* quo = quo - 1;  */
 
608
              add_double (*lquo, *hquo,
 
609
                          (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
 
610
Index: gcc/tree-ssa-ifcombine.c
 
611
===================================================================
 
612
--- a/src/gcc/tree-ssa-ifcombine.c      (.../tags/gcc_4_8_3_release)
 
613
+++ b/src/gcc/tree-ssa-ifcombine.c      (.../branches/gcc-4_8-branch)
 
614
@@ -105,7 +105,11 @@
 
615
     {
 
616
       gimple stmt = gsi_stmt (gsi);
 
617
 
 
618
+      if (is_gimple_debug (stmt))
 
619
+       continue;
 
620
+
 
621
       if (gimple_has_side_effects (stmt)
 
622
+         || gimple_could_trap_p (stmt)
 
623
          || gimple_vuse (stmt))
 
624
        return false;
 
625
     }
 
626
Index: gcc/sel-sched-ir.c
 
627
===================================================================
 
628
--- a/src/gcc/sel-sched-ir.c    (.../tags/gcc_4_8_3_release)
 
629
+++ b/src/gcc/sel-sched-ir.c    (.../branches/gcc-4_8-branch)
 
630
@@ -162,7 +162,7 @@
 
631
 static void free_av_set (basic_block);
 
632
 static void invalidate_av_set (basic_block);
 
633
 static void extend_insn_data (void);
 
634
-static void sel_init_new_insn (insn_t, int);
 
635
+static void sel_init_new_insn (insn_t, int, int = -1);
 
636
 static void finish_insns (void);
 
637
 
 
638
 /* Various list functions.  */
 
639
@@ -4011,9 +4011,10 @@
 
640
   return seqno;
 
641
 }
 
642
 
 
643
-/* Compute seqno for INSN by its preds or succs.  */
 
644
+/* Compute seqno for INSN by its preds or succs.  Use OLD_SEQNO to compute
 
645
+   seqno in corner cases.  */
 
646
 static int
 
647
-get_seqno_for_a_jump (insn_t insn)
 
648
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
 
649
 {
 
650
   int seqno;
 
651
 
 
652
@@ -4069,8 +4070,16 @@
 
653
   if (seqno < 0)
 
654
     seqno = get_seqno_by_succs (insn);
 
655
 
 
656
+  if (seqno < 0)
 
657
+    {
 
658
+      /* The only case where this could be here legally is that the only
 
659
+        unscheduled insn was a conditional jump that got removed and turned
 
660
+        into this unconditional one.  Initialize from the old seqno
 
661
+        of that jump passed down to here.  */
 
662
+      seqno = old_seqno;
 
663
+    }
 
664
+
 
665
   gcc_assert (seqno >= 0);
 
666
-
 
667
   return seqno;
 
668
 }
 
669
 
 
670
@@ -4250,22 +4259,24 @@
 
671
 }
 
672
 
 
673
 /* This is used to initialize spurious jumps generated by
 
674
-   sel_redirect_edge ().  */
 
675
+   sel_redirect_edge ().  OLD_SEQNO is used for initializing seqnos
 
676
+   in corner cases within get_seqno_for_a_jump.  */
 
677
 static void
 
678
-init_simplejump_data (insn_t insn)
 
679
+init_simplejump_data (insn_t insn, int old_seqno)
 
680
 {
 
681
   init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
 
682
             REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
 
683
             vNULL, true, false, false,
 
684
             false, true);
 
685
-  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
 
686
+  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
 
687
   init_first_time_insn_data (insn);
 
688
 }
 
689
 
 
690
 /* Perform deferred initialization of insns.  This is used to process
 
691
-   a new jump that may be created by redirect_edge.  */
 
692
-void
 
693
-sel_init_new_insn (insn_t insn, int flags)
 
694
+   a new jump that may be created by redirect_edge.  OLD_SEQNO is used
 
695
+   for initializing simplejumps in init_simplejump_data.  */
 
696
+static void
 
697
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
 
698
 {
 
699
   /* We create data structures for bb when the first insn is emitted in it.  */
 
700
   if (INSN_P (insn)
 
701
@@ -4292,7 +4303,7 @@
 
702
   if (flags & INSN_INIT_TODO_SIMPLEJUMP)
 
703
     {
 
704
       extend_insn_data ();
 
705
-      init_simplejump_data (insn);
 
706
+      init_simplejump_data (insn, old_seqno);
 
707
     }
 
708
 
 
709
   gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
 
710
@@ -5578,8 +5589,7 @@
 
711
 }
 
712
 
 
713
 /* A wrapper for redirect_edge_and_branch_force, which also initializes
 
714
-   data structures for possibly created bb and insns.  Returns the newly
 
715
-   added bb or NULL, when a bb was not needed.  */
 
716
+   data structures for possibly created bb and insns.  */
 
717
 void
 
718
 sel_redirect_edge_and_branch_force (edge e, basic_block to)
 
719
 {
 
720
@@ -5586,6 +5596,7 @@
 
721
   basic_block jump_bb, src, orig_dest = e->dest;
 
722
   int prev_max_uid;
 
723
   rtx jump;
 
724
+  int old_seqno = -1;
 
725
 
 
726
   /* This function is now used only for bookkeeping code creation, where
 
727
      we'll never get the single pred of orig_dest block and thus will not
 
728
@@ -5594,8 +5605,13 @@
 
729
               && !single_pred_p (orig_dest));
 
730
   src = e->src;
 
731
   prev_max_uid = get_max_uid ();
 
732
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
733
+     when the conditional jump being redirected may become unconditional.  */
 
734
+  if (any_condjump_p (BB_END (src))
 
735
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
736
+    old_seqno = INSN_SEQNO (BB_END (src));
 
737
+
 
738
   jump_bb = redirect_edge_and_branch_force (e, to);
 
739
-
 
740
   if (jump_bb != NULL)
 
741
     sel_add_bb (jump_bb);
 
742
 
 
743
@@ -5607,7 +5623,8 @@
 
744
 
 
745
   jump = find_new_jump (src, jump_bb, prev_max_uid);
 
746
   if (jump)
 
747
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
748
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
 
749
+                      old_seqno);
 
750
   set_immediate_dominator (CDI_DOMINATORS, to,
 
751
                           recompute_dominator (CDI_DOMINATORS, to));
 
752
   set_immediate_dominator (CDI_DOMINATORS, orig_dest,
 
753
@@ -5626,6 +5643,7 @@
 
754
   edge redirected;
 
755
   bool recompute_toporder_p = false;
 
756
   bool maybe_unreachable = single_pred_p (orig_dest);
 
757
+  int old_seqno = -1;
 
758
 
 
759
   latch_edge_p = (pipelining_p
 
760
                   && current_loop_nest
 
761
@@ -5634,6 +5652,12 @@
 
762
   src = e->src;
 
763
   prev_max_uid = get_max_uid ();
 
764
 
 
765
+  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
 
766
+     when the conditional jump being redirected may become unconditional.  */
 
767
+  if (any_condjump_p (BB_END (src))
 
768
+      && INSN_SEQNO (BB_END (src)) >= 0)
 
769
+    old_seqno = INSN_SEQNO (BB_END (src));
 
770
+
 
771
   redirected = redirect_edge_and_branch (e, to);
 
772
 
 
773
   gcc_assert (redirected && !last_added_blocks.exists ());
 
774
@@ -5654,7 +5678,7 @@
 
775
 
 
776
   jump = find_new_jump (src, NULL, prev_max_uid);
 
777
   if (jump)
 
778
-    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
 
779
+    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
 
780
 
 
781
   /* Only update dominator info when we don't have unreachable blocks.
 
782
      Otherwise we'll update in maybe_tidy_empty_bb.  */
 
783
Index: gcc/fortran/ChangeLog
 
784
===================================================================
 
785
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
786
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
 
787
@@ -1,3 +1,10 @@
 
788
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
789
+
 
790
+       Backport from mainline
 
791
+       PR libfortran/61310
 
792
+       * intrinsics.texi (CTIME): Remove mention of locale-dependent
 
793
+       behavior.
 
794
+
 
795
 2014-05-22  Release Manager
 
796
 
 
797
        * GCC 4.8.3 released.
 
798
Index: gcc/config/i386/i386.c
 
799
===================================================================
 
800
--- a/src/gcc/config/i386/i386.c        (.../tags/gcc_4_8_3_release)
 
801
+++ b/src/gcc/config/i386/i386.c        (.../branches/gcc-4_8-branch)
 
802
@@ -20505,7 +20505,7 @@
 
803
          t1 = gen_reg_rtx (V32QImode);
 
804
          t2 = gen_reg_rtx (V32QImode);
 
805
          t3 = gen_reg_rtx (V32QImode);
 
806
-         vt2 = GEN_INT (128);
 
807
+         vt2 = GEN_INT (-128);
 
808
          for (i = 0; i < 32; i++)
 
809
            vec[i] = vt2;
 
810
          vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
 
811
@@ -24640,13 +24640,17 @@
 
812
              {
 
813
                edge e;
 
814
                edge_iterator ei;
 
815
-               /* Assume that region is SCC, i.e. all immediate predecessors
 
816
-                  of non-head block are in the same region.  */
 
817
+
 
818
+               /* Regions are SCCs with the exception of selective
 
819
+                  scheduling with pipelining of outer blocks enabled.
 
820
+                  So also check that immediate predecessors of a non-head
 
821
+                  block are in the same region.  */
 
822
                FOR_EACH_EDGE (e, ei, bb->preds)
 
823
                  {
 
824
                    /* Avoid creating of loop-carried dependencies through
 
825
-                      using topological odering in region.  */
 
826
-                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
827
+                      using topological ordering in the region.  */
 
828
+                   if (rgn == CONTAINING_RGN (e->src->index)
 
829
+                       && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
 
830
                      add_dependee_for_func_arg (first_arg, e->src); 
 
831
                  }
 
832
              }
 
833
Index: gcc/config/aarch64/arm_neon.h
 
834
===================================================================
 
835
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
 
836
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
 
837
@@ -13815,7 +13815,7 @@
 
838
   int16x4_t result;
 
839
   __asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
 
840
            : "=w"(result)
 
841
-           : "w"(a), "w"(b)
 
842
+           : "w"(a), "x"(b)
 
843
            : /* No clobbers */);
 
844
   return result;
 
845
 }
 
846
@@ -13837,7 +13837,7 @@
 
847
   int16x8_t result;
 
848
   __asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
 
849
            : "=w"(result)
 
850
-           : "w"(a), "w"(b)
 
851
+           : "w"(a), "x"(b)
 
852
            : /* No clobbers */);
 
853
   return result;
 
854
 }
 
855
Index: gcc/config/rs6000/htm.md
 
856
===================================================================
 
857
--- a/src/gcc/config/rs6000/htm.md      (.../tags/gcc_4_8_3_release)
 
858
+++ b/src/gcc/config/rs6000/htm.md      (.../branches/gcc-4_8-branch)
 
859
@@ -179,7 +179,7 @@
 
860
                             (const_int 0)]
 
861
                            UNSPECV_HTM_TABORTWCI))
 
862
    (set (subreg:CC (match_dup 2) 0) (match_dup 1))
 
863
-   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
 
864
+   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
 
865
    (parallel [(set (match_operand:SI 0 "int_reg_operand" "")
 
866
                   (and:SI (match_dup 3) (const_int 15)))
 
867
               (clobber (scratch:CC))])]
 
868
Index: gcc/config/rs6000/rs6000.c
 
869
===================================================================
 
870
--- a/src/gcc/config/rs6000/rs6000.c    (.../tags/gcc_4_8_3_release)
 
871
+++ b/src/gcc/config/rs6000/rs6000.c    (.../branches/gcc-4_8-branch)
 
872
@@ -6109,7 +6109,8 @@
 
873
     return false;
 
874
 
 
875
   extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
 
876
-  gcc_assert (extra >= 0);
 
877
+  if (extra < 0)
 
878
+    extra = 0;
 
879
 
 
880
   if (GET_CODE (addr) == LO_SUM)
 
881
     /* For lo_sum addresses, we must allow any offset except one that
 
882
Index: gcc/config/rs6000/vsx.md
 
883
===================================================================
 
884
--- a/src/gcc/config/rs6000/vsx.md      (.../tags/gcc_4_8_3_release)
 
885
+++ b/src/gcc/config/rs6000/vsx.md      (.../branches/gcc-4_8-branch)
 
886
@@ -24,6 +24,13 @@
 
887
 ;; Iterator for the 2 64-bit vector types
 
888
 (define_mode_iterator VSX_D [V2DF V2DI])
 
889
 
 
890
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
 
891
+;; lxvd2x to properly handle swapping words on little endian
 
892
+(define_mode_iterator VSX_LE [V2DF
 
893
+                             V2DI
 
894
+                             V1TI
 
895
+                             (TI       "VECTOR_MEM_VSX_P (TImode)")])
 
896
+
 
897
 ;; Iterator for the 2 32-bit vector types
 
898
 (define_mode_iterator VSX_W [V4SF V4SI])
 
899
 
 
900
@@ -228,8 +235,8 @@
 
901
 ;; The patterns for LE permuted loads and stores come before the general
 
902
 ;; VSX moves so they match first.
 
903
 (define_insn_and_split "*vsx_le_perm_load_<mode>"
 
904
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
905
-        (match_operand:VSX_D 1 "memory_operand" "Z"))]
 
906
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
 
907
+        (match_operand:VSX_LE 1 "memory_operand" "Z"))]
 
908
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
909
   "#"
 
910
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
911
@@ -342,8 +349,8 @@
 
912
    (set_attr "length" "8")])
 
913
 
 
914
 (define_insn "*vsx_le_perm_store_<mode>"
 
915
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
916
-        (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
 
917
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
918
+        (match_operand:VSX_LE 1 "vsx_register_operand" "+wa"))]
 
919
   "!BYTES_BIG_ENDIAN && TARGET_VSX"
 
920
   "#"
 
921
   [(set_attr "type" "vecstore")
 
922
@@ -350,8 +357,8 @@
 
923
    (set_attr "length" "12")])
 
924
 
 
925
 (define_split
 
926
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
927
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
928
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
929
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
930
   "!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
 
931
   [(set (match_dup 2)
 
932
         (vec_select:<MODE>
 
933
@@ -369,8 +376,8 @@
 
934
 ;; The post-reload split requires that we re-permute the source
 
935
 ;; register in case it is still live.
 
936
 (define_split
 
937
-  [(set (match_operand:VSX_D 0 "memory_operand" "")
 
938
-        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
 
939
+  [(set (match_operand:VSX_LE 0 "memory_operand" "")
 
940
+        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
 
941
   "!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
 
942
   [(set (match_dup 1)
 
943
         (vec_select:<MODE>
 
944
@@ -1352,9 +1359,9 @@
 
945
 ;; xxpermdi for little endian loads and stores.  We need several of
 
946
 ;; these since the form of the PARALLEL differs by mode.
 
947
 (define_insn "*vsx_xxpermdi2_le_<mode>"
 
948
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
949
-        (vec_select:VSX_D
 
950
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
951
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
 
952
+        (vec_select:VSX_LE
 
953
+          (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
 
954
           (parallel [(const_int 1) (const_int 0)])))]
 
955
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
956
   "xxpermdi %x0,%x1,%x1,2"
 
957
@@ -1401,9 +1408,9 @@
 
958
 ;; lxvd2x for little endian loads.  We need several of
 
959
 ;; these since the form of the PARALLEL differs by mode.
 
960
 (define_insn "*vsx_lxvd2x2_le_<mode>"
 
961
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
 
962
-        (vec_select:VSX_D
 
963
-          (match_operand:VSX_D 1 "memory_operand" "Z")
 
964
+  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
 
965
+        (vec_select:VSX_LE
 
966
+          (match_operand:VSX_LE 1 "memory_operand" "Z")
 
967
           (parallel [(const_int 1) (const_int 0)])))]
 
968
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
969
   "lxvd2x %x0,%y1"
 
970
@@ -1450,9 +1457,9 @@
 
971
 ;; stxvd2x for little endian stores.  We need several of
 
972
 ;; these since the form of the PARALLEL differs by mode.
 
973
 (define_insn "*vsx_stxvd2x2_le_<mode>"
 
974
-  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
 
975
-        (vec_select:VSX_D
 
976
-          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
 
977
+  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
 
978
+        (vec_select:VSX_LE
 
979
+          (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
 
980
           (parallel [(const_int 1) (const_int 0)])))]
 
981
   "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
 
982
   "stxvd2x %x1,%y0"
 
983
Index: gcc/config/rs6000/rs6000.md
 
984
===================================================================
 
985
--- a/src/gcc/config/rs6000/rs6000.md   (.../tags/gcc_4_8_3_release)
 
986
+++ b/src/gcc/config/rs6000/rs6000.md   (.../branches/gcc-4_8-branch)
 
987
@@ -737,7 +737,7 @@
 
988
 
 
989
 (define_insn "*extendsidi2_lfiwax"
 
990
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
 
991
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
 
992
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
 
993
   "TARGET_POWERPC64 && TARGET_LFIWAX"
 
994
   "@
 
995
    lwa%U1%X1 %0,%1
 
996
@@ -760,7 +760,7 @@
 
997
 
 
998
 (define_insn "*extendsidi2_nocell"
 
999
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
 
1000
-       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
 
1001
+       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
 
1002
   "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
 
1003
   "@
 
1004
    lwa%U1%X1 %0,%1
 
1005
Index: gcc/config/arm/arm.md
 
1006
===================================================================
 
1007
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
 
1008
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
 
1009
@@ -7630,12 +7630,13 @@
 
1010
 
 
1011
 (define_insn "*arm_cmpdi_unsigned"
 
1012
   [(set (reg:CC_CZ CC_REGNUM)
 
1013
-       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
 
1014
-                      (match_operand:DI 1 "arm_di_operand"     "rDi")))]
 
1015
+       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
 
1016
+                      (match_operand:DI 1 "arm_di_operand"     "rDi,rDi")))]
 
1017
   "TARGET_32BIT"
 
1018
   "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
 
1019
   [(set_attr "conds" "set")
 
1020
-   (set_attr "length" "8")]
 
1021
+   (set_attr "arch" "a,t2")
 
1022
+   (set_attr "length" "8,10")]
 
1023
 )
 
1024
 
 
1025
 (define_insn "*arm_cmpdi_zero"
 
1026
Index: libgfortran/intrinsics/ctime.c
 
1027
===================================================================
 
1028
--- a/src/libgfortran/intrinsics/ctime.c        (.../tags/gcc_4_8_3_release)
 
1029
+++ b/src/libgfortran/intrinsics/ctime.c        (.../branches/gcc-4_8-branch)
 
1030
@@ -31,31 +31,53 @@
 
1031
 #include <string.h>
 
1032
 
 
1033
 
 
1034
-/* strftime-like function that fills a C string with %c format which
 
1035
-   is identical to ctime in the default locale. As ctime and ctime_r
 
1036
-   are poorly specified and their usage not recommended, the
 
1037
-   implementation instead uses strftime.  */
 
1038
+/* Maximum space a ctime-like string might need. A "normal" ctime
 
1039
+   string is 26 bytes, and in our case 24 bytes as we don't include
 
1040
+   the trailing newline and null. However, the longest possible year
 
1041
+   number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
 
1042
+   32-bit signed integer) so an extra 7 bytes are needed. */
 
1043
+#define CTIME_BUFSZ 31
 
1044
 
 
1045
-static size_t
 
1046
-strctime (char *s, size_t max, const time_t *timep)
 
1047
+
 
1048
+/* Thread-safe ctime-like function that fills a Fortran
 
1049
+   string. ctime_r is a portability headache and marked as obsolescent
 
1050
+   in POSIX 2008, which recommends strftime in its place. However,
 
1051
+   strftime(..., "%c",...)  doesn't produce ctime-like output on
 
1052
+   MinGW, so do it manually with snprintf.  */
 
1053
+
 
1054
+static int
 
1055
+gf_ctime (char *s, size_t max, const time_t timev)
 
1056
 {
 
1057
   struct tm ltm;
 
1058
   int failed;
 
1059
+  char buf[CTIME_BUFSZ + 1];
 
1060
   /* Some targets provide a localtime_r based on a draft of the POSIX
 
1061
      standard where the return type is int rather than the
 
1062
      standardized struct tm*.  */
 
1063
-  __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, &ltm)) 
 
1064
+  __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, &ltm)) 
 
1065
                         == 5,
 
1066
-                        failed = localtime_r (timep, &ltm) == NULL,
 
1067
-                        failed = localtime_r (timep, &ltm) != 0);
 
1068
+                        failed = localtime_r (&timev, &ltm) == NULL,
 
1069
+                        failed = localtime_r (&timev, &ltm) != 0);
 
1070
   if (failed)
 
1071
-    return 0;
 
1072
-  return strftime (s, max, "%c", &ltm);
 
1073
+    goto blank;
 
1074
+  int n = snprintf (buf, sizeof (buf), 
 
1075
+                   "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
 
1076
+                   "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
 
1077
+                   "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
 
1078
+                   ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec, 
 
1079
+                   1900 + ltm.tm_year);
 
1080
+  if (n < 0)
 
1081
+    goto blank;
 
1082
+  if ((size_t) n <= max)
 
1083
+    {
 
1084
+      cf_strcpy (s, max, buf);
 
1085
+      return n;
 
1086
+    }
 
1087
+ blank:
 
1088
+  memset (s, ' ', max);
 
1089
+  return 0;
 
1090
 }
 
1091
 
 
1092
-/* In the default locale, the date and time representation fits in 26
 
1093
-   bytes. However, other locales might need more space.  */
 
1094
-#define CSZ 100
 
1095
 
 
1096
 extern void fdate (char **, gfc_charlen_type *);
 
1097
 export_proto(fdate);
 
1098
@@ -64,8 +86,8 @@
 
1099
 fdate (char ** date, gfc_charlen_type * date_len)
 
1100
 {
 
1101
   time_t now = time(NULL);
 
1102
-  *date = xmalloc (CSZ);
 
1103
-  *date_len = strctime (*date, CSZ, &now);
 
1104
+  *date = xmalloc (CTIME_BUFSZ);
 
1105
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
1106
 }
 
1107
 
 
1108
 
 
1109
@@ -76,10 +98,7 @@
 
1110
 fdate_sub (char * date, gfc_charlen_type date_len)
 
1111
 {
 
1112
   time_t now = time(NULL);
 
1113
-  char *s = xmalloc (date_len + 1);
 
1114
-  size_t n = strctime (s, date_len + 1, &now);
 
1115
-  fstrcpy (date, date_len, s, n);
 
1116
-  free (s);
 
1117
+  gf_ctime (date, date_len, now);
 
1118
 }
 
1119
 
 
1120
 
 
1121
@@ -91,8 +110,8 @@
 
1122
 PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
 
1123
 {
 
1124
   time_t now = t;
 
1125
-  *date = xmalloc (CSZ);
 
1126
-  *date_len = strctime (*date, CSZ, &now);
 
1127
+  *date = xmalloc (CTIME_BUFSZ);
 
1128
+  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
 
1129
 }
 
1130
 
 
1131
 
 
1132
@@ -103,8 +122,5 @@
 
1133
 ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
 
1134
 {
 
1135
   time_t now = *t;
 
1136
-  char *s = xmalloc (date_len + 1);
 
1137
-  size_t n = strctime (s, date_len + 1, &now);
 
1138
-  fstrcpy (date, date_len, s, n);
 
1139
-  free (s);
 
1140
+  gf_ctime (date, date_len, now);
 
1141
 }
 
1142
Index: libgfortran/ChangeLog
 
1143
===================================================================
 
1144
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
 
1145
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
 
1146
@@ -1,3 +1,21 @@
 
1147
+2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
 
1148
+
 
1149
+       Backport from mainline
 
1150
+       PR libfortran/61310
 
1151
+       * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
 
1152
+       instead of strftime.
 
1153
+       (fdate): Use gf_ctime.
 
1154
+       (fdate_sub): Likewise.
 
1155
+       (ctime): Likewise.
 
1156
+       (ctime_sub): Likewise.
 
1157
+
 
1158
+2014-05-25  Janne Blomqvist  <jb@gcc.gnu.org>
 
1159
+
 
1160
+       Backport from trunk.
 
1161
+       PR libfortran/61187
 
1162
+       * io/unix.c (raw_close): Check if s->fd is -1.
 
1163
+       (fd_to_stream): Check return value of fstat(), handle error.
 
1164
+
 
1165
 2014-05-22  Release Manager
 
1166
 
 
1167
        * GCC 4.8.3 released.
 
1168
Index: libgfortran/io/unix.c
 
1169
===================================================================
 
1170
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
 
1171
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
 
1172
@@ -407,7 +407,9 @@
 
1173
 {
 
1174
   int retval;
 
1175
   
 
1176
-  if (s->fd != STDOUT_FILENO
 
1177
+  if (s->fd == -1)
 
1178
+    retval = -1;
 
1179
+  else if (s->fd != STDOUT_FILENO
 
1180
       && s->fd != STDERR_FILENO
 
1181
       && s->fd != STDIN_FILENO)
 
1182
     retval = close (s->fd);
 
1183
@@ -983,7 +985,15 @@
 
1184
 
 
1185
   /* Get the current length of the file. */
 
1186
 
 
1187
-  fstat (fd, &statbuf);
 
1188
+  if (fstat (fd, &statbuf) == -1)
 
1189
+    {
 
1190
+      s->st_dev = s->st_ino = -1;
 
1191
+      s->file_length = 0;
 
1192
+      if (errno == EBADF)
 
1193
+       s->fd = -1;
 
1194
+      raw_init (s);
 
1195
+      return (stream *) s;
 
1196
+    }
 
1197
 
 
1198
   s->st_dev = statbuf.st_dev;
 
1199
   s->st_ino = statbuf.st_ino;