]> TLD Linux GIT Repositories - packages/gcc.git/blob - gcc-branch.diff
- fixed isl BR, release 3
[packages/gcc.git] / gcc-branch.diff
1 Index: libstdc++-v3/python/libstdcxx/v6/printers.py
2 ===================================================================
3 --- libstdc++-v3/python/libstdcxx/v6/printers.py        (.../tags/gcc_4_8_3_release)    (revision 217117)
4 +++ libstdc++-v3/python/libstdcxx/v6/printers.py        (.../branches/gcc-4_8-branch)   (revision 217117)
5 @@ -1,4 +1,4 @@
6 -# Pretty-printers for libstc++.
7 +# Pretty-printers for libstdc++.
8  
9  # Copyright (C) 2008-2013 Free Software Foundation, Inc.
10  
11 @@ -18,7 +18,51 @@
12  import gdb
13  import itertools
14  import re
15 +import sys
16  
17 +### Python 2 + Python 3 compatibility code
18 +
19 +# Resources about compatibility:
20 +#
21 +#  * <http://pythonhosted.org/six/>: Documentation of the "six" module
22 +
23 +# FIXME: The handling of e.g. std::basic_string (at least on char)
24 +# probably needs updating to work with Python 3's new string rules.
25 +#
26 +# In particular, Python 3 has a separate type (called byte) for
27 +# bytestrings, and a special b"" syntax for the byte literals; the old
28 +# str() type has been redefined to always store Unicode text.
29 +#
30 +# We probably can't do much about this until this GDB PR is addressed:
31 +# <https://sourceware.org/bugzilla/show_bug.cgi?id=17138>
32 +
33 +if sys.version_info[0] > 2:
34 +    ### Python 3 stuff
35 +    Iterator = object
36 +    # Python 3 folds these into the normal functions.
37 +    imap = map
38 +    izip = zip
39 +    # Also, int subsumes long
40 +    long = int
41 +else:
42 +    ### Python 2 stuff
43 +    class Iterator:
44 +        """Compatibility mixin for iterators
45 +
46 +        Instead of writing next() methods for iterators, write
47 +        __next__() methods and use this mixin to make them work in
48 +        Python 2 as well as Python 3.
49 +
50 +        Idea stolen from the "six" documentation:
51 +        <http://pythonhosted.org/six/#six.Iterator>
52 +        """
53 +
54 +        def next(self):
55 +            return self.__next__()
56 +
57 +    # In Python 2, we still need these from itertools
58 +    from itertools import imap, izip
59 +
60  # Try to use the new-style pretty-printing if available.
61  _use_gdb_pp = True
62  try:
63 @@ -51,7 +95,7 @@
64          # anything fancier here.
65          field = typ.fields()[0]
66          if not field.is_base_class:
67 -            raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
68 +            raise ValueError("Cannot find type %s::%s" % (str(orig), name))
69          typ = field.type
70  
71  class SharedPointerPrinter:
72 @@ -87,7 +131,7 @@
73  class StdListPrinter:
74      "Print a std::list"
75  
76 -    class _iterator:
77 +    class _iterator(Iterator):
78          def __init__(self, nodetype, head):
79              self.nodetype = nodetype
80              self.base = head['_M_next']
81 @@ -97,7 +141,7 @@
82          def __iter__(self):
83              return self
84  
85 -        def next(self):
86 +        def __next__(self):
87              if self.base == self.head:
88                  raise StopIteration
89              elt = self.base.cast(self.nodetype).dereference()
90 @@ -135,7 +179,7 @@
91  class StdSlistPrinter:
92      "Print a __gnu_cxx::slist"
93  
94 -    class _iterator:
95 +    class _iterator(Iterator):
96          def __init__(self, nodetype, head):
97              self.nodetype = nodetype
98              self.base = head['_M_head']['_M_next']
99 @@ -144,7 +188,7 @@
100          def __iter__(self):
101              return self
102  
103 -        def next(self):
104 +        def __next__(self):
105              if self.base == 0:
106                  raise StopIteration
107              elt = self.base.cast(self.nodetype).dereference()
108 @@ -180,7 +224,7 @@
109  class StdVectorPrinter:
110      "Print a std::vector"
111  
112 -    class _iterator:
113 +    class _iterator(Iterator):
114          def __init__ (self, start, finish, bitvec):
115              self.bitvec = bitvec
116              if bitvec:
117 @@ -198,7 +242,7 @@
118          def __iter__(self):
119              return self
120  
121 -        def next(self):
122 +        def __next__(self):
123              count = self.count
124              self.count = self.count + 1
125              if self.bitvec:
126 @@ -265,7 +309,7 @@
127  class StdTuplePrinter:
128      "Print a std::tuple"
129  
130 -    class _iterator:
131 +    class _iterator(Iterator):
132          def __init__ (self, head):
133              self.head = head
134  
135 @@ -276,13 +320,13 @@
136                  # Set the actual head to the first pair.
137                  self.head  = self.head.cast (nodes[0].type)
138              elif len (nodes) != 0:
139 -                raise ValueError, "Top of tuple tree does not consist of a single node."
140 +                raise ValueError("Top of tuple tree does not consist of a single node.")
141              self.count = 0
142  
143          def __iter__ (self):
144              return self
145  
146 -        def next (self):
147 +        def __next__ (self):
148              nodes = self.head.type.fields ()
149              # Check for further recursions in the inheritance tree.
150              if len (nodes) == 0:
151 @@ -289,7 +333,7 @@
152                  raise StopIteration
153              # Check that this iteration has an expected structure.
154              if len (nodes) != 2:
155 -                raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
156 +                raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
157  
158              # - Left node is the next recursion parent.
159              # - Right node is the actual class contained in the tuple.
160 @@ -341,7 +385,7 @@
161              return self.visualizer.display_hint ()
162          return None
163  
164 -class RbtreeIterator:
165 +class RbtreeIterator(Iterator):
166      def __init__(self, rbtree):
167          self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
168          self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
169 @@ -353,7 +397,7 @@
170      def __len__(self):
171          return int (self.size)
172  
173 -    def next(self):
174 +    def __next__(self):
175          if self.count == self.size:
176              raise StopIteration
177          result = self.node
178 @@ -405,7 +449,7 @@
179      "Print a std::map or std::multimap"
180  
181      # Turn an RbtreeIterator into a pretty-print iterator.
182 -    class _iter:
183 +    class _iter(Iterator):
184          def __init__(self, rbiter, type):
185              self.rbiter = rbiter
186              self.count = 0
187 @@ -414,9 +458,9 @@
188          def __iter__(self):
189              return self
190  
191 -        def next(self):
192 +        def __next__(self):
193              if self.count % 2 == 0:
194 -                n = self.rbiter.next()
195 +                n = next(self.rbiter)
196                  n = n.cast(self.type).dereference()['_M_value_field']
197                  self.pair = n
198                  item = n['first']
199 @@ -447,7 +491,7 @@
200      "Print a std::set or std::multiset"
201  
202      # Turn an RbtreeIterator into a pretty-print iterator.
203 -    class _iter:
204 +    class _iter(Iterator):
205          def __init__(self, rbiter, type):
206              self.rbiter = rbiter
207              self.count = 0
208 @@ -456,8 +500,8 @@
209          def __iter__(self):
210              return self
211  
212 -        def next(self):
213 -            item = self.rbiter.next()
214 +        def __next__(self):
215 +            item = next(self.rbiter)
216              item = item.cast(self.type).dereference()['_M_value_field']
217              # FIXME: this is weird ... what to do?
218              # Maybe a 'set' display hint?
219 @@ -522,7 +566,7 @@
220  class StdDequePrinter:
221      "Print a std::deque"
222  
223 -    class _iter:
224 +    class _iter(Iterator):
225          def __init__(self, node, start, end, last, buffer_size):
226              self.node = node
227              self.p = start
228 @@ -534,7 +578,7 @@
229          def __iter__(self):
230              return self
231  
232 -        def next(self):
233 +        def __next__(self):
234              if self.p == self.last:
235                  raise StopIteration
236  
237 @@ -619,7 +663,7 @@
238      def display_hint (self):
239          return 'string'
240  
241 -class Tr1HashtableIterator:
242 +class Tr1HashtableIterator(Iterator):
243      def __init__ (self, hash):
244          self.node = hash['_M_bbegin']['_M_node']['_M_nxt']
245          self.node_type = find_type(hash.type, '__node_type').pointer()
246 @@ -627,7 +671,7 @@
247      def __iter__ (self):
248          return self
249  
250 -    def next (self):
251 +    def __next__ (self):
252          if self.node == 0:
253              raise StopIteration
254          node = self.node.cast(self.node_type)
255 @@ -655,8 +699,8 @@
256          return '[%d]' % i
257  
258      def children (self):
259 -        counter = itertools.imap (self.format_count, itertools.count())
260 -        return itertools.izip (counter, Tr1HashtableIterator (self.hashtable()))
261 +        counter = imap (self.format_count, itertools.count())
262 +        return izip (counter, Tr1HashtableIterator (self.hashtable()))
263  
264  class Tr1UnorderedMapPrinter:
265      "Print a tr1::unordered_map"
266 @@ -688,11 +732,11 @@
267          return '[%d]' % i
268  
269      def children (self):
270 -        counter = itertools.imap (self.format_count, itertools.count())
271 +        counter = imap (self.format_count, itertools.count())
272          # Map over the hash table and flatten the result.
273 -        data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
274 +        data = self.flatten (imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
275          # Zip the two iterators together.
276 -        return itertools.izip (counter, data)
277 +        return izip (counter, data)
278  
279      def display_hint (self):
280          return 'map'
281 @@ -700,7 +744,7 @@
282  class StdForwardListPrinter:
283      "Print a std::forward_list"
284  
285 -    class _iterator:
286 +    class _iterator(Iterator):
287          def __init__(self, nodetype, head):
288              self.nodetype = nodetype
289              self.base = head['_M_next']
290 @@ -709,7 +753,7 @@
291          def __iter__(self):
292              return self
293  
294 -        def next(self):
295 +        def __next__(self):
296              if self.base == 0:
297                  raise StopIteration
298              elt = self.base.cast(self.nodetype).dereference()
299 @@ -764,7 +808,7 @@
300          # A small sanity check.
301          # FIXME
302          if not self.compiled_rx.match(name + '<>'):
303 -            raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
304 +            raise ValueError('libstdc++ programming error: "%s" does not match' % name)
305          printer = RxPrinter(name, function)
306          self.subprinters.append(printer)
307          self.lookup[name] = printer
308 Index: libstdc++-v3/scripts/run_doxygen
309 ===================================================================
310 --- libstdc++-v3/scripts/run_doxygen    (.../tags/gcc_4_8_3_release)    (revision 217117)
311 +++ libstdc++-v3/scripts/run_doxygen    (.../branches/gcc-4_8-branch)   (revision 217117)
312 @@ -193,8 +193,15 @@
313  if $do_latex; then
314      cd ${outdir}/${mode}
315  
316 -    # Also drop in the header file and style sheet
317 -    doxygen -w latex header.tex doxygen.sty
318 +    # Grrr, Doxygen 1.8.x changed the -w latex options.
319 +    need_footer=`doxygen -h | sed -n -e '/-w latex/s=.*footer.*=true=p'`
320 +
321 +    # Also drop in the header file (maybe footer file) and style sheet
322 +    if $need_footer; then
323 +      doxygen -w latex header.tex footer.tex doxygen.sty
324 +    else
325 +      doxygen -w latex header.tex doxygen.sty
326 +    fi
327      
328      echo ::
329      echo :: LaTeX pages begin with
330 Index: libstdc++-v3/doc/xml/manual/containers.xml
331 ===================================================================
332 --- libstdc++-v3/doc/xml/manual/containers.xml  (.../tags/gcc_4_8_3_release)    (revision 217117)
333 +++ libstdc++-v3/doc/xml/manual/containers.xml  (.../branches/gcc-4_8-branch)   (revision 217117)
334 @@ -25,8 +25,9 @@
335    <section xml:id="sequences.list.size" xreflabel="list::size() is O(n)"><info><title>list::size() is O(n)</title></info>
336      
337     <para>
338 -     Yes it is, and that's okay.  This is a decision that we preserved
339 -     when we imported SGI's STL implementation.  The following is
340 +     Yes it is, and that was okay until the 2011 edition of the C++ standard.
341 +     In future GCC will change it to O(1) but O(N) was a decision that we
342 +     preserved when we imported SGI's STL implementation.  The following is
343       quoted from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</link>:
344     </para>
345     <blockquote>
346 @@ -72,26 +73,6 @@
347    </section>
348  </section>
349  
350 -<section xml:id="containers.sequences.vector" xreflabel="vector"><info><title>vector</title></info>
351 -<?dbhtml filename="vector.html"?>
352 -  
353 -  <para>
354 -  </para>
355 -  <section xml:id="sequences.vector.management" xreflabel="Space Overhead Management"><info><title>Space Overhead Management</title></info>
356 -    
357 -   <para>
358 -     In <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html">this
359 -     message to the list</link>, Daniel Kostecky announced work on an
360 -     alternate form of <code>std::vector</code> that would support
361 -     hints on the number of elements to be over-allocated.  The design
362 -     was also described, along with possible implementation choices.
363 -   </para>
364 -   <para>
365 -     The first two alpha releases were announced <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00048.html">here</link>
366 -     and <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html">here</link>.
367 -   </para>
368 -
369 -  </section></section>
370  </section>
371  
372  <!-- Sect1 02 : Associative -->
373 Index: libstdc++-v3/doc/xml/manual/status_cxx2011.xml
374 ===================================================================
375 --- libstdc++-v3/doc/xml/manual/status_cxx2011.xml      (.../tags/gcc_4_8_3_release)    (revision 217117)
376 +++ libstdc++-v3/doc/xml/manual/status_cxx2011.xml      (.../branches/gcc-4_8-branch)   (revision 217117)
377 @@ -226,10 +226,12 @@
378        <entry/>
379      </row>
380      <row>
381 +      <?dbhtml bgcolor="#B0B0B0" ?>
382        <entry>18.8.6</entry>
383        <entry><code>nested_exception</code></entry>
384 -      <entry>Y</entry>
385 -      <entry/>
386 +      <entry>Partial</entry>
387 +      <entry>Follows an earlier C++0x draft, not the final specification.
388 +      </entry>
389      </row>
390      <row>
391        <entry>18.9</entry>
392 @@ -612,10 +614,11 @@
393        <entry/>
394      </row>
395      <row>
396 +      <?dbhtml bgcolor="#B0B0B0" ?>
397        <entry>20.6.12.4</entry>
398        <entry><code>uninitialized_fill_n</code></entry>
399 -      <entry>Y</entry>
400 -      <entry/>
401 +      <entry>Partial</entry>
402 +      <entry>Returns <code>void</code>.</entry>
403      </row>
404      <row>
405        <entry>20.6.13</entry>
406 @@ -1119,10 +1122,13 @@
407        <entry/>
408      </row>
409      <row>
410 +      <?dbhtml bgcolor="#B0B0B0" ?>
411        <entry>21.4</entry>
412        <entry>Class template <code>basic_string</code></entry>
413 -      <entry>Y</entry>
414 -      <entry/>
415 +      <entry>Partial</entry>
416 +      <entry>Non-conforming Copy-On-Write implementation.
417 +             Missing <code>getline</code> overloads for rvalue streams.
418 +      </entry>
419      </row>
420      <row>
421        <entry>21.5</entry>
422 @@ -1190,10 +1196,11 @@
423        <entry/>
424      </row>
425      <row>
426 +      <?dbhtml bgcolor="#B0B0B0" ?>
427        <entry>22.3.3.1</entry>
428        <entry>Character classification</entry>
429 -      <entry>Y</entry>
430 -      <entry/>
431 +      <entry>Partial</entry>
432 +      <entry>Missing <code>isblank</code>.</entry>
433      </row>
434      <row>
435        <entry>22.3.3.2</entry>
436 @@ -1272,16 +1279,18 @@
437        <entry/>
438      </row>
439      <row>
440 +      <?dbhtml bgcolor="#B0B0B0" ?>
441        <entry>22.4.5.1</entry>
442        <entry>Class template <code>time_get</code></entry>
443 -      <entry>Y</entry>
444 -      <entry/>
445 +      <entry>Partial</entry>
446 +      <entry>Missing <code>get</code> and <code>do_get</code></entry>
447      </row>
448      <row>
449 +      <?dbhtml bgcolor="#B0B0B0" ?>
450        <entry>22.4.5.2</entry>
451        <entry>Class template <code>time_get_byname</code></entry>
452 -      <entry>Y</entry>
453 -      <entry/>
454 +      <entry>Partial</entry>
455 +      <entry>Likewise</entry>
456      </row>
457      <row>
458        <entry>22.4.5.3</entry>
459 @@ -1434,8 +1443,10 @@
460        <entry>23.3.5</entry>
461        <entry>Class template <code>list</code></entry>
462        <entry>Partial</entry>
463 -      <entry><code>insert</code> and <code>erase</code> members do not
464 -             take <code>const_iterator</code> arguments (N2350).</entry>
465 +      <entry>O(N) size.
466 +             <code>insert</code> and <code>erase</code> members do not
467 +             take <code>const_iterator</code> arguments (N2350).
468 +      </entry>
469      </row>
470      <row>
471        <?dbhtml bgcolor="#B0B0B0" ?>
472 @@ -1650,10 +1661,11 @@
473        <entry/>
474      </row>
475      <row>
476 +      <?dbhtml bgcolor="#B0B0B0" ?>
477        <entry>25.3</entry>
478        <entry>Mutating sequence operations</entry>
479 -      <entry>Y</entry>
480 -      <entry/>
481 +      <entry>Partial</entry>
482 +      <entry><code>rotate</code> returns <code>void</code>.</entry>
483      </row>
484      <row>
485        <entry>25.4</entry>
486 @@ -2060,10 +2072,13 @@
487        <entry/>
488      </row>
489      <row>
490 +      <?dbhtml bgcolor="#B0B0B0" ?>
491        <entry>26.8</entry>
492        <entry>C Library</entry>
493 -      <entry>Y</entry>
494 -      <entry/>
495 +      <entry>Partial</entry>
496 +      <entry><code>&lt;ctgmath&gt;</code> doesn't include
497 +       <code>&lt;ccomplex&gt;</code>
498 +      </entry>
499      </row>
500      <row>
501        <entry>
502 @@ -2143,6 +2158,7 @@
503          Missing move and swap operations on <code>basic_ios</code>.
504          Missing <code>io_errc</code> and <code>iostream_category</code>.
505          <code>ios_base::failure</code> is not derived from <code>system_error</code>.
506 +       Missing <code>ios_base::hexfloat</code>.
507        </entry>
508      </row>
509      <row>
510 Index: libstdc++-v3/doc/html/index.html
511 ===================================================================
512 --- libstdc++-v3/doc/html/index.html    (.../tags/gcc_4_8_3_release)    (revision 217117)
513 +++ libstdc++-v3/doc/html/index.html    (.../branches/gcc-4_8-branch)   (revision 217117)
514 @@ -43,7 +43,7 @@
515  </a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#idm269999753024">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9. 
516    Containers
517    
518 -</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="manual/containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="manual/associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10. 
519 +</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="manual/associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10. 
520    Iterators
521    
522  </a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/algorithms.html">11. 
523 @@ -162,4 +162,4 @@
524    
525  </a></span></dt><dt><span class="appendix"><a href="manual/appendix_gpl.html">D. 
526      <acronym class="acronym">GNU</acronym> General Public License version 3
527 -  </a></span></dt><dt><span class="appendix"><a href="manual/appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></dd><dt><span class="book"><a href="bk02.html"></a></span></dt><dd><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"></a></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> The GNU C++ Library Manual</td></tr></table></div></body></html>
528 \ No newline at end of file
529 +  </a></span></dt><dt><span class="appendix"><a href="manual/appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></dd><dt><span class="book"><a href="bk02.html"></a></span></dt><dd><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"></a></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> The GNU C++ Library Manual</td></tr></table></div></body></html>
530 Index: libstdc++-v3/doc/html/manual/status.html
531 ===================================================================
532 --- libstdc++-v3/doc/html/manual/status.html    (.../tags/gcc_4_8_3_release)    (revision 217117)
533 +++ libstdc++-v3/doc/html/manual/status.html    (.../branches/gcc-4_8-branch)   (revision 217117)
534 @@ -165,7 +165,8 @@
535               <code class="code">set_new_handler</code> is not thread-safe.
536        </td></tr><tr><td align="left">18.7</td><td align="left">Type identification</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.7.1</td><td align="left">Class type_info</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.7.2</td><td align="left">Class bad_cast</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.7.3</td><td align="left">Class bad_typeid</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8</td><td align="left">Exception handling</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.8.1</td><td align="left">Class exception</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.2</td><td align="left">Class bad_exception</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">18.8.3</td><td align="left">Abnormal termination</td><td align="left">Partial</td><td align="left">Missing <code class="code">get_terminate</code>.
537               <code class="code">set_terminate</code> is not thread-safe.
538 -      </td></tr><tr><td align="left">18.8.4</td><td align="left"><code class="code">uncaught_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.5</td><td align="left">Exception Propagation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.6</td><td align="left"><code class="code">nested_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9</td><td align="left">Initializer lists</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.9.1</td><td align="left">Initializer list constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.2</td><td align="left">Initializer list access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.3</td><td align="left">Initializer list range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.10</td><td align="left">Other runtime support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
539 +      </td></tr><tr><td align="left">18.8.4</td><td align="left"><code class="code">uncaught_exception</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.8.5</td><td align="left">Exception Propagation</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">18.8.6</td><td align="left"><code class="code">nested_exception</code></td><td align="left">Partial</td><td align="left">Follows an earlier C++0x draft, not the final specification.
540 +      </td></tr><tr><td align="left">18.9</td><td align="left">Initializer lists</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">18.9.1</td><td align="left">Initializer list constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.2</td><td align="left">Initializer list access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.9.3</td><td align="left">Initializer list range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">18.10</td><td align="left">Other runtime support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
541         <span class="emphasis"><em>19</em></span>
542        </td><td colspan="3" align="left">
543         <span class="emphasis"><em>Diagnostics</em></span>
544 @@ -173,7 +174,7 @@
545         <span class="emphasis"><em>20</em></span>
546        </td><td colspan="3" align="left">
547         <span class="emphasis"><em>General utilities</em></span>
548 -      </td></tr><tr><td align="left">20.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.2</td><td align="left">Utility components</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.2.1</td><td align="left">Operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.2</td><td align="left">Swap</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.3</td><td align="left"><code class="code">forward</code> and <code class="code">move</code> helpers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.4</td><td align="left">Function template <code class="code">declval</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3</td><td align="left">Pairs</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.2</td><td align="left">Class template <code class="code">pair</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.3</td><td align="left">Specialized algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.4</td><td align="left">Tuple-like access to <code class="code">pair</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.5</td><td align="left">Piecewise construction</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4</td><td align="left">Tuples</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2</td><td align="left">Class template <code class="code">tuple</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2.1</td><td align="left">Construction</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.2</td><td align="left">Assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.3</td><td align="left">Swap</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.4</td><td align="left">Tuple creation functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.5</td><td align="left">Tuple helper classes</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.6</td><td align="left">Element access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.7</td><td align="left">Relational operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.8</td><td align="left">Tuple traits</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.9</td><td align="left">Tuple specialized algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5</td><td align="left">Class template <code class="code">bitset</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.1</td><td align="left"><code class="code">bitset</code> constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.2</td><td align="left"><code class="code">bitset</code> members</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.3</td><td align="left"><code class="code">bitset</code> hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.4</td><td align="left"><code class="code">bitset</code> operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6</td><td align="left">Memory</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.2</td><td align="left">Header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.3</td><td align="left">Pointer traits</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">20.6.4</td><td align="left">Pointer safety</td><td align="left">Partial</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">20.6.5</td><td align="left">Align</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">20.6.6</td><td align="left">Allocator argument tag</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.7</td><td align="left"><code class="code">uses_allocator</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.8</td><td align="left">Allocator traits</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.9</td><td align="left">The default allocator</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.10</td><td align="left">Raw storage iterator</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.11</td><td align="left">Temporary buffers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12</td><td align="left">Specialized algorithms</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.12.1</td><td align="left"><code class="code">addressof</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12.2</td><td align="left"><code class="code">uninitialized_copy</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12.3</td><td align="left"><code class="code">uninitialized_fill</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12.4</td><td align="left"><code class="code">uninitialized_fill_n</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.13</td><td align="left">C library</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.7.1</td><td align="left">Class template <code class="code">unique_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2</td><td align="left">Shared-ownership pointers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2.1</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2.2</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">Y</td><td align="left">
549 +      </td></tr><tr><td align="left">20.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.2</td><td align="left">Utility components</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.2.1</td><td align="left">Operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.2</td><td align="left">Swap</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.3</td><td align="left"><code class="code">forward</code> and <code class="code">move</code> helpers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.2.4</td><td align="left">Function template <code class="code">declval</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3</td><td align="left">Pairs</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.2</td><td align="left">Class template <code class="code">pair</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.3</td><td align="left">Specialized algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.4</td><td align="left">Tuple-like access to <code class="code">pair</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.3.5</td><td align="left">Piecewise construction</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4</td><td align="left">Tuples</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2</td><td align="left">Class template <code class="code">tuple</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2.1</td><td align="left">Construction</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.2</td><td align="left">Assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.3</td><td align="left">Swap</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.4</td><td align="left">Tuple creation functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.5</td><td align="left">Tuple helper classes</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.6</td><td align="left">Element access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.7</td><td align="left">Relational operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.8</td><td align="left">Tuple traits</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.4.2.9</td><td align="left">Tuple specialized algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5</td><td align="left">Class template <code class="code">bitset</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.1</td><td align="left"><code class="code">bitset</code> constructors</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.2</td><td align="left"><code class="code">bitset</code> members</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.3</td><td align="left"><code class="code">bitset</code> hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.5.4</td><td align="left"><code class="code">bitset</code> operators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6</td><td align="left">Memory</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.1</td><td align="left">In general</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.2</td><td align="left">Header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.3</td><td align="left">Pointer traits</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">20.6.4</td><td align="left">Pointer safety</td><td align="left">Partial</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">20.6.5</td><td align="left">Align</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">20.6.6</td><td align="left">Allocator argument tag</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.7</td><td align="left"><code class="code">uses_allocator</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.8</td><td align="left">Allocator traits</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.9</td><td align="left">The default allocator</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.10</td><td align="left">Raw storage iterator</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.11</td><td align="left">Temporary buffers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12</td><td align="left">Specialized algorithms</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.12.1</td><td align="left"><code class="code">addressof</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12.2</td><td align="left"><code class="code">uninitialized_copy</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.6.12.3</td><td align="left"><code class="code">uninitialized_fill</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">20.6.12.4</td><td align="left"><code class="code">uninitialized_fill_n</code></td><td align="left">Partial</td><td align="left">Returns <code class="code">void</code>.</td></tr><tr><td align="left">20.6.13</td><td align="left">C library</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.7.1</td><td align="left">Class template <code class="code">unique_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2</td><td align="left">Shared-ownership pointers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2.1</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">20.7.2.2</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">Y</td><td align="left">
550         <p>
551           Uses code from
552           <a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">boost::shared_ptr</a>.
553 @@ -187,14 +188,16 @@
554         <span class="emphasis"><em>21</em></span>
555        </td><td colspan="3" align="left">
556         <span class="emphasis"><em>Strings</em></span>
557 -      </td></tr><tr><td align="left">21.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2</td><td align="left">Character traits</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">21.2.1</td><td align="left">Character traits requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.2</td><td align="left">traits typedefs</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3</td><td align="left"><code class="code">char_traits</code> specializations</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.1</td><td align="left">struct <code class="code">char_traits&lt;char&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.2</td><td align="left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">21.2.3.3</td><td align="left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3.4</td><td align="left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.3</td><td align="left">String classes</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.4</td><td align="left">Class template <code class="code">basic_string</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.5</td><td align="left">Numeric Conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.6</td><td align="left">Hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.7</td><td align="left">Null-terminated sequence utilities</td><td align="left">Partial</td><td align="left">C library dependency.
558 +      </td></tr><tr><td align="left">21.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2</td><td align="left">Character traits</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">21.2.1</td><td align="left">Character traits requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.2</td><td align="left">traits typedefs</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3</td><td align="left"><code class="code">char_traits</code> specializations</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.1</td><td align="left">struct <code class="code">char_traits&lt;char&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr bgcolor="#B0B0B0"><td align="left">21.2.3.2</td><td align="left">struct <code class="code">char_traits&lt;char16_t&gt;</code></td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">21.2.3.3</td><td align="left">struct <code class="code">char_traits&lt;char32_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.2.3.4</td><td align="left">struct <code class="code">char_traits&lt;wchar_t&gt;</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.3</td><td align="left">String classes</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.4</td><td align="left">Class template <code class="code">basic_string</code></td><td align="left">Partial</td><td align="left">Non-conforming Copy-On-Write implementation.
559 +             Missing <code class="code">getline</code> overloads for rvalue streams.
560 +      </td></tr><tr><td align="left">21.5</td><td align="left">Numeric Conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">21.6</td><td align="left">Hash support</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">21.7</td><td align="left">Null-terminated sequence utilities</td><td align="left">Partial</td><td align="left">C library dependency.
561        Missing <code class="filename">&lt;cuchar&gt;</code>
562        </td></tr><tr><td align="left">
563         <span class="emphasis"><em>22</em></span>
564        </td><td colspan="3" align="left">
565         <span class="emphasis"><em>Localization</em></span>
566 -      </td></tr><tr><td align="left">22.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.2</td><td align="left">Header <code class="code">&lt;locale&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3</td><td align="left">Locales</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.3.1</td><td align="left">Class <code class="code">locale</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3.2</td><td align="left"><code class="code">locale</code> globals</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3.3</td><td align="left">Convenience interfaces</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.3.3.1</td><td align="left">Character classification</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3.3.2</td><td align="left">Conversions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.3.3.2.1</td><td align="left">Character conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.3.3.2.2</td><td align="left"><code class="code">string</code> conversions</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.3.3.2.3</td><td align="left">Buffer conversions</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">22.4</td><td align="left">Standard <code class="code">locale</code> categories</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">22.4.1</td><td align="left">The <code class="code">ctype</code> category</td><td align="left">Partial</td><td align="left">Missing <code class="code">codecvt&lt;char16_t&gt;</code> and
567 -             <code class="code">codecvt&lt;char32_t&gt;</code></td></tr><tr><td align="left">22.4.2</td><td align="left">The numeric category</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.4.2.1</td><td align="left"><code class="code">num_get</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.2.2</td><td align="left"><code class="code">num_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.3</td><td align="left">The numeric punctuation facet</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.4</td><td align="left">The collate category</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5</td><td align="left">The time category</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.4.5.1</td><td align="left">Class template <code class="code">time_get</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5.2</td><td align="left">Class template <code class="code">time_get_byname</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5.3</td><td align="left">Class template <code class="code">time_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5.3</td><td align="left">Class template <code class="code">time_put_byname</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6</td><td align="left">The monetary category</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.4.6.1</td><td align="left">Class template <code class="code">money_get</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.2</td><td align="left">Class template <code class="code">money_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.3</td><td align="left">Class template <code class="code">money_punct</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.4</td><td align="left">Class template <code class="code">money_punct_byname</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.7</td><td align="left">The message retrieval category</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.8</td><td align="left">Program-defined facets</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.5</td><td align="left">Standard code conversion facets</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">22.6</td><td align="left">C Library Locales</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
568 +      </td></tr><tr><td align="left">22.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.2</td><td align="left">Header <code class="code">&lt;locale&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3</td><td align="left">Locales</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.3.1</td><td align="left">Class <code class="code">locale</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3.2</td><td align="left"><code class="code">locale</code> globals</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.3.3</td><td align="left">Convenience interfaces</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">22.3.3.1</td><td align="left">Character classification</td><td align="left">Partial</td><td align="left">Missing <code class="code">isblank</code>.</td></tr><tr><td align="left">22.3.3.2</td><td align="left">Conversions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.3.3.2.1</td><td align="left">Character conversions</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.3.3.2.2</td><td align="left"><code class="code">string</code> conversions</td><td align="left">N</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.3.3.2.3</td><td align="left">Buffer conversions</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">22.4</td><td align="left">Standard <code class="code">locale</code> categories</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">22.4.1</td><td align="left">The <code class="code">ctype</code> category</td><td align="left">Partial</td><td align="left">Missing <code class="code">codecvt&lt;char16_t&gt;</code> and
569 +             <code class="code">codecvt&lt;char32_t&gt;</code></td></tr><tr><td align="left">22.4.2</td><td align="left">The numeric category</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.4.2.1</td><td align="left"><code class="code">num_get</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.2.2</td><td align="left"><code class="code">num_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.3</td><td align="left">The numeric punctuation facet</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.4</td><td align="left">The collate category</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5</td><td align="left">The time category</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">22.4.5.1</td><td align="left">Class template <code class="code">time_get</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">get</code> and <code class="code">do_get</code></td></tr><tr bgcolor="#B0B0B0"><td align="left">22.4.5.2</td><td align="left">Class template <code class="code">time_get_byname</code></td><td align="left">Partial</td><td align="left">Likewise</td></tr><tr><td align="left">22.4.5.3</td><td align="left">Class template <code class="code">time_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.5.3</td><td align="left">Class template <code class="code">time_put_byname</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6</td><td align="left">The monetary category</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">22.4.6.1</td><td align="left">Class template <code class="code">money_get</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.2</td><td align="left">Class template <code class="code">money_put</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.3</td><td align="left">Class template <code class="code">money_punct</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.6.4</td><td align="left">Class template <code class="code">money_punct_byname</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.7</td><td align="left">The message retrieval category</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">22.4.8</td><td align="left">Program-defined facets</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">22.5</td><td align="left">Standard code conversion facets</td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">22.6</td><td align="left">C Library Locales</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
570         <span class="emphasis"><em>23</em></span>
571        </td><td colspan="3" align="left">
572         <span class="emphasis"><em>Containers</em></span>
573 @@ -201,8 +204,10 @@
574        </td></tr><tr><td align="left">23.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2</td><td align="left">Container requirements</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.2.1</td><td align="left">General container requirements</td><td align="left">Partial</td><td align="left">Only <code class="code">vector</code> and <code class="code">forward_list</code>
575               meet the requirements
576               relating to allocator use and propagation.</td></tr><tr><td align="left">23.2.2</td><td align="left">Container data races</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.3</td><td align="left">Sequence containers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.4</td><td align="left">Associative containers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.5</td><td align="left">Unordered associative containers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.3</td><td align="left">Sequence containers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.3.2</td><td align="left">Class template <code class="code">array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.3</td><td align="left">Class template <code class="code">deque</code></td><td align="left">Partial</td><td align="left"><code class="code">insert</code> and <code class="code">erase</code> members do not
577 -             take <code class="code">const_iterator</code> arguments (N2350).</td></tr><tr><td align="left">23.3.4</td><td align="left">Class template <code class="code">forward_list</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.5</td><td align="left">Class template <code class="code">list</code></td><td align="left">Partial</td><td align="left"><code class="code">insert</code> and <code class="code">erase</code> members do not
578 -             take <code class="code">const_iterator</code> arguments (N2350).</td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.6</td><td align="left">Class template <code class="code">vector</code></td><td align="left">Partial</td><td align="left"><code class="code">insert</code> and <code class="code">erase</code> members do not
579 +             take <code class="code">const_iterator</code> arguments (N2350).</td></tr><tr><td align="left">23.3.4</td><td align="left">Class template <code class="code">forward_list</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.5</td><td align="left">Class template <code class="code">list</code></td><td align="left">Partial</td><td align="left">O(N) size.
580 +             <code class="code">insert</code> and <code class="code">erase</code> members do not
581 +             take <code class="code">const_iterator</code> arguments (N2350).
582 +      </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.6</td><td align="left">Class template <code class="code">vector</code></td><td align="left">Partial</td><td align="left"><code class="code">insert</code> and <code class="code">erase</code> members do not
583               take <code class="code">const_iterator</code> arguments (N2350).</td></tr><tr bgcolor="#B0B0B0"><td align="left">23.3.7</td><td align="left">Class <code class="code">vector&lt;bool&gt;</code></td><td align="left">Partial</td><td align="left"><code class="code">insert</code> and <code class="code">erase</code> members do not
584               take <code class="code">const_iterator</code> arguments (N2350).</td></tr><tr><td align="left">23.4</td><td align="left">Associative containers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.4</td><td align="left">Class template <code class="code">map</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.4.5</td><td align="left">Class template <code class="code">multimap</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.4.6</td><td align="left">Class template <code class="code">set</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.4.7</td><td align="left">Class template <code class="code">multiset</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.5</td><td align="left">Unordered associative containers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.5.4</td><td align="left">Class template <code class="code">unordered_map</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.5.5</td><td align="left">Class template <code class="code">unordered_multimap</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.5.6</td><td align="left">Class template <code class="code">unordered_set</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.5.7</td><td align="left">Class template <code class="code">unordered_multiset</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.6</td><td align="left">Container adaptors</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.6.1</td><td align="left">Class template <code class="code">queue</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.6.2</td><td align="left">Class template <code class="code">priority_queue</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.6.3</td><td align="left">Class template <code class="code">stack</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
585         <span class="emphasis"><em>24</em></span>
586 @@ -212,11 +217,13 @@
587         <span class="emphasis"><em>25</em></span>
588        </td><td colspan="3" align="left">
589         <span class="emphasis"><em>Algorithms</em></span>
590 -      </td></tr><tr><td align="left">25.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">25.2</td><td align="left">Non-modifying sequence operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">25.3</td><td align="left">Mutating sequence operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">25.4</td><td align="left">Sorting and related operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">25.5</td><td align="left">C library algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
591 +      </td></tr><tr><td align="left">25.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">25.2</td><td align="left">Non-modifying sequence operations</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">25.3</td><td align="left">Mutating sequence operations</td><td align="left">Partial</td><td align="left"><code class="code">rotate</code> returns <code class="code">void</code>.</td></tr><tr><td align="left">25.4</td><td align="left">Sorting and related operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">25.5</td><td align="left">C library algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
592        <span class="emphasis"><em>26</em></span>
593        </td><td colspan="3" align="left">
594         <span class="emphasis"><em>Numerics</em></span>
595 -      </td></tr><tr><td align="left">26.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.2</td><td align="left">Numeric type requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.3</td><td align="left">The floating-point environment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.4</td><td align="left">Complex numbers</td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5</td><td align="left">Random number generation</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.1</td><td align="left">Requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.2</td><td align="left">Header <code class="code">&lt;random&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.3</td><td align="left">Random number engine class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.3.1</td><td align="left">Class template <code class="code">linear_congruential_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.3.2</td><td align="left">Class template <code class="code">mersenne_twister_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.3.3</td><td align="left">Class template <code class="code">subtract_with_carry_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4</td><td align="left">Random number engine adaptor class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.4.2</td><td align="left">Class template <code class="code">discard_block_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4.3</td><td align="left">Class template <code class="code">independent_bits_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4.4</td><td align="left">Class template <code class="code">shuffle_order_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.5</td><td align="left">Engines and engine adaptors with predefined parameters</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.6</td><td align="left">Class <code class="code">random_device</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.7</td><td align="left">Utilities</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.7.1</td><td align="left">Class <code class="code">seed_seq</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.7.2</td><td align="left">Function template <code class="code">generate_canonical</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8</td><td align="left">Random number distribution class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.2</td><td align="left">Uniform distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.2.1</td><td align="left">Class template <code class="code">uniform_int_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.2.2</td><td align="left">Class template <code class="code">uniform_real_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3</td><td align="left">Bernoulli distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.1</td><td align="left">Class <code class="code">bernoulli_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.2</td><td align="left">Class template <code class="code">binomial_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.3</td><td align="left">Class template <code class="code">geometric_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.4</td><td align="left">Class template <code class="code">negative_binomial_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4</td><td align="left">Poisson distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.1</td><td align="left">Class template <code class="code">poisson_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.2</td><td align="left">Class template <code class="code">exponential_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.3</td><td align="left">Class template <code class="code">gamma_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.4</td><td align="left">Class template <code class="code">weibull_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.5</td><td align="left">Class template <code class="code">extreme_value_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5</td><td align="left">Normal distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.1</td><td align="left">Class template <code class="code">normal_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.2</td><td align="left">Class template <code class="code">lognormal_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.3</td><td align="left">Class template <code class="code">chi_squared_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.4</td><td align="left">Class template <code class="code">cauchy_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.5</td><td align="left">Class template <code class="code">fisher_f_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.6</td><td align="left">Class template <code class="code">student_t_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6</td><td align="left">Sampling distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.1</td><td align="left">Class template <code class="code">discrete_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.2</td><td align="left">Class template <code class="code">piecewise_constant_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.3</td><td align="left">Class template <code class="code">piecewise_linear_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6</td><td align="left">Numeric arrays</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.6.1</td><td align="left">Header <code class="code">&lt;valarray&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.2</td><td align="left">Class template <code class="code">valarray</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.3</td><td align="left"><code class="code">valarray</code> non-member operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.4</td><td align="left">Class <code class="code">slice</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.5</td><td align="left">Class template <code class="code">slice_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.6</td><td align="left">The <code class="code">gslice</code> class</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.7</td><td align="left">Class template <code class="code">gslice_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.8</td><td align="left">Class template <code class="code">mask_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.9</td><td align="left">Class template <code class="code">indirect_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.10</td><td align="left"><code class="code">valarray</code> range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7</td><td align="left">Generalized numeric operations</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.7.1</td><td align="left">Header <code class="code">&lt;numeric&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.2</td><td align="left"><code class="code">accumulate</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.3</td><td align="left"><code class="code">inner_product</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.4</td><td align="left"><code class="code">partial_sum</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.5</td><td align="left"><code class="code">adjacent_difference</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.6</td><td align="left">iota</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.8</td><td align="left">C Library</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
596 +      </td></tr><tr><td align="left">26.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.2</td><td align="left">Numeric type requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.3</td><td align="left">The floating-point environment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.4</td><td align="left">Complex numbers</td><td align="left">Partial</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5</td><td align="left">Random number generation</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.1</td><td align="left">Requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.2</td><td align="left">Header <code class="code">&lt;random&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.3</td><td align="left">Random number engine class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.3.1</td><td align="left">Class template <code class="code">linear_congruential_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.3.2</td><td align="left">Class template <code class="code">mersenne_twister_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.3.3</td><td align="left">Class template <code class="code">subtract_with_carry_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4</td><td align="left">Random number engine adaptor class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.4.2</td><td align="left">Class template <code class="code">discard_block_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4.3</td><td align="left">Class template <code class="code">independent_bits_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.4.4</td><td align="left">Class template <code class="code">shuffle_order_engine</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.5</td><td align="left">Engines and engine adaptors with predefined parameters</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.6</td><td align="left">Class <code class="code">random_device</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">26.5.7</td><td align="left">Utilities</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.7.1</td><td align="left">Class <code class="code">seed_seq</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.7.2</td><td align="left">Function template <code class="code">generate_canonical</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8</td><td align="left">Random number distribution class templates</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.2</td><td align="left">Uniform distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.2.1</td><td align="left">Class template <code class="code">uniform_int_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.2.2</td><td align="left">Class template <code class="code">uniform_real_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3</td><td align="left">Bernoulli distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.1</td><td align="left">Class <code class="code">bernoulli_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.2</td><td align="left">Class template <code class="code">binomial_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.3</td><td align="left">Class template <code class="code">geometric_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.3.4</td><td align="left">Class template <code class="code">negative_binomial_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4</td><td align="left">Poisson distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.1</td><td align="left">Class template <code class="code">poisson_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.2</td><td align="left">Class template <code class="code">exponential_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.3</td><td align="left">Class template <code class="code">gamma_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.4</td><td align="left">Class template <code class="code">weibull_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.4.5</td><td align="left">Class template <code class="code">extreme_value_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5</td><td align="left">Normal distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.1</td><td align="left">Class template <code class="code">normal_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.2</td><td align="left">Class template <code class="code">lognormal_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.3</td><td align="left">Class template <code class="code">chi_squared_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.4</td><td align="left">Class template <code class="code">cauchy_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.5</td><td align="left">Class template <code class="code">fisher_f_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.5.6</td><td align="left">Class template <code class="code">student_t_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6</td><td align="left">Sampling distributions</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.1</td><td align="left">Class template <code class="code">discrete_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.2</td><td align="left">Class template <code class="code">piecewise_constant_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.5.8.6.3</td><td align="left">Class template <code class="code">piecewise_linear_distribution</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6</td><td align="left">Numeric arrays</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.6.1</td><td align="left">Header <code class="code">&lt;valarray&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.2</td><td align="left">Class template <code class="code">valarray</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.3</td><td align="left"><code class="code">valarray</code> non-member operations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.4</td><td align="left">Class <code class="code">slice</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.5</td><td align="left">Class template <code class="code">slice_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.6</td><td align="left">The <code class="code">gslice</code> class</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.7</td><td align="left">Class template <code class="code">gslice_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.8</td><td align="left">Class template <code class="code">mask_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.9</td><td align="left">Class template <code class="code">indirect_array</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.6.10</td><td align="left"><code class="code">valarray</code> range access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7</td><td align="left">Generalized numeric operations</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.7.1</td><td align="left">Header <code class="code">&lt;numeric&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.2</td><td align="left"><code class="code">accumulate</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.3</td><td align="left"><code class="code">inner_product</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.4</td><td align="left"><code class="code">partial_sum</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.5</td><td align="left"><code class="code">adjacent_difference</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">26.7.6</td><td align="left">iota</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">26.8</td><td align="left">C Library</td><td align="left">Partial</td><td align="left"><code class="code">&lt;ctgmath&gt;</code> doesn't include
597 +       <code class="code">&lt;ccomplex&gt;</code>
598 +      </td></tr><tr><td align="left">
599         <span class="emphasis"><em>27</em></span>
600        </td><td colspan="3" align="left">
601         <span class="emphasis"><em>Input/output library</em></span>
602 @@ -224,6 +231,7 @@
603          Missing move and swap operations on <code class="code">basic_ios</code>.
604          Missing <code class="code">io_errc</code> and <code class="code">iostream_category</code>.
605          <code class="code">ios_base::failure</code> is not derived from <code class="code">system_error</code>.
606 +       Missing <code class="code">ios_base::hexfloat</code>.
607        </td></tr><tr><td align="left">27.6</td><td align="left">Stream buffers</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">27.7</td><td align="left">Formatting and manipulators</td><td align="left">Partial</td><td align="left">
608          Missing move and swap operations
609          Missing <code class="code">get_time</code> and <code class="code">put_time</code> manipulators.
610 Index: libstdc++-v3/doc/html/manual/abi.html
611 ===================================================================
612 --- libstdc++-v3/doc/html/manual/abi.html       (.../tags/gcc_4_8_3_release)    (revision 217117)
613 +++ libstdc++-v3/doc/html/manual/abi.html       (.../branches/gcc-4_8-branch)   (revision 217117)
614 @@ -96,7 +96,7 @@
615     definitions, where the version definition is the maximum for a
616     particular release. Labels are cumulative. If a particular release
617     is not listed, it has the same version labels as the preceding
618 -   release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: GCC_3.0</p></li><li class="listitem"><p>GCC 3.3.0: GCC_3.3</p></li><li class="listitem"><p>GCC 3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>GCC 3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>GCC 3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>GCC 3.4.0: GCC_3.4</p></li><li class="listitem"><p>GCC 3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>GCC 3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>GCC 4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>GCC 4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>GCC 4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>GCC 4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>GCC 4.4.0: GCC_4.4.0</p></li><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li></ul></div></li><li class="listitem"><p>
619 +   release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: GCC_3.0</p></li><li class="listitem"><p>GCC 3.3.0: GCC_3.3</p></li><li class="listitem"><p>GCC 3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>GCC 3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>GCC 3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>GCC 3.4.0: GCC_3.4</p></li><li class="listitem"><p>GCC 3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>GCC 3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>GCC 4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>GCC 4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>GCC 4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>GCC 4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>GCC 4.4.0: GCC_4.4.0</p></li><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li><li class="listitem"><p>GCC 4.8.0: GCC_4.8.0</p></li></ul></div></li><li class="listitem"><p>
620         Release versioning on the libstdc++.so binary, implemented in
621         the same way as the libgcc_s.so binary above. Listed is the
622         filename: <code class="constant">DT_SONAME</code> can be deduced from
623 @@ -111,7 +111,7 @@
624         has the same filename and <code class="constant">DT_SONAME</code> as the
625         preceding release.
626        </p><p>It is versioned as follows:
627 -    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: libstdc++.so.3.0.0</p></li><li class="listitem"><p>GCC 3.0.1: libstdc++.so.3.0.1</p></li><li class="listitem"><p>GCC 3.0.2: libstdc++.so.3.0.2</p></li><li class="listitem"><p>GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li class="listitem"><p>GCC 3.0.4: libstdc++.so.3.0.4</p></li><li class="listitem"><p>GCC 3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.1.1: libstdc++.so.4.0.1</p></li><li class="listitem"><p>GCC 3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.2.1: libstdc++.so.5.0.1</p></li><li class="listitem"><p>GCC 3.2.2: libstdc++.so.5.0.2</p></li><li class="listitem"><p>GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li class="listitem"><p>GCC 3.3.0: libstdc++.so.5.0.4</p></li><li class="listitem"><p>GCC 3.3.1: libstdc++.so.5.0.5</p></li><li class="listitem"><p>GCC 3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.4.1: libstdc++.so.6.0.1</p></li><li class="listitem"><p>GCC 3.4.2: libstdc++.so.6.0.2</p></li><li class="listitem"><p>GCC 3.4.3: libstdc++.so.6.0.3</p></li><li class="listitem"><p>GCC 4.0.0: libstdc++.so.6.0.4</p></li><li class="listitem"><p>GCC 4.0.1: libstdc++.so.6.0.5</p></li><li class="listitem"><p>GCC 4.0.2: libstdc++.so.6.0.6</p></li><li class="listitem"><p>GCC 4.0.3: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.0: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.1: libstdc++.so.6.0.8</p></li><li class="listitem"><p>GCC 4.2.0: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li class="listitem"><p>GCC 4.2.2: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.3.0: libstdc++.so.6.0.10</p></li><li class="listitem"><p>GCC 4.4.0: libstdc++.so.6.0.11</p></li><li class="listitem"><p>GCC 4.4.1: libstdc++.so.6.0.12</p></li><li class="listitem"><p>GCC 4.4.2: libstdc++.so.6.0.13</p></li><li class="listitem"><p>GCC 4.5.0: libstdc++.so.6.0.14</p></li><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li></ul></div><p>
628 +    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: libstdc++.so.3.0.0</p></li><li class="listitem"><p>GCC 3.0.1: libstdc++.so.3.0.1</p></li><li class="listitem"><p>GCC 3.0.2: libstdc++.so.3.0.2</p></li><li class="listitem"><p>GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li class="listitem"><p>GCC 3.0.4: libstdc++.so.3.0.4</p></li><li class="listitem"><p>GCC 3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.1.1: libstdc++.so.4.0.1</p></li><li class="listitem"><p>GCC 3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.2.1: libstdc++.so.5.0.1</p></li><li class="listitem"><p>GCC 3.2.2: libstdc++.so.5.0.2</p></li><li class="listitem"><p>GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li class="listitem"><p>GCC 3.3.0: libstdc++.so.5.0.4</p></li><li class="listitem"><p>GCC 3.3.1: libstdc++.so.5.0.5</p></li><li class="listitem"><p>GCC 3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 3.4.1: libstdc++.so.6.0.1</p></li><li class="listitem"><p>GCC 3.4.2: libstdc++.so.6.0.2</p></li><li class="listitem"><p>GCC 3.4.3: libstdc++.so.6.0.3</p></li><li class="listitem"><p>GCC 4.0.0: libstdc++.so.6.0.4</p></li><li class="listitem"><p>GCC 4.0.1: libstdc++.so.6.0.5</p></li><li class="listitem"><p>GCC 4.0.2: libstdc++.so.6.0.6</p></li><li class="listitem"><p>GCC 4.0.3: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.0: libstdc++.so.6.0.7</p></li><li class="listitem"><p>GCC 4.1.1: libstdc++.so.6.0.8</p></li><li class="listitem"><p>GCC 4.2.0: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li class="listitem"><p>GCC 4.2.2: libstdc++.so.6.0.9</p></li><li class="listitem"><p>GCC 4.3.0: libstdc++.so.6.0.10</p></li><li class="listitem"><p>GCC 4.4.0: libstdc++.so.6.0.11</p></li><li class="listitem"><p>GCC 4.4.1: libstdc++.so.6.0.12</p></li><li class="listitem"><p>GCC 4.4.2: libstdc++.so.6.0.13</p></li><li class="listitem"><p>GCC 4.5.0: libstdc++.so.6.0.14</p></li><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li><li class="listitem"><p>GCC 4.8.3: libstdc++.so.6.0.19</p></li></ul></div><p>
629        Note 1: Error should be libstdc++.so.3.0.3.
630      </p><p>
631        Note 2: Not strictly required.
632 @@ -129,7 +129,7 @@
633     GLIBCPP_3.2 for symbols that were introduced in the GCC 3.2.0
634     release.) If a particular release is not listed, it has the same
635     version labels as the preceding release.
636 -   </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.1: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.2: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.3: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.4: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.2: GLIBCXX_3.4.2</p></li><li class="listitem"><p>GCC 3.4.3: GLIBCXX_3.4.3</p></li><li class="listitem"><p>GCC 4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li class="listitem"><p>GCC 4.0.1: GLIBCXX_3.4.5</p></li><li class="listitem"><p>GCC 4.0.2: GLIBCXX_3.4.6</p></li><li class="listitem"><p>GCC 4.0.3: GLIBCXX_3.4.7</p></li><li class="listitem"><p>GCC 4.1.1: GLIBCXX_3.4.8</p></li><li class="listitem"><p>GCC 4.2.0: GLIBCXX_3.4.9</p></li><li class="listitem"><p>GCC 4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li class="listitem"><p>GCC 4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.1: GLIBCXX_3.4.12, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</p></li><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
637 +   </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0.0: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.1: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.2: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.3: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.0.4: (Error, not versioned)</p></li><li class="listitem"><p>GCC 3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>GCC 3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>GCC 3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>GCC 3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li class="listitem"><p>GCC 3.4.2: GLIBCXX_3.4.2</p></li><li class="listitem"><p>GCC 3.4.3: GLIBCXX_3.4.3</p></li><li class="listitem"><p>GCC 4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li class="listitem"><p>GCC 4.0.1: GLIBCXX_3.4.5</p></li><li class="listitem"><p>GCC 4.0.2: GLIBCXX_3.4.6</p></li><li class="listitem"><p>GCC 4.0.3: GLIBCXX_3.4.7</p></li><li class="listitem"><p>GCC 4.1.1: GLIBCXX_3.4.8</p></li><li class="listitem"><p>GCC 4.2.0: GLIBCXX_3.4.9</p></li><li class="listitem"><p>GCC 4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li class="listitem"><p>GCC 4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.1: GLIBCXX_3.4.12, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3</p></li><li class="listitem"><p>GCC 4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</p></li><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li><li class="listitem"><p>GCC 4.8.3: GLIBCXX_3.4.19, CXXABI_1.3.7</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
638      __GXX_ABI_VERSION. This macro is defined as the version of the
639      compiler v3 ABI, with g++ 3.0 being version 100. This macro will
640      be automatically defined whenever g++ is used (the curious can
641 Index: libstdc++-v3/doc/html/manual/std_contents.html
642 ===================================================================
643 --- libstdc++-v3/doc/html/manual/std_contents.html      (.../tags/gcc_4_8_3_release)    (revision 217117)
644 +++ libstdc++-v3/doc/html/manual/std_contents.html      (.../branches/gcc-4_8-branch)   (revision 217117)
645 @@ -21,7 +21,7 @@
646  </a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm269999753024">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9. 
647    Containers
648    
649 -</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10. 
650 +</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10. 
651    Iterators
652    
653  </a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11. 
654 @@ -42,4 +42,4 @@
655  </a></span></dt><dd><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Debugging Support </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. 
656    Support
657    
658 -</td></tr></table></div></body></html>
659 \ No newline at end of file
660 +</td></tr></table></div></body></html>
661 Index: libstdc++-v3/doc/html/manual/containers.html
662 ===================================================================
663 --- libstdc++-v3/doc/html/manual/containers.html        (.../tags/gcc_4_8_3_release)    (revision 217117)
664 +++ libstdc++-v3/doc/html/manual/containers.html        (.../branches/gcc-4_8-branch)   (revision 217117)
665 @@ -7,9 +7,10 @@
666    </th><td width="20%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"></a>Chapter 9. 
667    Containers
668    <a id="idm269999493408" class="indexterm"></a>
669 -</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
670 -     Yes it is, and that's okay.  This is a decision that we preserved
671 -     when we imported SGI's STL implementation.  The following is
672 +</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
673 +     Yes it is, and that was okay until the 2011 edition of the C++ standard.
674 +     In future GCC will change it to O(1) but O(N) was a decision that we
675 +     preserved when we imported SGI's STL implementation.  The following is
676       quoted from <a class="link" href="http://www.sgi.com/tech/stl/FAQ.html" target="_top">their FAQ</a>:
677     </p><div class="blockquote"><blockquote class="blockquote"><p>
678         The size() member function, for list and slist, takes time
679 @@ -41,14 +42,4 @@
680          </p><pre class="programlisting">
681          if (L.empty())
682              ...
683 -        </pre></blockquote></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.vector"></a>vector</h3></div></div></div><p>
684 -  </p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.vector.management"></a>Space Overhead Management</h4></div></div></div><p>
685 -     In <a class="link" href="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html" target="_top">this
686 -     message to the list</a>, Daniel Kostecky announced work on an
687 -     alternate form of <code class="code">std::vector</code> that would support
688 -     hints on the number of elements to be over-allocated.  The design
689 -     was also described, along with possible implementation choices.
690 -   </p><p>
691 -     The first two alpha releases were announced <a class="link" href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00048.html" target="_top">here</a>
692 -     and <a class="link" href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html" target="_top">here</a>.
693 -   </p></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="std_contents.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Facets </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Associative</td></tr></table></div></body></html>
694 \ No newline at end of file
695 +        </pre></blockquote></div></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="std_contents.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Facets </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Associative</td></tr></table></div></body></html>
696 Index: libstdc++-v3/doc/html/manual/index.html
697 ===================================================================
698 --- libstdc++-v3/doc/html/manual/index.html     (.../tags/gcc_4_8_3_release)    (revision 217117)
699 +++ libstdc++-v3/doc/html/manual/index.html     (.../branches/gcc-4_8-branch)   (revision 217117)
700 @@ -24,7 +24,7 @@
701  </a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm269999753024">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9. 
702    Containers
703    
704 -</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10. 
705 +</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10. 
706    Iterators
707    
708  </a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11. 
709 @@ -160,4 +160,4 @@
710               </a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
711    Introduction
712    
713 -</td></tr></table></div></body></html>
714 \ No newline at end of file
715 +</td></tr></table></div></body></html>
716 Index: libstdc++-v3/include/std/future
717 ===================================================================
718 --- libstdc++-v3/include/std/future     (.../tags/gcc_4_8_3_release)    (revision 217117)
719 +++ libstdc++-v3/include/std/future     (.../branches/gcc-4_8-branch)   (revision 217117)
720 @@ -351,12 +351,14 @@
721        void
722        _M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
723        {
724 -        bool __set = __ignore_failure;
725 +        bool __set = false;
726          // all calls to this function are serialized,
727          // side-effects of invoking __res only happen once
728          call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
729              ref(__set));
730 -        if (!__set)
731 +       if (__set)
732 +         _M_cond.notify_all();
733 +       else if (!__ignore_failure)
734            __throw_future_error(int(future_errc::promise_already_satisfied));
735        }
736  
737 @@ -471,7 +473,6 @@
738            lock_guard<mutex> __lock(_M_mutex);
739            _M_result.swap(__res);
740          }
741 -        _M_cond.notify_all();
742          __set = true;
743        }
744  
745 @@ -983,22 +984,25 @@
746        void
747        set_value(const _Res& __r)
748        {
749 +       auto __future = _M_future;
750          auto __setter = _State::__setter(this, __r);
751 -        _M_future->_M_set_result(std::move(__setter));
752 +        __future->_M_set_result(std::move(__setter));
753        }
754  
755        void
756        set_value(_Res&& __r)
757        {
758 +       auto __future = _M_future;
759          auto __setter = _State::__setter(this, std::move(__r));
760 -        _M_future->_M_set_result(std::move(__setter));
761 +        __future->_M_set_result(std::move(__setter));
762        }
763  
764        void
765        set_exception(exception_ptr __p)
766        {
767 +       auto __future = _M_future;
768          auto __setter = _State::__setter(__p, this);
769 -        _M_future->_M_set_result(std::move(__setter));
770 +        __future->_M_set_result(std::move(__setter));
771        }
772      };
773  
774 @@ -1081,15 +1085,17 @@
775        void
776        set_value(_Res& __r)
777        {
778 +       auto __future = _M_future;
779          auto __setter = _State::__setter(this, __r);
780 -        _M_future->_M_set_result(std::move(__setter));
781 +        __future->_M_set_result(std::move(__setter));
782        }
783  
784        void
785        set_exception(exception_ptr __p)
786        {
787 +       auto __future = _M_future;
788          auto __setter = _State::__setter(__p, this);
789 -        _M_future->_M_set_result(std::move(__setter));
790 +        __future->_M_set_result(std::move(__setter));
791        }
792      };
793  
794 @@ -1166,8 +1172,9 @@
795        void
796        set_exception(exception_ptr __p)
797        {
798 +       auto __future = _M_future;
799          auto __setter = _State::__setter(__p, this);
800 -        _M_future->_M_set_result(std::move(__setter));
801 +        __future->_M_set_result(std::move(__setter));
802        }
803      };
804  
805 @@ -1193,8 +1200,9 @@
806    inline void
807    promise<void>::set_value()
808    {
809 +    auto __future = _M_future;
810      auto __setter = _State::__setter(this);
811 -    _M_future->_M_set_result(std::move(__setter));
812 +    __future->_M_set_result(std::move(__setter));
813    }
814  
815  
816 Index: libstdc++-v3/include/ext/rope
817 ===================================================================
818 --- libstdc++-v3/include/ext/rope       (.../tags/gcc_4_8_3_release)    (revision 217117)
819 +++ libstdc++-v3/include/ext/rope       (.../branches/gcc-4_8-branch)   (revision 217117)
820 @@ -1544,7 +1544,7 @@
821        typedef typename _Base::allocator_type allocator_type;
822        using _Base::_M_tree_ptr;
823        using _Base::get_allocator;
824 -      using _Base::_M_get_allocator;      
825 +      using _Base::_M_get_allocator;
826        typedef __GC_CONST _CharT* _Cstrptr;
827        
828        static _CharT _S_empty_c_str[1];
829 @@ -1876,8 +1876,9 @@
830            const allocator_type& __a = allocator_type())
831        : _Base(__a)
832        {
833 -       this->_M_tree_ptr = (0 == __len) ?
834 -         0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
835 +       this->_M_tree_ptr = (0 == __len)
836 +         ? 0
837 +         : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
838        }
839  
840        rope(const rope& __x, const allocator_type& __a = allocator_type())
841 Index: libstdc++-v3/include/bits/stl_tree.h
842 ===================================================================
843 --- libstdc++-v3/include/bits/stl_tree.h        (.../tags/gcc_4_8_3_release)    (revision 217117)
844 +++ libstdc++-v3/include/bits/stl_tree.h        (.../branches/gcc-4_8-branch)   (revision 217117)
845 @@ -510,11 +510,11 @@
846  
847        _Link_type
848        _M_end()
849 -      { return static_cast<_Link_type>(&this->_M_impl._M_header); }
850 +      { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
851  
852        _Const_Link_type
853        _M_end() const
854 -      { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
855 +      { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
856  
857        static const_reference
858        _S_value(_Const_Link_type __x)
859 Index: libstdc++-v3/include/tr2/bool_set
860 ===================================================================
861 --- libstdc++-v3/include/tr2/bool_set   (.../tags/gcc_4_8_3_release)    (revision 217117)
862 +++ libstdc++-v3/include/tr2/bool_set   (.../branches/gcc-4_8-branch)   (revision 217117)
863 @@ -44,7 +44,7 @@
864     *  bool_set
865     *
866     *  See N2136, Bool_set: multi-valued logic
867 -   *  by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
868 +   *  by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
869     *
870     *  The implicit conversion to bool is slippery!  I may use the new
871     *  explicit conversion.  This has been specialized in the language
872 Index: libstdc++-v3/ChangeLog
873 ===================================================================
874 --- libstdc++-v3/ChangeLog      (.../tags/gcc_4_8_3_release)    (revision 217117)
875 +++ libstdc++-v3/ChangeLog      (.../branches/gcc-4_8-branch)   (revision 217117)
876 @@ -1,3 +1,96 @@
877 +2014-10-15  Jason Merrill  <jason@redhat.com>
878 +
879 +       * libsupc++/dyncast.cc (__dynamic_cast): Handle mid-destruction
880 +       dynamic_cast more gracefully.
881 +
882 +2014-10-14  Kai Tietz  <ktietz@redhat.com>
883 +
884 +       PR libstdc++/57440
885 +       * config/os/mingw32/os_defines.h (_GTHREAD_USE_MUTEX_INIT_FUNC):
886 +       Define to avoid leak.
887 +       * config/os/mingw32-w64/os_defines.h: Likewise.
888 +
889 +2014-10-03  Jonathan Wakely  <jwakely@redhat.com>
890 +
891 +       PR libstdc++/63449
892 +       * doc/xml/manual/containers.xml: Remove outdated section. Update
893 +       std::list notes.
894 +       * doc/html/*: Regenerate.
895 +
896 +2014-10-01  Jonathan Wakely  <jwakely@redhat.com>
897 +
898 +       * doc/xml/manual/status_cxx2011.xml: Corrections.
899 +       * doc/html/manual/status.html: Regenerate.
900 +
901 +2014-08-28  Samuel Bronson  <naesten@gmail.com>
902 +
903 +       Backport r212453 from trunk
904 +       2014-07-11  Samuel Bronson  <naesten@gmail.com>
905 +                   Matthias Klose  <doko@ubuntu.com>
906 +
907 +       PR libstdc++/58962
908 +       * python/libstdcxx/v6/printers.py: Port to Python 2+3
909 +       (imap): New compat function.
910 +       (izip): Likewise.
911 +       (Iterator): New mixin to allow writing iterators in Python 3 style
912 +       regardless of which version we're running on.
913 +       [Python3] (long) New compat alias for "int".
914 +       * testsuite/lib/gdb-test.exp: Port to Python 2+3 (print syntax)
915 +
916 +       Backport r210625 from trunk
917 +       2014-05-19  Jonathan Wakely  <jwakely@redhat.com>
918 +
919 +       * python/libstdcxx/v6/printers.py: Use Python3 raise syntax.
920 +
921 +2014-08-26  John David Anglin  <danglin@gcc.gnu.org>
922 +
923 +       * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
924 +
925 +2014-08-26  Jonathan Wakely  <jwakely@redhat.com>
926 +
927 +       * doc/xml/manual/status_cxx2011.xml: Correct status table.
928 +       * doc/html/manual/*: Regenerate.
929 +
930 +2014-08-04  Jonathan Wakely  <jwakely@redhat.com>
931 +
932 +       Backported from mainline
933 +       2014-07-29  Jonathan Wakely  <jwakely@redhat.com>
934 +
935 +       PR libstdc++/61946
936 +       * include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
937 +       const allocator_type&)): Pass non-const allocator to
938 +       _S_new_RopeFunction.
939 +       * testsuite/ext/rope/61946.cc: New.
940 +
941 +2014-08-04  Zifei Tong  <zifeitong@gmail.com>
942 +
943 +       * libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
944 +       _GLIBCXX_ prefix to macro.
945 +
946 +2014-06-03  Jonathan Wakely  <jwakely@redhat.com>
947 +
948 +       Backport from mainline
949 +       2014-04-15  Jonathan Wakely  <jwakely@redhat.com>
950 +
951 +       PR libstdc++/60734
952 +       * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
953 +
954 +       Backport from mainline
955 +       2014-05-16  Jonathan Wakely  <jwakely@redhat.com>
956 +
957 +       PR libstdc++/60966
958 +       * include/std/future (__future_base::_State_baseV2::_M_set_result):
959 +       Signal condition variable after call_once returns.
960 +       (__future_base::_State_baseV2::_M_do_set): Do not signal here.
961 +       (promise::set_value, promise::set_exception): Increment the reference
962 +       count on the shared state until the function returns.
963 +       * testsuite/30_threads/promise/60966.cc: New.
964 +
965 +2014-05-29  Jonathan Wakely  <jwakely@redhat.com>
966 +
967 +       * include/tr2/bool_set: Use UTF-8 for accented characters.
968 +       * scripts/run_doxygen: Handle Doxygen 1.8.x change.
969 +
970  2014-05-22  Release Manager
971  
972         * GCC 4.8.3 released.
973 Index: libstdc++-v3/libsupc++/atexit_thread.cc
974 ===================================================================
975 --- libstdc++-v3/libsupc++/atexit_thread.cc     (.../tags/gcc_4_8_3_release)    (revision 217117)
976 +++ libstdc++-v3/libsupc++/atexit_thread.cc     (.../branches/gcc-4_8-branch)   (revision 217117)
977 @@ -26,7 +26,7 @@
978  #include <new>
979  #include "bits/gthr.h"
980  
981 -#if HAVE___CXA_THREAD_ATEXIT_IMPL
982 +#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
983  
984  extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
985                                          void *arg, void *d);
986 @@ -38,7 +38,7 @@
987    return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
988  }
989  
990 -#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
991 +#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
992  
993  namespace {
994    // One element in a singly-linked stack of cleanups.
995 @@ -142,4 +142,4 @@
996    return 0;
997  }
998  
999 -#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
1000 +#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
1001 Index: libstdc++-v3/libsupc++/dyncast.cc
1002 ===================================================================
1003 --- libstdc++-v3/libsupc++/dyncast.cc   (.../tags/gcc_4_8_3_release)    (revision 217117)
1004 +++ libstdc++-v3/libsupc++/dyncast.cc   (.../branches/gcc-4_8-branch)   (revision 217117)
1005 @@ -55,6 +55,18 @@
1006        adjust_pointer <void> (src_ptr, prefix->whole_object);
1007    const __class_type_info *whole_type = prefix->whole_type;
1008    __class_type_info::__dyncast_result result;
1009 +
1010 +  // If the whole object vptr doesn't refer to the whole object type, we're
1011 +  // in the middle of constructing a primary base, and src is a separate
1012 +  // base.  This has undefined behavior and we can't find anything outside
1013 +  // of the base we're actually constructing, so fail now rather than
1014 +  // segfault later trying to use a vbase offset that doesn't exist.
1015 +  const void *whole_vtable = *static_cast <const void *const *> (whole_ptr);
1016 +  const vtable_prefix *whole_prefix =
1017 +    adjust_pointer <vtable_prefix> (whole_vtable,
1018 +                                   -offsetof (vtable_prefix, origin));
1019 +  if (whole_prefix->whole_type != whole_type)
1020 +    return NULL;
1021    
1022    whole_type->__do_dyncast (src2dst, __class_type_info::__contained_public,
1023                              dst_type, whole_ptr, src_type, src_ptr, result);
1024 Index: libstdc++-v3/testsuite/30_threads/promise/60966.cc
1025 ===================================================================
1026 --- libstdc++-v3/testsuite/30_threads/promise/60966.cc  (.../tags/gcc_4_8_3_release)    (revision 0)
1027 +++ libstdc++-v3/testsuite/30_threads/promise/60966.cc  (.../branches/gcc-4_8-branch)   (revision 217117)
1028 @@ -0,0 +1,67 @@
1029 +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
1030 +// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
1031 +// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
1032 +// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
1033 +// { dg-require-cstdint "" }
1034 +// { dg-require-gthreads "" }
1035 +// { dg-require-atomic-builtins "" }
1036 +
1037 +// Copyright (C) 2014 Free Software Foundation, Inc.
1038 +//
1039 +// This file is part of the GNU ISO C++ Library.  This library is free
1040 +// software; you can redistribute it and/or modify it under the
1041 +// terms of the GNU General Public License as published by the
1042 +// Free Software Foundation; either version 3, or (at your option)
1043 +// any later version.
1044 +
1045 +// This library is distributed in the hope that it will be useful,
1046 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1047 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1048 +// GNU General Public License for more details.
1049 +
1050 +// You should have received a copy of the GNU General Public License along
1051 +// with this library; see the file COPYING3.  If not see
1052 +// <http://www.gnu.org/licenses/>.
1053 +
1054 +// libstdc++/60966
1055 +// This test hangs if std::promise::~promise() destroys the
1056 +// shared state before std::promise::set_value() finishes using it.
1057 +
1058 +#include <future>
1059 +#include <thread>
1060 +#include <vector>
1061 +
1062 +const int THREADS = 10;
1063 +
1064 +void run_task(std::promise<void>* pr)
1065 +{
1066 +  std::this_thread::sleep_for(std::chrono::milliseconds(100));
1067 +  pr->set_value();
1068 +}
1069 +
1070 +int main()
1071 +{
1072 +  std::vector<std::promise<void>*> tasks(THREADS);
1073 +  std::vector<std::thread> threads(THREADS);
1074 +  std::vector<std::future<void>> futures(THREADS);
1075 +
1076 +  for (int i = 0; i < THREADS; ++i)
1077 +  {
1078 +    std::promise<void>* task = new std::promise<void>;
1079 +    tasks[i] = task;
1080 +    futures[i] = task->get_future();
1081 +    threads[i] = std::thread(run_task, task);
1082 +  }
1083 +
1084 +  for (int i = 0; i < THREADS; ++i)
1085 +  {
1086 +    // the temporary future releases the state as soon as wait() returns
1087 +    std::future<void>(std::move(futures[i])).wait();
1088 +    // state is ready, should now be safe to delete promise, so it
1089 +    // releases the shared state too
1090 +    delete tasks[i];
1091 +  }
1092 +
1093 +  for (auto& t : threads)
1094 +    t.join();
1095 +}
1096 Index: libstdc++-v3/testsuite/ext/rope/61946.cc
1097 ===================================================================
1098 --- libstdc++-v3/testsuite/ext/rope/61946.cc    (.../tags/gcc_4_8_3_release)    (revision 0)
1099 +++ libstdc++-v3/testsuite/ext/rope/61946.cc    (.../branches/gcc-4_8-branch)   (revision 217117)
1100 @@ -0,0 +1,31 @@
1101 +// Copyright (C) 2014 Free Software Foundation, Inc.
1102 +//
1103 +// This file is part of the GNU ISO C++ Library.  This library is free
1104 +// software; you can redistribute it and/or modify it under the
1105 +// terms of the GNU General Public License as published by the
1106 +// Free Software Foundation; either version 3, or (at your option)
1107 +// any later version.
1108 +
1109 +// This library is distributed in the hope that it will be useful,
1110 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1112 +// GNU General Public License for more details.
1113 +
1114 +// You should have received a copy of the GNU General Public License along
1115 +// with this library; see the file COPYING3.  If not see
1116 +// <http://www.gnu.org/licenses/>.
1117 +
1118 +// { dg-do compile }
1119 +
1120 +#include <ext/rope>
1121 +
1122 +struct empty_char_prod : __gnu_cxx::char_producer<char>
1123 +{
1124 +  virtual void operator()(size_t, size_t, char*) {}
1125 +};
1126 +
1127 +int main ()
1128 +{
1129 +  empty_char_prod* ecp = new empty_char_prod;
1130 +  __gnu_cxx::crope excrope( ecp, 10L, true );
1131 +}
1132 Index: libstdc++-v3/testsuite/lib/gdb-test.exp
1133 ===================================================================
1134 --- libstdc++-v3/testsuite/lib/gdb-test.exp     (.../tags/gcc_4_8_3_release)    (revision 217117)
1135 +++ libstdc++-v3/testsuite/lib/gdb-test.exp     (.../branches/gcc-4_8-branch)   (revision 217117)
1136 @@ -91,7 +91,7 @@
1137         }
1138      }
1139  
1140 -    set do_whatis_tests [gdb_batch_check "python print gdb.type_printers" \
1141 +    set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
1142                            "\\\[\\\]"]
1143      if {!$do_whatis_tests} {
1144         send_log "skipping 'whatis' tests - gdb too old"
1145 @@ -252,6 +252,6 @@
1146  # but not earlier versions.
1147  # Return 1 if the version is ok, 0 otherwise.
1148  proc gdb_version_check {} {
1149 -    return [gdb_batch_check "python print gdb.lookup_global_symbol" \
1150 +    return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
1151               "<built-in function lookup_global_symbol>"]
1152  }
1153 Index: libstdc++-v3/config/os/mingw32-w64/os_defines.h
1154 ===================================================================
1155 --- libstdc++-v3/config/os/mingw32-w64/os_defines.h     (.../tags/gcc_4_8_3_release)    (revision 217117)
1156 +++ libstdc++-v3/config/os/mingw32-w64/os_defines.h     (.../branches/gcc-4_8-branch)   (revision 217117)
1157 @@ -78,4 +78,7 @@
1158  #define _GLIBCXX_LLP64 1
1159  #endif
1160  
1161 +// See libstdc++/59807
1162 +#define _GTHREAD_USE_MUTEX_INIT_FUNC 1
1163 +
1164  #endif
1165 Index: libstdc++-v3/config/os/mingw32/os_defines.h
1166 ===================================================================
1167 --- libstdc++-v3/config/os/mingw32/os_defines.h (.../tags/gcc_4_8_3_release)    (revision 217117)
1168 +++ libstdc++-v3/config/os/mingw32/os_defines.h (.../branches/gcc-4_8-branch)   (revision 217117)
1169 @@ -75,4 +75,7 @@
1170  #define _GLIBCXX_LLP64 1
1171  #endif
1172  
1173 +// See libstdc++/59807
1174 +#define _GTHREAD_USE_MUTEX_INIT_FUNC 1
1175 +
1176  #endif
1177 Index: libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
1178 ===================================================================
1179 --- libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt    (.../tags/gcc_4_8_3_release)    (revision 217117)
1180 +++ libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt    (.../branches/gcc-4_8-branch)   (revision 217117)
1181 @@ -400,6 +400,7 @@
1182  FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE6getlocEv@@GLIBCXX_3.4
1183  FUNC:_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
1184  FUNC:_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
1185 +FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
1186  FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
1187  FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
1188  FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
1189 @@ -587,6 +588,8 @@
1190  FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4
1191  FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4
1192  FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4
1193 +FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEj@@GLIBCXX_3.4.18
1194 +FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEjjj@@GLIBCXX_3.4.18
1195  FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9
1196  FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4
1197  FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4
1198 @@ -1204,6 +1207,7 @@
1199  FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15
1200  FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15
1201  FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15
1202 +FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIxSt5ratioILx1ELx1EEEENS1_IxS2_ILx1ELx1000000000EEEE@@GLIBCXX_3.4.18
1203  FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4
1204  FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1
1205  FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4
1206 @@ -1471,6 +1475,11 @@
1207  FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4
1208  FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4
1209  FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4
1210 +FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18
1211 +FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18
1212 +FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18
1213 +FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18
1214 +FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18
1215  FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4
1216  FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4
1217  FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4
1218 @@ -1900,6 +1909,8 @@
1219  FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
1220  FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
1221  FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
1222 +FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
1223 +FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
1224  FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
1225  FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
1226  FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
1227 @@ -2436,6 +2447,7 @@
1228  FUNC:__cxa_guard_release@@CXXABI_1.3
1229  FUNC:__cxa_pure_virtual@@CXXABI_1.3
1230  FUNC:__cxa_rethrow@@CXXABI_1.3
1231 +FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
1232  FUNC:__cxa_throw@@CXXABI_1.3
1233  FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
1234  FUNC:__cxa_vec_cctor@@CXXABI_1.3
1235 @@ -2482,6 +2494,7 @@
1236  OBJECT:0:CXXABI_1.3.4
1237  OBJECT:0:CXXABI_1.3.5
1238  OBJECT:0:CXXABI_1.3.6
1239 +OBJECT:0:CXXABI_1.3.7
1240  OBJECT:0:CXXABI_TM_1
1241  OBJECT:0:GLIBCXX_3.4
1242  OBJECT:0:GLIBCXX_3.4.1
1243 @@ -2493,6 +2506,8 @@
1244  OBJECT:0:GLIBCXX_3.4.15
1245  OBJECT:0:GLIBCXX_3.4.16
1246  OBJECT:0:GLIBCXX_3.4.17
1247 +OBJECT:0:GLIBCXX_3.4.18
1248 +OBJECT:0:GLIBCXX_3.4.19
1249  OBJECT:0:GLIBCXX_3.4.2
1250  OBJECT:0:GLIBCXX_3.4.3
1251  OBJECT:0:GLIBCXX_3.4.4
1252 @@ -2992,6 +3007,8 @@
1253  OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4
1254  OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4
1255  OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11
1256 +OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19
1257 +OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19
1258  OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11
1259  OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11
1260  OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
1261 Index: configure.ac
1262 ===================================================================
1263 --- configure.ac        (.../tags/gcc_4_8_3_release)    (revision 217117)
1264 +++ configure.ac        (.../branches/gcc-4_8-branch)   (revision 217117)
1265 @@ -1154,6 +1154,9 @@
1266    *-mingw*)
1267      host_makefile_frag="config/mh-mingw"
1268      ;;
1269 +  alpha*-*-linux*)
1270 +    host_makefile_frag="config/mh-alpha-linux"
1271 +    ;;
1272    hppa*-hp-hpux10*)
1273      host_makefile_frag="config/mh-pa-hpux10"
1274      ;;
1275 Index: ChangeLog
1276 ===================================================================
1277 --- ChangeLog   (.../tags/gcc_4_8_3_release)    (revision 217117)
1278 +++ ChangeLog   (.../branches/gcc-4_8-branch)   (revision 217117)
1279 @@ -1,3 +1,9 @@
1280 +2014-07-26  Uros Bizjak  <ubizjak@gmail.com>
1281 +
1282 +       PR target/47230
1283 +       * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
1284 +       * configure: Regenerate.
1285 +
1286  2014-05-22  Release Manager
1287  
1288         * GCC 4.8.3 released.
1289 Index: contrib/ChangeLog
1290 ===================================================================
1291 --- contrib/ChangeLog   (.../tags/gcc_4_8_3_release)    (revision 217117)
1292 +++ contrib/ChangeLog   (.../branches/gcc-4_8-branch)   (revision 217117)
1293 @@ -1,3 +1,7 @@
1294 +2014-07-07  Richard Biener  <rguenther@suse.de>
1295 +
1296 +        * gennews: Use gcc-3.0/index.html.
1297 +
1298  2014-05-22  Release Manager
1299  
1300         * GCC 4.8.3 released.
1301 Index: contrib/gennews
1302 ===================================================================
1303 --- contrib/gennews     (.../tags/gcc_4_8_3_release)    (revision 217117)
1304 +++ contrib/gennews     (.../branches/gcc-4_8-branch)   (revision 217117)
1305 @@ -37,7 +37,7 @@
1306      gcc-3.3/index.html gcc-3.3/changes.html
1307      gcc-3.2/index.html gcc-3.2/changes.html
1308      gcc-3.1/index.html gcc-3.1/changes.html
1309 -    gcc-3.0/gcc-3.0.html gcc-3.0/features.html gcc-3.0/caveats.html
1310 +    gcc-3.0/index.html gcc-3.0/features.html gcc-3.0/caveats.html
1311      gcc-2.95/index.html gcc-2.95/features.html gcc-2.95/caveats.html
1312      egcs-1.1/index.html egcs-1.1/features.html egcs-1.1/caveats.html
1313      egcs-1.0/index.html egcs-1.0/features.html egcs-1.0/caveats.html"
1314 Index: config/mh-alpha-linux
1315 ===================================================================
1316 --- config/mh-alpha-linux       (.../tags/gcc_4_8_3_release)    (revision 0)
1317 +++ config/mh-alpha-linux       (.../branches/gcc-4_8-branch)   (revision 217117)
1318 @@ -0,0 +1,3 @@
1319 +# Prevent GPREL16 relocation truncation
1320 +LDFLAGS += -Wl,--no-relax
1321 +BOOT_LDFLAGS += -Wl,--no-relax
1322 Index: config/ChangeLog
1323 ===================================================================
1324 --- config/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
1325 +++ config/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
1326 @@ -1,3 +1,8 @@
1327 +2014-07-26  Uros Bizjak  <ubizjak@gmail.com>
1328 +
1329 +       PR target/47230
1330 +       * mh-alpha-linux: New file.
1331 +
1332  2014-05-22  Release Manager
1333  
1334         * GCC 4.8.3 released.
1335 Index: libjava/classpath
1336 ===================================================================
1337 --- libjava/classpath   (.../tags/gcc_4_8_3_release)    (revision 217117)
1338 +++ libjava/classpath   (.../branches/gcc-4_8-branch)   (revision 217117)
1339
1340 Property changes on: libjava/classpath
1341 ___________________________________________________________________
1342 Modified: svn:mergeinfo
1343    Merged /trunk/libjava/classpath:r211733,215049
1344 Index: configure
1345 ===================================================================
1346 --- configure   (.../tags/gcc_4_8_3_release)    (revision 217117)
1347 +++ configure   (.../branches/gcc-4_8-branch)   (revision 217117)
1348 @@ -3834,6 +3834,9 @@
1349    *-mingw*)
1350      host_makefile_frag="config/mh-mingw"
1351      ;;
1352 +  alpha*-*-linux*)
1353 +    host_makefile_frag="config/mh-alpha-linux"
1354 +    ;;
1355    hppa*-hp-hpux10*)
1356      host_makefile_frag="config/mh-pa-hpux10"
1357      ;;
1358 Index: libgcc/ChangeLog
1359 ===================================================================
1360 --- libgcc/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
1361 +++ libgcc/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
1362 @@ -1,3 +1,14 @@
1363 +2014-10-26  John David Anglin  <danglin@gcc.gnu.org>
1364 +
1365 +       * config/pa/linux-unwind.h (pa32_read_access_ok): New function.
1366 +       (pa32_fallback_frame_state): Use pa32_read_access_ok to check if
1367 +       memory read accesses are ok.
1368 +
1369 +2014-09-18  Joseph Myers  <joseph@codesourcery.com>
1370 +
1371 +       * config/i386/sfp-machine.h (FP_TRAPPING_EXCEPTIONS): Treat clear
1372 +       bits not set bits as indicating trapping exceptions.
1373 +
1374  2014-05-22  Release Manager
1375  
1376         * GCC 4.8.3 released.
1377 Index: libgcc/config/i386/sfp-machine.h
1378 ===================================================================
1379 --- libgcc/config/i386/sfp-machine.h    (.../tags/gcc_4_8_3_release)    (revision 217117)
1380 +++ libgcc/config/i386/sfp-machine.h    (.../branches/gcc-4_8-branch)   (revision 217117)
1381 @@ -59,7 +59,7 @@
1382        __sfp_handle_exceptions (_fex);          \
1383    } while (0);
1384  
1385 -#define FP_TRAPPING_EXCEPTIONS ((_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
1386 +#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
1387  
1388  #define FP_ROUNDMODE           (_fcw & FP_RND_MASK)
1389  #endif
1390 Index: libgcc/config/pa/linux-unwind.h
1391 ===================================================================
1392 --- libgcc/config/pa/linux-unwind.h     (.../tags/gcc_4_8_3_release)    (revision 217117)
1393 +++ libgcc/config/pa/linux-unwind.h     (.../branches/gcc-4_8-branch)   (revision 217117)
1394 @@ -32,6 +32,17 @@
1395  #include <signal.h>
1396  #include <sys/ucontext.h>
1397  
1398 +/* Return TRUE if read access to *P is allowed.  */
1399 +
1400 +static inline long
1401 +pa32_read_access_ok (void *p)
1402 +{
1403 +  long ret;
1404 +
1405 +  __asm__ ("proberi (%1),3,%0" : "=r" (ret) : "r" (p) :);
1406 +  return ret;
1407 +}
1408 +
1409  /* Unfortunately, because of various bugs and changes to the kernel,
1410     we have several cases to deal with.
1411  
1412 @@ -48,8 +59,13 @@
1413     tell us how to locate the sigcontext structure.
1414  
1415     Note that with a 2.4 64-bit kernel, the signal context is not properly
1416 -   passed back to userspace so the unwind will not work correctly.  */
1417 +   passed back to userspace so the unwind will not work correctly.
1418  
1419 +   There is also a bug in various glibc versions.  The (CONTEXT)->ra
1420 +   for the outermost frame is not marked as undefined, so we need to
1421 +   check whether read access is allowed for all the accesses used in
1422 +   searching for the signal trampoline.  */
1423 +
1424  #define MD_FALLBACK_FRAME_STATE_FOR pa32_fallback_frame_state
1425  
1426  static _Unwind_Reason_Code
1427 @@ -73,14 +89,17 @@
1428       e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31
1429       08000240 nop  */
1430  
1431 -  if (pc[0] == 0x34190000 || pc[0] == 0x34190002)
1432 +  if (pa32_read_access_ok (pc)
1433 +      && (pc[0] == 0x34190000 || pc[0] == 0x34190002))
1434      off = 4*4;
1435 -  else if (pc[4] == 0x34190000 || pc[4] == 0x34190002)
1436 +  else if (pa32_read_access_ok (&pc[4])
1437 +          && (pc[4] == 0x34190000 || pc[4] == 0x34190002))
1438      {
1439        pc += 4;
1440        off = 10 * 4;
1441      }
1442 -  else if (pc[5] == 0x34190000 || pc[5] == 0x34190002)
1443 +  else if (pa32_read_access_ok (&pc[5])
1444 +          && (pc[5] == 0x34190000 || pc[5] == 0x34190002))
1445      {
1446        pc += 5;
1447        off = 10 * 4;
1448 @@ -96,13 +115,16 @@
1449          word boundary and we can then determine the frame offset.  */
1450        sp = (unsigned long)context->ra;
1451        pc = (unsigned int *)sp;
1452 -      if ((pc[0] == 0x34190000 || pc[0] == 0x34190002) && (sp & 4))
1453 +      if ((sp & 4)
1454 +         && pa32_read_access_ok (pc)
1455 +         && (pc[0] == 0x34190000 || pc[0] == 0x34190002))
1456         off = 5 * 4;
1457        else
1458         return _URC_END_OF_STACK;
1459      }
1460  
1461 -  if (pc[1] != 0x3414015a
1462 +  if (!pa32_read_access_ok (&pc[3])
1463 +      || pc[1] != 0x3414015a
1464        || pc[2] != 0xe4008200
1465        || pc[3] != 0x08000240)
1466      return _URC_END_OF_STACK;
1467 Index: gcc/doc/sourcebuild.texi
1468 ===================================================================
1469 --- gcc/doc/sourcebuild.texi    (.../tags/gcc_4_8_3_release)    (revision 217117)
1470 +++ gcc/doc/sourcebuild.texi    (.../branches/gcc-4_8-branch)   (revision 217117)
1471 @@ -1299,6 +1299,9 @@
1472  @item double64plus
1473  Target has @code{double} that is 64 bits or longer.
1474  
1475 +@item longdouble128
1476 +Target has 128-bit @code{long double}.
1477 +
1478  @item int32plus
1479  Target has @code{int} that is at 32 bits or longer.
1480  
1481 Index: gcc/doc/extend.texi
1482 ===================================================================
1483 --- gcc/doc/extend.texi (.../tags/gcc_4_8_3_release)    (revision 217117)
1484 +++ gcc/doc/extend.texi (.../branches/gcc-4_8-branch)   (revision 217117)
1485 @@ -375,6 +375,8 @@
1486  This is more friendly to code living in shared libraries, as it reduces
1487  the number of dynamic relocations that are needed, and by consequence,
1488  allows the data to be read-only.
1489 +This alternative with label differences is not supported for the AVR target,
1490 +please use the first approach for AVR programs.
1491  
1492  The @code{&&foo} expressions for the same label might have different
1493  values if the containing function is inlined or cloned.  If a program
1494 @@ -10490,7 +10492,7 @@
1495  name.
1496  
1497  @smallexample
1498 -v32qi __builtin_ia32_mpsadbw256 (v32qi,v32qi,v32qi,int)
1499 +v32qi __builtin_ia32_mpsadbw256 (v32qi,v32qi,int)
1500  v32qi __builtin_ia32_pabsb256 (v32qi)
1501  v16hi __builtin_ia32_pabsw256 (v16hi)
1502  v8si __builtin_ia32_pabsd256 (v8si)
1503 @@ -10725,8 +10727,8 @@
1504  @smallexample
1505  v2df __builtin_ia32_vfrczpd (v2df)
1506  v4sf __builtin_ia32_vfrczps (v4sf)
1507 -v2df __builtin_ia32_vfrczsd (v2df, v2df)
1508 -v4sf __builtin_ia32_vfrczss (v4sf, v4sf)
1509 +v2df __builtin_ia32_vfrczsd (v2df)
1510 +v4sf __builtin_ia32_vfrczss (v4sf)
1511  v4df __builtin_ia32_vfrczpd256 (v4df)
1512  v8sf __builtin_ia32_vfrczps256 (v8sf)
1513  v2di __builtin_ia32_vpcmov (v2di, v2di, v2di)
1514 @@ -11855,8 +11857,6 @@
1515  uint64_t __builtin_ppc_get_timebase ();
1516  unsigned long __builtin_ppc_mftb ();
1517  double __builtin_unpack_longdouble (long double, int);
1518 -double __builtin_longdouble_dw0 (long double);
1519 -double __builtin_longdouble_dw1 (long double);
1520  long double __builtin_pack_longdouble (double, double);
1521  @end smallexample
1522  
1523 Index: gcc/doc/tm.texi
1524 ===================================================================
1525 --- gcc/doc/tm.texi     (.../tags/gcc_4_8_3_release)    (revision 217117)
1526 +++ gcc/doc/tm.texi     (.../branches/gcc-4_8-branch)   (revision 217117)
1527 @@ -3930,6 +3930,13 @@
1528  @c above is overfull.  not sure what to do.  --mew 5feb93  did
1529  @c something, not sure if it looks good.  --mew 10feb93
1530  
1531 +@defmac INCOMING_REG_PARM_STACK_SPACE (@var{fndecl})
1532 +Like @code{REG_PARM_STACK_SPACE}, but for incoming register arguments.
1533 +Define this macro if space guaranteed when compiling a function body
1534 +is different to space required when making a call, a situation that
1535 +can arise with K&R style function definitions.
1536 +@end defmac
1537 +
1538  @defmac OUTGOING_REG_PARM_STACK_SPACE (@var{fntype})
1539  Define this to a nonzero value if it is the responsibility of the
1540  caller to allocate the area reserved for arguments passed in registers
1541 Index: gcc/doc/tm.texi.in
1542 ===================================================================
1543 --- gcc/doc/tm.texi.in  (.../tags/gcc_4_8_3_release)    (revision 217117)
1544 +++ gcc/doc/tm.texi.in  (.../branches/gcc-4_8-branch)   (revision 217117)
1545 @@ -3898,6 +3898,13 @@
1546  @c above is overfull.  not sure what to do.  --mew 5feb93  did
1547  @c something, not sure if it looks good.  --mew 10feb93
1548  
1549 +@defmac INCOMING_REG_PARM_STACK_SPACE (@var{fndecl})
1550 +Like @code{REG_PARM_STACK_SPACE}, but for incoming register arguments.
1551 +Define this macro if space guaranteed when compiling a function body
1552 +is different to space required when making a call, a situation that
1553 +can arise with K&R style function definitions.
1554 +@end defmac
1555 +
1556  @defmac OUTGOING_REG_PARM_STACK_SPACE (@var{fntype})
1557  Define this to a nonzero value if it is the responsibility of the
1558  caller to allocate the area reserved for arguments passed in registers
1559 Index: gcc/doc/invoke.texi
1560 ===================================================================
1561 --- gcc/doc/invoke.texi (.../tags/gcc_4_8_3_release)    (revision 217117)
1562 +++ gcc/doc/invoke.texi (.../branches/gcc-4_8-branch)   (revision 217117)
1563 @@ -475,6 +475,7 @@
1564  -mstrict-align @gol
1565  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
1566  -mtls-dialect=desc  -mtls-dialect=traditional @gol
1567 +-mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
1568  -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
1569  
1570  @emph{Adapteva Epiphany Options}
1571 @@ -1009,6 +1010,7 @@
1572  -ffixed-@var{reg}  -fexceptions @gol
1573  -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1574  -fasynchronous-unwind-tables @gol
1575 +-fno-gnu-unique @gol
1576  -finhibit-size-directive  -finstrument-functions @gol
1577  -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1578  -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1579 @@ -10933,6 +10935,14 @@
1580  Use traditional TLS as the thread-local storage mechanism for dynamic accesses
1581  of TLS variables.
1582  
1583 +@item -mfix-cortex-a53-835769
1584 +@itemx -mno-fix-cortex-a53-835769
1585 +@opindex -mfix-cortex-a53-835769
1586 +@opindex -mno-fix-cortex-a53-835769
1587 +Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
1588 +This will involve inserting a NOP instruction between memory instructions and
1589 +64-bit integer multiply-accumulate instructions.
1590 +
1591  @item -march=@var{name}
1592  @opindex march
1593  Specify the name of the target architecture, optionally suffixed by one or
1594 @@ -11271,8 +11281,8 @@
1595  
1596  @option{-march=native} causes the compiler to auto-detect the architecture
1597  of the build computer.  At present, this feature is only supported on
1598 -Linux, and not all architectures are recognized.  If the auto-detect is
1599 -unsuccessful the option has no effect.
1600 +GNU/Linux, and not all architectures are recognized.  If the auto-detect
1601 +is unsuccessful the option has no effect.
1602  
1603  @item -mtune=@var{name}
1604  @opindex mtune
1605 @@ -11317,7 +11327,7 @@
1606  
1607  @option{-mtune=native} causes the compiler to auto-detect the CPU
1608  of the build computer.  At present, this feature is only supported on
1609 -Linux, and not all architectures are recognized.  If the auto-detect is
1610 +GNU/Linux, and not all architectures are recognized.  If the auto-detect is
1611  unsuccessful the option has no effect.
1612  
1613  @item -mcpu=@var{name}
1614 @@ -11338,8 +11348,8 @@
1615  
1616  @option{-mcpu=native} causes the compiler to auto-detect the CPU
1617  of the build computer.  At present, this feature is only supported on
1618 -Linux, and not all architectures are recognized.  If the auto-detect is
1619 -unsuccessful the option has no effect.
1620 +GNU/Linux, and not all architectures are recognized.  If the auto-detect
1621 +is unsuccessful the option has no effect.
1622  
1623  @item -mfpu=@var{name}
1624  @opindex mfpu
1625 @@ -12479,7 +12489,7 @@
1626  @item -mkernel
1627  @opindex mkernel
1628  Enable kernel development mode.  The @option{-mkernel} option sets
1629 -@option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
1630 +@option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
1631  @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
1632  @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
1633  applicable.  This mode also sets @option{-mno-altivec},
1634 @@ -18707,6 +18717,72 @@
1635  @opindex m4
1636  Generate code for the SH4.
1637  
1638 +@item -m4-100
1639 +@opindex m4-100
1640 +Generate code for SH4-100.
1641 +
1642 +@item -m4-100-nofpu
1643 +@opindex m4-100-nofpu
1644 +Generate code for SH4-100 in such a way that the
1645 +floating-point unit is not used.
1646 +
1647 +@item -m4-100-single
1648 +@opindex m4-100-single
1649 +Generate code for SH4-100 assuming the floating-point unit is in
1650 +single-precision mode by default.
1651 +
1652 +@item -m4-100-single-only
1653 +@opindex m4-100-single-only
1654 +Generate code for SH4-100 in such a way that no double-precision
1655 +floating-point operations are used.
1656 +
1657 +@item -m4-200
1658 +@opindex m4-200
1659 +Generate code for SH4-200.
1660 +
1661 +@item -m4-200-nofpu
1662 +@opindex m4-200-nofpu
1663 +Generate code for SH4-200 without in such a way that the
1664 +floating-point unit is not used.
1665 +
1666 +@item -m4-200-single
1667 +@opindex m4-200-single
1668 +Generate code for SH4-200 assuming the floating-point unit is in
1669 +single-precision mode by default.
1670 +
1671 +@item -m4-200-single-only
1672 +@opindex m4-200-single-only
1673 +Generate code for SH4-200 in such a way that no double-precision
1674 +floating-point operations are used.
1675 +
1676 +@item -m4-300
1677 +@opindex m4-300
1678 +Generate code for SH4-300.
1679 +
1680 +@item -m4-300-nofpu
1681 +@opindex m4-300-nofpu
1682 +Generate code for SH4-300 without in such a way that the
1683 +floating-point unit is not used.
1684 +
1685 +@item -m4-300-single
1686 +@opindex m4-300-single
1687 +Generate code for SH4-300 in such a way that no double-precision
1688 +floating-point operations are used.
1689 +
1690 +@item -m4-300-single-only
1691 +@opindex m4-300-single-only
1692 +Generate code for SH4-300 in such a way that no double-precision
1693 +floating-point operations are used.
1694 +
1695 +@item -m4-340
1696 +@opindex m4-340
1697 +Generate code for SH4-340 (no MMU, no FPU).
1698 +
1699 +@item -m4-500
1700 +@opindex m4-500
1701 +Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
1702 +assembler.
1703 +
1704  @item -m4a-nofpu
1705  @opindex m4a-nofpu
1706  Generate code for the SH4al-dsp, or for a SH4a in such a way that the
1707 @@ -18732,6 +18808,33 @@
1708  @option{-dsp} to the assembler.  GCC doesn't generate any DSP
1709  instructions at the moment.
1710  
1711 +@item -m5-32media
1712 +@opindex m5-32media
1713 +Generate 32-bit code for SHmedia.
1714 +
1715 +@item -m5-32media-nofpu
1716 +@opindex m5-32media-nofpu
1717 +Generate 32-bit code for SHmedia in such a way that the
1718 +floating-point unit is not used.
1719 +
1720 +@item -m5-64media
1721 +@opindex m5-64media
1722 +Generate 64-bit code for SHmedia.
1723 +
1724 +@item -m5-64media-nofpu
1725 +@opindex m5-64media-nofpu
1726 +Generate 64-bit code for SHmedia in such a way that the
1727 +floating-point unit is not used.
1728 +
1729 +@item -m5-compact
1730 +@opindex m5-compact
1731 +Generate code for SHcompact.
1732 +
1733 +@item -m5-compact-nofpu
1734 +@opindex m5-compact-nofpu
1735 +Generate code for SHcompact in such a way that the
1736 +floating-point unit is not used.
1737 +
1738  @item -mb
1739  @opindex mb
1740  Compile code for the processor in big-endian mode.
1741 @@ -18765,16 +18868,12 @@
1742  Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
1743  alignment constraints.
1744  
1745 -@item -mhitachi
1746 -@opindex mhitachi
1747 -Comply with the calling conventions defined by Renesas.
1748 -
1749  @item -mrenesas
1750 -@opindex mhitachi
1751 +@opindex mrenesas
1752  Comply with the calling conventions defined by Renesas.
1753  
1754  @item -mno-renesas
1755 -@opindex mhitachi
1756 +@opindex mno-renesas
1757  Comply with the calling conventions defined for GCC before the Renesas
1758  conventions were available.  This option is the default for all
1759  targets of the SH toolchain.
1760 @@ -18782,12 +18881,12 @@
1761  @item -mnomacsave
1762  @opindex mnomacsave
1763  Mark the @code{MAC} register as call-clobbered, even if
1764 -@option{-mhitachi} is given.
1765 +@option{-mrenesas} is given.
1766  
1767  @item -mieee
1768  @itemx -mno-ieee
1769  @opindex mieee
1770 -@opindex mnoieee
1771 +@opindex mno-ieee
1772  Control the IEEE compliance of floating-point comparisons, which affects the
1773  handling of cases where the result of a comparison is unordered.  By default
1774  @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
1775 @@ -18827,7 +18926,7 @@
1776  
1777  @item none
1778  Disable compiler generated atomic sequences and emit library calls for atomic
1779 -operations.  This is the default if the target is not @code{sh-*-linux*}.
1780 +operations.  This is the default if the target is not @code{sh*-*-linux*}.
1781  
1782  @item soft-gusa
1783  Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
1784 @@ -18834,7 +18933,7 @@
1785  built-in functions.  The generated atomic sequences require additional support
1786  from the interrupt/exception handling code of the system and are only suitable
1787  for SH3* and SH4* single-core systems.  This option is enabled by default when
1788 -the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
1789 +the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
1790  this option will also partially utilize the hardware atomic instructions
1791  @code{movli.l} and @code{movco.l} to create more efficient code, unless
1792  @samp{strict} is specified.  
1793 @@ -18853,7 +18952,7 @@
1794  in privileged mode and is only suitable for single-core systems.  Additional
1795  support from the interrupt/exception handling code of the system is not
1796  required.  This model is enabled by default when the target is
1797 -@code{sh-*-linux*} and SH1* or SH2*.
1798 +@code{sh*-*-linux*} and SH1* or SH2*.
1799  
1800  @item hard-llcs
1801  Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
1802 @@ -18888,10 +18987,6 @@
1803  processors the @code{tas.b} instruction must be used with caution since it
1804  can result in data corruption for certain cache configurations.
1805  
1806 -@item -mspace
1807 -@opindex mspace
1808 -Optimize for space instead of speed.  Implied by @option{-Os}.
1809 -
1810  @item -mprefergot
1811  @opindex mprefergot
1812  When generating position-independent code, emit function calls using
1813 @@ -18898,11 +18993,14 @@
1814  the Global Offset Table instead of the Procedure Linkage Table.
1815  
1816  @item -musermode
1817 +@itemx -mno-usermode
1818  @opindex musermode
1819 -Don't generate privileged mode only code.  This option
1820 -implies @option{-mno-inline-ic_invalidate}
1821 -if the inlined code would not work in user mode.
1822 -This is the default when the target is @code{sh-*-linux*}.
1823 +@opindex mno-usermode
1824 +Don't allow (allow) the compiler generating privileged mode code.  Specifying
1825 +@option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
1826 +inlined code would not work in user mode.  @option{-musermode} is the default
1827 +when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
1828 +@option{-musermode} has no effect, since there is no user mode.
1829  
1830  @item -multcost=@var{number}
1831  @opindex multcost=@var{number}
1832 @@ -20357,6 +20455,20 @@
1833  table is exact at each instruction boundary, so it can be used for stack
1834  unwinding from asynchronous events (such as debugger or garbage collector).
1835  
1836 +@item -fno-gnu-unique
1837 +@opindex fno-gnu-unique
1838 +On systems with recent GNU assembler and C library, the C++ compiler
1839 +uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
1840 +of template static data members and static local variables in inline
1841 +functions are unique even in the presence of @code{RTLD_LOCAL}; this
1842 +is necessary to avoid problems with a library used by two different
1843 +@code{RTLD_LOCAL} plugins depending on a definition in one of them and
1844 +therefore disagreeing with the other one about the binding of the
1845 +symbol.  But this causes @code{dlclose} to be ignored for affected
1846 +DSOs; if your program relies on reinitialization of a DSO via
1847 +@code{dlclose} and @code{dlopen}, you can use
1848 +@option{-fno-gnu-unique}.
1849 +
1850  @item -fpcc-struct-return
1851  @opindex fpcc-struct-return
1852  Return ``short'' @code{struct} and @code{union} values in memory like
1853 Index: gcc/doc/md.texi
1854 ===================================================================
1855 --- gcc/doc/md.texi     (.../tags/gcc_4_8_3_release)    (revision 217117)
1856 +++ gcc/doc/md.texi     (.../branches/gcc-4_8-branch)   (revision 217117)
1857 @@ -2081,6 +2081,18 @@
1858  @item wg
1859  If @option{-mmfpgpr} was used, a floating point register or NO_REGS.
1860  
1861 +@item wh
1862 +Floating point register if direct moves are available, or NO_REGS.
1863 +
1864 +@item wi
1865 +FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.
1866 +
1867 +@item wj
1868 +FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.
1869 +
1870 +@item wk
1871 +FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.
1872 +
1873  @item wl
1874  Floating point register if the LFIWAX instruction is enabled or NO_REGS.
1875  
1876 @@ -2112,7 +2124,7 @@
1877  Floating point register if the STFIWX instruction is enabled or NO_REGS.
1878  
1879  @item wy
1880 -VSX vector register to hold scalar float values or NO_REGS.
1881 +FP or VSX register to perform ISA 2.07 float ops or NO_REGS.
1882  
1883  @item wz
1884  Floating point register if the LFIWZX instruction is enabled or NO_REGS.
1885 Index: gcc/doc/install.texi
1886 ===================================================================
1887 --- gcc/doc/install.texi        (.../tags/gcc_4_8_3_release)    (revision 217117)
1888 +++ gcc/doc/install.texi        (.../branches/gcc-4_8-branch)   (revision 217117)
1889 @@ -2915,12 +2915,6 @@
1890  Solaris 2 (SPARC, Intel):
1891  @itemize
1892  @item
1893 -@uref{http://www.sunfreeware.com/,,Sunfreeware}
1894 -
1895 -@item
1896 -@uref{http://www.blastwave.org/,,Blastwave}
1897 -
1898 -@item
1899  @uref{http://www.opencsw.org/,,OpenCSW}
1900  
1901  @item
1902 @@ -2988,6 +2982,8 @@
1903  @ifhtml
1904  @itemize
1905  @item
1906 +@uref{#aarch64x-x-x,,aarch64*-*-*}
1907 +@item
1908  @uref{#alpha-x-x,,alpha*-*-*}
1909  @item
1910  @uref{#alpha-dec-osf51,,alpha*-dec-osf5.1}
1911 @@ -3130,6 +3126,18 @@
1912  <!-- -------- host/target specific issues start here ---------------- -->
1913  <hr />
1914  @end html
1915 +
1916 +@heading @anchor{aarch64x-x-x}aarch64*-*-*
1917 +To enable a workaround for the Cortex-A53 erratum number 835769 by default
1918 +(for all CPUs regardless of -mcpu option given) at configure time use the
1919 +@option{--enable-fix-cortex-a53-835769} option.  This will enable the fix by
1920 +default and can be explicitly disabled during during compilation by passing the
1921 +@option{-mno-fix-cortex-a53-835769} option.  Conversely,
1922 +@option{--disable-fix-cortex-a53-835769} will disable the workaround by
1923 +default.  The workaround is disabled by default if neither of
1924 +@option{--enable-fix-cortex-a53-835769} or
1925 +@option{--disable-fix-cortex-a53-835769} is given at configure time.
1926 +
1927  @heading @anchor{alpha-x-x}alpha*-*-*
1928  
1929  This section contains general configuration information for all
1930 Index: gcc/tree-ssa-tail-merge.c
1931 ===================================================================
1932 --- gcc/tree-ssa-tail-merge.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
1933 +++ gcc/tree-ssa-tail-merge.c   (.../branches/gcc-4_8-branch)   (revision 217117)
1934 @@ -1060,6 +1060,24 @@
1935      gcc_unreachable ();
1936  }
1937  
1938 +/* Return true if gimple operands T1 and T2 have the same value.  */
1939 +
1940 +static bool
1941 +gimple_operand_equal_value_p (tree t1, tree t2)
1942 +{
1943 +  if (t1 == t2)
1944 +    return true;
1945 +
1946 +  if (t1 == NULL_TREE
1947 +      || t2 == NULL_TREE)
1948 +    return false;
1949 +
1950 +  if (operand_equal_p (t1, t2, 0))
1951 +    return true;
1952 +
1953 +  return gvn_uses_equal (t1, t2);
1954 +}
1955 +
1956  /* Return true if gimple statements S1 and S2 are equal.  Gimple_bb (s1) and
1957     gimple_bb (s2) are members of SAME_SUCC.  */
1958  
1959 @@ -1122,8 +1140,9 @@
1960        lhs2 = gimple_get_lhs (s2);
1961        if (TREE_CODE (lhs1) != SSA_NAME
1962           && TREE_CODE (lhs2) != SSA_NAME)
1963 -       return (vn_valueize (gimple_vdef (s1))
1964 -               == vn_valueize (gimple_vdef (s2)));
1965 +       return (operand_equal_p (lhs1, lhs2, 0)
1966 +               && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
1967 +                                                gimple_assign_rhs1 (s2)));
1968        else if (TREE_CODE (lhs1) == SSA_NAME
1969                && TREE_CODE (lhs2) == SSA_NAME)
1970         return vn_valueize (lhs1) == vn_valueize (lhs2);
1971 Index: gcc/DATESTAMP
1972 ===================================================================
1973 --- gcc/DATESTAMP       (.../tags/gcc_4_8_3_release)    (revision 217117)
1974 +++ gcc/DATESTAMP       (.../branches/gcc-4_8-branch)   (revision 217117)
1975 @@ -1 +1 @@
1976 -20140522
1977 +20141105
1978 Index: gcc/ipa-cp.c
1979 ===================================================================
1980 --- gcc/ipa-cp.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
1981 +++ gcc/ipa-cp.c        (.../branches/gcc-4_8-branch)   (revision 217117)
1982 @@ -447,6 +447,8 @@
1983    else if (!opt_for_fn (node->symbol.decl, optimize)
1984            || !opt_for_fn (node->symbol.decl, flag_ipa_cp))
1985      reason = "non-optimized function";
1986 +  else if (node->tm_clone)
1987 +    reason = "transactional memory clone";
1988  
1989    if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
1990      fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
1991 @@ -2902,6 +2904,11 @@
1992                 intersect_with_agg_replacements (cs->caller, src_idx,
1993                                                  &inter, 0);
1994             }
1995 +         else
1996 +           {
1997 +             inter.release ();
1998 +             return vNULL;
1999 +           }
2000         }
2001        else
2002         {
2003 @@ -2917,6 +2924,11 @@
2004               else
2005                 intersect_with_plats (src_plats, &inter, 0);
2006             }
2007 +         else
2008 +           {
2009 +             inter.release ();
2010 +             return vNULL;
2011 +           }
2012         }
2013      }
2014    else if (jfunc->type == IPA_JF_ANCESTOR
2015 @@ -3000,7 +3012,8 @@
2016                                           vec<cgraph_edge_p> callers)
2017  {
2018    struct ipa_node_params *dest_info = IPA_NODE_REF (node);
2019 -  struct ipa_agg_replacement_value *res = NULL;
2020 +  struct ipa_agg_replacement_value *res;
2021 +  struct ipa_agg_replacement_value **tail = &res;
2022    struct cgraph_edge *cs;
2023    int i, j, count = ipa_get_param_count (dest_info);
2024  
2025 @@ -3044,8 +3057,8 @@
2026           v->offset = item->offset;
2027           v->value = item->value;
2028           v->by_ref = plats->aggs_by_ref;
2029 -         v->next = res;
2030 -         res = v;
2031 +         *tail = v;
2032 +         tail = &v->next;
2033         }
2034  
2035      next_param:
2036 @@ -3052,6 +3065,7 @@
2037        if (inter.exists ())
2038         inter.release ();
2039      }
2040 +  *tail = NULL;
2041    return res;
2042  }
2043  
2044 @@ -3060,7 +3074,8 @@
2045  static struct ipa_agg_replacement_value *
2046  known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function_t> known_aggs)
2047  {
2048 -  struct ipa_agg_replacement_value *res = NULL;
2049 +  struct ipa_agg_replacement_value *res;
2050 +  struct ipa_agg_replacement_value **tail = &res;
2051    struct ipa_agg_jump_function *aggjf;
2052    struct ipa_agg_jf_item *item;
2053    int i, j;
2054 @@ -3074,9 +3089,10 @@
2055         v->offset = item->offset;
2056         v->value = item->value;
2057         v->by_ref = aggjf->by_ref;
2058 -       v->next = res;
2059 -       res = v;
2060 +       *tail = v;
2061 +       tail = &v->next;
2062        }
2063 +  *tail = NULL;
2064    return res;
2065  }
2066  
2067 Index: gcc/configure
2068 ===================================================================
2069 --- gcc/configure       (.../tags/gcc_4_8_3_release)    (revision 217117)
2070 +++ gcc/configure       (.../branches/gcc-4_8-branch)   (revision 217117)
2071 @@ -910,6 +910,7 @@
2072  enable_gnu_indirect_function
2073  enable_initfini_array
2074  enable_comdat
2075 +enable_fix_cortex_a53_835769
2076  enable_gnu_unique_object
2077  enable_linker_build_id
2078  with_long_double_128
2079 @@ -1619,6 +1620,14 @@
2080                            glibc systems
2081    --enable-initfini-array      use .init_array/.fini_array sections
2082    --enable-comdat         enable COMDAT group support
2083 +
2084 +  --enable-fix-cortex-a53-835769
2085 +                          enable workaround for AArch64 Cortex-A53 erratum
2086 +                          835769 by default
2087 +  --disable-fix-cortex-a53-835769
2088 +                          disable workaround for AArch64 Cortex-A53 erratum
2089 +                          835769 by default
2090 +
2091    --enable-gnu-unique-object
2092                            enable the use of the @gnu_unique_object ELF
2093                            extension on glibc systems
2094 @@ -17838,7 +17847,7 @@
2095    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2096    lt_status=$lt_dlunknown
2097    cat > conftest.$ac_ext <<_LT_EOF
2098 -#line 17841 "configure"
2099 +#line 17850 "configure"
2100  #include "confdefs.h"
2101  
2102  #if HAVE_DLFCN_H
2103 @@ -17944,7 +17953,7 @@
2104    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2105    lt_status=$lt_dlunknown
2106    cat > conftest.$ac_ext <<_LT_EOF
2107 -#line 17947 "configure"
2108 +#line 17956 "configure"
2109  #include "confdefs.h"
2110  
2111  #if HAVE_DLFCN_H
2112 @@ -23796,6 +23805,28 @@
2113  $as_echo "$gcc_cv_lto_plugin" >&6; }
2114  
2115  case "$target" in
2116 +
2117 +  aarch64*-*-*)
2118 +    # Enable default workaround for AArch64 Cortex-A53 erratum 835769.
2119 +    # Check whether --enable-fix-cortex-a53-835769 was given.
2120 +if test "${enable_fix_cortex_a53_835769+set}" = set; then :
2121 +  enableval=$enable_fix_cortex_a53_835769;
2122 +        case $enableval in
2123 +          yes)
2124 +            tm_defines="${tm_defines} TARGET_FIX_ERR_A53_835769_DEFAULT=1"
2125 +            ;;
2126 +          no)
2127 +            ;;
2128 +          *)
2129 +            as_fn_error "'$enableval' is an invalid value for --enable-fix-cortex-a53-835769.\
2130 +  Valid choices are 'yes' and 'no'." "$LINENO" 5
2131 +            ;;
2132 +
2133 +        esac
2134 +
2135 +fi
2136 +
2137 +  ;;
2138    # All TARGET_ABI_OSF targets.
2139    alpha*-*-linux* | alpha*-*-*bsd*)
2140      { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for explicit relocation support" >&5
2141 Index: gcc/fold-const.c
2142 ===================================================================
2143 --- gcc/fold-const.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
2144 +++ gcc/fold-const.c    (.../branches/gcc-4_8-branch)   (revision 217117)
2145 @@ -9213,7 +9213,7 @@
2146    /* Transform comparisons of the form X +- C1 CMP Y +- C2 to
2147       X CMP Y +- C2 +- C1 for signed X, Y.  This is valid if
2148       the resulting offset is smaller in absolute value than the
2149 -     original one.  */
2150 +     original one and has the same sign.  */
2151    if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
2152        && (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
2153        && (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
2154 @@ -9232,19 +9232,20 @@
2155                                       "a comparison");
2156  
2157        /* Put the constant on the side where it doesn't overflow and is
2158 -        of lower absolute value than before.  */
2159 +        of lower absolute value and of same sign than before.  */
2160        cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
2161                              ? MINUS_EXPR : PLUS_EXPR,
2162                              const2, const1);
2163        if (!TREE_OVERFLOW (cst)
2164 -         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2))
2165 +         && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2)
2166 +         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const2))
2167         {
2168           fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
2169           return fold_build2_loc (loc, code, type,
2170 -                             variable1,
2171 -                             fold_build2_loc (loc,
2172 -                                          TREE_CODE (arg1), TREE_TYPE (arg1),
2173 -                                          variable2, cst));
2174 +                                 variable1,
2175 +                                 fold_build2_loc (loc, TREE_CODE (arg1),
2176 +                                                  TREE_TYPE (arg1),
2177 +                                                  variable2, cst));
2178         }
2179  
2180        cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
2181 @@ -9251,13 +9252,15 @@
2182                              ? MINUS_EXPR : PLUS_EXPR,
2183                              const1, const2);
2184        if (!TREE_OVERFLOW (cst)
2185 -         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1))
2186 +         && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1)
2187 +         && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const1))
2188         {
2189           fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
2190           return fold_build2_loc (loc, code, type,
2191 -                             fold_build2_loc (loc, TREE_CODE (arg0), TREE_TYPE (arg0),
2192 -                                          variable1, cst),
2193 -                             variable2);
2194 +                                 fold_build2_loc (loc, TREE_CODE (arg0),
2195 +                                                  TREE_TYPE (arg0),
2196 +                                                  variable1, cst),
2197 +                                 variable2);
2198         }
2199      }
2200  
2201 @@ -11218,7 +11221,6 @@
2202         {
2203           double_int c1, c2, c3, msk;
2204           int width = TYPE_PRECISION (type), w;
2205 -         bool try_simplify = true;
2206  
2207           c1 = tree_to_double_int (TREE_OPERAND (arg0, 1));
2208           c2 = tree_to_double_int (arg1);
2209 @@ -11255,20 +11257,7 @@
2210                 }
2211             }
2212  
2213 -         /* If X is a tree of the form (Y * K1) & K2, this might conflict
2214 -            with that optimization from the BIT_AND_EXPR optimizations.
2215 -            This could end up in an infinite recursion.  */
2216 -         if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR
2217 -             && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1))
2218 -                           == INTEGER_CST)
2219 -         {
2220 -           tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
2221 -           double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
2222 -
2223 -           try_simplify = (masked != c1);
2224 -         }
2225 -
2226 -         if (try_simplify && c3 != c1)
2227 +         if (c3 != c1)
2228             return fold_build2_loc (loc, BIT_IOR_EXPR, type,
2229                                     fold_build2_loc (loc, BIT_AND_EXPR, type,
2230                                                      TREE_OPERAND (arg0, 0),
2231 @@ -11658,16 +11647,25 @@
2232           && TREE_CODE (arg0) == MULT_EXPR
2233           && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
2234         {
2235 +         double_int darg1 = tree_to_double_int (arg1);
2236           double_int masked
2237 -           = mask_with_tz (type, tree_to_double_int (arg1),
2238 +           = mask_with_tz (type, darg1,
2239                             tree_to_double_int (TREE_OPERAND (arg0, 1)));
2240  
2241           if (masked.is_zero ())
2242             return omit_two_operands_loc (loc, type, build_zero_cst (type),
2243                                           arg0, arg1);
2244 -         else if (masked != tree_to_double_int (arg1))
2245 -           return fold_build2_loc (loc, code, type, op0,
2246 -                                   double_int_to_tree (type, masked));
2247 +         else if (masked != darg1)
2248 +           {
2249 +             /* Avoid the transform if arg1 is a mask of some
2250 +                mode which allows further optimizations.  */
2251 +             int pop = darg1.popcount ();
2252 +             if (!(pop >= BITS_PER_UNIT
2253 +                   && exact_log2 (pop) != -1
2254 +                   && double_int::mask (pop) == darg1))
2255 +               return fold_build2_loc (loc, code, type, op0,
2256 +                                       double_int_to_tree (type, masked));
2257 +           }
2258         }
2259  
2260        /* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
2261 Index: gcc/omp-low.c
2262 ===================================================================
2263 --- gcc/omp-low.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
2264 +++ gcc/omp-low.c       (.../branches/gcc-4_8-branch)   (revision 217117)
2265 @@ -1586,7 +1586,6 @@
2266    TREE_STATIC (decl) = 1;
2267    TREE_USED (decl) = 1;
2268    DECL_ARTIFICIAL (decl) = 1;
2269 -  DECL_NAMELESS (decl) = 1;
2270    DECL_IGNORED_P (decl) = 0;
2271    TREE_PUBLIC (decl) = 0;
2272    DECL_UNINLINABLE (decl) = 1;
2273 Index: gcc/toplev.c
2274 ===================================================================
2275 --- gcc/toplev.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
2276 +++ gcc/toplev.c        (.../branches/gcc-4_8-branch)   (revision 217117)
2277 @@ -1036,16 +1036,19 @@
2278  
2279    if (warn_stack_usage >= 0)
2280      {
2281 +      const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
2282 +
2283        if (stack_usage_kind == DYNAMIC)
2284 -       warning (OPT_Wstack_usage_, "stack usage might be unbounded");
2285 +       warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
2286        else if (stack_usage > warn_stack_usage)
2287         {
2288           if (stack_usage_kind == DYNAMIC_BOUNDED)
2289 -           warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
2290 -                    stack_usage);
2291 +           warning_at (loc,
2292 +                       OPT_Wstack_usage_, "stack usage might be %wd bytes",
2293 +                       stack_usage);
2294           else
2295 -           warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
2296 -                    stack_usage);
2297 +           warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
2298 +                       stack_usage);
2299         }
2300      }
2301  }
2302 Index: gcc/DEV-PHASE
2303 ===================================================================
2304 --- gcc/DEV-PHASE       (.../tags/gcc_4_8_3_release)    (revision 217117)
2305 +++ gcc/DEV-PHASE       (.../branches/gcc-4_8-branch)   (revision 217117)
2306 @@ -0,0 +1 @@
2307 +prerelease
2308 Index: gcc/tree-ssa-sccvn.c
2309 ===================================================================
2310 --- gcc/tree-ssa-sccvn.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
2311 +++ gcc/tree-ssa-sccvn.c        (.../branches/gcc-4_8-branch)   (revision 217117)
2312 @@ -3015,33 +3015,12 @@
2313    /* If all value numbered to the same value, the phi node has that
2314       value.  */
2315    if (allsame)
2316 -    {
2317 -      if (is_gimple_min_invariant (sameval))
2318 -       {
2319 -         VN_INFO (PHI_RESULT (phi))->has_constants = true;
2320 -         VN_INFO (PHI_RESULT (phi))->expr = sameval;
2321 -       }
2322 -      else
2323 -       {
2324 -         VN_INFO (PHI_RESULT (phi))->has_constants = false;
2325 -         VN_INFO (PHI_RESULT (phi))->expr = sameval;
2326 -       }
2327 +    return set_ssa_val_to (PHI_RESULT (phi), sameval);
2328  
2329 -      if (TREE_CODE (sameval) == SSA_NAME)
2330 -       return visit_copy (PHI_RESULT (phi), sameval);
2331 -
2332 -      return set_ssa_val_to (PHI_RESULT (phi), sameval);
2333 -    }
2334 -
2335    /* Otherwise, see if it is equivalent to a phi node in this block.  */
2336    result = vn_phi_lookup (phi);
2337    if (result)
2338 -    {
2339 -      if (TREE_CODE (result) == SSA_NAME)
2340 -       changed = visit_copy (PHI_RESULT (phi), result);
2341 -      else
2342 -       changed = set_ssa_val_to (PHI_RESULT (phi), result);
2343 -    }
2344 +    changed = set_ssa_val_to (PHI_RESULT (phi), result);
2345    else
2346      {
2347        vn_phi_insert (phi, PHI_RESULT (phi));
2348 @@ -3142,24 +3121,18 @@
2349       catch those with constants.  The goal here is to simultaneously
2350       combine constants between expressions, but avoid infinite
2351       expansion of expressions during simplification.  */
2352 -  if (TREE_CODE (op0) == SSA_NAME)
2353 -    {
2354 -      if (VN_INFO (op0)->has_constants
2355 +  op0 = vn_valueize (op0);
2356 +  if (TREE_CODE (op0) == SSA_NAME
2357 +      && (VN_INFO (op0)->has_constants
2358           || TREE_CODE_CLASS (code) == tcc_comparison
2359 -         || code == COMPLEX_EXPR)
2360 -       op0 = valueize_expr (vn_get_expr_for (op0));
2361 -      else
2362 -       op0 = vn_valueize (op0);
2363 -    }
2364 +         || code == COMPLEX_EXPR))
2365 +    op0 = valueize_expr (vn_get_expr_for (op0));
2366  
2367 -  if (TREE_CODE (op1) == SSA_NAME)
2368 -    {
2369 -      if (VN_INFO (op1)->has_constants
2370 -         || code == COMPLEX_EXPR)
2371 -       op1 = valueize_expr (vn_get_expr_for (op1));
2372 -      else
2373 -       op1 = vn_valueize (op1);
2374 -    }
2375 +  op1 = vn_valueize (op1);
2376 +  if (TREE_CODE (op1) == SSA_NAME
2377 +      && (VN_INFO (op1)->has_constants
2378 +         || code == COMPLEX_EXPR))
2379 +    op1 = valueize_expr (vn_get_expr_for (op1));
2380  
2381    /* Pointer plus constant can be represented as invariant address.
2382       Do so to allow further propatation, see also tree forwprop.  */
2383 @@ -3217,27 +3190,31 @@
2384      return NULL_TREE;
2385  
2386    orig_op0 = op0;
2387 -  if (VN_INFO (op0)->has_constants)
2388 -    op0 = valueize_expr (vn_get_expr_for (op0));
2389 -  else if (CONVERT_EXPR_CODE_P (code)
2390 -          || code == REALPART_EXPR
2391 -          || code == IMAGPART_EXPR
2392 -          || code == VIEW_CONVERT_EXPR
2393 -          || code == BIT_FIELD_REF)
2394 +  op0 = vn_valueize (op0);
2395 +  if (TREE_CODE (op0) == SSA_NAME)
2396      {
2397 -      /* We want to do tree-combining on conversion-like expressions.
2398 -         Make sure we feed only SSA_NAMEs or constants to fold though.  */
2399 -      tree tem = valueize_expr (vn_get_expr_for (op0));
2400 -      if (UNARY_CLASS_P (tem)
2401 -         || BINARY_CLASS_P (tem)
2402 -         || TREE_CODE (tem) == VIEW_CONVERT_EXPR
2403 -         || TREE_CODE (tem) == SSA_NAME
2404 -         || TREE_CODE (tem) == CONSTRUCTOR
2405 -         || is_gimple_min_invariant (tem))
2406 -       op0 = tem;
2407 +      if (VN_INFO (op0)->has_constants)
2408 +       op0 = valueize_expr (vn_get_expr_for (op0));
2409 +      else if (CONVERT_EXPR_CODE_P (code)
2410 +              || code == REALPART_EXPR
2411 +              || code == IMAGPART_EXPR
2412 +              || code == VIEW_CONVERT_EXPR
2413 +              || code == BIT_FIELD_REF)
2414 +       {
2415 +         /* We want to do tree-combining on conversion-like expressions.
2416 +            Make sure we feed only SSA_NAMEs or constants to fold though.  */
2417 +         tree tem = valueize_expr (vn_get_expr_for (op0));
2418 +         if (UNARY_CLASS_P (tem)
2419 +             || BINARY_CLASS_P (tem)
2420 +             || TREE_CODE (tem) == VIEW_CONVERT_EXPR
2421 +             || TREE_CODE (tem) == SSA_NAME
2422 +             || TREE_CODE (tem) == CONSTRUCTOR
2423 +             || is_gimple_min_invariant (tem))
2424 +           op0 = tem;
2425 +       }
2426      }
2427  
2428 -  /* Avoid folding if nothing changed, but remember the expression.  */
2429 +  /* Avoid folding if nothing changed.  */
2430    if (op0 == orig_op0)
2431      return NULL_TREE;
2432  
2433 Index: gcc/cgraphunit.c
2434 ===================================================================
2435 --- gcc/cgraphunit.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
2436 +++ gcc/cgraphunit.c    (.../branches/gcc-4_8-branch)   (revision 217117)
2437 @@ -1097,7 +1097,7 @@
2438           /* We use local aliases for C++ thunks to force the tailcall
2439              to bind locally.  This is a hack - to keep it working do
2440              the following (which is not strictly correct).  */
2441 -         && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
2442 +         && (TREE_CODE (target_node->symbol.decl) != FUNCTION_DECL
2443               || ! DECL_VIRTUAL_P (target_node->symbol.decl))
2444           && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
2445         {
2446 Index: gcc/ChangeLog
2447 ===================================================================
2448 --- gcc/ChangeLog       (.../tags/gcc_4_8_3_release)    (revision 217117)
2449 +++ gcc/ChangeLog       (.../branches/gcc-4_8-branch)   (revision 217117)
2450 @@ -1,3 +1,930 @@
2451 +2014-10-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2452 +
2453 +       * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Restore
2454 +       recog state after aarch64_prev_real_insn call.
2455 +
2456 +2014-10-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2457 +
2458 +       * config.gcc (aarch64*-*-*): Define TARGET_FIX_ERR_A53_835769_DEFAULT
2459 +       if asked.
2460 +       * configure.ac: Add --enable-fix-cortex-a53-835769 option.
2461 +       * configure: Regenerate.
2462 +       * config/aarch64/aarch64.c (aarch64_override_options): Handle
2463 +       TARGET_FIX_ERR_A53_835769_DEFAULT.
2464 +       * config/aarch64/aarch64.opt (mfix-cortex-a53-835769): Set Init value
2465 +       to 2.
2466 +       * doc/install.texi: Document --enable-fix-cortex-a53-835769 option.
2467 +
2468 +2014-10-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2469 +
2470 +       * config/aarch64/aarch64.opt (mfix-cortex-a53-835769): New option.
2471 +       * config/aarch64/aarch64.h (ADJUST_INSN_LENGTH): Define.
2472 +       (FINAL_PRESCAN_INSN): Likewise.
2473 +       * config/aarch64/aarch64.h (is_mem_p): New function.
2474 +       (has_memory_op): Likewise.
2475 +       (aarch64_prev_real_insn): Likewise.
2476 +       (is_madd_op): Likewise.
2477 +       (dep_between_memop_and_curr): Likewise.
2478 +       (aarch64_madd_needs_nop): Likewise.
2479 +       (aarch64_final_prescan_insn): Likewise.
2480 +       * doc/invoke.texi (Document new option).
2481 +
2482 +2014-10-15  Eric Botcazou  <ebotcazou@adacore.com>
2483 +
2484 +       * stor-layout.c (self_referential_size): Do not promote arguments.
2485 +
2486 +2014-10-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2487 +
2488 +       Backport from mainline r215880
2489 +       2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2490 +
2491 +       * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
2492 +       Issue a warning message when vec_lvsl or vec_lvsr is used with a
2493 +       little endian target.
2494 +
2495 +       Backport from mainline r215882
2496 +       2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2497 +
2498 +       * altivec.md (altivec_lvsl): New define_expand.
2499 +       (altivec_lvsl_direct): Rename define_insn from altivec_lvsl.
2500 +       (altivec_lvsr): New define_expand.
2501 +       (altivec_lvsr_direct): Rename define_insn from altivec_lvsr.
2502 +       * rs6000.c (rs6000_expand_builtin): Change to use
2503 +       altivec_lvs[lr]_direct; remove commented-out code.
2504 +
2505 +2014-10-09  Uros Bizjak  <ubizjak@gmail.com>
2506 +
2507 +       Backport from mainline
2508 +       2014-10-09  Uros Bizjak  <ubizjak@gmail.com>
2509 +
2510 +       PR rtl-optimization/57003
2511 +       * regcprop.c (copyprop_hardreg_forward_1): If ksvd.ignore_set_reg,
2512 +       also check CALL_INSN_FUNCTION_USAGE for clobbers again after
2513 +       killing regs_invalidated_by_call.
2514 +
2515 +2014-10-08  Oleg Endo  <olegendo@gcc.gnu.org>
2516 +
2517 +       Backport from mainline
2518 +       2014-10-08  Oleg Endo  <olegendo@gcc.gnu.org>
2519 +
2520 +       PR target/52941
2521 +       * config/sh/sync.md (atomic_exchangesi_hard, atomic_exchange<mode>_hard,
2522 +       atomic_fetch_<fetchop_name>si_hard,
2523 +       atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nandsi_hard,
2524 +       atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetchsi_hard,
2525 +       atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetchsi_hard,
2526 +       atomic_nand_fetch<mode>_hard): Add missing set of T_REG.
2527 +
2528 +2014-10-02  Martin Jambor  <mjambor@suse.cz>
2529 +
2530 +       PR tree-optimization/63375
2531 +       * tree-sra.c (build_access_from_expr_1): Disqualify volatile
2532 +       references.
2533 +
2534 +2014-10-01  Jakub Jelinek  <jakub@redhat.com>
2535 +
2536 +       PR debug/63342
2537 +       * dwarf2out.c (loc_list_from_tree): Handle TARGET_MEM_REF and
2538 +       SSA_NAME.
2539 +
2540 +       PR target/63428
2541 +       * config/i386/i386.c (expand_vec_perm_pshufb): Fix up rperm[0]
2542 +       argument to avx2_permv2ti.
2543 +
2544 +2014-10-01  Uros Bizjak  <ubizjak@gmail.com>
2545 +
2546 +       Backport from mainline
2547 +       2014-09-30  Uros Bizjak  <ubizjak@gmail.com>
2548 +
2549 +       * config/i386/i386.md (fmodxf3): Enable for flag_finite_math_only only.
2550 +       (fmod<mode>3): Ditto.
2551 +       (fpremxf4_i387): Ditto.
2552 +       (reminderxf3): Ditto.
2553 +       (reminder<mode>3): Ditto.
2554 +       (fprem1xf4_i387): Ditto.
2555 +
2556 +2014-09-30  Jakub Jelinek  <jakub@redhat.com>
2557 +
2558 +       PR inline-asm/63282
2559 +       * ifcvt.c (dead_or_predicable): Don't call redirect_jump_1
2560 +       or invert_jump_1 if jump isn't any_condjump_p.
2561 +
2562 +2014-09-29  Charles Baylis  <charles.baylis@linaro.org>
2563 +
2564 +       Backport from mainline r212303
2565 +       PR target/49423
2566 +       * config/arm/arm-protos.h (arm_legitimate_address_p,
2567 +       arm_is_constant_pool_ref): Add prototypes.
2568 +       * config/arm/arm.c (arm_legitimate_address_p): Remove static.
2569 +       (arm_is_constant_pool_ref) New function.
2570 +       * config/arm/arm.md (unaligned_loadhis, arm_zero_extendhisi2_v6,
2571 +       arm_zero_extendqisi2_v6): Use Uh constraint for memory operand.
2572 +       (arm_extendhisi2, arm_extendhisi2_v6): Use Uh constraint for memory
2573 +       operand and remove pool_range and neg_pool_range attributes.
2574 +       (arm_extendqihi_insn, arm_extendqisi, arm_extendqisi_v6): Remove
2575 +       pool_range and neg_pool_range attributes.
2576 +       * config/arm/constraints.md (Uh): New constraint. (Uq): Don't allow
2577 +       constant pool references.
2578 +
2579 +2014-09-28  John David Anglin  <danglin@gcc.gnu.org>
2580 +
2581 +       * config/pa/pa.c (pa_output_function_epilogue): Only update
2582 +       last_address when a nonnote insn is found.
2583 +
2584 +2014-09-25  Oleg Endo  <olegendo@gcc.gnu.org>
2585 +
2586 +       Backport from mainline
2587 +       2014-09-25  Nick Clifton  <nickc@redhat.com>
2588 +       2014-09-25  Oleg Endo  <olegendo@gcc.gnu.org>
2589 +
2590 +       PR target/62218
2591 +       * config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask,
2592 +       atomic_test_and_set_soft_imask): Fix typo in instruction sequence.
2593 +
2594 +2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2595 +
2596 +       Backport from mainline r215559
2597 +       2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2598 +
2599 +       PR target/63335
2600 +       * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin):
2601 +       Exclude VSX_BUILTIN_XVCMPGEDP_P from special handling.
2602 +
2603 +2014-09-25  Jakub Jelinek  <jakub@redhat.com>
2604 +
2605 +       PR tree-optimization/63341
2606 +       * tree-vectorizer.h (vect_create_data_ref_ptr,
2607 +       vect_create_addr_base_for_vector_ref): Add another tree argument
2608 +       defaulting to NULL_TREE.
2609 +       * tree-vect-data-refs.c (vect_create_data_ref_ptr): Add byte_offset
2610 +       argument, pass it down to vect_create_addr_base_for_vector_ref.
2611 +       (vect_create_addr_base_for_vector_ref): Add byte_offset argument,
2612 +       add that to base_offset too if non-NULL.
2613 +       * tree-vect-stmts.c (vectorizable_load): Add byte_offset variable,
2614 +       for dr_explicit_realign_optimized set it to vector byte size
2615 +       - 1 instead of setting offset, pass byte_offset down to
2616 +       vect_create_data_ref_ptr.
2617 +
2618 +2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
2619 +
2620 +       Back port from trunk:
2621 +       2014-09-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
2622 +
2623 +       * config/rs6000/rs6000.md (f32_vsx): New mode attributes to
2624 +       refine the constraints used on 32/64-bit floating point moves.
2625 +       (f32_av): Likewise.
2626 +       (f64_vsx): Likewise.
2627 +       (f64_dm): Likewise.
2628 +       (f64_av): Likewise.
2629 +       (BOOL_REGS_OUTPUT): Use wt constraint for TImode instead of wa.
2630 +       (BOOL_REGS_OP1): Likewise.
2631 +       (BOOL_REGS_OP2): Likewise.
2632 +       (BOOL_REGS_UNARY): Likewise.
2633 +       (mov<mode>_hardfloat, SFmode/SDmode): Tighten down constraints for
2634 +       32/64-bit floating point moves.  Do not use wa, instead use ww/ws
2635 +       for moves involving VSX registers.  Do not use constraints that
2636 +       target VSX registers for decimal types.
2637 +       (mov<mode>_hardfloat32, DFmode/DDmode): Likewise.
2638 +       (mov<mode>_hardfloat64, DFmode/DDmode): Likewise.
2639 +
2640 +2014-09-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
2641 +
2642 +       Back port from trunk:
2643 +       2014-09-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
2644 +
2645 +       * config/rs6000/predicates.md (fusion_gpr_mem_load): Move testing
2646 +       for base_reg_operand to be common between LO_SUM and PLUS.
2647 +       (fusion_gpr_mem_combo): New predicate to match a fused address
2648 +       that combines the addis and memory offset address.
2649 +
2650 +       * config/rs6000/rs6000-protos.h (fusion_gpr_load_p): Change
2651 +       calling signature.
2652 +       (emit_fusion_gpr_load): Likewise.
2653 +
2654 +       * config/rs6000/rs6000.c (fusion_gpr_load_p): Change calling
2655 +       signature to pass each argument separately, rather than
2656 +       using an operands array.  Rewrite the insns found by peephole2 to
2657 +       be a single insn, rather than hoping the insns will still be
2658 +       together when the peephole pass is done.  Drop being called via a
2659 +       normal peephole.
2660 +       (emit_fusion_gpr_load): Change calling signature to be called from
2661 +       the fusion_gpr_load_<mode> insns with a combined memory address
2662 +       instead of the peephole pass passing the addis and offset
2663 +       separately.
2664 +
2665 +       * config/rs6000/rs6000.md (UNSPEC_FUSION_GPR): New unspec for GPR
2666 +       fusion.
2667 +       (power8 fusion peephole): Drop support for doing power8 via a
2668 +       normal peephole that was created by the peephole2 pass.
2669 +       (power8 fusion peephole2): Create a new insn with the fused
2670 +       address, so that the fused operation is kept together after
2671 +       register allocation is done.
2672 +       (fusion_gpr_load_<mode>): Likewise.
2673 +
2674 +2014-09-17  Jakub Jelinek  <jakub@redhat.com>
2675 +
2676 +       PR debug/63284
2677 +       * tree-cfgcleanup.c (fixup_noreturn_call): Don't split block
2678 +       if there are only debug stmts after the noreturn call, instead
2679 +       remove the debug stmts.
2680 +
2681 +2014-09-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
2682 +
2683 +       * config/rs6000/vsx.md (vsx_fmav4sf4): Use correct constraints for
2684 +       V2DF, V4SF, DF, and DI modes.
2685 +       (vsx_fmav2df2): Likewise.
2686 +       (vsx_float_fix_<mode>2): Likewise.
2687 +       (vsx_reduc_<VEC_reduc_name>_v2df_scalar): Likewise.
2688 +
2689 +2014-09-10  Alan Modra  <amodra@gmail.com>
2690 +
2691 +       PR debug/60655
2692 +       * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend
2693 +       can't be output.
2694 +
2695 +2014-09-09  Richard Biener  <rguenther@suse.de>
2696 +
2697 +       Backport from mainline
2698 +       2014-06-11  Richard Biener  <rguenther@suse.de>
2699 +
2700 +       PR tree-optimization/61452
2701 +       * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
2702 +       expr and has_constants in case we found a leader.
2703 +       (simplify_binary_expression): Always valueize operands first.
2704 +       (simplify_unary_expression): Likewise.
2705 +
2706 +2014-09-09  Richard Biener  <rguenther@suse.de>
2707 +
2708 +       Backport from mainline
2709 +       2014-05-05  Richard Biener  <rguenther@suse.de>
2710 +
2711 +       PR middle-end/61010
2712 +       * fold-const.c (fold_binary_loc): Consistently avoid
2713 +       canonicalizing X & CST away from a CST that is the mask
2714 +       of a mode.
2715 +
2716 +       2014-05-28  Richard Biener  <rguenther@suse.de>
2717 +
2718 +       PR middle-end/61045
2719 +       * fold-const.c (fold_comparison): When folding
2720 +       X +- C1 CMP Y +- C2 to X CMP Y +- C2 +- C1 also ensure
2721 +       the sign of the remaining constant operand stays the same.
2722 +
2723 +       2014-08-11  Richard Biener  <rguenther@suse.de>
2724 +
2725 +       PR tree-optimization/62075
2726 +       * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly
2727 +       handle uses in patterns.
2728 +
2729 +2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
2730 +
2731 +       Backport from mainline.
2732 +       2014-09-09  James Greenhalgh  <james.greenhalgh@arm.com>
2733 +
2734 +       * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
2735 +       (-mtune): Likewise.
2736 +       (-mcpu): Likewise.
2737 +
2738 +2014-09-08  Jakub Jelinek  <jakub@redhat.com>
2739 +
2740 +       PR tree-optimization/60196
2741 +       PR tree-optimization/63189
2742 +       Backported from mainline
2743 +       2013-09-17  Cong Hou  <congh@google.com>
2744 +
2745 +       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Fix a bug
2746 +       when checking the dot production pattern. The type of rhs operand
2747 +       of multiply is now checked correctly.
2748 +
2749 +2014-09-08  Jakub Jelinek  <jakub@redhat.com>
2750 +
2751 +       Backported from mainline
2752 +       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
2753 +
2754 +       PR debug/61923
2755 +       * haifa-sched.c (advance_one_cycle): Fix dump.
2756 +       (schedule_block): Don't advance cycle if we are already at the
2757 +       beginning of the cycle.
2758 +
2759 +2014-09-03  Martin Jambor  <mjambor@suse.cz>
2760 +
2761 +       PR ipa/62015
2762 +       * ipa-cp.c (intersect_aggregates_with_edge): Handle impermissible
2763 +       pass-trough jump functions correctly.
2764 +
2765 +2014-09-03  Martin Jambor  <mjambor@suse.cz>
2766 +
2767 +       PR ipa/61986
2768 +       * ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
2769 +       created replacements in ascending order of offsets.
2770 +       (known_aggs_to_agg_replacement_list): Likewise.
2771 +
2772 +2014-09-01  Marek Polacek  <polacek@redhat.com>
2773 +
2774 +       Backport from mainline
2775 +       2014-08-21  Marek Polacek  <polacek@redhat.com>
2776 +
2777 +       PR c/61271
2778 +       * expr.c (is_aligning_offset): Remove logical not.
2779 +
2780 +2014-09-01  Marek Polacek  <polacek@redhat.com>
2781 +
2782 +       Backport from mainline
2783 +       2014-08-19  Marek Polacek  <polacek@redhat.com>
2784 +
2785 +       PR c/61271
2786 +       * cgraphunit.c (handle_alias_pairs): Fix condition.
2787 +
2788 +2014-08-30  John David Anglin  <danglin@gcc.gnu.org>
2789 +
2790 +       * config/pa/pa.c (pa_assemble_integer): Don't add PLABEL relocation
2791 +       prefix to function labels when generating fast indirect calls.
2792 +
2793 +2014-08-26  Joel Sherrill <joel.sherrill@oarcorp.com>
2794 +
2795 +       * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
2796 +
2797 +2014-08-26  Marek Polacek  <polacek@redhat.com>
2798 +
2799 +       Backport from mainline
2800 +       2014-08-26  Marek Polacek  <polacek@redhat.com>
2801 +
2802 +       PR c/61271
2803 +       * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
2804 +       LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
2805 +
2806 +2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
2807 +
2808 +       Backport from mainline
2809 +       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
2810 +
2811 +       PR target/61996
2812 +       * config/sh/sh.opt (musermode): Allow negative form.
2813 +       * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
2814 +       targets that don't support it.
2815 +       * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
2816 +       Document -mno-usermode option.
2817 +
2818 +2014-08-23  John David Anglin  <danglin@gcc.gnu.org>
2819 +
2820 +       PR target/62038
2821 +       * config/pa/pa.c (pa_output_function_epilogue): Don't set
2822 +       last_address when the current function is a thunk.
2823 +       (pa_asm_output_mi_thunk): When we don't have named sections or they
2824 +       are not being used, check that thunk can reach the stub table with a
2825 +       short branch.
2826 +
2827 +2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
2828 +
2829 +       Backport fro mainline
2830 +       2014-08-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
2831 +
2832 +       PR target/62195
2833 +       * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
2834 +       documentation to state it is only for VSX operations.
2835 +
2836 +       * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
2837 +       constraint only active if VSX.
2838 +
2839 +       * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
2840 +       wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
2841 +       (lfiwzx): Likewise.
2842 +
2843 +2014-08-15  Tom de Vries  <tom@codesourcery.com>
2844 +
2845 +       Backport from mainline:
2846 +       2014-08-14  Tom de Vries  <tom@codesourcery.com>
2847 +
2848 +       PR rtl-optimization/62004
2849 +       PR rtl-optimization/62030
2850 +       * ifcvt.c (rtx_interchangeable_p): New function.
2851 +       (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
2852 +
2853 +       2014-08-05  Richard Biener  <rguenther@suse.de>
2854 +
2855 +       * emit-rtl.h (mem_attrs_eq_p): Declare.
2856 +       * emit-rtl.c (mem_attrs_eq_p): Export.
2857 +
2858 +2014-08-16  John David Anglin  <danglin@gcc.gnu.org>
2859 +
2860 +       Backport from trunk:
2861 +       2014-04-06  John David Anglin  <danglin@gcc.gnu.org>
2862 +
2863 +       PR debug/55794
2864 +       * config/pa/pa.c (pa_output_function_epilogue): Skip address and code
2865 +       size accounting for thunks.
2866 +       (pa_asm_output_mi_thunk): Use final_start_function() and
2867 +       final_end_function() to output function start and end directives.
2868 +
2869 +2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
2870 +
2871 +       Backport from mainline:
2872 +       2014-08-15  Oleg Endo  <olegendo@gcc.gnu.org>
2873 +
2874 +       * doc/invoke.texi (SH options): Document missing processor variant
2875 +       options.  Remove references to Hitachi.  Undocument deprecated mspace
2876 +       option.
2877 +
2878 +2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
2879 +
2880 +       PR tree-optimization/62073
2881 +       * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
2882 +       a basic block.
2883 +
2884 +2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
2885 +
2886 +       Backport from mainline
2887 +       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
2888 +
2889 +       PR middle-end/62103
2890 +       * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
2891 +       bitfields, that is when size doesn't match the size of type or the
2892 +       size of the constructor.
2893 +
2894 +2014-08-12  Michael Meissner  <meissner@linux.vnet.ibm.com>
2895 +
2896 +       Backport patch from mainline
2897 +       2014-08-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
2898 +
2899 +       * config/rs6000/constraints.md (wh constraint): New constraint,
2900 +       for FP registers if direct move is available.
2901 +       (wi constraint): New constraint, for VSX/FP registers that can
2902 +       handle 64-bit integers.
2903 +       (wj constraint): New constraint for VSX/FP registers that can
2904 +       handle 64-bit integers for direct moves.
2905 +       (wk constraint): New constraint for VSX/FP registers that can
2906 +       handle 64-bit doubles for direct moves.
2907 +       (wy constraint): Make documentation match implementation.
2908 +
2909 +       * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
2910 +       scalar_in_vmx_p field to simplify tests of whether SFmode or
2911 +       DFmode can go in the Altivec registers.
2912 +       (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
2913 +       (rs6000_setup_reg_addr_masks): Likewise.
2914 +       (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
2915 +       field, and wh/wi/wj/wk constraints.
2916 +       (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
2917 +       the wh/wi/wj/wk constraints.
2918 +       (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
2919 +       upper registers, prefer VSX registers unless the operation is a
2920 +       memory operation with REG+OFFSET addressing.
2921 +
2922 +       * config/rs6000/vsx.md (VSr mode attribute): Add support for
2923 +       DImode.  Change SFmode to use ww constraint instead of d to allow
2924 +       SF registers in the upper registers.
2925 +       (VSr2): Likewise.
2926 +       (VSr3): Likewise.
2927 +       (VSr5): Fix thinko in comment.
2928 +       (VSa): New mode attribute that is an alternative to wa, that
2929 +       returns the VSX register class that a mode can go in, but may not
2930 +       be the preferred register class.
2931 +       (VS_64dm): New mode attribute for appropriate register classes for
2932 +       referencing 64-bit elements of vectors for direct moves and normal
2933 +       moves.
2934 +       (VS_64reg): Likewise.
2935 +       (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
2936 +       register allocator to only registers the data type can handle.
2937 +       (vsx_le_perm_load_<mode>): Likewise.
2938 +       (vsx_le_perm_store_<mode>): Likewise.
2939 +       (vsx_xxpermdi2_le_<mode>): Likewise.
2940 +       (vsx_xxpermdi4_le_<mode>): Likewise.
2941 +       (vsx_lxvd2x2_le_<mode>): Likewise.
2942 +       (vsx_lxvd2x4_le_<mode>): Likewise.
2943 +       (vsx_stxvd2x2_le_<mode>): Likewise.
2944 +       (vsx_add<mode>3): Likewise.
2945 +       (vsx_sub<mode>3): Likewise.
2946 +       (vsx_mul<mode>3): Likewise.
2947 +       (vsx_div<mode>3): Likewise.
2948 +       (vsx_tdiv<mode>3_internal): Likewise.
2949 +       (vsx_fre<mode>2): Likewise.
2950 +       (vsx_neg<mode>2): Likewise.
2951 +       (vsx_abs<mode>2): Likewise.
2952 +       (vsx_nabs<mode>2): Likewise.
2953 +       (vsx_smax<mode>3): Likewise.
2954 +       (vsx_smin<mode>3): Likewise.
2955 +       (vsx_sqrt<mode>2): Likewise.
2956 +       (vsx_rsqrte<mode>2): Likewise.
2957 +       (vsx_tsqrt<mode>2_internal): Likewise.
2958 +       (vsx_fms<mode>4): Likewise.
2959 +       (vsx_nfma<mode>4): Likewise.
2960 +       (vsx_eq<mode>): Likewise.
2961 +       (vsx_gt<mode>): Likewise.
2962 +       (vsx_ge<mode>): Likewise.
2963 +       (vsx_eq<mode>_p): Likewise.
2964 +       (vsx_gt<mode>_p): Likewise.
2965 +       (vsx_ge<mode>_p): Likewise.
2966 +       (vsx_xxsel<mode>): Likewise.
2967 +       (vsx_xxsel<mode>_uns): Likewise.
2968 +       (vsx_copysign<mode>3): Likewise.
2969 +       (vsx_float<VSi><mode>2): Likewise.
2970 +       (vsx_floatuns<VSi><mode>2): Likewise.
2971 +       (vsx_fix_trunc<mode><VSi>2): Likewise.
2972 +       (vsx_fixuns_trunc<mode><VSi>2): Likewise.
2973 +       (vsx_x<VSv>r<VSs>i): Likewise.
2974 +       (vsx_x<VSv>r<VSs>ic): Likewise.
2975 +       (vsx_btrunc<mode>2): Likewise.
2976 +       (vsx_b2trunc<mode>2): Likewise.
2977 +       (vsx_floor<mode>2): Likewise.
2978 +       (vsx_ceil<mode>2): Likewise.
2979 +       (vsx_<VS_spdp_insn>): Likewise.
2980 +       (vsx_xscvspdp): Likewise.
2981 +       (vsx_xvcvspuxds): Likewise.
2982 +       (vsx_float_fix_<mode>2): Likewise.
2983 +       (vsx_set_<mode>): Likewise.
2984 +       (vsx_extract_<mode>_internal1): Likewise.
2985 +       (vsx_extract_<mode>_internal2): Likewise.
2986 +       (vsx_extract_<mode>_load): Likewise.
2987 +       (vsx_extract_<mode>_store): Likewise.
2988 +       (vsx_splat_<mode>): Likewise.
2989 +       (vsx_xxspltw_<mode>): Likewise.
2990 +       (vsx_xxspltw_<mode>_direct): Likewise.
2991 +       (vsx_xxmrghw_<mode>): Likewise.
2992 +       (vsx_xxmrglw_<mode>): Likewise.
2993 +       (vsx_xxsldwi_<mode>): Likewise.
2994 +       (vsx_xscvdpspn): Tighten constraints to only use register classes
2995 +       the types use.
2996 +       (vsx_xscvspdpn): Likewise.
2997 +       (vsx_xscvdpspn_scalar): Likewise.
2998 +
2999 +       * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
3000 +       wj, and wk constraints.
3001 +       (GPR_REG_CLASS_P): New helper macro for register classes targeting
3002 +       general purpose registers.
3003 +
3004 +       * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
3005 +       direct moves.
3006 +       (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
3007 +       DImode instead of wm.  Use wk constraint for direct move of DFmode
3008 +       instead of wm.
3009 +       (extendsidi2_lfiwax): Likewise.
3010 +       (lfiwax): Likewise.
3011 +       (lfiwzx): Likewise.
3012 +       (movdi_internal64): Likewise.
3013 +
3014 +       * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
3015 +       wk constraints. Make the wy constraint documentation match them
3016 +       implementation.
3017 +
3018 +2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
3019 +
3020 +       Backport from mainline
3021 +       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
3022 +
3023 +       PR tree-optimization/61375
3024 +       * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
3025 +       symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
3026 +       (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
3027 +
3028 +2014-08-01  Richard Biener  <rguenther@suse.de>
3029 +
3030 +       PR tree-optimization/61964
3031 +       * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
3032 +       function merged from trunk.
3033 +       (gimple_equal_p): Handle non-SSA LHS solely by structural
3034 +       equality.
3035 +
3036 +2014-07-25  Uros Bizjak  <ubizjak@gmail.com>
3037 +
3038 +       * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
3039 +
3040 +2014-07-24  Kyle McMartin  <kyle@redhat.com>
3041 +
3042 +       * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
3043 +
3044 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
3045 +
3046 +       * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
3047 +       Add prototype.
3048 +       * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
3049 +       function.  Issue -Wpsabi warning if future GCC releases will use
3050 +       different field alignment rules for this type.
3051 +       * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
3052 +       * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
3053 +       * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
3054 +
3055 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
3056 +
3057 +       * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
3058 +       -Wpsabi note when encountering a type where future GCC releases
3059 +       will apply different alignment requirements.
3060 +
3061 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
3062 +
3063 +       * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
3064 +       does not fit fully into floating-point registers, and there is still
3065 +       space in the register parameter area, issue -Wpsabi note that the ABI
3066 +       will change in a future GCC release.
3067 +
3068 +2014-07-23  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3069 +
3070 +       * config/arm/t-rtems-eabi: Add
3071 +       mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
3072 +       mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
3073 +       mbig-endian/mthumb/march=armv7-r, and
3074 +       mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
3075 +       multilibs.
3076 +
3077 +2014-07-21  Peter Bergner  <bergner@vnet.ibm.com>
3078 +
3079 +       * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
3080 +       (LIBTSAN_EARLY_SPEC): Likewise.
3081 +       (STATIC_LIBASAN_LIBS): Likewise.
3082 +       (STATIC_LIBTSAN_LIBS): Likewise.
3083 +
3084 +2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
3085 +
3086 +       * toplev.c (output_stack_usage): Adjust the location of the warning.
3087 +
3088 +2014-07-19  Daniel Cederman  <cederman@gaisler.com>
3089 +
3090 +       * config/sparc/sync.md (*membar_storeload_leon3): New insn.
3091 +       (*membar_storeload): Disable for LEON3.
3092 +
3093 +2014-07-17  Richard Biener  <rguenther@suse.de>
3094 +
3095 +       PR rtl-optimization/61801
3096 +       * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
3097 +       ASM_INPUT don't set reg_pending_barrier if it appears in a
3098 +       debug-insn.
3099 +
3100 +2014-07-16  Jakub Jelinek  <jakub@redhat.com>
3101 +
3102 +       * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
3103 +       on the FUNCTION_DECL.
3104 +
3105 +2014-07-10  Tom G. Christensen  <tgc@jupiterrise.com>
3106 +
3107 +       * doc/install.texi: Remove links to defunct package providers for
3108 +       Solaris.
3109 +
3110 +2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
3111 +
3112 +       PR middle-end/53590
3113 +       * function.c (allocate_struct_function): Revert r188667 change.
3114 +
3115 +2014-07-04  Jakub Jelinek  <jakub@redhat.com>
3116 +
3117 +       PR tree-optimization/61684
3118 +       * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
3119 +       rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
3120 +
3121 +2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
3122 +
3123 +       Backport from Mainline
3124 +       2014-06-20  Jakub Jelinek  <jakub@redhat.com>
3125 +       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
3126 +
3127 +       PR tree-optimization/61306
3128 +       * tree-ssa-math-opts.c (struct symbolic_number): Store type of
3129 +       expression instead of its size.
3130 +       (do_shift_rotate): Adapt to change in struct symbolic_number. Return
3131 +       false to prevent optimization when the result is unpredictable due to
3132 +       arithmetic right shift of signed type with highest byte is set.
3133 +       (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
3134 +       (find_bswap_1): Likewise. Return NULL to prevent optimization when the
3135 +       result is unpredictable due to sign extension.
3136 +       (find_bswap): Adapt to change in struct symbolic_number.
3137 +
3138 +2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
3139 +
3140 +       Backport from mainline
3141 +       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
3142 +
3143 +       PR target/61586
3144 +       * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
3145 +
3146 +2014-06-26  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
3147 +
3148 +       PR target/61542
3149 +       * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
3150 +       extraction other than index 3.
3151 +
3152 +2014-06-24  Jakub Jelinek  <jakub@redhat.com>
3153 +
3154 +       PR target/61570
3155 +       * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
3156 +       model family 6 CPU with has_longmode never use a CPU without
3157 +       64-bit support.
3158 +
3159 +2014-06-20  Chung-Lin Tang  <cltang@codesourcery.com>
3160 +
3161 +       Backport from mainline
3162 +
3163 +       2014-06-20  Julian Brown  <julian@codesourcery.com>
3164 +                   Chung-Lin Tang  <cltang@codesourcery.com>
3165 +
3166 +       * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
3167 +       TARGET_THUMB1_ONLY. Add comments.
3168 +
3169 +2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
3170 +
3171 +       Backport from mainline
3172 +       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
3173 +
3174 +       PR target/61423
3175 +       * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
3176 +       define_insn_and_split pattern, merged from *floatunssi<mode>2_1
3177 +       and corresponding splitters.  Zero extend general register
3178 +       or memory input operand to XMM temporary.  Enable for
3179 +       TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
3180 +       (floatunssi<mode>2): Update expander predicate.
3181 +
3182 +2014-06-18  Richard Henderson  <rth@redhat.com>
3183 +
3184 +       PR target/61545
3185 +       * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
3186 +
3187 +2014-06-17  Nagaraju Mekala <nagaraju.mekala@xilinx.com>
3188 +
3189 +       Revert on gcc-4_8-branch.
3190 +       * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
3191 +       * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
3192 +
3193 +2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
3194 +
3195 +       Backport from mainline
3196 +
3197 +       PR target/61483
3198 +       * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
3199 +       variable 'size'; calculate 'size' right in the front; use
3200 +       'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
3201 +       pcum->aapcs_stack_words.
3202 +
3203 +2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
3204 +
3205 +       Backport from mainline
3206 +
3207 +       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
3208 +       PR target/61415
3209 +       * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
3210 +       (BU_MISC_2): Rename to ...
3211 +       (BU_LDBL128_2): ... this.
3212 +       * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
3213 +       (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
3214 +       * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
3215 +       RS6000_BTM_LDBL128.
3216 +       (rs6000_invalid_builtin): Add long double 128-bit builtin support.
3217 +       (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
3218 +       * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
3219 +       (unpacktf_1): Likewise.
3220 +       * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
3221 +       (__builtin_longdouble_dw1): Likewise.
3222 +       * doc/sourcebuild.texi (longdouble128): Document.
3223 +
3224 +2014-06-13  Jason Merrill  <jason@redhat.com>
3225 +
3226 +       PR c++/60731
3227 +       * common.opt (-fno-gnu-unique): Add.
3228 +       * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
3229 +
3230 +2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
3231 +
3232 +       Backport from 2014-05-09 trunk r210272
3233 +
3234 +       * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
3235 +       unsigned int initializers for regno_in, regno_out.
3236 +
3237 +       Backport from 2014-05-14 trunk r210418
3238 +       * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
3239 +       shifted values to avoid build warning.
3240 +
3241 +       Backport from 2014-06-12 trunk r211491
3242 +
3243 +       PR target/61443
3244 +       * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
3245 +       loading from address spaces.
3246 +
3247 +2014-06-12  Alan Modra  <amodra@gmail.com>
3248 +
3249 +       PR target/61300
3250 +       * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
3251 +       * doc/tm.texi: Regenerate.
3252 +       * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
3253 +       Use throughout in place of REG_PARM_STACK_SPACE.
3254 +       * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
3255 +       "incoming" param.  Pass to rs6000_function_parms_need_stack.
3256 +       (rs6000_function_parms_need_stack): Add "incoming" param, ignore
3257 +       prototype_p when incoming.  Use function decl when incoming
3258 +       to handle K&R style functions.
3259 +       * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
3260 +       (INCOMING_REG_PARM_STACK_SPACE): Define.
3261 +
3262 +2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
3263 +
3264 +       Back port from trunk
3265 +       2014-06-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
3266 +
3267 +       PR target/61431
3268 +       * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
3269 +       iterators, VSX_D that handles 64-bit types, and VSX_LE that
3270 +       handles swapping the two 64-bit double words on little endian
3271 +       systems.  Include V1TImode and optionally TImode in VSX_LE so that
3272 +       these types are properly swapped.  Change all of the insns and
3273 +       splits that do the 64-bit swaps to use VSX_LE.
3274 +       (vsx_le_perm_load_<mode>): Likewise.
3275 +       (vsx_le_perm_store_<mode>): Likewise.
3276 +       (splitters for little endian memory operations): Likewise.
3277 +       (vsx_xxpermdi2_le_<mode>): Likewise.
3278 +       (vsx_lxvd2x2_le_<mode>): Likewise.
3279 +       (vsx_stxvd2x2_le_<mode>): Likewise.
3280 +
3281 +2014-06-05  Martin Jambor  <mjambor@suse.cz>
3282 +
3283 +       PR ipa/61393
3284 +       * ipa-cp.c (determine_versionability): Pretend that tm_clones are
3285 +       not versionable.
3286 +
3287 +2014-06-04  Richard Biener  <rguenther@suse.de>
3288 +
3289 +       PR tree-optimization/61383
3290 +       * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
3291 +       stmts can't trap.
3292 +
3293 +2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
3294 +
3295 +       Backport from mainline
3296 +       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
3297 +
3298 +       PR rtl-optimization/60866
3299 +       * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
3300 +       Default it to -1.  Pass it down to init_simplejump_data.
3301 +       (init_simplejump_data): New parameter old_seqno.  Pass it down
3302 +       to get_seqno_for_a_jump.
3303 +       (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
3304 +       initializing new jump seqno as a last resort.  Add comment.
3305 +       (sel_redirect_edge_and_branch): Save old seqno of the conditional
3306 +       jump and pass it down to sel_init_new_insn.
3307 +       (sel_redirect_edge_and_branch_force): Likewise.
3308 +
3309 +2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
3310 +
3311 +       Backport from mainline
3312 +       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
3313 +
3314 +       PR rtl-optimization/60901
3315 +       * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
3316 +       bb predecessor belongs to the same scheduling region.  Adjust comment.
3317 +
3318 +2014-06-03  Uros Bizjak  <ubizjak@gmail.com>
3319 +
3320 +       Backport from mainline
3321 +       2014-06-02  Uros Bizjak  <ubizjak@gmail.com>
3322 +
3323 +       PR target/61239
3324 +       * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
3325 +       GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
3326 +
3327 +2014-05-28  Guozhi Wei  <carrot@google.com>
3328 +
3329 +       PR target/61202
3330 +       * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
3331 +       constraint.
3332 +       (vqdmulhq_n_s16): Likewise.
3333 +
3334 +2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3335 +
3336 +       Backport from mainline
3337 +       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
3338 +
3339 +       * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
3340 +       predicate to detect a negative quotient.
3341 +
3342 +2014-05-28  Georg-Johann Lay  <avr@gjlay.de>
3343 +
3344 +       PR target/61044
3345 +       * doc/extend.texi (Local Labels): Note that label differences are
3346 +       not supported for AVR.
3347 +
3348 +2014-05-26  Michael Tautschnig  <mt@debian.org>
3349 +
3350 +       PR target/61249
3351 +       * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
3352 +       __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
3353 +
3354 +2014-05-23  Alan Modra  <amodra@gmail.com>
3355 +
3356 +       PR target/61231
3357 +       * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
3358 +       * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
3359 +       Use "Y" constraint rather than "m".
3360 +
3361 +2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
3362 +
3363 +       Backport from mainline
3364 +       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
3365 +
3366 +       * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
3367 +
3368 +2014-05-22  Richard Earnshaw  <rearnsha@arm.com>
3369 +
3370 +       PR target/61208
3371 +       * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
3372 +
3373 +2013-05-22  Richard Biener  <rguenther@suse.de>
3374 +
3375 +       * BASE-VER: Set to 4.8.4.
3376 +       * DEV-PHASE: Set to prerelease.
3377 +
3378  2014-05-22  Release Manager
3379  
3380         * GCC 4.8.3 released.
3381 Index: gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c
3382 ===================================================================
3383 --- gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c   (.../tags/gcc_4_8_3_release)    (revision 0)
3384 +++ gcc/testsuite/gcc.target/powerpc/warn-lvsl-lvsr.c   (.../branches/gcc-4_8-branch)   (revision 217117)
3385 @@ -0,0 +1,14 @@
3386 +/* Test for deprecation messages on use of lvsl and lvsr for little endian.  */
3387 +
3388 +/* { dg-do compile { target { powerpc64le-*-* } } } */
3389 +/* { dg-options "-O0 -Wdeprecated" } */
3390 +
3391 +#include <altivec.h>
3392 +
3393 +float f[20];
3394 +
3395 +void foo ()
3396 +{
3397 +  vector unsigned char a = vec_lvsl (4, f); /* { dg-warning "vec_lvsl is deprecated for little endian; use assignment for unaligned loads and stores" } */
3398 +  vector unsigned char b = vec_lvsr (8, f); /* { dg-warning "vec_lvsr is deprecated for little endian; use assignment for unaligned loads and stores" } */
3399 +}
3400 Index: gcc/testsuite/gcc.target/powerpc/pr63335.c
3401 ===================================================================
3402 --- gcc/testsuite/gcc.target/powerpc/pr63335.c  (.../tags/gcc_4_8_3_release)    (revision 0)
3403 +++ gcc/testsuite/gcc.target/powerpc/pr63335.c  (.../branches/gcc-4_8-branch)   (revision 217117)
3404 @@ -0,0 +1,30 @@
3405 +/* { dg-do run { target { powerpc64*-*-* } } } */
3406 +/* { dg-require-effective-target powerpc_vsx_ok } */
3407 +/* { dg-options "-mvsx" } */
3408 +
3409 +#include <altivec.h>
3410 +
3411 +void abort (void);
3412 +
3413 +vector double vec = (vector double) {99.0, 99.0};
3414 +
3415 +int main() {
3416 +
3417 +  int actual = vec_all_nge(vec, vec);
3418 +  if ( actual != 0)
3419 +    abort();
3420 +
3421 +  actual = vec_all_nle(vec, vec);
3422 +  if ( actual != 0)
3423 +    abort();
3424 +
3425 +  actual = vec_any_nge(vec, vec);
3426 +  if ( actual != 0)
3427 +    abort();
3428 +
3429 +  actual = vec_any_nle(vec, vec);
3430 +  if ( actual != 0)
3431 +    abort();
3432 +
3433 +  return 0;
3434 +}
3435 Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c
3436 ===================================================================
3437 --- gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
3438 +++ gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c    (.../branches/gcc-4_8-branch)   (revision 217117)
3439 @@ -1,7 +1,7 @@
3440  /* { dg-do compile { target { powerpc*-*-* } } } */
3441  /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3442  /* { dg-require-effective-target powerpc_vsx_ok } */
3443 -/* { dg-options "-O3 -mcpu=power7" } */
3444 +/* { dg-options "-O3 -mcpu=power7 -Wno-deprecated" } */
3445  
3446  /* Test the various load/store varients.  */
3447  
3448 Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
3449 ===================================================================
3450 --- gcc/testsuite/gcc.target/powerpc/tfmode_off.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
3451 +++ gcc/testsuite/gcc.target/powerpc/tfmode_off.c       (.../branches/gcc-4_8-branch)   (revision 217117)
3452 @@ -1,6 +1,7 @@
3453  /* { dg-do assemble } */
3454  /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
3455  /* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
3456 +/* { dg-require-effective-target longdouble128 } */
3457  /* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
3458  
3459  typedef float TFmode __attribute__ ((mode (TF)));
3460 Index: gcc/testsuite/gcc.target/powerpc/pack02.c
3461 ===================================================================
3462 --- gcc/testsuite/gcc.target/powerpc/pack02.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
3463 +++ gcc/testsuite/gcc.target/powerpc/pack02.c   (.../branches/gcc-4_8-branch)   (revision 217117)
3464 @@ -2,6 +2,7 @@
3465  /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3466  /* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
3467  /* { dg-require-effective-target powerpc_fprs } */
3468 +/* { dg-require-effective-target longdouble128 } */
3469  /* { dg-options "-O2 -mhard-float" } */
3470  
3471  #include <stddef.h>
3472 Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
3473 ===================================================================
3474 --- gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../tags/gcc_4_8_3_release)    (revision 0)
3475 +++ gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../branches/gcc-4_8-branch)   (revision 217117)
3476 @@ -0,0 +1,12 @@
3477 +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
3478 +/* { dg-options "-mabi=elfv2" } */
3479 +
3480 +struct f8
3481 +  {
3482 +    float x[8];
3483 +  };
3484 +
3485 +void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
3486 +{
3487 +}
3488 +
3489 Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
3490 ===================================================================
3491 --- gcc/testsuite/gcc.target/powerpc/htm-ttest.c        (.../tags/gcc_4_8_3_release)    (revision 0)
3492 +++ gcc/testsuite/gcc.target/powerpc/htm-ttest.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3493 @@ -0,0 +1,14 @@
3494 +/* { dg-do compile { target { powerpc*-*-* } } } */
3495 +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3496 +/* { dg-require-effective-target powerpc_htm_ok } */
3497 +/* { dg-options "-O2 -mhtm" } */
3498 +
3499 +/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
3500 +/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
3501 +
3502 +#include <htmintrin.h>
3503 +long
3504 +ttest (void)
3505 +{
3506 +  return _HTM_STATE(__builtin_ttest());
3507 +}
3508 Index: gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c
3509 ===================================================================
3510 --- gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c        (.../tags/gcc_4_8_3_release)    (revision 0)
3511 +++ gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3512 @@ -0,0 +1,21 @@
3513 +/* Test expected code generation for lvsl and lvsr on little endian.
3514 +   Note that lvsl and lvsr are each produced once, but the filename
3515 +   causes them to appear twice in the file.  */
3516 +
3517 +/* { dg-do compile { target { powerpc64le-*-* } } } */
3518 +/* { dg-options "-O0 -Wno-deprecated" } */
3519 +/* { dg-final { scan-assembler-times "lvsl" 2 } } */
3520 +/* { dg-final { scan-assembler-times "lvsr" 2 } } */
3521 +/* { dg-final { scan-assembler-times "lxvd2x" 2 } } */
3522 +/* { dg-final { scan-assembler-times "vperm" 2 } } */
3523 +
3524 +
3525 +#include <altivec.h>
3526 +
3527 +float f[20];
3528 +
3529 +void foo ()
3530 +{
3531 +  vector unsigned char a = vec_lvsl (4, f);
3532 +  vector unsigned char b = vec_lvsr (8, f);
3533 +}
3534 Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
3535 ===================================================================
3536 --- gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../tags/gcc_4_8_3_release)    (revision 0)
3537 +++ gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../branches/gcc-4_8-branch)   (revision 217117)
3538 @@ -0,0 +1,12 @@
3539 +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
3540 +/* { dg-options "-mno-compat-align-parm" } */
3541 +
3542 +struct test
3543 +  {
3544 +    long a __attribute__((aligned (16)));
3545 +  };
3546 +
3547 +void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
3548 +{
3549 +}
3550 +
3551 Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
3552 ===================================================================
3553 --- gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../tags/gcc_4_8_3_release)    (revision 0)
3554 +++ gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../branches/gcc-4_8-branch)   (revision 217117)
3555 @@ -0,0 +1,9 @@
3556 +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
3557 +/* { dg-require-effective-target powerpc_altivec_ok } */
3558 +/* { dg-options "-maltivec" } */
3559 +
3560 +struct test
3561 +  {
3562 +    int a __attribute__((vector_size (8)));
3563 +  }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
3564 +
3565 Index: gcc/testsuite/gcc.target/powerpc/altivec-6.c
3566 ===================================================================
3567 --- gcc/testsuite/gcc.target/powerpc/altivec-6.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
3568 +++ gcc/testsuite/gcc.target/powerpc/altivec-6.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3569 @@ -1,6 +1,6 @@
3570  /* { dg-do compile { target powerpc*-*-* } } */
3571  /* { dg-require-effective-target powerpc_altivec_ok } */
3572 -/* { dg-options "-maltivec -O0 -Wall" } */
3573 +/* { dg-options "-maltivec -O0 -Wall -Wno-deprecated" } */
3574  
3575  #include <altivec.h>
3576  
3577 Index: gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c
3578 ===================================================================
3579 --- gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
3580 +++ gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3581 @@ -1,7 +1,7 @@
3582  /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
3583  /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3584  /* { dg-require-effective-target powerpc_altivec_ok } */
3585 -/* { dg-options "-maltivec -O2" } */
3586 +/* { dg-options "-maltivec -O2 -Wno-deprecated" } */
3587  
3588  #include <altivec.h>
3589  
3590 Index: gcc/testsuite/gcc.target/powerpc/altivec-20.c
3591 ===================================================================
3592 --- gcc/testsuite/gcc.target/powerpc/altivec-20.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
3593 +++ gcc/testsuite/gcc.target/powerpc/altivec-20.c       (.../branches/gcc-4_8-branch)   (revision 217117)
3594 @@ -1,5 +1,5 @@
3595  /* { dg-do compile { target powerpc_altivec_ok } } */
3596 -/* { dg-options "-maltivec -mcpu=G5 -O2" } */
3597 +/* { dg-options "-maltivec -mcpu=G5 -O2 -Wno-deprecated" } */
3598  
3599  #include <altivec.h>
3600  
3601 Index: gcc/testsuite/gcc.target/alpha/pr61586.c
3602 ===================================================================
3603 --- gcc/testsuite/gcc.target/alpha/pr61586.c    (.../tags/gcc_4_8_3_release)    (revision 0)
3604 +++ gcc/testsuite/gcc.target/alpha/pr61586.c    (.../branches/gcc-4_8-branch)   (revision 217117)
3605 @@ -0,0 +1,10 @@
3606 +/* { dg-do compile } */
3607 +/* { dg-options "-O2 -mieee" } */
3608 +
3609 +void foo (int *dimensions, double **params, int hh)
3610 +{
3611 +  if (params[hh])
3612 +    ;
3613 +  else if (dimensions[hh] > 0)
3614 +    params[hh][0] = 1.0f;
3615 +}
3616 Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
3617 ===================================================================
3618 --- gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c        (.../tags/gcc_4_8_3_release)    (revision 0)
3619 +++ gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3620 @@ -0,0 +1,35 @@
3621 +/* Test AAPCS64 layout and __builtin_va_start.
3622 +
3623 +   Pass named HFA/HVA argument on stack.  */
3624 +
3625 +/* { dg-do run { target aarch64*-*-* } } */
3626 +
3627 +#ifndef IN_FRAMEWORK
3628 +#define AAPCS64_TEST_STDARG
3629 +#define TESTFILE "va_arg-14.c"
3630 +#include "type-def.h"
3631 +
3632 +struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
3633 +struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
3634 +vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
3635 +vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
3636 +
3637 +#include "abitest.h"
3638 +#else
3639 +  ARG (float, 1.0f, S0, 0)
3640 +  ARG (float, 2.0f, S1, 1)
3641 +  ARG (float, 3.0f, S2, 2)
3642 +  ARG (float, 4.0f, S3, 3)
3643 +  ARG (float, 5.0f, S4, 4)
3644 +  ARG (float, 6.0f, S5, 5)
3645 +  ARG (float, 7.0f, S6, 6)
3646 +  ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
3647 +  /* Previous argument size has been rounded up to the nearest multiple of
3648 +     8 bytes.  */
3649 +  ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
3650 +  /* NSAA is rounded up to the nearest natural alignment of float32x4.  */
3651 +  ARG (vf4_t, float32x4, STACK + 32, 9)
3652 +  ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
3653 +  DOTS
3654 +  LAST_ANON (double, 123456789.987, STACK + 64, 11)
3655 +#endif
3656 Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
3657 ===================================================================
3658 --- gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../tags/gcc_4_8_3_release)    (revision 217117)
3659 +++ gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../branches/gcc-4_8-branch)   (revision 217117)
3660 @@ -34,6 +34,13 @@
3661    float b;
3662  };
3663  
3664 +struct hfa_fx3_t
3665 +{
3666 +  float a;
3667 +  float b;
3668 +  float c;
3669 +};
3670 +
3671  struct hfa_dx2_t
3672  {
3673    double a;
3674 Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
3675 ===================================================================
3676 --- gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c        (.../tags/gcc_4_8_3_release)    (revision 0)
3677 +++ gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3678 @@ -0,0 +1,59 @@
3679 +/* Test AAPCS64 layout and __builtin_va_start.
3680 +
3681 +   Pass named HFA/HVA argument on stack.  */
3682 +
3683 +/* { dg-do run { target aarch64*-*-* } } */
3684 +
3685 +#ifndef IN_FRAMEWORK
3686 +#define AAPCS64_TEST_STDARG
3687 +#define TESTFILE "va_arg-13.c"
3688 +
3689 +struct float_float_t
3690 +{
3691 +  float a;
3692 +  float b;
3693 +} float_float;
3694 +
3695 +union float_int_t
3696 +{
3697 +  float b8;
3698 +  int b5;
3699 +} float_int;
3700 +
3701 +#define HAS_DATA_INIT_FUNC
3702 +void
3703 +init_data ()
3704 +{
3705 +  float_float.a = 1.2f;
3706 +  float_float.b = 2.2f;
3707 +
3708 +  float_int.b8 = 4983.80f;
3709 +}
3710 +
3711 +#include "abitest.h"
3712 +#else
3713 +  ARG (float, 1.0f, S0, 0)
3714 +  ARG (float, 2.0f, S1, 1)
3715 +  ARG (float, 3.0f, S2, 2)
3716 +  ARG (float, 4.0f, S3, 3)
3717 +  ARG (float, 5.0f, S4, 4)
3718 +  ARG (float, 6.0f, S5, 5)
3719 +  ARG (float, 7.0f, S6, 6)
3720 +  ARG (struct float_float_t, float_float, STACK, 7)
3721 +  ARG (int,  9, W0, 8)
3722 +  ARG (int, 10, W1, 9)
3723 +  ARG (int, 11, W2, 10)
3724 +  ARG (int, 12, W3, 11)
3725 +  ARG (int, 13, W4, 12)
3726 +  ARG (int, 14, W5, 13)
3727 +  ARG (int, 15, W6, LAST_NAMED_ARG_ID)
3728 +  DOTS
3729 +  /* Note on the reason of using 'X7' instead of 'W7' here:
3730 +     Using 'X7' makes sure the test works in the big-endian mode.
3731 +     According to PCS rules B.4 and C.10, the size of float_int is rounded
3732 +     to 8 bytes and prepared in the register X7 as if loaded via LDR from
3733 +     the memory, with the content of the other 4 bytes unspecified.  The
3734 +     test framework will only compare the 4 relavent bytes.  */
3735 +  ANON (union float_int_t, float_int, X7, 15)
3736 +  LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
3737 +#endif
3738 Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
3739 ===================================================================
3740 --- gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c        (.../tags/gcc_4_8_3_release)    (revision 0)
3741 +++ gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c        (.../branches/gcc-4_8-branch)   (revision 217117)
3742 @@ -0,0 +1,39 @@
3743 +/* Test AAPCS64 layout and __builtin_va_start.
3744 +
3745 +   Pass named __128int argument on stack.  */
3746 +
3747 +/* { dg-do run { target aarch64*-*-* } } */
3748 +
3749 +#ifndef IN_FRAMEWORK
3750 +#define AAPCS64_TEST_STDARG
3751 +#define TESTFILE "va_arg-15.c"
3752 +#include "type-def.h"
3753 +
3754 +union int128_t qword;
3755 +
3756 +#define HAS_DATA_INIT_FUNC
3757 +void
3758 +init_data ()
3759 +{
3760 +  /* Init signed quad-word integer.  */
3761 +  qword.l64 = 0xfdb9753102468aceLL;
3762 +  qword.h64 = 0xeca8642013579bdfLL;
3763 +}
3764 +
3765 +#include "abitest.h"
3766 +#else
3767 +  ARG (int, 1, W0, 0)
3768 +  ARG (int, 2, W1, 1)
3769 +  ARG (int, 3, W2, 2)
3770 +  ARG (int, 4, W3, 3)
3771 +  ARG (int, 5, W4, 4)
3772 +  ARG (int, 6, W5, 5)
3773 +  ARG (int, 7, W6, 6)
3774 +  ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
3775 +  DOTS
3776 +#ifndef __AAPCS64_BIG_ENDIAN__
3777 +  LAST_ANON (int, 8, STACK + 16, 8)
3778 +#else
3779 +  LAST_ANON (int, 8, STACK + 20, 8)
3780 +#endif
3781 +#endif
3782 Index: gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c
3783 ===================================================================
3784 --- gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c (.../tags/gcc_4_8_3_release)    (revision 0)
3785 +++ gcc/testsuite/gcc.target/aarch64/madd_after_asm_1.c (.../branches/gcc-4_8-branch)   (revision 217117)
3786 @@ -0,0 +1,14 @@
3787 +/* { dg-do assemble } */
3788 +/* { dg-options "-O2 -mfix-cortex-a53-835769" } */
3789 +
3790 +int
3791 +test (int a, double b, int c, int d, int e)
3792 +{
3793 +  double result;
3794 +  __asm__ __volatile ("// %0, %1"
3795 +                      : "=w" (result)
3796 +                      : "0" (b)
3797 +                      :    /* No clobbers */
3798 +                      );
3799 +  return c * d + e;
3800 +}
3801 Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
3802 ===================================================================
3803 --- gcc/testsuite/gcc.target/avr/torture/pr61443.c      (.../tags/gcc_4_8_3_release)    (revision 0)
3804 +++ gcc/testsuite/gcc.target/avr/torture/pr61443.c      (.../branches/gcc-4_8-branch)   (revision 217117)
3805 @@ -0,0 +1,134 @@
3806 +/* { dg-do run } */
3807 +/* { dg-options "-std=gnu99" } */
3808 +
3809 +#include <stdlib.h>
3810 +#include <stdarg.h>
3811 +
3812 +#define NC __attribute__((noinline,noclone))
3813 +
3814 +void NC vfun (char n, ...)
3815 +{
3816 +  va_list ap;
3817 +
3818 +  va_start (ap, n);
3819 +
3820 +  switch (n)
3821 +    {
3822 +    default:
3823 +      abort();
3824 +    case 1:
3825 +      if (11 != va_arg (ap, int))
3826 +        abort();
3827 +      break;
3828 +    case 2:
3829 +      if (2222 != va_arg (ap, int))
3830 +        abort();
3831 +      break;
3832 +    case 3:
3833 +      if (333333 != va_arg (ap, __int24))
3834 +        abort();
3835 +      break;
3836 +    case 4:
3837 +      if (44444444 != va_arg (ap, long))
3838 +        abort();
3839 +      break;
3840 +    case 8:
3841 +      if (8888888888888888 != va_arg (ap, long long))
3842 +        abort();
3843 +      break;
3844 +    }
3845 +
3846 +  va_end (ap);
3847 +}
3848 +
3849 +
3850 +void NC boo_qi (const __flash char *p)
3851 +{
3852 +  vfun (1, *p);
3853 +}
3854 +
3855 +void NC boox_qi (const __memx char *p)
3856 +{
3857 +  vfun (1, *p);
3858 +}
3859 +
3860 +void NC boo_hi (const __flash int *p)
3861 +{
3862 +  vfun (2, *p);
3863 +}
3864 +
3865 +void NC boox_hi (const __memx int *p)
3866 +{
3867 +  vfun (2, *p);
3868 +}
3869 +
3870 +void NC boo_psi (const __flash __int24 *p)
3871 +{
3872 +  vfun (3, *p);
3873 +}
3874 +
3875 +void NC boox_psi (const __memx __int24 *p)
3876 +{
3877 +  vfun (3, *p);
3878 +}
3879 +
3880 +void NC boo_si (const __flash long *p)
3881 +{
3882 +  vfun (4, *p);
3883 +}
3884 +
3885 +void NC boox_si (const __memx long *p)
3886 +{
3887 +  vfun (4, *p);
3888 +}
3889 +
3890 +void NC boo_di (const __flash long long *p)
3891 +{
3892 +  vfun (8, *p);
3893 +}
3894 +
3895 +void NC boox_di (const __memx long long *p)
3896 +{
3897 +  vfun (8, *p);
3898 +}
3899 +
3900 +const __flash char f_qi = 11;
3901 +const __flash int f_hi = 2222;
3902 +const __flash __int24 f_psi = 333333;
3903 +const __flash long f_si = 44444444;
3904 +const __flash long long f_di = 8888888888888888;
3905 +
3906 +const __memx char x_qi = 11;
3907 +const __memx int x_hi = 2222;
3908 +const __memx __int24 x_psi = 333333;
3909 +const __memx long x_si = 44444444;
3910 +const __memx long long x_di = 8888888888888888;
3911 +
3912 +char r_qi = 11;
3913 +int r_hi = 2222;
3914 +__int24 r_psi = 333333;
3915 +long r_si = 44444444;
3916 +long long r_di = 8888888888888888;
3917 +
3918 +int main (void)
3919 +{
3920 +  boo_qi (&f_qi);
3921 +  boo_hi (&f_hi);
3922 +  boo_psi (&f_psi);
3923 +  boo_si (&f_si);
3924 +  boo_di (&f_di);
3925 +
3926 +  boox_qi (&x_qi);
3927 +  boox_hi (&x_hi);
3928 +  boox_psi (&x_psi);
3929 +  boox_si (&x_si);
3930 +  boox_di (&x_di);
3931 +
3932 +  boox_qi (&r_qi);
3933 +  boox_hi (&r_hi);
3934 +  boox_psi (&r_psi);
3935 +  boox_si (&r_si);
3936 +  boox_di (&r_di);
3937 +
3938 +  exit (0);
3939 +}
3940 Index: gcc/testsuite/gcc.target/i386/pr61923.c
3941 ===================================================================
3942 --- gcc/testsuite/gcc.target/i386/pr61923.c     (.../tags/gcc_4_8_3_release)    (revision 0)
3943 +++ gcc/testsuite/gcc.target/i386/pr61923.c     (.../branches/gcc-4_8-branch)   (revision 217117)
3944 @@ -0,0 +1,36 @@
3945 +/* PR debug/61923 */
3946 +/* { dg-do compile } */
3947 +/* { dg-options "-O2 -fcompare-debug" } */
3948 +
3949 +typedef struct
3950 +{
3951 +  struct
3952 +  {
3953 +    struct
3954 +    {
3955 +      char head;
3956 +    } tickets;
3957 +  };
3958 +} arch_spinlock_t;
3959 +struct ext4_map_blocks
3960 +{
3961 +  int m_lblk;
3962 +  int m_len;
3963 +  int m_flags;
3964 +};
3965 +int ext4_da_map_blocks_ei_0;
3966 +void fn1 (int p1, struct ext4_map_blocks *p2)
3967 +{
3968 +  int ret;
3969 +  if (p2->m_flags)
3970 +    {
3971 +      ext4_da_map_blocks_ei_0++;
3972 +      arch_spinlock_t *lock;
3973 +      switch (sizeof *&lock->tickets.head)
3974 +      case 1:
3975 +      asm("" : "+m"(*&lock->tickets.head) : ""(0));
3976 +      __asm__("");
3977 +      ret = 0;
3978 +    }
3979 +  fn2 (p2->m_lblk, p2->m_len);
3980 +}
3981 Index: gcc/testsuite/gcc.target/i386/pr61423.c
3982 ===================================================================
3983 --- gcc/testsuite/gcc.target/i386/pr61423.c     (.../tags/gcc_4_8_3_release)    (revision 0)
3984 +++ gcc/testsuite/gcc.target/i386/pr61423.c     (.../branches/gcc-4_8-branch)   (revision 217117)
3985 @@ -0,0 +1,38 @@
3986 +/* PR target/61423 */
3987 +/* { dg-do run { target ia32 } } */
3988 +/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
3989 +
3990 +#define N 1024
3991 +static unsigned int A[N];
3992 +
3993 +double
3994 +__attribute__((noinline))
3995 +func (void)
3996 +{
3997 +  unsigned int sum = 0;
3998 +  unsigned i;
3999 +  double t;
4000 +
4001 +  for (i = 0; i < N; i++)
4002 +    sum += A[i];
4003 +
4004 +  t = sum;
4005 +  return t;
4006 +}
4007 +
4008 +int
4009 +main ()
4010 +{
4011 +  unsigned i;
4012 +  double d;
4013 +
4014 +  for(i = 0; i < N; i++)
4015 +    A[i] = 1;
4016 +
4017 +  d = func();
4018 +
4019 +  if (d != 1024.0)
4020 +    __builtin_abort ();
4021 +
4022 +  return 0;
4023 +}
4024 Index: gcc/testsuite/gcc.target/i386/pr60901.c
4025 ===================================================================
4026 --- gcc/testsuite/gcc.target/i386/pr60901.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4027 +++ gcc/testsuite/gcc.target/i386/pr60901.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4028 @@ -0,0 +1,17 @@
4029 +/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts"  } */
4030 +
4031 +extern int n;
4032 +extern void bar (void);
4033 +extern int baz (int);
4034 +
4035 +void
4036 +foo (void)
4037 +{
4038 +  int i, j;
4039 +  for (j = 0; j < n; j++)
4040 +    {
4041 +      for (i = 1; i < j; i++)
4042 +       bar ();
4043 +      baz (0);
4044 +    }
4045 +}
4046 Index: gcc/testsuite/gcc.target/i386/pr61801.c
4047 ===================================================================
4048 --- gcc/testsuite/gcc.target/i386/pr61801.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4049 +++ gcc/testsuite/gcc.target/i386/pr61801.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4050 @@ -0,0 +1,21 @@
4051 +/* PR rtl-optimization/61801 */
4052 +/* { dg-do compile } */
4053 +/* { dg-options "-Os -fcompare-debug" } */
4054 +
4055 +int a, c;
4056 +int bar (void);
4057 +void baz (void);
4058 +
4059 +void
4060 +foo (void)
4061 +{
4062 +  int d;
4063 +  if (bar ())
4064 +    {
4065 +      int e;
4066 +      baz ();
4067 +      asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
4068 +      d = e;
4069 +    }
4070 +  c = d;
4071 +}
4072 Index: gcc/testsuite/gcc.target/i386/pr61446.c
4073 ===================================================================
4074 --- gcc/testsuite/gcc.target/i386/pr61446.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4075 +++ gcc/testsuite/gcc.target/i386/pr61446.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4076 @@ -0,0 +1,14 @@
4077 +/* PR rtl-optimization/61446 */
4078 +
4079 +/* { dg-do compile { target { ia32 } } } */
4080 +/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
4081 +
4082 +unsigned long long
4083 +foo (float a)
4084 +{
4085 +  const double dfa = a;
4086 +  const unsigned int hi = dfa / 0x1p32f;
4087 +  const unsigned int lo = dfa - (double) hi * 0x1p32f;
4088 +
4089 +  return ((unsigned long long) hi << (4 * (8))) | lo;
4090 +}
4091 Index: gcc/testsuite/gcc.target/mips/pr62030-octeon.c
4092 ===================================================================
4093 --- gcc/testsuite/gcc.target/mips/pr62030-octeon.c      (.../tags/gcc_4_8_3_release)    (revision 0)
4094 +++ gcc/testsuite/gcc.target/mips/pr62030-octeon.c      (.../branches/gcc-4_8-branch)   (revision 217117)
4095 @@ -0,0 +1,50 @@
4096 +/* { dg-do run } */
4097 +/* { dg-options "-march=octeon" } */
4098 +
4099 +extern void abort (void);
4100 +
4101 +struct node
4102 +{
4103 +  struct node *next;
4104 +  struct node *prev;
4105 +};
4106 +
4107 +struct node node;
4108 +
4109 +struct head
4110 +{
4111 +  struct node *first;
4112 +};
4113 +
4114 +struct head heads[5];
4115 +
4116 +int k = 2;
4117 +
4118 +struct head *head = &heads[2];
4119 +
4120 +static int __attribute__((noinline))
4121 +foo (void)
4122 +{
4123 +  node.prev = (void *)head;
4124 +  head->first = &node;
4125 +
4126 +  struct node *n = head->first;
4127 +  struct head *h = &heads[k];
4128 +  struct node *next = n->next;
4129 +
4130 +  if (n->prev == (void *)h)
4131 +    h->first = next;
4132 +  else
4133 +    n->prev->next = next;
4134 +
4135 +  n->next = h->first;
4136 +  return n->next == &node;
4137 +}
4138 +
4139 +int
4140 +main (void)
4141 +{
4142 +  if (foo ())
4143 +    abort ();
4144 +  return 0;
4145 +}
4146 Index: gcc/testsuite/gcc.target/sh/pr61996.c
4147 ===================================================================
4148 --- gcc/testsuite/gcc.target/sh/pr61996.c       (.../tags/gcc_4_8_3_release)    (revision 0)
4149 +++ gcc/testsuite/gcc.target/sh/pr61996.c       (.../branches/gcc-4_8-branch)   (revision 217117)
4150 @@ -0,0 +1,12 @@
4151 +/* Check that the option -musermode has no effect on targets that do not
4152 +   support user/privileged mode and that it does not interfere with option
4153 +   -matomic-model=soft-imask.  */
4154 +/* { dg-do compile }  */
4155 +/* { dg-options "-matomic-model=soft-imask" }  */
4156 +/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } }  */
4157 +
4158 +int
4159 +test (void)
4160 +{
4161 +  return 0;
4162 +}
4163 Index: gcc/testsuite/lib/target-supports.exp
4164 ===================================================================
4165 --- gcc/testsuite/lib/target-supports.exp       (.../tags/gcc_4_8_3_release)    (revision 217117)
4166 +++ gcc/testsuite/lib/target-supports.exp       (.../branches/gcc-4_8-branch)   (revision 217117)
4167 @@ -1790,6 +1790,15 @@
4168      }]
4169  }
4170  
4171 +# Return 1 if the target supports long double of 128 bits,
4172 +# 0 otherwise.
4173 +
4174 +proc check_effective_target_longdouble128 { } {
4175 +    return [check_no_compiler_messages longdouble128 object {
4176 +       int dummy[sizeof(long double) == 16 ? 1 : -1];
4177 +    }]
4178 +}
4179 +
4180  # Return 1 if the target supports double of 64 bits,
4181  # 0 otherwise.
4182  
4183 @@ -5329,3 +5338,40 @@
4184         return 0
4185      }
4186  }
4187 +
4188 +# Return 1 if <fenv.h> is available with all the standard IEEE
4189 +# exceptions and floating-point exceptions are raised by arithmetic
4190 +# operations.  (If the target requires special options for "inexact"
4191 +# exceptions, those need to be specified in the testcases.)
4192 +
4193 +proc check_effective_target_fenv_exceptions {} {
4194 +    return [check_runtime fenv_exceptions {
4195 +       #include <fenv.h>
4196 +       #include <stdlib.h>
4197 +       #ifndef FE_DIVBYZERO
4198 +       # error Missing FE_DIVBYZERO
4199 +       #endif
4200 +       #ifndef FE_INEXACT
4201 +       # error Missing FE_INEXACT
4202 +       #endif
4203 +       #ifndef FE_INVALID
4204 +       # error Missing FE_INVALID
4205 +       #endif
4206 +       #ifndef FE_OVERFLOW
4207 +       # error Missing FE_OVERFLOW
4208 +       #endif
4209 +       #ifndef FE_UNDERFLOW
4210 +       # error Missing FE_UNDERFLOW
4211 +       #endif
4212 +       volatile float a = 0.0f, r;
4213 +       int
4214 +       main (void)
4215 +       {
4216 +         r = a / a;
4217 +         if (fetestexcept (FE_INVALID))
4218 +           exit (0);
4219 +         else
4220 +           abort ();
4221 +       }
4222 +    } "-std=gnu99"]
4223 +}
4224 Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
4225 ===================================================================
4226 --- gcc/testsuite/gfortran.dg/default_format_denormal_2.f90     (.../tags/gcc_4_8_3_release)    (revision 217117)
4227 +++ gcc/testsuite/gfortran.dg/default_format_denormal_2.f90     (.../branches/gcc-4_8-branch)   (revision 217117)
4228 @@ -1,6 +1,6 @@
4229  ! { dg-require-effective-target fortran_large_real }
4230 -! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
4231 -! Test XFAILed on these platforms because the system's printf() lacks
4232 +! { dg-do run { xfail powerpc*-apple-darwin* } }
4233 +! Test XFAILed on this platform because the system's printf() lacks
4234  ! proper support for denormalized long doubles. See PR24685
4235  !
4236  ! This tests that the default formats for formatted I/O of reals are
4237 Index: gcc/testsuite/gfortran.dg/dot_product_3.f90
4238 ===================================================================
4239 --- gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../tags/gcc_4_8_3_release)    (revision 0)
4240 +++ gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../branches/gcc-4_8-branch)   (revision 217117)
4241 @@ -0,0 +1,15 @@
4242 +! { dg-do compile }
4243 +! { dg-options "-fdump-tree-original" }
4244 +! PR 61999 - this used to ICE.
4245 +! Original test case by A. Kasahara
4246 +program main
4247 +   use, intrinsic:: iso_fortran_env, only: output_unit
4248 +
4249 +   implicit none
4250 +
4251 +   write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
4252 +
4253 +   stop
4254 +end program main
4255 +! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
4256 +! { dg-final { cleanup-tree-dump "original" } }
4257 Index: gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90
4258 ===================================================================
4259 --- gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90        (.../tags/gcc_4_8_3_release)    (revision 0)
4260 +++ gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90        (.../branches/gcc-4_8-branch)   (revision 217117)
4261 @@ -0,0 +1,13 @@
4262 +! PR fortran/59488
4263 +! { dg-do compile }
4264 +! { dg-options "-fopenmp" }
4265 +
4266 +  implicit none
4267 +  integer, parameter :: p(2) = (/ 11, 12 /)
4268 +  integer :: r
4269 +
4270 +  !$omp parallel do default(none)
4271 +  do r = 1, 2
4272 +    print *, p(r)
4273 +  end do
4274 +end
4275 Index: gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90
4276 ===================================================================
4277 --- gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90        (.../tags/gcc_4_8_3_release)    (revision 0)
4278 +++ gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90        (.../branches/gcc-4_8-branch)   (revision 217117)
4279 @@ -0,0 +1,16 @@
4280 +! PR fortran/59488
4281 +! { dg-do compile }
4282 +! { dg-options "-fopenmp" }
4283 +
4284 +  implicit none
4285 +  type t
4286 +    integer :: s1, s2, s3
4287 +  end type
4288 +  integer :: r
4289 +  type(t), parameter :: u = t(1, 2, 3)
4290 +
4291 +  !$omp parallel do default(none)
4292 +  do r = 1, 2
4293 +    print *, u
4294 +  end do
4295 +end
4296 Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
4297 ===================================================================
4298 --- gcc/testsuite/gfortran.dg/cray_pointers_10.f90      (.../tags/gcc_4_8_3_release)    (revision 0)
4299 +++ gcc/testsuite/gfortran.dg/cray_pointers_10.f90      (.../branches/gcc-4_8-branch)   (revision 217117)
4300 @@ -0,0 +1,18 @@
4301 +! { dg-do run }
4302 +! { dg-options "-fcray-pointer" }
4303 +!
4304 +! PR fortran/45187
4305 +!
4306 +module foo
4307 +  implicit none
4308 +  real :: a
4309 +  pointer(c_a, a)
4310 +end module foo
4311 +
4312 +program test
4313 +  use foo
4314 +  real :: z
4315 +  c_a = loc(z)
4316 +  a = 42
4317 +  if (z /= 42) call abort
4318 +end program test
4319 Index: gcc/testsuite/gfortran.dg/dependency_44.f90
4320 ===================================================================
4321 --- gcc/testsuite/gfortran.dg/dependency_44.f90 (.../tags/gcc_4_8_3_release)    (revision 0)
4322 +++ gcc/testsuite/gfortran.dg/dependency_44.f90 (.../branches/gcc-4_8-branch)   (revision 217117)
4323 @@ -0,0 +1,36 @@
4324 +! { dg-do run }
4325 +! Tests fix for PR61780 in which the loop reversal mechanism was
4326 +! not accounting for the first index being an element so that no
4327 +! loop in this dimension is created.
4328 +!
4329 +! Contributed by Manfred Tietze on clf.
4330 +!
4331 +program prgm3
4332 +    implicit none
4333 +    integer, parameter :: n = 10, k = 3
4334 +    integer :: i, j
4335 +    integer, dimension(n,n) :: y
4336 +    integer :: res1(n), res2(n)
4337 +
4338 +1   format(10i5)
4339 +
4340 +!initialize
4341 +    do i=1,n
4342 +        do j=1,n
4343 +            y(i,j) = n*i + j
4344 +        end do
4345 +    end do
4346 +    res2 = y(k,:)
4347 +
4348 +!shift right
4349 +    y(k,4:n) = y(k,3:n-1)
4350 +    y(k,3) = 0
4351 +    res1 = y(k,:)
4352 +    y(k,:) = res2
4353 +    y(k,n:4:-1) = y(k,n-1:3:-1)
4354 +    y(k,3) = 0
4355 +    res2 = y(k,:)
4356 +!    print *, res1
4357 +!    print *, res2
4358 +    if (any(res1 /= res2)) call abort ()
4359 +end program prgm3
4360 Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
4361 ===================================================================
4362 --- gcc/testsuite/gfortran.dg/oldstyle_5.f      (.../tags/gcc_4_8_3_release)    (revision 0)
4363 +++ gcc/testsuite/gfortran.dg/oldstyle_5.f      (.../branches/gcc-4_8-branch)   (revision 217117)
4364 @@ -0,0 +1,8 @@
4365 +C { dg-do compile }
4366 +      TYPE T
4367 +      INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
4368 +      END TYPE
4369 +      TYPE S
4370 +      INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
4371 +      END TYPE
4372 +      END
4373 Index: gcc/testsuite/gfortran.dg/nint_2.f90
4374 ===================================================================
4375 --- gcc/testsuite/gfortran.dg/nint_2.f90        (.../tags/gcc_4_8_3_release)    (revision 217117)
4376 +++ gcc/testsuite/gfortran.dg/nint_2.f90        (.../branches/gcc-4_8-branch)   (revision 217117)
4377 @@ -4,7 +4,8 @@
4378  ! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
4379  !
4380  ! { dg-do run }
4381 -! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
4382 +! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
4383 +! Note that this doesn't fail on powerpc64le-*-linux*.
4384    real(kind=8) :: a
4385    integer(kind=8) :: i1, i2
4386    real :: b
4387 Index: gcc/testsuite/gfortran.dg/pointer_intent_7.f90
4388 ===================================================================
4389 --- gcc/testsuite/gfortran.dg/pointer_intent_7.f90      (.../tags/gcc_4_8_3_release)    (revision 217117)
4390 +++ gcc/testsuite/gfortran.dg/pointer_intent_7.f90      (.../branches/gcc-4_8-branch)   (revision 217117)
4391 @@ -23,7 +23,7 @@
4392      call bar2 (c)
4393      call bar3 (c)
4394      call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
4395 -    call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
4396 +    call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
4397      call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
4398      call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
4399    end subroutine
4400 Index: gcc/testsuite/gfortran.dg/array_assignment_5.f90
4401 ===================================================================
4402 --- gcc/testsuite/gfortran.dg/array_assignment_5.f90    (.../tags/gcc_4_8_3_release)    (revision 0)
4403 +++ gcc/testsuite/gfortran.dg/array_assignment_5.f90    (.../branches/gcc-4_8-branch)   (revision 217117)
4404 @@ -0,0 +1,16 @@
4405 +! { dg-do run }
4406 +! { dg-options "-ffrontend-optimize" }
4407 +! PR 62214 - this used to give the wrong result.
4408 +! Original test case by Oliver Fuhrer
4409 +PROGRAM test
4410 +  IMPLICIT NONE
4411 +  CHARACTER(LEN=20)   :: fullNames(2)
4412 +  CHARACTER(LEN=255)  :: pathName
4413 +  CHARACTER(LEN=5)    :: fileNames(2)
4414 +  
4415 +  pathName = "/dir1/dir2/"
4416 +  fileNames = (/ "file1", "file2" /)
4417 +  fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
4418 +  if (fullNames(1) /= '/dir1/dir2/file1' .or. &
4419 +       & fullnames(2) /= '/dir1/dir2/file2') call abort
4420 +END PROGRAM test
4421 Index: gcc/testsuite/gfortran.dg/pr45636.f90
4422 ===================================================================
4423 --- gcc/testsuite/gfortran.dg/pr45636.f90       (.../tags/gcc_4_8_3_release)    (revision 217117)
4424 +++ gcc/testsuite/gfortran.dg/pr45636.f90       (.../branches/gcc-4_8-branch)   (revision 217117)
4425 @@ -10,5 +10,5 @@
4426    b = y
4427    call sub(a, b)
4428  end program main
4429 -! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
4430 +! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
4431  ! { dg-final { cleanup-tree-dump "forwprop2" } }
4432 Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
4433 ===================================================================
4434 --- gcc/testsuite/gfortran.dg/allocatable_function_8.f90        (.../tags/gcc_4_8_3_release)    (revision 0)
4435 +++ gcc/testsuite/gfortran.dg/allocatable_function_8.f90        (.../branches/gcc-4_8-branch)   (revision 217117)
4436 @@ -0,0 +1,47 @@
4437 +! { dg-do run }
4438 +! Test the fix for PR61459.
4439 +!
4440 +! Contributed by John Wingate  <johnww@tds.net>
4441 +!
4442 +module a
4443 +
4444 +   implicit none
4445 +   private
4446 +   public :: f_segfault, f_segfault_plus, f_workaround
4447 +   integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
4448 +
4449 +contains
4450 +
4451 +   function f_segfault(x)
4452 +      real, dimension(:), allocatable :: f_segfault
4453 +      real, dimension(:), intent(in)  :: x
4454 +      allocate(f_segfault(2))
4455 +      f_segfault = matmul(b,x)
4456 +   end function f_segfault
4457 +
4458 +! Sefaulted without the ALLOCATE as well.
4459 +   function f_segfault_plus(x)
4460 +      real, dimension(:), allocatable :: f_segfault_plus
4461 +      real, dimension(:), intent(in)  :: x
4462 +      f_segfault_plus = matmul(b,x)
4463 +   end function f_segfault_plus
4464 +
4465 +   function f_workaround(x)
4466 +      real, dimension(:), allocatable :: f_workaround
4467 +      real, dimension(:), intent(in)  :: x
4468 +      real, dimension(:), allocatable :: tmp
4469 +      allocate(f_workaround(2),tmp(2))
4470 +      tmp = matmul(b,x)
4471 +      f_workaround = tmp
4472 +   end function f_workaround
4473 +
4474 +end module a
4475 +
4476 +program main
4477 +   use a
4478 +   implicit none
4479 +   real, dimension(2) :: x = 1.0, y
4480 +   y = f_workaround (x)
4481 +   if (any (f_segfault (x) .ne. y)) call abort
4482 +   if (any (f_segfault_plus (x) .ne. y)) call abort
4483 +end program main
4484 Index: gcc/testsuite/gfortran.dg/bessel_7.f90
4485 ===================================================================
4486 --- gcc/testsuite/gfortran.dg/bessel_7.f90      (.../tags/gcc_4_8_3_release)    (revision 217117)
4487 +++ gcc/testsuite/gfortran.dg/bessel_7.f90      (.../branches/gcc-4_8-branch)   (revision 217117)
4488 @@ -16,7 +16,7 @@
4489  implicit none
4490  real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] 
4491  real,parameter :: myeps(size(values)) = epsilon(0.0) &
4492 -                  * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
4493 +                  * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
4494  ! The following is sufficient for me - the values above are a bit
4495  ! more tolerant
4496  !                  * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
4497 Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
4498 ===================================================================
4499 --- gcc/testsuite/gcc.c-torture/execute/pr61306-1.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4500 +++ gcc/testsuite/gcc.c-torture/execute/pr61306-1.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4501 @@ -0,0 +1,39 @@
4502 +#ifdef __INT32_TYPE__
4503 +typedef __INT32_TYPE__ int32_t;
4504 +#else
4505 +typedef int int32_t;
4506 +#endif
4507 +
4508 +#ifdef __UINT32_TYPE__
4509 +typedef __UINT32_TYPE__ uint32_t;
4510 +#else
4511 +typedef unsigned uint32_t;
4512 +#endif
4513 +
4514 +#define __fake_const_swab32(x) ((uint32_t)(                  \
4515 +       (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |    \
4516 +       (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |    \
4517 +       (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |    \
4518 +       (( (int32_t)(x) &  (int32_t)0xff000000UL) >> 24)))
4519 +
4520 +/* Previous version of bswap optimization failed to consider sign extension
4521 +   and as a result would replace an expression *not* doing a bswap by a
4522 +   bswap.  */
4523 +
4524 +__attribute__ ((noinline, noclone)) uint32_t
4525 +fake_bswap32 (uint32_t in)
4526 +{
4527 +  return __fake_const_swab32 (in);
4528 +}
4529 +
4530 +int
4531 +main(void)
4532 +{
4533 +  if (sizeof (int32_t) * __CHAR_BIT__ != 32)
4534 +    return 0;
4535 +  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
4536 +    return 0;
4537 +  if (fake_bswap32 (0x87654321) != 0xffffff87)
4538 +    __builtin_abort ();
4539 +  return 0;
4540 +}
4541 Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
4542 ===================================================================
4543 --- gcc/testsuite/gcc.c-torture/execute/pr23135.x       (.../tags/gcc_4_8_3_release)    (revision 0)
4544 +++ gcc/testsuite/gcc.c-torture/execute/pr23135.x       (.../branches/gcc-4_8-branch)   (revision 217117)
4545 @@ -0,0 +1,2 @@
4546 +set additional_flags "-Wno-psabi"
4547 +return 0
4548 Index: gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
4549 ===================================================================
4550 --- gcc/testsuite/gcc.c-torture/execute/bitfld-6.c      (.../tags/gcc_4_8_3_release)    (revision 0)
4551 +++ gcc/testsuite/gcc.c-torture/execute/bitfld-6.c      (.../branches/gcc-4_8-branch)   (revision 217117)
4552 @@ -0,0 +1,23 @@
4553 +union U
4554 +{
4555 +  const int a;
4556 +  unsigned b : 20;
4557 +};
4558 +
4559 +static union U u = { 0x12345678 };
4560 +
4561 +/* Constant folding used to fail to account for endianness when folding a
4562 +   union.  */
4563 +
4564 +int
4565 +main (void)
4566 +{
4567 +#ifdef __BYTE_ORDER__
4568 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4569 +  return u.b - 0x45678;
4570 +#else
4571 +  return u.b - 0x12345;
4572 +#endif
4573 +#endif
4574 +  return 0;
4575 +}
4576 Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
4577 ===================================================================
4578 --- gcc/testsuite/gcc.c-torture/execute/pr61306-3.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4579 +++ gcc/testsuite/gcc.c-torture/execute/pr61306-3.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4580 @@ -0,0 +1,13 @@
4581 +short a = -1;
4582 +int b;
4583 +char c;
4584 +
4585 +int
4586 +main ()
4587 +{
4588 +  c = a;
4589 +  b = a | c;
4590 +  if (b != -1)
4591 +    __builtin_abort ();
4592 +  return 0;
4593 +}
4594 Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
4595 ===================================================================
4596 --- gcc/testsuite/gcc.c-torture/execute/20050604-1.x    (.../tags/gcc_4_8_3_release)    (revision 217117)
4597 +++ gcc/testsuite/gcc.c-torture/execute/20050604-1.x    (.../branches/gcc-4_8-branch)   (revision 217117)
4598 @@ -6,4 +6,5 @@
4599         set additional_flags "-mno-mmx"
4600  }
4601  
4602 +set additional_flags "-Wno-psabi"
4603  return 0
4604 Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
4605 ===================================================================
4606 --- gcc/testsuite/gcc.c-torture/execute/pr61306-2.c     (.../tags/gcc_4_8_3_release)    (revision 0)
4607 +++ gcc/testsuite/gcc.c-torture/execute/pr61306-2.c     (.../branches/gcc-4_8-branch)   (revision 217117)
4608 @@ -0,0 +1,40 @@
4609 +#ifdef __INT16_TYPE__
4610 +typedef __INT16_TYPE__ int16_t;
4611 +#else
4612 +typedef short int16_t;
4613 +#endif
4614 +
4615 +#ifdef __UINT32_TYPE__
4616 +typedef __UINT32_TYPE__ uint32_t;
4617 +#else
4618 +typedef unsigned uint32_t;
4619 +#endif
4620 +
4621 +#define __fake_const_swab32(x) ((uint32_t)(                          \
4622 +       (((uint32_t)         (x) & (uint32_t)0x000000ffUL) << 24) |   \
4623 +       (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) <<  8) |   \
4624 +       (((uint32_t)         (x) & (uint32_t)0x00ff0000UL) >>  8) |   \
4625 +       (((uint32_t)         (x) & (uint32_t)0xff000000UL) >> 24)))
4626 +
4627 +
4628 +/* Previous version of bswap optimization failed to consider sign extension
4629 +   and as a result would replace an expression *not* doing a bswap by a
4630 +   bswap.  */
4631 +
4632 +__attribute__ ((noinline, noclone)) uint32_t
4633 +fake_bswap32 (uint32_t in)
4634 +{
4635 +  return __fake_const_swab32 (in);
4636 +}
4637 +
4638 +int
4639 +main(void)
4640 +{
4641 +  if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
4642 +    return 0;
4643 +  if (sizeof (int16_t) * __CHAR_BIT__ != 16)
4644 +    return 0;
4645 +  if (fake_bswap32 (0x81828384) != 0xff838281)
4646 +    __builtin_abort ();
4647 +  return 0;
4648 +}
4649 Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
4650 ===================================================================
4651 --- gcc/testsuite/gcc.c-torture/execute/pr61375.c       (.../tags/gcc_4_8_3_release)    (revision 0)
4652 +++ gcc/testsuite/gcc.c-torture/execute/pr61375.c       (.../branches/gcc-4_8-branch)   (revision 217117)
4653 @@ -0,0 +1,35 @@
4654 +#ifdef __UINT64_TYPE__
4655 +typedef __UINT64_TYPE__ uint64_t;
4656 +#else
4657 +typedef unsigned long long uint64_t;
4658 +#endif
4659 +
4660 +#ifndef __SIZEOF_INT128__
4661 +#define __int128 long long
4662 +#endif
4663 +
4664 +/* Some version of bswap optimization would ICE when analyzing a mask constant
4665 +   too big for an HOST_WIDE_INT (PR61375).  */
4666 +
4667 +__attribute__ ((noinline, noclone)) uint64_t
4668 +uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
4669 +{
4670 +  __int128 mask = (__int128)0xffff << 56;
4671 +  return ((in1 & mask) >> 56) | in2;
4672 +}
4673 +
4674 +int
4675 +main (int argc)
4676 +{
4677 +  __int128 in = 1;
4678 +#ifdef __SIZEOF_INT128__
4679 +  in <<= 64;
4680 +#endif
4681 +  if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
4682 +    return 0;
4683 +  if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
4684 +    return 0;
4685 +  if (uint128_central_bitsi_ior (in, 2) != 0x102)
4686 +    __builtin_abort ();
4687 +  return 0;
4688 +}
4689 Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
4690 ===================================================================
4691 --- gcc/testsuite/gcc.c-torture/execute/20050316-1.x    (.../tags/gcc_4_8_3_release)    (revision 217117)
4692 +++ gcc/testsuite/gcc.c-torture/execute/20050316-1.x    (.../branches/gcc-4_8-branch)   (revision 217117)
4693 @@ -4,4 +4,5 @@
4694         return 1
4695  }
4696  
4697 +set additional_flags "-Wno-psabi"
4698  return 0;
4699 Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
4700 ===================================================================
4701 --- gcc/testsuite/gcc.c-torture/execute/20050316-3.x    (.../tags/gcc_4_8_3_release)    (revision 0)
4702 +++ gcc/testsuite/gcc.c-torture/execute/20050316-3.x    (.../branches/gcc-4_8-branch)   (revision 217117)
4703 @@ -0,0 +1,2 @@
4704 +set additional_flags "-Wno-psabi"
4705 +return 0
4706 Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
4707 ===================================================================
4708 --- gcc/testsuite/gcc.c-torture/compile/pr61684.c       (.../tags/gcc_4_8_3_release)    (revision 0)
4709 +++ gcc/testsuite/gcc.c-torture/compile/pr61684.c       (.../branches/gcc-4_8-branch)   (revision 217117)
4710 @@ -0,0 +1,15 @@
4711 +/* PR tree-optimization/61684 */
4712 +
4713 +int a, c;
4714 +static int *b = 0;
4715 +short d;
4716 +static short **e = 0;
4717 +
4718 +void
4719 +foo ()
4720 +{
4721 +  for (; c < 1; c++)
4722 +    ;
4723 +  *e = &d;
4724 +  a = d && (c && 1) & *b;
4725 +}
4726 Index: gcc/testsuite/gcc.c-torture/compile/pr63282.c
4727 ===================================================================
4728 --- gcc/testsuite/gcc.c-torture/compile/pr63282.c       (.../tags/gcc_4_8_3_release)    (revision 0)
4729 +++ gcc/testsuite/gcc.c-torture/compile/pr63282.c       (.../branches/gcc-4_8-branch)   (revision 217117)
4730 @@ -0,0 +1,13 @@
4731 +/* PR inline-asm/63282 */
4732 +
4733 +void bar (void);
4734 +
4735 +void
4736 +foo (void)
4737 +{
4738 +  asm volatile goto ("" : : : : a, b);
4739 +a:
4740 +  bar ();
4741 +b:
4742 +  return;
4743 +}
4744 Index: gcc/testsuite/gnat.dg/opt41_pkg.adb
4745 ===================================================================
4746 --- gcc/testsuite/gnat.dg/opt41_pkg.adb (.../tags/gcc_4_8_3_release)    (revision 0)
4747 +++ gcc/testsuite/gnat.dg/opt41_pkg.adb (.../branches/gcc-4_8-branch)   (revision 217117)
4748 @@ -0,0 +1,53 @@
4749 +with Ada.Streams; use Ada.Streams;\r
4750 +\r
4751 +package body Opt41_Pkg is\r
4752 +\r
4753 +   type Wstream is new Root_Stream_Type with record\r
4754 +      S : Unbounded_String;\r
4755 +   end record;\r
4756 +\r
4757 +   procedure Read (Stream : in out Wstream;\r
4758 +                   Item   : out Stream_Element_Array;\r
4759 +                   Last   : out Stream_Element_Offset) is null;\r
4760 +\r
4761 +   procedure Write (Stream : in out Wstream; Item : Stream_Element_Array) is\r
4762 +   begin\r
4763 +      for J in Item'Range loop\r
4764 +         Append (Stream.S, Character'Val (Item (J)));\r
4765 +      end loop;\r
4766 +   end Write;\r
4767 +\r
4768 +   function Rec_Write (R : Rec) return Unbounded_String is\r
4769 +      S : aliased Wstream;\r
4770 +   begin\r
4771 +      Rec'Output (S'Access, R);\r
4772 +      return S.S;\r
4773 +   end Rec_Write;\r
4774 +\r
4775 +   type Rstream is new Root_Stream_Type with record\r
4776 +      S   : String_Access;\r
4777 +      Idx : Integer := 1;\r
4778 +   end record;\r
4779 +\r
4780 +   procedure Write (Stream : in out Rstream; Item : Stream_Element_Array) is null;\r
4781 +\r
4782 +   procedure Read (Stream : in out Rstream;\r
4783 +                   Item   : out Stream_Element_Array;\r
4784 +                   Last   : out Stream_Element_Offset) is\r
4785 +   begin\r
4786 +      Last := Stream_Element_Offset'Min\r
4787 +         (Item'Last, Item'First + Stream_Element_Offset (Stream.S'Last - Stream.Idx));\r
4788 +      for I in Item'First .. Last loop\r
4789 +         Item (I) := Stream_Element (Character'Pos (Stream.S (Stream.Idx)));\r
4790 +         Stream.Idx := Stream.Idx + 1;\r
4791 +      end loop;\r
4792 +   end Read;\r
4793 +\r
4794 +   function Rec_Read (Str : String_Access) return Rec is\r
4795 +      S : aliased Rstream;\r
4796 +   begin\r
4797 +      S.S := Str;\r
4798 +      return Rec'Input (S'Access);\r
4799 +   end Rec_Read;\r
4800 +\r
4801 +end Opt41_Pkg;\r
4802 Index: gcc/testsuite/gnat.dg/opt41_pkg.ads
4803 ===================================================================
4804 --- gcc/testsuite/gnat.dg/opt41_pkg.ads (.../tags/gcc_4_8_3_release)    (revision 0)
4805 +++ gcc/testsuite/gnat.dg/opt41_pkg.ads (.../branches/gcc-4_8-branch)   (revision 217117)
4806 @@ -0,0 +1,28 @@
4807 +with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;\r
4808 +\r
4809 +package Opt41_Pkg is\r
4810 +\r
4811 +   type Enum is (One, Two, Three, Four, Five, Six);\r
4812 +\r
4813 +   type Rec (D : Enum) is record\r
4814 +      case D is\r
4815 +         when One => \r
4816 +            I : Integer;\r
4817 +         when Two | Five | Six =>\r
4818 +            S : Unbounded_String;\r
4819 +            case D is\r
4820 +               when Two => B : Boolean;\r
4821 +               when others => null;\r
4822 +            end case;\r
4823 +         when others =>\r
4824 +            null;\r
4825 +      end case;\r
4826 +   end record;\r
4827 +\r
4828 +   type Rec_Ptr is access all Rec;\r
4829 +\r
4830 +   function Rec_Write (R : Rec) return Unbounded_String;\r
4831 +\r
4832 +   function Rec_Read (Str : String_Access) return Rec;\r
4833 +\r
4834 +end Opt41_Pkg;\r
4835 Index: gcc/testsuite/gnat.dg/opt39.adb
4836 ===================================================================
4837 --- gcc/testsuite/gnat.dg/opt39.adb     (.../tags/gcc_4_8_3_release)    (revision 0)
4838 +++ gcc/testsuite/gnat.dg/opt39.adb     (.../branches/gcc-4_8-branch)   (revision 217117)
4839 @@ -0,0 +1,31 @@
4840 +-- { dg-do compile }
4841 +-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
4842 +
4843 +procedure Opt39 (I : Integer) is
4844 +
4845 +  type Rec is record
4846 +    I1 : Integer;
4847 +    I2 : Integer;
4848 +    I3 : Integer;
4849 +    I4 : Integer;
4850 +    I5 : Integer;
4851 +  end record;
4852 +
4853 +  procedure Set (A : access Rec; I : Integer) is
4854 +    Tmp : Rec := A.all;
4855 +  begin
4856 +    Tmp.I1 := I;
4857 +    A.all := Tmp;
4858 +  end;
4859 +
4860 +  R : aliased Rec;
4861 +
4862 +begin
4863 +  Set (R'Access, I);
4864 +  if R.I1 /= I then
4865 +    raise Program_Error;
4866 +  end if;
4867 +end;
4868 +
4869 +-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
4870 +-- { dg-final { cleanup-tree-dump "optimized" } }
4871 Index: gcc/testsuite/gnat.dg/opt41.adb
4872 ===================================================================
4873 --- gcc/testsuite/gnat.dg/opt41.adb     (.../tags/gcc_4_8_3_release)    (revision 0)
4874 +++ gcc/testsuite/gnat.dg/opt41.adb     (.../branches/gcc-4_8-branch)   (revision 217117)
4875 @@ -0,0 +1,15 @@
4876 +-- { dg-do run }
4877 +-- { dg-options "-Os" }
4878 +
4879 +with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
4880 +with Opt41_Pkg;             use Opt41_Pkg;
4881 +
4882 +procedure Opt41 is
4883 +   R  : Rec := (Five, To_Unbounded_String ("CONFIG"));
4884 +   SP : String_Access := new String'(To_String (Rec_Write (R)));
4885 +   RP : Rec_Ptr := new Rec'(Rec_Read (SP));
4886 +begin
4887 +   if RP.D /= R.D then
4888 +      raise Program_Error;
4889 +   end if;
4890 +end;
4891 Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
4892 ===================================================================
4893 --- gcc/testsuite/gnat.dg/overflow_fixed.adb    (.../tags/gcc_4_8_3_release)    (revision 0)
4894 +++ gcc/testsuite/gnat.dg/overflow_fixed.adb    (.../branches/gcc-4_8-branch)   (revision 217117)
4895 @@ -0,0 +1,19 @@
4896 +-- { dg-do run }
4897 +-- { dg-options "-gnato -O" }
4898 +
4899 +procedure Overflow_Fixed is
4900 +
4901 +  type Unsigned_8_Bit is mod 2**8;
4902 +
4903 +  procedure Fixed_To_Eight (Value : Duration) is
4904 +    Item : Unsigned_8_Bit;
4905 +  begin
4906 +    Item := Unsigned_8_Bit(Value);
4907 +    raise Program_Error;
4908 +  exception
4909 +    when Constraint_Error => null; -- expected case
4910 +  end;
4911 +
4912 +begin
4913 +  Fixed_To_Eight (-0.5);
4914 +end;
4915 Index: gcc/testsuite/gnat.dg/aliasing1.adb
4916 ===================================================================
4917 --- gcc/testsuite/gnat.dg/aliasing1.adb (.../tags/gcc_4_8_3_release)    (revision 217117)
4918 +++ gcc/testsuite/gnat.dg/aliasing1.adb (.../branches/gcc-4_8-branch)   (revision 217117)
4919 @@ -18,5 +18,5 @@
4920  
4921  end Aliasing1;
4922  
4923 --- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
4924 +-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
4925  -- { dg-final { cleanup-tree-dump "optimized" } }
4926 Index: gcc/testsuite/gcc.dg/pr60866.c
4927 ===================================================================
4928 --- gcc/testsuite/gcc.dg/pr60866.c      (.../tags/gcc_4_8_3_release)    (revision 0)
4929 +++ gcc/testsuite/gcc.dg/pr60866.c      (.../branches/gcc-4_8-branch)   (revision 217117)
4930 @@ -0,0 +1,18 @@
4931 +/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
4932 +/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns"  } */
4933 +
4934 +int n;
4935 +
4936 +void
4937 +foo (int w, int **dnroot, int **dn)
4938 +{
4939 +  int *child;
4940 +  int *xchild = xchild;
4941 +  for (; w < n; w++)
4942 +    if (!dnroot)
4943 +      {
4944 +       dnroot = dn;
4945 +       for (child = *dn; child; child = xchild)
4946 +         ;
4947 +      }
4948 +}
4949 Index: gcc/testsuite/gcc.dg/vmx/3c-01a.c
4950 ===================================================================
4951 --- gcc/testsuite/gcc.dg/vmx/3c-01a.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
4952 +++ gcc/testsuite/gcc.dg/vmx/3c-01a.c   (.../branches/gcc-4_8-branch)   (revision 217117)
4953 @@ -1,4 +1,5 @@
4954  /* { dg-do compile } */
4955 +/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mno-vsx -Wno-deprecated" } */
4956  #include <altivec.h>
4957  typedef const volatile unsigned int _1;
4958  typedef const  unsigned int _2;
4959 Index: gcc/testsuite/gcc.dg/vmx/ops.c
4960 ===================================================================
4961 --- gcc/testsuite/gcc.dg/vmx/ops.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
4962 +++ gcc/testsuite/gcc.dg/vmx/ops.c      (.../branches/gcc-4_8-branch)   (revision 217117)
4963 @@ -1,4 +1,5 @@
4964  /* { dg-do compile } */
4965 +/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mno-vsx -Wno-deprecated" } */
4966  #include <altivec.h>
4967  #include <stdlib.h>
4968  extern char * *var_char_ptr;
4969 Index: gcc/testsuite/gcc.dg/vmx/ops-long-1.c
4970 ===================================================================
4971 --- gcc/testsuite/gcc.dg/vmx/ops-long-1.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
4972 +++ gcc/testsuite/gcc.dg/vmx/ops-long-1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
4973 @@ -1,4 +1,5 @@
4974  /* { dg-do compile } */
4975 +/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mno-vsx -Wno-deprecated" } */
4976  
4977  /* Checks from the original ops.c that pass pointers to long or
4978     unsigned long for operations that support that in released versions
4979 Index: gcc/testsuite/gcc.dg/pr63342.c
4980 ===================================================================
4981 --- gcc/testsuite/gcc.dg/pr63342.c      (.../tags/gcc_4_8_3_release)    (revision 0)
4982 +++ gcc/testsuite/gcc.dg/pr63342.c      (.../branches/gcc-4_8-branch)   (revision 217117)
4983 @@ -0,0 +1,26 @@
4984 +/* PR debug/63342 */
4985 +/* { dg-do compile } */
4986 +/* { dg-options "-g -O2" } */
4987 +/* { dg-additional-options "-fpic" { target fpic } } */
4988 +
4989 +static __thread double u[9], v[9];
4990 +
4991 +void
4992 +foo (double **p, double **q)
4993 +{
4994 +  *p = u;
4995 +  *q = v;
4996 +}
4997 +
4998 +double
4999 +bar (double x)
5000 +{
5001 +  int i;
5002 +  double s = 0.0;
5003 +  for (i = 0; i < 9; i++)
5004 +    {
5005 +      double a = x + v[i];
5006 +      s += u[i] * a * a;
5007 +    }
5008 +  return s;
5009 +}
5010 Index: gcc/testsuite/gcc.dg/pr63284.c
5011 ===================================================================
5012 --- gcc/testsuite/gcc.dg/pr63284.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5013 +++ gcc/testsuite/gcc.dg/pr63284.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5014 @@ -0,0 +1,42 @@
5015 +/* PR debug/63284 */
5016 +/* { dg-do compile } */
5017 +/* { dg-options "-O2 -fcompare-debug" } */
5018 +
5019 +int a[10], *b, *d, c, f;
5020 +int fn2 (void);
5021 +void fn3 (void);
5022 +void fn4 (int);
5023 +
5024 +static int
5025 +fn1 (int x)
5026 +{
5027 +  int e = a[0];
5028 +  if (e)
5029 +    return 1;
5030 +  if (b)
5031 +    switch (x)
5032 +      {
5033 +      case 1:
5034 +        if (d)
5035 +          e = fn2 ();
5036 +        else
5037 +          fn3 ();
5038 +        break;
5039 +      case 0:
5040 +        if (d)
5041 +          {
5042 +            fn3 ();
5043 +            if (c)
5044 +              fn4 (1);
5045 +          }
5046 +        else
5047 +          fn4 (0);
5048 +      }
5049 +  return e;
5050 +}
5051 +
5052 +void
5053 +fn6 (void)
5054 +{
5055 +  f = fn1 (0);
5056 +}
5057 Index: gcc/testsuite/gcc.dg/pr61045.c
5058 ===================================================================
5059 --- gcc/testsuite/gcc.dg/pr61045.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5060 +++ gcc/testsuite/gcc.dg/pr61045.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5061 @@ -0,0 +1,12 @@
5062 +/* { dg-do run } */
5063 +/* { dg-options "-fstrict-overflow" } */
5064 +
5065 +int main ()
5066 +{
5067 +  int a = 0;
5068 +  int b = __INT_MAX__;
5069 +  int t = (a - 2) > (b - 1);
5070 +  if (t != 0)
5071 +    __builtin_abort();
5072 +  return 0;
5073 +}
5074 Index: gcc/testsuite/gcc.dg/pr52769.c
5075 ===================================================================
5076 --- gcc/testsuite/gcc.dg/pr52769.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5077 +++ gcc/testsuite/gcc.dg/pr52769.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5078 @@ -0,0 +1,24 @@
5079 +/* PR c/52769 */
5080 +/* { dg-do run } */
5081 +/* { dg-options "-O3" } */
5082 +
5083 +typedef struct
5084 +{
5085 +  int should_be_zero;
5086 +  char s[6];
5087 +  int x;
5088 +} foo_t;
5089 +
5090 +int
5091 +main (void)
5092 +{
5093 +  volatile foo_t foo = {
5094 +    .s = "123456",
5095 +    .x = 2
5096 +  };
5097 +
5098 +  if (foo.should_be_zero != 0)
5099 +    __builtin_abort ();
5100 +
5101 +  return 0;
5102 +}
5103 Index: gcc/testsuite/gcc.dg/pr62004.c
5104 ===================================================================
5105 --- gcc/testsuite/gcc.dg/pr62004.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5106 +++ gcc/testsuite/gcc.dg/pr62004.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5107 @@ -0,0 +1,47 @@
5108 +/* { dg-do run } */
5109 +/* { dg-options "-O2 -fno-tree-tail-merge" } */
5110 +
5111 +struct node
5112 +{
5113 +  struct node *next;
5114 +  struct node *prev;
5115 +};
5116 +
5117 +struct node node;
5118 +
5119 +struct head
5120 +{
5121 +  struct node *first;
5122 +};
5123 +
5124 +struct head heads[5];
5125 +
5126 +int k = 2;
5127 +
5128 +struct head *head = &heads[2];
5129 +
5130 +int
5131 +main ()
5132 +{
5133 +  struct node *p;
5134 +
5135 +  node.next = (void*)0;
5136 +
5137 +  node.prev = (void *)head;
5138 +
5139 +  head->first = &node;
5140 +
5141 +  struct node *n = head->first;
5142 +
5143 +  struct head *h = &heads[k];
5144 +
5145 +  heads[2].first = n->next;
5146 +
5147 +  if ((void*)n->prev == (void *)h)
5148 +    p = h->first;
5149 +  else
5150 +    /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next.  */
5151 +    p = n->prev->next;
5152 +
5153 +  return !(p == (void*)0);
5154 +}
5155 Index: gcc/testsuite/gcc.dg/pr51879-18.c
5156 ===================================================================
5157 --- gcc/testsuite/gcc.dg/pr51879-18.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
5158 +++ gcc/testsuite/gcc.dg/pr51879-18.c   (.../branches/gcc-4_8-branch)   (revision 217117)
5159 @@ -13,5 +13,5 @@
5160      *q = foo ();
5161  }
5162  
5163 -/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
5164 +/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
5165  /* { dg-final { cleanup-tree-dump "pre" } } */
5166 Index: gcc/testsuite/gcc.dg/torture/pr61964.c
5167 ===================================================================
5168 --- gcc/testsuite/gcc.dg/torture/pr61964.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5169 +++ gcc/testsuite/gcc.dg/torture/pr61964.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5170 @@ -0,0 +1,33 @@
5171 +/* { dg-do run } */
5172 +
5173 +extern void abort (void);
5174 +
5175 +struct node { struct node *next, *prev; } node;
5176 +struct head { struct node *first; } heads[5];
5177 +int k = 2;
5178 +struct head *head = &heads[2];
5179 +
5180 +static int __attribute__((noinline))
5181 +foo()
5182 +{
5183 +  node.prev = (void *)head;
5184 +  head->first = &node;
5185 +
5186 +  struct node *n = head->first;
5187 +  struct head *h = &heads[k];
5188 +
5189 +  if (n->prev == (void *)h)
5190 +    h->first = n->next;
5191 +  else
5192 +    n->prev->next = n->next;
5193 +
5194 +  n->next = h->first;
5195 +  return n->next == &node;
5196 +}
5197 +
5198 +int main()
5199 +{
5200 +  if (foo ())
5201 +    abort ();
5202 +  return 0;
5203 +}
5204 Index: gcc/testsuite/gcc.dg/torture/pr61010.c
5205 ===================================================================
5206 --- gcc/testsuite/gcc.dg/torture/pr61010.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5207 +++ gcc/testsuite/gcc.dg/torture/pr61010.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5208 @@ -0,0 +1,8 @@
5209 +/* { dg-do compile } */
5210 +
5211 +int main (void)
5212 +{
5213 +  int a = 0;
5214 +  unsigned b = (a * 64 & 192) | 63U;
5215 +  return 0;
5216 +}
5217 Index: gcc/testsuite/gcc.dg/torture/pr61452.c
5218 ===================================================================
5219 --- gcc/testsuite/gcc.dg/torture/pr61452.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5220 +++ gcc/testsuite/gcc.dg/torture/pr61452.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5221 @@ -0,0 +1,31 @@
5222 +/* { dg-do run } */
5223 +
5224 +int a, b;
5225 +short c, d;
5226 +char e, f;
5227 +
5228 +int
5229 +fn1 (int p1, char p2)
5230 +{
5231 +  return p1 || p2 ? 0 : p2;
5232 +}
5233 +
5234 +void
5235 +fn2 ()
5236 +{
5237 +  for (; a;)
5238 +    {
5239 +      int g;
5240 +      g = c = e;
5241 +      for (; a;)
5242 +       b = fn1 (g = d = e, g);
5243 +      f = g; 
5244 +    }
5245 +}
5246 +
5247 +int
5248 +main ()
5249 +{
5250 +  fn2 (); 
5251 +  return 0;
5252 +}
5253 Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
5254 ===================================================================
5255 --- gcc/testsuite/gcc.dg/torture/pr61383-1.c    (.../tags/gcc_4_8_3_release)    (revision 0)
5256 +++ gcc/testsuite/gcc.dg/torture/pr61383-1.c    (.../branches/gcc-4_8-branch)   (revision 217117)
5257 @@ -0,0 +1,35 @@
5258 +/* { dg-do run } */
5259 +
5260 +int a, b = 1, c, d, e, f, g;
5261 +
5262 +int
5263 +fn1 ()
5264 +{
5265 +  int h;
5266 +  for (;;)
5267 +    {
5268 +      g = b;
5269 +      g = g ? 0 : 1 % g;
5270 +      e = a + 1;
5271 +      for (; d < 1; d = e)
5272 +       {
5273 +         if (f == 0)
5274 +           h = 0;
5275 +         else
5276 +           h = 1 % f;
5277 +         if (f < 1)
5278 +           c = 0;
5279 +         else if (h)
5280 +           break;
5281 +       }
5282 +      if (b)
5283 +       return 0;
5284 +    }
5285 +}
5286 +
5287 +int
5288 +main ()
5289 +{
5290 +  fn1 ();
5291 +  return 0;
5292 +}
5293 Index: gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c
5294 ===================================================================
5295 --- gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c     (.../tags/gcc_4_8_3_release)    (revision 0)
5296 +++ gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c     (.../branches/gcc-4_8-branch)   (revision 217117)
5297 @@ -0,0 +1,41 @@
5298 +/* Test that exact underflow in __float128 signals the underflow
5299 +   exception if trapping is enabled, but does not raise the flag
5300 +   otherwise.  */
5301 +
5302 +/* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* } } */
5303 +/* { dg-options "-D_GNU_SOURCE" } */
5304 +/* { dg-require-effective-target fenv_exceptions } */
5305 +
5306 +#include <fenv.h>
5307 +#include <setjmp.h>
5308 +#include <signal.h>
5309 +#include <stdlib.h>
5310 +
5311 +volatile sig_atomic_t caught_sigfpe;
5312 +sigjmp_buf buf;
5313 +
5314 +static void
5315 +handle_sigfpe (int sig)
5316 +{
5317 +  caught_sigfpe = 1;
5318 +  siglongjmp (buf, 1);
5319 +}
5320 +
5321 +int
5322 +main (void)
5323 +{
5324 +  volatile __float128 a = 0x1p-16382q, b = 0x1p-2q;
5325 +  volatile __float128 r;
5326 +  r = a * b;
5327 +  if (fetestexcept (FE_UNDERFLOW))
5328 +    abort ();
5329 +  if (r != 0x1p-16384q)
5330 +    abort ();
5331 +  feenableexcept (FE_UNDERFLOW);
5332 +  signal (SIGFPE, handle_sigfpe);
5333 +  if (sigsetjmp (buf, 1) == 0)
5334 +    r = a * b;
5335 +  if (!caught_sigfpe)
5336 +    abort ();
5337 +  exit (0);
5338 +}
5339 Index: gcc/testsuite/gcc.dg/torture/vshuf-4.inc
5340 ===================================================================
5341 --- gcc/testsuite/gcc.dg/torture/vshuf-4.inc    (.../tags/gcc_4_8_3_release)    (revision 217117)
5342 +++ gcc/testsuite/gcc.dg/torture/vshuf-4.inc    (.../branches/gcc-4_8-branch)   (revision 217117)
5343 @@ -23,7 +23,8 @@
5344  T (20, 0, 4, 1, 5) \
5345  T (21, 2, 6, 3, 7) \
5346  T (22, 1, 2, 3, 0) \
5347 -T (23, 2, 1, 0, 3)
5348 +T (23, 2, 1, 0, 3) \
5349 +T (24, 2, 5, 6, 3)
5350  #define EXPTESTS \
5351  T (116,        1, 2, 4, 3) \
5352  T (117,        7, 3, 3, 0) \
5353 @@ -31,7 +32,6 @@
5354  T (119,        0, 3, 5, 6) \
5355  T (120,        0, 0, 1, 5) \
5356  T (121,        4, 6, 2, 1) \
5357 -T (122,        2, 5, 6, 3) \
5358  T (123,        4, 6, 3, 2) \
5359  T (124,        4, 7, 5, 6) \
5360  T (125,        0, 4, 2, 4) \
5361 Index: gcc/testsuite/gcc.dg/stack-usage-2.c
5362 ===================================================================
5363 --- gcc/testsuite/gcc.dg/stack-usage-2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
5364 +++ gcc/testsuite/gcc.dg/stack-usage-2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
5365 @@ -1,21 +1,21 @@
5366  /* { dg-do compile } */
5367  /* { dg-options "-Wstack-usage=512" } */
5368  
5369 -int foo1 (void)
5370 +int foo1 (void)  /* { dg-bogus "stack usage" } */
5371  {
5372    char arr[16];
5373    arr[0] = 1;
5374    return 0;
5375 -} /* { dg-bogus "stack usage" } */
5376 +}
5377  
5378 -int foo2 (void)
5379 +int foo2 (void)  /* { dg-warning "stack usage is \[0-9\]* bytes" } */
5380  {
5381    char arr[1024];
5382    arr[0] = 1;
5383    return 0;
5384 -} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
5385 +}
5386  
5387 -int foo3 (void)
5388 +int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
5389  {
5390    char arr[1024] __attribute__((aligned (512)));
5391    arr[0] = 1;
5392 @@ -22,12 +22,11 @@
5393    /* Force dynamic realignment of argument pointer.  */
5394    __builtin_apply ((void (*)()) foo2, 0, 0);
5395    return 0;
5396 +}
5397  
5398 -} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
5399 -
5400 -int foo4 (int n)
5401 +int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
5402  {
5403    char arr[n];
5404    arr[0] = 1;
5405    return 0;
5406 -} /* { dg-warning "stack usage might be unbounded" } */
5407 +}
5408 Index: gcc/testsuite/gcc.dg/ipa/pr61986.c
5409 ===================================================================
5410 --- gcc/testsuite/gcc.dg/ipa/pr61986.c  (.../tags/gcc_4_8_3_release)    (revision 0)
5411 +++ gcc/testsuite/gcc.dg/ipa/pr61986.c  (.../branches/gcc-4_8-branch)   (revision 217117)
5412 @@ -0,0 +1,48 @@
5413 +/* { dg-do compile } */
5414 +/* { dg-options "-O3" } */
5415 +
5416 +int a, b, c;
5417 +
5418 +struct S
5419 +{
5420 +  int f0;
5421 +  int f1;
5422 +} d;
5423 +
5424 +static int fn2 (struct S);
5425 +void fn3 (struct S);
5426 +
5427 +void
5428 +fn1 (struct S p)
5429 +{
5430 +  struct S h = { 0, 0 };
5431 +  fn3 (p);
5432 +  fn2 (h);
5433 +}
5434 +
5435 +int
5436 +fn2 (struct S p)
5437 +{
5438 +  struct S j = { 0, 0 };
5439 +  fn3 (p);
5440 +  fn2 (j);
5441 +  return 0;
5442 +}
5443 +
5444 +void
5445 +fn3 (struct S p)
5446 +{
5447 +  for (; b; a++)
5448 +    c = p.f0;
5449 +  fn1 (d);
5450 +}
5451 +
5452 +void
5453 +fn4 ()
5454 +{
5455 +  for (;;)
5456 +    {
5457 +      struct S f = { 0, 0 };
5458 +      fn1 (f);
5459 +    }
5460 +}
5461 Index: gcc/testsuite/gcc.dg/pr62030.c
5462 ===================================================================
5463 --- gcc/testsuite/gcc.dg/pr62030.c      (.../tags/gcc_4_8_3_release)    (revision 0)
5464 +++ gcc/testsuite/gcc.dg/pr62030.c      (.../branches/gcc-4_8-branch)   (revision 217117)
5465 @@ -0,0 +1,50 @@
5466 +/* { dg-do run } */
5467 +/* { dg-options "-O2" } */
5468 +
5469 +extern void abort (void);
5470 +
5471 +struct node
5472 +{
5473 +  struct node *next;
5474 +  struct node *prev;
5475 +};
5476 +
5477 +struct node node;
5478 +
5479 +struct head
5480 +{
5481 +  struct node *first;
5482 +};
5483 +
5484 +struct head heads[5];
5485 +
5486 +int k = 2;
5487 +
5488 +struct head *head = &heads[2];
5489 +
5490 +static int __attribute__((noinline))
5491 +foo (void)
5492 +{
5493 +  node.prev = (void *)head;
5494 +  head->first = &node;
5495 +
5496 +  struct node *n = head->first;
5497 +  struct head *h = &heads[k];
5498 +  struct node *next = n->next;
5499 +
5500 +  if (n->prev == (void *)h)
5501 +    h->first = next;
5502 +  else
5503 +    n->prev->next = next;
5504 +
5505 +  n->next = h->first;
5506 +  return n->next == &node;
5507 +}
5508 +
5509 +int
5510 +main (void)
5511 +{
5512 +  if (foo ())
5513 +    abort ();
5514 +  return 0;
5515 +}
5516 Index: gcc/testsuite/gcc.dg/vect/pr63341-2.c
5517 ===================================================================
5518 --- gcc/testsuite/gcc.dg/vect/pr63341-2.c       (.../tags/gcc_4_8_3_release)    (revision 0)
5519 +++ gcc/testsuite/gcc.dg/vect/pr63341-2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
5520 @@ -0,0 +1,35 @@
5521 +/* PR tree-optimization/63341 */
5522 +/* { dg-do run } */
5523 +
5524 +#include "tree-vect.h"
5525 +
5526 +typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
5527 +struct S { char e __attribute__((aligned (64))); U s[32]; };
5528 +struct S t = {0, {{0x5010}, {0x5111}, {0x5212}, {0x5313}, {0x5414}, {0x5515}, {0x5616}, {0x5717},
5529 +                 {0x5818}, {0x5919}, {0x5a1a}, {0x5b1b}, {0x5c1c}, {0x5d1d}, {0x5e1e}, {0x5f1f},
5530 +                 {0x6020}, {0x6121}, {0x6222}, {0x6323}, {0x6424}, {0x6525}, {0x6626}, {0x6727},
5531 +                 {0x6828}, {0x6929}, {0x6a2a}, {0x6b2b}, {0x6c2c}, {0x6d2d}, {0x6e2e}, {0x6f2f}}};
5532 +unsigned short d[32] = { 1 };
5533 +
5534 +__attribute__((noinline, noclone)) void
5535 +foo ()
5536 +{
5537 +  int i;
5538 +  for (i = 0; i < 32; i++)
5539 +    d[i] = t.s[i].s + 4;
5540 +  for (i = 0; i < 32; i++)
5541 +    if (d[i] != t.s[i].s + 4)
5542 +      abort ();
5543 +    else
5544 +      asm volatile ("" : : : "memory");
5545 +}
5546 +
5547 +int
5548 +main ()
5549 +{
5550 +  check_vect ();
5551 +  foo ();
5552 +  return 0;
5553 +}
5554 +
5555 +/* { dg-final { cleanup-tree-dump "vect" } } */
5556 Index: gcc/testsuite/gcc.dg/vect/pr63189.c
5557 ===================================================================
5558 --- gcc/testsuite/gcc.dg/vect/pr63189.c (.../tags/gcc_4_8_3_release)    (revision 0)
5559 +++ gcc/testsuite/gcc.dg/vect/pr63189.c (.../branches/gcc-4_8-branch)   (revision 217117)
5560 @@ -0,0 +1,26 @@
5561 +/* PR tree-optimization/63189 */
5562 +/* { dg-do run } */
5563 +
5564 +#include "tree-vect.h"
5565 +
5566 +short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
5567 +
5568 +__attribute__((noinline, noclone)) void
5569 +foo (void)
5570 +{
5571 +  int j, s = 0;
5572 +  for (j = 0; j < 8; j++)
5573 +    s += d[j] * j;
5574 +  if (s != 7)
5575 +    abort ();
5576 +}
5577 +
5578 +int
5579 +main ()
5580 +{
5581 +  check_vect ();
5582 +  foo ();
5583 +  return 0;
5584 +}
5585 +
5586 +/* { dg-final { cleanup-tree-dump "vect" } } */
5587 Index: gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
5588 ===================================================================
5589 --- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c     (.../tags/gcc_4_8_3_release)    (revision 0)
5590 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c     (.../branches/gcc-4_8-branch)   (revision 217117)
5591 @@ -0,0 +1,73 @@
5592 +/* { dg-require-effective-target vect_int } */
5593 +
5594 +#include <stdarg.h>
5595 +#include "tree-vect.h"
5596 +
5597 +#define N 64
5598 +#define DOT 43680
5599 +
5600 +signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
5601 +signed int   Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
5602 +
5603 +/* (short, int)->int->int dot product.
5604 +   Not detected as a dot-product pattern.  */
5605 +
5606 +__attribute__ ((noinline)) int
5607 +foo (int len)
5608 +{
5609 +  int i;
5610 +  int result = 0;
5611 +
5612 +  for (i = 0; i < len; i++)
5613 +    {
5614 +      result += (X[i] * Y[i]);
5615 +    }
5616 +  return result;
5617 +}
5618 +
5619 +
5620 +/* (int, short)->int->int dot product.
5621 +   Not detected as a dot-product pattern.  */
5622 +
5623 +__attribute__ ((noinline)) int
5624 +bar (int len)
5625 +{
5626 +  int i;
5627 +  int result = 0;
5628 +
5629 +  for (i = 0; i < len; i++)
5630 +    {
5631 +      result += (Y[i] * X[i]);
5632 +    }
5633 +  return result;
5634 +}
5635 +
5636 +int
5637 +main (void)
5638 +{
5639 +  int i;
5640 +  int dot;
5641 +
5642 +  check_vect ();
5643 +
5644 +  for (i = 0; i < N; i++)
5645 +    {
5646 +      X[i] = i;
5647 +      Y[i] = N - i;
5648 +      __asm__ volatile ("");
5649 +    }
5650 +
5651 +  dot = foo (N);
5652 +  if (dot != DOT)
5653 +    abort ();
5654 +
5655 +  dot = bar (N);
5656 +  if (dot != DOT)
5657 +    abort ();
5658 +
5659 +  return 0;
5660 +}
5661 +
5662 +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
5663 +/* { dg-final { cleanup-tree-dump "vect" } } */
5664 +
5665 Index: gcc/testsuite/gcc.dg/vect/pr62073.c
5666 ===================================================================
5667 --- gcc/testsuite/gcc.dg/vect/pr62073.c (.../tags/gcc_4_8_3_release)    (revision 0)
5668 +++ gcc/testsuite/gcc.dg/vect/pr62073.c (.../branches/gcc-4_8-branch)   (revision 217117)
5669 @@ -0,0 +1,40 @@
5670 +/* { dg-do compile } */
5671 +/* { dg-additional-options "-O1" } */
5672 +
5673 +struct S0
5674 +{
5675 +  int f7;
5676 +};
5677 +struct S0 g_50;
5678 +int g_70;
5679 +int g_76;
5680 +
5681 +int foo (long long p_56, int * p_57)
5682 +{
5683 +  int *l_77;
5684 +  int l_101;
5685 +
5686 +  for (; g_70;)
5687 +    {
5688 +      int **l_78 = &l_77;
5689 +      if (g_50.f7)
5690 +       continue;
5691 +      *l_78 = 0;
5692 +    }
5693 +  for (g_76 = 1; g_76 >= 0; g_76--)
5694 +    {
5695 +      int *l_90;
5696 +      for (l_101 = 4; l_101 >= 0; l_101--)
5697 +       if (l_101)
5698 +         *l_90 = 0;
5699 +       else
5700 +         {
5701 +           int **l_113 = &l_77;
5702 +           *l_113 = p_57;
5703 +         }
5704 +    }
5705 +
5706 +  return *l_77;
5707 +}
5708 +
5709 +/* { dg-final { cleanup-tree-dump "vect" } } */
5710 Index: gcc/testsuite/gcc.dg/vect/pr60196-1.c
5711 ===================================================================
5712 --- gcc/testsuite/gcc.dg/vect/pr60196-1.c       (.../tags/gcc_4_8_3_release)    (revision 0)
5713 +++ gcc/testsuite/gcc.dg/vect/pr60196-1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
5714 @@ -0,0 +1,34 @@
5715 +/* PR tree-optimization/63189 */
5716 +/* { dg-additional-options "-fwrapv" } */
5717 +/* { dg-do run } */
5718 +
5719 +#include "tree-vect.h"
5720 +
5721 +__attribute__((noinline, noclone)) static int
5722 +bar (const short *a, int len)
5723 +{
5724 +  int x;
5725 +  int x1 = 0;
5726 +
5727 +  for (x = 0; x < len; x++)
5728 +    x1 += x * a[x];
5729 +  return x1;
5730 +}
5731 +
5732 +__attribute__((noinline, noclone)) void
5733 +foo (void)
5734 +{
5735 +  short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
5736 +  if (bar (stuff, 9) != 36)
5737 +    abort ();
5738 +}
5739 +
5740 +int
5741 +main ()
5742 +{
5743 +  check_vect ();
5744 +  foo ();
5745 +  return 0;
5746 +}
5747 +
5748 +/* { dg-final { cleanup-tree-dump "vect" } } */
5749 Index: gcc/testsuite/gcc.dg/vect/pr62075.c
5750 ===================================================================
5751 --- gcc/testsuite/gcc.dg/vect/pr62075.c (.../tags/gcc_4_8_3_release)    (revision 0)
5752 +++ gcc/testsuite/gcc.dg/vect/pr62075.c (.../branches/gcc-4_8-branch)   (revision 217117)
5753 @@ -0,0 +1,22 @@
5754 +/* { dg-do compile } */
5755 +
5756 +int a[16][2];
5757 +struct A
5758 +{
5759 +  int b[16][2];
5760 +  int c[16][1];
5761 +};
5762 +
5763 +void
5764 +foo (struct A *x)
5765 +{
5766 +  int i;
5767 +  for (i = 0; i < 16; ++i)
5768 +    {
5769 +      x->b[i][0] = a[i][0];
5770 +      x->c[i][0] = 0 != a[i][0];
5771 +      x->b[i][1] = a[i][1];
5772 +    }
5773 +}
5774 +
5775 +/* { dg-final { cleanup-tree-dump "vect" } } */
5776 Index: gcc/testsuite/gcc.dg/vect/pr60196-2.c
5777 ===================================================================
5778 --- gcc/testsuite/gcc.dg/vect/pr60196-2.c       (.../tags/gcc_4_8_3_release)    (revision 0)
5779 +++ gcc/testsuite/gcc.dg/vect/pr60196-2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
5780 @@ -0,0 +1,33 @@
5781 +/* PR tree-optimization/63189 */
5782 +/* { dg-do run } */
5783 +
5784 +#include "tree-vect.h"
5785 +
5786 +static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
5787 +static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
5788 +
5789 +__attribute__((noinline, noclone)) static int
5790 +bar (void)
5791 +{
5792 +  int sum = 0, i;
5793 +  for (i = 0; i < 8; ++i)
5794 +    sum += a[i] * b[i];
5795 +  return sum;
5796 +}
5797 +
5798 +__attribute__((noinline, noclone)) void
5799 +foo (void)
5800 +{
5801 +  if (bar () != 0)
5802 +    abort ();
5803 +}
5804 +
5805 +int
5806 +main ()
5807 +{
5808 +  check_vect ();
5809 +  foo ();
5810 +  return 0;
5811 +}
5812 +
5813 +/* { dg-final { cleanup-tree-dump "vect" } } */
5814 Index: gcc/testsuite/gcc.dg/vect/pr63341-1.c
5815 ===================================================================
5816 --- gcc/testsuite/gcc.dg/vect/pr63341-1.c       (.../tags/gcc_4_8_3_release)    (revision 0)
5817 +++ gcc/testsuite/gcc.dg/vect/pr63341-1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
5818 @@ -0,0 +1,32 @@
5819 +/* PR tree-optimization/63341 */
5820 +/* { dg-do run } */
5821 +
5822 +#include "tree-vect.h"
5823 +
5824 +typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
5825 +struct S { char e __attribute__((aligned (64))); U s[32]; };
5826 +struct S t = {0, {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8},
5827 +                 {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16},
5828 +                 {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24},
5829 +                 {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}}};
5830 +unsigned short d[32] = { 1 };
5831 +
5832 +__attribute__((noinline, noclone)) void
5833 +foo ()
5834 +{
5835 +  int i;
5836 +  for (i = 0; i < 32; i++)
5837 +    d[i] = t.s[i].s;
5838 +  if (__builtin_memcmp (d, t.s, sizeof d))
5839 +    abort ();
5840 +}
5841 +
5842 +int
5843 +main ()
5844 +{
5845 +  check_vect ();
5846 +  foo ();
5847 +  return 0;
5848 +}
5849 +
5850 +/* { dg-final { cleanup-tree-dump "vect" } } */
5851 Index: gcc/testsuite/ChangeLog
5852 ===================================================================
5853 --- gcc/testsuite/ChangeLog     (.../tags/gcc_4_8_3_release)    (revision 217117)
5854 +++ gcc/testsuite/ChangeLog     (.../branches/gcc-4_8-branch)   (revision 217117)
5855 @@ -1,3 +1,433 @@
5856 +2014-11-03  Marek Polacek  <polacek@redhat.com>
5857 +
5858 +       PR c/52769
5859 +       * gcc.dg/pr52769.c: New test.
5860 +
5861 +2014-10-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
5862 +
5863 +       * gcc.target/aarch64/madd_after_asm_1.c: New test.
5864 +
5865 +2014-10-15  Eric Botcazou  <ebotcazou@adacore.com>
5866 +
5867 +       * gnat.dg/opt41.adb: New test.
5868 +       * gnat.dg/opt41_pkg.ad[sb]: New helper.
5869 +
5870 +2014-10-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5871 +
5872 +       Backport from mainline r215880
5873 +       2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5874 +
5875 +       * g++.dg/ext/altivec-2.C: Compile with -Wno-deprecated to avoid
5876 +       failing with the new warning message.
5877 +       * gcc.dg/vmx/3c-01a.c: Likewise.
5878 +       * gcc.dg/vmx/ops-long-1.c: Likewise.
5879 +       * gcc.dg/vmx/ops.c: Likewise.
5880 +       * gcc.target/powerpc/altivec-20.c: Likewise.
5881 +       * gcc.target/powerpc/altivec-6.c: Likewise.
5882 +       * gcc.target/powerpc/altivec-vec-merge.c: Likewise.
5883 +       * gcc.target/powerpc/vsx-builtin-8.c: Likewise.
5884 +       * gcc.target/powerpc/warn-lvsl-lvsr.c: New test.
5885 +
5886 +       Backport from mainline r215882
5887 +       2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5888 +
5889 +       * gcc.target/powerpc/lvsl-lvsr.c: New test.
5890 +
5891 +       Backport from mainline r216017
5892 +       2014-10-08  Pat Haugen  <pthaugen@us.ibm.com>
5893 +
5894 +       * gcc.dg/vmx/3c-01a.c: Add default options from vmx.exp.
5895 +       * gcc.dg/vmx/ops.c: Likewise.
5896 +       * gcc.dg/vmx/ops-long-1.c: Likewise.
5897 +
5898 +2014-10-10  Jakub Jelinek  <jakub@redhat.com>
5899 +
5900 +       PR fortran/59488
5901 +       * gfortran.dg/gomp/pr59488-1.f90: New test.
5902 +       * gfortran.dg/gomp/pr59488-2.f90: New test.
5903 +
5904 +2014-10-01  Jakub Jelinek  <jakub@redhat.com>
5905 +
5906 +       PR debug/63342
5907 +       * gcc.dg/pr63342.c: New test.
5908 +
5909 +       PR target/63428
5910 +       * gcc.dg/torture/vshuf-4.inc: Move test 122 from EXPTESTS
5911 +       to test 24 in TESTS.
5912 +
5913 +2014-10-01  Uros Bizjak  <ubizjak@gmail.com>
5914 +
5915 +       Backport from mainline
5916 +       2013-11-07  Joseph Myers  <joseph@codesourcery.com>
5917 +
5918 +       * lib/target-supports.exp
5919 +       (check_effective_target_fenv_exceptions): New function.
5920 +
5921 +2014-09-30  Jakub Jelinek  <jakub@redhat.com>
5922 +
5923 +       PR inline-asm/63282
5924 +       * gcc.c-torture/compile/pr63282.c: New test.
5925 +
5926 +2014-09-26  Jakub Jelinek  <jakub@redhat.com>
5927 +
5928 +       * g++.dg/compat/struct-layout-1_generate.c: Add -Wno-abi
5929 +       to default options.
5930 +
5931 +2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5932 +
5933 +       Backport from mainline r215559
5934 +       2014-09-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5935 +
5936 +       PR target/63335
5937 +       * gcc.target/powerpc/pr63335.c: New test.
5938 +
5939 +2014-09-25  Jakub Jelinek  <jakub@redhat.com>
5940 +
5941 +       PR tree-optimization/63341
5942 +       * gcc.dg/vect/pr63341-1.c: New test.
5943 +       * gcc.dg/vect/pr63341-2.c: New test.
5944 +
5945 +2014-09-18  Joseph Myers  <joseph@codesourcery.com>
5946 +
5947 +       * gcc.dg/torture/float128-exact-underflow.c: New test.
5948 +
5949 +2014-09-17  Jakub Jelinek  <jakub@redhat.com>
5950 +
5951 +       PR debug/63284
5952 +       * gcc.dg/pr63284.c: New test.
5953 +
5954 +2014-09-09  Richard Biener  <rguenther@suse.de>
5955 +
5956 +       Backport from mainline
5957 +       2014-06-11  Richard Biener  <rguenther@suse.de>
5958 +
5959 +       PR tree-optimization/61452
5960 +       * gcc.dg/torture/pr61452.c: New testcase.
5961 +
5962 +2014-09-09  Richard Biener  <rguenther@suse.de>
5963 +
5964 +       Backport from mainline
5965 +       2014-05-05  Richard Biener  <rguenther@suse.de>
5966 +
5967 +       PR middle-end/61010
5968 +       * gcc.dg/torture/pr61010.c: New testcase.
5969 +
5970 +       2014-05-28  Richard Biener  <rguenther@suse.de>
5971 +
5972 +       PR middle-end/61045
5973 +       * gcc.dg/pr61045.c: New testcase.
5974 +
5975 +       2014-08-11  Richard Biener  <rguenther@suse.de>
5976 +
5977 +       PR tree-optimization/62075
5978 +       * gcc.dg/vect/pr62075.c: New testcase.
5979 +
5980 +2014-09-08  Jakub Jelinek  <jakub@redhat.com>
5981 +
5982 +       PR tree-optimization/60196
5983 +       PR tree-optimization/63189
5984 +       * gcc.dg/vect/pr63189.c: New test.
5985 +       * gcc.dg/vect/pr60196-1.c: New test.
5986 +       * gcc.dg/vect/pr60196-2.c: New test.
5987 +
5988 +       Backported from mainline
5989 +       2013-09-17  Cong Hou  <congh@google.com>
5990 +
5991 +       * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product 
5992 +       on two arrays with short and int types. This should not be recognized
5993 +       as a dot product pattern.
5994 +
5995 +2014-09-08  Jakub Jelinek  <jakub@redhat.com>
5996 +
5997 +       Backported from mainline
5998 +       2014-08-06  Vladimir Makarov  <vmakarov@redhat.com>
5999 +
6000 +       PR debug/61923
6001 +       * gcc.target/i386/pr61923.c: New test.
6002 +
6003 +2014-09-06  John David Anglin  <danglin@gcc.gnu.org>
6004 +
6005 +       PR testsuite/56194
6006 +       * g++.dg/init/const9.C: Skip scan-assembler-not "rodata" on hppa*-*-*.
6007 +
6008 +2014-09-03  Marek Polacek  <polacek@redhat.com>
6009 +
6010 +       Backport from mainline
6011 +       2014-09-02  Marek Polacek  <polacek@redhat.com>
6012 +
6013 +       PR fortran/62270
6014 +       * gfortran.dg/pointer_intent_7.f90: Adjust dg-error.
6015 +
6016 +2014-09-03  Martin Jambor  <mjambor@suse.cz>
6017 +
6018 +       PR ipa/62015
6019 +       * g++.dg/ipa/pr62015.C: New test.
6020 +
6021 +2014-09-03  Martin Jambor  <mjambor@suse.cz>
6022 +
6023 +       PR ipa/61986
6024 +       * gcc.dg/ipa/pr61986.c: New test.
6025 +
6026 +2014-08-26  Dominik Vogt  <vogt@linux.vnet.ibm.com>
6027 +
6028 +       * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
6029 +       failure on s390*-*-linux-gnu.
6030 +
6031 +2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
6032 +
6033 +       Backport from mainline
6034 +       2014-08-24  Oleg Endo  <olegendo@gcc.gnu.org>
6035 +
6036 +       PR target/61996
6037 +       * gcc.target/sh/pr61996.c: New.
6038 +
6039 +2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
6040 +
6041 +       Backport from trunk
6042 +       PR fortran/62214
6043 +       * gfortran.dg/array_assignment_5.f90:  New test.
6044 +
6045 +2014-08-15  Tom de Vries  <tom@codesourcery.com>
6046 +
6047 +       Backport from mainline:
6048 +       2014-08-14  Tom de Vries  <tom@codesourcery.com>
6049 +
6050 +       PR rtl-optimization/62004
6051 +       PR rtl-optimization/62030
6052 +       * gcc.dg/pr62004.c: New test.
6053 +       * gcc.dg/pr62030.c: Same.
6054 +       * gcc.target/mips/pr62030-octeon.c: Same.
6055 +
6056 +2014-08-13  Felix Yang  <fei.yang0953@gmail.com>
6057 +
6058 +       PR tree-optimization/62073
6059 +       * gcc.dg/vect/pr62073.c: New test.
6060 +
6061 +2014-08-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6062 +
6063 +       Backport from mainline
6064 +       2014-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6065 +
6066 +       PR middle-end/62103
6067 +       * gcc.c-torture/execute/bitfld-6.c: New test.
6068 +
6069 +2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
6070 +
6071 +       Backport from trunk
6072 +       PR fortran/61999
6073 +       * gfortran.dg/dot_product_3.f90:  New test case.
6074 +
6075 +2014-08-07  John David Anglin  <danglin@gcc.gnu.org>
6076 +
6077 +       PR tree-optimization/60707
6078 +       * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
6079 +
6080 +2014-08-06  Jakub Jelinek  <jakub@redhat.com>
6081 +
6082 +       PR rtl-optimization/61801
6083 +       * gcc.target/i386/pr61801.c: Rewritten.
6084 +
6085 +2014-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6086 +
6087 +       Backport from mainline
6088 +       2014-06-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6089 +
6090 +       PR tree-optimization/61375
6091 +       * gcc.c-torture/execute/pr61375-1.c: New test.
6092 +
6093 +2014-08-01  Richard Biener  <rguenther@suse.de>
6094 +
6095 +       PR tree-optimization/61964
6096 +       * gcc.dg/torture/pr61964.c: New testcase.
6097 +       * gcc.dg/pr51879-18.c: XFAIL.
6098 +
6099 +2014-07-28  Richard Biener  <rguenther@suse.de>
6100 +
6101 +       PR rtl-optimization/61801
6102 +       * gcc.target/i386/pr61801.c: Fix testcase.
6103 +
6104 +2014-07-28  Richard Biener  <rguenther@suse.de>
6105 +
6106 +       PR rtl-optimization/61801
6107 +       * gcc.target/i386/pr61801.c: New testcase.
6108 +
6109 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6110 +
6111 +       Backport from mainline:
6112 +       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6113 +
6114 +       * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
6115 +
6116 +       * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
6117 +       * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
6118 +       * gcc.c-torture/execute/20050316-3.x: New file.  Add -Wno-psabi.
6119 +       * gcc.c-torture/execute/pr23135.x: Likewise.
6120 +
6121 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6122 +
6123 +       Backport from mainline:
6124 +       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6125 +
6126 +       * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
6127 +
6128 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6129 +
6130 +       Backport from mainline:
6131 +       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6132 +
6133 +       * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
6134 +
6135 +2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6136 +
6137 +       Backport from mainline:
6138 +       2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
6139 +
6140 +       * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
6141 +
6142 +2014-07-19  Eric Botcazou  <ebotcazou@adacore.com>
6143 +
6144 +       * gcc.dg/stack-usage-2.c: Adjust.
6145 +
6146 +2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
6147 +
6148 +       Backport from trunk.
6149 +       PR fortran/61780
6150 +       * gfortran.dg/dependency_44.f90 : New test
6151 +
6152 +2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>
6153 +
6154 +       * gnat.dg/opt39.adb: New test.
6155 +
6156 +2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
6157 +
6158 +       PR fortran/61459
6159 +       PR fortran/58883
6160 +       * gfortran.dg/allocatable_function_8.f90 : New test
6161 +
6162 +2014-07-04  Jakub Jelinek  <jakub@redhat.com>
6163 +
6164 +       PR tree-optimization/61684
6165 +       * gcc.c-torture/compile/pr61684.c: New test.
6166 +
6167 +2014-07-02  Jakub Jelinek  <jakub@redhat.com>
6168 +           Fritz Reese  <Reese-Fritz@zai.com>
6169 +
6170 +       * gfortran.dg/oldstyle_5.f: New test.
6171 +
6172 +2014-06-30  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6173 +
6174 +       Backport from mainline
6175 +       2014-06-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>
6176 +
6177 +       PR tree-optimization/61306
6178 +       * gcc.c-torture/execute/pr61306-1.c: New test.
6179 +       * gcc.c-torture/execute/pr61306-2.c: Likewise.
6180 +       * gcc.c-torture/execute/pr61306-3.c: Likewise.
6181 +
6182 +2014-06-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
6183 +
6184 +       * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
6185 +
6186 +2014-06-27  Uros Bizjak  <ubizjak@gmail.com>
6187 +
6188 +       Backport from mainline
6189 +       2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
6190 +
6191 +       PR target/61586
6192 +       * gcc.target/alpha/pr61586.c: New test.
6193 +
6194 +2014-06-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
6195 +
6196 +       * gfortran.dg/default_format_denormal_2.f90:  Remove xfail for
6197 +       powerpc*-*-linux*.
6198 +
6199 +2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
6200 +
6201 +       Backport from mainline
6202 +       2014-06-13  Ilya Enkovich  <ilya.enkovich@intel.com>
6203 +
6204 +       PR rtl-optimization/61094
6205 +       PR rtl-optimization/61446
6206 +       * gcc.target/i386/pr61446.c : New.
6207 +
6208 +       Backport from mainline
6209 +       2014-06-06  Uros Bizjak  <ubizjak@gmail.com>
6210 +
6211 +       PR target/61423
6212 +       * gcc.target/i386/pr61423.c: New test.
6213 +
6214 +2014-06-17  Yufeng Zhang  <yufeng.zhang@arm.com>
6215 +
6216 +       Backport from mainline
6217 +
6218 +       PR target/61483
6219 +       * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
6220 +       * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
6221 +       * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
6222 +       * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
6223 +
6224 +2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
6225 +
6226 +       Backport from trunk.
6227 +       PR fortran/45187
6228 +       * gfortran.dg/cray_pointers_10.f90: New file.
6229 +
6230 +2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
6231 +
6232 +       Backport from mainline
6233 +
6234 +       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
6235 +       PR target/61415
6236 +       * lib/target-supports.exp (check_effective_target_longdouble128): New.
6237 +       * gcc.target/powerpc/pack02.c: Use it.
6238 +       * gcc.target/powerpc/tfmode_off.c: Likewise.
6239 +
6240 +2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
6241 +
6242 +       Backport from 2014-06-12 trunk r211491
6243 +
6244 +       PR target/61443
6245 +       * gcc.target/avr/torture/pr61443.c: New test.
6246 +
6247 +2014-06-04  Richard Biener  <rguenther@suse.de>
6248 +
6249 +       PR tree-optimization/61383
6250 +       * gcc.dg/torture/pr61383-1.c: New testcase.
6251 +
6252 +2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
6253 +
6254 +       Backport from mainline
6255 +       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
6256 +
6257 +       PR rtl-optimization/60866
6258 +       * gcc.dg/pr60866.c: New test.
6259 +
6260 +2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
6261 +
6262 +       Backport from mainline
6263 +       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
6264 +
6265 +       PR rtl-optimization/60901
6266 +       * gcc.target/i386/pr60901.c: New test.
6267 +
6268 +2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
6269 +
6270 +       Backport from mainline
6271 +       2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
6272 +
6273 +       * gnat.dg/overflow_fixed.adb: New test.
6274 +
6275 +2014-05-27  Eric Botcazou  <ebotcazou@adacore.com>
6276 +
6277 +       * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
6278 +
6279 +2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
6280 +
6281 +       Backport from mainline
6282 +       2014-05-22  Peter Bergner  <bergner@vnet.ibm.com>
6283 +
6284 +       * gcc.target/powerpc/htm-ttest.c: New test.
6285 +
6286  2014-05-22  Release Manager
6287  
6288         * GCC 4.8.3 released.
6289 Index: gcc/testsuite/g++.dg/rtti/dyncast7.C
6290 ===================================================================
6291 --- gcc/testsuite/g++.dg/rtti/dyncast7.C        (.../tags/gcc_4_8_3_release)    (revision 0)
6292 +++ gcc/testsuite/g++.dg/rtti/dyncast7.C        (.../branches/gcc-4_8-branch)   (revision 217117)
6293 @@ -0,0 +1,28 @@
6294 +// I think this dynamic_cast has undefined behavior when destroying E::o
6295 +// because we're the F period of destruction has started and ap doesn't
6296 +// point to the object currently being destroyed--but the reasonable
6297 +// options are success or failure, not SEGV.
6298 +
6299 +// { dg-do run }
6300 +
6301 +extern "C" void abort();
6302 +
6303 +struct A { virtual ~A(); };
6304 +struct B { virtual ~B() { } };
6305 +struct C : B, A { };
6306 +struct E : virtual B { A o; };
6307 +struct F : virtual C, virtual E { };
6308 +
6309 +A* ap;
6310 +C* cp;
6311 +
6312 +A::~A() {
6313 +  C* cp2 = dynamic_cast<C*>(ap);
6314 +  if (cp2 != cp && cp2 != 0)
6315 +    abort();
6316 +}
6317 +
6318 +int main() {
6319 +  F f;
6320 +  ap = cp = &f;
6321 +}
6322 Index: gcc/testsuite/g++.dg/ext/altivec-2.C
6323 ===================================================================
6324 --- gcc/testsuite/g++.dg/ext/altivec-2.C        (.../tags/gcc_4_8_3_release)    (revision 217117)
6325 +++ gcc/testsuite/g++.dg/ext/altivec-2.C        (.../branches/gcc-4_8-branch)   (revision 217117)
6326 @@ -1,6 +1,6 @@
6327  /* { dg-do compile { target powerpc*-*-* } } */
6328  /* { dg-require-effective-target powerpc_altivec_ok } */
6329 -/* { dg-options "-maltivec -Wall -Wno-unused-but-set-variable" } */
6330 +/* { dg-options "-maltivec -Wall -Wno-unused-but-set-variable -Wno-deprecated" } */
6331  
6332  /* This test checks if AltiVec builtins accept const-qualified
6333     arguments.  */
6334 Index: gcc/testsuite/g++.dg/ext/stmtexpr16.C
6335 ===================================================================
6336 --- gcc/testsuite/g++.dg/ext/stmtexpr16.C       (.../tags/gcc_4_8_3_release)    (revision 0)
6337 +++ gcc/testsuite/g++.dg/ext/stmtexpr16.C       (.../branches/gcc-4_8-branch)   (revision 217117)
6338 @@ -0,0 +1,10 @@
6339 +// PR c++/63455
6340 +// { dg-options "-std=gnu++11" }
6341 +
6342 +int main()
6343 +{
6344 +    int x = 0;
6345 +
6346 +    // without '+0', gcc 4.6 gives a different error (no ICE though)
6347 +    decltype(({ int y = x; y; })+0) v1 = 0;
6348 +}
6349 Index: gcc/testsuite/g++.dg/expr/cond12.C
6350 ===================================================================
6351 --- gcc/testsuite/g++.dg/expr/cond12.C  (.../tags/gcc_4_8_3_release)    (revision 0)
6352 +++ gcc/testsuite/g++.dg/expr/cond12.C  (.../branches/gcc-4_8-branch)   (revision 217117)
6353 @@ -0,0 +1,12 @@
6354 +// PR c++/58714
6355 +// { dg-do run }
6356 +
6357 +struct X {
6358 +    X& operator=(const X&){}
6359 +    X& operator=(X&){__builtin_abort();}
6360 +};
6361 +
6362 +int main(int argv,char**) {
6363 +  X a, b;
6364 +  ((argv > 2) ? a : b) = X();
6365 +}
6366 Index: gcc/testsuite/g++.dg/init/const9.C
6367 ===================================================================
6368 --- gcc/testsuite/g++.dg/init/const9.C  (.../tags/gcc_4_8_3_release)    (revision 217117)
6369 +++ gcc/testsuite/g++.dg/init/const9.C  (.../branches/gcc-4_8-branch)   (revision 217117)
6370 @@ -1,5 +1,5 @@
6371  // PR c++/55893
6372 -// { dg-final { scan-assembler-not "rodata" } }
6373 +// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
6374  
6375  struct foo
6376  {
6377 Index: gcc/testsuite/g++.dg/tls/thread_local10.C
6378 ===================================================================
6379 --- gcc/testsuite/g++.dg/tls/thread_local10.C   (.../tags/gcc_4_8_3_release)    (revision 0)
6380 +++ gcc/testsuite/g++.dg/tls/thread_local10.C   (.../branches/gcc-4_8-branch)   (revision 217117)
6381 @@ -0,0 +1,23 @@
6382 +// PR c++/58624
6383 +
6384 +// { dg-do run { target c++11 } }
6385 +// { dg-add-options tls }
6386 +// { dg-require-effective-target tls_runtime }
6387 +
6388 +int i;
6389 +
6390 +template <typename> struct A
6391 +{
6392 +  static thread_local int s;
6393 +
6394 +  A () { i = s; }
6395 +};
6396 +
6397 +int f() { return 42; }
6398 +template <typename T> thread_local int A<T>::s = f();
6399 +
6400 +int main () {
6401 +  A<void> a;
6402 +  if (i != 42)
6403 +    __builtin_abort();
6404 +}
6405 Index: gcc/testsuite/g++.dg/parse/typename7.C
6406 ===================================================================
6407 --- gcc/testsuite/g++.dg/parse/typename7.C      (.../tags/gcc_4_8_3_release)    (revision 217117)
6408 +++ gcc/testsuite/g++.dg/parse/typename7.C      (.../branches/gcc-4_8-branch)   (revision 217117)
6409 @@ -7,10 +7,9 @@
6410  
6411  struct A
6412  {
6413 -  template<typename>   void foo(int); // { dg-message "note" }
6414 -  template<typename T> void bar(T t) { // { dg-message "note" }
6415 +  template<typename>   void foo(int);
6416 +  template<typename T> void bar(T t) {
6417      this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
6418 -  // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
6419    template<typename T> void bad(T t) {
6420      foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
6421  };
6422 @@ -20,7 +19,6 @@
6423  {
6424    void bar(T t) {
6425      A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
6426 -  // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
6427    void bad(T t) {
6428      B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
6429  };
6430 Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
6431 ===================================================================
6432 --- gcc/testsuite/g++.dg/parse/parameter-declaration-2.C        (.../tags/gcc_4_8_3_release)    (revision 217117)
6433 +++ gcc/testsuite/g++.dg/parse/parameter-declaration-2.C        (.../branches/gcc-4_8-branch)   (revision 217117)
6434 @@ -1,2 +1,2 @@
6435 -void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
6436 +void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
6437  // { dg-prune-output "array bound" }
6438 Index: gcc/testsuite/g++.dg/parse/ambig7.C
6439 ===================================================================
6440 --- gcc/testsuite/g++.dg/parse/ambig7.C (.../tags/gcc_4_8_3_release)    (revision 0)
6441 +++ gcc/testsuite/g++.dg/parse/ambig7.C (.../branches/gcc-4_8-branch)   (revision 217117)
6442 @@ -0,0 +1,16 @@
6443 +// PR c++/60361
6444 +
6445 +struct Helper
6446 +{
6447 +  Helper(int a, void (*pfunc)());
6448 +};
6449 +
6450 +template <int I> void function();
6451 +
6452 +const int A = 1;
6453 +const int B = 2;
6454 +
6455 +Helper testOk(A, function<A>);
6456 +Helper testOk2(int(A), function<B>);
6457 +Helper testOk3((int(A)), function<A>);
6458 +Helper testFail(int(A), function<A>);
6459 Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
6460 ===================================================================
6461 --- gcc/testsuite/g++.dg/compat/struct-layout-1.exp     (.../tags/gcc_4_8_3_release)    (revision 217117)
6462 +++ gcc/testsuite/g++.dg/compat/struct-layout-1.exp     (.../branches/gcc-4_8-branch)   (revision 217117)
6463 @@ -89,6 +89,9 @@
6464  # This must be done after the compat-use-*-compiler definitions.
6465  load_lib compat.exp
6466  
6467 +# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
6468 +load_lib g++-dg.exp
6469 +
6470  g++_init
6471  
6472  # Save variables for the C++ compiler under test, which each test will
6473 Index: gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
6474 ===================================================================
6475 --- gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
6476 +++ gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c      (.../branches/gcc-4_8-branch)   (revision 217117)
6477 @@ -1,5 +1,5 @@
6478  /* Structure layout test generator.
6479 -   Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011, 2012
6480 +   Copyright (C) 2004-2014
6481     Free Software Foundation, Inc.
6482     Contributed by Jakub Jelinek <jakub@redhat.com>.
6483  
6484 @@ -44,7 +44,7 @@
6485  #endif
6486  
6487  const char *dg_options[] = {
6488 -"/* { dg-options \"%s-I%s\" } */\n",
6489 +"/* { dg-options \"%s-I%s -Wno-abi\" } */\n",
6490  "/* { dg-options \"%s-I%s -mno-mmx -Wno-abi\" { target i?86-*-* x86_64-*-* } } */\n",
6491  "/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* powerpc*-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
6492  "/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target i?86-*-darwin* x86_64-*-darwin* i?86-*-mingw32* x86_64-*-mingw32* i?86-*-cygwin* } } */\n",
6493 Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
6494 ===================================================================
6495 --- gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C       (.../tags/gcc_4_8_3_release)    (revision 0)
6496 +++ gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C       (.../branches/gcc-4_8-branch)   (revision 217117)
6497 @@ -0,0 +1,28 @@
6498 +// PR c++/61959
6499 +// { dg-do compile { target c++11 } }
6500 +
6501 +template <class Coord> struct BasePoint
6502 +{
6503 +  Coord x, y;
6504 +  constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
6505 +};
6506 +template <class T> struct BaseCoord
6507 +{
6508 +  int value;
6509 +  constexpr BaseCoord (T) : value (1) {}
6510 +};
6511 +template <class units> struct IntCoordTyped : BaseCoord<int>, units
6512 +{
6513 +  typedef BaseCoord Super;
6514 +  constexpr IntCoordTyped (int) : Super (0) {}
6515 +};
6516 +template <class units>
6517 +struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
6518 +{
6519 +  typedef BasePoint<IntCoordTyped<units> > Super;
6520 +  constexpr IntPointTyped (int, int) : Super (0, 0) {}
6521 +};
6522 +struct A
6523 +{
6524 +};
6525 +IntPointTyped<A> a (0, 0);
6526 Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-names1.C
6527 ===================================================================
6528 --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-names1.C   (.../tags/gcc_4_8_3_release)    (revision 0)
6529 +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-names1.C   (.../branches/gcc-4_8-branch)   (revision 217117)
6530 @@ -0,0 +1,9 @@
6531 +// PR c++/56710
6532 +// { dg-options "-std=c++11 -Wall" }
6533 +
6534 +int main()
6535 +{
6536 +    int t = 0;
6537 +    return [&]() -> int {int __t; __t = t; return __t; }();
6538 +    return [&t]() -> int {int __t; __t = t; return __t; }();
6539 +}
6540 Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
6541 ===================================================================
6542 --- gcc/testsuite/g++.dg/cpp0x/variadic158.C    (.../tags/gcc_4_8_3_release)    (revision 0)
6543 +++ gcc/testsuite/g++.dg/cpp0x/variadic158.C    (.../branches/gcc-4_8-branch)   (revision 217117)
6544 @@ -0,0 +1,24 @@
6545 +// PR c++/61134
6546 +// { dg-do compile { target c++11 } }
6547 +
6548 +struct Base { };
6549 +
6550 +template <typename>
6551 +struct Fixed {
6552 +  typedef const char* name;
6553 +};
6554 +
6555 +template <typename VT, typename... Fields>
6556 +void New(const char* name,
6557 +         typename Fixed<Fields>::name... field_names);
6558 +
6559 +template <typename VT, typename... Fields>
6560 +void CreateMetric(const char* name,
6561 +                  typename Fixed<Fields>::name... field_names,
6562 +                  const Base&) { }
6563 +
6564 +
6565 +void Fn()
6566 +{
6567 +  CreateMetric<int, const char*>("abcd", "def", Base());
6568 +}
6569 Index: gcc/testsuite/g++.dg/cpp0x/constexpr-initlist8.C
6570 ===================================================================
6571 --- gcc/testsuite/g++.dg/cpp0x/constexpr-initlist8.C    (.../tags/gcc_4_8_3_release)    (revision 0)
6572 +++ gcc/testsuite/g++.dg/cpp0x/constexpr-initlist8.C    (.../branches/gcc-4_8-branch)   (revision 217117)
6573 @@ -0,0 +1,7 @@
6574 +// PR c++/63415
6575 +// { dg-do compile { target c++11 } }
6576 +
6577 +template <typename T>
6578 +struct A {
6579 +  static constexpr int value = int(T{});
6580 +};
6581 Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
6582 ===================================================================
6583 --- gcc/testsuite/g++.dg/cpp0x/variadic160.C    (.../tags/gcc_4_8_3_release)    (revision 0)
6584 +++ gcc/testsuite/g++.dg/cpp0x/variadic160.C    (.../branches/gcc-4_8-branch)   (revision 217117)
6585 @@ -0,0 +1,49 @@
6586 +// PR c++/61539
6587 +// { dg-do compile { target c++11 } }
6588 +
6589 +template <typename _CharT> class A;
6590 +template <typename> class B;
6591 +template <class charT> class C;
6592 +template <> class C<char>
6593 +{
6594 +  virtual void xparse (int &, const B<A<char> > &) const;
6595 +};
6596 +template <class T, class charT = char> class G : C<charT>
6597 +{
6598 +public:
6599 +  G (void *) {}
6600 +  void default_value (const T &);
6601 +  void xparse (int &, const B<A<charT> > &) const;
6602 +};
6603 +template <class T, class charT>
6604 +void validate (int &, const B<A<charT> > &, T *, int);
6605 +template <class T, class charT>
6606 +void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
6607 +{
6608 +  validate (p1, p2, (T *)0, 0);
6609 +}
6610 +template <class T> G<T> *value (T *) { return new G<T>(0); }
6611 +namespace Eigen
6612 +{
6613 +template <typename T> struct D;
6614 +template <typename, int, int, int = 0, int = 0, int = 0 > class F;
6615 +template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
6616 +          int _MaxCols>
6617 +struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
6618 +{
6619 +  typedef _Scalar Scalar;
6620 +};
6621 +template <typename, int, int, int, int, int _MaxCols> class F
6622 +{
6623 +public:
6624 +  typedef typename Eigen::D<F>::Scalar Scalar;
6625 +  F (const Scalar &, const Scalar &, const Scalar &);
6626 +};
6627 +template <class... T>
6628 +void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
6629 +}
6630 +int main (int, char *[])
6631 +{
6632 +  Eigen::F<double, 3, 1> a (0, 0, 0);
6633 +  value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
6634 +}
6635 Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
6636 ===================================================================
6637 --- gcc/testsuite/g++.dg/cpp0x/rv-cond1.C       (.../tags/gcc_4_8_3_release)    (revision 0)
6638 +++ gcc/testsuite/g++.dg/cpp0x/rv-cond1.C       (.../branches/gcc-4_8-branch)   (revision 217117)
6639 @@ -0,0 +1,13 @@
6640 +// PR c++/58714
6641 +// { dg-do compile { target c++11 } }
6642 +
6643 +struct X {
6644 +  X& operator=(const X&) = delete;
6645 +  X& operator=(X&& ) = default;
6646 +};
6647 +
6648 +void f(bool t) {
6649 +  X a, b;
6650 +  *(t ? &a : &b) = X();
6651 +  (t ? a : b) = X();
6652 +}
6653 Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
6654 ===================================================================
6655 --- gcc/testsuite/g++.dg/cpp0x/overload3.C      (.../tags/gcc_4_8_3_release)    (revision 0)
6656 +++ gcc/testsuite/g++.dg/cpp0x/overload3.C      (.../branches/gcc-4_8-branch)   (revision 217117)
6657 @@ -0,0 +1,17 @@
6658 +// PR c++/59823
6659 +// { dg-options "-std=c++11" }
6660 +
6661 +struct X { };
6662 +
6663 +void f(X&&);                   // { dg-message "void f" }
6664 +
6665 +struct wrap
6666 +{
6667 +  operator const X&() const;
6668 +};
6669 +
6670 +int main()
6671 +{
6672 +  wrap w;
6673 +  f(w);                                // { dg-error "lvalue" }
6674 +}
6675 Index: gcc/testsuite/g++.dg/ipa/pr62015.C
6676 ===================================================================
6677 --- gcc/testsuite/g++.dg/ipa/pr62015.C  (.../tags/gcc_4_8_3_release)    (revision 0)
6678 +++ gcc/testsuite/g++.dg/ipa/pr62015.C  (.../branches/gcc-4_8-branch)   (revision 217117)
6679 @@ -0,0 +1,55 @@
6680 +/* { dg-do run } */
6681 +/* { dg-options "-O3 -std=c++11"  } */
6682 +
6683 +
6684 +extern "C" int printf(const char *fmt, ...);
6685 +extern "C" void abort(void);
6686 +
6687 +struct Side {
6688 +    enum _Value { Left, Right, Invalid };
6689 +
6690 +    constexpr Side() : _value(Invalid) {}
6691 +    constexpr Side(_Value value) : _value(value) {}
6692 +    operator _Value() const { return (_Value)_value; }
6693 +
6694 +  private:
6695 +    char _value;
6696 +};
6697 +
6698 +struct A {
6699 +    void init();
6700 +    void adjust(Side side, bool final);
6701 +    void move(Side side);
6702 +};
6703 +
6704 +void A::init()
6705 +{
6706 +    adjust(Side::Invalid, false);
6707 +}
6708 +
6709 +static void __attribute__((noinline))
6710 +check (int v, int final)
6711 +{
6712 +    if (v != 0)
6713 +      abort();
6714 +}
6715 +
6716 +
6717 +__attribute__((noinline))
6718 +void A::adjust(Side side, bool final)
6719 +{
6720 +  check ((int)side, final);
6721 +}
6722 +
6723 +void A::move(Side side)
6724 +{
6725 +    adjust(side, false);
6726 +    adjust(side, true);
6727 +}
6728 +
6729 +int main()
6730 +{
6731 +    A t;
6732 +    t.move(Side::Left);
6733 +    return 0;
6734 +}
6735 Index: gcc/testsuite/g++.dg/template/local-fn1.C
6736 ===================================================================
6737 --- gcc/testsuite/g++.dg/template/local-fn1.C   (.../tags/gcc_4_8_3_release)    (revision 0)
6738 +++ gcc/testsuite/g++.dg/template/local-fn1.C   (.../branches/gcc-4_8-branch)   (revision 217117)
6739 @@ -0,0 +1,8 @@
6740 +// PR c++/60605
6741 +
6742 +template <typename T = int>
6743 +struct Foo {
6744 +    void bar() {
6745 +        void bug();
6746 +    }
6747 +};
6748 Index: gcc/testsuite/g++.dg/template/conv14.C
6749 ===================================================================
6750 --- gcc/testsuite/g++.dg/template/conv14.C      (.../tags/gcc_4_8_3_release)    (revision 0)
6751 +++ gcc/testsuite/g++.dg/template/conv14.C      (.../branches/gcc-4_8-branch)   (revision 217117)
6752 @@ -0,0 +1,30 @@
6753 +// PR c++/61647
6754 +
6755 +class XX;
6756 +
6757 +template<typename Container, typename Key>
6758 +struct Accessor;
6759 +
6760 +template<typename Container, typename Key, typename KeyStore = Key>
6761 +class Variant {
6762 +protected:
6763 +    KeyStore index;
6764 +    Container state;
6765 +public:
6766 +    Variant(Container st, const Key& i) : index(i), state(st) {}
6767 +
6768 +    template<typename T>
6769 +    operator T() const {
6770 +        return Accessor<Container, KeyStore>::template get<T>(state, index);
6771 +    }
6772 +};
6773 +
6774 +class AutoCleanVariant : public Variant<XX*, int> {
6775 +public:
6776 +    AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
6777 +
6778 +    template<typename T>
6779 +    operator T() const {
6780 +         return Variant<XX*, int>::operator T();
6781 +    }
6782 +};
6783 Index: gcc/testsuite/g++.dg/template/friend55.C
6784 ===================================================================
6785 --- gcc/testsuite/g++.dg/template/friend55.C    (.../tags/gcc_4_8_3_release)    (revision 0)
6786 +++ gcc/testsuite/g++.dg/template/friend55.C    (.../branches/gcc-4_8-branch)   (revision 217117)
6787 @@ -0,0 +1,18 @@
6788 +// PR c++/59956
6789 +
6790 +template <int I> struct A;
6791 +template <int I> class B {
6792 +  int i;
6793 +  template <int A_S> friend void A<A_S>::impl();
6794 +};
6795 +
6796 +B<0> b1;
6797 +template<int I>struct A { void impl(); };
6798 +B<1> b2;
6799 +
6800 +template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
6801 +
6802 +int main()
6803 +{
6804 +  A<0>().impl();
6805 +}
6806 Index: gcc/testsuite/g++.dg/template/memclass5.C
6807 ===================================================================
6808 --- gcc/testsuite/g++.dg/template/memclass5.C   (.../tags/gcc_4_8_3_release)    (revision 0)
6809 +++ gcc/testsuite/g++.dg/template/memclass5.C   (.../branches/gcc-4_8-branch)   (revision 217117)
6810 @@ -0,0 +1,26 @@
6811 +// PR c++/60241
6812 +
6813 +template <typename T>
6814 +struct x
6815 +{
6816 +    template <typename U>
6817 +    struct y
6818 +    {
6819 +        typedef T result2;
6820 +    };
6821 +
6822 +    typedef y<int> zy;
6823 +};
6824 +
6825 +template<>
6826 +template<class T>
6827 +struct x<int>::y
6828 +{
6829 +    typedef double result2;
6830 +};
6831 +
6832 +int main()
6833 +{
6834 +    x<int>::zy::result2 xxx;
6835 +    x<int>::y<int>::result2 xxx2;
6836 +}
6837 Index: gcc/testsuite/g++.dg/template/ptrmem27.C
6838 ===================================================================
6839 --- gcc/testsuite/g++.dg/template/ptrmem27.C    (.../tags/gcc_4_8_3_release)    (revision 0)
6840 +++ gcc/testsuite/g++.dg/template/ptrmem27.C    (.../branches/gcc-4_8-branch)   (revision 217117)
6841 @@ -0,0 +1,22 @@
6842 +// PR c++/61500
6843 +
6844 +struct X {
6845 +  int i;
6846 +  int j;
6847 +
6848 +  int foo(int X::* ptr);
6849 +
6850 +  template <int X::* ptr>
6851 +  int bar();
6852 +};
6853 +
6854 +int X::foo(int X::* ptr) {
6855 +  int* p = &(this->*ptr);  // OK.
6856 +  return *p;
6857 +}
6858 +
6859 +template <int X::* ptr>
6860 +int X::bar() {
6861 +  int* p = &(this->*ptr);  // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
6862 +  return *p;
6863 +}
6864 Index: gcc/cp/tree.c
6865 ===================================================================
6866 --- gcc/cp/tree.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
6867 +++ gcc/cp/tree.c       (.../branches/gcc-4_8-branch)   (revision 217117)
6868 @@ -97,6 +97,16 @@
6869      case IMAGPART_EXPR:
6870        return lvalue_kind (TREE_OPERAND (ref, 0));
6871  
6872 +    case MEMBER_REF:
6873 +    case DOTSTAR_EXPR:
6874 +      if (TREE_CODE (ref) == MEMBER_REF)
6875 +       op1_lvalue_kind = clk_ordinary;
6876 +      else
6877 +       op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
6878 +      if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
6879 +       op1_lvalue_kind = clk_none;
6880 +      return op1_lvalue_kind;
6881 +
6882      case COMPONENT_REF:
6883        op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
6884        /* Look at the member designator.  */
6885 @@ -3738,6 +3748,10 @@
6886      {
6887        init_expr = get_target_expr (exp);
6888        exp = TARGET_EXPR_SLOT (init_expr);
6889 +      if (CLASS_TYPE_P (TREE_TYPE (exp)))
6890 +       exp = move (exp);
6891 +      else
6892 +       exp = rvalue (exp);
6893      }
6894    else
6895      {
6896 Index: gcc/cp/ChangeLog
6897 ===================================================================
6898 --- gcc/cp/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
6899 +++ gcc/cp/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
6900 @@ -1,3 +1,87 @@
6901 +2014-10-15  Jason Merrill  <jason@redhat.com>
6902 +
6903 +       PR c++/63455
6904 +       Revert:
6905 +       * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
6906 +       committed to this tentative parse.
6907 +
6908 +       PR c++/63415
6909 +       * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
6910 +       (iterative_hash_template_arg): Likewise.
6911 +
6912 +       PR c++/56710
6913 +       * semantics.c (finish_member_declaration): Don't push closure
6914 +       members.
6915 +
6916 +       PR c++/58624
6917 +       * pt.c (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
6918 +       * semantics.c (finish_id_expression): Don't call TLS wrapper in a
6919 +       template.
6920 +
6921 +2014-08-07  Jason Merrill  <jason@redhat.com>
6922 +
6923 +       PR c++/61959
6924 +       * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
6925 +
6926 +       PR c++/58714
6927 +       * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
6928 +
6929 +2014-01-27  Jason Merrill  <jason@redhat.com>
6930 +
6931 +       PR c++/59823
6932 +       Core DR 1138
6933 +       * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
6934 +       list-initialization.  A conversion to rvalue ref that involves
6935 +       an lvalue-rvalue conversion is bad.
6936 +       (convert_like_real): Give helpful error message.
6937 +
6938 +2014-01-29  Jason Merrill  <jason@redhat.com>
6939 +
6940 +       PR c++/59956
6941 +       * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
6942 +       have a friend template in a class template.
6943 +       * pt.c (tsubst_friend_function): Look through it.
6944 +       (push_template_decl_real): A friend member template is
6945 +       primary.
6946 +
6947 +2014-02-21  Jason Merrill  <jason@redhat.com>
6948 +
6949 +       PR c++/60241
6950 +       * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
6951 +       of the partial instantiation, not the most general template.
6952 +       (maybe_process_partial_specialization): Reassign everything on
6953 +       that list.
6954 +
6955 +2014-03-05  Jason Merrill  <jason@redhat.com>
6956 +
6957 +       PR c++/60361
6958 +       * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
6959 +       if re-parsing might succeed.
6960 +       * semantics.c (finish_id_expression): Use of a parameter outside
6961 +       the function body is a parse error.
6962 +
6963 +2014-06-30  Jason Merrill  <jason@redhat.com>
6964 +
6965 +       PR c++/61647
6966 +       * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
6967 +
6968 +       PR c++/61539
6969 +       * pt.c (unify_one_argument): Type/expression mismatch just causes
6970 +       deduction failure.
6971 +
6972 +       PR c++/61500
6973 +       * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
6974 +
6975 +2014-06-17  Jason Merrill  <jason@redhat.com>
6976 +
6977 +       PR c++/60605
6978 +       * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
6979 +
6980 +2014-06-02  Jason Merrill  <jason@redhat.com>
6981 +
6982 +       PR c++/61134
6983 +       * pt.c (pack_deducible_p): Handle canonicalization.
6984 +
6985  2014-05-22  Release Manager
6986  
6987         * GCC 4.8.3 released.
6988 Index: gcc/cp/pt.c
6989 ===================================================================
6990 --- gcc/cp/pt.c (.../tags/gcc_4_8_3_release)    (revision 217117)
6991 +++ gcc/cp/pt.c (.../branches/gcc-4_8-branch)   (revision 217117)
6992 @@ -907,11 +907,13 @@
6993                t; t = TREE_CHAIN (t))
6994             {
6995               tree inst = TREE_VALUE (t);
6996 -             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
6997 +             if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
6998 +                 || !COMPLETE_OR_OPEN_TYPE_P (inst))
6999                 {
7000                   /* We already have a full specialization of this partial
7001 -                    instantiation.  Reassign it to the new member
7002 -                    specialization template.  */
7003 +                    instantiation, or a full specialization has been
7004 +                    looked up but not instantiated.  Reassign it to the
7005 +                    new member specialization template.  */
7006                   spec_entry elt;
7007                   spec_entry *entry;
7008                   void **slot;
7009 @@ -930,7 +932,7 @@
7010                   *entry = elt;
7011                   *slot = entry;
7012                 }
7013 -             else if (COMPLETE_OR_OPEN_TYPE_P (inst))
7014 +             else
7015                 /* But if we've had an implicit instantiation, that's a
7016                    problem ([temp.expl.spec]/6).  */
7017                 error ("specialization %qT after instantiation %qT",
7018 @@ -1569,6 +1571,7 @@
7019      case CONSTRUCTOR:
7020        {
7021         tree field, value;
7022 +       iterative_hash_template_arg (TREE_TYPE (arg), val);
7023         FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (arg), i, field, value)
7024           {
7025             val = iterative_hash_template_arg (field, val);
7026 @@ -4308,7 +4311,8 @@
7027       in the template-parameter-list of the definition of a member of a
7028       class template.  */
7029  
7030 -  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
7031 +  if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
7032 +      || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
7033      /* You can't have a function template declaration in a local
7034         scope, nor you can you define a member of a class template in a
7035         local scope.  */
7036 @@ -4572,7 +4576,8 @@
7037      DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
7038  
7039    /* See if this is a primary template.  */
7040 -  if (is_friend && ctx)
7041 +  if (is_friend && ctx
7042 +      && uses_template_parms_level (ctx, processing_template_decl))
7043      /* A friend template that specifies a class context, i.e.
7044           template <typename T> friend void A<T>::f();
7045         is not primary.  */
7046 @@ -7454,7 +7459,7 @@
7047         }
7048  
7049        /* Let's consider the explicit specialization of a member
7050 -         of a class template specialization that is implicitely instantiated,
7051 +         of a class template specialization that is implicitly instantiated,
7052          e.g.:
7053              template<class T>
7054              struct S
7055 @@ -7552,9 +7557,9 @@
7056  
7057        /* Note this use of the partial instantiation so we can check it
7058          later in maybe_process_partial_specialization.  */
7059 -      DECL_TEMPLATE_INSTANTIATIONS (templ)
7060 +      DECL_TEMPLATE_INSTANTIATIONS (found)
7061         = tree_cons (arglist, t,
7062 -                    DECL_TEMPLATE_INSTANTIATIONS (templ));
7063 +                    DECL_TEMPLATE_INSTANTIATIONS (found));
7064  
7065        if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
7066         /* Now that the type has been registered on the instantiations
7067 @@ -8289,10 +8294,17 @@
7068  
7069        if (COMPLETE_TYPE_P (context))
7070         {
7071 +         tree fn = new_friend;
7072 +         /* do_friend adds the TEMPLATE_DECL for any member friend
7073 +            template even if it isn't a member template, i.e.
7074 +              template <class T> friend A<T>::f();
7075 +            Look through it in that case.  */
7076 +         if (TREE_CODE (fn) == TEMPLATE_DECL
7077 +             && !PRIMARY_TEMPLATE_P (fn))
7078 +           fn = DECL_TEMPLATE_RESULT (fn);
7079           /* Check to see that the declaration is really present, and,
7080              possibly obtain an improved declaration.  */
7081 -         tree fn = check_classfn (context,
7082 -                                  new_friend, NULL_TREE);
7083 +         fn = check_classfn (context, fn, NULL_TREE);
7084  
7085           if (fn)
7086             new_friend = fn;
7087 @@ -14488,6 +14500,16 @@
7088      case PARM_DECL:
7089        {
7090         tree r = tsubst_copy (t, args, complain, in_decl);
7091 +       if (TREE_CODE (r) == VAR_DECL
7092 +           && !processing_template_decl
7093 +           && !cp_unevaluated_operand
7094 +           && DECL_THREAD_LOCAL_P (r))
7095 +         {
7096 +           if (tree wrap = get_tls_wrapper_fn (r))
7097 +             /* Replace an evaluated use of the thread_local variable with
7098 +                a call to its wrapper.  */
7099 +             r = build_cxx_call (wrap, 0, NULL, tf_warning_or_error);
7100 +         }
7101  
7102         if (TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE)
7103           /* If the original type was a reference, we'll be wrapped in
7104 @@ -14934,7 +14956,7 @@
7105         continue;
7106        for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
7107            packs; packs = TREE_CHAIN (packs))
7108 -       if (TREE_VALUE (packs) == parm)
7109 +       if (template_args_equal (TREE_VALUE (packs), parm))
7110           {
7111             /* The template parameter pack is used in a function parameter
7112                pack.  If this is the end of the parameter list, the
7113 @@ -15502,8 +15524,9 @@
7114         maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
7115      }
7116    else
7117 -    gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
7118 -               == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
7119 +    if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
7120 +       != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
7121 +      return unify_template_argument_mismatch (explain_p, parm, arg);
7122  
7123    /* For deduction from an init-list we need the actual list.  */
7124    if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
7125 @@ -19804,6 +19827,8 @@
7126        {
7127         unsigned ix;
7128         tree val;
7129 +       if (dependent_type_p (TREE_TYPE (expression)))
7130 +         return true;
7131         FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val)
7132           if (value_dependent_expression_p (val))
7133             return true;
7134 @@ -20009,7 +20034,12 @@
7135         return true;
7136  
7137        if (BASELINK_P (expression))
7138 -       expression = BASELINK_FUNCTIONS (expression);
7139 +       {
7140 +         if (BASELINK_OPTYPE (expression)
7141 +             && dependent_type_p (BASELINK_OPTYPE (expression)))
7142 +           return true;
7143 +         expression = BASELINK_FUNCTIONS (expression);
7144 +       }
7145  
7146        if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
7147         {
7148 Index: gcc/cp/semantics.c
7149 ===================================================================
7150 --- gcc/cp/semantics.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
7151 +++ gcc/cp/semantics.c  (.../branches/gcc-4_8-branch)   (revision 217117)
7152 @@ -2735,8 +2735,10 @@
7153                                               /*friend_p=*/0);
7154         }
7155      }
7156 -  /* Enter the DECL into the scope of the class.  */
7157 -  else if (pushdecl_class_level (decl))
7158 +  /* Enter the DECL into the scope of the class, if the class
7159 +     isn't a closure (whose fields are supposed to be unnamed).  */
7160 +  else if (CLASSTYPE_LAMBDA_EXPR (current_class_type)
7161 +          || pushdecl_class_level (decl))
7162      {
7163        if (TREE_CODE (decl) == USING_DECL)
7164         {
7165 @@ -3108,7 +3110,7 @@
7166           && DECL_CONTEXT (decl) == NULL_TREE
7167           && !cp_unevaluated_operand)
7168         {
7169 -         error ("use of parameter %qD outside function body", decl);
7170 +         *error_msg = "use of parameter outside function body";
7171           return error_mark_node;
7172         }
7173      }
7174 @@ -3343,6 +3345,7 @@
7175        tree wrap;
7176        if (TREE_CODE (decl) == VAR_DECL
7177           && !cp_unevaluated_operand
7178 +         && !processing_template_decl
7179           && DECL_THREAD_LOCAL_P (decl)
7180           && (wrap = get_tls_wrapper_fn (decl)))
7181         {
7182 @@ -7296,7 +7299,9 @@
7183           constructor_elt *inner = base_field_constructor_elt (n, ce->index);
7184           inner->value = elt;
7185         }
7186 -      else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
7187 +      else if (ce->index
7188 +              && (TREE_CODE (ce->index) == NOP_EXPR
7189 +                  || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
7190         {
7191           /* This is an initializer for an empty base; now that we've
7192              checked that it's constant, we can ignore it.  */
7193 Index: gcc/cp/parser.c
7194 ===================================================================
7195 --- gcc/cp/parser.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
7196 +++ gcc/cp/parser.c     (.../branches/gcc-4_8-branch)   (revision 217117)
7197 @@ -12831,7 +12831,12 @@
7198       the effort required to do the parse, nor will we issue duplicate
7199       error messages about problems during instantiation of the
7200       template.  */
7201 -  if (start_of_id)
7202 +  if (start_of_id
7203 +      /* Don't do this if we had a parse error in a declarator; re-parsing
7204 +        might succeed if a name changes meaning (60361).  */
7205 +      && !(cp_parser_error_occurred (parser)
7206 +          && cp_parser_parsing_tentatively (parser)
7207 +          && parser->in_declarator_p))
7208      {
7209        cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
7210  
7211 @@ -23774,8 +23779,6 @@
7212  static void
7213  cp_parser_abort_tentative_parse (cp_parser* parser)
7214  {
7215 -  gcc_assert (parser->context->status != CP_PARSER_STATUS_KIND_COMMITTED
7216 -             || errorcount > 0);
7217    cp_parser_simulate_error (parser);
7218    /* Now, pretend that we want to see if the construct was
7219       successfully parsed.  */
7220 Index: gcc/cp/call.c
7221 ===================================================================
7222 --- gcc/cp/call.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
7223 +++ gcc/cp/call.c       (.../branches/gcc-4_8-branch)   (revision 217117)
7224 @@ -1464,7 +1464,7 @@
7225      {
7226        maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
7227        conv = implicit_conversion (to, from, expr, c_cast_p,
7228 -                                 flags, complain);
7229 +                                 flags|LOOKUP_NO_TEMP_BIND, complain);
7230        if (!CLASS_TYPE_P (to)
7231           && CONSTRUCTOR_NELTS (expr) == 1)
7232         {
7233 @@ -1624,9 +1624,9 @@
7234  
7235    /* [dcl.init.ref]
7236  
7237 -     Otherwise, the reference shall be to a non-volatile const type.
7238 -
7239 -     Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
7240 +     Otherwise, the reference shall be an lvalue reference to a
7241 +     non-volatile const type, or the reference shall be an rvalue
7242 +     reference.  */
7243    if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
7244      return NULL;
7245  
7246 @@ -1664,7 +1664,16 @@
7247    /* This reference binding, unlike those above, requires the
7248       creation of a temporary.  */
7249    conv->need_temporary_p = true;
7250 -  conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
7251 +  if (TYPE_REF_IS_RVALUE (rto))
7252 +    {
7253 +      conv->rvaluedness_matches_p = 1;
7254 +      /* In the second case, if the reference is an rvalue reference and
7255 +        the second standard conversion sequence of the user-defined
7256 +        conversion sequence includes an lvalue-to-rvalue conversion, the
7257 +        program is ill-formed.  */
7258 +      if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
7259 +       conv->bad_p = 1;
7260 +    }
7261  
7262    return conv;
7263  }
7264 @@ -5811,7 +5820,7 @@
7265        && convs->kind != ck_list
7266        && convs->kind != ck_ambig
7267        && (convs->kind != ck_ref_bind
7268 -         || convs->user_conv_p)
7269 +         || (convs->user_conv_p && next_conversion (convs)->bad_p))
7270        && (convs->kind != ck_rvalue
7271           || SCALAR_TYPE_P (totype))
7272        && convs->kind != ck_base)
7273 @@ -6110,7 +6119,8 @@
7274         if (convs->bad_p && !next_conversion (convs)->bad_p)
7275           {
7276             gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
7277 -                       && real_lvalue_p (expr));
7278 +                       && (real_lvalue_p (expr)
7279 +                           || next_conversion(convs)->kind == ck_rvalue));
7280  
7281             error_at (loc, "cannot bind %qT lvalue to %qT",
7282                       TREE_TYPE (expr), totype);
7283 Index: gcc/cp/friend.c
7284 ===================================================================
7285 --- gcc/cp/friend.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
7286 +++ gcc/cp/friend.c     (.../branches/gcc-4_8-branch)   (revision 217117)
7287 @@ -502,7 +502,13 @@
7288                                   ? current_template_parms
7289                                   : NULL_TREE);
7290  
7291 -         if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
7292 +         if ((template_member_p
7293 +              /* Always pull out the TEMPLATE_DECL if we have a friend
7294 +                 template in a class template so that it gets tsubsted
7295 +                 properly later on (59956).  tsubst_friend_function knows
7296 +                 how to tell this apart from a member template.  */
7297 +              || (class_template_depth && friend_depth))
7298 +             && decl && TREE_CODE (decl) == FUNCTION_DECL)
7299             decl = DECL_TI_TEMPLATE (decl);
7300  
7301           if (decl)
7302 Index: gcc/haifa-sched.c
7303 ===================================================================
7304 --- gcc/haifa-sched.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
7305 +++ gcc/haifa-sched.c   (.../branches/gcc-4_8-branch)   (revision 217117)
7306 @@ -2931,7 +2931,7 @@
7307  {
7308    advance_state (curr_state);
7309    if (sched_verbose >= 6)
7310 -    fprintf (sched_dump, ";;\tAdvanced a state.\n");
7311 +    fprintf (sched_dump, ";;\tAdvance the current state.\n");
7312  }
7313  
7314  /* Update register pressure after scheduling INSN.  */
7315 @@ -5964,6 +5964,7 @@
7316    modulo_insns_scheduled = 0;
7317  
7318    ls.modulo_epilogue = false;
7319 +  ls.first_cycle_insn_p = true;
7320  
7321    /* Loop until all the insns in BB are scheduled.  */
7322    while ((*current_sched_info->schedule_more_p) ())
7323 @@ -6034,7 +6035,6 @@
7324        if (must_backtrack)
7325         goto do_backtrack;
7326  
7327 -      ls.first_cycle_insn_p = true;
7328        ls.shadows_only_p = false;
7329        cycle_issued_insns = 0;
7330        ls.can_issue_more = issue_rate;
7331 @@ -6321,11 +6321,13 @@
7332               break;
7333             }
7334         }
7335 +      ls.first_cycle_insn_p = true;
7336      }
7337    if (ls.modulo_epilogue)
7338      success = true;
7339   end_schedule:
7340 -  advance_one_cycle ();
7341 +  if (!ls.first_cycle_insn_p)
7342 +    advance_one_cycle ();
7343    perform_replacements_new_cycle ();
7344    if (modulo_ii > 0)
7345      {
7346 Index: gcc/double-int.c
7347 ===================================================================
7348 --- gcc/double-int.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
7349 +++ gcc/double-int.c    (.../branches/gcc-4_8-branch)   (revision 217117)
7350 @@ -616,7 +616,7 @@
7351                  == (unsigned HOST_WIDE_INT) htwice)
7352                 && (labs_den <= ltwice)))
7353           {
7354 -           if (*hquo < 0)
7355 +           if (quo_neg)
7356               /* quo = quo - 1;  */
7357               add_double (*lquo, *hquo,
7358                           (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
7359 Index: gcc/tree-ssa-math-opts.c
7360 ===================================================================
7361 --- gcc/tree-ssa-math-opts.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
7362 +++ gcc/tree-ssa-math-opts.c    (.../branches/gcc-4_8-branch)   (revision 217117)
7363 @@ -1537,7 +1537,7 @@
7364  
7365  struct symbolic_number {
7366    unsigned HOST_WIDEST_INT n;
7367 -  int size;
7368 +  tree type;
7369  };
7370  
7371  /* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
7372 @@ -1549,13 +1549,15 @@
7373                  struct symbolic_number *n,
7374                  int count)
7375  {
7376 +  int bitsize = TYPE_PRECISION (n->type);
7377 +
7378    if (count % 8 != 0)
7379      return false;
7380  
7381    /* Zero out the extra bits of N in order to avoid them being shifted
7382       into the significant bits.  */
7383 -  if (n->size < (int)sizeof (HOST_WIDEST_INT))
7384 -    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
7385 +  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
7386 +    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
7387  
7388    switch (code)
7389      {
7390 @@ -1563,20 +1565,24 @@
7391        n->n <<= count;
7392        break;
7393      case RSHIFT_EXPR:
7394 +      /* Arithmetic shift of signed type: result is dependent on the value.  */
7395 +      if (!TYPE_UNSIGNED (n->type)
7396 +         && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
7397 +       return false;
7398        n->n >>= count;
7399        break;
7400      case LROTATE_EXPR:
7401 -      n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
7402 +      n->n = (n->n << count) | (n->n >> (bitsize - count));
7403        break;
7404      case RROTATE_EXPR:
7405 -      n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
7406 +      n->n = (n->n >> count) | (n->n << (bitsize - count));
7407        break;
7408      default:
7409        return false;
7410      }
7411    /* Zero unused bits for size.  */
7412 -  if (n->size < (int)sizeof (HOST_WIDEST_INT))
7413 -    n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
7414 +  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
7415 +    n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
7416    return true;
7417  }
7418  
7419 @@ -1593,7 +1599,7 @@
7420    if (TREE_CODE (lhs_type) != INTEGER_TYPE)
7421      return false;
7422  
7423 -  if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
7424 +  if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
7425      return false;
7426  
7427    return true;
7428 @@ -1650,20 +1656,25 @@
7429          to initialize the symbolic number.  */
7430        if (!source_expr1)
7431         {
7432 +         int size;
7433 +
7434           /* Set up the symbolic number N by setting each byte to a
7435              value between 1 and the byte size of rhs1.  The highest
7436              order byte is set to n->size and the lowest order
7437              byte to 1.  */
7438 -         n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
7439 -         if (n->size % BITS_PER_UNIT != 0)
7440 +         n->type = TREE_TYPE (rhs1);
7441 +         size = TYPE_PRECISION (n->type);
7442 +         if (size % BITS_PER_UNIT != 0)
7443             return NULL_TREE;
7444 -         n->size /= BITS_PER_UNIT;
7445 +         if (size > HOST_BITS_PER_WIDEST_INT)
7446 +           return NULL_TREE;
7447 +         size /= BITS_PER_UNIT;
7448           n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
7449                   (unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
7450  
7451 -         if (n->size < (int)sizeof (HOST_WIDEST_INT))
7452 +         if (size < (int)sizeof (HOST_WIDEST_INT))
7453             n->n &= ((unsigned HOST_WIDEST_INT)1 <<
7454 -                    (n->size * BITS_PER_UNIT)) - 1;
7455 +                    (size * BITS_PER_UNIT)) - 1;
7456  
7457           source_expr1 = rhs1;
7458         }
7459 @@ -1672,12 +1683,12 @@
7460         {
7461         case BIT_AND_EXPR:
7462           {
7463 -           int i;
7464 +           int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
7465             unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
7466             unsigned HOST_WIDEST_INT tmp = val;
7467  
7468             /* Only constants masking full bytes are allowed.  */
7469 -           for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
7470 +           for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
7471               if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
7472                 return NULL_TREE;
7473  
7474 @@ -1693,12 +1704,24 @@
7475           break;
7476         CASE_CONVERT:
7477           {
7478 -           int type_size;
7479 +           int type_size, old_type_size;
7480 +           tree type;
7481  
7482 -           type_size = TYPE_PRECISION (gimple_expr_type (stmt));
7483 +           type = gimple_expr_type (stmt);
7484 +           type_size = TYPE_PRECISION (type);
7485             if (type_size % BITS_PER_UNIT != 0)
7486               return NULL_TREE;
7487 +           if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
7488 +             return NULL_TREE;
7489  
7490 +           /* Sign extension: result is dependent on the value.  */
7491 +           old_type_size = TYPE_PRECISION (n->type);
7492 +           if (!TYPE_UNSIGNED (n->type)
7493 +               && type_size > old_type_size
7494 +               && n->n &
7495 +                  ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
7496 +             return NULL_TREE;
7497 +
7498             if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
7499               {
7500                 /* If STMT casts to a smaller type mask out the bits not
7501 @@ -1705,7 +1728,7 @@
7502                    belonging to the target type.  */
7503                 n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
7504               }
7505 -           n->size = type_size / BITS_PER_UNIT;
7506 +           n->type = type;
7507           }
7508           break;
7509         default:
7510 @@ -1718,7 +1741,7 @@
7511  
7512    if (rhs_class == GIMPLE_BINARY_RHS)
7513      {
7514 -      int i;
7515 +      int i, size;
7516        struct symbolic_number n1, n2;
7517        unsigned HOST_WIDEST_INT mask;
7518        tree source_expr2;
7519 @@ -1742,11 +1765,12 @@
7520           source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
7521  
7522           if (source_expr1 != source_expr2
7523 -             || n1.size != n2.size)
7524 +             || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
7525             return NULL_TREE;
7526  
7527 -         n->size = n1.size;
7528 -         for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
7529 +         n->type = n1.type;
7530 +         size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
7531 +         for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
7532             {
7533               unsigned HOST_WIDEST_INT masked1, masked2;
7534  
7535 @@ -1785,7 +1809,7 @@
7536  
7537    struct symbolic_number n;
7538    tree source_expr;
7539 -  int limit;
7540 +  int limit, bitsize;
7541  
7542    /* The last parameter determines the depth search limit.  It usually
7543       correlates directly to the number of bytes to be touched.  We
7544 @@ -1800,13 +1824,14 @@
7545      return NULL_TREE;
7546  
7547    /* Zero out the extra bits of N and CMP.  */
7548 -  if (n.size < (int)sizeof (HOST_WIDEST_INT))
7549 +  bitsize = TYPE_PRECISION (n.type);
7550 +  if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
7551      {
7552        unsigned HOST_WIDEST_INT mask =
7553 -       ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
7554 +       ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
7555  
7556        n.n &= mask;
7557 -      cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
7558 +      cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
7559      }
7560  
7561    /* A complete byte swap should make the symbolic number to start
7562 @@ -1828,7 +1853,7 @@
7563    bool changed = false;
7564    tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
7565  
7566 -  if (BITS_PER_UNIT != 8)
7567 +  if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
7568      return 0;
7569  
7570    if (sizeof (HOST_WIDEST_INT) < 8)
7571 Index: gcc/ifcvt.c
7572 ===================================================================
7573 --- gcc/ifcvt.c (.../tags/gcc_4_8_3_release)    (revision 217117)
7574 +++ gcc/ifcvt.c (.../branches/gcc-4_8-branch)   (revision 217117)
7575 @@ -294,6 +294,28 @@
7576  
7577    return (e) ? e->dest : NULL_BLOCK;
7578  }
7579 +
7580 +/* Return true if RTXs A and B can be safely interchanged.  */
7581 +
7582 +static bool
7583 +rtx_interchangeable_p (const_rtx a, const_rtx b)
7584 +{
7585 +  if (!rtx_equal_p (a, b))
7586 +    return false;
7587 +
7588 +  if (GET_CODE (a) != MEM)
7589 +    return true;
7590 +
7591 +  /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
7592 +     reference is not.  Interchanging a dead type-unsafe memory reference with
7593 +     a live type-safe one creates a live type-unsafe memory reference, in other
7594 +     words, it makes the program illegal.
7595 +     We check here conservatively whether the two memory references have equal
7596 +     memory attributes.  */
7597 +
7598 +  return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
7599 +}
7600 +
7601  \f
7602  /* Go through a bunch of insns, converting them to conditional
7603     execution format if possible.  Return TRUE if all of the non-note
7604 @@ -1014,6 +1036,9 @@
7605        || (rtx_equal_p (if_info->a, XEXP (cond, 1))
7606           && rtx_equal_p (if_info->b, XEXP (cond, 0))))
7607      {
7608 +      if (!rtx_interchangeable_p (if_info->a, if_info->b))
7609 +       return FALSE;
7610 +
7611        y = (code == EQ) ? if_info->a : if_info->b;
7612  
7613        /* Avoid generating the move if the source is the destination.  */
7614 @@ -2483,7 +2508,7 @@
7615        if (! insn_b
7616           || insn_b != last_active_insn (else_bb, FALSE)
7617           || (set_b = single_set (insn_b)) == NULL_RTX
7618 -         || ! rtx_equal_p (x, SET_DEST (set_b)))
7619 +         || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
7620         return FALSE;
7621      }
7622    else
7623 @@ -2496,7 +2521,7 @@
7624           || BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
7625           || !NONJUMP_INSN_P (insn_b)
7626           || (set_b = single_set (insn_b)) == NULL_RTX
7627 -         || ! rtx_equal_p (x, SET_DEST (set_b))
7628 +         || ! rtx_interchangeable_p (x, SET_DEST (set_b))
7629           || ! noce_operand_ok (SET_SRC (set_b))
7630           || reg_overlap_mentioned_p (x, SET_SRC (set_b))
7631           || modified_between_p (SET_SRC (set_b), insn_b, jump)
7632 @@ -2562,7 +2587,7 @@
7633  
7634    /* Look and see if A and B are really the same.  Avoid creating silly
7635       cmove constructs that no one will fix up later.  */
7636 -  if (rtx_equal_p (a, b))
7637 +  if (rtx_interchangeable_p (a, b))
7638      {
7639        /* If we have an INSN_B, we don't have to create any new rtl.  Just
7640          move the instruction that we already have.  If we don't have an
7641 @@ -4246,6 +4271,9 @@
7642    old_dest = JUMP_LABEL (jump);
7643    if (other_bb != new_dest)
7644      {
7645 +      if (!any_condjump_p (jump))
7646 +       goto cancel;
7647 +
7648        if (JUMP_P (BB_END (dest_edge->src)))
7649         new_dest_label = JUMP_LABEL (BB_END (dest_edge->src));
7650        else if (new_dest == EXIT_BLOCK_PTR)
7651 Index: gcc/dwarf2out.c
7652 ===================================================================
7653 --- gcc/dwarf2out.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
7654 +++ gcc/dwarf2out.c     (.../branches/gcc-4_8-branch)   (revision 217117)
7655 @@ -12234,7 +12234,7 @@
7656               op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
7657                                         VAR_INIT_STATUS_INITIALIZED);
7658               if (op1 == 0)
7659 -               break;
7660 +               return NULL;
7661               add_loc_descr (&mem_loc_result, op1);
7662               add_loc_descr (&mem_loc_result,
7663                              new_loc_descr (DW_OP_plus, 0, 0));
7664 @@ -13882,6 +13882,10 @@
7665        have_address = 1;
7666        break;
7667  
7668 +    case TARGET_MEM_REF:
7669 +    case SSA_NAME:
7670 +      return NULL;
7671 +
7672      case COMPOUND_EXPR:
7673        return loc_list_from_tree (TREE_OPERAND (loc, 1), want_address);
7674  
7675 Index: gcc/expr.c
7676 ===================================================================
7677 --- gcc/expr.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
7678 +++ gcc/expr.c  (.../branches/gcc-4_8-branch)   (revision 217117)
7679 @@ -10603,7 +10603,7 @@
7680        || !host_integerp (TREE_OPERAND (offset, 1), 1)
7681        || compare_tree_int (TREE_OPERAND (offset, 1),
7682                            BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
7683 -      || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
7684 +      || exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
7685      return 0;
7686  
7687    /* Look at the first operand of BIT_AND_EXPR and strip any conversion.
7688 Index: gcc/ada/socket.c
7689 ===================================================================
7690 --- gcc/ada/socket.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
7691 +++ gcc/ada/socket.c    (.../branches/gcc-4_8-branch)   (revision 217117)
7692 @@ -212,7 +212,7 @@
7693    struct hostent *rh;
7694    int ri;
7695  
7696 -#if defined(__linux__) || defined(__GLIBC__)
7697 +#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
7698    (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
7699  #else
7700    rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
7701 Index: gcc/ada/uintp.adb
7702 ===================================================================
7703 --- gcc/ada/uintp.adb   (.../tags/gcc_4_8_3_release)    (revision 217117)
7704 +++ gcc/ada/uintp.adb   (.../branches/gcc-4_8-branch)   (revision 217117)
7705 @@ -171,22 +171,6 @@
7706     --  If Discard_Quotient is True, Quotient is set to No_Uint
7707     --  If Discard_Remainder is True, Remainder is set to No_Uint
7708  
7709 -   function Vector_To_Uint
7710 -     (In_Vec   : UI_Vector;
7711 -      Negative : Boolean) return Uint;
7712 -   --  Functions that calculate values in UI_Vectors, call this function to
7713 -   --  create and return the Uint value. In_Vec contains the multiple precision
7714 -   --  (Base) representation of a non-negative value. Leading zeroes are
7715 -   --  permitted. Negative is set if the desired result is the negative of the
7716 -   --  given value. The result will be either the appropriate directly
7717 -   --  represented value, or a table entry in the proper canonical format is
7718 -   --  created and returned.
7719 -   --
7720 -   --  Note that Init_Operand puts a signed value in the result vector, but
7721 -   --  Vector_To_Uint is always presented with a non-negative value. The
7722 -   --  processing of signs is something that is done by the caller before
7723 -   --  calling Vector_To_Uint.
7724 -
7725     ------------
7726     -- Direct --
7727     ------------
7728 Index: gcc/ada/uintp.ads
7729 ===================================================================
7730 --- gcc/ada/uintp.ads   (.../tags/gcc_4_8_3_release)    (revision 217117)
7731 +++ gcc/ada/uintp.ads   (.../branches/gcc-4_8-branch)   (revision 217117)
7732 @@ -90,6 +90,18 @@
7733     Uint_Minus_80  : constant Uint;
7734     Uint_Minus_128 : constant Uint;
7735  
7736 +   type UI_Vector is array (Pos range <>) of Int;
7737 +   --  Vector containing the integer values of a Uint value
7738 +
7739 +   --  Note: An earlier version of this package used pointers of arrays of Ints
7740 +   --  (dynamically allocated) for the Uint type. The change leads to a few
7741 +   --  less natural idioms used throughout this code, but eliminates all uses
7742 +   --  of the heap except for the table package itself. For example, Uint
7743 +   --  parameters are often converted to UI_Vectors for internal manipulation.
7744 +   --  This is done by creating the local UI_Vector using the function N_Digits
7745 +   --  on the Uint to find the size needed for the vector, and then calling
7746 +   --  Init_Operand to copy the values out of the table into the vector.
7747 +
7748     -----------------
7749     -- Subprograms --
7750     -----------------
7751 @@ -252,6 +264,22 @@
7752     --  function is used for capacity checks, and it can be one bit off
7753     --  without affecting its usage.
7754  
7755 +   function Vector_To_Uint
7756 +     (In_Vec   : UI_Vector;
7757 +      Negative : Boolean) return Uint;
7758 +   --  Functions that calculate values in UI_Vectors, call this function to
7759 +   --  create and return the Uint value. In_Vec contains the multiple precision
7760 +   --  (Base) representation of a non-negative value. Leading zeroes are
7761 +   --  permitted. Negative is set if the desired result is the negative of the
7762 +   --  given value. The result will be either the appropriate directly
7763 +   --  represented value, or a table entry in the proper canonical format is
7764 +   --  created and returned.
7765 +   --
7766 +   --  Note that Init_Operand puts a signed value in the result vector, but
7767 +   --  Vector_To_Uint is always presented with a non-negative value. The
7768 +   --  processing of signs is something that is done by the caller before
7769 +   --  calling Vector_To_Uint.
7770 +
7771     ---------------------
7772     -- Output Routines --
7773     ---------------------
7774 @@ -494,18 +522,6 @@
7775     --  UI_Vector is defined for this purpose and some internal subprograms
7776     --  used for converting from one to the other are defined.
7777  
7778 -   type UI_Vector is array (Pos range <>) of Int;
7779 -   --  Vector containing the integer values of a Uint value
7780 -
7781 -   --  Note: An earlier version of this package used pointers of arrays of Ints
7782 -   --  (dynamically allocated) for the Uint type. The change leads to a few
7783 -   --  less natural idioms used throughout this code, but eliminates all uses
7784 -   --  of the heap except for the table package itself. For example, Uint
7785 -   --  parameters are often converted to UI_Vectors for internal manipulation.
7786 -   --  This is done by creating the local UI_Vector using the function N_Digits
7787 -   --  on the Uint to find the size needed for the vector, and then calling
7788 -   --  Init_Operand to copy the values out of the table into the vector.
7789 -
7790     type Uint_Entry is record
7791        Length : Pos;
7792        --  Length of entry in Udigits table in digits (i.e. in words)
7793 Index: gcc/ada/ChangeLog
7794 ===================================================================
7795 --- gcc/ada/ChangeLog   (.../tags/gcc_4_8_3_release)    (revision 217117)
7796 +++ gcc/ada/ChangeLog   (.../branches/gcc-4_8-branch)   (revision 217117)
7797 @@ -1,3 +1,20 @@
7798 +2014-10-13  Eric Botcazou  <ebotcazou@adacore.com>
7799 +            Alan Modra  <amodra@gmail.com>
7800 +
7801 +       PR ada/63225
7802 +       * uintp.adb (Vector_To_Uint): Move from here to...
7803 +       * uintp.ads (UI_Vector): Make public.
7804 +       (Vector_To_Uint): ...here.
7805 +
7806 +2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
7807 +
7808 +       * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
7809 +       * gsocket.h Add include of <unistd.h> on RTEMS.
7810 +
7811 +2014-08-11  Joel Sherrill <joel.sherrill@oarcorp.com>
7812 +
7813 +       * s-osinte-rtems.adb: Correct formatting of line in license block.
7814 +
7815  2014-05-22  Release Manager
7816  
7817         * GCC 4.8.3 released.
7818 Index: gcc/ada/s-osinte-rtems.adb
7819 ===================================================================
7820 --- gcc/ada/s-osinte-rtems.adb  (.../tags/gcc_4_8_3_release)    (revision 217117)
7821 +++ gcc/ada/s-osinte-rtems.adb  (.../branches/gcc-4_8-branch)   (revision 217117)
7822 @@ -22,7 +22,7 @@
7823  -- You should have received a copy of the GNU General Public License and    --
7824  -- a copy of the GCC Runtime Library Exception along with this program;     --
7825  -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
7826 --- <http://www.gnu.org/licenses/>.                                         
7827 +-- <http://www.gnu.org/licenses/>.                                          --
7828  --                                                                          --
7829  -- GNARL was developed by the GNARL team at Florida State University. It is --
7830  -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
7831 Index: gcc/ada/gsocket.h
7832 ===================================================================
7833 --- gcc/ada/gsocket.h   (.../tags/gcc_4_8_3_release)    (revision 217117)
7834 +++ gcc/ada/gsocket.h   (.../branches/gcc-4_8-branch)   (revision 217117)
7835 @@ -183,6 +183,11 @@
7836  #include <sys/time.h>
7837  #endif
7838  
7839 +#if defined(__rtems__)
7840 +#include <unistd.h>
7841 +/* Required, for read(), write(), and close() */
7842 +#endif
7843 +
7844  /*
7845   * RTEMS has these .h files but not until you have built and installed RTEMS.
7846   * When building a C/C++ toolset, you also build the newlib C library, so the
7847 Index: gcc/tree-ssa-ifcombine.c
7848 ===================================================================
7849 --- gcc/tree-ssa-ifcombine.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
7850 +++ gcc/tree-ssa-ifcombine.c    (.../branches/gcc-4_8-branch)   (revision 217117)
7851 @@ -105,7 +105,11 @@
7852      {
7853        gimple stmt = gsi_stmt (gsi);
7854  
7855 +      if (is_gimple_debug (stmt))
7856 +       continue;
7857 +
7858        if (gimple_has_side_effects (stmt)
7859 +         || gimple_could_trap_p (stmt)
7860           || gimple_vuse (stmt))
7861         return false;
7862      }
7863 @@ -197,7 +201,8 @@
7864        while (is_gimple_assign (stmt)
7865              && ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
7866                   && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
7867 -                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
7868 +                     <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
7869 +                 && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
7870                  || gimple_assign_ssa_name_copy_p (stmt)))
7871         stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
7872  
7873 Index: gcc/sel-sched-ir.c
7874 ===================================================================
7875 --- gcc/sel-sched-ir.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
7876 +++ gcc/sel-sched-ir.c  (.../branches/gcc-4_8-branch)   (revision 217117)
7877 @@ -162,7 +162,7 @@
7878  static void free_av_set (basic_block);
7879  static void invalidate_av_set (basic_block);
7880  static void extend_insn_data (void);
7881 -static void sel_init_new_insn (insn_t, int);
7882 +static void sel_init_new_insn (insn_t, int, int = -1);
7883  static void finish_insns (void);
7884  \f
7885  /* Various list functions.  */
7886 @@ -4011,9 +4011,10 @@
7887    return seqno;
7888  }
7889  
7890 -/* Compute seqno for INSN by its preds or succs.  */
7891 +/* Compute seqno for INSN by its preds or succs.  Use OLD_SEQNO to compute
7892 +   seqno in corner cases.  */
7893  static int
7894 -get_seqno_for_a_jump (insn_t insn)
7895 +get_seqno_for_a_jump (insn_t insn, int old_seqno)
7896  {
7897    int seqno;
7898  
7899 @@ -4069,8 +4070,16 @@
7900    if (seqno < 0)
7901      seqno = get_seqno_by_succs (insn);
7902  
7903 +  if (seqno < 0)
7904 +    {
7905 +      /* The only case where this could be here legally is that the only
7906 +        unscheduled insn was a conditional jump that got removed and turned
7907 +        into this unconditional one.  Initialize from the old seqno
7908 +        of that jump passed down to here.  */
7909 +      seqno = old_seqno;
7910 +    }
7911 +
7912    gcc_assert (seqno >= 0);
7913 -
7914    return seqno;
7915  }
7916  
7917 @@ -4250,22 +4259,24 @@
7918  }
7919  
7920  /* This is used to initialize spurious jumps generated by
7921 -   sel_redirect_edge ().  */
7922 +   sel_redirect_edge ().  OLD_SEQNO is used for initializing seqnos
7923 +   in corner cases within get_seqno_for_a_jump.  */
7924  static void
7925 -init_simplejump_data (insn_t insn)
7926 +init_simplejump_data (insn_t insn, int old_seqno)
7927  {
7928    init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
7929              REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
7930              vNULL, true, false, false,
7931              false, true);
7932 -  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
7933 +  INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
7934    init_first_time_insn_data (insn);
7935  }
7936  
7937  /* Perform deferred initialization of insns.  This is used to process
7938 -   a new jump that may be created by redirect_edge.  */
7939 -void
7940 -sel_init_new_insn (insn_t insn, int flags)
7941 +   a new jump that may be created by redirect_edge.  OLD_SEQNO is used
7942 +   for initializing simplejumps in init_simplejump_data.  */
7943 +static void
7944 +sel_init_new_insn (insn_t insn, int flags, int old_seqno)
7945  {
7946    /* We create data structures for bb when the first insn is emitted in it.  */
7947    if (INSN_P (insn)
7948 @@ -4292,7 +4303,7 @@
7949    if (flags & INSN_INIT_TODO_SIMPLEJUMP)
7950      {
7951        extend_insn_data ();
7952 -      init_simplejump_data (insn);
7953 +      init_simplejump_data (insn, old_seqno);
7954      }
7955  
7956    gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
7957 @@ -5578,8 +5589,7 @@
7958  }
7959  
7960  /* A wrapper for redirect_edge_and_branch_force, which also initializes
7961 -   data structures for possibly created bb and insns.  Returns the newly
7962 -   added bb or NULL, when a bb was not needed.  */
7963 +   data structures for possibly created bb and insns.  */
7964  void
7965  sel_redirect_edge_and_branch_force (edge e, basic_block to)
7966  {
7967 @@ -5586,6 +5596,7 @@
7968    basic_block jump_bb, src, orig_dest = e->dest;
7969    int prev_max_uid;
7970    rtx jump;
7971 +  int old_seqno = -1;
7972  
7973    /* This function is now used only for bookkeeping code creation, where
7974       we'll never get the single pred of orig_dest block and thus will not
7975 @@ -5594,8 +5605,13 @@
7976                && !single_pred_p (orig_dest));
7977    src = e->src;
7978    prev_max_uid = get_max_uid ();
7979 +  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
7980 +     when the conditional jump being redirected may become unconditional.  */
7981 +  if (any_condjump_p (BB_END (src))
7982 +      && INSN_SEQNO (BB_END (src)) >= 0)
7983 +    old_seqno = INSN_SEQNO (BB_END (src));
7984 +
7985    jump_bb = redirect_edge_and_branch_force (e, to);
7986 -
7987    if (jump_bb != NULL)
7988      sel_add_bb (jump_bb);
7989  
7990 @@ -5607,7 +5623,8 @@
7991  
7992    jump = find_new_jump (src, jump_bb, prev_max_uid);
7993    if (jump)
7994 -    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
7995 +    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
7996 +                      old_seqno);
7997    set_immediate_dominator (CDI_DOMINATORS, to,
7998                            recompute_dominator (CDI_DOMINATORS, to));
7999    set_immediate_dominator (CDI_DOMINATORS, orig_dest,
8000 @@ -5626,6 +5643,7 @@
8001    edge redirected;
8002    bool recompute_toporder_p = false;
8003    bool maybe_unreachable = single_pred_p (orig_dest);
8004 +  int old_seqno = -1;
8005  
8006    latch_edge_p = (pipelining_p
8007                    && current_loop_nest
8008 @@ -5634,6 +5652,12 @@
8009    src = e->src;
8010    prev_max_uid = get_max_uid ();
8011  
8012 +  /* Compute and pass old_seqno down to sel_init_new_insn only for the case
8013 +     when the conditional jump being redirected may become unconditional.  */
8014 +  if (any_condjump_p (BB_END (src))
8015 +      && INSN_SEQNO (BB_END (src)) >= 0)
8016 +    old_seqno = INSN_SEQNO (BB_END (src));
8017 +
8018    redirected = redirect_edge_and_branch (e, to);
8019  
8020    gcc_assert (redirected && !last_added_blocks.exists ());
8021 @@ -5654,7 +5678,7 @@
8022  
8023    jump = find_new_jump (src, NULL, prev_max_uid);
8024    if (jump)
8025 -    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
8026 +    sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
8027  
8028    /* Only update dominator info when we don't have unreachable blocks.
8029       Otherwise we'll update in maybe_tidy_empty_bb.  */
8030 Index: gcc/fortran/interface.c
8031 ===================================================================
8032 --- gcc/fortran/interface.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
8033 +++ gcc/fortran/interface.c     (.../branches/gcc-4_8-branch)   (revision 217117)
8034 @@ -1923,7 +1923,7 @@
8035    /* F2008, 12.5.2.5; IR F08/0073.  */
8036    if (formal->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL
8037        && ((CLASS_DATA (formal)->attr.class_pointer
8038 -          && !formal->attr.intent == INTENT_IN)
8039 +          && formal->attr.intent != INTENT_IN)
8040            || CLASS_DATA (formal)->attr.allocatable))
8041      {
8042        if (actual->ts.type != BT_CLASS)
8043 Index: gcc/fortran/trans-expr.c
8044 ===================================================================
8045 --- gcc/fortran/trans-expr.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8046 +++ gcc/fortran/trans-expr.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8047 @@ -7096,7 +7096,7 @@
8048  
8049    res_desc = gfc_evaluate_now (desc, &se->pre);
8050    gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
8051 -  se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
8052 +  se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
8053  
8054    /* Free the lhs after the function call and copy the result data to
8055       the lhs descriptor.  */
8056 Index: gcc/fortran/decl.c
8057 ===================================================================
8058 --- gcc/fortran/decl.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
8059 +++ gcc/fortran/decl.c  (.../branches/gcc-4_8-branch)   (revision 217117)
8060 @@ -1996,6 +1996,13 @@
8061        if (gfc_notify_std (GFC_STD_GNU, "Old-style "
8062                           "initialization at %C") == FAILURE)
8063         return MATCH_ERROR;
8064 +      else if (gfc_current_state () == COMP_DERIVED)
8065 +       {
8066 +         gfc_error ("Invalid old style initialization for derived type "
8067 +                    "component at %C");
8068 +         m = MATCH_ERROR;
8069 +         goto cleanup;
8070 +       }
8071  
8072        return match_old_style_init (name);
8073      }
8074 Index: gcc/fortran/trans-openmp.c
8075 ===================================================================
8076 --- gcc/fortran/trans-openmp.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
8077 +++ gcc/fortran/trans-openmp.c  (.../branches/gcc-4_8-branch)   (revision 217117)
8078 @@ -115,6 +115,16 @@
8079    if (GFC_DECL_RESULT (decl) && ! DECL_HAS_VALUE_EXPR_P (decl))
8080      return OMP_CLAUSE_DEFAULT_SHARED;
8081  
8082 +  /* These are either array or derived parameters, or vtables.
8083 +     In the former cases, the OpenMP standard doesn't consider them to be
8084 +     variables at all (they can't be redefined), but they can nevertheless appear
8085 +     in parallel/task regions and for default(none) purposes treat them as shared.
8086 +     For vtables likely the same handling is desirable.  */
8087 +  if (TREE_CODE (decl) == VAR_DECL
8088 +      && TREE_READONLY (decl)
8089 +      && TREE_STATIC (decl))
8090 +    return OMP_CLAUSE_DEFAULT_SHARED;
8091 +
8092    return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
8093  }
8094  
8095 Index: gcc/fortran/ChangeLog
8096 ===================================================================
8097 --- gcc/fortran/ChangeLog       (.../tags/gcc_4_8_3_release)    (revision 217117)
8098 +++ gcc/fortran/ChangeLog       (.../branches/gcc-4_8-branch)   (revision 217117)
8099 @@ -1,3 +1,63 @@
8100 +2014-10-10  Jakub Jelinek  <jakub@redhat.com>
8101 +
8102 +       PR fortran/59488
8103 +       * trans-openmp.c (gfc_omp_predetermined_sharing): Return
8104 +       OMP_CLAUSE_DEFAULT_SHARED for parameters or vtables.
8105 +
8106 +2014-09-03  Marek Polacek  <polacek@redhat.com>
8107 +
8108 +       Backport from trunk
8109 +       PR fortran/62270
8110 +       * interface.c (compare_parameter): Fix condition.
8111 +
8112 +2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
8113 +
8114 +       Backport from trunk
8115 +       PR fortran/62214
8116 +       * gfortran.dg/array_assignment_5.f90:  New test.
8117 +
8118 +2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
8119 +
8120 +       Backport from trunk
8121 +       PR fortran/61999
8122 +       * simplify.c (gfc_simplify_dot_product): Convert types of
8123 +       vectors before calculating the result.
8124 +
8125 +2014-07-19  Paul Thomas  <pault@gcc.gnu.org>
8126 +
8127 +       Backport from trunk.
8128 +       PR fortran/61780
8129 +       * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
8130 +       that elements are skipped. This then correctly aligns 'reverse'
8131 +       with the scalarizer loops.
8132 +
8133 +2014-07-08  Paul Thomas  <pault@gcc.gnu.org>
8134 +
8135 +       PR fortran/61459
8136 +       PR fortran/58883
8137 +       * trans-expr.c (fcncall_realloc_result): Use the natural type
8138 +       for the address expression of 'res_desc'.
8139 +
8140 +2014-07-02  Jakub Jelinek  <jakub@redhat.com>
8141 +           Fritz Reese  <Reese-Fritz@zai.com>
8142 +
8143 +       * decl.c (variable_decl): Reject old style initialization
8144 +       for derived type components.
8145 +
8146 +2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
8147 +
8148 +       Backport from trunk.
8149 +       PR fortran/45187
8150 +       * trans-decl.c (gfc_create_module_variable): Don't create
8151 +       Cray-pointee decls twice.
8152 +
8153 +2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
8154 +
8155 +       Backport from mainline
8156 +       PR libfortran/61310
8157 +       * intrinsics.texi (CTIME): Remove mention of locale-dependent
8158 +       behavior.
8159 +
8160  2014-05-22  Release Manager
8161  
8162         * GCC 4.8.3 released.
8163 Index: gcc/fortran/frontend-passes.c
8164 ===================================================================
8165 --- gcc/fortran/frontend-passes.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
8166 +++ gcc/fortran/frontend-passes.c       (.../branches/gcc-4_8-branch)   (revision 217117)
8167 @@ -874,6 +874,10 @@
8168             return true;
8169           break;
8170  
8171 +       case INTRINSIC_CONCAT:
8172 +         /* Do not do string concatenations.  */
8173 +         break;
8174 +
8175         default:
8176           /* Binary operators.  */
8177           if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
8178 Index: gcc/fortran/trans-decl.c
8179 ===================================================================
8180 --- gcc/fortran/trans-decl.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8181 +++ gcc/fortran/trans-decl.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8182 @@ -4084,8 +4084,8 @@
8183      }
8184  
8185    /* Don't generate variables from other modules. Variables from
8186 -     COMMONs will already have been generated.  */
8187 -  if (sym->attr.use_assoc || sym->attr.in_common)
8188 +     COMMONs and Cray pointees will already have been generated.  */
8189 +  if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
8190      return;
8191  
8192    /* Equivalenced variables arrive here after creation.  */
8193 Index: gcc/fortran/dependency.c
8194 ===================================================================
8195 --- gcc/fortran/dependency.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8196 +++ gcc/fortran/dependency.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8197 @@ -1779,6 +1779,7 @@
8198  gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
8199  {
8200    int n;
8201 +  int m;
8202    gfc_dependency fin_dep;
8203    gfc_dependency this_dep;
8204  
8205 @@ -1828,6 +1829,8 @@
8206               break;
8207             }
8208  
8209 +         /* Index for the reverse array.  */
8210 +         m = -1;
8211           for (n=0; n < lref->u.ar.dimen; n++)
8212             {
8213               /* Assume dependency when either of array reference is vector
8214 @@ -1862,31 +1865,37 @@
8215                  The ability to reverse or not is set by previous conditions
8216                  in this dimension.  If reversal is not activated, the
8217                  value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP.  */
8218 +
8219 +             /* Get the indexing right for the scalarizing loop. If this
8220 +                is an element, there is no corresponding loop.  */
8221 +             if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
8222 +               m++;
8223 +
8224               if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
8225                     && lref->u.ar.dimen_type[n] == DIMEN_RANGE)
8226                 {
8227                   /* Set reverse if backward dependence and not inhibited.  */
8228 -                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
8229 -                   reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
8230 -                                GFC_REVERSE_SET : reverse[n];
8231 +                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
8232 +                   reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
8233 +                                GFC_REVERSE_SET : reverse[m];
8234  
8235                   /* Set forward if forward dependence and not inhibited.  */
8236 -                 if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
8237 -                   reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
8238 -                                GFC_FORWARD_SET : reverse[n];
8239 +                 if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
8240 +                   reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
8241 +                                GFC_FORWARD_SET : reverse[m];
8242  
8243                   /* Flag up overlap if dependence not compatible with
8244                      the overall state of the expression.  */
8245 -                 if (reverse && reverse[n] == GFC_REVERSE_SET
8246 +                 if (reverse && reverse[m] == GFC_REVERSE_SET
8247                         && this_dep == GFC_DEP_FORWARD)
8248                     {
8249 -                     reverse[n] = GFC_INHIBIT_REVERSE;
8250 +                     reverse[m] = GFC_INHIBIT_REVERSE;
8251                       this_dep = GFC_DEP_OVERLAP;
8252                     }
8253 -                 else if (reverse && reverse[n] == GFC_FORWARD_SET
8254 +                 else if (reverse && reverse[m] == GFC_FORWARD_SET
8255                         && this_dep == GFC_DEP_BACKWARD)
8256                     {
8257 -                     reverse[n] = GFC_INHIBIT_REVERSE;
8258 +                     reverse[m] = GFC_INHIBIT_REVERSE;
8259                       this_dep = GFC_DEP_OVERLAP;
8260                     }
8261  
8262 @@ -1893,7 +1902,7 @@
8263                   /* If no intention of reversing or reversing is explicitly
8264                      inhibited, convert backward dependence to overlap.  */
8265                   if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
8266 -                     || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
8267 +                     || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
8268                     this_dep = GFC_DEP_OVERLAP;
8269                 }
8270  
8271 Index: gcc/fortran/intrinsic.texi
8272 ===================================================================
8273 --- gcc/fortran/intrinsic.texi  (.../tags/gcc_4_8_3_release)    (revision 217117)
8274 +++ gcc/fortran/intrinsic.texi  (.../branches/gcc-4_8-branch)   (revision 217117)
8275 @@ -3343,10 +3343,8 @@
8276  @table @asis
8277  @item @emph{Description}:
8278  @code{CTIME} converts a system time value, such as returned by
8279 -@code{TIME8}, to a string. Unless the application has called
8280 -@code{setlocale}, the output will be in the default locale, of length
8281 -24 and of the form @samp{Sat Aug 19 18:13:14 1995}. In other locales,
8282 -a longer string may result.
8283 +@code{TIME8}, to a string. The output will be of the form @samp{Sat
8284 +Aug 19 18:13:14 1995}.
8285  
8286  This intrinsic is provided in both subroutine and function forms; however,
8287  only one form can be used in any given program unit.
8288 Index: gcc/fortran/simplify.c
8289 ===================================================================
8290 --- gcc/fortran/simplify.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
8291 +++ gcc/fortran/simplify.c      (.../branches/gcc-4_8-branch)   (revision 217117)
8292 @@ -1877,6 +1877,9 @@
8293  gfc_expr*
8294  gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
8295  {
8296 +
8297 +  gfc_expr temp;
8298 +
8299    if (!is_constant_array_expr (vector_a)
8300        || !is_constant_array_expr (vector_b))
8301      return NULL;
8302 @@ -1883,8 +1886,14 @@
8303  
8304    gcc_assert (vector_a->rank == 1);
8305    gcc_assert (vector_b->rank == 1);
8306 -  gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
8307  
8308 +  temp.expr_type = EXPR_OP;
8309 +  gfc_clear_ts (&temp.ts);
8310 +  temp.value.op.op = INTRINSIC_NONE;
8311 +  temp.value.op.op1 = vector_a;
8312 +  temp.value.op.op2 = vector_b;
8313 +  gfc_type_convert_binary (&temp, 1);
8314 +
8315    return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
8316  }
8317  
8318 Index: gcc/configure.ac
8319 ===================================================================
8320 --- gcc/configure.ac    (.../tags/gcc_4_8_3_release)    (revision 217117)
8321 +++ gcc/configure.ac    (.../branches/gcc-4_8-branch)   (revision 217117)
8322 @@ -3443,6 +3443,32 @@
8323  AC_MSG_RESULT($gcc_cv_lto_plugin)
8324  
8325  case "$target" in
8326 +
8327 +  aarch64*-*-*)
8328 +    # Enable default workaround for AArch64 Cortex-A53 erratum 835769.
8329 +    AC_ARG_ENABLE(fix-cortex-a53-835769,
8330 +    [
8331 +AS_HELP_STRING([--enable-fix-cortex-a53-835769],
8332 +        [enable workaround for AArch64 Cortex-A53 erratum 835769 by default])
8333 +AS_HELP_STRING([--disable-fix-cortex-a53-835769],
8334 +        [disable workaround for AArch64 Cortex-A53 erratum 835769 by default])
8335 +    ],
8336 +      [
8337 +        case $enableval in
8338 +          yes)
8339 +            tm_defines="${tm_defines} TARGET_FIX_ERR_A53_835769_DEFAULT=1"
8340 +            ;;
8341 +          no)
8342 +            ;;
8343 +          *)
8344 +            AC_MSG_ERROR(['$enableval' is an invalid value for --enable-fix-cortex-a53-835769.\
8345 +  Valid choices are 'yes' and 'no'.])
8346 +            ;;
8347 +
8348 +        esac
8349 +      ],
8350 +    [])
8351 +  ;;
8352    # All TARGET_ABI_OSF targets.
8353    alpha*-*-linux* | alpha*-*-*bsd*)
8354      gcc_GAS_CHECK_FEATURE([explicit relocation support],
8355 Index: gcc/function.c
8356 ===================================================================
8357 --- gcc/function.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
8358 +++ gcc/function.c      (.../branches/gcc-4_8-branch)   (revision 217117)
8359 @@ -1354,9 +1354,13 @@
8360  #define STACK_POINTER_OFFSET   0
8361  #endif
8362  
8363 +#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
8364 +#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
8365 +#endif
8366 +
8367  /* If not defined, pick an appropriate default for the offset of dynamically
8368     allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
8369 -   REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
8370 +   INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.  */
8371  
8372  #ifndef STACK_DYNAMIC_OFFSET
8373  
8374 @@ -1368,12 +1372,12 @@
8375     `crtl->outgoing_args_size'.  Nevertheless, we must allow
8376     for it when allocating stack dynamic objects.  */
8377  
8378 -#if defined(REG_PARM_STACK_SPACE)
8379 +#ifdef INCOMING_REG_PARM_STACK_SPACE
8380  #define STACK_DYNAMIC_OFFSET(FNDECL)   \
8381  ((ACCUMULATE_OUTGOING_ARGS                                                   \
8382    ? (crtl->outgoing_args_size                                \
8383       + (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
8384 -                                              : REG_PARM_STACK_SPACE (FNDECL))) \
8385 +                                              : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
8386    : 0) + (STACK_POINTER_OFFSET))
8387  #else
8388  #define STACK_DYNAMIC_OFFSET(FNDECL)   \
8389 @@ -2211,8 +2215,9 @@
8390  #endif
8391    all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
8392  
8393 -#ifdef REG_PARM_STACK_SPACE
8394 -  all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
8395 +#ifdef INCOMING_REG_PARM_STACK_SPACE
8396 +  all->reg_parm_stack_space
8397 +    = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
8398  #endif
8399  }
8400  
8401 @@ -4518,6 +4523,7 @@
8402        /* ??? This could be set on a per-function basis by the front-end
8403           but is this worth the hassle?  */
8404        cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
8405 +      cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
8406      }
8407  }
8408  
8409 Index: gcc/tree-vectorizer.h
8410 ===================================================================
8411 --- gcc/tree-vectorizer.h       (.../tags/gcc_4_8_3_release)    (revision 217117)
8412 +++ gcc/tree-vectorizer.h       (.../branches/gcc-4_8-branch)   (revision 217117)
8413 @@ -324,9 +324,9 @@
8414  #define LOOP_VINFO_OPERANDS_SWAPPED(L)     (L)->operands_swapped
8415  
8416  #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
8417 -(L)->may_misalign_stmts.length () > 0
8418 +((L)->may_misalign_stmts.length () > 0)
8419  #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L)     \
8420 -(L)->may_alias_ddrs.length () > 0
8421 +((L)->may_alias_ddrs.length () > 0)
8422  
8423  #define NITERS_KNOWN_P(n)                     \
8424  (host_integerp ((n),0)                        \
8425 @@ -931,7 +931,8 @@
8426  extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
8427  extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
8428                                       tree *, gimple_stmt_iterator *,
8429 -                                     gimple *, bool, bool *);
8430 +                                     gimple *, bool, bool *,
8431 +                                     tree = NULL_TREE);
8432  extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
8433  extern tree vect_create_destination_var (tree, tree);
8434  extern bool vect_grouped_store_supported (tree, unsigned HOST_WIDE_INT);
8435 @@ -949,7 +950,8 @@
8436  extern int vect_get_place_in_interleaving_chain (gimple, gimple);
8437  extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
8438  extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
8439 -                                                  tree, struct loop *);
8440 +                                                 tree, struct loop *,
8441 +                                                 tree = NULL_TREE);
8442  
8443  /* In tree-vect-loop.c.  */
8444  /* FORNOW: Used in tree-parloops.c.  */
8445 Index: gcc/stor-layout.c
8446 ===================================================================
8447 --- gcc/stor-layout.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
8448 +++ gcc/stor-layout.c   (.../branches/gcc-4_8-branch)   (revision 217117)
8449 @@ -234,12 +234,7 @@
8450        param_type = TREE_TYPE (ref);
8451        param_decl
8452         = build_decl (input_location, PARM_DECL, param_name, param_type);
8453 -      if (targetm.calls.promote_prototypes (NULL_TREE)
8454 -         && INTEGRAL_TYPE_P (param_type)
8455 -         && TYPE_PRECISION (param_type) < TYPE_PRECISION (integer_type_node))
8456 -       DECL_ARG_TYPE (param_decl) = integer_type_node;
8457 -      else
8458 -       DECL_ARG_TYPE (param_decl) = param_type;
8459 +      DECL_ARG_TYPE (param_decl) = param_type;
8460        DECL_ARTIFICIAL (param_decl) = 1;
8461        TREE_READONLY (param_decl) = 1;
8462  
8463 Index: gcc/tree-vect-loop.c
8464 ===================================================================
8465 --- gcc/tree-vect-loop.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
8466 +++ gcc/tree-vect-loop.c        (.../branches/gcc-4_8-branch)   (revision 217117)
8467 @@ -2205,7 +2205,8 @@
8468          }
8469  
8470        def1 = SSA_NAME_DEF_STMT (op1);
8471 -      if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
8472 +      if (gimple_bb (def1)
8473 +         && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
8474            && loop->inner
8475            && flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
8476            && is_gimple_assign (def1))
8477 Index: gcc/tree-vect-data-refs.c
8478 ===================================================================
8479 --- gcc/tree-vect-data-refs.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
8480 +++ gcc/tree-vect-data-refs.c   (.../branches/gcc-4_8-branch)   (revision 217117)
8481 @@ -3553,6 +3553,9 @@
8482             is as follows:
8483             if LOOP=i_loop:     &in             (relative to i_loop)
8484             if LOOP=j_loop:     &in+i*2B        (relative to j_loop)
8485 +   BYTE_OFFSET: Optional, defaulted to NULL.  If supplied, it is added to the
8486 +           initial address.  Unlike OFFSET, which is number of elements to
8487 +           be added, BYTE_OFFSET is measured in bytes.
8488  
8489     Output:
8490     1. Return an SSA_NAME whose value is the address of the memory location of
8491 @@ -3566,7 +3569,8 @@
8492  vect_create_addr_base_for_vector_ref (gimple stmt,
8493                                       gimple_seq *new_stmt_list,
8494                                       tree offset,
8495 -                                     struct loop *loop)
8496 +                                     struct loop *loop,
8497 +                                     tree byte_offset)
8498  {
8499    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
8500    struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
8501 @@ -3628,7 +3632,17 @@
8502        base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
8503        gimple_seq_add_seq (new_stmt_list, seq);
8504      }
8505 +  if (byte_offset)
8506 +    {
8507 +      tree tmp = create_tmp_var (sizetype, "offset");
8508  
8509 +      byte_offset = fold_convert (sizetype, byte_offset);
8510 +      base_offset = fold_build2 (PLUS_EXPR, sizetype,
8511 +                                base_offset, byte_offset);
8512 +      base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
8513 +      gimple_seq_add_seq (new_stmt_list, seq);
8514 +    }
8515 +
8516    /* base + base_offset */
8517    if (loop_vinfo)
8518      addr_base = fold_build_pointer_plus (data_ref_base, base_offset);
8519 @@ -3692,6 +3706,10 @@
8520     5. BSI: location where the new stmts are to be placed if there is no loop
8521     6. ONLY_INIT: indicate if ap is to be updated in the loop, or remain
8522          pointing to the initial address.
8523 +   7. BYTE_OFFSET (optional, defaults to NULL): a byte offset to be added
8524 +       to the initial address accessed by the data-ref in STMT.  This is
8525 +       similar to OFFSET, but OFFSET is counted in elements, while BYTE_OFFSET
8526 +       in bytes.
8527  
8528     Output:
8529     1. Declare a new ptr to vector_type, and have it point to the base of the
8530 @@ -3705,6 +3723,8 @@
8531           initial_address = &a[init];
8532        if OFFSET is supplied:
8533           initial_address = &a[init + OFFSET];
8534 +      if BYTE_OFFSET is supplied:
8535 +        initial_address = &a[init] + BYTE_OFFSET;
8536  
8537        Return the initial_address in INITIAL_ADDRESS.
8538  
8539 @@ -3722,7 +3742,7 @@
8540  vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
8541                           tree offset, tree *initial_address,
8542                           gimple_stmt_iterator *gsi, gimple *ptr_incr,
8543 -                         bool only_init, bool *inv_p)
8544 +                         bool only_init, bool *inv_p, tree byte_offset)
8545  {
8546    const char *base_name;
8547    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
8548 @@ -3881,10 +3901,10 @@
8549    /* (2) Calculate the initial address of the aggregate-pointer, and set
8550       the aggregate-pointer to point to it before the loop.  */
8551  
8552 -  /* Create: (&(base[init_val+offset]) in the loop preheader.  */
8553 +  /* Create: (&(base[init_val+offset]+byte_offset) in the loop preheader.  */
8554  
8555    new_temp = vect_create_addr_base_for_vector_ref (stmt, &new_stmt_list,
8556 -                                                   offset, loop);
8557 +                                                  offset, loop, byte_offset);
8558    if (new_stmt_list)
8559      {
8560        if (pe)
8561 Index: gcc/emit-rtl.c
8562 ===================================================================
8563 --- gcc/emit-rtl.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
8564 +++ gcc/emit-rtl.c      (.../branches/gcc-4_8-branch)   (revision 217117)
8565 @@ -263,7 +263,7 @@
8566  
8567  /* Return true if the given memory attributes are equal.  */
8568  
8569 -static bool
8570 +bool
8571  mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
8572  {
8573    return (p->alias == q->alias
8574 Index: gcc/gimple-fold.c
8575 ===================================================================
8576 --- gcc/gimple-fold.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
8577 +++ gcc/gimple-fold.c   (.../branches/gcc-4_8-branch)   (revision 217117)
8578 @@ -2955,8 +2955,8 @@
8579       result.  */
8580    if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
8581        /* VIEW_CONVERT_EXPR is defined only for matching sizes.  */
8582 -      && operand_equal_p (TYPE_SIZE (type),
8583 -                         TYPE_SIZE (TREE_TYPE (ctor)), 0))
8584 +      && !compare_tree_int (TYPE_SIZE (type), size)
8585 +      && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
8586      {
8587        ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
8588        ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
8589 Index: gcc/emit-rtl.h
8590 ===================================================================
8591 --- gcc/emit-rtl.h      (.../tags/gcc_4_8_3_release)    (revision 217117)
8592 +++ gcc/emit-rtl.h      (.../branches/gcc-4_8-branch)   (revision 217117)
8593 @@ -20,6 +20,9 @@
8594  #ifndef GCC_EMIT_RTL_H
8595  #define GCC_EMIT_RTL_H
8596  
8597 +/* Return whether two MEM_ATTRs are equal.  */
8598 +bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
8599 +
8600  /* Set the alias set of MEM to SET.  */
8601  extern void set_mem_alias_set (rtx, alias_set_type);
8602  
8603 Index: gcc/tree-cfgcleanup.c
8604 ===================================================================
8605 --- gcc/tree-cfgcleanup.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
8606 +++ gcc/tree-cfgcleanup.c       (.../branches/gcc-4_8-branch)   (revision 217117)
8607 @@ -498,7 +498,20 @@
8608  
8609    /* First split basic block if stmt is not last.  */
8610    if (stmt != gsi_stmt (gsi_last_bb (bb)))
8611 -    split_block (bb, stmt);
8612 +    {
8613 +      if (stmt == gsi_stmt (gsi_last_nondebug_bb (bb)))
8614 +       {
8615 +         /* Don't split if there are only debug stmts
8616 +            after stmt, that can result in -fcompare-debug
8617 +            failures.  Remove the debug stmts instead,
8618 +            they should be all unreachable anyway.  */
8619 +         gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
8620 +         for (gsi_next (&gsi); !gsi_end_p (gsi); )
8621 +           gsi_remove (&gsi, true);
8622 +       }
8623 +      else
8624 +       split_block (bb, stmt);
8625 +    }
8626  
8627    changed |= remove_fallthru_edge (bb->succs);
8628  
8629 Index: gcc/tree-sra.c
8630 ===================================================================
8631 --- gcc/tree-sra.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
8632 +++ gcc/tree-sra.c      (.../branches/gcc-4_8-branch)   (revision 217117)
8633 @@ -1030,6 +1030,11 @@
8634                                "component.");
8635        return NULL;
8636      }
8637 +  if (TREE_THIS_VOLATILE (expr))
8638 +    {
8639 +      disqualify_base_of_expr (expr, "part of a volatile reference.");
8640 +      return NULL;
8641 +    }
8642  
8643    switch (TREE_CODE (expr))
8644      {
8645 Index: gcc/common.opt
8646 ===================================================================
8647 --- gcc/common.opt      (.../tags/gcc_4_8_3_release)    (revision 217117)
8648 +++ gcc/common.opt      (.../branches/gcc-4_8-branch)   (revision 217117)
8649 @@ -1226,6 +1226,10 @@
8650  Common Report Var(flag_tm)
8651  Enable support for GNU transactional memory
8652  
8653 +fgnu-unique
8654 +Common Report Var(flag_gnu_unique) Init(1)
8655 +Use STB_GNU_UNIQUE if supported by the assembler
8656 +
8657  floop-flatten
8658  Common Ignore
8659  Does nothing. Preserved for backward compatibility.
8660 Index: gcc/tree-vect-patterns.c
8661 ===================================================================
8662 --- gcc/tree-vect-patterns.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8663 +++ gcc/tree-vect-patterns.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8664 @@ -395,7 +395,7 @@
8665            || !promotion)
8666          return NULL;
8667        oprnd00 = gimple_assign_rhs1 (def_stmt);
8668 -      if (!type_conversion_p (oprnd0, stmt, true, &half_type1, &def_stmt,
8669 +      if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt,
8670                                  &promotion)
8671            || !promotion)
8672          return NULL;
8673 Index: gcc/sched-deps.c
8674 ===================================================================
8675 --- gcc/sched-deps.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8676 +++ gcc/sched-deps.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8677 @@ -2744,7 +2744,8 @@
8678            Consider for instance a volatile asm that changes the fpu rounding
8679            mode.  An insn should not be moved across this even if it only uses
8680            pseudo-regs because it might give an incorrectly rounded result.  */
8681 -       if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
8682 +       if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
8683 +           && !DEBUG_INSN_P (insn))
8684           reg_pending_barrier = TRUE_BARRIER;
8685  
8686         /* For all ASM_OPERANDS, we must traverse the vector of input operands.
8687 Index: gcc/tree-vect-stmts.c
8688 ===================================================================
8689 --- gcc/tree-vect-stmts.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
8690 +++ gcc/tree-vect-stmts.c       (.../branches/gcc-4_8-branch)   (revision 217117)
8691 @@ -4319,6 +4319,7 @@
8692    int i, j, group_size;
8693    tree msq = NULL_TREE, lsq;
8694    tree offset = NULL_TREE;
8695 +  tree byte_offset = NULL_TREE;
8696    tree realignment_token = NULL_TREE;
8697    gimple phi = NULL;
8698    vec<tree> dr_chain = vNULL;
8699 @@ -4934,7 +4935,8 @@
8700        if (alignment_support_scheme == dr_explicit_realign_optimized)
8701         {
8702           phi = SSA_NAME_DEF_STMT (msq);
8703 -         offset = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
8704 +         byte_offset = size_binop (MINUS_EXPR, TYPE_SIZE_UNIT (vectype),
8705 +                                   size_one_node);
8706         }
8707      }
8708    else
8709 @@ -4955,7 +4957,8 @@
8710        if (j == 0)
8711          dataref_ptr = vect_create_data_ref_ptr (first_stmt, aggr_type, at_loop,
8712                                                 offset, &dummy, gsi,
8713 -                                               &ptr_incr, false, &inv_p);
8714 +                                               &ptr_incr, false, &inv_p,
8715 +                                               byte_offset);
8716        else
8717          dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
8718                                        TYPE_SIZE_UNIT (aggr_type));
8719 Index: gcc/config/alpha/elf.h
8720 ===================================================================
8721 --- gcc/config/alpha/elf.h      (.../tags/gcc_4_8_3_release)    (revision 217117)
8722 +++ gcc/config/alpha/elf.h      (.../branches/gcc-4_8-branch)   (revision 217117)
8723 @@ -126,6 +126,10 @@
8724    "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
8725     %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
8726  
8727 +/* This variable should be set to 'true' if the target ABI requires
8728 +   unwinding tables even when exceptions are not used.  */
8729 +#define TARGET_UNWIND_TABLES_DEFAULT true
8730 +
8731  /* Select a format to encode pointers in exception handling data.  CODE
8732     is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
8733     true if the symbol may be affected by dynamic relocations.
8734 Index: gcc/config/alpha/alpha.c
8735 ===================================================================
8736 --- gcc/config/alpha/alpha.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
8737 +++ gcc/config/alpha/alpha.c    (.../branches/gcc-4_8-branch)   (revision 217117)
8738 @@ -8658,6 +8658,11 @@
8739                         }
8740                       break;
8741  
8742 +                   case BARRIER:
8743 +                     /* __builtin_unreachable can expand to no code at all,
8744 +                        leaving (barrier) RTXes in the instruction stream.  */
8745 +                     goto close_shadow_notrapb;
8746 +
8747                     case JUMP_INSN:
8748                     case CALL_INSN:
8749                     case CODE_LABEL:
8750 @@ -8673,6 +8678,7 @@
8751                   n = emit_insn_before (gen_trapb (), i);
8752                   PUT_MODE (n, TImode);
8753                   PUT_MODE (i, TImode);
8754 +               close_shadow_notrapb:
8755                   trap_pending = 0;
8756                   shadow.used.i = 0;
8757                   shadow.used.fp = 0;
8758 Index: gcc/config/elfos.h
8759 ===================================================================
8760 --- gcc/config/elfos.h  (.../tags/gcc_4_8_3_release)    (revision 217117)
8761 +++ gcc/config/elfos.h  (.../branches/gcc-4_8-branch)   (revision 217117)
8762 @@ -287,7 +287,7 @@
8763  /* Write the extra assembler code needed to declare an object properly.  */
8764  
8765  #ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
8766 -#define USE_GNU_UNIQUE_OBJECT 1
8767 +#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
8768  #else
8769  #define USE_GNU_UNIQUE_OBJECT 0
8770  #endif
8771 Index: gcc/config/sparc/sync.md
8772 ===================================================================
8773 --- gcc/config/sparc/sync.md    (.../tags/gcc_4_8_3_release)    (revision 217117)
8774 +++ gcc/config/sparc/sync.md    (.../branches/gcc-4_8-branch)   (revision 217117)
8775 @@ -64,11 +64,19 @@
8776    "stbar"
8777    [(set_attr "type" "multi")])
8778  
8779 +;; For LEON3, STB has the effect of membar #StoreLoad.
8780 +(define_insn "*membar_storeload_leon3"
8781 +  [(set (match_operand:BLK 0 "" "")
8782 +       (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
8783 +  "TARGET_LEON3"
8784 +  "stb\t%%g0, [%%sp-1]"
8785 +  [(set_attr "type" "store")])
8786 +
8787  ;; For V8, LDSTUB has the effect of membar #StoreLoad.
8788  (define_insn "*membar_storeload"
8789    [(set (match_operand:BLK 0 "" "")
8790         (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
8791 -  "TARGET_V8"
8792 +  "TARGET_V8 && !TARGET_LEON3"
8793    "ldstub\t[%%sp-1], %%g0"
8794    [(set_attr "type" "multi")])
8795  
8796 Index: gcc/config/i386/i386.md
8797 ===================================================================
8798 --- gcc/config/i386/i386.md     (.../tags/gcc_4_8_3_release)    (revision 217117)
8799 +++ gcc/config/i386/i386.md     (.../branches/gcc-4_8-branch)   (revision 217117)
8800 @@ -5339,66 +5339,37 @@
8801  
8802  ;; Avoid store forwarding (partial memory) stall penalty by extending
8803  ;; SImode value to DImode through XMM register instead of pushing two
8804 -;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
8805 -;; targets benefit from this optimization. Also note that fild
8806 -;; loads from memory only.
8807 +;; SImode values to stack. Also note that fild loads from memory only.
8808  
8809 -(define_insn "*floatunssi<mode>2_1"
8810 -  [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
8811 +(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
8812 +  [(set (match_operand:X87MODEF 0 "register_operand" "=f")
8813         (unsigned_float:X87MODEF
8814 -         (match_operand:SI 1 "nonimmediate_operand" "x,m")))
8815 -   (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
8816 -   (clobber (match_scratch:SI 3 "=X,x"))]
8817 +         (match_operand:SI 1 "nonimmediate_operand" "rm")))
8818 +   (clobber (match_scratch:DI 3 "=x"))
8819 +   (clobber (match_operand:DI 2 "memory_operand" "=m"))]
8820    "!TARGET_64BIT
8821     && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
8822 -   && TARGET_SSE"
8823 +   && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
8824    "#"
8825 +  "&& reload_completed"
8826 +  [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
8827 +   (set (match_dup 2) (match_dup 3))
8828 +   (set (match_dup 0)
8829 +       (float:X87MODEF (match_dup 2)))]
8830 +  ""
8831    [(set_attr "type" "multi")
8832     (set_attr "mode" "<MODE>")])
8833  
8834 -(define_split
8835 -  [(set (match_operand:X87MODEF 0 "register_operand")
8836 -       (unsigned_float:X87MODEF
8837 -         (match_operand:SI 1 "register_operand")))
8838 -   (clobber (match_operand:DI 2 "memory_operand"))
8839 -   (clobber (match_scratch:SI 3))]
8840 -  "!TARGET_64BIT
8841 -   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
8842 -   && TARGET_SSE
8843 -   && reload_completed"
8844 -  [(set (match_dup 2) (match_dup 1))
8845 -   (set (match_dup 0)
8846 -       (float:X87MODEF (match_dup 2)))]
8847 -  "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
8848 -
8849 -(define_split
8850 -  [(set (match_operand:X87MODEF 0 "register_operand")
8851 -       (unsigned_float:X87MODEF
8852 -         (match_operand:SI 1 "memory_operand")))
8853 -   (clobber (match_operand:DI 2 "memory_operand"))
8854 -   (clobber (match_scratch:SI 3))]
8855 -  "!TARGET_64BIT
8856 -   && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
8857 -   && TARGET_SSE
8858 -   && reload_completed"
8859 -  [(set (match_dup 2) (match_dup 3))
8860 -   (set (match_dup 0)
8861 -       (float:X87MODEF (match_dup 2)))]
8862 -{
8863 -  emit_move_insn (operands[3], operands[1]);
8864 -  operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
8865 -})
8866 -
8867  (define_expand "floatunssi<mode>2"
8868    [(parallel
8869       [(set (match_operand:X87MODEF 0 "register_operand")
8870            (unsigned_float:X87MODEF
8871              (match_operand:SI 1 "nonimmediate_operand")))
8872 -      (clobber (match_dup 2))
8873 -      (clobber (match_scratch:SI 3))])]
8874 +      (clobber (match_scratch:DI 3))
8875 +      (clobber (match_dup 2))])]
8876    "!TARGET_64BIT
8877     && ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
8878 -       && TARGET_SSE)
8879 +       && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
8880         || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
8881  {
8882    if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
8883 @@ -13545,7 +13516,8 @@
8884     (set (reg:CCFP FPSR_REG)
8885         (unspec:CCFP [(match_dup 2) (match_dup 3)]
8886                      UNSPEC_C2_FLAG))]
8887 -  "TARGET_USE_FANCY_MATH_387"
8888 +  "TARGET_USE_FANCY_MATH_387
8889 +   && flag_finite_math_only"
8890    "fprem"
8891    [(set_attr "type" "fpspc")
8892     (set_attr "mode" "XF")])
8893 @@ -13554,7 +13526,8 @@
8894    [(use (match_operand:XF 0 "register_operand"))
8895     (use (match_operand:XF 1 "general_operand"))
8896     (use (match_operand:XF 2 "general_operand"))]
8897 -  "TARGET_USE_FANCY_MATH_387"
8898 +  "TARGET_USE_FANCY_MATH_387
8899 +   && flag_finite_math_only"
8900  {
8901    rtx label = gen_label_rtx ();
8902  
8903 @@ -13577,7 +13550,8 @@
8904    [(use (match_operand:MODEF 0 "register_operand"))
8905     (use (match_operand:MODEF 1 "general_operand"))
8906     (use (match_operand:MODEF 2 "general_operand"))]
8907 -  "TARGET_USE_FANCY_MATH_387"
8908 +  "TARGET_USE_FANCY_MATH_387
8909 +   && flag_finite_math_only"
8910  {
8911    rtx (*gen_truncxf) (rtx, rtx);
8912  
8913 @@ -13616,7 +13590,8 @@
8914     (set (reg:CCFP FPSR_REG)
8915         (unspec:CCFP [(match_dup 2) (match_dup 3)]
8916                      UNSPEC_C2_FLAG))]
8917 -  "TARGET_USE_FANCY_MATH_387"
8918 +  "TARGET_USE_FANCY_MATH_387
8919 +   && flag_finite_math_only"
8920    "fprem1"
8921    [(set_attr "type" "fpspc")
8922     (set_attr "mode" "XF")])
8923 @@ -13625,7 +13600,8 @@
8924    [(use (match_operand:XF 0 "register_operand"))
8925     (use (match_operand:XF 1 "general_operand"))
8926     (use (match_operand:XF 2 "general_operand"))]
8927 -  "TARGET_USE_FANCY_MATH_387"
8928 +  "TARGET_USE_FANCY_MATH_387
8929 +   && flag_finite_math_only"
8930  {
8931    rtx label = gen_label_rtx ();
8932  
8933 @@ -13648,7 +13624,8 @@
8934    [(use (match_operand:MODEF 0 "register_operand"))
8935     (use (match_operand:MODEF 1 "general_operand"))
8936     (use (match_operand:MODEF 2 "general_operand"))]
8937 -  "TARGET_USE_FANCY_MATH_387"
8938 +  "TARGET_USE_FANCY_MATH_387
8939 +   && flag_finite_math_only"
8940  {
8941    rtx (*gen_truncxf) (rtx, rtx);
8942  
8943 Index: gcc/config/i386/driver-i386.c
8944 ===================================================================
8945 --- gcc/config/i386/driver-i386.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
8946 +++ gcc/config/i386/driver-i386.c       (.../branches/gcc-4_8-branch)   (revision 217117)
8947 @@ -713,6 +713,11 @@
8948                     /* Assume Core 2.  */
8949                     cpu = "core2";
8950                 }
8951 +             else if (has_longmode)
8952 +               /* Perhaps some emulator?  Assume x86-64, otherwise gcc
8953 +                  -march=native would be unusable for 64-bit compilations,
8954 +                  as all the CPUs below are 32-bit only.  */
8955 +               cpu = "x86-64";
8956               else if (has_sse3)
8957                 /* It is Core Duo.  */
8958                 cpu = "pentium-m";
8959 Index: gcc/config/i386/i386.c
8960 ===================================================================
8961 --- gcc/config/i386/i386.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
8962 +++ gcc/config/i386/i386.c      (.../branches/gcc-4_8-branch)   (revision 217117)
8963 @@ -20505,7 +20505,7 @@
8964           t1 = gen_reg_rtx (V32QImode);
8965           t2 = gen_reg_rtx (V32QImode);
8966           t3 = gen_reg_rtx (V32QImode);
8967 -         vt2 = GEN_INT (128);
8968 +         vt2 = GEN_INT (-128);
8969           for (i = 0; i < 32; i++)
8970             vec[i] = vt2;
8971           vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
8972 @@ -24640,13 +24640,17 @@
8973               {
8974                 edge e;
8975                 edge_iterator ei;
8976 -               /* Assume that region is SCC, i.e. all immediate predecessors
8977 -                  of non-head block are in the same region.  */
8978 +
8979 +               /* Regions are SCCs with the exception of selective
8980 +                  scheduling with pipelining of outer blocks enabled.
8981 +                  So also check that immediate predecessors of a non-head
8982 +                  block are in the same region.  */
8983                 FOR_EACH_EDGE (e, ei, bb->preds)
8984                   {
8985                     /* Avoid creating of loop-carried dependencies through
8986 -                      using topological odering in region.  */
8987 -                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
8988 +                      using topological ordering in the region.  */
8989 +                   if (rgn == CONTAINING_RGN (e->src->index)
8990 +                       && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
8991                       add_dependee_for_func_arg (first_arg, e->src); 
8992                   }
8993               }
8994 @@ -38807,8 +38811,8 @@
8995               op0 = gen_lowpart (V4DImode, d->op0);
8996               op1 = gen_lowpart (V4DImode, d->op1);
8997               rperm[0]
8998 -               = GEN_INT (((d->perm[0] & (nelt / 2)) ? 1 : 0)
8999 -                          || ((d->perm[nelt / 2] & (nelt / 2)) ? 2 : 0));
9000 +               = GEN_INT ((d->perm[0] / (nelt / 2))
9001 +                          | ((d->perm[nelt / 2] / (nelt / 2)) * 16));
9002               emit_insn (gen_avx2_permv2ti (target, op0, op1, rperm[0]));
9003               return true;
9004             }
9005 Index: gcc/config/sh/sh.c
9006 ===================================================================
9007 --- gcc/config/sh/sh.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
9008 +++ gcc/config/sh/sh.c  (.../branches/gcc-4_8-branch)   (revision 217117)
9009 @@ -808,6 +808,12 @@
9010         targetm.asm_out.aligned_op.di = NULL;
9011         targetm.asm_out.unaligned_op.di = NULL;
9012      }
9013 +
9014 +  /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
9015 +     Disable it for everything else.  */
9016 +  if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
9017 +    TARGET_USERMODE = false;
9018 +
9019    if (TARGET_SH1)
9020      {
9021        if (! strcmp (sh_div_str, "call-div1"))
9022 Index: gcc/config/sh/sync.md
9023 ===================================================================
9024 --- gcc/config/sh/sync.md       (.../tags/gcc_4_8_3_release)    (revision 217117)
9025 +++ gcc/config/sh/sync.md       (.../branches/gcc-4_8-branch)   (revision 217117)
9026 @@ -466,6 +466,7 @@
9027     (set (mem:SI (match_dup 1))
9028         (unspec:SI
9029           [(match_operand:SI 2 "arith_operand" "rI08")] UNSPEC_ATOMIC))
9030 +   (set (reg:SI T_REG) (const_int 1))
9031     (clobber (reg:SI R0_REG))]
9032    "TARGET_ATOMIC_HARD_LLCS
9033     || (TARGET_SH4A_ARCH && TARGET_ATOMIC_ANY && !TARGET_ATOMIC_STRICT)"
9034 @@ -484,6 +485,7 @@
9035     (set (mem:QIHI (match_dup 1))
9036         (unspec:QIHI
9037           [(match_operand:QIHI 2 "register_operand" "r")] UNSPEC_ATOMIC))
9038 +   (set (reg:SI T_REG) (const_int 1))
9039     (clobber (reg:SI R0_REG))
9040     (clobber (match_scratch:SI 3 "=&r"))
9041     (clobber (match_scratch:SI 4 "=1"))]
9042 @@ -617,6 +619,7 @@
9043           [(FETCHOP:SI (mem:SI (match_dup 1))
9044              (match_operand:SI 2 "<fetchop_predicate>" "<fetchop_constraint>"))]
9045           UNSPEC_ATOMIC))
9046 +   (set (reg:SI T_REG) (const_int 1))
9047     (clobber (reg:SI R0_REG))]
9048    "TARGET_ATOMIC_HARD_LLCS
9049     || (TARGET_SH4A_ARCH && TARGET_ATOMIC_ANY && !TARGET_ATOMIC_STRICT)"
9050 @@ -637,6 +640,7 @@
9051           [(FETCHOP:QIHI (mem:QIHI (match_dup 1))
9052              (match_operand:QIHI 2 "<fetchop_predicate>" "<fetchop_constraint>"))]
9053           UNSPEC_ATOMIC))
9054 +   (set (reg:SI T_REG) (const_int 1))
9055     (clobber (reg:SI R0_REG))
9056     (clobber (match_scratch:SI 3 "=&r"))
9057     (clobber (match_scratch:SI 4 "=1"))]
9058 @@ -784,6 +788,7 @@
9059           [(not:SI (and:SI (mem:SI (match_dup 1))
9060                    (match_operand:SI 2 "logical_operand" "rK08")))]
9061           UNSPEC_ATOMIC))
9062 +   (set (reg:SI T_REG) (const_int 1))
9063     (clobber (reg:SI R0_REG))]
9064    "TARGET_ATOMIC_HARD_LLCS
9065     || (TARGET_SH4A_ARCH && TARGET_ATOMIC_ANY && !TARGET_ATOMIC_STRICT)"
9066 @@ -805,6 +810,7 @@
9067           [(not:QIHI (and:QIHI (mem:QIHI (match_dup 1))
9068                      (match_operand:QIHI 2 "logical_operand" "rK08")))]
9069           UNSPEC_ATOMIC))
9070 +   (set (reg:SI T_REG) (const_int 1))
9071     (clobber (reg:SI R0_REG))
9072     (clobber (match_scratch:SI 3 "=&r"))
9073     (clobber (match_scratch:SI 4 "=1"))]
9074 @@ -903,7 +909,7 @@
9075          "      and     %0,%3"                  "\n"
9076          "      not     %3,%3"                  "\n"
9077          "      mov.<bwl>       %3,@%1"         "\n"
9078 -        "      stc     %4,sr";
9079 +        "      ldc     %4,sr";
9080  }
9081    [(set_attr "length" "20")])
9082  
9083 @@ -960,7 +966,8 @@
9084     (set (mem:SI (match_dup 1))
9085         (unspec:SI
9086           [(FETCHOP:SI (mem:SI (match_dup 1)) (match_dup 2))]
9087 -         UNSPEC_ATOMIC))]
9088 +         UNSPEC_ATOMIC))
9089 +   (set (reg:SI T_REG) (const_int 1))]
9090    "TARGET_ATOMIC_HARD_LLCS
9091     || (TARGET_SH4A_ARCH && TARGET_ATOMIC_ANY && !TARGET_ATOMIC_STRICT)"
9092  {
9093 @@ -980,6 +987,7 @@
9094         (unspec:QIHI
9095           [(FETCHOP:QIHI (mem:QIHI (match_dup 1)) (match_dup 2))]
9096           UNSPEC_ATOMIC))
9097 +   (set (reg:SI T_REG) (const_int 1))
9098     (clobber (reg:SI R0_REG))
9099     (clobber (match_scratch:SI 3 "=&r"))
9100     (clobber (match_scratch:SI 4 "=1"))]
9101 @@ -1124,7 +1132,8 @@
9102     (set (mem:SI (match_dup 1))
9103         (unspec:SI
9104           [(not:SI (and:SI (mem:SI (match_dup 1)) (match_dup 2)))]
9105 -         UNSPEC_ATOMIC))]
9106 +         UNSPEC_ATOMIC))
9107 +   (set (reg:SI T_REG) (const_int 1))]
9108    "TARGET_ATOMIC_HARD_LLCS
9109     || (TARGET_SH4A_ARCH && TARGET_ATOMIC_ANY && !TARGET_ATOMIC_STRICT)"
9110  {
9111 @@ -1145,6 +1154,7 @@
9112         (unspec:QIHI
9113           [(not:QIHI (and:QIHI (mem:QIHI (match_dup 1)) (match_dup 2)))]
9114           UNSPEC_ATOMIC))
9115 +   (set (reg:SI T_REG) (const_int 1))
9116     (clobber (reg:SI R0_REG))
9117     (clobber (match_scratch:SI 3 "=&r"))
9118     (clobber (match_scratch:SI 4 "=1"))]
9119 @@ -1353,7 +1363,7 @@
9120          "      ldc     r0,sr"          "\n"
9121          "      mov.b   @%0,r0"         "\n"
9122          "      mov.b   %1,@%0"         "\n"
9123 -        "      stc     %2,sr"          "\n"
9124 +        "      ldc     %2,sr"          "\n"
9125          "      tst     r0,r0";
9126  }
9127    [(set_attr "length" "16")])
9128 Index: gcc/config/sh/sh.opt
9129 ===================================================================
9130 --- gcc/config/sh/sh.opt        (.../tags/gcc_4_8_3_release)    (revision 217117)
9131 +++ gcc/config/sh/sh.opt        (.../branches/gcc-4_8-branch)   (revision 217117)
9132 @@ -343,7 +343,7 @@
9133  Cost to assume for a multiply insn
9134  
9135  musermode
9136 -Target Report RejectNegative Var(TARGET_USERMODE)
9137 +Target Var(TARGET_USERMODE)
9138  Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
9139  
9140  ;; We might want to enable this by default for TARGET_HARD_SH4, because
9141 Index: gcc/config/microblaze/predicates.md
9142 ===================================================================
9143 --- gcc/config/microblaze/predicates.md (.../tags/gcc_4_8_3_release)    (revision 217117)
9144 +++ gcc/config/microblaze/predicates.md (.../branches/gcc-4_8-branch)   (revision 217117)
9145 @@ -85,10 +85,6 @@
9146    (ior (match_operand 0 "const_0_operand")
9147         (match_operand 0 "register_operand")))
9148  
9149 -(define_predicate "reg_or_mem_operand"
9150 -  (ior (match_operand 0 "memory_operand")
9151 -       (match_operand 0 "register_operand")))
9152 -
9153  ;;  Return if the operand is either the PC or a label_ref.  
9154  (define_special_predicate "pc_or_label_operand"
9155    (ior (match_code "pc,label_ref")
9156 Index: gcc/config/microblaze/microblaze.md
9157 ===================================================================
9158 --- gcc/config/microblaze/microblaze.md (.../tags/gcc_4_8_3_release)    (revision 217117)
9159 +++ gcc/config/microblaze/microblaze.md (.../branches/gcc-4_8-branch)   (revision 217117)
9160 @@ -1119,18 +1119,6 @@
9161    }
9162  )
9163  
9164 -;;Load and store reverse
9165 -(define_insn "movsi4_rev"
9166 -  [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
9167 -        (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
9168 -  "TARGET_REORDER"
9169 -  "@
9170 -   lwr\t%0,%y1,r0
9171 -   swr\t%1,%y0,r0"
9172 -  [(set_attr "type"     "load,store")
9173 -  (set_attr "mode"      "SI")
9174 -  (set_attr "length"    "4,4")])
9175 -
9176  ;; 32-bit floating point moves
9177  
9178  (define_expand "movsf"
9179 Index: gcc/config/avr/avr-fixed.md
9180 ===================================================================
9181 --- gcc/config/avr/avr-fixed.md (.../tags/gcc_4_8_3_release)    (revision 217117)
9182 +++ gcc/config/avr/avr-fixed.md (.../branches/gcc-4_8-branch)   (revision 217117)
9183 @@ -430,8 +430,8 @@
9184        }
9185  
9186      // Input and output of the libgcc function
9187 -    const unsigned int regno_in[]  = { -1, 22, 22, -1, 18 };
9188 -    const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
9189 +    const unsigned int regno_in[]  = { -1U, 22, 22, -1U, 18 };
9190 +    const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
9191  
9192      operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
9193      operands[4] = gen_rtx_REG (<MODE>mode,  regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
9194 Index: gcc/config/avr/avr.md
9195 ===================================================================
9196 --- gcc/config/avr/avr.md       (.../tags/gcc_4_8_3_release)    (revision 217117)
9197 +++ gcc/config/avr/avr.md       (.../branches/gcc-4_8-branch)   (revision 217117)
9198 @@ -367,6 +367,15 @@
9199    ""
9200    {
9201      int i;
9202 +
9203 +    // Avoid (subreg (mem)) for non-generic address spaces below.  Because
9204 +    // of the poor addressing capabilities of these spaces it's better to
9205 +    // load them in one chunk.  And it avoids PR61443.
9206 +
9207 +    if (MEM_P (operands[0])
9208 +        && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
9209 +      operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
9210 +
9211      for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
9212        {
9213          rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
9214 Index: gcc/config/avr/avr.h
9215 ===================================================================
9216 --- gcc/config/avr/avr.h        (.../tags/gcc_4_8_3_release)    (revision 217117)
9217 +++ gcc/config/avr/avr.h        (.../branches/gcc-4_8-branch)   (revision 217117)
9218 @@ -250,18 +250,18 @@
9219  #define REG_CLASS_CONTENTS {                                           \
9220    {0x00000000,0x00000000},     /* NO_REGS */                           \
9221    {0x00000001,0x00000000},     /* R0_REG */                            \
9222 -  {3 << REG_X,0x00000000},      /* POINTER_X_REGS, r26 - r27 */                \
9223 -  {3 << REG_Y,0x00000000},      /* POINTER_Y_REGS, r28 - r29 */                \
9224 -  {3 << REG_Z,0x00000000},      /* POINTER_Z_REGS, r30 - r31 */                \
9225 +  {3u << REG_X,0x00000000},     /* POINTER_X_REGS, r26 - r27 */                \
9226 +  {3u << REG_Y,0x00000000},     /* POINTER_Y_REGS, r28 - r29 */                \
9227 +  {3u << REG_Z,0x00000000},     /* POINTER_Z_REGS, r30 - r31 */                \
9228    {0x00000000,0x00000003},     /* STACK_REG, STACK */                  \
9229 -  {(3 << REG_Y) | (3 << REG_Z),                                                \
9230 +  {(3u << REG_Y) | (3u << REG_Z),                                      \
9231       0x00000000},              /* BASE_POINTER_REGS, r28 - r31 */      \
9232 -  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z),                         \
9233 +  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z),                      \
9234       0x00000000},              /* POINTER_REGS, r26 - r31 */           \
9235 -  {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W),          \
9236 +  {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W),      \
9237       0x00000000},              /* ADDW_REGS, r24 - r31 */              \
9238    {0x00ff0000,0x00000000},     /* SIMPLE_LD_REGS r16 - r23 */          \
9239 -  {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16),   \
9240 +  {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
9241       0x00000000},      /* LD_REGS, r16 - r31 */                        \
9242    {0x0000ffff,0x00000000},     /* NO_LD_REGS  r0 - r15 */              \
9243    {0xffffffff,0x00000000},     /* GENERAL_REGS, r0 - r31 */            \
9244 Index: gcc/config/aarch64/arm_neon.h
9245 ===================================================================
9246 --- gcc/config/aarch64/arm_neon.h       (.../tags/gcc_4_8_3_release)    (revision 217117)
9247 +++ gcc/config/aarch64/arm_neon.h       (.../branches/gcc-4_8-branch)   (revision 217117)
9248 @@ -13815,7 +13815,7 @@
9249    int16x4_t result;
9250    __asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
9251             : "=w"(result)
9252 -           : "w"(a), "w"(b)
9253 +           : "w"(a), "x"(b)
9254             : /* No clobbers */);
9255    return result;
9256  }
9257 @@ -13837,7 +13837,7 @@
9258    int16x8_t result;
9259    __asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
9260             : "=w"(result)
9261 -           : "w"(a), "w"(b)
9262 +           : "w"(a), "x"(b)
9263             : /* No clobbers */);
9264    return result;
9265  }
9266 Index: gcc/config/aarch64/aarch64.md
9267 ===================================================================
9268 --- gcc/config/aarch64/aarch64.md       (.../tags/gcc_4_8_3_release)    (revision 217117)
9269 +++ gcc/config/aarch64/aarch64.md       (.../branches/gcc-4_8-branch)   (revision 217117)
9270 @@ -3292,6 +3292,7 @@
9271          (unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
9272                    UNSPEC_TLSDESC))
9273     (clobber (reg:DI LR_REGNUM))
9274 +   (clobber (reg:CC CC_REGNUM))
9275     (clobber (match_scratch:DI 1 "=r"))]
9276    "TARGET_TLS_DESC"
9277    "adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
9278 Index: gcc/config/aarch64/aarch64.opt
9279 ===================================================================
9280 --- gcc/config/aarch64/aarch64.opt      (.../tags/gcc_4_8_3_release)    (revision 217117)
9281 +++ gcc/config/aarch64/aarch64.opt      (.../branches/gcc-4_8-branch)   (revision 217117)
9282 @@ -67,6 +67,10 @@
9283  Target Report RejectNegative Mask(GENERAL_REGS_ONLY)
9284  Generate code which uses only the general registers
9285  
9286 +mfix-cortex-a53-835769
9287 +Target Report Var(aarch64_fix_a53_err835769) Init(2)
9288 +Workaround for ARM Cortex-A53 Erratum number 835769
9289 +
9290  mlittle-endian
9291  Target Report RejectNegative InverseMask(BIG_END)
9292  Assume target CPU is configured as little endian
9293 Index: gcc/config/aarch64/aarch64-protos.h
9294 ===================================================================
9295 --- gcc/config/aarch64/aarch64-protos.h (.../tags/gcc_4_8_3_release)    (revision 217117)
9296 +++ gcc/config/aarch64/aarch64-protos.h (.../branches/gcc-4_8-branch)   (revision 217117)
9297 @@ -247,6 +247,8 @@
9298  
9299  extern void aarch64_split_combinev16qi (rtx operands[3]);
9300  extern void aarch64_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
9301 +extern bool aarch64_madd_needs_nop (rtx);
9302 +extern void aarch64_final_prescan_insn (rtx);
9303  extern bool
9304  aarch64_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
9305  
9306 Index: gcc/config/aarch64/aarch64.c
9307 ===================================================================
9308 --- gcc/config/aarch64/aarch64.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
9309 +++ gcc/config/aarch64/aarch64.c        (.../branches/gcc-4_8-branch)   (revision 217117)
9310 @@ -1201,6 +1201,7 @@
9311    CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
9312    int ncrn, nvrn, nregs;
9313    bool allocate_ncrn, allocate_nvrn;
9314 +  HOST_WIDE_INT size;
9315  
9316    /* We need to do this once per argument.  */
9317    if (pcum->aapcs_arg_processed)
9318 @@ -1208,6 +1209,11 @@
9319  
9320    pcum->aapcs_arg_processed = true;
9321  
9322 +  /* Size in bytes, rounded to the nearest multiple of 8 bytes.  */
9323 +  size
9324 +    = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
9325 +                       UNITS_PER_WORD);
9326 +
9327    allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
9328    allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
9329                                                  mode,
9330 @@ -1258,10 +1264,8 @@
9331      }
9332  
9333    ncrn = pcum->aapcs_ncrn;
9334 -  nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
9335 -          + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
9336 +  nregs = size / UNITS_PER_WORD;
9337  
9338 -
9339    /* C6 - C9.  though the sign and zero extension semantics are
9340       handled elsewhere.  This is the case where the argument fits
9341       entirely general registers.  */
9342 @@ -1309,13 +1313,12 @@
9343    pcum->aapcs_nextncrn = NUM_ARG_REGS;
9344  
9345    /* The argument is passed on stack; record the needed number of words for
9346 -     this argument (we can re-use NREGS) and align the total size if
9347 -     necessary.  */
9348 +     this argument and align the total size if necessary.  */
9349  on_stack:
9350 -  pcum->aapcs_stack_words = nregs;
9351 +  pcum->aapcs_stack_words = size / UNITS_PER_WORD;
9352    if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
9353      pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
9354 -                                              16 / UNITS_PER_WORD) + 1;
9355 +                                              16 / UNITS_PER_WORD);
9356    return;
9357  }
9358  
9359 @@ -4845,6 +4848,15 @@
9360    aarch64_tune = selected_tune->core;
9361    aarch64_tune_params = selected_tune->tune;
9362  
9363 +  if (aarch64_fix_a53_err835769 == 2)
9364 +    {
9365 +#ifdef TARGET_FIX_ERR_A53_835769_DEFAULT
9366 +      aarch64_fix_a53_err835769 = 1;
9367 +#else
9368 +      aarch64_fix_a53_err835769 = 0;
9369 +#endif
9370 +    }
9371 +
9372    aarch64_override_options_after_change ();
9373  }
9374  
9375 @@ -6037,6 +6049,135 @@
9376    return NULL;
9377  }
9378  
9379 +
9380 +/* Return true iff X is a MEM rtx.  */
9381 +
9382 +static int
9383 +is_mem_p (rtx *x, void *data ATTRIBUTE_UNUSED)
9384 +{
9385 +  return MEM_P (*x);
9386 +}
9387 +
9388 +
9389 +/*  Return true if mem_insn contains a MEM RTX somewhere in it.  */
9390 +
9391 +static bool
9392 +has_memory_op (rtx mem_insn)
9393 +{
9394 +   rtx pattern = PATTERN (mem_insn);
9395 +   return for_each_rtx (&pattern, is_mem_p, NULL);
9396 +}
9397 +
9398 +
9399 +/* Find the first rtx before insn that will generate an assembly
9400 +   instruction.  */
9401 +
9402 +static rtx
9403 +aarch64_prev_real_insn (rtx insn)
9404 +{
9405 +  if (!insn)
9406 +    return NULL;
9407 +
9408 +  do
9409 +    {
9410 +      insn = prev_real_insn (insn);
9411 +    }
9412 +  while (insn && recog_memoized (insn) < 0);
9413 +
9414 +  return insn;
9415 +}
9416 +
9417 +/*  Return true iff t1 is the v8type of a multiply-accumulate instruction.  */
9418 +
9419 +static bool
9420 +is_madd_op (enum attr_v8type t1)
9421 +{
9422 +  return t1 == V8TYPE_MADD
9423 +         || t1 == V8TYPE_MADDL;
9424 +}
9425 +
9426 +
9427 +/* Check if there is a register dependency between a load and the insn
9428 +   for which we hold recog_data.  */
9429 +
9430 +static bool
9431 +dep_between_memop_and_curr (rtx memop)
9432 +{
9433 +  rtx load_reg;
9434 +  int opno;
9435 +
9436 +  gcc_assert (GET_CODE (memop) == SET);
9437 +
9438 +  if (!REG_P (SET_DEST (memop)))
9439 +    return false;
9440 +
9441 +  load_reg = SET_DEST (memop);
9442 +  for (opno = 1; opno < recog_data.n_operands; opno++)
9443 +    {
9444 +      rtx operand = recog_data.operand[opno];
9445 +      if (REG_P (operand)
9446 +          && reg_overlap_mentioned_p (load_reg, operand))
9447 +        return true;
9448 +
9449 +    }
9450 +  return false;
9451 +}
9452 +
9453 +
9454 +
9455 +/* When working around the Cortex-A53 erratum 835769,
9456 +   given rtx_insn INSN, return true if it is a 64-bit multiply-accumulate
9457 +   instruction and has a preceding memory instruction such that a NOP
9458 +   should be inserted between them.  */
9459 +
9460 +bool
9461 +aarch64_madd_needs_nop (rtx insn)
9462 +{
9463 +  enum attr_v8type attr_type;
9464 +  rtx prev;
9465 +  rtx body;
9466 +
9467 +  if (!aarch64_fix_a53_err835769)
9468 +    return false;
9469 +
9470 +  if (recog_memoized (insn) < 0)
9471 +    return false;
9472 +
9473 +  attr_type = get_attr_v8type (insn);
9474 +  if (!is_madd_op (attr_type))
9475 +    return false;
9476 +
9477 +  prev = aarch64_prev_real_insn (insn);
9478 +  /* aarch64_prev_real_insn can call recog_memoized on insns other than INSN.
9479 +     Restore recog state to INSN to avoid state corruption.  */
9480 +  extract_constrain_insn_cached (insn);
9481 +
9482 +  if (!prev || !has_memory_op (prev))
9483 +    return false;
9484 +
9485 +  body = single_set (prev);
9486 +
9487 +  /* If the previous insn is a memory op and there is no dependency between
9488 +     it and the madd, emit a nop between them.  If we know it's a memop but
9489 +     body is NULL, return true to be safe.  */
9490 +  if (GET_MODE (recog_data.operand[0]) == DImode
9491 +      && (!body || !dep_between_memop_and_curr (body)))
9492 +    return true;
9493 +
9494 +  return false;
9495 +
9496 +}
9497 +
9498 +/* Implement FINAL_PRESCAN_INSN.  */
9499 +
9500 +void
9501 +aarch64_final_prescan_insn (rtx insn)
9502 +{
9503 +  if (aarch64_madd_needs_nop (insn))
9504 +    fprintf (asm_out_file, "\tnop // between mem op and mult-accumulate\n");
9505 +}
9506 +
9507 +
9508  /* Return the equivalent letter for size.  */
9509  static unsigned char
9510  sizetochar (int size)
9511 Index: gcc/config/aarch64/aarch64-linux.h
9512 ===================================================================
9513 --- gcc/config/aarch64/aarch64-linux.h  (.../tags/gcc_4_8_3_release)    (revision 217117)
9514 +++ gcc/config/aarch64/aarch64-linux.h  (.../branches/gcc-4_8-branch)   (revision 217117)
9515 @@ -43,4 +43,6 @@
9516      }                                          \
9517    while (0)
9518  
9519 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
9520 +
9521  #endif  /* GCC_AARCH64_LINUX_H */
9522 Index: gcc/config/aarch64/aarch64.h
9523 ===================================================================
9524 --- gcc/config/aarch64/aarch64.h        (.../tags/gcc_4_8_3_release)    (revision 217117)
9525 +++ gcc/config/aarch64/aarch64.h        (.../branches/gcc-4_8-branch)   (revision 217117)
9526 @@ -465,6 +465,18 @@
9527    (TARGET_CPU_generic | (AARCH64_CPU_DEFAULT_FLAGS << 6))
9528  #endif
9529  
9530 +/* If inserting NOP before a mult-accumulate insn remember to adjust the
9531 +   length so that conditional branching code is updated appropriately.  */
9532 +#define ADJUST_INSN_LENGTH(insn, length)       \
9533 +  do                                           \
9534 +    {                                          \
9535 +      if (aarch64_madd_needs_nop (insn))       \
9536 +        length += 4;                           \
9537 +    } while (0)
9538 +
9539 +#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)     \
9540 +    aarch64_final_prescan_insn (INSN);                 \
9541 +
9542  /* The processor for which instructions should be scheduled.  */
9543  extern enum aarch64_processor aarch64_tune;
9544  
9545 Index: gcc/config/rs6000/constraints.md
9546 ===================================================================
9547 --- gcc/config/rs6000/constraints.md    (.../tags/gcc_4_8_3_release)    (revision 217117)
9548 +++ gcc/config/rs6000/constraints.md    (.../branches/gcc-4_8-branch)   (revision 217117)
9549 @@ -65,6 +65,20 @@
9550  (define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
9551    "If -mmfpgpr was used, a floating point register or NO_REGS.")
9552  
9553 +(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
9554 +  "Floating point register if direct moves are available, or NO_REGS.")
9555 +
9556 +;; At present, DImode is not allowed in the Altivec registers.  If in the
9557 +;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
9558 +(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
9559 +  "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
9560 +
9561 +(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
9562 +  "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
9563 +
9564 +(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
9565 +  "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
9566 +
9567  (define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
9568    "Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
9569  
9570 @@ -98,7 +112,7 @@
9571    "Floating point register if the STFIWX instruction is enabled or NO_REGS.")
9572  
9573  (define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
9574 -  "VSX vector register to hold scalar float values or NO_REGS.")
9575 +  "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
9576  
9577  (define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
9578    "Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
9579 Index: gcc/config/rs6000/predicates.md
9580 ===================================================================
9581 --- gcc/config/rs6000/predicates.md     (.../tags/gcc_4_8_3_release)    (revision 217117)
9582 +++ gcc/config/rs6000/predicates.md     (.../branches/gcc-4_8-branch)   (revision 217117)
9583 @@ -1795,7 +1795,7 @@
9584  (define_predicate "fusion_gpr_mem_load"
9585    (match_code "mem,sign_extend,zero_extend")
9586  {
9587 -  rtx addr;
9588 +  rtx addr, base, offset;
9589  
9590    /* Handle sign/zero extend.  */
9591    if (GET_CODE (op) == ZERO_EXTEND
9592 @@ -1825,24 +1825,79 @@
9593      }
9594  
9595    addr = XEXP (op, 0);
9596 +  if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
9597 +    return 0;
9598 +
9599 +  base = XEXP (addr, 0);
9600 +  if (!base_reg_operand (base, GET_MODE (base)))
9601 +    return 0;
9602 +
9603 +  offset = XEXP (addr, 1);
9604 +
9605    if (GET_CODE (addr) == PLUS)
9606 +    return satisfies_constraint_I (offset);
9607 +
9608 +  else if (GET_CODE (addr) == LO_SUM)
9609      {
9610 -      rtx base = XEXP (addr, 0);
9611 -      rtx offset = XEXP (addr, 1);
9612 +      if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
9613 +       return small_toc_ref (offset, GET_MODE (offset));
9614  
9615 -      return (base_reg_operand (base, GET_MODE (base))
9616 -             && satisfies_constraint_I (offset));
9617 +      else if (TARGET_ELF && !TARGET_POWERPC64)
9618 +       return CONSTANT_P (offset);
9619      }
9620  
9621 -  else if (GET_CODE (addr) == LO_SUM)
9622 +  return 0;
9623 +})
9624 +
9625 +;; Match a GPR load (lbz, lhz, lwz, ld) that uses a combined address in the
9626 +;; memory field with both the addis and the memory offset.  Sign extension
9627 +;; is not handled here, since lha and lwa are not fused.
9628 +(define_predicate "fusion_gpr_mem_combo"
9629 +  (match_code "mem,zero_extend")
9630 +{
9631 +  rtx addr, base, offset;
9632 +
9633 +  /* Handle zero extend.  */
9634 +  if (GET_CODE (op) == ZERO_EXTEND)
9635      {
9636 -      rtx base = XEXP (addr, 0);
9637 -      rtx offset = XEXP (addr, 1);
9638 +      op = XEXP (op, 0);
9639 +      mode = GET_MODE (op);
9640 +    }
9641  
9642 -      if (!base_reg_operand (base, GET_MODE (base)))
9643 +  if (!MEM_P (op))
9644 +    return 0;
9645 +
9646 +  switch (mode)
9647 +    {
9648 +    case QImode:
9649 +    case HImode:
9650 +    case SImode:
9651 +      break;
9652 +
9653 +    case DImode:
9654 +      if (!TARGET_POWERPC64)
9655         return 0;
9656 +      break;
9657  
9658 -      else if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
9659 +    default:
9660 +      return 0;
9661 +    }
9662 +
9663 +  addr = XEXP (op, 0);
9664 +  if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
9665 +    return 0;
9666 +
9667 +  base = XEXP (addr, 0);
9668 +  if (!fusion_gpr_addis (base, GET_MODE (base)))
9669 +    return 0;
9670 +
9671 +  offset = XEXP (addr, 1);
9672 +  if (GET_CODE (addr) == PLUS)
9673 +    return satisfies_constraint_I (offset);
9674 +
9675 +  else if (GET_CODE (addr) == LO_SUM)
9676 +    {
9677 +      if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
9678         return small_toc_ref (offset, GET_MODE (offset));
9679  
9680        else if (TARGET_ELF && !TARGET_POWERPC64)
9681 Index: gcc/config/rs6000/htm.md
9682 ===================================================================
9683 --- gcc/config/rs6000/htm.md    (.../tags/gcc_4_8_3_release)    (revision 217117)
9684 +++ gcc/config/rs6000/htm.md    (.../branches/gcc-4_8-branch)   (revision 217117)
9685 @@ -179,7 +179,7 @@
9686                              (const_int 0)]
9687                             UNSPECV_HTM_TABORTWCI))
9688     (set (subreg:CC (match_dup 2) 0) (match_dup 1))
9689 -   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
9690 +   (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
9691     (parallel [(set (match_operand:SI 0 "int_reg_operand" "")
9692                    (and:SI (match_dup 3) (const_int 15)))
9693                (clobber (scratch:CC))])]
9694 Index: gcc/config/rs6000/freebsd64.h
9695 ===================================================================
9696 --- gcc/config/rs6000/freebsd64.h       (.../tags/gcc_4_8_3_release)    (revision 217117)
9697 +++ gcc/config/rs6000/freebsd64.h       (.../branches/gcc-4_8-branch)   (revision 217117)
9698 @@ -367,7 +367,7 @@
9699  /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
9700  #undef  ADJUST_FIELD_ALIGN
9701  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
9702 -  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
9703 +  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
9704     ? 128                                                                \
9705     : (TARGET_64BIT                                                      \
9706        && TARGET_ALIGN_NATURAL == 0                                      \
9707 Index: gcc/config/rs6000/rs6000-protos.h
9708 ===================================================================
9709 --- gcc/config/rs6000/rs6000-protos.h   (.../tags/gcc_4_8_3_release)    (revision 217117)
9710 +++ gcc/config/rs6000/rs6000-protos.h   (.../branches/gcc-4_8-branch)   (revision 217117)
9711 @@ -79,9 +79,9 @@
9712  extern bool gpr_or_gpr_p (rtx, rtx);
9713  extern bool direct_move_p (rtx, rtx);
9714  extern bool quad_load_store_p (rtx, rtx);
9715 -extern bool fusion_gpr_load_p (rtx *, bool);
9716 +extern bool fusion_gpr_load_p (rtx, rtx, rtx, rtx);
9717  extern void expand_fusion_gpr_load (rtx *);
9718 -extern const char *emit_fusion_gpr_load (rtx *);
9719 +extern const char *emit_fusion_gpr_load (rtx, rtx);
9720  extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
9721                                                             enum reg_class);
9722  extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
9723 @@ -153,6 +153,7 @@
9724  
9725  #ifdef TREE_CODE
9726  extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
9727 +extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
9728  extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
9729                                                      unsigned int);
9730  extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
9731 @@ -161,7 +162,7 @@
9732  extern rtx rs6000_libcall_value (enum machine_mode);
9733  extern rtx rs6000_va_arg (tree, tree);
9734  extern int function_ok_for_sibcall (tree);
9735 -extern int rs6000_reg_parm_stack_space (tree);
9736 +extern int rs6000_reg_parm_stack_space (tree, bool);
9737  extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
9738  extern bool rs6000_elf_in_small_data_p (const_tree);
9739  #ifdef ARGS_SIZE_RTX
9740 Index: gcc/config/rs6000/rs6000-builtin.def
9741 ===================================================================
9742 --- gcc/config/rs6000/rs6000-builtin.def        (.../tags/gcc_4_8_3_release)    (revision 217117)
9743 +++ gcc/config/rs6000/rs6000-builtin.def        (.../branches/gcc-4_8-branch)   (revision 217117)
9744 @@ -622,20 +622,13 @@
9745                      | RS6000_BTC_TERNARY),                             \
9746                     CODE_FOR_ ## ICODE)                 /* ICODE */
9747  
9748 -/* Miscellaneous builtins.  */
9749 -#define BU_MISC_1(ENUM, NAME, ATTR, ICODE)                             \
9750 +/* 128-bit long double floating point builtins.  */
9751 +#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE)                          \
9752    RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
9753                     "__builtin_" NAME,                  /* NAME */      \
9754 -                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
9755 +                   (RS6000_BTM_HARD_FLOAT              /* MASK */      \
9756 +                    | RS6000_BTM_LDBL128),                             \
9757                     (RS6000_BTC_ ## ATTR                /* ATTR */      \
9758 -                    | RS6000_BTC_UNARY),                               \
9759 -                   CODE_FOR_ ## ICODE)                 /* ICODE */
9760 -
9761 -#define BU_MISC_2(ENUM, NAME, ATTR, ICODE)                             \
9762 -  RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
9763 -                   "__builtin_" NAME,                  /* NAME */      \
9764 -                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
9765 -                   (RS6000_BTC_ ## ATTR                /* ATTR */      \
9766                      | RS6000_BTC_BINARY),                              \
9767                     CODE_FOR_ ## ICODE)                 /* ICODE */
9768  
9769 @@ -1593,10 +1586,8 @@
9770  BU_DFP_MISC_2 (PACK_TD,                "pack_dec128",          CONST,  packtd)
9771  BU_DFP_MISC_2 (UNPACK_TD,      "unpack_dec128",        CONST,  unpacktd)
9772  
9773 -BU_MISC_2 (PACK_TF,            "pack_longdouble",      CONST,  packtf)
9774 -BU_MISC_2 (UNPACK_TF,          "unpack_longdouble",    CONST,  unpacktf)
9775 -BU_MISC_1 (UNPACK_TF_0,                "longdouble_dw0",       CONST,  unpacktf_0)
9776 -BU_MISC_1 (UNPACK_TF_1,                "longdouble_dw1",       CONST,  unpacktf_1)
9777 +BU_LDBL128_2 (PACK_TF,         "pack_longdouble",      CONST,  packtf)
9778 +BU_LDBL128_2 (UNPACK_TF,       "unpack_longdouble",    CONST,  unpacktf)
9779  
9780  BU_P7_MISC_2 (PACK_V1TI,       "pack_vector_int128",   CONST,  packv1ti)
9781  BU_P7_MISC_2 (UNPACK_V1TI,     "unpack_vector_int128", CONST,  unpackv1ti)
9782 Index: gcc/config/rs6000/rs6000-c.c
9783 ===================================================================
9784 --- gcc/config/rs6000/rs6000-c.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
9785 +++ gcc/config/rs6000/rs6000-c.c        (.../branches/gcc-4_8-branch)   (revision 217117)
9786 @@ -4126,7 +4126,8 @@
9787       argument) is reversed.  Patch the arguments here before building
9788       the resolved CALL_EXPR.  */
9789    if (desc->code == ALTIVEC_BUILTIN_VEC_VCMPGE_P
9790 -      && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P)
9791 +      && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P
9792 +      && desc->overloaded_code != VSX_BUILTIN_XVCMPGEDP_P)
9793      {
9794        tree t;
9795        t = args[2], args[2] = args[1], args[1] = t;
9796 @@ -4184,6 +4185,14 @@
9797    if (TARGET_DEBUG_BUILTIN)
9798      fprintf (stderr, "altivec_resolve_overloaded_builtin, code = %4d, %s\n",
9799              (int)fcode, IDENTIFIER_POINTER (DECL_NAME (fndecl)));
9800
9801 +  /* vec_lvsl and vec_lvsr are deprecated for use with LE element order.  */
9802 +  if (fcode == ALTIVEC_BUILTIN_VEC_LVSL && !VECTOR_ELT_ORDER_BIG)
9803 +    warning (OPT_Wdeprecated, "vec_lvsl is deprecated for little endian; use \
9804 +assignment for unaligned loads and stores");
9805 +  else if (fcode == ALTIVEC_BUILTIN_VEC_LVSR && !VECTOR_ELT_ORDER_BIG)
9806 +    warning (OPT_Wdeprecated, "vec_lvsr is deprecated for little endian; use \
9807 +assignment for unaligned loads and stores");
9808  
9809    /* For now treat vec_splats and vec_promote as the same.  */
9810    if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS
9811 Index: gcc/config/rs6000/linux64.h
9812 ===================================================================
9813 --- gcc/config/rs6000/linux64.h (.../tags/gcc_4_8_3_release)    (revision 217117)
9814 +++ gcc/config/rs6000/linux64.h (.../branches/gcc-4_8-branch)   (revision 217117)
9815 @@ -246,7 +246,7 @@
9816  /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
9817  #undef  ADJUST_FIELD_ALIGN
9818  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
9819 -  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)    \
9820 +  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
9821     ? 128                                                               \
9822     : (TARGET_64BIT                                                     \
9823        && TARGET_ALIGN_NATURAL == 0                                     \
9824 Index: gcc/config/rs6000/rs6000.c
9825 ===================================================================
9826 --- gcc/config/rs6000/rs6000.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
9827 +++ gcc/config/rs6000/rs6000.c  (.../branches/gcc-4_8-branch)   (revision 217117)
9828 @@ -369,6 +369,7 @@
9829    enum insn_code reload_gpr_vsx;       /* INSN to move from GPR to VSX.  */
9830    enum insn_code reload_vsx_gpr;       /* INSN to move from VSX to GPR.  */
9831    addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks.  */
9832 +  bool scalar_in_vmx_p;                        /* Scalar value can go in VMX.  */
9833  };
9834  
9835  static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
9836 @@ -1704,8 +1705,7 @@
9837       asked for it.  */
9838    if (TARGET_VSX && VSX_REGNO_P (regno)
9839        && (VECTOR_MEM_VSX_P (mode)
9840 -         || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
9841 -         || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
9842 +         || reg_addr[mode].scalar_in_vmx_p
9843           || (TARGET_VSX_TIMODE && mode == TImode)
9844           || (TARGET_VADDUQM && mode == V1TImode)))
9845      {
9846 @@ -1714,12 +1714,9 @@
9847  
9848        if (ALTIVEC_REGNO_P (regno))
9849         {
9850 -         if (mode == SFmode && !TARGET_UPPER_REGS_SF)
9851 +         if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
9852             return 0;
9853  
9854 -         if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
9855 -           return 0;
9856 -
9857           return ALTIVEC_REGNO_P (last_regno);
9858         }
9859      }
9860 @@ -1897,14 +1894,16 @@
9861    if (rs6000_vector_unit[m] != VECTOR_NONE
9862        || rs6000_vector_mem[m] != VECTOR_NONE
9863        || (reg_addr[m].reload_store != CODE_FOR_nothing)
9864 -      || (reg_addr[m].reload_load != CODE_FOR_nothing))
9865 +      || (reg_addr[m].reload_load != CODE_FOR_nothing)
9866 +      || reg_addr[m].scalar_in_vmx_p)
9867      {
9868        fprintf (stderr,
9869 -              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
9870 +              "  Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
9871                rs6000_debug_vector_unit (rs6000_vector_unit[m]),
9872                rs6000_debug_vector_unit (rs6000_vector_mem[m]),
9873                (reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
9874 -              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
9875 +              (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
9876 +              (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
9877      }
9878  
9879    fputs ("\n", stderr);
9880 @@ -2021,6 +2020,10 @@
9881            "wd reg_class = %s\n"
9882            "wf reg_class = %s\n"
9883            "wg reg_class = %s\n"
9884 +          "wh reg_class = %s\n"
9885 +          "wi reg_class = %s\n"
9886 +          "wj reg_class = %s\n"
9887 +          "wk reg_class = %s\n"
9888            "wl reg_class = %s\n"
9889            "wm reg_class = %s\n"
9890            "wr reg_class = %s\n"
9891 @@ -2040,6 +2043,10 @@
9892            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
9893            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
9894            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
9895 +          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
9896 +          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
9897 +          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
9898 +          reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
9899            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
9900            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
9901            reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
9902 @@ -2324,6 +2331,8 @@
9903  
9904    for (m = 0; m < NUM_MACHINE_MODES; ++m)
9905      {
9906 +      enum machine_mode m2 = (enum machine_mode)m;
9907 +
9908        /* SDmode is special in that we want to access it only via REG+REG
9909          addressing on power7 and above, since we want to use the LFIWZX and
9910          STFIWZX instructions to load it.  */
9911 @@ -2358,13 +2367,12 @@
9912  
9913               if (TARGET_UPDATE
9914                   && (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
9915 -                 && GET_MODE_SIZE (m) <= 8
9916 -                 && !VECTOR_MODE_P (m)
9917 -                 && !COMPLEX_MODE_P (m)
9918 +                 && GET_MODE_SIZE (m2) <= 8
9919 +                 && !VECTOR_MODE_P (m2)
9920 +                 && !COMPLEX_MODE_P (m2)
9921                   && !indexed_only_p
9922 -                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
9923 -                 && !(m == DFmode && TARGET_UPPER_REGS_DF)
9924 -                 && !(m == SFmode && TARGET_UPPER_REGS_SF))
9925 +                 && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
9926 +                 && !reg_addr[m2].scalar_in_vmx_p)
9927                 {
9928                   addr_mask |= RELOAD_REG_PRE_INCDEC;
9929  
9930 @@ -2595,16 +2603,22 @@
9931         f  - Register class to use with traditional SFmode instructions.
9932         v  - Altivec register.
9933         wa - Any VSX register.
9934 +       wc - Reserved to represent individual CR bits (used in LLVM).
9935         wd - Preferred register class for V2DFmode.
9936         wf - Preferred register class for V4SFmode.
9937         wg - Float register for power6x move insns.
9938 +       wh - FP register for direct move instructions.
9939 +       wi - FP or VSX register to hold 64-bit integers for VSX insns.
9940 +       wj - FP or VSX register to hold 64-bit integers for direct moves.
9941 +       wk - FP or VSX register to hold 64-bit doubles for direct moves.
9942         wl - Float register if we can do 32-bit signed int loads.
9943         wm - VSX register for ISA 2.07 direct move operations.
9944 +       wn - always NO_REGS.
9945         wr - GPR if 64-bit mode is permitted.
9946         ws - Register class to do ISA 2.06 DF operations.
9947 +       wt - VSX register for TImode in VSX registers.
9948         wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
9949         wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
9950 -       wt - VSX register for TImode in VSX registers.
9951         ww - Register class to do SF conversions in with VSX operations.
9952         wx - Float register if we can do 32-bit int stores.
9953         wy - Register class to do ISA 2.07 SF operations.
9954 @@ -2611,21 +2625,22 @@
9955         wz - Float register if we can do 32-bit unsigned int loads.  */
9956  
9957    if (TARGET_HARD_FLOAT && TARGET_FPRS)
9958 -    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
9959 +    rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;      /* SFmode  */
9960  
9961    if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
9962 -    rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
9963 +    rs6000_constraints[RS6000_CONSTRAINT_d]  = FLOAT_REGS;     /* DFmode  */
9964  
9965    if (TARGET_VSX)
9966      {
9967        rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
9968 -      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
9969 -      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
9970 +      rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;     /* V2DFmode  */
9971 +      rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;     /* V4SFmode  */
9972 +      rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS;   /* DImode  */
9973  
9974        if (TARGET_VSX_TIMODE)
9975 -       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
9976 +       rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;    /* TImode  */
9977  
9978 -      if (TARGET_UPPER_REGS_DF)
9979 +      if (TARGET_UPPER_REGS_DF)                                        /* DFmode  */
9980         {
9981           rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
9982           rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
9983 @@ -2639,19 +2654,26 @@
9984    if (TARGET_ALTIVEC)
9985      rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
9986  
9987 -  if (TARGET_MFPGPR)
9988 +  if (TARGET_MFPGPR)                                           /* DFmode  */
9989      rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
9990  
9991    if (TARGET_LFIWAX)
9992 -    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
9993 +    rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;     /* DImode  */
9994  
9995    if (TARGET_DIRECT_MOVE)
9996 -    rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
9997 +    {
9998 +      rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
9999 +      rs6000_constraints[RS6000_CONSTRAINT_wj]                 /* DImode  */
10000 +       = rs6000_constraints[RS6000_CONSTRAINT_wi];
10001 +      rs6000_constraints[RS6000_CONSTRAINT_wk]                 /* DFmode  */
10002 +       = rs6000_constraints[RS6000_CONSTRAINT_ws];
10003 +      rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
10004 +    }
10005  
10006    if (TARGET_POWERPC64)
10007      rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
10008  
10009 -  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
10010 +  if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)                        /* SFmode  */
10011      {
10012        rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
10013        rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
10014 @@ -2666,10 +2688,10 @@
10015      rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
10016  
10017    if (TARGET_STFIWX)
10018 -    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
10019 +    rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;     /* DImode  */
10020  
10021    if (TARGET_LFIWZX)
10022 -    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
10023 +    rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;     /* DImode  */
10024  
10025    /* Set up the reload helper and direct move functions.  */
10026    if (TARGET_VSX || TARGET_ALTIVEC)
10027 @@ -2692,10 +2714,11 @@
10028           reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_di_load;
10029           if (TARGET_VSX && TARGET_UPPER_REGS_DF)
10030             {
10031 -             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_di_store;
10032 -             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_di_load;
10033 -             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_di_store;
10034 -             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_di_load;
10035 +             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_di_store;
10036 +             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_di_load;
10037 +             reg_addr[DFmode].scalar_in_vmx_p = true;
10038 +             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_di_store;
10039 +             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_di_load;
10040             }
10041           if (TARGET_P8_VECTOR)
10042             {
10043 @@ -2703,6 +2726,8 @@
10044               reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_di_load;
10045               reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_di_store;
10046               reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_di_load;
10047 +             if (TARGET_UPPER_REGS_SF)
10048 +               reg_addr[SFmode].scalar_in_vmx_p = true;
10049             }
10050           if (TARGET_VSX_TIMODE)
10051             {
10052 @@ -2759,10 +2784,11 @@
10053           reg_addr[V2DFmode].reload_load   = CODE_FOR_reload_v2df_si_load;
10054           if (TARGET_VSX && TARGET_UPPER_REGS_DF)
10055             {
10056 -             reg_addr[DFmode].reload_store  = CODE_FOR_reload_df_si_store;
10057 -             reg_addr[DFmode].reload_load   = CODE_FOR_reload_df_si_load;
10058 -             reg_addr[DDmode].reload_store  = CODE_FOR_reload_dd_si_store;
10059 -             reg_addr[DDmode].reload_load   = CODE_FOR_reload_dd_si_load;
10060 +             reg_addr[DFmode].reload_store    = CODE_FOR_reload_df_si_store;
10061 +             reg_addr[DFmode].reload_load     = CODE_FOR_reload_df_si_load;
10062 +             reg_addr[DFmode].scalar_in_vmx_p = true;
10063 +             reg_addr[DDmode].reload_store    = CODE_FOR_reload_dd_si_store;
10064 +             reg_addr[DDmode].reload_load     = CODE_FOR_reload_dd_si_load;
10065             }
10066           if (TARGET_P8_VECTOR)
10067             {
10068 @@ -2770,6 +2796,8 @@
10069               reg_addr[SFmode].reload_load   = CODE_FOR_reload_sf_si_load;
10070               reg_addr[SDmode].reload_store  = CODE_FOR_reload_sd_si_store;
10071               reg_addr[SDmode].reload_load   = CODE_FOR_reload_sd_si_load;
10072 +             if (TARGET_UPPER_REGS_SF)
10073 +               reg_addr[SFmode].scalar_in_vmx_p = true;
10074             }
10075           if (TARGET_VSX_TIMODE)
10076             {
10077 @@ -2810,6 +2838,7 @@
10078  
10079        for (m = 0; m < NUM_MACHINE_MODES; ++m)
10080         {
10081 +         enum machine_mode m2 = (enum machine_mode)m;
10082           int reg_size2 = reg_size;
10083  
10084           /* TFmode/TDmode always takes 2 registers, even in VSX.  */
10085 @@ -2818,7 +2847,7 @@
10086             reg_size2 = UNITS_PER_FP_WORD;
10087  
10088           rs6000_class_max_nregs[m][c]
10089 -           = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
10090 +           = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
10091         }
10092      }
10093  
10094 @@ -3014,7 +3043,8 @@
10095           | ((TARGET_CRYPTO)                ? RS6000_BTM_CRYPTO    : 0)
10096           | ((TARGET_HTM)                   ? RS6000_BTM_HTM       : 0)
10097           | ((TARGET_DFP)                   ? RS6000_BTM_DFP       : 0)
10098 -         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0));
10099 +         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0)
10100 +         | ((TARGET_LONG_DOUBLE_128)       ? RS6000_BTM_LDBL128 : 0));
10101  }
10102  
10103  /* Override command line options.  Mostly we process the processor type and
10104 @@ -5861,6 +5891,34 @@
10105    return align;
10106  }
10107  
10108 +/* Previous GCC releases forced all vector types to have 16-byte alignment.  */
10109 +
10110 +bool
10111 +rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
10112 +{
10113 +  if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
10114 +    {
10115 +      if (computed != 128)
10116 +       {
10117 +         static bool warned;
10118 +         if (!warned && warn_psabi)
10119 +           {
10120 +             warned = true;
10121 +             inform (input_location,
10122 +                     "the layout of aggregates containing vectors with"
10123 +                     " %d-byte alignment will change in a future GCC release",
10124 +                     computed / BITS_PER_UNIT);
10125 +           }
10126 +       }
10127 +      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
10128 +        keep the special treatment of vector types, but warn if there will
10129 +        be differences in future GCC releases.  */
10130 +      return true;
10131 +    }
10132 +
10133 +  return false;
10134 +}
10135 +
10136  /* AIX increases natural record alignment to doubleword if the first
10137     field is an FP double while the FP fields remain word aligned.  */
10138  
10139 @@ -6109,7 +6167,8 @@
10140      return false;
10141  
10142    extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
10143 -  gcc_assert (extra >= 0);
10144 +  if (extra < 0)
10145 +    extra = 0;
10146  
10147    if (GET_CODE (addr) == LO_SUM)
10148      /* For lo_sum addresses, we must allow any offset except one that
10149 @@ -9198,14 +9257,51 @@
10150            || (type && TREE_CODE (type) == VECTOR_TYPE
10151                && int_size_in_bytes (type) >= 16))
10152      return 128;
10153 -  else if (((TARGET_MACHO && rs6000_darwin64_abi)
10154 -           || DEFAULT_ABI == ABI_ELFv2
10155 -            || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
10156 -          && mode == BLKmode
10157 -          && type && TYPE_ALIGN (type) > 64)
10158 +
10159 +  /* Aggregate types that need > 8 byte alignment are quadword-aligned
10160 +     in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
10161 +     -mcompat-align-parm is used.  */
10162 +  if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
10163 +       || DEFAULT_ABI == ABI_ELFv2)
10164 +      && type && TYPE_ALIGN (type) > 64)
10165 +    {
10166 +      /* "Aggregate" means any AGGREGATE_TYPE except for single-element
10167 +         or homogeneous float/vector aggregates here.  We already handled
10168 +         vector aggregates above, but still need to check for float here. */
10169 +      bool aggregate_p = (AGGREGATE_TYPE_P (type)
10170 +                         && !SCALAR_FLOAT_MODE_P (elt_mode));
10171 +
10172 +      /* We used to check for BLKmode instead of the above aggregate type
10173 +        check.  Warn when this results in any difference to the ABI.  */
10174 +      if (aggregate_p != (mode == BLKmode))
10175 +       {
10176 +         static bool warned;
10177 +         if (!warned && warn_psabi)
10178 +           {
10179 +             warned = true;
10180 +             inform (input_location,
10181 +                     "the ABI of passing aggregates with %d-byte alignment"
10182 +                     " will change in a future GCC release",
10183 +                     (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
10184 +           }
10185 +       }
10186 +
10187 +      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
10188 +        keep using the BLKmode check, but warn if there will be differences
10189 +        in future GCC releases.  */
10190 +      if (mode == BLKmode)
10191 +       return 128;
10192 +    }
10193 +
10194 +  /* Similar for the Darwin64 ABI.  Note that for historical reasons we
10195 +     implement the "aggregate type" check as a BLKmode check here; this
10196 +     means certain aggregate types are in fact not aligned.  */
10197 +  if (TARGET_MACHO && rs6000_darwin64_abi
10198 +      && mode == BLKmode
10199 +      && type && TYPE_ALIGN (type) > 64)
10200      return 128;
10201 -  else
10202 -    return PARM_BOUNDARY;
10203 +
10204 +  return PARM_BOUNDARY;
10205  }
10206  
10207  /* The offset in words to the start of the parameter save area.  */
10208 @@ -10243,6 +10339,7 @@
10209           rtx r, off;
10210           int i, k = 0;
10211           unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
10212 +         int fpr_words;
10213  
10214           /* Do we also need to pass this argument in the parameter
10215              save area?  */
10216 @@ -10271,6 +10368,37 @@
10217               rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
10218             }
10219  
10220 +         /* If there were not enough FPRs to hold the argument, the rest
10221 +            usually goes into memory.  However, if the current position
10222 +            is still within the register parameter area, a portion may
10223 +            actually have to go into GPRs.
10224 +
10225 +            Note that it may happen that the portion of the argument
10226 +            passed in the first "half" of the first GPR was already
10227 +            passed in the last FPR as well.
10228 +
10229 +            For unnamed arguments, we already set up GPRs to cover the
10230 +            whole argument in rs6000_psave_function_arg, so there is
10231 +            nothing further to do at this point.
10232 +
10233 +            GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
10234 +            GCC releases.  To avoid any ABI change on the release branch,
10235 +            we retain that original implementation here, but warn if we
10236 +            encounter a case where the ABI will change in the future.  */
10237 +         fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
10238 +         if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
10239 +             && cum->nargs_prototype > 0)
10240 +            {
10241 +             static bool warned;
10242 +             if (!warned && warn_psabi)
10243 +               {
10244 +                 warned = true;
10245 +                 inform (input_location,
10246 +                         "the ABI of passing homogeneous float aggregates"
10247 +                         " will change in a future GCC release");
10248 +               }
10249 +           }
10250 +
10251           return rs6000_finish_function_arg (mode, rvec, k);
10252         }
10253        else if (align_words < GP_ARG_NUM_REG)
10254 @@ -10497,10 +10625,9 @@
10255     list, or passes any parameter in memory.  */
10256  
10257  static bool
10258 -rs6000_function_parms_need_stack (tree fun)
10259 +rs6000_function_parms_need_stack (tree fun, bool incoming)
10260  {
10261 -  function_args_iterator args_iter;
10262 -  tree arg_type;
10263 +  tree fntype, result;
10264    CUMULATIVE_ARGS args_so_far_v;
10265    cumulative_args_t args_so_far;
10266  
10267 @@ -10507,26 +10634,57 @@
10268    if (!fun)
10269      /* Must be a libcall, all of which only use reg parms.  */
10270      return false;
10271 +
10272 +  fntype = fun;
10273    if (!TYPE_P (fun))
10274 -    fun = TREE_TYPE (fun);
10275 +    fntype = TREE_TYPE (fun);
10276  
10277    /* Varargs functions need the parameter save area.  */
10278 -  if (!prototype_p (fun) || stdarg_p (fun))
10279 +  if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
10280      return true;
10281  
10282 -  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
10283 +  INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
10284    args_so_far = pack_cumulative_args (&args_so_far_v);
10285  
10286 -  if (aggregate_value_p (TREE_TYPE (fun), fun))
10287 +  /* When incoming, we will have been passed the function decl.
10288 +     It is necessary to use the decl to handle K&R style functions,
10289 +     where TYPE_ARG_TYPES may not be available.  */
10290 +  if (incoming)
10291      {
10292 -      tree type = build_pointer_type (TREE_TYPE (fun));
10293 -      rs6000_parm_needs_stack (args_so_far, type);
10294 +      gcc_assert (DECL_P (fun));
10295 +      result = DECL_RESULT (fun);
10296      }
10297 +  else
10298 +    result = TREE_TYPE (fntype);
10299  
10300 -  FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
10301 -    if (rs6000_parm_needs_stack (args_so_far, arg_type))
10302 -      return true;
10303 +  if (result && aggregate_value_p (result, fntype))
10304 +    {
10305 +      if (!TYPE_P (result))
10306 +       result = TREE_TYPE (result);
10307 +      result = build_pointer_type (result);
10308 +      rs6000_parm_needs_stack (args_so_far, result);
10309 +    }
10310  
10311 +  if (incoming)
10312 +    {
10313 +      tree parm;
10314 +
10315 +      for (parm = DECL_ARGUMENTS (fun);
10316 +          parm && parm != void_list_node;
10317 +          parm = TREE_CHAIN (parm))
10318 +       if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
10319 +         return true;
10320 +    }
10321 +  else
10322 +    {
10323 +      function_args_iterator args_iter;
10324 +      tree arg_type;
10325 +
10326 +      FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
10327 +       if (rs6000_parm_needs_stack (args_so_far, arg_type))
10328 +         return true;
10329 +    }
10330 +
10331    return false;
10332  }
10333  
10334 @@ -10537,7 +10695,7 @@
10335     all parameters in registers.  */
10336  
10337  int
10338 -rs6000_reg_parm_stack_space (tree fun)
10339 +rs6000_reg_parm_stack_space (tree fun, bool incoming)
10340  {
10341    int reg_parm_stack_space;
10342  
10343 @@ -10555,7 +10713,7 @@
10344      case ABI_ELFv2:
10345        /* ??? Recomputing this every time is a bit expensive.  Is there
10346          a place to cache this information?  */
10347 -      if (rs6000_function_parms_need_stack (fun))
10348 +      if (rs6000_function_parms_need_stack (fun, incoming))
10349         reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
10350        else
10351         reg_parm_stack_space = 0;
10352 @@ -13544,11 +13702,15 @@
10353    else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
10354            == (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
10355      error ("Builtin function %s requires the -mhard-dfp and"
10356 -          "-mpower8-vector options", name);
10357 +          " -mpower8-vector options", name);
10358    else if ((fnmask & RS6000_BTM_DFP) != 0)
10359      error ("Builtin function %s requires the -mhard-dfp option", name);
10360    else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
10361      error ("Builtin function %s requires the -mpower8-vector option", name);
10362 +  else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
10363 +          == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
10364 +    error ("Builtin function %s requires the -mhard-float and"
10365 +          " -mlong-double-128 options", name);
10366    else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
10367      error ("Builtin function %s requires the -mhard-float option", name);
10368    else
10369 @@ -13649,8 +13811,8 @@
10370      case ALTIVEC_BUILTIN_MASK_FOR_LOAD:
10371      case ALTIVEC_BUILTIN_MASK_FOR_STORE:
10372        {
10373 -       int icode = (BYTES_BIG_ENDIAN ? (int) CODE_FOR_altivec_lvsr
10374 -                    : (int) CODE_FOR_altivec_lvsl);
10375 +       int icode = (BYTES_BIG_ENDIAN ? (int) CODE_FOR_altivec_lvsr_direct
10376 +                    : (int) CODE_FOR_altivec_lvsl_direct);
10377         enum machine_mode tmode = insn_data[icode].operand[0].mode;
10378         enum machine_mode mode = insn_data[icode].operand[1].mode;
10379         tree arg;
10380 @@ -13678,7 +13840,6 @@
10381             || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
10382           target = gen_reg_rtx (tmode);
10383  
10384 -       /*pat = gen_altivec_lvsr (target, op);*/
10385         pat = GEN_FCN (icode) (target, op);
10386         if (!pat)
10387           return 0;
10388 @@ -17099,7 +17260,14 @@
10389       prefer Altivec loads..  */
10390    if (rclass == VSX_REGS)
10391      {
10392 -      if (GET_MODE_SIZE (mode) <= 8)
10393 +      if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
10394 +       {
10395 +         rtx addr = XEXP (x, 0);
10396 +         if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
10397 +             || legitimate_lo_sum_address_p (mode, addr, false))
10398 +           return FLOAT_REGS;
10399 +       }
10400 +      else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
10401         return FLOAT_REGS;
10402  
10403        if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
10404 @@ -31413,6 +31581,7 @@
10405    { "htm",              RS6000_BTM_HTM,        false, false },
10406    { "hard-dfp",                 RS6000_BTM_DFP,        false, false },
10407    { "hard-float",       RS6000_BTM_HARD_FLOAT, false, false },
10408 +  { "long-double-128",  RS6000_BTM_LDBL128,    false, false },
10409  };
10410  
10411  /* Option variables that we want to support inside attribute((target)) and
10412 @@ -32663,25 +32832,14 @@
10413  \f
10414  /* Return true if the peephole2 can combine a load involving a combination of
10415     an addis instruction and a load with an offset that can be fused together on
10416 -   a power8.
10417 +   a power8.  */
10418  
10419 -   The operands are:
10420 -       operands[0]     register set with addis
10421 -       operands[1]     value set via addis
10422 -       operands[2]     target register being loaded
10423 -       operands[3]     D-form memory reference using operands[0].
10424 -
10425 -   In addition, we are passed a boolean that is true if this is a peephole2,
10426 -   and we can use see if the addis_reg is dead after the insn and can be
10427 -   replaced by the target register.  */
10428 -
10429  bool
10430 -fusion_gpr_load_p (rtx *operands, bool peep2_p)
10431 +fusion_gpr_load_p (rtx addis_reg,      /* register set via addis.  */
10432 +                  rtx addis_value,     /* addis value.  */
10433 +                  rtx target,          /* target register that is loaded.  */
10434 +                  rtx mem)             /* bottom part of the memory addr. */
10435  {
10436 -  rtx addis_reg = operands[0];
10437 -  rtx addis_value = operands[1];
10438 -  rtx target = operands[2];
10439 -  rtx mem = operands[3];
10440    rtx addr;
10441    rtx base_reg;
10442  
10443 @@ -32695,9 +32853,6 @@
10444    if (!fusion_gpr_addis (addis_value, GET_MODE (addis_value)))
10445      return false;
10446  
10447 -  if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
10448 -    return false;
10449 -
10450    /* Allow sign/zero extension.  */
10451    if (GET_CODE (mem) == ZERO_EXTEND
10452        || (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN))
10453 @@ -32706,22 +32861,22 @@
10454    if (!MEM_P (mem))
10455      return false;
10456  
10457 +  if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
10458 +    return false;
10459 +
10460    addr = XEXP (mem, 0);                        /* either PLUS or LO_SUM.  */
10461    if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
10462      return false;
10463  
10464    /* Validate that the register used to load the high value is either the
10465 -     register being loaded, or we can safely replace its use in a peephole2.
10466 +     register being loaded, or we can safely replace its use.
10467  
10468 -     If this is a peephole2, we assume that there are 2 instructions in the
10469 -     peephole (addis and load), so we want to check if the target register was
10470 -     not used in the memory address and the register to hold the addis result
10471 -     is dead after the peephole.  */
10472 +     This function is only called from the peephole2 pass and we assume that
10473 +     there are 2 instructions in the peephole (addis and load), so we want to
10474 +     check if the target register was not used in the memory address and the
10475 +     register to hold the addis result is dead after the peephole.  */
10476    if (REGNO (addis_reg) != REGNO (target))
10477      {
10478 -      if (!peep2_p)
10479 -       return false;
10480 -
10481        if (reg_mentioned_p (target, mem))
10482         return false;
10483  
10484 @@ -32762,9 +32917,6 @@
10485    enum machine_mode extend_mode = target_mode;
10486    enum machine_mode ptr_mode = Pmode;
10487    enum rtx_code extend = UNKNOWN;
10488 -  rtx addis_reg = ((ptr_mode == target_mode)
10489 -                  ? target
10490 -                  : simplify_subreg (ptr_mode, target, target_mode, 0));
10491  
10492    if (GET_CODE (orig_mem) == ZERO_EXTEND
10493        || (TARGET_P8_FUSION_SIGN && GET_CODE (orig_mem) == SIGN_EXTEND))
10494 @@ -32781,13 +32933,14 @@
10495    gcc_assert (plus_or_lo_sum == PLUS || plus_or_lo_sum == LO_SUM);
10496  
10497    offset = XEXP (orig_addr, 1);
10498 -  new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_reg, offset);
10499 -  new_mem = change_address (orig_mem, target_mode, new_addr);
10500 +  new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_value, offset);
10501 +  new_mem = replace_equiv_address_nv (orig_mem, new_addr);
10502  
10503    if (extend != UNKNOWN)
10504      new_mem = gen_rtx_fmt_e (ZERO_EXTEND, extend_mode, new_mem);
10505  
10506 -  emit_insn (gen_rtx_SET (VOIDmode, addis_reg, addis_value));
10507 +  new_mem = gen_rtx_UNSPEC (extend_mode, gen_rtvec (1, new_mem),
10508 +                           UNSPEC_FUSION_GPR);
10509    emit_insn (gen_rtx_SET (VOIDmode, target, new_mem));
10510  
10511    if (extend == SIGN_EXTEND)
10512 @@ -32806,55 +32959,40 @@
10513  }
10514  
10515  /* Return a string to fuse an addis instruction with a gpr load to the same
10516 -   register that we loaded up the addis instruction.  The code is complicated,
10517 -   so we call output_asm_insn directly, and just return "".
10518 +   register that we loaded up the addis instruction.  The address that is used
10519 +   is the logical address that was formed during peephole2:
10520 +       (lo_sum (high) (low-part))
10521  
10522 -   The operands are:
10523 -       operands[0]     register set with addis (must be same reg as target).
10524 -       operands[1]     value set via addis
10525 -       operands[2]     target register being loaded
10526 -       operands[3]     D-form memory reference using operands[0].  */
10527 +   The code is complicated, so we call output_asm_insn directly, and just
10528 +   return "".  */
10529  
10530  const char *
10531 -emit_fusion_gpr_load (rtx *operands)
10532 +emit_fusion_gpr_load (rtx target, rtx mem)
10533  {
10534 -  rtx addis_reg = operands[0];
10535 -  rtx addis_value = operands[1];
10536 -  rtx target = operands[2];
10537 -  rtx mem = operands[3];
10538 +  rtx addis_value;
10539    rtx fuse_ops[10];
10540    rtx addr;
10541    rtx load_offset;
10542    const char *addis_str = NULL;
10543    const char *load_str = NULL;
10544 -  const char *extend_insn = NULL;
10545    const char *mode_name = NULL;
10546    char insn_template[80];
10547    enum machine_mode mode;
10548    const char *comment_str = ASM_COMMENT_START;
10549 -  bool sign_p = false;
10550  
10551 -  gcc_assert (REG_P (addis_reg) && REG_P (target));
10552 -  gcc_assert (REGNO (addis_reg) == REGNO (target));
10553 +  if (GET_CODE (mem) == ZERO_EXTEND)
10554 +    mem = XEXP (mem, 0);
10555  
10556 +  gcc_assert (REG_P (target) && MEM_P (mem));
10557 +
10558    if (*comment_str == ' ')
10559      comment_str++;
10560  
10561 -  /* Allow sign/zero extension.  */
10562 -  if (GET_CODE (mem) == ZERO_EXTEND)
10563 -    mem = XEXP (mem, 0);
10564 -
10565 -  else if (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN)
10566 -    {
10567 -      sign_p = true;
10568 -      mem = XEXP (mem, 0);
10569 -    }
10570 -
10571 -  gcc_assert (MEM_P (mem));
10572    addr = XEXP (mem, 0);
10573    if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
10574      gcc_unreachable ();
10575  
10576 +  addis_value = XEXP (addr, 0);
10577    load_offset = XEXP (addr, 1);
10578  
10579    /* Now emit the load instruction to the same register.  */
10580 @@ -32864,29 +33002,22 @@
10581      case QImode:
10582        mode_name = "char";
10583        load_str = "lbz";
10584 -      extend_insn = "extsb %0,%0";
10585        break;
10586  
10587      case HImode:
10588        mode_name = "short";
10589        load_str = "lhz";
10590 -      extend_insn = "extsh %0,%0";
10591        break;
10592  
10593      case SImode:
10594        mode_name = "int";
10595        load_str = "lwz";
10596 -      extend_insn = "extsw %0,%0";
10597        break;
10598  
10599      case DImode:
10600 -      if (TARGET_POWERPC64)
10601 -       {
10602 -         mode_name = "long";
10603 -         load_str = "ld";
10604 -       }
10605 -      else
10606 -       gcc_unreachable ();
10607 +      gcc_assert (TARGET_POWERPC64);
10608 +      mode_name = "long";
10609 +      load_str = "ld";
10610        break;
10611  
10612      default:
10613 @@ -33030,14 +33161,6 @@
10614    else
10615      fatal_insn ("Unable to generate load offset for fusion", load_offset);
10616  
10617 -  /* Handle sign extension.  The peephole2 pass generates this as a separate
10618 -     insn, but we handle it just in case it got reattached.  */
10619 -  if (sign_p)
10620 -    {
10621 -      gcc_assert (extend_insn != NULL);
10622 -      output_asm_insn (extend_insn, fuse_ops);
10623 -    }
10624 -
10625    return "";
10626  }
10627  
10628 Index: gcc/config/rs6000/vsx.md
10629 ===================================================================
10630 --- gcc/config/rs6000/vsx.md    (.../tags/gcc_4_8_3_release)    (revision 217117)
10631 +++ gcc/config/rs6000/vsx.md    (.../branches/gcc-4_8-branch)   (revision 217117)
10632 @@ -24,6 +24,13 @@
10633  ;; Iterator for the 2 64-bit vector types
10634  (define_mode_iterator VSX_D [V2DF V2DI])
10635  
10636 +;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
10637 +;; lxvd2x to properly handle swapping words on little endian
10638 +(define_mode_iterator VSX_LE [V2DF
10639 +                             V2DI
10640 +                             V1TI
10641 +                             (TI       "VECTOR_MEM_VSX_P (TImode)")])
10642 +
10643  ;; Iterator for the 2 32-bit vector types
10644  (define_mode_iterator VSX_W [V4SF V4SI])
10645  
10646 @@ -79,19 +86,26 @@
10647                          (V4SF  "wf")
10648                          (V2DI  "wd")
10649                          (V2DF  "wd")
10650 +                        (DI    "wi")
10651                          (DF    "ws")
10652 -                        (SF    "d")
10653 +                        (SF    "ww")
10654                          (V1TI  "v")
10655                          (TI    "wt")])
10656  
10657 -;; Map the register class used for float<->int conversions
10658 +;; Map the register class used for float<->int conversions (floating point side)
10659 +;; VSr2 is the preferred register class, VSr3 is any register class that will
10660 +;; hold the data
10661  (define_mode_attr VSr2 [(V2DF  "wd")
10662                          (V4SF  "wf")
10663 -                        (DF    "ws")])
10664 +                        (DF    "ws")
10665 +                        (SF    "ww")
10666 +                        (DI    "wi")])
10667  
10668  (define_mode_attr VSr3 [(V2DF  "wa")
10669                          (V4SF  "wa")
10670 -                        (DF    "ws")])
10671 +                        (DF    "ws")
10672 +                        (SF    "ww")
10673 +                        (DI    "wi")])
10674  
10675  ;; Map the register class for sp<->dp float conversions, destination
10676  (define_mode_attr VSr4 [(SF    "ws")
10677 @@ -99,12 +113,27 @@
10678                          (V2DF  "wd")
10679                          (V4SF  "v")])
10680  
10681 -;; Map the register class for sp<->dp float conversions, destination
10682 +;; Map the register class for sp<->dp float conversions, source
10683  (define_mode_attr VSr5 [(SF    "ws")
10684                          (DF    "f")
10685                          (V2DF  "v")
10686                          (V4SF  "wd")])
10687  
10688 +;; The VSX register class that a type can occupy, even if it is not the
10689 +;; preferred register class (VSr is the preferred register class that will get
10690 +;; allocated first).
10691 +(define_mode_attr VSa  [(V16QI "wa")
10692 +                        (V8HI  "wa")
10693 +                        (V4SI  "wa")
10694 +                        (V4SF  "wa")
10695 +                        (V2DI  "wa")
10696 +                        (V2DF  "wa")
10697 +                        (DI    "wi")
10698 +                        (DF    "ws")
10699 +                        (SF    "ww")
10700 +                        (V1TI  "wa")
10701 +                        (TI    "wt")])
10702 +
10703  ;; Same size integer type for floating point data
10704  (define_mode_attr VSi [(V4SF  "v4si")
10705                        (V2DF  "v2di")
10706 @@ -200,6 +229,16 @@
10707                              (V2DF      "V4DF")
10708                              (V1TI      "V2TI")])
10709  
10710 +;; Map register class for 64-bit element in 128-bit vector for direct moves
10711 +;; to/from gprs
10712 +(define_mode_attr VS_64dm [(V2DF       "wk")
10713 +                          (V2DI        "wj")])
10714 +
10715 +;; Map register class for 64-bit element in 128-bit vector for normal register
10716 +;; to register moves
10717 +(define_mode_attr VS_64reg [(V2DF      "ws")
10718 +                           (V2DI       "wi")])
10719 +
10720  ;; Constants for creating unspecs
10721  (define_c_enum "unspec"
10722    [UNSPEC_VSX_CONCAT
10723 @@ -228,8 +267,8 @@
10724  ;; The patterns for LE permuted loads and stores come before the general
10725  ;; VSX moves so they match first.
10726  (define_insn_and_split "*vsx_le_perm_load_<mode>"
10727 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
10728 -        (match_operand:VSX_D 1 "memory_operand" "Z"))]
10729 +  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
10730 +        (match_operand:VSX_LE 1 "memory_operand" "Z"))]
10731    "!BYTES_BIG_ENDIAN && TARGET_VSX"
10732    "#"
10733    "!BYTES_BIG_ENDIAN && TARGET_VSX"
10734 @@ -251,7 +290,7 @@
10735     (set_attr "length" "8")])
10736  
10737  (define_insn_and_split "*vsx_le_perm_load_<mode>"
10738 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
10739 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
10740          (match_operand:VSX_W 1 "memory_operand" "Z"))]
10741    "!BYTES_BIG_ENDIAN && TARGET_VSX"
10742    "#"
10743 @@ -342,8 +381,8 @@
10744     (set_attr "length" "8")])
10745  
10746  (define_insn "*vsx_le_perm_store_<mode>"
10747 -  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
10748 -        (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
10749 +  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
10750 +        (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
10751    "!BYTES_BIG_ENDIAN && TARGET_VSX"
10752    "#"
10753    [(set_attr "type" "vecstore")
10754 @@ -350,8 +389,8 @@
10755     (set_attr "length" "12")])
10756  
10757  (define_split
10758 -  [(set (match_operand:VSX_D 0 "memory_operand" "")
10759 -        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
10760 +  [(set (match_operand:VSX_LE 0 "memory_operand" "")
10761 +        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
10762    "!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
10763    [(set (match_dup 2)
10764          (vec_select:<MODE>
10765 @@ -369,8 +408,8 @@
10766  ;; The post-reload split requires that we re-permute the source
10767  ;; register in case it is still live.
10768  (define_split
10769 -  [(set (match_operand:VSX_D 0 "memory_operand" "")
10770 -        (match_operand:VSX_D 1 "vsx_register_operand" ""))]
10771 +  [(set (match_operand:VSX_LE 0 "memory_operand" "")
10772 +        (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
10773    "!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
10774    [(set (match_dup 1)
10775          (vec_select:<MODE>
10776 @@ -388,7 +427,7 @@
10777  
10778  (define_insn "*vsx_le_perm_store_<mode>"
10779    [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
10780 -        (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
10781 +        (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
10782    "!BYTES_BIG_ENDIAN && TARGET_VSX"
10783    "#"
10784    [(set_attr "type" "vecstore")
10785 @@ -578,8 +617,8 @@
10786  
10787  
10788  (define_insn "*vsx_mov<mode>"
10789 -  [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,wQ,?&r,??Y,??r,??r,<VSr>,?wa,*r,v,wZ, v")
10790 -       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
10791 +  [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?<VSa>,?<VSa>,wQ,?&r,??Y,??r,??r,<VSr>,?<VSa>,*r,v,wZ, v")
10792 +       (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
10793    "VECTOR_MEM_VSX_P (<MODE>mode)
10794     && (register_operand (operands[0], <MODE>mode) 
10795         || register_operand (operands[1], <MODE>mode))"
10796 @@ -681,9 +720,9 @@
10797  ;; instructions are now combined with the insn for the traditional floating
10798  ;; point unit.
10799  (define_insn "*vsx_add<mode>3"
10800 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10801 -        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10802 -                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10803 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10804 +        (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10805 +                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10806    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10807    "xvadd<VSs> %x0,%x1,%x2"
10808    [(set_attr "type" "<VStype_simple>")
10809 @@ -690,9 +729,9 @@
10810     (set_attr "fp_type" "<VSfptype_simple>")])
10811  
10812  (define_insn "*vsx_sub<mode>3"
10813 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10814 -        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10815 -                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10816 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10817 +        (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10818 +                    (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10819    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10820    "xvsub<VSs> %x0,%x1,%x2"
10821    [(set_attr "type" "<VStype_simple>")
10822 @@ -699,9 +738,9 @@
10823     (set_attr "fp_type" "<VSfptype_simple>")])
10824  
10825  (define_insn "*vsx_mul<mode>3"
10826 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10827 -        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10828 -                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10829 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10830 +        (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10831 +                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10832    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10833    "xvmul<VSs> %x0,%x1,%x2"
10834    [(set_attr "type" "<VStype_simple>")
10835 @@ -708,9 +747,9 @@
10836     (set_attr "fp_type" "<VSfptype_mul>")])
10837  
10838  (define_insn "*vsx_div<mode>3"
10839 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10840 -        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10841 -                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10842 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10843 +        (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10844 +                  (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10845    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10846    "xvdiv<VSs> %x0,%x1,%x2"
10847    [(set_attr "type" "<VStype_div>")
10848 @@ -746,8 +785,8 @@
10849  
10850  (define_insn "*vsx_tdiv<mode>3_internal"
10851    [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
10852 -       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
10853 -                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
10854 +       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
10855 +                     (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
10856                    UNSPEC_VSX_TDIV))]
10857    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10858    "x<VSv>tdiv<VSs> %0,%x1,%x2"
10859 @@ -755,8 +794,8 @@
10860     (set_attr "fp_type" "<VSfptype_simple>")])
10861  
10862  (define_insn "vsx_fre<mode>2"
10863 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10864 -       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
10865 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10866 +       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
10867                       UNSPEC_FRES))]
10868    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10869    "xvre<VSs> %x0,%x1"
10870 @@ -764,8 +803,8 @@
10871     (set_attr "fp_type" "<VSfptype_simple>")])
10872  
10873  (define_insn "*vsx_neg<mode>2"
10874 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10875 -        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
10876 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10877 +        (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
10878    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10879    "xvneg<VSs> %x0,%x1"
10880    [(set_attr "type" "<VStype_simple>")
10881 @@ -772,8 +811,8 @@
10882     (set_attr "fp_type" "<VSfptype_simple>")])
10883  
10884  (define_insn "*vsx_abs<mode>2"
10885 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10886 -        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
10887 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10888 +        (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
10889    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10890    "xvabs<VSs> %x0,%x1"
10891    [(set_attr "type" "<VStype_simple>")
10892 @@ -780,10 +819,10 @@
10893     (set_attr "fp_type" "<VSfptype_simple>")])
10894  
10895  (define_insn "vsx_nabs<mode>2"
10896 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10897 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10898          (neg:VSX_F
10899          (abs:VSX_F
10900 -         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
10901 +         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
10902    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10903    "xvnabs<VSs> %x0,%x1"
10904    [(set_attr "type" "<VStype_simple>")
10905 @@ -790,9 +829,9 @@
10906     (set_attr "fp_type" "<VSfptype_simple>")])
10907  
10908  (define_insn "vsx_smax<mode>3"
10909 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10910 -        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10911 -                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10912 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10913 +        (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10914 +                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10915    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10916    "xvmax<VSs> %x0,%x1,%x2"
10917    [(set_attr "type" "<VStype_simple>")
10918 @@ -799,9 +838,9 @@
10919     (set_attr "fp_type" "<VSfptype_simple>")])
10920  
10921  (define_insn "*vsx_smin<mode>3"
10922 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10923 -        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
10924 -                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
10925 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10926 +        (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
10927 +                   (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
10928    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10929    "xvmin<VSs> %x0,%x1,%x2"
10930    [(set_attr "type" "<VStype_simple>")
10931 @@ -808,8 +847,8 @@
10932     (set_attr "fp_type" "<VSfptype_simple>")])
10933  
10934  (define_insn "*vsx_sqrt<mode>2"
10935 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10936 -        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
10937 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10938 +        (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
10939    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10940    "xvsqrt<VSs> %x0,%x1"
10941    [(set_attr "type" "<VStype_sqrt>")
10942 @@ -816,8 +855,8 @@
10943     (set_attr "fp_type" "<VSfptype_sqrt>")])
10944  
10945  (define_insn "*vsx_rsqrte<mode>2"
10946 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
10947 -       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
10948 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
10949 +       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
10950                       UNSPEC_RSQRT))]
10951    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10952    "xvrsqrte<VSs> %x0,%x1"
10953 @@ -852,7 +891,7 @@
10954  
10955  (define_insn "*vsx_tsqrt<mode>2_internal"
10956    [(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
10957 -       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
10958 +       (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
10959                      UNSPEC_VSX_TSQRT))]
10960    "VECTOR_UNIT_VSX_P (<MODE>mode)"
10961    "x<VSv>tsqrt<VSs> %0,%x1"
10962 @@ -865,11 +904,11 @@
10963  ;; multiply.
10964  
10965  (define_insn "*vsx_fmav4sf4"
10966 -  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
10967 +  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
10968         (fma:V4SF
10969 -         (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
10970 -         (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
10971 -         (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
10972 +         (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
10973 +         (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
10974 +         (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))]
10975    "VECTOR_UNIT_VSX_P (V4SFmode)"
10976    "@
10977     xvmaddasp %x0,%x1,%x2
10978 @@ -880,11 +919,11 @@
10979    [(set_attr "type" "vecfloat")])
10980  
10981  (define_insn "*vsx_fmav2df4"
10982 -  [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
10983 +  [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
10984         (fma:V2DF
10985 -         (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
10986 -         (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
10987 -         (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
10988 +         (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
10989 +         (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
10990 +         (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))]
10991    "VECTOR_UNIT_VSX_P (V2DFmode)"
10992    "@
10993     xvmaddadp %x0,%x1,%x2
10994 @@ -894,12 +933,12 @@
10995    [(set_attr "type" "vecdouble")])
10996  
10997  (define_insn "*vsx_fms<mode>4"
10998 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
10999 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
11000         (fma:VSX_F
11001 -         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
11002 -         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
11003 +         (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
11004 +         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
11005           (neg:VSX_F
11006 -           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
11007 +           (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
11008    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11009    "@
11010     xvmsuba<VSs> %x0,%x1,%x2
11011 @@ -909,12 +948,12 @@
11012    [(set_attr "type" "<VStype_mul>")])
11013  
11014  (define_insn "*vsx_nfma<mode>4"
11015 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
11016 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
11017         (neg:VSX_F
11018          (fma:VSX_F
11019 -         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
11020 -         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
11021 -         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
11022 +         (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
11023 +         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
11024 +         (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
11025    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11026    "@
11027     xvnmadda<VSs> %x0,%x1,%x2
11028 @@ -959,9 +998,9 @@
11029  
11030  ;; Vector conditional expressions (no scalar version for these instructions)
11031  (define_insn "vsx_eq<mode>"
11032 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11033 -       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
11034 -                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
11035 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11036 +       (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
11037 +                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
11038    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11039    "xvcmpeq<VSs> %x0,%x1,%x2"
11040    [(set_attr "type" "<VStype_simple>")
11041 @@ -968,9 +1007,9 @@
11042     (set_attr "fp_type" "<VSfptype_simple>")])
11043  
11044  (define_insn "vsx_gt<mode>"
11045 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11046 -       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
11047 -                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
11048 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11049 +       (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
11050 +                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
11051    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11052    "xvcmpgt<VSs> %x0,%x1,%x2"
11053    [(set_attr "type" "<VStype_simple>")
11054 @@ -977,9 +1016,9 @@
11055     (set_attr "fp_type" "<VSfptype_simple>")])
11056  
11057  (define_insn "*vsx_ge<mode>"
11058 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11059 -       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
11060 -                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
11061 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11062 +       (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
11063 +                 (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
11064    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11065    "xvcmpge<VSs> %x0,%x1,%x2"
11066    [(set_attr "type" "<VStype_simple>")
11067 @@ -990,10 +1029,10 @@
11068  (define_insn "*vsx_eq_<mode>_p"
11069    [(set (reg:CC 74)
11070         (unspec:CC
11071 -        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
11072 -                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
11073 +        [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
11074 +                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
11075          UNSPEC_PREDICATE))
11076 -   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11077 +   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11078         (eq:VSX_F (match_dup 1)
11079                   (match_dup 2)))]
11080    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11081 @@ -1003,10 +1042,10 @@
11082  (define_insn "*vsx_gt_<mode>_p"
11083    [(set (reg:CC 74)
11084         (unspec:CC
11085 -        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
11086 -                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
11087 +        [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
11088 +                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
11089          UNSPEC_PREDICATE))
11090 -   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11091 +   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11092         (gt:VSX_F (match_dup 1)
11093                   (match_dup 2)))]
11094    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11095 @@ -1016,10 +1055,10 @@
11096  (define_insn "*vsx_ge_<mode>_p"
11097    [(set (reg:CC 74)
11098         (unspec:CC
11099 -        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
11100 -                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
11101 +        [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
11102 +                (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
11103          UNSPEC_PREDICATE))
11104 -   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11105 +   (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11106         (ge:VSX_F (match_dup 1)
11107                   (match_dup 2)))]
11108    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11109 @@ -1028,23 +1067,23 @@
11110  
11111  ;; Vector select
11112  (define_insn "*vsx_xxsel<mode>"
11113 -  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
11114 +  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11115         (if_then_else:VSX_L
11116 -        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
11117 +        (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
11118                 (match_operand:VSX_L 4 "zero_constant" ""))
11119 -        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
11120 -        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
11121 +        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
11122 +        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
11123    "VECTOR_MEM_VSX_P (<MODE>mode)"
11124    "xxsel %x0,%x3,%x2,%x1"
11125    [(set_attr "type" "vecperm")])
11126  
11127  (define_insn "*vsx_xxsel<mode>_uns"
11128 -  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
11129 +  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11130         (if_then_else:VSX_L
11131 -        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
11132 +        (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
11133                    (match_operand:VSX_L 4 "zero_constant" ""))
11134 -        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
11135 -        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
11136 +        (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
11137 +        (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
11138    "VECTOR_MEM_VSX_P (<MODE>mode)"
11139    "xxsel %x0,%x3,%x2,%x1"
11140    [(set_attr "type" "vecperm")])
11141 @@ -1051,10 +1090,10 @@
11142  
11143  ;; Copy sign
11144  (define_insn "vsx_copysign<mode>3"
11145 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11146 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11147         (unspec:VSX_F
11148 -        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
11149 -         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
11150 +        [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
11151 +         (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
11152          UNSPEC_COPYSIGN))]
11153    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11154    "xvcpsgn<VSs> %x0,%x2,%x1"
11155 @@ -1067,7 +1106,7 @@
11156  ;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
11157  ;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
11158  (define_insn "vsx_float<VSi><mode>2"
11159 -  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
11160 +  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
11161         (float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
11162    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11163    "x<VSv>cvsx<VSc><VSs> %x0,%x1"
11164 @@ -1075,7 +1114,7 @@
11165     (set_attr "fp_type" "<VSfptype_simple>")])
11166  
11167  (define_insn "vsx_floatuns<VSi><mode>2"
11168 -  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
11169 +  [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
11170         (unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
11171    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11172    "x<VSv>cvux<VSc><VSs> %x0,%x1"
11173 @@ -1084,7 +1123,7 @@
11174  
11175  (define_insn "vsx_fix_trunc<mode><VSi>2"
11176    [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
11177 -       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
11178 +       (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
11179    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11180    "x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
11181    [(set_attr "type" "<VStype_simple>")
11182 @@ -1092,7 +1131,7 @@
11183  
11184  (define_insn "vsx_fixuns_trunc<mode><VSi>2"
11185    [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
11186 -       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
11187 +       (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
11188    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11189    "x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
11190    [(set_attr "type" "<VStype_simple>")
11191 @@ -1100,8 +1139,8 @@
11192  
11193  ;; Math rounding functions
11194  (define_insn "vsx_x<VSv>r<VSs>i"
11195 -  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
11196 -       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
11197 +  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11198 +       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
11199                       UNSPEC_VSX_ROUND_I))]
11200    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11201    "x<VSv>r<VSs>i %x0,%x1"
11202 @@ -1109,8 +1148,8 @@
11203     (set_attr "fp_type" "<VSfptype_simple>")])
11204  
11205  (define_insn "vsx_x<VSv>r<VSs>ic"
11206 -  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
11207 -       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
11208 +  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11209 +       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
11210                       UNSPEC_VSX_ROUND_IC))]
11211    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11212    "x<VSv>r<VSs>ic %x0,%x1"
11213 @@ -1118,8 +1157,8 @@
11214     (set_attr "fp_type" "<VSfptype_simple>")])
11215  
11216  (define_insn "vsx_btrunc<mode>2"
11217 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11218 -       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
11219 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11220 +       (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
11221    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11222    "xvr<VSs>iz %x0,%x1"
11223    [(set_attr "type" "<VStype_simple>")
11224 @@ -1126,8 +1165,8 @@
11225     (set_attr "fp_type" "<VSfptype_simple>")])
11226  
11227  (define_insn "*vsx_b2trunc<mode>2"
11228 -  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
11229 -       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
11230 +  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11231 +       (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
11232                       UNSPEC_FRIZ))]
11233    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11234    "x<VSv>r<VSs>iz %x0,%x1"
11235 @@ -1135,8 +1174,8 @@
11236     (set_attr "fp_type" "<VSfptype_simple>")])
11237  
11238  (define_insn "vsx_floor<mode>2"
11239 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11240 -       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
11241 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11242 +       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
11243                       UNSPEC_FRIM))]
11244    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11245    "xvr<VSs>im %x0,%x1"
11246 @@ -1144,8 +1183,8 @@
11247     (set_attr "fp_type" "<VSfptype_simple>")])
11248  
11249  (define_insn "vsx_ceil<mode>2"
11250 -  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
11251 -       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
11252 +  [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11253 +       (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
11254                       UNSPEC_FRIP))]
11255    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11256    "xvr<VSs>ip %x0,%x1"
11257 @@ -1160,8 +1199,8 @@
11258  ;; scalar single precision instructions internally use the double format.
11259  ;; Prefer the altivec registers, since we likely will need to do a vperm
11260  (define_insn "vsx_<VS_spdp_insn>"
11261 -  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
11262 -       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
11263 +  [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
11264 +       (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
11265                               UNSPEC_VSX_CVSPDP))]
11266    "VECTOR_UNIT_VSX_P (<MODE>mode)"
11267    "<VS_spdp_insn> %x0,%x1"
11268 @@ -1169,8 +1208,8 @@
11269  
11270  ;; xscvspdp, represent the scalar SF type as V4SF
11271  (define_insn "vsx_xscvspdp"
11272 -  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
11273 -       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
11274 +  [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
11275 +       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
11276                    UNSPEC_VSX_CVSPDP))]
11277    "VECTOR_UNIT_VSX_P (V4SFmode)"
11278    "xscvspdp %x0,%x1"
11279 @@ -1197,7 +1236,7 @@
11280  
11281  ;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
11282  (define_insn "vsx_xscvdpspn"
11283 -  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
11284 +  [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
11285         (unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
11286                      UNSPEC_VSX_CVDPSPN))]
11287    "TARGET_XSCVDPSPN"
11288 @@ -1205,8 +1244,8 @@
11289    [(set_attr "type" "fp")])
11290  
11291  (define_insn "vsx_xscvspdpn"
11292 -  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
11293 -       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
11294 +  [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
11295 +       (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
11296                    UNSPEC_VSX_CVSPDPN))]
11297    "TARGET_XSCVSPDPN"
11298    "xscvspdpn %x0,%x1"
11299 @@ -1213,8 +1252,8 @@
11300    [(set_attr "type" "fp")])
11301  
11302  (define_insn "vsx_xscvdpspn_scalar"
11303 -  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
11304 -       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
11305 +  [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
11306 +       (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
11307                      UNSPEC_VSX_CVDPSPN))]
11308    "TARGET_XSCVDPSPN"
11309    "xscvdpspn %x0,%x1"
11310 @@ -1302,10 +1341,10 @@
11311  ;; since the xsrdpiz instruction does not truncate the value if the floating
11312  ;; point value is < LONG_MIN or > LONG_MAX.
11313  (define_insn "*vsx_float_fix_<mode>2"
11314 -  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
11315 +  [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11316         (float:VSX_DF
11317          (fix:<VSI>
11318 -         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
11319 +         (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
11320    "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
11321     && VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
11322     && !flag_trapping_math && TARGET_FRIZ"
11323 @@ -1318,10 +1357,10 @@
11324  
11325  ;; Build a V2DF/V2DI vector from two scalars
11326  (define_insn "vsx_concat_<mode>"
11327 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
11328 +  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
11329         (vec_concat:VSX_D
11330 -        (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
11331 -        (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
11332 +        (match_operand:<VS_scalar> 1 "vsx_register_operand" "<VS_64reg>,<VSa>")
11333 +        (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")))]
11334    "VECTOR_MEM_VSX_P (<MODE>mode)"
11335  {
11336    if (BYTES_BIG_ENDIAN)
11337 @@ -1352,9 +1391,9 @@
11338  ;; xxpermdi for little endian loads and stores.  We need several of
11339  ;; these since the form of the PARALLEL differs by mode.
11340  (define_insn "*vsx_xxpermdi2_le_<mode>"
11341 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
11342 -        (vec_select:VSX_D
11343 -          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
11344 +  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
11345 +        (vec_select:VSX_LE
11346 +          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
11347            (parallel [(const_int 1) (const_int 0)])))]
11348    "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
11349    "xxpermdi %x0,%x1,%x1,2"
11350 @@ -1361,9 +1400,9 @@
11351    [(set_attr "type" "vecperm")])
11352  
11353  (define_insn "*vsx_xxpermdi4_le_<mode>"
11354 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
11355 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
11356          (vec_select:VSX_W
11357 -          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
11358 +          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
11359            (parallel [(const_int 2) (const_int 3)
11360                       (const_int 0) (const_int 1)])))]
11361    "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
11362 @@ -1401,9 +1440,9 @@
11363  ;; lxvd2x for little endian loads.  We need several of
11364  ;; these since the form of the PARALLEL differs by mode.
11365  (define_insn "*vsx_lxvd2x2_le_<mode>"
11366 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
11367 -        (vec_select:VSX_D
11368 -          (match_operand:VSX_D 1 "memory_operand" "Z")
11369 +  [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
11370 +        (vec_select:VSX_LE
11371 +          (match_operand:VSX_LE 1 "memory_operand" "Z")
11372            (parallel [(const_int 1) (const_int 0)])))]
11373    "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
11374    "lxvd2x %x0,%y1"
11375 @@ -1410,7 +1449,7 @@
11376    [(set_attr "type" "vecload")])
11377  
11378  (define_insn "*vsx_lxvd2x4_le_<mode>"
11379 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
11380 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
11381          (vec_select:VSX_W
11382            (match_operand:VSX_W 1 "memory_operand" "Z")
11383            (parallel [(const_int 2) (const_int 3)
11384 @@ -1450,9 +1489,9 @@
11385  ;; stxvd2x for little endian stores.  We need several of
11386  ;; these since the form of the PARALLEL differs by mode.
11387  (define_insn "*vsx_stxvd2x2_le_<mode>"
11388 -  [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
11389 -        (vec_select:VSX_D
11390 -          (match_operand:VSX_D 1 "vsx_register_operand" "wa")
11391 +  [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
11392 +        (vec_select:VSX_LE
11393 +          (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
11394            (parallel [(const_int 1) (const_int 0)])))]
11395    "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
11396    "stxvd2x %x1,%y0"
11397 @@ -1461,7 +1500,7 @@
11398  (define_insn "*vsx_stxvd2x4_le_<mode>"
11399    [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
11400          (vec_select:VSX_W
11401 -          (match_operand:VSX_W 1 "vsx_register_operand" "wa")
11402 +          (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
11403            (parallel [(const_int 2) (const_int 3)
11404                       (const_int 0) (const_int 1)])))]
11405    "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
11406 @@ -1513,11 +1552,12 @@
11407  
11408  ;; Set the element of a V2DI/VD2F mode
11409  (define_insn "vsx_set_<mode>"
11410 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
11411 -       (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
11412 -                      (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
11413 -                      (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
11414 -                     UNSPEC_VSX_SET))]
11415 +  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
11416 +       (unspec:VSX_D
11417 +        [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
11418 +         (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
11419 +         (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
11420 +        UNSPEC_VSX_SET))]
11421    "VECTOR_MEM_VSX_P (<MODE>mode)"
11422  {
11423    int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
11424 @@ -1582,7 +1622,7 @@
11425  (define_insn_and_split "vsx_extract_v4sf"
11426    [(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
11427         (vec_select:SF
11428 -        (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
11429 +        (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
11430          (parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
11431     (clobber (match_scratch:V4SF 3 "=X,0"))]
11432    "VECTOR_UNIT_VSX_P (V4SFmode)"
11433 @@ -1606,7 +1646,7 @@
11434      {
11435        if (GET_CODE (op3) == SCRATCH)
11436         op3 = gen_reg_rtx (V4SFmode);
11437 -      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
11438 +      emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
11439        tmp = op3;
11440      }
11441    emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
11442 @@ -1765,9 +1805,9 @@
11443  
11444  ;; V2DF/V2DI splat
11445  (define_insn "vsx_splat_<mode>"
11446 -  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
11447 +  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
11448         (vec_duplicate:VSX_D
11449 -        (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
11450 +        (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
11451    "VECTOR_MEM_VSX_P (<MODE>mode)"
11452    "@
11453     xxpermdi %x0,%x1,%x1,0
11454 @@ -1780,10 +1820,10 @@
11455  
11456  ;; V4SF/V4SI splat
11457  (define_insn "vsx_xxspltw_<mode>"
11458 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
11459 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
11460         (vec_duplicate:VSX_W
11461          (vec_select:<VS_scalar>
11462 -         (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
11463 +         (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
11464           (parallel
11465            [(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
11466    "VECTOR_MEM_VSX_P (<MODE>mode)"
11467 @@ -1796,8 +1836,8 @@
11468    [(set_attr "type" "vecperm")])
11469  
11470  (define_insn "vsx_xxspltw_<mode>_direct"
11471 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
11472 -        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
11473 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
11474 +        (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
11475                         (match_operand:QI 2 "u5bit_cint_operand" "i,i")]
11476                        UNSPEC_VSX_XXSPLTW))]
11477    "VECTOR_MEM_VSX_P (<MODE>mode)"
11478 @@ -1806,11 +1846,11 @@
11479  
11480  ;; V4SF/V4SI interleave
11481  (define_insn "vsx_xxmrghw_<mode>"
11482 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
11483 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
11484          (vec_select:VSX_W
11485           (vec_concat:<VS_double>
11486 -           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
11487 -           (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
11488 +           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
11489 +           (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
11490           (parallel [(const_int 0) (const_int 4)
11491                      (const_int 1) (const_int 5)])))]
11492    "VECTOR_MEM_VSX_P (<MODE>mode)"
11493 @@ -1823,11 +1863,11 @@
11494    [(set_attr "type" "vecperm")])
11495  
11496  (define_insn "vsx_xxmrglw_<mode>"
11497 -  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
11498 +  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
11499         (vec_select:VSX_W
11500           (vec_concat:<VS_double>
11501 -           (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
11502 -           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
11503 +           (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
11504 +           (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
11505           (parallel [(const_int 2) (const_int 6)
11506                      (const_int 3) (const_int 7)])))]
11507    "VECTOR_MEM_VSX_P (<MODE>mode)"
11508 @@ -1841,9 +1881,9 @@
11509  
11510  ;; Shift left double by word immediate
11511  (define_insn "vsx_xxsldwi_<mode>"
11512 -  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
11513 -       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
11514 -                      (match_operand:VSX_L 2 "vsx_register_operand" "wa")
11515 +  [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
11516 +       (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
11517 +                      (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
11518                        (match_operand:QI 3 "u5bit_cint_operand" "i")]
11519                       UNSPEC_VSX_SLDWI))]
11520    "VECTOR_MEM_VSX_P (<MODE>mode)"
11521 @@ -1924,7 +1964,7 @@
11522  ;; to the top element of the V2DF array without doing an extract.
11523  
11524  (define_insn_and_split "*vsx_reduc_<VEC_reduc_name>_v2df_scalar"
11525 -  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?wa,ws,?wa")
11526 +  [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?ws,ws,?ws")
11527         (vec_select:DF
11528          (VEC_reduc:V2DF
11529           (vec_concat:V2DF
11530 Index: gcc/config/rs6000/rs6000.h
11531 ===================================================================
11532 --- gcc/config/rs6000/rs6000.h  (.../tags/gcc_4_8_3_release)    (revision 217117)
11533 +++ gcc/config/rs6000/rs6000.h  (.../branches/gcc-4_8-branch)   (revision 217117)
11534 @@ -1438,6 +1438,10 @@
11535    RS6000_CONSTRAINT_wd,                /* VSX register for V2DF */
11536    RS6000_CONSTRAINT_wf,                /* VSX register for V4SF */
11537    RS6000_CONSTRAINT_wg,                /* FPR register for -mmfpgpr */
11538 +  RS6000_CONSTRAINT_wh,                /* FPR register for direct moves.  */
11539 +  RS6000_CONSTRAINT_wi,                /* FPR/VSX register to hold DImode */
11540 +  RS6000_CONSTRAINT_wj,                /* FPR/VSX register for DImode direct moves. */
11541 +  RS6000_CONSTRAINT_wk,                /* FPR/VSX register for DFmode direct moves. */
11542    RS6000_CONSTRAINT_wl,                /* FPR register for LFIWAX */
11543    RS6000_CONSTRAINT_wm,                /* VSX register for direct move */
11544    RS6000_CONSTRAINT_wr,                /* GPR register if 64-bit  */
11545 @@ -1462,6 +1466,9 @@
11546  #define VSX_REG_CLASS_P(CLASS)                 \
11547    ((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
11548  
11549 +/* Return whether a given register class targets general purpose registers.  */
11550 +#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
11551 +
11552  /* Given an rtx X being reloaded into a reg required to be
11553     in class CLASS, return the class of reg to actually use.
11554     In general this is just CLASS; but on some machines
11555 @@ -1593,8 +1600,15 @@
11556  /* Define this if stack space is still allocated for a parameter passed
11557     in a register.  The value is the number of bytes allocated to this
11558     area.  */
11559 -#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
11560 +#define REG_PARM_STACK_SPACE(FNDECL) \
11561 +  rs6000_reg_parm_stack_space ((FNDECL), false)
11562  
11563 +/* Define this macro if space guaranteed when compiling a function body
11564 +   is different to space required when making a call, a situation that
11565 +   can arise with K&R style function definitions.  */
11566 +#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
11567 +  rs6000_reg_parm_stack_space ((FNDECL), true)
11568 +
11569  /* Define this if the above stack space is to be considered part of the
11570     space allocated by the caller.  */
11571  #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
11572 @@ -2483,8 +2497,8 @@
11573  #define RS6000_BTC_SAT         RS6000_BTC_MISC /* saturate sets VSCR.  */
11574  
11575  /* Builtin targets.  For now, we reuse the masks for those options that are in
11576 -   target flags, and pick two random bits for SPE and paired which aren't in
11577 -   target_flags.  */
11578 +   target flags, and pick three random bits for SPE, paired and ldbl128 which
11579 +   aren't in target_flags.  */
11580  #define RS6000_BTM_ALWAYS      0               /* Always enabled.  */
11581  #define RS6000_BTM_ALTIVEC     MASK_ALTIVEC    /* VMX/altivec vectors.  */
11582  #define RS6000_BTM_VSX         MASK_VSX        /* VSX (vector/scalar).  */
11583 @@ -2501,6 +2515,7 @@
11584  #define RS6000_BTM_CELL                MASK_FPRND      /* Target is cell powerpc.  */
11585  #define RS6000_BTM_DFP         MASK_DFP        /* Decimal floating point.  */
11586  #define RS6000_BTM_HARD_FLOAT  MASK_SOFT_FLOAT /* Hardware floating point.  */
11587 +#define RS6000_BTM_LDBL128     MASK_MULTIPLE   /* 128-bit long double.  */
11588  
11589  #define RS6000_BTM_COMMON      (RS6000_BTM_ALTIVEC                     \
11590                                  | RS6000_BTM_VSX                       \
11591 @@ -2514,7 +2529,8 @@
11592                                  | RS6000_BTM_POPCNTD                   \
11593                                  | RS6000_BTM_CELL                      \
11594                                  | RS6000_BTM_DFP                       \
11595 -                                | RS6000_BTM_HARD_FLOAT)
11596 +                                | RS6000_BTM_HARD_FLOAT                \
11597 +                                | RS6000_BTM_LDBL128)
11598  
11599  /* Define builtin enum index.  */
11600  
11601 Index: gcc/config/rs6000/altivec.md
11602 ===================================================================
11603 --- gcc/config/rs6000/altivec.md        (.../tags/gcc_4_8_3_release)    (revision 217117)
11604 +++ gcc/config/rs6000/altivec.md        (.../branches/gcc-4_8-branch)   (revision 217117)
11605 @@ -2297,7 +2297,31 @@
11606    "dststt %0,%1,%2"
11607    [(set_attr "type" "vecsimple")])
11608  
11609 -(define_insn "altivec_lvsl"
11610 +(define_expand "altivec_lvsl"
11611 +  [(use (match_operand:V16QI 0 "register_operand" ""))
11612 +   (use (match_operand:V16QI 1 "memory_operand" ""))]
11613 +  "TARGET_ALTIVEC"
11614 +{
11615 +  if (VECTOR_ELT_ORDER_BIG)
11616 +    emit_insn (gen_altivec_lvsl_direct (operands[0], operands[1]));
11617 +  else
11618 +    {
11619 +      int i;
11620 +      rtx mask, perm[16], constv, vperm;
11621 +      mask = gen_reg_rtx (V16QImode);
11622 +      emit_insn (gen_altivec_lvsl_direct (mask, operands[1]));
11623 +      for (i = 0; i < 16; ++i)
11624 +        perm[i] = GEN_INT (i);
11625 +      constv = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, perm));
11626 +      constv = force_reg (V16QImode, constv);
11627 +      vperm = gen_rtx_UNSPEC (V16QImode, gen_rtvec (3, mask, mask, constv),
11628 +                              UNSPEC_VPERM);
11629 +      emit_insn (gen_rtx_SET (VOIDmode, operands[0], vperm));
11630 +    }
11631 +  DONE;
11632 +})
11633 +
11634 +(define_insn "altivec_lvsl_direct"
11635    [(set (match_operand:V16QI 0 "register_operand" "=v")
11636         (unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "Z")]
11637                       UNSPEC_LVSL))]
11638 @@ -2305,7 +2329,31 @@
11639    "lvsl %0,%y1"
11640    [(set_attr "type" "vecload")])
11641  
11642 -(define_insn "altivec_lvsr"
11643 +(define_expand "altivec_lvsr"
11644 +  [(use (match_operand:V16QI 0 "register_operand" ""))
11645 +   (use (match_operand:V16QI 1 "memory_operand" ""))]
11646 +  "TARGET_ALTIVEC"
11647 +{
11648 +  if (VECTOR_ELT_ORDER_BIG)
11649 +    emit_insn (gen_altivec_lvsr_direct (operands[0], operands[1]));
11650 +  else
11651 +    {
11652 +      int i;
11653 +      rtx mask, perm[16], constv, vperm;
11654 +      mask = gen_reg_rtx (V16QImode);
11655 +      emit_insn (gen_altivec_lvsr_direct (mask, operands[1]));
11656 +      for (i = 0; i < 16; ++i)
11657 +        perm[i] = GEN_INT (i);
11658 +      constv = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, perm));
11659 +      constv = force_reg (V16QImode, constv);
11660 +      vperm = gen_rtx_UNSPEC (V16QImode, gen_rtvec (3, mask, mask, constv),
11661 +                              UNSPEC_VPERM);
11662 +      emit_insn (gen_rtx_SET (VOIDmode, operands[0], vperm));
11663 +    }
11664 +  DONE;
11665 +})
11666 +
11667 +(define_insn "altivec_lvsr_direct"
11668    [(set (match_operand:V16QI 0 "register_operand" "=v")
11669         (unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "Z")]
11670                       UNSPEC_LVSR))]
11671 Index: gcc/config/rs6000/rs6000.md
11672 ===================================================================
11673 --- gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_3_release)    (revision 217117)
11674 +++ gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch)   (revision 217117)
11675 @@ -134,6 +134,7 @@
11676     UNSPEC_UNPACK_128BIT
11677     UNSPEC_PACK_128BIT
11678     UNSPEC_LSQ
11679 +   UNSPEC_FUSION_GPR
11680    ])
11681  
11682  ;;
11683 @@ -317,8 +318,25 @@
11684  (define_mode_attr f32_sv [(SF "stxsspx %x1,%y0")  (SD "stxsiwzx %x1,%y0")])
11685  
11686  ; Definitions for 32-bit fpr direct move
11687 -(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
11688 +; At present, the decimal modes are not allowed in the traditional altivec
11689 +; registers, so restrict the constraints to just the traditional FPRs.
11690 +(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
11691  
11692 +; Definitions for 32-bit VSX
11693 +(define_mode_attr f32_vsx [(SF "ww") (SD "wn")])
11694 +
11695 +; Definitions for 32-bit use of altivec registers
11696 +(define_mode_attr f32_av  [(SF "wu") (SD "wn")])
11697 +
11698 +; Definitions for 64-bit VSX
11699 +(define_mode_attr f64_vsx [(DF "ws") (DD "wn")])
11700 +
11701 +; Definitions for 64-bit direct move
11702 +(define_mode_attr f64_dm  [(DF "wk") (DD "wh")])
11703 +
11704 +; Definitions for 64-bit use of altivec registers
11705 +(define_mode_attr f64_av  [(DF "wv") (DD "wn")])
11706 +
11707  ; These modes do not fit in integer registers in 32-bit mode.
11708  ; but on e500v2, the gpr are 64 bit registers
11709  (define_mode_iterator DIFD [DI (DF "!TARGET_E500_DOUBLE") DD])
11710 @@ -424,7 +442,7 @@
11711  ;; either.
11712  
11713  ;; Mode attribute for boolean operation register constraints for output
11714 -(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wa,v")
11715 +(define_mode_attr BOOL_REGS_OUTPUT     [(TI    "&r,r,r,wt,v")
11716                                          (PTI   "&r,r,r")
11717                                          (V16QI "wa,v,&?r,?r,?r")
11718                                          (V8HI  "wa,v,&?r,?r,?r")
11719 @@ -435,7 +453,7 @@
11720                                          (V1TI  "wa,v,&?r,?r,?r")])
11721  
11722  ;; Mode attribute for boolean operation register constraints for operand1
11723 -(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wa,v")
11724 +(define_mode_attr BOOL_REGS_OP1                [(TI    "r,0,r,wt,v")
11725                                          (PTI   "r,0,r")
11726                                          (V16QI "wa,v,r,0,r")
11727                                          (V8HI  "wa,v,r,0,r")
11728 @@ -446,7 +464,7 @@
11729                                          (V1TI  "wa,v,r,0,r")])
11730  
11731  ;; Mode attribute for boolean operation register constraints for operand2
11732 -(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wa,v")
11733 +(define_mode_attr BOOL_REGS_OP2                [(TI    "r,r,0,wt,v")
11734                                          (PTI   "r,r,0")
11735                                          (V16QI "wa,v,r,r,0")
11736                                          (V8HI  "wa,v,r,r,0")
11737 @@ -459,7 +477,7 @@
11738  ;; Mode attribute for boolean operation register constraints for operand1
11739  ;; for one_cmpl.  To simplify things, we repeat the constraint where 0
11740  ;; is used for operand1 or operand2
11741 -(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wa,v")
11742 +(define_mode_attr BOOL_REGS_UNARY      [(TI    "r,0,0,wt,v")
11743                                          (PTI   "r,0,0")
11744                                          (V16QI "wa,v,r,0,0")
11745                                          (V8HI  "wa,v,r,0,0")
11746 @@ -566,7 +584,7 @@
11747    "")
11748  
11749  (define_insn "*zero_extendsidi2_lfiwzx"
11750 -  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
11751 +  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
11752         (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
11753    "TARGET_POWERPC64 && TARGET_LFIWZX"
11754    "@
11755 @@ -736,8 +754,8 @@
11756    "")
11757  
11758  (define_insn "*extendsidi2_lfiwax"
11759 -  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
11760 -       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
11761 +  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
11762 +       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
11763    "TARGET_POWERPC64 && TARGET_LFIWAX"
11764    "@
11765     lwa%U1%X1 %0,%1
11766 @@ -760,7 +778,7 @@
11767  
11768  (define_insn "*extendsidi2_nocell"
11769    [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11770 -       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
11771 +       (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
11772    "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
11773    "@
11774     lwa%U1%X1 %0,%1
11775 @@ -5614,7 +5632,7 @@
11776  ; We don't define lfiwax/lfiwzx with the normal definition, because we
11777  ; don't want to support putting SImode in FPR registers.
11778  (define_insn "lfiwax"
11779 -  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
11780 +  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
11781         (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
11782                    UNSPEC_LFIWAX))]
11783    "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
11784 @@ -5694,7 +5712,7 @@
11785     (set_attr "type" "fpload")])
11786  
11787  (define_insn "lfiwzx"
11788 -  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
11789 +  [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
11790         (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
11791                    UNSPEC_LFIWZX))]
11792    "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
11793 @@ -9210,8 +9228,8 @@
11794  }")
11795  
11796  (define_insn "mov<mode>_hardfloat"
11797 -  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,wu,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
11798 -       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,Z,wu,r,<f32_dm>,r,h,0,G,Fn"))]
11799 +  [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,<f32_lr>,<f32_sm>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
11800 +       (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,j,<f32_lm>,<f32_sr>,Z,<f32_av>,r,<f32_dm>,r, h, 0, G,Fn"))]
11801    "(gpc_reg_operand (operands[0], <MODE>mode)
11802     || gpc_reg_operand (operands[1], <MODE>mode))
11803     && (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
11804 @@ -9422,8 +9440,8 @@
11805  ;; reloading.
11806  
11807  (define_insn "*mov<mode>_hardfloat32"
11808 -  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,!r,!r,!r")
11809 -       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,G,H,F"))]
11810 +  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,!r,!r,!r")
11811 +       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,G,H,F"))]
11812    "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT 
11813     && (gpc_reg_operand (operands[0], <MODE>mode)
11814         || gpc_reg_operand (operands[1], <MODE>mode))"
11815 @@ -9491,8 +9509,8 @@
11816  ; ld/std require word-aligned displacements -> 'Y' constraint.
11817  ; List Y->r and r->Y before r->r for reload.
11818  (define_insn "*mov<mode>_hardfloat64"
11819 -  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wm")
11820 -       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wm,r"))]
11821 +  [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,<f64_dm>")
11822 +       (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,r,h,0,G,H,F,wg,r,<f64_dm>,r"))]
11823    "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
11824     && (gpc_reg_operand (operands[0], <MODE>mode)
11825         || gpc_reg_operand (operands[1], <MODE>mode))"
11826 @@ -10272,8 +10290,8 @@
11827  { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
11828  
11829  (define_insn "*movdi_internal64"
11830 -  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
11831 -       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
11832 +  [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
11833 +       (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
11834    "TARGET_POWERPC64
11835     && (gpc_reg_operand (operands[0], DImode)
11836         || gpc_reg_operand (operands[1], DImode))"
11837 @@ -10293,7 +10311,8 @@
11838     mftgpr %0,%1
11839     mffgpr %0,%1
11840     mfvsrd %0,%x1
11841 -   mtvsrd %x0,%1"
11842 +   mtvsrd %x0,%1
11843 +   xxlxor %x0,%x0,%x0"
11844    [(set_attr_alternative "type"
11845        [(if_then_else
11846          (match_test "update_indexed_address_mem (operands[0], VOIDmode)")
11847 @@ -10334,8 +10353,9 @@
11848         (const_string "mftgpr")
11849         (const_string "mffgpr")
11850         (const_string "mftgpr")
11851 -       (const_string "mffgpr")])
11852 -   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
11853 +       (const_string "mffgpr")
11854 +       (const_string "vecsimple")])
11855 +   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
11856  
11857  ;; immediate value valid for a single instruction hiding in a const_double
11858  (define_insn ""
11859 @@ -15751,23 +15771,10 @@
11860  ;; a GPR.  The addis instruction must be adjacent to the load, and use the same
11861  ;; register that is being loaded.  The fused ops must be physically adjacent.
11862  
11863 -;; We use define_peephole for the actual addis/load, and the register used to
11864 -;; hold the addis value must be the same as the register being loaded.  We use
11865 -;; define_peephole2 to change the register used for addis to be the register
11866 -;; being loaded, since we can look at whether it is dead after the load insn.
11867 +;; Find cases where the addis that feeds into a load instruction is either used
11868 +;; once or is the same as the target register, and replace it with the fusion
11869 +;; insn
11870  
11871 -(define_peephole
11872 -  [(set (match_operand:P 0 "base_reg_operand" "")
11873 -       (match_operand:P 1 "fusion_gpr_addis" ""))
11874 -   (set (match_operand:INT1 2 "base_reg_operand" "")
11875 -       (match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
11876 -  "TARGET_P8_FUSION && fusion_gpr_load_p (operands, false)"
11877 -{
11878 -  return emit_fusion_gpr_load (operands);
11879 -}
11880 -  [(set_attr "type" "load")
11881 -   (set_attr "length" "8")])
11882 -
11883  (define_peephole2
11884    [(set (match_operand:P 0 "base_reg_operand" "")
11885         (match_operand:P 1 "fusion_gpr_addis" ""))
11886 @@ -15774,9 +15781,8 @@
11887     (set (match_operand:INT1 2 "base_reg_operand" "")
11888         (match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
11889    "TARGET_P8_FUSION
11890 -   && (REGNO (operands[0]) != REGNO (operands[2])
11891 -       || GET_CODE (operands[3]) == SIGN_EXTEND)
11892 -   && fusion_gpr_load_p (operands, true)"
11893 +   && fusion_gpr_load_p (operands[0], operands[1], operands[2],
11894 +                        operands[3])"
11895    [(const_int 0)]
11896  {
11897    expand_fusion_gpr_load (operands);
11898 @@ -15783,6 +15789,20 @@
11899    DONE;
11900  })
11901  
11902 +;; Fusion insn, created by the define_peephole2 above (and eventually by
11903 +;; reload)
11904 +
11905 +(define_insn "fusion_gpr_load_<mode>"
11906 +  [(set (match_operand:INT1 0 "base_reg_operand" "=&b")
11907 +       (unspec:INT1 [(match_operand:INT1 1 "fusion_gpr_mem_combo" "")]
11908 +                    UNSPEC_FUSION_GPR))]
11909 +  "TARGET_P8_FUSION"
11910 +{
11911 +  return emit_fusion_gpr_load (operands[0], operands[1]);
11912 +}
11913 +  [(set_attr "type" "load")
11914 +   (set_attr "length" "8")])
11915 +
11916  \f
11917  ;; Miscellaneous ISA 2.06 (power7) instructions
11918  (define_insn "addg6s"
11919 @@ -15847,26 +15867,6 @@
11920    ""
11921    "")
11922  
11923 -;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
11924 -;; and __builtin_longdouble_dw1 to optimize glibc.  Add support for these
11925 -;; builtins here.
11926 -
11927 -(define_expand "unpacktf_0"
11928 -  [(set (match_operand:DF 0 "nonimmediate_operand" "")
11929 -       (unspec:DF [(match_operand:TF 1 "register_operand" "")
11930 -                   (const_int 0)]
11931 -        UNSPEC_UNPACK_128BIT))]
11932 -  ""
11933 -  "")
11934 -
11935 -(define_expand "unpacktf_1"
11936 -  [(set (match_operand:DF 0 "nonimmediate_operand" "")
11937 -       (unspec:DF [(match_operand:TF 1 "register_operand" "")
11938 -                   (const_int 1)]
11939 -        UNSPEC_UNPACK_128BIT))]
11940 -  ""
11941 -  "")
11942 -
11943  (define_insn_and_split "unpack<mode>_dm"
11944    [(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
11945         (unspec:<FP128_64>
11946 Index: gcc/config/rs6000/sysv4.h
11947 ===================================================================
11948 --- gcc/config/rs6000/sysv4.h   (.../tags/gcc_4_8_3_release)    (revision 217117)
11949 +++ gcc/config/rs6000/sysv4.h   (.../branches/gcc-4_8-branch)   (revision 217117)
11950 @@ -292,7 +292,7 @@
11951  /* An expression for the alignment of a structure field FIELD if the
11952     alignment computed in the usual way is COMPUTED.  */
11953  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                  \
11954 -       ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
11955 +       (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))            \
11956          ? 128 : COMPUTED)
11957  
11958  #undef  BIGGEST_FIELD_ALIGNMENT
11959 @@ -949,3 +949,27 @@
11960  #define TARGET_USES_SYSV4_OPT 1
11961  
11962  #undef DBX_REGISTER_NUMBER
11963 +
11964 +/* Link -lasan early on the command line.  For -static-libasan, don't link
11965 +   it for -shared link, the executable should be compiled with -static-libasan
11966 +   in that case, and for executable link link with --{,no-}whole-archive around
11967 +   it to force everything into the executable.  And similarly for -ltsan.  */
11968 +#if defined(HAVE_LD_STATIC_DYNAMIC)
11969 +#undef LIBASAN_EARLY_SPEC
11970 +#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
11971 +  "%{static-libasan:%{!shared:" \
11972 +  LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
11973 +  LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
11974 +#undef LIBTSAN_EARLY_SPEC
11975 +#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
11976 +  LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
11977 +  LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
11978 +#endif
11979 +
11980 +/* Additional libraries needed by -static-libasan.  */
11981 +#undef STATIC_LIBASAN_LIBS
11982 +#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
11983 +
11984 +/* Additional libraries needed by -static-libtsan.  */
11985 +#undef STATIC_LIBTSAN_LIBS
11986 +#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
11987 Index: gcc/config/arm/arm.c
11988 ===================================================================
11989 --- gcc/config/arm/arm.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
11990 +++ gcc/config/arm/arm.c        (.../branches/gcc-4_8-branch)   (revision 217117)
11991 @@ -82,7 +82,6 @@
11992  static reg_class_t arm_preferred_reload_class (rtx, reg_class_t);
11993  static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
11994  inline static int thumb1_index_register_rtx_p (rtx, int);
11995 -static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
11996  static int thumb_far_jump_used_p (void);
11997  static bool thumb_force_lr_save (void);
11998  static unsigned arm_size_return_regs (void);
11999 @@ -24476,9 +24475,13 @@
12000        fputs (":\n", file);
12001        if (flag_pic)
12002         {
12003 -         /* Output ".word .LTHUNKn-7-.LTHUNKPCn".  */
12004 +         /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn".  */
12005           rtx tem = XEXP (DECL_RTL (function), 0);
12006 -         tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
12007 +         /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
12008 +            pipeline offset is four rather than eight.  Adjust the offset
12009 +            accordingly.  */
12010 +         tem = plus_constant (GET_MODE (tem), tem,
12011 +                              TARGET_THUMB1_ONLY ? -3 : -7);
12012           tem = gen_rtx_MINUS (GET_MODE (tem),
12013                                tem,
12014                                gen_rtx_SYMBOL_REF (Pmode,
12015 @@ -27462,4 +27465,13 @@
12016  
12017  }
12018  
12019 +/* return TRUE if x is a reference to a value in a constant pool */
12020 +extern bool
12021 +arm_is_constant_pool_ref (rtx x)
12022 +{
12023 +  return (MEM_P (x)
12024 +         && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
12025 +         && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
12026 +}
12027 +
12028  #include "gt-arm.h"
12029 Index: gcc/config/arm/arm-protos.h
12030 ===================================================================
12031 --- gcc/config/arm/arm-protos.h (.../tags/gcc_4_8_3_release)    (revision 217117)
12032 +++ gcc/config/arm/arm-protos.h (.../branches/gcc-4_8-branch)   (revision 217117)
12033 @@ -55,6 +55,7 @@
12034  extern int legitimate_pic_operand_p (rtx);
12035  extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
12036  extern rtx legitimize_tls_address (rtx, rtx);
12037 +extern bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
12038  extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
12039  extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
12040  extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
12041 @@ -286,4 +287,6 @@
12042  
12043  extern void arm_emit_eabi_attribute (const char *, int, int);
12044  
12045 +extern bool arm_is_constant_pool_ref (rtx);
12046 +
12047  #endif /* ! GCC_ARM_PROTOS_H */
12048 Index: gcc/config/arm/constraints.md
12049 ===================================================================
12050 --- gcc/config/arm/constraints.md       (.../tags/gcc_4_8_3_release)    (revision 217117)
12051 +++ gcc/config/arm/constraints.md       (.../branches/gcc-4_8-branch)   (revision 217117)
12052 @@ -36,7 +36,7 @@
12053  ;; in Thumb-2 state: Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py
12054  
12055  ;; The following memory constraints have been used:
12056 -;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Um, Us
12057 +;; in ARM/Thumb-2 state: Q, Uh, Ut, Uv, Uy, Un, Um, Us
12058  ;; in ARM state: Uq
12059  ;; in Thumb state: Uu, Uw
12060  
12061 @@ -310,6 +310,12 @@
12062    An address valid for loading/storing register exclusive"
12063   (match_operand 0 "mem_noofs_operand"))
12064  
12065 +(define_memory_constraint "Uh"
12066 + "@internal
12067 +  An address suitable for byte and half-word loads which does not point inside a constant pool"
12068 + (and (match_code "mem")
12069 +      (match_test "arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), false) && !arm_is_constant_pool_ref (op)")))
12070 +
12071  (define_memory_constraint "Ut"
12072   "@internal
12073    In ARM/Thumb-2 state an address valid for loading/storing opaque structure
12074 @@ -356,7 +362,8 @@
12075   (and (match_code "mem")
12076        (match_test "TARGET_ARM
12077                    && arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
12078 -                                                     SIGN_EXTEND, 0)")))
12079 +                                                     SIGN_EXTEND, 0)
12080 +                  && !arm_is_constant_pool_ref (op)")))
12081  
12082  (define_memory_constraint "Q"
12083   "@internal
12084 Index: gcc/config/arm/arm.md
12085 ===================================================================
12086 --- gcc/config/arm/arm.md       (.../tags/gcc_4_8_3_release)    (revision 217117)
12087 +++ gcc/config/arm/arm.md       (.../branches/gcc-4_8-branch)   (revision 217117)
12088 @@ -4047,7 +4047,7 @@
12089  (define_insn "unaligned_loadhis"
12090    [(set (match_operand:SI 0 "s_register_operand" "=l,r")
12091         (sign_extend:SI
12092 -         (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
12093 +         (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,Uh")]
12094                      UNSPEC_UNALIGNED_LOAD)))]
12095    "unaligned_access && TARGET_32BIT"
12096    "ldr%(sh%)\t%0, %1\t@ unaligned"
12097 @@ -4655,7 +4655,7 @@
12098  
12099  (define_insn "*arm_zero_extendhisi2_v6"
12100    [(set (match_operand:SI 0 "s_register_operand" "=r,r")
12101 -       (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
12102 +       (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
12103    "TARGET_ARM && arm_arch6"
12104    "@
12105     uxth%?\\t%0, %1
12106 @@ -4748,7 +4748,7 @@
12107  
12108  (define_insn "*arm_zero_extendqisi2_v6"
12109    [(set (match_operand:SI 0 "s_register_operand" "=r,r")
12110 -       (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
12111 +       (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uh")))]
12112    "TARGET_ARM && arm_arch6"
12113    "@
12114     uxtb%(%)\\t%0, %1
12115 @@ -4980,7 +4980,7 @@
12116  
12117  (define_insn "*arm_extendhisi2"
12118    [(set (match_operand:SI 0 "s_register_operand" "=r,r")
12119 -       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
12120 +       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
12121    "TARGET_ARM && arm_arch4 && !arm_arch6"
12122    "@
12123     #
12124 @@ -4987,23 +4987,19 @@
12125     ldr%(sh%)\\t%0, %1"
12126    [(set_attr "length" "8,4")
12127     (set_attr "type" "alu_shift,load_byte")
12128 -   (set_attr "predicable" "yes")
12129 -   (set_attr "pool_range" "*,256")
12130 -   (set_attr "neg_pool_range" "*,244")]
12131 +   (set_attr "predicable" "yes")]
12132  )
12133  
12134  ;; ??? Check Thumb-2 pool range
12135  (define_insn "*arm_extendhisi2_v6"
12136    [(set (match_operand:SI 0 "s_register_operand" "=r,r")
12137 -       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
12138 +       (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
12139    "TARGET_32BIT && arm_arch6"
12140    "@
12141     sxth%?\\t%0, %1
12142     ldr%(sh%)\\t%0, %1"
12143    [(set_attr "type" "simple_alu_shift,load_byte")
12144 -   (set_attr "predicable" "yes")
12145 -   (set_attr "pool_range" "*,256")
12146 -   (set_attr "neg_pool_range" "*,244")]
12147 +   (set_attr "predicable" "yes")]
12148  )
12149  
12150  (define_insn "*arm_extendhisi2addsi"
12151 @@ -5045,9 +5041,7 @@
12152    "TARGET_ARM && arm_arch4"
12153    "ldr%(sb%)\\t%0, %1"
12154    [(set_attr "type" "load_byte")
12155 -   (set_attr "predicable" "yes")
12156 -   (set_attr "pool_range" "256")
12157 -   (set_attr "neg_pool_range" "244")]
12158 +   (set_attr "predicable" "yes")]
12159  )
12160  
12161  (define_expand "extendqisi2"
12162 @@ -5087,9 +5081,7 @@
12163     ldr%(sb%)\\t%0, %1"
12164    [(set_attr "length" "8,4")
12165     (set_attr "type" "alu_shift,load_byte")
12166 -   (set_attr "predicable" "yes")
12167 -   (set_attr "pool_range" "*,256")
12168 -   (set_attr "neg_pool_range" "*,244")]
12169 +   (set_attr "predicable" "yes")]
12170  )
12171  
12172  (define_insn "*arm_extendqisi_v6"
12173 @@ -5101,9 +5093,7 @@
12174     sxtb%?\\t%0, %1
12175     ldr%(sb%)\\t%0, %1"
12176    [(set_attr "type" "simple_alu_shift,load_byte")
12177 -   (set_attr "predicable" "yes")
12178 -   (set_attr "pool_range" "*,256")
12179 -   (set_attr "neg_pool_range" "*,244")]
12180 +   (set_attr "predicable" "yes")]
12181  )
12182  
12183  (define_insn "*arm_extendqisi2addsi"
12184 @@ -7630,12 +7620,13 @@
12185  
12186  (define_insn "*arm_cmpdi_unsigned"
12187    [(set (reg:CC_CZ CC_REGNUM)
12188 -       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
12189 -                      (match_operand:DI 1 "arm_di_operand"     "rDi")))]
12190 +       (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
12191 +                      (match_operand:DI 1 "arm_di_operand"     "rDi,rDi")))]
12192    "TARGET_32BIT"
12193    "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
12194    [(set_attr "conds" "set")
12195 -   (set_attr "length" "8")]
12196 +   (set_attr "arch" "a,t2")
12197 +   (set_attr "length" "8,10")]
12198  )
12199  
12200  (define_insn "*arm_cmpdi_zero"
12201 Index: gcc/config/arm/t-rtems-eabi
12202 ===================================================================
12203 --- gcc/config/arm/t-rtems-eabi (.../tags/gcc_4_8_3_release)    (revision 217117)
12204 +++ gcc/config/arm/t-rtems-eabi (.../branches/gcc-4_8-branch)   (revision 217117)
12205 @@ -1,47 +1,167 @@
12206  # Custom RTEMS EABI multilibs
12207  
12208 -MULTILIB_OPTIONS  = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
12209 -MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
12210 +MULTILIB_OPTIONS  = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard
12211 +MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
12212  
12213  # Enumeration of multilibs
12214  
12215  MULTILIB_EXCEPTIONS =
12216 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
12217 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
12218 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
12219 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
12220 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12221 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
12222 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
12223 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
12224 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
12225 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
12226 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
12227 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
12228 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
12229 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
12230 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
12231 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
12232 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
12233 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
12234 +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
12235 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
12236 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
12237 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
12238 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
12239 +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
12240 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
12241 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
12242 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
12243 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
12244 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12245 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
12246 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
12247 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
12248 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
12249 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
12250 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
12251 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
12252 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
12253 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
12254 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
12255 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb
12256 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
12257 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
12258 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
12259 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
12260 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12261 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
12262 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
12263 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
12264 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
12265 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
12266 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
12267 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
12268 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
12269 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
12270 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
12271 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
12272 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
12273 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
12274 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
12275 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
12276 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
12277 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
12278 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
12279 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
12280 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
12281 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
12282 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
12283 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
12284 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12285 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
12286 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
12287 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
12288 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
12289 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
12290 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
12291 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
12292 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
12293 +MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
12294 +MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
12295 +MULTILIB_EXCEPTIONS += mbig-endian
12296  MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
12297  MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
12298 +MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
12299 +MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
12300 +MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12301 +MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
12302  MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
12303  # MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
12304  # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
12305  MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
12306 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
12307 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
12308 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
12309 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
12310  MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
12311  # MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
12312  MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
12313  MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
12314 +# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
12315 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
12316 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
12317 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
12318  MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
12319  # MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
12320  MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
12321  MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
12322 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
12323 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
12324 +# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12325 +MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
12326  MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
12327  # MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
12328  MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
12329  MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
12330 +MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
12331 +MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
12332 +MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
12333 +MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
12334  MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
12335  # MULTILIB_EXCEPTIONS += mthumb
12336  MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
12337  MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
12338 +MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
12339 +MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
12340 +MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12341 +MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
12342  MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
12343  MULTILIB_EXCEPTIONS += march=armv6-m
12344  MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
12345  MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
12346 +MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
12347 +MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
12348 +MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
12349 +MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
12350  MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
12351  MULTILIB_EXCEPTIONS += march=armv7-a
12352  MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
12353  MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
12354 +MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
12355 +MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
12356 +MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
12357 +MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
12358  MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
12359  MULTILIB_EXCEPTIONS += march=armv7-r
12360  MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
12361  MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
12362 +MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
12363 +MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
12364 +MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
12365 +MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
12366  MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
12367  MULTILIB_EXCEPTIONS += march=armv7-m
12368  MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
12369  MULTILIB_EXCEPTIONS += mfpu=neon
12370 +MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
12371 +MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
12372 +MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
12373 +MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
12374  MULTILIB_EXCEPTIONS += mfloat-abi=hard
12375 Index: gcc/config/pa/pa.c
12376 ===================================================================
12377 --- gcc/config/pa/pa.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
12378 +++ gcc/config/pa/pa.c  (.../branches/gcc-4_8-branch)   (revision 217117)
12379 @@ -3237,7 +3237,12 @@
12380        && aligned_p
12381        && function_label_operand (x, VOIDmode))
12382      {
12383 -      fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
12384 +      fputs (size == 8? "\t.dword\t" : "\t.word\t", asm_out_file);
12385 +
12386 +      /* We don't want an OPD when generating fast indirect calls.  */
12387 +      if (!TARGET_FAST_INDIRECT_CALLS)
12388 +       fputs ("P%", asm_out_file);
12389 +
12390        output_addr_const (asm_out_file, x);
12391        fputc ('\n', asm_out_file);
12392        return true;
12393 @@ -4160,9 +4165,8 @@
12394  pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
12395  {
12396    rtx insn = get_last_insn ();
12397 +  bool extra_nop;
12398  
12399 -  last_address = 0;
12400 -
12401    /* pa_expand_epilogue does the dirty work now.  We just need
12402       to output the assembler directives which denote the end
12403       of a function.
12404 @@ -4185,14 +4189,16 @@
12405    if (insn && GET_CODE (insn) == CALL_INSN)
12406      {
12407        fputs ("\tnop\n", file);
12408 -      last_address += 4;
12409 +      extra_nop = true;
12410      }
12411 +  else
12412 +    extra_nop = false;
12413  
12414    fputs ("\t.EXIT\n\t.PROCEND\n", file);
12415  
12416    if (TARGET_SOM && TARGET_GAS)
12417      {
12418 -      /* We done with this subspace except possibly for some additional
12419 +      /* We are done with this subspace except possibly for some additional
12420          debug information.  Forget that we are in this subspace to ensure
12421          that the next function is output in its own subspace.  */
12422        in_section = NULL;
12423 @@ -4199,12 +4205,20 @@
12424        cfun->machine->in_nsubspa = 2;
12425      }
12426  
12427 +  /* Thunks do their own insn accounting.  */
12428 +  if (cfun->is_thunk)
12429 +    return;
12430 +
12431    if (INSN_ADDRESSES_SET_P ())
12432      {
12433 +      last_address = extra_nop ? 4 : 0;
12434        insn = get_last_nonnote_insn ();
12435 -      last_address += INSN_ADDRESSES (INSN_UID (insn));
12436 -      if (INSN_P (insn))
12437 -       last_address += insn_default_length (insn);
12438 +      if (insn)
12439 +       {
12440 +         last_address += INSN_ADDRESSES (INSN_UID (insn));
12441 +         if (INSN_P (insn))
12442 +           last_address += insn_default_length (insn);
12443 +       }
12444        last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)
12445                       & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1));
12446      }
12447 @@ -8270,8 +8284,7 @@
12448    xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
12449    xoperands[2] = GEN_INT (delta);
12450  
12451 -  ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
12452 -  fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
12453 +  final_start_function (emit_barrier (), file, 1);
12454  
12455    /* Output the thunk.  We know that the function is in the same
12456       translation unit (i.e., the same space) as the thunk, and that
12457 @@ -8301,12 +8314,16 @@
12458                    || ((DECL_SECTION_NAME (thunk_fndecl)
12459                         == DECL_SECTION_NAME (function))
12460                        && last_address < 262132)))
12461 +             /* In this case, we need to be able to reach the start of
12462 +                the stub table even though the function is likely closer
12463 +                and can be jumped to directly.  */
12464               || (targetm_common.have_named_sections
12465                   && DECL_SECTION_NAME (thunk_fndecl) == NULL
12466                   && DECL_SECTION_NAME (function) == NULL
12467 -                 && last_address < 262132)
12468 +                 && total_code_bytes < MAX_PCREL17F_OFFSET)
12469 +             /* Likewise.  */
12470               || (!targetm_common.have_named_sections
12471 -                 && last_address < 262132))))
12472 +                 && total_code_bytes < MAX_PCREL17F_OFFSET))))
12473      {
12474        if (!val_14)
12475         output_asm_insn ("addil L'%2,%%r26", xoperands);
12476 @@ -8477,17 +8494,8 @@
12477         }
12478      }
12479  
12480 -  fprintf (file, "\t.EXIT\n\t.PROCEND\n");
12481 +  final_end_function ();
12482  
12483 -  if (TARGET_SOM && TARGET_GAS)
12484 -    {
12485 -      /* We done with this subspace except possibly for some additional
12486 -        debug information.  Forget that we are in this subspace to ensure
12487 -        that the next function is output in its own subspace.  */
12488 -      in_section = NULL;
12489 -      cfun->machine->in_nsubspa = 2;
12490 -    }
12491 -
12492    if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
12493      {
12494        switch_to_section (data_section);
12495 Index: gcc/tree-vect-slp.c
12496 ===================================================================
12497 --- gcc/tree-vect-slp.c (.../tags/gcc_4_8_3_release)    (revision 217117)
12498 +++ gcc/tree-vect-slp.c (.../branches/gcc-4_8-branch)   (revision 217117)
12499 @@ -1837,7 +1837,10 @@
12500             && (stmt_vinfo = vinfo_for_stmt (use_stmt))
12501             && !STMT_SLP_TYPE (stmt_vinfo)
12502              && (STMT_VINFO_RELEVANT (stmt_vinfo)
12503 -                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))
12504 +                || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))
12505 +               || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
12506 +                   && STMT_VINFO_RELATED_STMT (stmt_vinfo)
12507 +                   && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo)))))
12508             && !(gimple_code (use_stmt) == GIMPLE_PHI
12509                   && STMT_VINFO_DEF_TYPE (stmt_vinfo)
12510                    == vect_reduction_def))
12511 Index: gcc/regcprop.c
12512 ===================================================================
12513 --- gcc/regcprop.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
12514 +++ gcc/regcprop.c      (.../branches/gcc-4_8-branch)   (revision 217117)
12515 @@ -1039,7 +1039,17 @@
12516              but instead among CLOBBERs on the CALL_INSN, we could wrongly
12517              assume the value in it is still live.  */
12518           if (ksvd.ignore_set_reg)
12519 -           note_stores (PATTERN (insn), kill_clobbered_value, vd);
12520 +           {
12521 +             note_stores (PATTERN (insn), kill_clobbered_value, vd);
12522 +             for (exp = CALL_INSN_FUNCTION_USAGE (insn);
12523 +                  exp;
12524 +                  exp = XEXP (exp, 1))
12525 +               {
12526 +                 rtx x = XEXP (exp, 0);
12527 +                 if (GET_CODE (x) == CLOBBER)
12528 +                   kill_value (SET_DEST (x), vd);
12529 +               }
12530 +           }
12531         }
12532  
12533        /* Notice stores.  */
12534 Index: libobjc/encoding.c
12535 ===================================================================
12536 --- libobjc/encoding.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
12537 +++ libobjc/encoding.c  (.../branches/gcc-4_8-branch)   (revision 217117)
12538 @@ -192,6 +192,8 @@
12539     ? MAX (MAX (COMPUTED, SPECIFIED), 64)                               \
12540     : MAX (COMPUTED, SPECIFIED));})
12541  
12542 +#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
12543 + (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
12544  
12545  /* Skip a variable name, enclosed in quotes (").  */
12546  static inline
12547 Index: libobjc/ChangeLog
12548 ===================================================================
12549 --- libobjc/ChangeLog   (.../tags/gcc_4_8_3_release)    (revision 217117)
12550 +++ libobjc/ChangeLog   (.../branches/gcc-4_8-branch)   (revision 217117)
12551 @@ -1,3 +1,16 @@
12552 +2014-07-27  Ulrich Weigand  <uweigand@de.ibm.com>
12553 +
12554 +       PR libobjc/61920
12555 +       * encoding.c (rs6000_special_adjust_field_align_p): Use definition
12556 +       that matches the 4.8 branch ABI.
12557 +
12558 +2014-07-27  Alan Modra  <amodra@gmail.com>
12559 +           Matthias Klose  <doko@ubuntu.com>
12560 +
12561 +       PR libobjc/61920
12562 +
12563 +       * encoding.c: Define rs6000_special_adjust_field_align_p.
12564 +
12565  2014-05-22  Release Manager
12566  
12567         * GCC 4.8.3 released.
12568 Index: libgfortran/m4/in_pack.m4
12569 ===================================================================
12570 --- libgfortran/m4/in_pack.m4   (.../tags/gcc_4_8_3_release)    (revision 217117)
12571 +++ libgfortran/m4/in_pack.m4   (.../branches/gcc-4_8-branch)   (revision 217117)
12572 @@ -79,7 +79,7 @@
12573      return source->base_addr;
12574  
12575    /* Allocate storage for the destination.  */
12576 -  destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
12577 +  destptr = xmallocarray (ssize, sizeof ('rtype_name`));
12578    dest = destptr;
12579    src = source->base_addr;
12580    stride0 = stride[0];
12581 Index: libgfortran/m4/pack.m4
12582 ===================================================================
12583 --- libgfortran/m4/pack.m4      (.../tags/gcc_4_8_3_release)    (revision 217117)
12584 +++ libgfortran/m4/pack.m4      (.../branches/gcc-4_8-branch)   (revision 217117)
12585 @@ -168,8 +168,8 @@
12586  
12587           ret->offset = 0;
12588  
12589 -         /* xmalloc allocates a single byte for zero size.  */
12590 -         ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
12591 +         /* xmallocarray allocates a single byte for zero size.  */
12592 +         ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
12593  
12594           if (total == 0)
12595             return;
12596 Index: libgfortran/m4/spread.m4
12597 ===================================================================
12598 --- libgfortran/m4/spread.m4    (.../tags/gcc_4_8_3_release)    (revision 217117)
12599 +++ libgfortran/m4/spread.m4    (.../branches/gcc-4_8-branch)   (revision 217117)
12600 @@ -102,8 +102,8 @@
12601         }
12602        ret->offset = 0;
12603  
12604 -      /* xmalloc allocates a single byte for zero size.  */
12605 -      ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
12606 +      /* xmallocarray allocates a single byte for zero size.  */
12607 +      ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
12608        if (rs <= 0)
12609          return;
12610      }
12611 @@ -245,7 +245,7 @@
12612  
12613    if (ret->base_addr == NULL)
12614      {
12615 -      ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
12616 +      ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
12617        ret->offset = 0;
12618        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12619      }
12620 Index: libgfortran/m4/transpose.m4
12621 ===================================================================
12622 --- libgfortran/m4/transpose.m4 (.../tags/gcc_4_8_3_release)    (revision 217117)
12623 +++ libgfortran/m4/transpose.m4 (.../branches/gcc-4_8-branch)   (revision 217117)
12624 @@ -61,7 +61,8 @@
12625        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
12626                         GFC_DESCRIPTOR_EXTENT(source, 1));
12627  
12628 -      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
12629 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
12630 +                                     sizeof ('rtype_name`));
12631        ret->offset = 0;
12632      } else if (unlikely (compile_options.bounds_check))
12633      {
12634 Index: libgfortran/m4/iforeach.m4
12635 ===================================================================
12636 --- libgfortran/m4/iforeach.m4  (.../tags/gcc_4_8_3_release)    (revision 217117)
12637 +++ libgfortran/m4/iforeach.m4  (.../branches/gcc-4_8-branch)   (revision 217117)
12638 @@ -30,7 +30,7 @@
12639        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12640        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12641        retarray->offset = 0;
12642 -      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
12643 +      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
12644      }
12645    else
12646      {
12647 @@ -133,7 +133,7 @@
12648        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12649        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12650        retarray->offset = 0;
12651 -      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
12652 +      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
12653      }
12654    else
12655      {
12656 @@ -264,7 +264,7 @@
12657        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12658        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12659        retarray->offset = 0;
12660 -      retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
12661 +      retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
12662      }
12663    else if (unlikely (compile_options.bounds_check))
12664      {
12665 Index: libgfortran/m4/eoshift1.m4
12666 ===================================================================
12667 --- libgfortran/m4/eoshift1.m4  (.../tags/gcc_4_8_3_release)    (revision 217117)
12668 +++ libgfortran/m4/eoshift1.m4  (.../branches/gcc-4_8-branch)   (revision 217117)
12669 @@ -106,8 +106,8 @@
12670           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
12671  
12672          }
12673 -      /* xmalloc allocates a single byte for zero size.  */
12674 -      ret->base_addr = xmalloc (size * arraysize);
12675 +      /* xmallocarray allocates a single byte for zero size.  */
12676 +      ret->base_addr = xmallocarray (arraysize, size);
12677  
12678      }
12679    else if (unlikely (compile_options.bounds_check))
12680 Index: libgfortran/m4/eoshift3.m4
12681 ===================================================================
12682 --- libgfortran/m4/eoshift3.m4  (.../tags/gcc_4_8_3_release)    (revision 217117)
12683 +++ libgfortran/m4/eoshift3.m4  (.../branches/gcc-4_8-branch)   (revision 217117)
12684 @@ -90,7 +90,7 @@
12685      {
12686        int i;
12687  
12688 -      ret->base_addr = xmalloc (size * arraysize);
12689 +      ret->base_addr = xmallocarray (arraysize, size);
12690        ret->offset = 0;
12691        ret->dtype = array->dtype;
12692        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
12693 @@ -108,8 +108,8 @@
12694           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
12695  
12696          }
12697 -      /* xmalloc allocates a single byte for zero size.  */
12698 -      ret->base_addr = xmalloc (size * arraysize);
12699 +      /* xmallocarray allocates a single byte for zero size.  */
12700 +      ret->base_addr = xmallocarray (arraysize, size);
12701  
12702      }
12703    else if (unlikely (compile_options.bounds_check))
12704 Index: libgfortran/m4/shape.m4
12705 ===================================================================
12706 --- libgfortran/m4/shape.m4     (.../tags/gcc_4_8_3_release)    (revision 217117)
12707 +++ libgfortran/m4/shape.m4     (.../branches/gcc-4_8-branch)   (revision 217117)
12708 @@ -50,7 +50,7 @@
12709      {
12710        GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
12711        ret->offset = 0;
12712 -      ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
12713 +      ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
12714      }
12715  
12716    stride = GFC_DESCRIPTOR_STRIDE(ret,0);
12717 Index: libgfortran/m4/cshift1.m4
12718 ===================================================================
12719 --- libgfortran/m4/cshift1.m4   (.../tags/gcc_4_8_3_release)    (revision 217117)
12720 +++ libgfortran/m4/cshift1.m4   (.../branches/gcc-4_8-branch)   (revision 217117)
12721 @@ -81,7 +81,7 @@
12722      {
12723        int i;
12724  
12725 -      ret->base_addr = xmalloc (size * arraysize);
12726 +      ret->base_addr = xmallocarray (arraysize, size);
12727        ret->offset = 0;
12728        ret->dtype = array->dtype;
12729        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
12730 Index: libgfortran/m4/matmull.m4
12731 ===================================================================
12732 --- libgfortran/m4/matmull.m4   (.../tags/gcc_4_8_3_release)    (revision 217117)
12733 +++ libgfortran/m4/matmull.m4   (.../branches/gcc-4_8-branch)   (revision 217117)
12734 @@ -89,7 +89,7 @@
12735          }
12736            
12737        retarray->base_addr
12738 -       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
12739 +       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
12740        retarray->offset = 0;
12741      }
12742      else if (unlikely (compile_options.bounds_check))
12743 Index: libgfortran/m4/bessel.m4
12744 ===================================================================
12745 --- libgfortran/m4/bessel.m4    (.../tags/gcc_4_8_3_release)    (revision 217117)
12746 +++ libgfortran/m4/bessel.m4    (.../branches/gcc-4_8-branch)   (revision 217117)
12747 @@ -56,7 +56,7 @@
12748      {
12749        size_t size = n2 < n1 ? 0 : n2-n1+1; 
12750        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12751 -      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
12752 +      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
12753        ret->offset = 0;
12754      }
12755  
12756 @@ -123,7 +123,7 @@
12757      {
12758        size_t size = n2 < n1 ? 0 : n2-n1+1; 
12759        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12760 -      ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
12761 +      ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
12762        ret->offset = 0;
12763      }
12764  
12765 @@ -163,7 +163,7 @@
12766  
12767    x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
12768  
12769 -  for (i = 2; i <= n1+n2; i++)
12770 +  for (i = 2; i <= n2 - n1; i++)
12771      {
12772  #if defined('rtype_name`_INFINITY)
12773        if (unlikely (last2 == -'rtype_name`_INFINITY))
12774 Index: libgfortran/m4/unpack.m4
12775 ===================================================================
12776 --- libgfortran/m4/unpack.m4    (.../tags/gcc_4_8_3_release)    (revision 217117)
12777 +++ libgfortran/m4/unpack.m4    (.../branches/gcc-4_8-branch)   (revision 217117)
12778 @@ -100,7 +100,7 @@
12779           rs *= extent[n];
12780         }
12781        ret->offset = 0;
12782 -      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
12783 +      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
12784      }
12785    else
12786      {
12787 @@ -245,7 +245,7 @@
12788           rs *= extent[n];
12789         }
12790        ret->offset = 0;
12791 -      ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
12792 +      ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
12793      }
12794    else
12795      {
12796 Index: libgfortran/m4/reshape.m4
12797 ===================================================================
12798 --- libgfortran/m4/reshape.m4   (.../tags/gcc_4_8_3_release)    (revision 217117)
12799 +++ libgfortran/m4/reshape.m4   (.../branches/gcc-4_8-branch)   (revision 217117)
12800 @@ -115,11 +115,11 @@
12801        ret->offset = 0;
12802  
12803        if (unlikely (rs < 1))
12804 -        alloc_size = 1;
12805 +        alloc_size = 0;
12806        else
12807 -        alloc_size = rs * sizeof ('rtype_name`);
12808 +        alloc_size = rs;
12809  
12810 -      ret->base_addr = xmalloc (alloc_size);
12811 +      ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
12812        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
12813      }
12814  
12815 Index: libgfortran/m4/ifunction_logical.m4
12816 ===================================================================
12817 --- libgfortran/m4/ifunction_logical.m4 (.../tags/gcc_4_8_3_release)    (revision 217117)
12818 +++ libgfortran/m4/ifunction_logical.m4 (.../branches/gcc-4_8-branch)   (revision 217117)
12819 @@ -89,8 +89,7 @@
12820        retarray->offset = 0;
12821        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12822  
12823 -      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12824 -                  * extent[rank-1];
12825 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12826  
12827        if (alloc_size == 0)
12828         {
12829 @@ -99,7 +98,7 @@
12830           return;
12831         }
12832        else
12833 -       retarray->base_addr = xmalloc (alloc_size);
12834 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
12835      }
12836    else
12837      {
12838 Index: libgfortran/m4/ifunction.m4
12839 ===================================================================
12840 --- libgfortran/m4/ifunction.m4 (.../tags/gcc_4_8_3_release)    (revision 217117)
12841 +++ libgfortran/m4/ifunction.m4 (.../branches/gcc-4_8-branch)   (revision 217117)
12842 @@ -85,10 +85,9 @@
12843        retarray->offset = 0;
12844        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12845  
12846 -      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12847 -                  * extent[rank-1];
12848 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12849  
12850 -      retarray->base_addr = xmalloc (alloc_size);
12851 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
12852        if (alloc_size == 0)
12853         {
12854           /* Make sure we have a zero-sized array.  */
12855 @@ -260,8 +259,7 @@
12856  
12857         }
12858  
12859 -      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12860 -                  * extent[rank-1];
12861 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12862  
12863        retarray->offset = 0;
12864        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12865 @@ -273,7 +271,7 @@
12866           return;
12867         }
12868        else
12869 -       retarray->base_addr = xmalloc (alloc_size);
12870 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
12871  
12872      }
12873    else
12874 @@ -417,8 +415,7 @@
12875        retarray->offset = 0;
12876        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12877  
12878 -      alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12879 -                  * extent[rank-1];
12880 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12881  
12882        if (alloc_size == 0)
12883         {
12884 @@ -427,7 +424,7 @@
12885           return;
12886         }
12887        else
12888 -       retarray->base_addr = xmalloc (alloc_size);
12889 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
12890      }
12891    else
12892      {
12893 Index: libgfortran/m4/matmul.m4
12894 ===================================================================
12895 --- libgfortran/m4/matmul.m4    (.../tags/gcc_4_8_3_release)    (revision 217117)
12896 +++ libgfortran/m4/matmul.m4    (.../branches/gcc-4_8-branch)   (revision 217117)
12897 @@ -125,7 +125,7 @@
12898          }
12899  
12900        retarray->base_addr
12901 -       = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
12902 +       = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
12903        retarray->offset = 0;
12904      }
12905      else if (unlikely (compile_options.bounds_check))
12906 Index: libgfortran/configure
12907 ===================================================================
12908 --- libgfortran/configure       (.../tags/gcc_4_8_3_release)    (revision 217117)
12909 +++ libgfortran/configure       (.../branches/gcc-4_8-branch)   (revision 217117)
12910 @@ -2595,6 +2595,7 @@
12911  as_fn_append ac_func_list " getegid"
12912  as_fn_append ac_func_list " secure_getenv"
12913  as_fn_append ac_func_list " __secure_getenv"
12914 +as_fn_append ac_func_list " strtok_r"
12915  as_fn_append ac_header_list " math.h"
12916  # Check that the precious variables saved in the cache have kept the same
12917  # value.
12918 @@ -12339,7 +12340,7 @@
12919    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
12920    lt_status=$lt_dlunknown
12921    cat > conftest.$ac_ext <<_LT_EOF
12922 -#line 12342 "configure"
12923 +#line 12343 "configure"
12924  #include "confdefs.h"
12925  
12926  #if HAVE_DLFCN_H
12927 @@ -12445,7 +12446,7 @@
12928    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
12929    lt_status=$lt_dlunknown
12930    cat > conftest.$ac_ext <<_LT_EOF
12931 -#line 12448 "configure"
12932 +#line 12449 "configure"
12933  #include "confdefs.h"
12934  
12935  #if HAVE_DLFCN_H
12936 @@ -16506,6 +16507,8 @@
12937  
12938  
12939  
12940 +
12941 +
12942  
12943  
12944  
12945 Index: libgfortran/runtime/in_pack_generic.c
12946 ===================================================================
12947 --- libgfortran/runtime/in_pack_generic.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
12948 +++ libgfortran/runtime/in_pack_generic.c       (.../branches/gcc-4_8-branch)   (revision 217117)
12949 @@ -180,7 +180,7 @@
12950      return source->base_addr;
12951  
12952     /* Allocate storage for the destination.  */
12953 -  destptr = xmalloc (ssize * size);
12954 +  destptr = xmallocarray (ssize, size);
12955    dest = (char *)destptr;
12956    src = source->base_addr;
12957    stride0 = stride[0] * size;
12958 Index: libgfortran/runtime/memory.c
12959 ===================================================================
12960 --- libgfortran/runtime/memory.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
12961 +++ libgfortran/runtime/memory.c        (.../branches/gcc-4_8-branch)   (revision 217117)
12962 @@ -25,8 +25,13 @@
12963  
12964  #include "libgfortran.h"
12965  #include <stdlib.h>
12966 +#include <errno.h>
12967  
12968 +#ifndef SIZE_MAX
12969 +#define SIZE_MAX ((size_t)-1)
12970 +#endif
12971  
12972 +
12973  void *
12974  xmalloc (size_t n)
12975  {
12976 @@ -44,12 +49,34 @@
12977  }
12978  
12979  
12980 +void *
12981 +xmallocarray (size_t nmemb, size_t size)
12982 +{
12983 +  void *p;
12984 +
12985 +  if (!nmemb || !size)
12986 +    size = nmemb = 1;
12987 +  else if (nmemb > SIZE_MAX / size)
12988 +    {
12989 +      errno = ENOMEM;
12990 +      os_error ("Integer overflow in xmallocarray");
12991 +    }
12992 +
12993 +  p = malloc (nmemb * size);
12994 +
12995 +  if (!p)
12996 +    os_error ("Memory allocation failed in xmallocarray");
12997 +
12998 +  return p;
12999 +}
13000 +
13001 +
13002  /* calloc wrapper that aborts on error.  */
13003  
13004  void *
13005  xcalloc (size_t nmemb, size_t size)
13006  {
13007 -  if (nmemb * size == 0)
13008 +  if (!nmemb || !size)
13009      nmemb = size = 1;
13010  
13011    void *p = calloc (nmemb, size);
13012 Index: libgfortran/runtime/convert_char.c
13013 ===================================================================
13014 --- libgfortran/runtime/convert_char.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13015 +++ libgfortran/runtime/convert_char.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13016 @@ -44,7 +44,7 @@
13017    gfc_charlen_type i, l;
13018  
13019    l = len > 0 ? len : 0;
13020 -  *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
13021 +  *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
13022  
13023    for (i = 0; i < l; i++)
13024      (*dst)[i] = src[i];
13025 @@ -60,7 +60,7 @@
13026    gfc_charlen_type i, l;
13027  
13028    l = len > 0 ? len : 0;
13029 -  *dst = xmalloc ((l + 1) * sizeof (unsigned char));
13030 +  *dst = xmalloc (l + 1);
13031  
13032    for (i = 0; i < l; i++)
13033      (*dst)[i] = src[i];
13034 Index: libgfortran/runtime/environ.c
13035 ===================================================================
13036 --- libgfortran/runtime/environ.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
13037 +++ libgfortran/runtime/environ.c       (.../branches/gcc-4_8-branch)   (revision 217117)
13038 @@ -833,7 +833,7 @@
13039      }
13040    else
13041      {
13042 -      elist = xmalloc (unit_count * sizeof (exception_t));
13043 +      elist = xmallocarray (unit_count, sizeof (exception_t));
13044        do_count = 0;
13045        p = val;
13046        do_parse ();
13047 Index: libgfortran/runtime/main.c
13048 ===================================================================
13049 --- libgfortran/runtime/main.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13050 +++ libgfortran/runtime/main.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13051 @@ -153,6 +153,16 @@
13052  }
13053  
13054  
13055 +#ifndef HAVE_STRTOK_R
13056 +static char*
13057 +gfstrtok_r (char *str, const char *delim, 
13058 +           char **saveptr __attribute__ ((unused)))
13059 +{
13060 +  return strtok (str, delim);
13061 +}
13062 +#define strtok_r gfstrtok_r
13063 +#endif
13064 +
13065  char *addr2line_path;
13066  
13067  /* Find addr2line and store the path.  */
13068 @@ -161,30 +171,32 @@
13069  find_addr2line (void)
13070  {
13071  #ifdef HAVE_ACCESS
13072 -#define A2L_LEN 10
13073 +#define A2L_LEN 11
13074    char *path = secure_getenv ("PATH");
13075    if (!path)
13076      return;
13077 +  char *tp = strdup (path);
13078 +  if (!tp)
13079 +    return;
13080    size_t n = strlen (path);
13081 -  char ap[n + 1 + A2L_LEN];
13082 -  size_t ai = 0;
13083 -  for (size_t i = 0; i < n; i++)
13084 +  char *ap = xmalloc (n + A2L_LEN);
13085 +  char *saveptr;
13086 +  for (char *str = tp;; str = NULL)
13087      {
13088 -      if (path[i] != ':')
13089 -       ap[ai++] = path[i];
13090 -      else
13091 +      char *token = strtok_r (str, ":", &saveptr);
13092 +      if (!token)
13093 +       break;
13094 +      size_t toklen = strlen (token);
13095 +      memcpy (ap, token, toklen);
13096 +      memcpy (ap + toklen, "/addr2line", A2L_LEN);
13097 +      if (access (ap, R_OK|X_OK) == 0)
13098         {
13099 -         ap[ai++] = '/';
13100 -         memcpy (ap + ai, "addr2line", A2L_LEN);
13101 -         if (access (ap, R_OK|X_OK) == 0)
13102 -           {
13103 -             addr2line_path = strdup (ap);
13104 -             return;
13105 -           }
13106 -         else
13107 -           ai = 0;
13108 +         addr2line_path = strdup (ap);
13109 +         break;
13110         }
13111      }
13112 +  free (tp);
13113 +  free (ap);
13114  #endif
13115  }
13116  
13117 Index: libgfortran/intrinsics/string_intrinsics_inc.c
13118 ===================================================================
13119 --- libgfortran/intrinsics/string_intrinsics_inc.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
13120 +++ libgfortran/intrinsics/string_intrinsics_inc.c      (.../branches/gcc-4_8-branch)   (revision 217117)
13121 @@ -164,7 +164,7 @@
13122    else
13123      {
13124        /* Allocate space for result string.  */
13125 -      *dest = xmalloc (*len * sizeof (CHARTYPE));
13126 +      *dest = xmallocarray (*len, sizeof (CHARTYPE));
13127  
13128        /* Copy string if necessary.  */
13129        memcpy (*dest, src, *len * sizeof (CHARTYPE));
13130 @@ -442,7 +442,7 @@
13131      *dest = &zero_length_string;
13132    else
13133      {
13134 -      CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
13135 +      CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
13136        memcpy (tmp, res, reslen * sizeof (CHARTYPE));
13137        MEMSET (&tmp[reslen], ' ', *rlen - reslen);
13138        *dest = tmp;
13139 Index: libgfortran/intrinsics/pack_generic.c
13140 ===================================================================
13141 --- libgfortran/intrinsics/pack_generic.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
13142 +++ libgfortran/intrinsics/pack_generic.c       (.../branches/gcc-4_8-branch)   (revision 217117)
13143 @@ -152,8 +152,8 @@
13144           GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
13145  
13146           ret->offset = 0;
13147 -         /* xmalloc allocates a single byte for zero size.  */
13148 -         ret->base_addr = xmalloc (size * total);
13149 +         /* xmallocarray allocates a single byte for zero size.  */
13150 +         ret->base_addr = xmallocarray (total, size);
13151  
13152           if (total == 0)
13153             return;      /* In this case, nothing remains to be done.  */
13154 @@ -519,7 +519,7 @@
13155  
13156        ret->offset = 0;
13157  
13158 -      ret->base_addr = xmalloc (size * total);
13159 +      ret->base_addr = xmallocarray (total, size);
13160  
13161        if (total == 0)
13162         return;
13163 Index: libgfortran/intrinsics/transpose_generic.c
13164 ===================================================================
13165 --- libgfortran/intrinsics/transpose_generic.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13166 +++ libgfortran/intrinsics/transpose_generic.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13167 @@ -60,7 +60,7 @@
13168        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13169                         GFC_DESCRIPTOR_EXTENT(source, 1));
13170  
13171 -      ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
13172 +      ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
13173        ret->offset = 0;
13174      }
13175    else if (unlikely (compile_options.bounds_check))
13176 Index: libgfortran/intrinsics/cshift0.c
13177 ===================================================================
13178 --- libgfortran/intrinsics/cshift0.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
13179 +++ libgfortran/intrinsics/cshift0.c    (.../branches/gcc-4_8-branch)   (revision 217117)
13180 @@ -79,8 +79,8 @@
13181           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
13182          }
13183  
13184 -      /* xmalloc allocates a single byte for zero size.  */
13185 -      ret->base_addr = xmalloc (size * arraysize);
13186 +      /* xmallocarray allocates a single byte for zero size.  */
13187 +      ret->base_addr = xmallocarray (arraysize, size);
13188      }
13189    else if (unlikely (compile_options.bounds_check))
13190      {
13191 Index: libgfortran/intrinsics/ctime.c
13192 ===================================================================
13193 --- libgfortran/intrinsics/ctime.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
13194 +++ libgfortran/intrinsics/ctime.c      (.../branches/gcc-4_8-branch)   (revision 217117)
13195 @@ -31,31 +31,53 @@
13196  #include <string.h>
13197  
13198  
13199 -/* strftime-like function that fills a C string with %c format which
13200 -   is identical to ctime in the default locale. As ctime and ctime_r
13201 -   are poorly specified and their usage not recommended, the
13202 -   implementation instead uses strftime.  */
13203 +/* Maximum space a ctime-like string might need. A "normal" ctime
13204 +   string is 26 bytes, and in our case 24 bytes as we don't include
13205 +   the trailing newline and null. However, the longest possible year
13206 +   number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
13207 +   32-bit signed integer) so an extra 7 bytes are needed. */
13208 +#define CTIME_BUFSZ 31
13209  
13210 -static size_t
13211 -strctime (char *s, size_t max, const time_t *timep)
13212 +
13213 +/* Thread-safe ctime-like function that fills a Fortran
13214 +   string. ctime_r is a portability headache and marked as obsolescent
13215 +   in POSIX 2008, which recommends strftime in its place. However,
13216 +   strftime(..., "%c",...)  doesn't produce ctime-like output on
13217 +   MinGW, so do it manually with snprintf.  */
13218 +
13219 +static int
13220 +gf_ctime (char *s, size_t max, const time_t timev)
13221  {
13222    struct tm ltm;
13223    int failed;
13224 +  char buf[CTIME_BUFSZ + 1];
13225    /* Some targets provide a localtime_r based on a draft of the POSIX
13226       standard where the return type is int rather than the
13227       standardized struct tm*.  */
13228 -  __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, &ltm)) 
13229 +  __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, &ltm)) 
13230                          == 5,
13231 -                        failed = localtime_r (timep, &ltm) == NULL,
13232 -                        failed = localtime_r (timep, &ltm) != 0);
13233 +                        failed = localtime_r (&timev, &ltm) == NULL,
13234 +                        failed = localtime_r (&timev, &ltm) != 0);
13235    if (failed)
13236 -    return 0;
13237 -  return strftime (s, max, "%c", &ltm);
13238 +    goto blank;
13239 +  int n = snprintf (buf, sizeof (buf), 
13240 +                   "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
13241 +                   "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
13242 +                   "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
13243 +                   ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec, 
13244 +                   1900 + ltm.tm_year);
13245 +  if (n < 0)
13246 +    goto blank;
13247 +  if ((size_t) n <= max)
13248 +    {
13249 +      cf_strcpy (s, max, buf);
13250 +      return n;
13251 +    }
13252 + blank:
13253 +  memset (s, ' ', max);
13254 +  return 0;
13255  }
13256  
13257 -/* In the default locale, the date and time representation fits in 26
13258 -   bytes. However, other locales might need more space.  */
13259 -#define CSZ 100
13260  
13261  extern void fdate (char **, gfc_charlen_type *);
13262  export_proto(fdate);
13263 @@ -64,8 +86,8 @@
13264  fdate (char ** date, gfc_charlen_type * date_len)
13265  {
13266    time_t now = time(NULL);
13267 -  *date = xmalloc (CSZ);
13268 -  *date_len = strctime (*date, CSZ, &now);
13269 +  *date = xmalloc (CTIME_BUFSZ);
13270 +  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
13271  }
13272  
13273  
13274 @@ -76,10 +98,7 @@
13275  fdate_sub (char * date, gfc_charlen_type date_len)
13276  {
13277    time_t now = time(NULL);
13278 -  char *s = xmalloc (date_len + 1);
13279 -  size_t n = strctime (s, date_len + 1, &now);
13280 -  fstrcpy (date, date_len, s, n);
13281 -  free (s);
13282 +  gf_ctime (date, date_len, now);
13283  }
13284  
13285  
13286 @@ -91,8 +110,8 @@
13287  PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
13288  {
13289    time_t now = t;
13290 -  *date = xmalloc (CSZ);
13291 -  *date_len = strctime (*date, CSZ, &now);
13292 +  *date = xmalloc (CTIME_BUFSZ);
13293 +  *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
13294  }
13295  
13296  
13297 @@ -103,8 +122,5 @@
13298  ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
13299  {
13300    time_t now = *t;
13301 -  char *s = xmalloc (date_len + 1);
13302 -  size_t n = strctime (s, date_len + 1, &now);
13303 -  fstrcpy (date, date_len, s, n);
13304 -  free (s);
13305 +  gf_ctime (date, date_len, now);
13306  }
13307 Index: libgfortran/intrinsics/spread_generic.c
13308 ===================================================================
13309 --- libgfortran/intrinsics/spread_generic.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
13310 +++ libgfortran/intrinsics/spread_generic.c     (.../branches/gcc-4_8-branch)   (revision 217117)
13311 @@ -100,7 +100,7 @@
13312           GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
13313         }
13314        ret->offset = 0;
13315 -      ret->base_addr = xmalloc (rs * size);
13316 +      ret->base_addr = xmallocarray (rs, size);
13317  
13318        if (rs <= 0)
13319         return;
13320 @@ -245,7 +245,7 @@
13321  
13322    if (ret->base_addr == NULL)
13323      {
13324 -      ret->base_addr = xmalloc (ncopies * size);
13325 +      ret->base_addr = xmallocarray (ncopies, size);
13326        ret->offset = 0;
13327        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13328      }
13329 Index: libgfortran/intrinsics/unpack_generic.c
13330 ===================================================================
13331 --- libgfortran/intrinsics/unpack_generic.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
13332 +++ libgfortran/intrinsics/unpack_generic.c     (.../branches/gcc-4_8-branch)   (revision 217117)
13333 @@ -125,7 +125,7 @@
13334           rs *= extent[n];
13335         }
13336        ret->offset = 0;
13337 -      ret->base_addr = xmalloc (rs * size);
13338 +      ret->base_addr = xmallocarray (rs, size);
13339      }
13340    else
13341      {
13342 Index: libgfortran/intrinsics/eoshift0.c
13343 ===================================================================
13344 --- libgfortran/intrinsics/eoshift0.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
13345 +++ libgfortran/intrinsics/eoshift0.c   (.../branches/gcc-4_8-branch)   (revision 217117)
13346 @@ -86,8 +86,8 @@
13347  
13348          }
13349  
13350 -      /* xmalloc allocates a single byte for zero size.  */
13351 -      ret->base_addr = xmalloc (size * arraysize);
13352 +      /* xmallocarray allocates a single byte for zero size.  */
13353 +      ret->base_addr = xmallocarray (arraysize, size);
13354      }
13355    else if (unlikely (compile_options.bounds_check))
13356      {
13357 Index: libgfortran/intrinsics/eoshift2.c
13358 ===================================================================
13359 --- libgfortran/intrinsics/eoshift2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
13360 +++ libgfortran/intrinsics/eoshift2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
13361 @@ -78,8 +78,8 @@
13362        ret->offset = 0;
13363        ret->dtype = array->dtype;
13364  
13365 -      /* xmalloc allocates a single byte for zero size.  */
13366 -      ret->base_addr = xmalloc (size * arraysize);
13367 +      /* xmallocarray allocates a single byte for zero size.  */
13368 +      ret->base_addr = xmallocarray (arraysize, size);
13369  
13370        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
13371          {
13372 Index: libgfortran/intrinsics/reshape_generic.c
13373 ===================================================================
13374 --- libgfortran/intrinsics/reshape_generic.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
13375 +++ libgfortran/intrinsics/reshape_generic.c    (.../branches/gcc-4_8-branch)   (revision 217117)
13376 @@ -99,11 +99,11 @@
13377        ret->offset = 0;
13378  
13379        if (unlikely (rs < 1))
13380 -       alloc_size = 1;
13381 +       alloc_size = 0; /* xmalloc will allocate 1 byte.  */
13382        else
13383 -       alloc_size = rs * size;
13384 +       alloc_size = rs;
13385  
13386 -      ret->base_addr = xmalloc (alloc_size);
13387 +      ret->base_addr = xmallocarray (alloc_size, size);
13388  
13389        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
13390      }
13391 Index: libgfortran/configure.ac
13392 ===================================================================
13393 --- libgfortran/configure.ac    (.../tags/gcc_4_8_3_release)    (revision 217117)
13394 +++ libgfortran/configure.ac    (.../branches/gcc-4_8-branch)   (revision 217117)
13395 @@ -267,7 +267,7 @@
13396  strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
13397  getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
13398  readlink getgid getpid getppid getuid geteuid umask getegid \
13399 -secure_getenv __secure_getenv)
13400 +secure_getenv __secure_getenv strtok_r)
13401  
13402  # Check strerror_r, cannot be above as versions with two and three arguments exist
13403  LIBGFOR_CHECK_STRERROR_R
13404 Index: libgfortran/ChangeLog
13405 ===================================================================
13406 --- libgfortran/ChangeLog       (.../tags/gcc_4_8_3_release)    (revision 217117)
13407 +++ libgfortran/ChangeLog       (.../branches/gcc-4_8-branch)   (revision 217117)
13408 @@ -1,3 +1,94 @@
13409 +2014-10-20  Janne Blomqvist  <jb@gcc.gnu.org>
13410 +
13411 +       PR libfortran/63589
13412 +       * configure.ac: Check for strtok_r.
13413 +       * runtime/main.c (gfstrtok_r): Fallback implementation of
13414 +       strtok_r.
13415 +       (find_addr2line): Use strtok_r to split PATH.
13416 +       * config.h.in: Regenerated.
13417 +       * configure: Regenerated.
13418 +
13419 +2014-08-20  Steven G. Kargl  <kargl@gcc.gnu.org>
13420 +
13421 +       PR libgfortran/62188
13422 +       * m4/bessel.m4: Avoid indexing off the end of an array.
13423 +       * generated/bessel_r10.c: Regenerated.
13424 +       * generated/bessel_r16.c: Ditto.
13425 +       * generated/bessel_r4.c: Ditto.
13426 +       * generated/bessel_r8.c: Ditto.
13427 +
13428 +2014-07-31  Janne Blomqvist  <jb@gcc.gnu.org>
13429 +
13430 +       Backport from mainline
13431 +       CVE-2014-5044
13432 +        * libgfortran.h (xmallocarray): New prototype.
13433 +        * runtime/memory.c (xmallocarray): New function.
13434 +        (xcalloc): Check for nonzero separately instead of multiplying.
13435 +        * generated/*.c: Regenerated.
13436 +        * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
13437 +        xmalloc.
13438 +        * intrinsics/eoshift0.c (eoshift0): Likewise.
13439 +        * intrinsics/eoshift2.c (eoshift2): Likewise.
13440 +        * intrinsics/pack_generic.c (pack_internal): Likewise.
13441 +        (pack_s_internal): Likewise.
13442 +        * intrinsics/reshape_generic.c (reshape_internal): Likewise.
13443 +        * intrinsics/spread_generic.c (spread_internal): Likewise.
13444 +        (spread_internal_scalar): Likewise.
13445 +        * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
13446 +        (string_minmax): Likewise.
13447 +        * intrinsics/transpose_generic.c (transpose_internal): Likewise.
13448 +        * intrinsics/unpack_generic.c (unpack_internal): Likewise.
13449 +        * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
13450 +        * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
13451 +        xmalloc.
13452 +        * io/unit.c (get_internal_unit): Likewise.
13453 +        (filename_from_unit): Don't cast xmalloc return value.
13454 +        * io/write.c (nml_write_obj): Likewise, formatting.
13455 +        * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
13456 +        instead of xmalloc.
13457 +        (besse_yn_r'rtype_kind`): Likewise.
13458 +        * m4/cshift1.m4 (cshift1): Likewise.
13459 +        * m4/eoshift1.m4 (eoshift1): Likewise.
13460 +        * m4/eoshift3.m4 (eoshift3): Likewise.
13461 +        * m4/iforeach.m4: Likewise.
13462 +        * m4/ifunction.m4: Likewise.
13463 +        * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
13464 +        Likewise.
13465 +        * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
13466 +        * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
13467 +        * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
13468 +        * m4/pack.m4 (pack_'rtype_code`): Likewise.
13469 +        * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
13470 +        * m4/shape.m4 (shape_'rtype_kind`): Likewise.
13471 +        * m4/spread.m4 (spread_'rtype_code`): Likewise.
13472 +        (spread_scalar_'rtype_code`): Likewise.
13473 +        * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
13474 +        * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
13475 +        (unpack1_'rtype_code`): Likewise.
13476 +        * runtime/convert_char.c (convert_char1_to_char4): Likewise.
13477 +        (convert_char4_to_char1): Simplify.
13478 +        * runtime/environ.c (init_unformatted): Call xmallocarray instead
13479 +        of xmalloc.
13480 +        * runtime/in_pack_generic.c (internal_pack): Likewise.
13481 +
13482 +2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
13483 +
13484 +       Backport from mainline
13485 +       PR libfortran/61310
13486 +       * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
13487 +       instead of strftime.
13488 +       (fdate): Use gf_ctime.
13489 +       (fdate_sub): Likewise.
13490 +       (ctime): Likewise.
13491 +       (ctime_sub): Likewise.
13492 +
13493 +2014-05-25  Janne Blomqvist  <jb@gcc.gnu.org>
13494 +
13495 +       Backport from trunk.
13496 +       PR libfortran/61187
13497 +       * io/unix.c (raw_close): Check if s->fd is -1.
13498 +       (fd_to_stream): Check return value of fstat(), handle error.
13499 +
13500  2014-05-22  Release Manager
13501  
13502         * GCC 4.8.3 released.
13503 Index: libgfortran/generated/spread_r10.c
13504 ===================================================================
13505 --- libgfortran/generated/spread_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13506 +++ libgfortran/generated/spread_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13507 @@ -101,8 +101,8 @@
13508         }
13509        ret->offset = 0;
13510  
13511 -      /* xmalloc allocates a single byte for zero size.  */
13512 -      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
13513 +      /* xmallocarray allocates a single byte for zero size.  */
13514 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
13515        if (rs <= 0)
13516          return;
13517      }
13518 @@ -244,7 +244,7 @@
13519  
13520    if (ret->base_addr == NULL)
13521      {
13522 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
13523 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
13524        ret->offset = 0;
13525        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13526      }
13527 Index: libgfortran/generated/maxloc1_4_r8.c
13528 ===================================================================
13529 --- libgfortran/generated/maxloc1_4_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
13530 +++ libgfortran/generated/maxloc1_4_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
13531 @@ -98,10 +98,9 @@
13532        retarray->offset = 0;
13533        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13534  
13535 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13536 -                  * extent[rank-1];
13537 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13538  
13539 -      retarray->base_addr = xmalloc (alloc_size);
13540 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13541        if (alloc_size == 0)
13542         {
13543           /* Make sure we have a zero-sized array.  */
13544 @@ -294,8 +293,7 @@
13545  
13546         }
13547  
13548 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13549 -                  * extent[rank-1];
13550 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13551  
13552        retarray->offset = 0;
13553        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13554 @@ -307,7 +305,7 @@
13555           return;
13556         }
13557        else
13558 -       retarray->base_addr = xmalloc (alloc_size);
13559 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13560  
13561      }
13562    else
13563 @@ -485,8 +483,7 @@
13564        retarray->offset = 0;
13565        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13566  
13567 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13568 -                  * extent[rank-1];
13569 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13570  
13571        if (alloc_size == 0)
13572         {
13573 @@ -495,7 +492,7 @@
13574           return;
13575         }
13576        else
13577 -       retarray->base_addr = xmalloc (alloc_size);
13578 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13579      }
13580    else
13581      {
13582 Index: libgfortran/generated/norm2_r4.c
13583 ===================================================================
13584 --- libgfortran/generated/norm2_r4.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
13585 +++ libgfortran/generated/norm2_r4.c    (.../branches/gcc-4_8-branch)   (revision 217117)
13586 @@ -101,10 +101,9 @@
13587        retarray->offset = 0;
13588        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13589  
13590 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13591 -                  * extent[rank-1];
13592 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13593  
13594 -      retarray->base_addr = xmalloc (alloc_size);
13595 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13596        if (alloc_size == 0)
13597         {
13598           /* Make sure we have a zero-sized array.  */
13599 Index: libgfortran/generated/parity_l2.c
13600 ===================================================================
13601 --- libgfortran/generated/parity_l2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
13602 +++ libgfortran/generated/parity_l2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
13603 @@ -98,10 +98,9 @@
13604        retarray->offset = 0;
13605        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13606  
13607 -      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13608 -                  * extent[rank-1];
13609 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13610  
13611 -      retarray->base_addr = xmalloc (alloc_size);
13612 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
13613        if (alloc_size == 0)
13614         {
13615           /* Make sure we have a zero-sized array.  */
13616 Index: libgfortran/generated/eoshift3_4.c
13617 ===================================================================
13618 --- libgfortran/generated/eoshift3_4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13619 +++ libgfortran/generated/eoshift3_4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13620 @@ -89,7 +89,7 @@
13621      {
13622        int i;
13623  
13624 -      ret->base_addr = xmalloc (size * arraysize);
13625 +      ret->base_addr = xmallocarray (arraysize, size);
13626        ret->offset = 0;
13627        ret->dtype = array->dtype;
13628        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
13629 @@ -107,8 +107,8 @@
13630           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
13631  
13632          }
13633 -      /* xmalloc allocates a single byte for zero size.  */
13634 -      ret->base_addr = xmalloc (size * arraysize);
13635 +      /* xmallocarray allocates a single byte for zero size.  */
13636 +      ret->base_addr = xmallocarray (arraysize, size);
13637  
13638      }
13639    else if (unlikely (compile_options.bounds_check))
13640 Index: libgfortran/generated/transpose_c8.c
13641 ===================================================================
13642 --- libgfortran/generated/transpose_c8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
13643 +++ libgfortran/generated/transpose_c8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
13644 @@ -60,7 +60,8 @@
13645        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13646                         GFC_DESCRIPTOR_EXTENT(source, 1));
13647  
13648 -      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
13649 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
13650 +                                     sizeof (GFC_COMPLEX_8));
13651        ret->offset = 0;
13652      } else if (unlikely (compile_options.bounds_check))
13653      {
13654 Index: libgfortran/generated/eoshift1_8.c
13655 ===================================================================
13656 --- libgfortran/generated/eoshift1_8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13657 +++ libgfortran/generated/eoshift1_8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13658 @@ -105,8 +105,8 @@
13659           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
13660  
13661          }
13662 -      /* xmalloc allocates a single byte for zero size.  */
13663 -      ret->base_addr = xmalloc (size * arraysize);
13664 +      /* xmallocarray allocates a single byte for zero size.  */
13665 +      ret->base_addr = xmallocarray (arraysize, size);
13666  
13667      }
13668    else if (unlikely (compile_options.bounds_check))
13669 Index: libgfortran/generated/reshape_r16.c
13670 ===================================================================
13671 --- libgfortran/generated/reshape_r16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
13672 +++ libgfortran/generated/reshape_r16.c (.../branches/gcc-4_8-branch)   (revision 217117)
13673 @@ -111,11 +111,11 @@
13674        ret->offset = 0;
13675  
13676        if (unlikely (rs < 1))
13677 -        alloc_size = 1;
13678 +        alloc_size = 0;
13679        else
13680 -        alloc_size = rs * sizeof (GFC_REAL_16);
13681 +        alloc_size = rs;
13682  
13683 -      ret->base_addr = xmalloc (alloc_size);
13684 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13685        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
13686      }
13687  
13688 Index: libgfortran/generated/bessel_r4.c
13689 ===================================================================
13690 --- libgfortran/generated/bessel_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
13691 +++ libgfortran/generated/bessel_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
13692 @@ -55,7 +55,7 @@
13693      {
13694        size_t size = n2 < n1 ? 0 : n2-n1+1; 
13695        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
13696 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
13697 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
13698        ret->offset = 0;
13699      }
13700  
13701 @@ -122,7 +122,7 @@
13702      {
13703        size_t size = n2 < n1 ? 0 : n2-n1+1; 
13704        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
13705 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
13706 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
13707        ret->offset = 0;
13708      }
13709  
13710 @@ -162,7 +162,7 @@
13711  
13712    x2rev = GFC_REAL_4_LITERAL(2.)/x;
13713  
13714 -  for (i = 2; i <= n1+n2; i++)
13715 +  for (i = 2; i <= n2 - n1; i++)
13716      {
13717  #if defined(GFC_REAL_4_INFINITY)
13718        if (unlikely (last2 == -GFC_REAL_4_INFINITY))
13719 Index: libgfortran/generated/any_l2.c
13720 ===================================================================
13721 --- libgfortran/generated/any_l2.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
13722 +++ libgfortran/generated/any_l2.c      (.../branches/gcc-4_8-branch)   (revision 217117)
13723 @@ -101,8 +101,7 @@
13724        retarray->offset = 0;
13725        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13726  
13727 -      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13728 -                  * extent[rank-1];
13729 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13730  
13731        if (alloc_size == 0)
13732         {
13733 @@ -111,7 +110,7 @@
13734           return;
13735         }
13736        else
13737 -       retarray->base_addr = xmalloc (alloc_size);
13738 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
13739      }
13740    else
13741      {
13742 Index: libgfortran/generated/product_r4.c
13743 ===================================================================
13744 --- libgfortran/generated/product_r4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13745 +++ libgfortran/generated/product_r4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13746 @@ -97,10 +97,9 @@
13747        retarray->offset = 0;
13748        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13749  
13750 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13751 -                  * extent[rank-1];
13752 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13753  
13754 -      retarray->base_addr = xmalloc (alloc_size);
13755 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13756        if (alloc_size == 0)
13757         {
13758           /* Make sure we have a zero-sized array.  */
13759 @@ -272,8 +271,7 @@
13760  
13761         }
13762  
13763 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13764 -                  * extent[rank-1];
13765 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13766  
13767        retarray->offset = 0;
13768        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13769 @@ -285,7 +283,7 @@
13770           return;
13771         }
13772        else
13773 -       retarray->base_addr = xmalloc (alloc_size);
13774 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13775  
13776      }
13777    else
13778 @@ -430,8 +428,7 @@
13779        retarray->offset = 0;
13780        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13781  
13782 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13783 -                  * extent[rank-1];
13784 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13785  
13786        if (alloc_size == 0)
13787         {
13788 @@ -440,7 +437,7 @@
13789           return;
13790         }
13791        else
13792 -       retarray->base_addr = xmalloc (alloc_size);
13793 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13794      }
13795    else
13796      {
13797 Index: libgfortran/generated/iany_i1.c
13798 ===================================================================
13799 --- libgfortran/generated/iany_i1.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
13800 +++ libgfortran/generated/iany_i1.c     (.../branches/gcc-4_8-branch)   (revision 217117)
13801 @@ -97,10 +97,9 @@
13802        retarray->offset = 0;
13803        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13804  
13805 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13806 -                  * extent[rank-1];
13807 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13808  
13809 -      retarray->base_addr = xmalloc (alloc_size);
13810 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13811        if (alloc_size == 0)
13812         {
13813           /* Make sure we have a zero-sized array.  */
13814 @@ -272,8 +271,7 @@
13815  
13816         }
13817  
13818 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13819 -                  * extent[rank-1];
13820 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13821  
13822        retarray->offset = 0;
13823        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13824 @@ -285,7 +283,7 @@
13825           return;
13826         }
13827        else
13828 -       retarray->base_addr = xmalloc (alloc_size);
13829 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13830  
13831      }
13832    else
13833 @@ -430,8 +428,7 @@
13834        retarray->offset = 0;
13835        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13836  
13837 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13838 -                  * extent[rank-1];
13839 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13840  
13841        if (alloc_size == 0)
13842         {
13843 @@ -440,7 +437,7 @@
13844           return;
13845         }
13846        else
13847 -       retarray->base_addr = xmalloc (alloc_size);
13848 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13849      }
13850    else
13851      {
13852 Index: libgfortran/generated/parity_l16.c
13853 ===================================================================
13854 --- libgfortran/generated/parity_l16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13855 +++ libgfortran/generated/parity_l16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13856 @@ -98,10 +98,9 @@
13857        retarray->offset = 0;
13858        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13859  
13860 -      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13861 -                  * extent[rank-1];
13862 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13863  
13864 -      retarray->base_addr = xmalloc (alloc_size);
13865 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
13866        if (alloc_size == 0)
13867         {
13868           /* Make sure we have a zero-sized array.  */
13869 Index: libgfortran/generated/in_pack_r4.c
13870 ===================================================================
13871 --- libgfortran/generated/in_pack_r4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13872 +++ libgfortran/generated/in_pack_r4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13873 @@ -76,7 +76,7 @@
13874      return source->base_addr;
13875  
13876    /* Allocate storage for the destination.  */
13877 -  destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
13878 +  destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
13879    dest = destptr;
13880    src = source->base_addr;
13881    stride0 = stride[0];
13882 Index: libgfortran/generated/product_i2.c
13883 ===================================================================
13884 --- libgfortran/generated/product_i2.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13885 +++ libgfortran/generated/product_i2.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13886 @@ -97,10 +97,9 @@
13887        retarray->offset = 0;
13888        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13889  
13890 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13891 -                  * extent[rank-1];
13892 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13893  
13894 -      retarray->base_addr = xmalloc (alloc_size);
13895 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
13896        if (alloc_size == 0)
13897         {
13898           /* Make sure we have a zero-sized array.  */
13899 @@ -272,8 +271,7 @@
13900  
13901         }
13902  
13903 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13904 -                  * extent[rank-1];
13905 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13906  
13907        retarray->offset = 0;
13908        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13909 @@ -285,7 +283,7 @@
13910           return;
13911         }
13912        else
13913 -       retarray->base_addr = xmalloc (alloc_size);
13914 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
13915  
13916      }
13917    else
13918 @@ -430,8 +428,7 @@
13919        retarray->offset = 0;
13920        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13921  
13922 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13923 -                  * extent[rank-1];
13924 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13925  
13926        if (alloc_size == 0)
13927         {
13928 @@ -440,7 +437,7 @@
13929           return;
13930         }
13931        else
13932 -       retarray->base_addr = xmalloc (alloc_size);
13933 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
13934      }
13935    else
13936      {
13937 Index: libgfortran/generated/iparity_i4.c
13938 ===================================================================
13939 --- libgfortran/generated/iparity_i4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
13940 +++ libgfortran/generated/iparity_i4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
13941 @@ -97,10 +97,9 @@
13942        retarray->offset = 0;
13943        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13944  
13945 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13946 -                  * extent[rank-1];
13947 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13948  
13949 -      retarray->base_addr = xmalloc (alloc_size);
13950 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13951        if (alloc_size == 0)
13952         {
13953           /* Make sure we have a zero-sized array.  */
13954 @@ -272,8 +271,7 @@
13955  
13956         }
13957  
13958 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13959 -                  * extent[rank-1];
13960 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13961  
13962        retarray->offset = 0;
13963        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13964 @@ -285,7 +283,7 @@
13965           return;
13966         }
13967        else
13968 -       retarray->base_addr = xmalloc (alloc_size);
13969 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13970  
13971      }
13972    else
13973 @@ -430,8 +428,7 @@
13974        retarray->offset = 0;
13975        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13976  
13977 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13978 -                  * extent[rank-1];
13979 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13980  
13981        if (alloc_size == 0)
13982         {
13983 @@ -440,7 +437,7 @@
13984           return;
13985         }
13986        else
13987 -       retarray->base_addr = xmalloc (alloc_size);
13988 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13989      }
13990    else
13991      {
13992 Index: libgfortran/generated/minloc0_4_i1.c
13993 ===================================================================
13994 --- libgfortran/generated/minloc0_4_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
13995 +++ libgfortran/generated/minloc0_4_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
13996 @@ -58,7 +58,7 @@
13997        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13998        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13999        retarray->offset = 0;
14000 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14001 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14002      }
14003    else
14004      {
14005 @@ -199,7 +199,7 @@
14006        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14007        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14008        retarray->offset = 0;
14009 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14010 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14011      }
14012    else
14013      {
14014 @@ -367,7 +367,7 @@
14015        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14016        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14017        retarray->offset = 0;
14018 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14019 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14020      }
14021    else if (unlikely (compile_options.bounds_check))
14022      {
14023 Index: libgfortran/generated/reshape_c4.c
14024 ===================================================================
14025 --- libgfortran/generated/reshape_c4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
14026 +++ libgfortran/generated/reshape_c4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
14027 @@ -111,11 +111,11 @@
14028        ret->offset = 0;
14029  
14030        if (unlikely (rs < 1))
14031 -        alloc_size = 1;
14032 +        alloc_size = 0;
14033        else
14034 -        alloc_size = rs * sizeof (GFC_COMPLEX_4);
14035 +        alloc_size = rs;
14036  
14037 -      ret->base_addr = xmalloc (alloc_size);
14038 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
14039        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
14040      }
14041  
14042 Index: libgfortran/generated/maxloc0_4_r16.c
14043 ===================================================================
14044 --- libgfortran/generated/maxloc0_4_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
14045 +++ libgfortran/generated/maxloc0_4_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
14046 @@ -58,7 +58,7 @@
14047        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14048        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14049        retarray->offset = 0;
14050 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14051 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14052      }
14053    else
14054      {
14055 @@ -199,7 +199,7 @@
14056        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14057        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14058        retarray->offset = 0;
14059 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14060 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14061      }
14062    else
14063      {
14064 @@ -367,7 +367,7 @@
14065        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14066        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14067        retarray->offset = 0;
14068 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14069 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14070      }
14071    else if (unlikely (compile_options.bounds_check))
14072      {
14073 Index: libgfortran/generated/iall_i8.c
14074 ===================================================================
14075 --- libgfortran/generated/iall_i8.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
14076 +++ libgfortran/generated/iall_i8.c     (.../branches/gcc-4_8-branch)   (revision 217117)
14077 @@ -97,10 +97,9 @@
14078        retarray->offset = 0;
14079        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14080  
14081 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14082 -                  * extent[rank-1];
14083 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14084  
14085 -      retarray->base_addr = xmalloc (alloc_size);
14086 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14087        if (alloc_size == 0)
14088         {
14089           /* Make sure we have a zero-sized array.  */
14090 @@ -272,8 +271,7 @@
14091  
14092         }
14093  
14094 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14095 -                  * extent[rank-1];
14096 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14097  
14098        retarray->offset = 0;
14099        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14100 @@ -285,7 +283,7 @@
14101           return;
14102         }
14103        else
14104 -       retarray->base_addr = xmalloc (alloc_size);
14105 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14106  
14107      }
14108    else
14109 @@ -430,8 +428,7 @@
14110        retarray->offset = 0;
14111        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14112  
14113 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14114 -                  * extent[rank-1];
14115 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14116  
14117        if (alloc_size == 0)
14118         {
14119 @@ -440,7 +437,7 @@
14120           return;
14121         }
14122        else
14123 -       retarray->base_addr = xmalloc (alloc_size);
14124 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14125      }
14126    else
14127      {
14128 Index: libgfortran/generated/maxloc1_8_r16.c
14129 ===================================================================
14130 --- libgfortran/generated/maxloc1_8_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
14131 +++ libgfortran/generated/maxloc1_8_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
14132 @@ -98,10 +98,9 @@
14133        retarray->offset = 0;
14134        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14135  
14136 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14137 -                  * extent[rank-1];
14138 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14139  
14140 -      retarray->base_addr = xmalloc (alloc_size);
14141 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14142        if (alloc_size == 0)
14143         {
14144           /* Make sure we have a zero-sized array.  */
14145 @@ -294,8 +293,7 @@
14146  
14147         }
14148  
14149 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14150 -                  * extent[rank-1];
14151 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14152  
14153        retarray->offset = 0;
14154        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14155 @@ -307,7 +305,7 @@
14156           return;
14157         }
14158        else
14159 -       retarray->base_addr = xmalloc (alloc_size);
14160 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14161  
14162      }
14163    else
14164 @@ -485,8 +483,7 @@
14165        retarray->offset = 0;
14166        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14167  
14168 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14169 -                  * extent[rank-1];
14170 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14171  
14172        if (alloc_size == 0)
14173         {
14174 @@ -495,7 +492,7 @@
14175           return;
14176         }
14177        else
14178 -       retarray->base_addr = xmalloc (alloc_size);
14179 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14180      }
14181    else
14182      {
14183 Index: libgfortran/generated/sum_r16.c
14184 ===================================================================
14185 --- libgfortran/generated/sum_r16.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
14186 +++ libgfortran/generated/sum_r16.c     (.../branches/gcc-4_8-branch)   (revision 217117)
14187 @@ -97,10 +97,9 @@
14188        retarray->offset = 0;
14189        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14190  
14191 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14192 -                  * extent[rank-1];
14193 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14194  
14195 -      retarray->base_addr = xmalloc (alloc_size);
14196 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14197        if (alloc_size == 0)
14198         {
14199           /* Make sure we have a zero-sized array.  */
14200 @@ -272,8 +271,7 @@
14201  
14202         }
14203  
14204 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14205 -                  * extent[rank-1];
14206 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14207  
14208        retarray->offset = 0;
14209        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14210 @@ -285,7 +283,7 @@
14211           return;
14212         }
14213        else
14214 -       retarray->base_addr = xmalloc (alloc_size);
14215 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14216  
14217      }
14218    else
14219 @@ -430,8 +428,7 @@
14220        retarray->offset = 0;
14221        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14222  
14223 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14224 -                  * extent[rank-1];
14225 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14226  
14227        if (alloc_size == 0)
14228         {
14229 @@ -440,7 +437,7 @@
14230           return;
14231         }
14232        else
14233 -       retarray->base_addr = xmalloc (alloc_size);
14234 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14235      }
14236    else
14237      {
14238 Index: libgfortran/generated/sum_i1.c
14239 ===================================================================
14240 --- libgfortran/generated/sum_i1.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
14241 +++ libgfortran/generated/sum_i1.c      (.../branches/gcc-4_8-branch)   (revision 217117)
14242 @@ -97,10 +97,9 @@
14243        retarray->offset = 0;
14244        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14245  
14246 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14247 -                  * extent[rank-1];
14248 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14249  
14250 -      retarray->base_addr = xmalloc (alloc_size);
14251 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14252        if (alloc_size == 0)
14253         {
14254           /* Make sure we have a zero-sized array.  */
14255 @@ -272,8 +271,7 @@
14256  
14257         }
14258  
14259 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14260 -                  * extent[rank-1];
14261 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14262  
14263        retarray->offset = 0;
14264        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14265 @@ -285,7 +283,7 @@
14266           return;
14267         }
14268        else
14269 -       retarray->base_addr = xmalloc (alloc_size);
14270 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14271  
14272      }
14273    else
14274 @@ -430,8 +428,7 @@
14275        retarray->offset = 0;
14276        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14277  
14278 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14279 -                  * extent[rank-1];
14280 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14281  
14282        if (alloc_size == 0)
14283         {
14284 @@ -440,7 +437,7 @@
14285           return;
14286         }
14287        else
14288 -       retarray->base_addr = xmalloc (alloc_size);
14289 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14290      }
14291    else
14292      {
14293 Index: libgfortran/generated/in_pack_i2.c
14294 ===================================================================
14295 --- libgfortran/generated/in_pack_i2.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
14296 +++ libgfortran/generated/in_pack_i2.c  (.../branches/gcc-4_8-branch)   (revision 217117)
14297 @@ -76,7 +76,7 @@
14298      return source->base_addr;
14299  
14300    /* Allocate storage for the destination.  */
14301 -  destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
14302 +  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
14303    dest = destptr;
14304    src = source->base_addr;
14305    stride0 = stride[0];
14306 Index: libgfortran/generated/transpose_r10.c
14307 ===================================================================
14308 --- libgfortran/generated/transpose_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
14309 +++ libgfortran/generated/transpose_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
14310 @@ -60,7 +60,8 @@
14311        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
14312                         GFC_DESCRIPTOR_EXTENT(source, 1));
14313  
14314 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
14315 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
14316 +                                     sizeof (GFC_REAL_10));
14317        ret->offset = 0;
14318      } else if (unlikely (compile_options.bounds_check))
14319      {
14320 Index: libgfortran/generated/maxloc1_16_r16.c
14321 ===================================================================
14322 --- libgfortran/generated/maxloc1_16_r16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
14323 +++ libgfortran/generated/maxloc1_16_r16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
14324 @@ -98,10 +98,9 @@
14325        retarray->offset = 0;
14326        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14327  
14328 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14329 -                  * extent[rank-1];
14330 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14331  
14332 -      retarray->base_addr = xmalloc (alloc_size);
14333 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14334        if (alloc_size == 0)
14335         {
14336           /* Make sure we have a zero-sized array.  */
14337 @@ -294,8 +293,7 @@
14338  
14339         }
14340  
14341 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14342 -                  * extent[rank-1];
14343 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14344  
14345        retarray->offset = 0;
14346        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14347 @@ -307,7 +305,7 @@
14348           return;
14349         }
14350        else
14351 -       retarray->base_addr = xmalloc (alloc_size);
14352 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14353  
14354      }
14355    else
14356 @@ -485,8 +483,7 @@
14357        retarray->offset = 0;
14358        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14359  
14360 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14361 -                  * extent[rank-1];
14362 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14363  
14364        if (alloc_size == 0)
14365         {
14366 @@ -495,7 +492,7 @@
14367           return;
14368         }
14369        else
14370 -       retarray->base_addr = xmalloc (alloc_size);
14371 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14372      }
14373    else
14374      {
14375 Index: libgfortran/generated/maxloc1_16_i4.c
14376 ===================================================================
14377 --- libgfortran/generated/maxloc1_16_i4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
14378 +++ libgfortran/generated/maxloc1_16_i4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
14379 @@ -98,10 +98,9 @@
14380        retarray->offset = 0;
14381        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14382  
14383 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14384 -                  * extent[rank-1];
14385 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14386  
14387 -      retarray->base_addr = xmalloc (alloc_size);
14388 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14389        if (alloc_size == 0)
14390         {
14391           /* Make sure we have a zero-sized array.  */
14392 @@ -294,8 +293,7 @@
14393  
14394         }
14395  
14396 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14397 -                  * extent[rank-1];
14398 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14399  
14400        retarray->offset = 0;
14401        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14402 @@ -307,7 +305,7 @@
14403           return;
14404         }
14405        else
14406 -       retarray->base_addr = xmalloc (alloc_size);
14407 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14408  
14409      }
14410    else
14411 @@ -485,8 +483,7 @@
14412        retarray->offset = 0;
14413        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14414  
14415 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14416 -                  * extent[rank-1];
14417 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14418  
14419        if (alloc_size == 0)
14420         {
14421 @@ -495,7 +492,7 @@
14422           return;
14423         }
14424        else
14425 -       retarray->base_addr = xmalloc (alloc_size);
14426 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14427      }
14428    else
14429      {
14430 Index: libgfortran/generated/spread_i1.c
14431 ===================================================================
14432 --- libgfortran/generated/spread_i1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
14433 +++ libgfortran/generated/spread_i1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
14434 @@ -101,8 +101,8 @@
14435         }
14436        ret->offset = 0;
14437  
14438 -      /* xmalloc allocates a single byte for zero size.  */
14439 -      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
14440 +      /* xmallocarray allocates a single byte for zero size.  */
14441 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
14442        if (rs <= 0)
14443          return;
14444      }
14445 @@ -244,7 +244,7 @@
14446  
14447    if (ret->base_addr == NULL)
14448      {
14449 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
14450 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
14451        ret->offset = 0;
14452        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
14453      }
14454 Index: libgfortran/generated/maxloc0_16_i8.c
14455 ===================================================================
14456 --- libgfortran/generated/maxloc0_16_i8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
14457 +++ libgfortran/generated/maxloc0_16_i8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
14458 @@ -58,7 +58,7 @@
14459        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14460        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14461        retarray->offset = 0;
14462 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14463 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14464      }
14465    else
14466      {
14467 @@ -199,7 +199,7 @@
14468        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14469        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14470        retarray->offset = 0;
14471 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14472 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14473      }
14474    else
14475      {
14476 @@ -367,7 +367,7 @@
14477        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14478        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14479        retarray->offset = 0;
14480 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14481 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14482      }
14483    else if (unlikely (compile_options.bounds_check))
14484      {
14485 Index: libgfortran/generated/maxval_r16.c
14486 ===================================================================
14487 --- libgfortran/generated/maxval_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
14488 +++ libgfortran/generated/maxval_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
14489 @@ -97,10 +97,9 @@
14490        retarray->offset = 0;
14491        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14492  
14493 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14494 -                  * extent[rank-1];
14495 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14496  
14497 -      retarray->base_addr = xmalloc (alloc_size);
14498 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14499        if (alloc_size == 0)
14500         {
14501           /* Make sure we have a zero-sized array.  */
14502 @@ -286,8 +285,7 @@
14503  
14504         }
14505  
14506 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14507 -                  * extent[rank-1];
14508 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14509  
14510        retarray->offset = 0;
14511        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14512 @@ -299,7 +297,7 @@
14513           return;
14514         }
14515        else
14516 -       retarray->base_addr = xmalloc (alloc_size);
14517 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14518  
14519      }
14520    else
14521 @@ -472,8 +470,7 @@
14522        retarray->offset = 0;
14523        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14524  
14525 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14526 -                  * extent[rank-1];
14527 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14528  
14529        if (alloc_size == 0)
14530         {
14531 @@ -482,7 +479,7 @@
14532           return;
14533         }
14534        else
14535 -       retarray->base_addr = xmalloc (alloc_size);
14536 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14537      }
14538    else
14539      {
14540 Index: libgfortran/generated/product_c10.c
14541 ===================================================================
14542 --- libgfortran/generated/product_c10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
14543 +++ libgfortran/generated/product_c10.c (.../branches/gcc-4_8-branch)   (revision 217117)
14544 @@ -97,10 +97,9 @@
14545        retarray->offset = 0;
14546        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14547  
14548 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14549 -                  * extent[rank-1];
14550 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14551  
14552 -      retarray->base_addr = xmalloc (alloc_size);
14553 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
14554        if (alloc_size == 0)
14555         {
14556           /* Make sure we have a zero-sized array.  */
14557 @@ -272,8 +271,7 @@
14558  
14559         }
14560  
14561 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14562 -                  * extent[rank-1];
14563 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14564  
14565        retarray->offset = 0;
14566        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14567 @@ -285,7 +283,7 @@
14568           return;
14569         }
14570        else
14571 -       retarray->base_addr = xmalloc (alloc_size);
14572 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
14573  
14574      }
14575    else
14576 @@ -430,8 +428,7 @@
14577        retarray->offset = 0;
14578        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14579  
14580 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14581 -                  * extent[rank-1];
14582 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14583  
14584        if (alloc_size == 0)
14585         {
14586 @@ -440,7 +437,7 @@
14587           return;
14588         }
14589        else
14590 -       retarray->base_addr = xmalloc (alloc_size);
14591 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
14592      }
14593    else
14594      {
14595 Index: libgfortran/generated/minloc1_8_i4.c
14596 ===================================================================
14597 --- libgfortran/generated/minloc1_8_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
14598 +++ libgfortran/generated/minloc1_8_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
14599 @@ -98,10 +98,9 @@
14600        retarray->offset = 0;
14601        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14602  
14603 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14604 -                  * extent[rank-1];
14605 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14606  
14607 -      retarray->base_addr = xmalloc (alloc_size);
14608 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14609        if (alloc_size == 0)
14610         {
14611           /* Make sure we have a zero-sized array.  */
14612 @@ -294,8 +293,7 @@
14613  
14614         }
14615  
14616 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14617 -                  * extent[rank-1];
14618 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14619  
14620        retarray->offset = 0;
14621        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14622 @@ -307,7 +305,7 @@
14623           return;
14624         }
14625        else
14626 -       retarray->base_addr = xmalloc (alloc_size);
14627 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14628  
14629      }
14630    else
14631 @@ -485,8 +483,7 @@
14632        retarray->offset = 0;
14633        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14634  
14635 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14636 -                  * extent[rank-1];
14637 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14638  
14639        if (alloc_size == 0)
14640         {
14641 @@ -495,7 +492,7 @@
14642           return;
14643         }
14644        else
14645 -       retarray->base_addr = xmalloc (alloc_size);
14646 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14647      }
14648    else
14649      {
14650 Index: libgfortran/generated/minloc0_16_i16.c
14651 ===================================================================
14652 --- libgfortran/generated/minloc0_16_i16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
14653 +++ libgfortran/generated/minloc0_16_i16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
14654 @@ -58,7 +58,7 @@
14655        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14656        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14657        retarray->offset = 0;
14658 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14659 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14660      }
14661    else
14662      {
14663 @@ -199,7 +199,7 @@
14664        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14665        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14666        retarray->offset = 0;
14667 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14668 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14669      }
14670    else
14671      {
14672 @@ -367,7 +367,7 @@
14673        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14674        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14675        retarray->offset = 0;
14676 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14677 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14678      }
14679    else if (unlikely (compile_options.bounds_check))
14680      {
14681 Index: libgfortran/generated/matmul_r16.c
14682 ===================================================================
14683 --- libgfortran/generated/matmul_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
14684 +++ libgfortran/generated/matmul_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
14685 @@ -124,7 +124,7 @@
14686          }
14687  
14688        retarray->base_addr
14689 -       = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
14690 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
14691        retarray->offset = 0;
14692      }
14693      else if (unlikely (compile_options.bounds_check))
14694 Index: libgfortran/generated/minloc0_4_r4.c
14695 ===================================================================
14696 --- libgfortran/generated/minloc0_4_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
14697 +++ libgfortran/generated/minloc0_4_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
14698 @@ -58,7 +58,7 @@
14699        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14700        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14701        retarray->offset = 0;
14702 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14703 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14704      }
14705    else
14706      {
14707 @@ -199,7 +199,7 @@
14708        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14709        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14710        retarray->offset = 0;
14711 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14712 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14713      }
14714    else
14715      {
14716 @@ -367,7 +367,7 @@
14717        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14718        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14719        retarray->offset = 0;
14720 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14721 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14722      }
14723    else if (unlikely (compile_options.bounds_check))
14724      {
14725 Index: libgfortran/generated/iany_i2.c
14726 ===================================================================
14727 --- libgfortran/generated/iany_i2.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
14728 +++ libgfortran/generated/iany_i2.c     (.../branches/gcc-4_8-branch)   (revision 217117)
14729 @@ -97,10 +97,9 @@
14730        retarray->offset = 0;
14731        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14732  
14733 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14734 -                  * extent[rank-1];
14735 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14736  
14737 -      retarray->base_addr = xmalloc (alloc_size);
14738 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
14739        if (alloc_size == 0)
14740         {
14741           /* Make sure we have a zero-sized array.  */
14742 @@ -272,8 +271,7 @@
14743  
14744         }
14745  
14746 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14747 -                  * extent[rank-1];
14748 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14749  
14750        retarray->offset = 0;
14751        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14752 @@ -285,7 +283,7 @@
14753           return;
14754         }
14755        else
14756 -       retarray->base_addr = xmalloc (alloc_size);
14757 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
14758  
14759      }
14760    else
14761 @@ -430,8 +428,7 @@
14762        retarray->offset = 0;
14763        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14764  
14765 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14766 -                  * extent[rank-1];
14767 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14768  
14769        if (alloc_size == 0)
14770         {
14771 @@ -440,7 +437,7 @@
14772           return;
14773         }
14774        else
14775 -       retarray->base_addr = xmalloc (alloc_size);
14776 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
14777      }
14778    else
14779      {
14780 Index: libgfortran/generated/sum_r4.c
14781 ===================================================================
14782 --- libgfortran/generated/sum_r4.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
14783 +++ libgfortran/generated/sum_r4.c      (.../branches/gcc-4_8-branch)   (revision 217117)
14784 @@ -97,10 +97,9 @@
14785        retarray->offset = 0;
14786        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14787  
14788 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14789 -                  * extent[rank-1];
14790 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14791  
14792 -      retarray->base_addr = xmalloc (alloc_size);
14793 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14794        if (alloc_size == 0)
14795         {
14796           /* Make sure we have a zero-sized array.  */
14797 @@ -272,8 +271,7 @@
14798  
14799         }
14800  
14801 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14802 -                  * extent[rank-1];
14803 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14804  
14805        retarray->offset = 0;
14806        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14807 @@ -285,7 +283,7 @@
14808           return;
14809         }
14810        else
14811 -       retarray->base_addr = xmalloc (alloc_size);
14812 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14813  
14814      }
14815    else
14816 @@ -430,8 +428,7 @@
14817        retarray->offset = 0;
14818        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14819  
14820 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14821 -                  * extent[rank-1];
14822 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14823  
14824        if (alloc_size == 0)
14825         {
14826 @@ -440,7 +437,7 @@
14827           return;
14828         }
14829        else
14830 -       retarray->base_addr = xmalloc (alloc_size);
14831 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14832      }
14833    else
14834      {
14835 Index: libgfortran/generated/unpack_c8.c
14836 ===================================================================
14837 --- libgfortran/generated/unpack_c8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
14838 +++ libgfortran/generated/unpack_c8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
14839 @@ -99,7 +99,7 @@
14840           rs *= extent[n];
14841         }
14842        ret->offset = 0;
14843 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
14844 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
14845      }
14846    else
14847      {
14848 @@ -244,7 +244,7 @@
14849           rs *= extent[n];
14850         }
14851        ret->offset = 0;
14852 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
14853 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
14854      }
14855    else
14856      {
14857 Index: libgfortran/generated/in_pack_c16.c
14858 ===================================================================
14859 --- libgfortran/generated/in_pack_c16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
14860 +++ libgfortran/generated/in_pack_c16.c (.../branches/gcc-4_8-branch)   (revision 217117)
14861 @@ -76,7 +76,7 @@
14862      return source->base_addr;
14863  
14864    /* Allocate storage for the destination.  */
14865 -  destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
14866 +  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
14867    dest = destptr;
14868    src = source->base_addr;
14869    stride0 = stride[0];
14870 Index: libgfortran/generated/minloc0_4_i2.c
14871 ===================================================================
14872 --- libgfortran/generated/minloc0_4_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
14873 +++ libgfortran/generated/minloc0_4_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
14874 @@ -58,7 +58,7 @@
14875        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14876        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14877        retarray->offset = 0;
14878 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14879 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14880      }
14881    else
14882      {
14883 @@ -199,7 +199,7 @@
14884        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14885        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14886        retarray->offset = 0;
14887 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14888 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14889      }
14890    else
14891      {
14892 @@ -367,7 +367,7 @@
14893        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14894        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14895        retarray->offset = 0;
14896 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14897 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14898      }
14899    else if (unlikely (compile_options.bounds_check))
14900      {
14901 Index: libgfortran/generated/spread_c10.c
14902 ===================================================================
14903 --- libgfortran/generated/spread_c10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
14904 +++ libgfortran/generated/spread_c10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
14905 @@ -101,8 +101,8 @@
14906         }
14907        ret->offset = 0;
14908  
14909 -      /* xmalloc allocates a single byte for zero size.  */
14910 -      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
14911 +      /* xmallocarray allocates a single byte for zero size.  */
14912 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
14913        if (rs <= 0)
14914          return;
14915      }
14916 @@ -244,7 +244,7 @@
14917  
14918    if (ret->base_addr == NULL)
14919      {
14920 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
14921 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
14922        ret->offset = 0;
14923        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
14924      }
14925 Index: libgfortran/generated/maxloc0_8_i1.c
14926 ===================================================================
14927 --- libgfortran/generated/maxloc0_8_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
14928 +++ libgfortran/generated/maxloc0_8_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
14929 @@ -58,7 +58,7 @@
14930        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14931        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14932        retarray->offset = 0;
14933 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14934 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14935      }
14936    else
14937      {
14938 @@ -199,7 +199,7 @@
14939        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14940        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14941        retarray->offset = 0;
14942 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14943 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14944      }
14945    else
14946      {
14947 @@ -367,7 +367,7 @@
14948        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14949        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14950        retarray->offset = 0;
14951 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14952 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14953      }
14954    else if (unlikely (compile_options.bounds_check))
14955      {
14956 Index: libgfortran/generated/spread_r4.c
14957 ===================================================================
14958 --- libgfortran/generated/spread_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
14959 +++ libgfortran/generated/spread_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
14960 @@ -101,8 +101,8 @@
14961         }
14962        ret->offset = 0;
14963  
14964 -      /* xmalloc allocates a single byte for zero size.  */
14965 -      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
14966 +      /* xmallocarray allocates a single byte for zero size.  */
14967 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
14968        if (rs <= 0)
14969          return;
14970      }
14971 @@ -244,7 +244,7 @@
14972  
14973    if (ret->base_addr == NULL)
14974      {
14975 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
14976 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
14977        ret->offset = 0;
14978        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
14979      }
14980 Index: libgfortran/generated/minloc0_8_i8.c
14981 ===================================================================
14982 --- libgfortran/generated/minloc0_8_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
14983 +++ libgfortran/generated/minloc0_8_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
14984 @@ -58,7 +58,7 @@
14985        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14986        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14987        retarray->offset = 0;
14988 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14989 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14990      }
14991    else
14992      {
14993 @@ -199,7 +199,7 @@
14994        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14995        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14996        retarray->offset = 0;
14997 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14998 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14999      }
15000    else
15001      {
15002 @@ -367,7 +367,7 @@
15003        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15004        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15005        retarray->offset = 0;
15006 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15007 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15008      }
15009    else if (unlikely (compile_options.bounds_check))
15010      {
15011 Index: libgfortran/generated/matmul_c8.c
15012 ===================================================================
15013 --- libgfortran/generated/matmul_c8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15014 +++ libgfortran/generated/matmul_c8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15015 @@ -124,7 +124,7 @@
15016          }
15017  
15018        retarray->base_addr
15019 -       = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
15020 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
15021        retarray->offset = 0;
15022      }
15023      else if (unlikely (compile_options.bounds_check))
15024 Index: libgfortran/generated/minloc1_16_r10.c
15025 ===================================================================
15026 --- libgfortran/generated/minloc1_16_r10.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
15027 +++ libgfortran/generated/minloc1_16_r10.c      (.../branches/gcc-4_8-branch)   (revision 217117)
15028 @@ -98,10 +98,9 @@
15029        retarray->offset = 0;
15030        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15031  
15032 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15033 -                  * extent[rank-1];
15034 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15035  
15036 -      retarray->base_addr = xmalloc (alloc_size);
15037 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15038        if (alloc_size == 0)
15039         {
15040           /* Make sure we have a zero-sized array.  */
15041 @@ -294,8 +293,7 @@
15042  
15043         }
15044  
15045 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15046 -                  * extent[rank-1];
15047 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15048  
15049        retarray->offset = 0;
15050        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15051 @@ -307,7 +305,7 @@
15052           return;
15053         }
15054        else
15055 -       retarray->base_addr = xmalloc (alloc_size);
15056 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15057  
15058      }
15059    else
15060 @@ -485,8 +483,7 @@
15061        retarray->offset = 0;
15062        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15063  
15064 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15065 -                  * extent[rank-1];
15066 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15067  
15068        if (alloc_size == 0)
15069         {
15070 @@ -495,7 +492,7 @@
15071           return;
15072         }
15073        else
15074 -       retarray->base_addr = xmalloc (alloc_size);
15075 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15076      }
15077    else
15078      {
15079 Index: libgfortran/generated/sum_i2.c
15080 ===================================================================
15081 --- libgfortran/generated/sum_i2.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
15082 +++ libgfortran/generated/sum_i2.c      (.../branches/gcc-4_8-branch)   (revision 217117)
15083 @@ -97,10 +97,9 @@
15084        retarray->offset = 0;
15085        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15086  
15087 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15088 -                  * extent[rank-1];
15089 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15090  
15091 -      retarray->base_addr = xmalloc (alloc_size);
15092 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15093        if (alloc_size == 0)
15094         {
15095           /* Make sure we have a zero-sized array.  */
15096 @@ -272,8 +271,7 @@
15097  
15098         }
15099  
15100 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15101 -                  * extent[rank-1];
15102 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15103  
15104        retarray->offset = 0;
15105        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15106 @@ -285,7 +283,7 @@
15107           return;
15108         }
15109        else
15110 -       retarray->base_addr = xmalloc (alloc_size);
15111 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15112  
15113      }
15114    else
15115 @@ -430,8 +428,7 @@
15116        retarray->offset = 0;
15117        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15118  
15119 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15120 -                  * extent[rank-1];
15121 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15122  
15123        if (alloc_size == 0)
15124         {
15125 @@ -440,7 +437,7 @@
15126           return;
15127         }
15128        else
15129 -       retarray->base_addr = xmalloc (alloc_size);
15130 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15131      }
15132    else
15133      {
15134 Index: libgfortran/generated/iparity_i16.c
15135 ===================================================================
15136 --- libgfortran/generated/iparity_i16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
15137 +++ libgfortran/generated/iparity_i16.c (.../branches/gcc-4_8-branch)   (revision 217117)
15138 @@ -97,10 +97,9 @@
15139        retarray->offset = 0;
15140        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15141  
15142 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15143 -                  * extent[rank-1];
15144 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15145  
15146 -      retarray->base_addr = xmalloc (alloc_size);
15147 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15148        if (alloc_size == 0)
15149         {
15150           /* Make sure we have a zero-sized array.  */
15151 @@ -272,8 +271,7 @@
15152  
15153         }
15154  
15155 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15156 -                  * extent[rank-1];
15157 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15158  
15159        retarray->offset = 0;
15160        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15161 @@ -285,7 +283,7 @@
15162           return;
15163         }
15164        else
15165 -       retarray->base_addr = xmalloc (alloc_size);
15166 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15167  
15168      }
15169    else
15170 @@ -430,8 +428,7 @@
15171        retarray->offset = 0;
15172        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15173  
15174 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15175 -                  * extent[rank-1];
15176 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15177  
15178        if (alloc_size == 0)
15179         {
15180 @@ -440,7 +437,7 @@
15181           return;
15182         }
15183        else
15184 -       retarray->base_addr = xmalloc (alloc_size);
15185 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15186      }
15187    else
15188      {
15189 Index: libgfortran/generated/minloc0_16_i1.c
15190 ===================================================================
15191 --- libgfortran/generated/minloc0_16_i1.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15192 +++ libgfortran/generated/minloc0_16_i1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15193 @@ -58,7 +58,7 @@
15194        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15195        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15196        retarray->offset = 0;
15197 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15198 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15199      }
15200    else
15201      {
15202 @@ -199,7 +199,7 @@
15203        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15204        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15205        retarray->offset = 0;
15206 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15207 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15208      }
15209    else
15210      {
15211 @@ -367,7 +367,7 @@
15212        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15213        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15214        retarray->offset = 0;
15215 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15216 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15217      }
15218    else if (unlikely (compile_options.bounds_check))
15219      {
15220 Index: libgfortran/generated/reshape_c16.c
15221 ===================================================================
15222 --- libgfortran/generated/reshape_c16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
15223 +++ libgfortran/generated/reshape_c16.c (.../branches/gcc-4_8-branch)   (revision 217117)
15224 @@ -111,11 +111,11 @@
15225        ret->offset = 0;
15226  
15227        if (unlikely (rs < 1))
15228 -        alloc_size = 1;
15229 +        alloc_size = 0;
15230        else
15231 -        alloc_size = rs * sizeof (GFC_COMPLEX_16);
15232 +        alloc_size = rs;
15233  
15234 -      ret->base_addr = xmalloc (alloc_size);
15235 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
15236        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
15237      }
15238  
15239 Index: libgfortran/generated/pack_c4.c
15240 ===================================================================
15241 --- libgfortran/generated/pack_c4.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
15242 +++ libgfortran/generated/pack_c4.c     (.../branches/gcc-4_8-branch)   (revision 217117)
15243 @@ -167,8 +167,8 @@
15244  
15245           ret->offset = 0;
15246  
15247 -         /* xmalloc allocates a single byte for zero size.  */
15248 -         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
15249 +         /* xmallocarray allocates a single byte for zero size.  */
15250 +         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
15251  
15252           if (total == 0)
15253             return;
15254 Index: libgfortran/generated/parity_l4.c
15255 ===================================================================
15256 --- libgfortran/generated/parity_l4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15257 +++ libgfortran/generated/parity_l4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15258 @@ -98,10 +98,9 @@
15259        retarray->offset = 0;
15260        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15261  
15262 -      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15263 -                  * extent[rank-1];
15264 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15265  
15266 -      retarray->base_addr = xmalloc (alloc_size);
15267 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
15268        if (alloc_size == 0)
15269         {
15270           /* Make sure we have a zero-sized array.  */
15271 Index: libgfortran/generated/spread_i2.c
15272 ===================================================================
15273 --- libgfortran/generated/spread_i2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15274 +++ libgfortran/generated/spread_i2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15275 @@ -101,8 +101,8 @@
15276         }
15277        ret->offset = 0;
15278  
15279 -      /* xmalloc allocates a single byte for zero size.  */
15280 -      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
15281 +      /* xmallocarray allocates a single byte for zero size.  */
15282 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
15283        if (rs <= 0)
15284          return;
15285      }
15286 @@ -244,7 +244,7 @@
15287  
15288    if (ret->base_addr == NULL)
15289      {
15290 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
15291 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
15292        ret->offset = 0;
15293        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
15294      }
15295 Index: libgfortran/generated/any_l4.c
15296 ===================================================================
15297 --- libgfortran/generated/any_l4.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
15298 +++ libgfortran/generated/any_l4.c      (.../branches/gcc-4_8-branch)   (revision 217117)
15299 @@ -101,8 +101,7 @@
15300        retarray->offset = 0;
15301        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15302  
15303 -      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15304 -                  * extent[rank-1];
15305 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15306  
15307        if (alloc_size == 0)
15308         {
15309 @@ -111,7 +110,7 @@
15310           return;
15311         }
15312        else
15313 -       retarray->base_addr = xmalloc (alloc_size);
15314 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
15315      }
15316    else
15317      {
15318 Index: libgfortran/generated/maxloc1_4_i8.c
15319 ===================================================================
15320 --- libgfortran/generated/maxloc1_4_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
15321 +++ libgfortran/generated/maxloc1_4_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
15322 @@ -98,10 +98,9 @@
15323        retarray->offset = 0;
15324        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15325  
15326 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15327 -                  * extent[rank-1];
15328 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15329  
15330 -      retarray->base_addr = xmalloc (alloc_size);
15331 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15332        if (alloc_size == 0)
15333         {
15334           /* Make sure we have a zero-sized array.  */
15335 @@ -294,8 +293,7 @@
15336  
15337         }
15338  
15339 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15340 -                  * extent[rank-1];
15341 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15342  
15343        retarray->offset = 0;
15344        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15345 @@ -307,7 +305,7 @@
15346           return;
15347         }
15348        else
15349 -       retarray->base_addr = xmalloc (alloc_size);
15350 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15351  
15352      }
15353    else
15354 @@ -485,8 +483,7 @@
15355        retarray->offset = 0;
15356        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15357  
15358 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15359 -                  * extent[rank-1];
15360 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15361  
15362        if (alloc_size == 0)
15363         {
15364 @@ -495,7 +492,7 @@
15365           return;
15366         }
15367        else
15368 -       retarray->base_addr = xmalloc (alloc_size);
15369 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15370      }
15371    else
15372      {
15373 Index: libgfortran/generated/maxloc0_8_r4.c
15374 ===================================================================
15375 --- libgfortran/generated/maxloc0_8_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
15376 +++ libgfortran/generated/maxloc0_8_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
15377 @@ -58,7 +58,7 @@
15378        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15379        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15380        retarray->offset = 0;
15381 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15382 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15383      }
15384    else
15385      {
15386 @@ -199,7 +199,7 @@
15387        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15388        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15389        retarray->offset = 0;
15390 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15391 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15392      }
15393    else
15394      {
15395 @@ -367,7 +367,7 @@
15396        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15397        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15398        retarray->offset = 0;
15399 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15400 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15401      }
15402    else if (unlikely (compile_options.bounds_check))
15403      {
15404 Index: libgfortran/generated/maxloc1_4_i16.c
15405 ===================================================================
15406 --- libgfortran/generated/maxloc1_4_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15407 +++ libgfortran/generated/maxloc1_4_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15408 @@ -98,10 +98,9 @@
15409        retarray->offset = 0;
15410        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15411  
15412 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15413 -                  * extent[rank-1];
15414 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15415  
15416 -      retarray->base_addr = xmalloc (alloc_size);
15417 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15418        if (alloc_size == 0)
15419         {
15420           /* Make sure we have a zero-sized array.  */
15421 @@ -294,8 +293,7 @@
15422  
15423         }
15424  
15425 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15426 -                  * extent[rank-1];
15427 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15428  
15429        retarray->offset = 0;
15430        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15431 @@ -307,7 +305,7 @@
15432           return;
15433         }
15434        else
15435 -       retarray->base_addr = xmalloc (alloc_size);
15436 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15437  
15438      }
15439    else
15440 @@ -485,8 +483,7 @@
15441        retarray->offset = 0;
15442        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15443  
15444 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15445 -                  * extent[rank-1];
15446 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15447  
15448        if (alloc_size == 0)
15449         {
15450 @@ -495,7 +492,7 @@
15451           return;
15452         }
15453        else
15454 -       retarray->base_addr = xmalloc (alloc_size);
15455 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15456      }
15457    else
15458      {
15459 Index: libgfortran/generated/minloc0_4_r10.c
15460 ===================================================================
15461 --- libgfortran/generated/minloc0_4_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15462 +++ libgfortran/generated/minloc0_4_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15463 @@ -58,7 +58,7 @@
15464        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15465        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15466        retarray->offset = 0;
15467 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15468 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15469      }
15470    else
15471      {
15472 @@ -199,7 +199,7 @@
15473        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15474        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15475        retarray->offset = 0;
15476 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15477 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15478      }
15479    else
15480      {
15481 @@ -367,7 +367,7 @@
15482        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15483        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15484        retarray->offset = 0;
15485 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15486 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15487      }
15488    else if (unlikely (compile_options.bounds_check))
15489      {
15490 Index: libgfortran/generated/minloc0_8_i16.c
15491 ===================================================================
15492 --- libgfortran/generated/minloc0_8_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15493 +++ libgfortran/generated/minloc0_8_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15494 @@ -58,7 +58,7 @@
15495        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15496        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15497        retarray->offset = 0;
15498 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15499 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15500      }
15501    else
15502      {
15503 @@ -199,7 +199,7 @@
15504        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15505        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15506        retarray->offset = 0;
15507 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15508 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15509      }
15510    else
15511      {
15512 @@ -367,7 +367,7 @@
15513        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15514        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15515        retarray->offset = 0;
15516 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15517 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15518      }
15519    else if (unlikely (compile_options.bounds_check))
15520      {
15521 Index: libgfortran/generated/minloc1_8_r10.c
15522 ===================================================================
15523 --- libgfortran/generated/minloc1_8_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15524 +++ libgfortran/generated/minloc1_8_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15525 @@ -98,10 +98,9 @@
15526        retarray->offset = 0;
15527        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15528  
15529 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15530 -                  * extent[rank-1];
15531 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15532  
15533 -      retarray->base_addr = xmalloc (alloc_size);
15534 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15535        if (alloc_size == 0)
15536         {
15537           /* Make sure we have a zero-sized array.  */
15538 @@ -294,8 +293,7 @@
15539  
15540         }
15541  
15542 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15543 -                  * extent[rank-1];
15544 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15545  
15546        retarray->offset = 0;
15547        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15548 @@ -307,7 +305,7 @@
15549           return;
15550         }
15551        else
15552 -       retarray->base_addr = xmalloc (alloc_size);
15553 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15554  
15555      }
15556    else
15557 @@ -485,8 +483,7 @@
15558        retarray->offset = 0;
15559        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15560  
15561 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15562 -                  * extent[rank-1];
15563 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15564  
15565        if (alloc_size == 0)
15566         {
15567 @@ -495,7 +492,7 @@
15568           return;
15569         }
15570        else
15571 -       retarray->base_addr = xmalloc (alloc_size);
15572 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15573      }
15574    else
15575      {
15576 Index: libgfortran/generated/minloc0_16_r4.c
15577 ===================================================================
15578 --- libgfortran/generated/minloc0_16_r4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15579 +++ libgfortran/generated/minloc0_16_r4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15580 @@ -58,7 +58,7 @@
15581        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15582        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15583        retarray->offset = 0;
15584 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15585 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15586      }
15587    else
15588      {
15589 @@ -199,7 +199,7 @@
15590        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15591        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15592        retarray->offset = 0;
15593 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15594 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15595      }
15596    else
15597      {
15598 @@ -367,7 +367,7 @@
15599        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15600        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15601        retarray->offset = 0;
15602 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15603 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15604      }
15605    else if (unlikely (compile_options.bounds_check))
15606      {
15607 Index: libgfortran/generated/product_i4.c
15608 ===================================================================
15609 --- libgfortran/generated/product_i4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
15610 +++ libgfortran/generated/product_i4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
15611 @@ -97,10 +97,9 @@
15612        retarray->offset = 0;
15613        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15614  
15615 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15616 -                  * extent[rank-1];
15617 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15618  
15619 -      retarray->base_addr = xmalloc (alloc_size);
15620 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15621        if (alloc_size == 0)
15622         {
15623           /* Make sure we have a zero-sized array.  */
15624 @@ -272,8 +271,7 @@
15625  
15626         }
15627  
15628 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15629 -                  * extent[rank-1];
15630 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15631  
15632        retarray->offset = 0;
15633        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15634 @@ -285,7 +283,7 @@
15635           return;
15636         }
15637        else
15638 -       retarray->base_addr = xmalloc (alloc_size);
15639 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15640  
15641      }
15642    else
15643 @@ -430,8 +428,7 @@
15644        retarray->offset = 0;
15645        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15646  
15647 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15648 -                  * extent[rank-1];
15649 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15650  
15651        if (alloc_size == 0)
15652         {
15653 @@ -440,7 +437,7 @@
15654           return;
15655         }
15656        else
15657 -       retarray->base_addr = xmalloc (alloc_size);
15658 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15659      }
15660    else
15661      {
15662 Index: libgfortran/generated/sum_c16.c
15663 ===================================================================
15664 --- libgfortran/generated/sum_c16.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
15665 +++ libgfortran/generated/sum_c16.c     (.../branches/gcc-4_8-branch)   (revision 217117)
15666 @@ -97,10 +97,9 @@
15667        retarray->offset = 0;
15668        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15669  
15670 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15671 -                  * extent[rank-1];
15672 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15673  
15674 -      retarray->base_addr = xmalloc (alloc_size);
15675 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
15676        if (alloc_size == 0)
15677         {
15678           /* Make sure we have a zero-sized array.  */
15679 @@ -272,8 +271,7 @@
15680  
15681         }
15682  
15683 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15684 -                  * extent[rank-1];
15685 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15686  
15687        retarray->offset = 0;
15688        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15689 @@ -285,7 +283,7 @@
15690           return;
15691         }
15692        else
15693 -       retarray->base_addr = xmalloc (alloc_size);
15694 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
15695  
15696      }
15697    else
15698 @@ -430,8 +428,7 @@
15699        retarray->offset = 0;
15700        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15701  
15702 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15703 -                  * extent[rank-1];
15704 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15705  
15706        if (alloc_size == 0)
15707         {
15708 @@ -440,7 +437,7 @@
15709           return;
15710         }
15711        else
15712 -       retarray->base_addr = xmalloc (alloc_size);
15713 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
15714      }
15715    else
15716      {
15717 Index: libgfortran/generated/transpose_c10.c
15718 ===================================================================
15719 --- libgfortran/generated/transpose_c10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15720 +++ libgfortran/generated/transpose_c10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15721 @@ -60,7 +60,8 @@
15722        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15723                         GFC_DESCRIPTOR_EXTENT(source, 1));
15724  
15725 -      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
15726 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
15727 +                                     sizeof (GFC_COMPLEX_10));
15728        ret->offset = 0;
15729      } else if (unlikely (compile_options.bounds_check))
15730      {
15731 Index: libgfortran/generated/maxloc1_16_r8.c
15732 ===================================================================
15733 --- libgfortran/generated/maxloc1_16_r8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15734 +++ libgfortran/generated/maxloc1_16_r8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15735 @@ -98,10 +98,9 @@
15736        retarray->offset = 0;
15737        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15738  
15739 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15740 -                  * extent[rank-1];
15741 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15742  
15743 -      retarray->base_addr = xmalloc (alloc_size);
15744 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15745        if (alloc_size == 0)
15746         {
15747           /* Make sure we have a zero-sized array.  */
15748 @@ -294,8 +293,7 @@
15749  
15750         }
15751  
15752 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15753 -                  * extent[rank-1];
15754 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15755  
15756        retarray->offset = 0;
15757        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15758 @@ -307,7 +305,7 @@
15759           return;
15760         }
15761        else
15762 -       retarray->base_addr = xmalloc (alloc_size);
15763 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15764  
15765      }
15766    else
15767 @@ -485,8 +483,7 @@
15768        retarray->offset = 0;
15769        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15770  
15771 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15772 -                  * extent[rank-1];
15773 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15774  
15775        if (alloc_size == 0)
15776         {
15777 @@ -495,7 +492,7 @@
15778           return;
15779         }
15780        else
15781 -       retarray->base_addr = xmalloc (alloc_size);
15782 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15783      }
15784    else
15785      {
15786 Index: libgfortran/generated/transpose_r4.c
15787 ===================================================================
15788 --- libgfortran/generated/transpose_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
15789 +++ libgfortran/generated/transpose_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
15790 @@ -60,7 +60,8 @@
15791        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15792                         GFC_DESCRIPTOR_EXTENT(source, 1));
15793  
15794 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
15795 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
15796 +                                     sizeof (GFC_REAL_4));
15797        ret->offset = 0;
15798      } else if (unlikely (compile_options.bounds_check))
15799      {
15800 Index: libgfortran/generated/cshift1_4.c
15801 ===================================================================
15802 --- libgfortran/generated/cshift1_4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15803 +++ libgfortran/generated/cshift1_4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15804 @@ -80,7 +80,7 @@
15805      {
15806        int i;
15807  
15808 -      ret->base_addr = xmalloc (size * arraysize);
15809 +      ret->base_addr = xmallocarray (arraysize, size);
15810        ret->offset = 0;
15811        ret->dtype = array->dtype;
15812        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
15813 Index: libgfortran/generated/maxloc0_8_i2.c
15814 ===================================================================
15815 --- libgfortran/generated/maxloc0_8_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
15816 +++ libgfortran/generated/maxloc0_8_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
15817 @@ -58,7 +58,7 @@
15818        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15819        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15820        retarray->offset = 0;
15821 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15822 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15823      }
15824    else
15825      {
15826 @@ -199,7 +199,7 @@
15827        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15828        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15829        retarray->offset = 0;
15830 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15831 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15832      }
15833    else
15834      {
15835 @@ -367,7 +367,7 @@
15836        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15837        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15838        retarray->offset = 0;
15839 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15840 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15841      }
15842    else if (unlikely (compile_options.bounds_check))
15843      {
15844 Index: libgfortran/generated/count_8_l.c
15845 ===================================================================
15846 --- libgfortran/generated/count_8_l.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15847 +++ libgfortran/generated/count_8_l.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15848 @@ -101,8 +101,7 @@
15849        retarray->offset = 0;
15850        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15851  
15852 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15853 -                  * extent[rank-1];
15854 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15855  
15856        if (alloc_size == 0)
15857         {
15858 @@ -111,7 +110,7 @@
15859           return;
15860         }
15861        else
15862 -       retarray->base_addr = xmalloc (alloc_size);
15863 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15864      }
15865    else
15866      {
15867 Index: libgfortran/generated/in_pack_i4.c
15868 ===================================================================
15869 --- libgfortran/generated/in_pack_i4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
15870 +++ libgfortran/generated/in_pack_i4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
15871 @@ -76,7 +76,7 @@
15872      return source->base_addr;
15873  
15874    /* Allocate storage for the destination.  */
15875 -  destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
15876 +  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
15877    dest = destptr;
15878    src = source->base_addr;
15879    stride0 = stride[0];
15880 Index: libgfortran/generated/minloc0_16_i2.c
15881 ===================================================================
15882 --- libgfortran/generated/minloc0_16_i2.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
15883 +++ libgfortran/generated/minloc0_16_i2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
15884 @@ -58,7 +58,7 @@
15885        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15886        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15887        retarray->offset = 0;
15888 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15889 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15890      }
15891    else
15892      {
15893 @@ -199,7 +199,7 @@
15894        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15895        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15896        retarray->offset = 0;
15897 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15898 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15899      }
15900    else
15901      {
15902 @@ -367,7 +367,7 @@
15903        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15904        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15905        retarray->offset = 0;
15906 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15907 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15908      }
15909    else if (unlikely (compile_options.bounds_check))
15910      {
15911 Index: libgfortran/generated/minloc1_8_r8.c
15912 ===================================================================
15913 --- libgfortran/generated/minloc1_8_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
15914 +++ libgfortran/generated/minloc1_8_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
15915 @@ -98,10 +98,9 @@
15916        retarray->offset = 0;
15917        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15918  
15919 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15920 -                  * extent[rank-1];
15921 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15922  
15923 -      retarray->base_addr = xmalloc (alloc_size);
15924 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15925        if (alloc_size == 0)
15926         {
15927           /* Make sure we have a zero-sized array.  */
15928 @@ -294,8 +293,7 @@
15929  
15930         }
15931  
15932 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15933 -                  * extent[rank-1];
15934 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15935  
15936        retarray->offset = 0;
15937        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15938 @@ -307,7 +305,7 @@
15939           return;
15940         }
15941        else
15942 -       retarray->base_addr = xmalloc (alloc_size);
15943 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15944  
15945      }
15946    else
15947 @@ -485,8 +483,7 @@
15948        retarray->offset = 0;
15949        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15950  
15951 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15952 -                  * extent[rank-1];
15953 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15954  
15955        if (alloc_size == 0)
15956         {
15957 @@ -495,7 +492,7 @@
15958           return;
15959         }
15960        else
15961 -       retarray->base_addr = xmalloc (alloc_size);
15962 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15963      }
15964    else
15965      {
15966 Index: libgfortran/generated/matmul_c16.c
15967 ===================================================================
15968 --- libgfortran/generated/matmul_c16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
15969 +++ libgfortran/generated/matmul_c16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
15970 @@ -124,7 +124,7 @@
15971          }
15972  
15973        retarray->base_addr
15974 -       = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
15975 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
15976        retarray->offset = 0;
15977      }
15978      else if (unlikely (compile_options.bounds_check))
15979 Index: libgfortran/generated/minval_i1.c
15980 ===================================================================
15981 --- libgfortran/generated/minval_i1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
15982 +++ libgfortran/generated/minval_i1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
15983 @@ -97,10 +97,9 @@
15984        retarray->offset = 0;
15985        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15986  
15987 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15988 -                  * extent[rank-1];
15989 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15990  
15991 -      retarray->base_addr = xmalloc (alloc_size);
15992 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15993        if (alloc_size == 0)
15994         {
15995           /* Make sure we have a zero-sized array.  */
15996 @@ -286,8 +285,7 @@
15997  
15998         }
15999  
16000 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16001 -                  * extent[rank-1];
16002 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16003  
16004        retarray->offset = 0;
16005        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16006 @@ -299,7 +297,7 @@
16007           return;
16008         }
16009        else
16010 -       retarray->base_addr = xmalloc (alloc_size);
16011 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
16012  
16013      }
16014    else
16015 @@ -472,8 +470,7 @@
16016        retarray->offset = 0;
16017        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16018  
16019 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16020 -                  * extent[rank-1];
16021 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16022  
16023        if (alloc_size == 0)
16024         {
16025 @@ -482,7 +479,7 @@
16026           return;
16027         }
16028        else
16029 -       retarray->base_addr = xmalloc (alloc_size);
16030 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
16031      }
16032    else
16033      {
16034 Index: libgfortran/generated/shape_i16.c
16035 ===================================================================
16036 --- libgfortran/generated/shape_i16.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16037 +++ libgfortran/generated/shape_i16.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16038 @@ -49,7 +49,7 @@
16039      {
16040        GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
16041        ret->offset = 0;
16042 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16043 +      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16044      }
16045  
16046    stride = GFC_DESCRIPTOR_STRIDE(ret,0);
16047 Index: libgfortran/generated/iany_i4.c
16048 ===================================================================
16049 --- libgfortran/generated/iany_i4.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
16050 +++ libgfortran/generated/iany_i4.c     (.../branches/gcc-4_8-branch)   (revision 217117)
16051 @@ -97,10 +97,9 @@
16052        retarray->offset = 0;
16053        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16054  
16055 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16056 -                  * extent[rank-1];
16057 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16058  
16059 -      retarray->base_addr = xmalloc (alloc_size);
16060 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16061        if (alloc_size == 0)
16062         {
16063           /* Make sure we have a zero-sized array.  */
16064 @@ -272,8 +271,7 @@
16065  
16066         }
16067  
16068 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16069 -                  * extent[rank-1];
16070 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16071  
16072        retarray->offset = 0;
16073        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16074 @@ -285,7 +283,7 @@
16075           return;
16076         }
16077        else
16078 -       retarray->base_addr = xmalloc (alloc_size);
16079 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16080  
16081      }
16082    else
16083 @@ -430,8 +428,7 @@
16084        retarray->offset = 0;
16085        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16086  
16087 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16088 -                  * extent[rank-1];
16089 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16090  
16091        if (alloc_size == 0)
16092         {
16093 @@ -440,7 +437,7 @@
16094           return;
16095         }
16096        else
16097 -       retarray->base_addr = xmalloc (alloc_size);
16098 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16099      }
16100    else
16101      {
16102 Index: libgfortran/generated/minloc0_16_r16.c
16103 ===================================================================
16104 --- libgfortran/generated/minloc0_16_r16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
16105 +++ libgfortran/generated/minloc0_16_r16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
16106 @@ -58,7 +58,7 @@
16107        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16108        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16109        retarray->offset = 0;
16110 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16111 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16112      }
16113    else
16114      {
16115 @@ -199,7 +199,7 @@
16116        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16117        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16118        retarray->offset = 0;
16119 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16120 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16121      }
16122    else
16123      {
16124 @@ -367,7 +367,7 @@
16125        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16126        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16127        retarray->offset = 0;
16128 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16129 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16130      }
16131    else if (unlikely (compile_options.bounds_check))
16132      {
16133 Index: libgfortran/generated/product_i16.c
16134 ===================================================================
16135 --- libgfortran/generated/product_i16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
16136 +++ libgfortran/generated/product_i16.c (.../branches/gcc-4_8-branch)   (revision 217117)
16137 @@ -97,10 +97,9 @@
16138        retarray->offset = 0;
16139        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16140  
16141 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16142 -                  * extent[rank-1];
16143 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16144  
16145 -      retarray->base_addr = xmalloc (alloc_size);
16146 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16147        if (alloc_size == 0)
16148         {
16149           /* Make sure we have a zero-sized array.  */
16150 @@ -272,8 +271,7 @@
16151  
16152         }
16153  
16154 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16155 -                  * extent[rank-1];
16156 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16157  
16158        retarray->offset = 0;
16159        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16160 @@ -285,7 +283,7 @@
16161           return;
16162         }
16163        else
16164 -       retarray->base_addr = xmalloc (alloc_size);
16165 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16166  
16167      }
16168    else
16169 @@ -430,8 +428,7 @@
16170        retarray->offset = 0;
16171        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16172  
16173 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16174 -                  * extent[rank-1];
16175 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16176  
16177        if (alloc_size == 0)
16178         {
16179 @@ -440,7 +437,7 @@
16180           return;
16181         }
16182        else
16183 -       retarray->base_addr = xmalloc (alloc_size);
16184 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16185      }
16186    else
16187      {
16188 Index: libgfortran/generated/unpack_i1.c
16189 ===================================================================
16190 --- libgfortran/generated/unpack_i1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16191 +++ libgfortran/generated/unpack_i1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16192 @@ -99,7 +99,7 @@
16193           rs *= extent[n];
16194         }
16195        ret->offset = 0;
16196 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
16197 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
16198      }
16199    else
16200      {
16201 @@ -244,7 +244,7 @@
16202           rs *= extent[n];
16203         }
16204        ret->offset = 0;
16205 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
16206 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
16207      }
16208    else
16209      {
16210 Index: libgfortran/generated/minloc0_4_i4.c
16211 ===================================================================
16212 --- libgfortran/generated/minloc0_4_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
16213 +++ libgfortran/generated/minloc0_4_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
16214 @@ -58,7 +58,7 @@
16215        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16216        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16217        retarray->offset = 0;
16218 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16219 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16220      }
16221    else
16222      {
16223 @@ -199,7 +199,7 @@
16224        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16225        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16226        retarray->offset = 0;
16227 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16228 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16229      }
16230    else
16231      {
16232 @@ -367,7 +367,7 @@
16233        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16234        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16235        retarray->offset = 0;
16236 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16237 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16238      }
16239    else if (unlikely (compile_options.bounds_check))
16240      {
16241 Index: libgfortran/generated/matmul_i1.c
16242 ===================================================================
16243 --- libgfortran/generated/matmul_i1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16244 +++ libgfortran/generated/matmul_i1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16245 @@ -124,7 +124,7 @@
16246          }
16247  
16248        retarray->base_addr
16249 -       = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
16250 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
16251        retarray->offset = 0;
16252      }
16253      else if (unlikely (compile_options.bounds_check))
16254 Index: libgfortran/generated/minval_r4.c
16255 ===================================================================
16256 --- libgfortran/generated/minval_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16257 +++ libgfortran/generated/minval_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16258 @@ -97,10 +97,9 @@
16259        retarray->offset = 0;
16260        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16261  
16262 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16263 -                  * extent[rank-1];
16264 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16265  
16266 -      retarray->base_addr = xmalloc (alloc_size);
16267 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16268        if (alloc_size == 0)
16269         {
16270           /* Make sure we have a zero-sized array.  */
16271 @@ -286,8 +285,7 @@
16272  
16273         }
16274  
16275 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16276 -                  * extent[rank-1];
16277 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16278  
16279        retarray->offset = 0;
16280        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16281 @@ -299,7 +297,7 @@
16282           return;
16283         }
16284        else
16285 -       retarray->base_addr = xmalloc (alloc_size);
16286 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16287  
16288      }
16289    else
16290 @@ -472,8 +470,7 @@
16291        retarray->offset = 0;
16292        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16293  
16294 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16295 -                  * extent[rank-1];
16296 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16297  
16298        if (alloc_size == 0)
16299         {
16300 @@ -482,7 +479,7 @@
16301           return;
16302         }
16303        else
16304 -       retarray->base_addr = xmalloc (alloc_size);
16305 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16306      }
16307    else
16308      {
16309 Index: libgfortran/generated/spread_i16.c
16310 ===================================================================
16311 --- libgfortran/generated/spread_i16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16312 +++ libgfortran/generated/spread_i16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16313 @@ -101,8 +101,8 @@
16314         }
16315        ret->offset = 0;
16316  
16317 -      /* xmalloc allocates a single byte for zero size.  */
16318 -      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
16319 +      /* xmallocarray allocates a single byte for zero size.  */
16320 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
16321        if (rs <= 0)
16322          return;
16323      }
16324 @@ -244,7 +244,7 @@
16325  
16326    if (ret->base_addr == NULL)
16327      {
16328 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
16329 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
16330        ret->offset = 0;
16331        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
16332      }
16333 Index: libgfortran/generated/sum_i4.c
16334 ===================================================================
16335 --- libgfortran/generated/sum_i4.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
16336 +++ libgfortran/generated/sum_i4.c      (.../branches/gcc-4_8-branch)   (revision 217117)
16337 @@ -97,10 +97,9 @@
16338        retarray->offset = 0;
16339        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16340  
16341 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16342 -                  * extent[rank-1];
16343 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16344  
16345 -      retarray->base_addr = xmalloc (alloc_size);
16346 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16347        if (alloc_size == 0)
16348         {
16349           /* Make sure we have a zero-sized array.  */
16350 @@ -272,8 +271,7 @@
16351  
16352         }
16353  
16354 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16355 -                  * extent[rank-1];
16356 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16357  
16358        retarray->offset = 0;
16359        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16360 @@ -285,7 +283,7 @@
16361           return;
16362         }
16363        else
16364 -       retarray->base_addr = xmalloc (alloc_size);
16365 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16366  
16367      }
16368    else
16369 @@ -430,8 +428,7 @@
16370        retarray->offset = 0;
16371        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16372  
16373 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16374 -                  * extent[rank-1];
16375 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16376  
16377        if (alloc_size == 0)
16378         {
16379 @@ -440,7 +437,7 @@
16380           return;
16381         }
16382        else
16383 -       retarray->base_addr = xmalloc (alloc_size);
16384 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16385      }
16386    else
16387      {
16388 Index: libgfortran/generated/unpack_r10.c
16389 ===================================================================
16390 --- libgfortran/generated/unpack_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16391 +++ libgfortran/generated/unpack_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16392 @@ -99,7 +99,7 @@
16393           rs *= extent[n];
16394         }
16395        ret->offset = 0;
16396 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
16397 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
16398      }
16399    else
16400      {
16401 @@ -244,7 +244,7 @@
16402           rs *= extent[n];
16403         }
16404        ret->offset = 0;
16405 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
16406 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
16407      }
16408    else
16409      {
16410 Index: libgfortran/generated/bessel_r16.c
16411 ===================================================================
16412 --- libgfortran/generated/bessel_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16413 +++ libgfortran/generated/bessel_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16414 @@ -59,7 +59,7 @@
16415      {
16416        size_t size = n2 < n1 ? 0 : n2-n1+1; 
16417        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
16418 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
16419 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
16420        ret->offset = 0;
16421      }
16422  
16423 @@ -126,7 +126,7 @@
16424      {
16425        size_t size = n2 < n1 ? 0 : n2-n1+1; 
16426        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
16427 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
16428 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
16429        ret->offset = 0;
16430      }
16431  
16432 @@ -166,7 +166,7 @@
16433  
16434    x2rev = GFC_REAL_16_LITERAL(2.)/x;
16435  
16436 -  for (i = 2; i <= n1+n2; i++)
16437 +  for (i = 2; i <= n2 - n1; i++)
16438      {
16439  #if defined(GFC_REAL_16_INFINITY)
16440        if (unlikely (last2 == -GFC_REAL_16_INFINITY))
16441 Index: libgfortran/generated/norm2_r8.c
16442 ===================================================================
16443 --- libgfortran/generated/norm2_r8.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
16444 +++ libgfortran/generated/norm2_r8.c    (.../branches/gcc-4_8-branch)   (revision 217117)
16445 @@ -101,10 +101,9 @@
16446        retarray->offset = 0;
16447        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16448  
16449 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16450 -                  * extent[rank-1];
16451 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16452  
16453 -      retarray->base_addr = xmalloc (alloc_size);
16454 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16455        if (alloc_size == 0)
16456         {
16457           /* Make sure we have a zero-sized array.  */
16458 Index: libgfortran/generated/spread_i4.c
16459 ===================================================================
16460 --- libgfortran/generated/spread_i4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16461 +++ libgfortran/generated/spread_i4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16462 @@ -101,8 +101,8 @@
16463         }
16464        ret->offset = 0;
16465  
16466 -      /* xmalloc allocates a single byte for zero size.  */
16467 -      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
16468 +      /* xmallocarray allocates a single byte for zero size.  */
16469 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
16470        if (rs <= 0)
16471          return;
16472      }
16473 @@ -244,7 +244,7 @@
16474  
16475    if (ret->base_addr == NULL)
16476      {
16477 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
16478 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
16479        ret->offset = 0;
16480        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
16481      }
16482 Index: libgfortran/generated/eoshift3_8.c
16483 ===================================================================
16484 --- libgfortran/generated/eoshift3_8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16485 +++ libgfortran/generated/eoshift3_8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16486 @@ -89,7 +89,7 @@
16487      {
16488        int i;
16489  
16490 -      ret->base_addr = xmalloc (size * arraysize);
16491 +      ret->base_addr = xmallocarray (arraysize, size);
16492        ret->offset = 0;
16493        ret->dtype = array->dtype;
16494        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
16495 @@ -107,8 +107,8 @@
16496           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
16497  
16498          }
16499 -      /* xmalloc allocates a single byte for zero size.  */
16500 -      ret->base_addr = xmalloc (size * arraysize);
16501 +      /* xmallocarray allocates a single byte for zero size.  */
16502 +      ret->base_addr = xmallocarray (arraysize, size);
16503  
16504      }
16505    else if (unlikely (compile_options.bounds_check))
16506 Index: libgfortran/generated/minloc1_4_i1.c
16507 ===================================================================
16508 --- libgfortran/generated/minloc1_4_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
16509 +++ libgfortran/generated/minloc1_4_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
16510 @@ -98,10 +98,9 @@
16511        retarray->offset = 0;
16512        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16513  
16514 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16515 -                  * extent[rank-1];
16516 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16517  
16518 -      retarray->base_addr = xmalloc (alloc_size);
16519 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16520        if (alloc_size == 0)
16521         {
16522           /* Make sure we have a zero-sized array.  */
16523 @@ -294,8 +293,7 @@
16524  
16525         }
16526  
16527 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16528 -                  * extent[rank-1];
16529 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16530  
16531        retarray->offset = 0;
16532        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16533 @@ -307,7 +305,7 @@
16534           return;
16535         }
16536        else
16537 -       retarray->base_addr = xmalloc (alloc_size);
16538 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16539  
16540      }
16541    else
16542 @@ -485,8 +483,7 @@
16543        retarray->offset = 0;
16544        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16545  
16546 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16547 -                  * extent[rank-1];
16548 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16549  
16550        if (alloc_size == 0)
16551         {
16552 @@ -495,7 +492,7 @@
16553           return;
16554         }
16555        else
16556 -       retarray->base_addr = xmalloc (alloc_size);
16557 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16558      }
16559    else
16560      {
16561 Index: libgfortran/generated/minval_i2.c
16562 ===================================================================
16563 --- libgfortran/generated/minval_i2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16564 +++ libgfortran/generated/minval_i2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16565 @@ -97,10 +97,9 @@
16566        retarray->offset = 0;
16567        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16568  
16569 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16570 -                  * extent[rank-1];
16571 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16572  
16573 -      retarray->base_addr = xmalloc (alloc_size);
16574 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16575        if (alloc_size == 0)
16576         {
16577           /* Make sure we have a zero-sized array.  */
16578 @@ -286,8 +285,7 @@
16579  
16580         }
16581  
16582 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16583 -                  * extent[rank-1];
16584 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16585  
16586        retarray->offset = 0;
16587        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16588 @@ -299,7 +297,7 @@
16589           return;
16590         }
16591        else
16592 -       retarray->base_addr = xmalloc (alloc_size);
16593 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16594  
16595      }
16596    else
16597 @@ -472,8 +470,7 @@
16598        retarray->offset = 0;
16599        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16600  
16601 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16602 -                  * extent[rank-1];
16603 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16604  
16605        if (alloc_size == 0)
16606         {
16607 @@ -482,7 +479,7 @@
16608           return;
16609         }
16610        else
16611 -       retarray->base_addr = xmalloc (alloc_size);
16612 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16613      }
16614    else
16615      {
16616 Index: libgfortran/generated/bessel_r8.c
16617 ===================================================================
16618 --- libgfortran/generated/bessel_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16619 +++ libgfortran/generated/bessel_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16620 @@ -55,7 +55,7 @@
16621      {
16622        size_t size = n2 < n1 ? 0 : n2-n1+1; 
16623        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
16624 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
16625 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
16626        ret->offset = 0;
16627      }
16628  
16629 @@ -122,7 +122,7 @@
16630      {
16631        size_t size = n2 < n1 ? 0 : n2-n1+1; 
16632        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
16633 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
16634 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
16635        ret->offset = 0;
16636      }
16637  
16638 @@ -162,7 +162,7 @@
16639  
16640    x2rev = GFC_REAL_8_LITERAL(2.)/x;
16641  
16642 -  for (i = 2; i <= n1+n2; i++)
16643 +  for (i = 2; i <= n2 - n1; i++)
16644      {
16645  #if defined(GFC_REAL_8_INFINITY)
16646        if (unlikely (last2 == -GFC_REAL_8_INFINITY))
16647 Index: libgfortran/generated/unpack_r4.c
16648 ===================================================================
16649 --- libgfortran/generated/unpack_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16650 +++ libgfortran/generated/unpack_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16651 @@ -99,7 +99,7 @@
16652           rs *= extent[n];
16653         }
16654        ret->offset = 0;
16655 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
16656 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
16657      }
16658    else
16659      {
16660 @@ -244,7 +244,7 @@
16661           rs *= extent[n];
16662         }
16663        ret->offset = 0;
16664 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
16665 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
16666      }
16667    else
16668      {
16669 Index: libgfortran/generated/product_r8.c
16670 ===================================================================
16671 --- libgfortran/generated/product_r8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16672 +++ libgfortran/generated/product_r8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16673 @@ -97,10 +97,9 @@
16674        retarray->offset = 0;
16675        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16676  
16677 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16678 -                  * extent[rank-1];
16679 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16680  
16681 -      retarray->base_addr = xmalloc (alloc_size);
16682 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16683        if (alloc_size == 0)
16684         {
16685           /* Make sure we have a zero-sized array.  */
16686 @@ -272,8 +271,7 @@
16687  
16688         }
16689  
16690 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16691 -                  * extent[rank-1];
16692 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16693  
16694        retarray->offset = 0;
16695        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16696 @@ -285,7 +283,7 @@
16697           return;
16698         }
16699        else
16700 -       retarray->base_addr = xmalloc (alloc_size);
16701 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16702  
16703      }
16704    else
16705 @@ -430,8 +428,7 @@
16706        retarray->offset = 0;
16707        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16708  
16709 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16710 -                  * extent[rank-1];
16711 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16712  
16713        if (alloc_size == 0)
16714         {
16715 @@ -440,7 +437,7 @@
16716           return;
16717         }
16718        else
16719 -       retarray->base_addr = xmalloc (alloc_size);
16720 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16721      }
16722    else
16723      {
16724 Index: libgfortran/generated/matmul_r4.c
16725 ===================================================================
16726 --- libgfortran/generated/matmul_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16727 +++ libgfortran/generated/matmul_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16728 @@ -124,7 +124,7 @@
16729          }
16730  
16731        retarray->base_addr
16732 -       = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
16733 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
16734        retarray->offset = 0;
16735      }
16736      else if (unlikely (compile_options.bounds_check))
16737 Index: libgfortran/generated/unpack_i2.c
16738 ===================================================================
16739 --- libgfortran/generated/unpack_i2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16740 +++ libgfortran/generated/unpack_i2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16741 @@ -99,7 +99,7 @@
16742           rs *= extent[n];
16743         }
16744        ret->offset = 0;
16745 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
16746 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
16747      }
16748    else
16749      {
16750 @@ -244,7 +244,7 @@
16751           rs *= extent[n];
16752         }
16753        ret->offset = 0;
16754 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
16755 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
16756      }
16757    else
16758      {
16759 Index: libgfortran/generated/in_pack_r8.c
16760 ===================================================================
16761 --- libgfortran/generated/in_pack_r8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16762 +++ libgfortran/generated/in_pack_r8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16763 @@ -76,7 +76,7 @@
16764      return source->base_addr;
16765  
16766    /* Allocate storage for the destination.  */
16767 -  destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
16768 +  destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
16769    dest = destptr;
16770    src = source->base_addr;
16771    stride0 = stride[0];
16772 Index: libgfortran/generated/maxloc1_4_r16.c
16773 ===================================================================
16774 --- libgfortran/generated/maxloc1_4_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
16775 +++ libgfortran/generated/maxloc1_4_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
16776 @@ -98,10 +98,9 @@
16777        retarray->offset = 0;
16778        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16779  
16780 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16781 -                  * extent[rank-1];
16782 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16783  
16784 -      retarray->base_addr = xmalloc (alloc_size);
16785 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16786        if (alloc_size == 0)
16787         {
16788           /* Make sure we have a zero-sized array.  */
16789 @@ -294,8 +293,7 @@
16790  
16791         }
16792  
16793 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16794 -                  * extent[rank-1];
16795 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16796  
16797        retarray->offset = 0;
16798        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16799 @@ -307,7 +305,7 @@
16800           return;
16801         }
16802        else
16803 -       retarray->base_addr = xmalloc (alloc_size);
16804 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16805  
16806      }
16807    else
16808 @@ -485,8 +483,7 @@
16809        retarray->offset = 0;
16810        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16811  
16812 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16813 -                  * extent[rank-1];
16814 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16815  
16816        if (alloc_size == 0)
16817         {
16818 @@ -495,7 +492,7 @@
16819           return;
16820         }
16821        else
16822 -       retarray->base_addr = xmalloc (alloc_size);
16823 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16824      }
16825    else
16826      {
16827 Index: libgfortran/generated/minloc0_8_r16.c
16828 ===================================================================
16829 --- libgfortran/generated/minloc0_8_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
16830 +++ libgfortran/generated/minloc0_8_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
16831 @@ -58,7 +58,7 @@
16832        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16833        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16834        retarray->offset = 0;
16835 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16836 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16837      }
16838    else
16839      {
16840 @@ -199,7 +199,7 @@
16841        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16842        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16843        retarray->offset = 0;
16844 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16845 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16846      }
16847    else
16848      {
16849 @@ -367,7 +367,7 @@
16850        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16851        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16852        retarray->offset = 0;
16853 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16854 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16855      }
16856    else if (unlikely (compile_options.bounds_check))
16857      {
16858 Index: libgfortran/generated/reshape_c8.c
16859 ===================================================================
16860 --- libgfortran/generated/reshape_c8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16861 +++ libgfortran/generated/reshape_c8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16862 @@ -111,11 +111,11 @@
16863        ret->offset = 0;
16864  
16865        if (unlikely (rs < 1))
16866 -        alloc_size = 1;
16867 +        alloc_size = 0;
16868        else
16869 -        alloc_size = rs * sizeof (GFC_COMPLEX_8);
16870 +        alloc_size = rs;
16871  
16872 -      ret->base_addr = xmalloc (alloc_size);
16873 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
16874        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
16875      }
16876  
16877 Index: libgfortran/generated/iparity_i8.c
16878 ===================================================================
16879 --- libgfortran/generated/iparity_i8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
16880 +++ libgfortran/generated/iparity_i8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
16881 @@ -97,10 +97,9 @@
16882        retarray->offset = 0;
16883        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16884  
16885 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16886 -                  * extent[rank-1];
16887 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16888  
16889 -      retarray->base_addr = xmalloc (alloc_size);
16890 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16891        if (alloc_size == 0)
16892         {
16893           /* Make sure we have a zero-sized array.  */
16894 @@ -272,8 +271,7 @@
16895  
16896         }
16897  
16898 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16899 -                  * extent[rank-1];
16900 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16901  
16902        retarray->offset = 0;
16903        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16904 @@ -285,7 +283,7 @@
16905           return;
16906         }
16907        else
16908 -       retarray->base_addr = xmalloc (alloc_size);
16909 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16910  
16911      }
16912    else
16913 @@ -430,8 +428,7 @@
16914        retarray->offset = 0;
16915        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16916  
16917 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16918 -                  * extent[rank-1];
16919 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16920  
16921        if (alloc_size == 0)
16922         {
16923 @@ -440,7 +437,7 @@
16924           return;
16925         }
16926        else
16927 -       retarray->base_addr = xmalloc (alloc_size);
16928 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16929      }
16930    else
16931      {
16932 Index: libgfortran/generated/count_1_l.c
16933 ===================================================================
16934 --- libgfortran/generated/count_1_l.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16935 +++ libgfortran/generated/count_1_l.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16936 @@ -101,8 +101,7 @@
16937        retarray->offset = 0;
16938        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16939  
16940 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16941 -                  * extent[rank-1];
16942 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16943  
16944        if (alloc_size == 0)
16945         {
16946 @@ -111,7 +110,7 @@
16947           return;
16948         }
16949        else
16950 -       retarray->base_addr = xmalloc (alloc_size);
16951 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
16952      }
16953    else
16954      {
16955 Index: libgfortran/generated/maxloc0_8_i4.c
16956 ===================================================================
16957 --- libgfortran/generated/maxloc0_8_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
16958 +++ libgfortran/generated/maxloc0_8_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
16959 @@ -58,7 +58,7 @@
16960        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16961        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16962        retarray->offset = 0;
16963 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16964 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16965      }
16966    else
16967      {
16968 @@ -199,7 +199,7 @@
16969        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16970        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16971        retarray->offset = 0;
16972 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16973 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16974      }
16975    else
16976      {
16977 @@ -367,7 +367,7 @@
16978        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16979        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16980        retarray->offset = 0;
16981 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16982 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16983      }
16984    else if (unlikely (compile_options.bounds_check))
16985      {
16986 Index: libgfortran/generated/matmul_i2.c
16987 ===================================================================
16988 --- libgfortran/generated/matmul_i2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
16989 +++ libgfortran/generated/matmul_i2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
16990 @@ -124,7 +124,7 @@
16991          }
16992  
16993        retarray->base_addr
16994 -       = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
16995 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
16996        retarray->offset = 0;
16997      }
16998      else if (unlikely (compile_options.bounds_check))
16999 Index: libgfortran/generated/minloc1_4_r4.c
17000 ===================================================================
17001 --- libgfortran/generated/minloc1_4_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17002 +++ libgfortran/generated/minloc1_4_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17003 @@ -98,10 +98,9 @@
17004        retarray->offset = 0;
17005        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17006  
17007 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17008 -                  * extent[rank-1];
17009 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17010  
17011 -      retarray->base_addr = xmalloc (alloc_size);
17012 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17013        if (alloc_size == 0)
17014         {
17015           /* Make sure we have a zero-sized array.  */
17016 @@ -294,8 +293,7 @@
17017  
17018         }
17019  
17020 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17021 -                  * extent[rank-1];
17022 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17023  
17024        retarray->offset = 0;
17025        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17026 @@ -307,7 +305,7 @@
17027           return;
17028         }
17029        else
17030 -       retarray->base_addr = xmalloc (alloc_size);
17031 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17032  
17033      }
17034    else
17035 @@ -485,8 +483,7 @@
17036        retarray->offset = 0;
17037        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17038  
17039 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17040 -                  * extent[rank-1];
17041 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17042  
17043        if (alloc_size == 0)
17044         {
17045 @@ -495,7 +492,7 @@
17046           return;
17047         }
17048        else
17049 -       retarray->base_addr = xmalloc (alloc_size);
17050 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17051      }
17052    else
17053      {
17054 Index: libgfortran/generated/transpose_i16.c
17055 ===================================================================
17056 --- libgfortran/generated/transpose_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
17057 +++ libgfortran/generated/transpose_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
17058 @@ -60,7 +60,8 @@
17059        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
17060                         GFC_DESCRIPTOR_EXTENT(source, 1));
17061  
17062 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
17063 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
17064 +                                     sizeof (GFC_INTEGER_16));
17065        ret->offset = 0;
17066      } else if (unlikely (compile_options.bounds_check))
17067      {
17068 Index: libgfortran/generated/minloc0_16_i4.c
17069 ===================================================================
17070 --- libgfortran/generated/minloc0_16_i4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
17071 +++ libgfortran/generated/minloc0_16_i4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
17072 @@ -58,7 +58,7 @@
17073        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17074        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17075        retarray->offset = 0;
17076 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17077 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17078      }
17079    else
17080      {
17081 @@ -199,7 +199,7 @@
17082        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17083        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17084        retarray->offset = 0;
17085 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17086 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17087      }
17088    else
17089      {
17090 @@ -367,7 +367,7 @@
17091        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17092        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17093        retarray->offset = 0;
17094 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17095 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17096      }
17097    else if (unlikely (compile_options.bounds_check))
17098      {
17099 Index: libgfortran/generated/transpose_i4.c
17100 ===================================================================
17101 --- libgfortran/generated/transpose_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17102 +++ libgfortran/generated/transpose_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17103 @@ -60,7 +60,8 @@
17104        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
17105                         GFC_DESCRIPTOR_EXTENT(source, 1));
17106  
17107 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
17108 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
17109 +                                     sizeof (GFC_INTEGER_4));
17110        ret->offset = 0;
17111      } else if (unlikely (compile_options.bounds_check))
17112      {
17113 Index: libgfortran/generated/maxloc1_16_i8.c
17114 ===================================================================
17115 --- libgfortran/generated/maxloc1_16_i8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
17116 +++ libgfortran/generated/maxloc1_16_i8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
17117 @@ -98,10 +98,9 @@
17118        retarray->offset = 0;
17119        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17120  
17121 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17122 -                  * extent[rank-1];
17123 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17124  
17125 -      retarray->base_addr = xmalloc (alloc_size);
17126 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17127        if (alloc_size == 0)
17128         {
17129           /* Make sure we have a zero-sized array.  */
17130 @@ -294,8 +293,7 @@
17131  
17132         }
17133  
17134 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17135 -                  * extent[rank-1];
17136 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17137  
17138        retarray->offset = 0;
17139        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17140 @@ -307,7 +305,7 @@
17141           return;
17142         }
17143        else
17144 -       retarray->base_addr = xmalloc (alloc_size);
17145 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17146  
17147      }
17148    else
17149 @@ -485,8 +483,7 @@
17150        retarray->offset = 0;
17151        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17152  
17153 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17154 -                  * extent[rank-1];
17155 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17156  
17157        if (alloc_size == 0)
17158         {
17159 @@ -495,7 +492,7 @@
17160           return;
17161         }
17162        else
17163 -       retarray->base_addr = xmalloc (alloc_size);
17164 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17165      }
17166    else
17167      {
17168 Index: libgfortran/generated/minloc1_4_i2.c
17169 ===================================================================
17170 --- libgfortran/generated/minloc1_4_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17171 +++ libgfortran/generated/minloc1_4_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17172 @@ -98,10 +98,9 @@
17173        retarray->offset = 0;
17174        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17175  
17176 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17177 -                  * extent[rank-1];
17178 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17179  
17180 -      retarray->base_addr = xmalloc (alloc_size);
17181 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17182        if (alloc_size == 0)
17183         {
17184           /* Make sure we have a zero-sized array.  */
17185 @@ -294,8 +293,7 @@
17186  
17187         }
17188  
17189 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17190 -                  * extent[rank-1];
17191 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17192  
17193        retarray->offset = 0;
17194        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17195 @@ -307,7 +305,7 @@
17196           return;
17197         }
17198        else
17199 -       retarray->base_addr = xmalloc (alloc_size);
17200 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17201  
17202      }
17203    else
17204 @@ -485,8 +483,7 @@
17205        retarray->offset = 0;
17206        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17207  
17208 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17209 -                  * extent[rank-1];
17210 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17211  
17212        if (alloc_size == 0)
17213         {
17214 @@ -495,7 +492,7 @@
17215           return;
17216         }
17217        else
17218 -       retarray->base_addr = xmalloc (alloc_size);
17219 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17220      }
17221    else
17222      {
17223 Index: libgfortran/generated/matmul_l16.c
17224 ===================================================================
17225 --- libgfortran/generated/matmul_l16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
17226 +++ libgfortran/generated/matmul_l16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
17227 @@ -88,7 +88,7 @@
17228          }
17229            
17230        retarray->base_addr
17231 -       = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
17232 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
17233        retarray->offset = 0;
17234      }
17235      else if (unlikely (compile_options.bounds_check))
17236 Index: libgfortran/generated/maxloc1_8_i1.c
17237 ===================================================================
17238 --- libgfortran/generated/maxloc1_8_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17239 +++ libgfortran/generated/maxloc1_8_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17240 @@ -98,10 +98,9 @@
17241        retarray->offset = 0;
17242        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17243  
17244 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17245 -                  * extent[rank-1];
17246 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17247  
17248 -      retarray->base_addr = xmalloc (alloc_size);
17249 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17250        if (alloc_size == 0)
17251         {
17252           /* Make sure we have a zero-sized array.  */
17253 @@ -294,8 +293,7 @@
17254  
17255         }
17256  
17257 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17258 -                  * extent[rank-1];
17259 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17260  
17261        retarray->offset = 0;
17262        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17263 @@ -307,7 +305,7 @@
17264           return;
17265         }
17266        else
17267 -       retarray->base_addr = xmalloc (alloc_size);
17268 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17269  
17270      }
17271    else
17272 @@ -485,8 +483,7 @@
17273        retarray->offset = 0;
17274        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17275  
17276 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17277 -                  * extent[rank-1];
17278 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17279  
17280        if (alloc_size == 0)
17281         {
17282 @@ -495,7 +492,7 @@
17283           return;
17284         }
17285        else
17286 -       retarray->base_addr = xmalloc (alloc_size);
17287 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17288      }
17289    else
17290      {
17291 Index: libgfortran/generated/minloc1_8_i8.c
17292 ===================================================================
17293 --- libgfortran/generated/minloc1_8_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17294 +++ libgfortran/generated/minloc1_8_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17295 @@ -98,10 +98,9 @@
17296        retarray->offset = 0;
17297        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17298  
17299 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17300 -                  * extent[rank-1];
17301 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17302  
17303 -      retarray->base_addr = xmalloc (alloc_size);
17304 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17305        if (alloc_size == 0)
17306         {
17307           /* Make sure we have a zero-sized array.  */
17308 @@ -294,8 +293,7 @@
17309  
17310         }
17311  
17312 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17313 -                  * extent[rank-1];
17314 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17315  
17316        retarray->offset = 0;
17317        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17318 @@ -307,7 +305,7 @@
17319           return;
17320         }
17321        else
17322 -       retarray->base_addr = xmalloc (alloc_size);
17323 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17324  
17325      }
17326    else
17327 @@ -485,8 +483,7 @@
17328        retarray->offset = 0;
17329        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17330  
17331 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17332 -                  * extent[rank-1];
17333 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17334  
17335        if (alloc_size == 0)
17336         {
17337 @@ -495,7 +492,7 @@
17338           return;
17339         }
17340        else
17341 -       retarray->base_addr = xmalloc (alloc_size);
17342 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17343      }
17344    else
17345      {
17346 Index: libgfortran/generated/minloc0_4_r8.c
17347 ===================================================================
17348 --- libgfortran/generated/minloc0_4_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17349 +++ libgfortran/generated/minloc0_4_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17350 @@ -58,7 +58,7 @@
17351        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17352        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17353        retarray->offset = 0;
17354 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17355 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17356      }
17357    else
17358      {
17359 @@ -199,7 +199,7 @@
17360        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17361        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17362        retarray->offset = 0;
17363 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17364 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17365      }
17366    else
17367      {
17368 @@ -367,7 +367,7 @@
17369        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17370        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17371        retarray->offset = 0;
17372 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17373 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17374      }
17375    else if (unlikely (compile_options.bounds_check))
17376      {
17377 Index: libgfortran/generated/product_r16.c
17378 ===================================================================
17379 --- libgfortran/generated/product_r16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
17380 +++ libgfortran/generated/product_r16.c (.../branches/gcc-4_8-branch)   (revision 217117)
17381 @@ -97,10 +97,9 @@
17382        retarray->offset = 0;
17383        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17384  
17385 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17386 -                  * extent[rank-1];
17387 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17388  
17389 -      retarray->base_addr = xmalloc (alloc_size);
17390 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17391        if (alloc_size == 0)
17392         {
17393           /* Make sure we have a zero-sized array.  */
17394 @@ -272,8 +271,7 @@
17395  
17396         }
17397  
17398 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17399 -                  * extent[rank-1];
17400 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17401  
17402        retarray->offset = 0;
17403        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17404 @@ -285,7 +283,7 @@
17405           return;
17406         }
17407        else
17408 -       retarray->base_addr = xmalloc (alloc_size);
17409 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17410  
17411      }
17412    else
17413 @@ -430,8 +428,7 @@
17414        retarray->offset = 0;
17415        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17416  
17417 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17418 -                  * extent[rank-1];
17419 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17420  
17421        if (alloc_size == 0)
17422         {
17423 @@ -440,7 +437,7 @@
17424           return;
17425         }
17426        else
17427 -       retarray->base_addr = xmalloc (alloc_size);
17428 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17429      }
17430    else
17431      {
17432 Index: libgfortran/generated/sum_r8.c
17433 ===================================================================
17434 --- libgfortran/generated/sum_r8.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
17435 +++ libgfortran/generated/sum_r8.c      (.../branches/gcc-4_8-branch)   (revision 217117)
17436 @@ -97,10 +97,9 @@
17437        retarray->offset = 0;
17438        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17439  
17440 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17441 -                  * extent[rank-1];
17442 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17443  
17444 -      retarray->base_addr = xmalloc (alloc_size);
17445 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17446        if (alloc_size == 0)
17447         {
17448           /* Make sure we have a zero-sized array.  */
17449 @@ -272,8 +271,7 @@
17450  
17451         }
17452  
17453 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17454 -                  * extent[rank-1];
17455 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17456  
17457        retarray->offset = 0;
17458        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17459 @@ -285,7 +283,7 @@
17460           return;
17461         }
17462        else
17463 -       retarray->base_addr = xmalloc (alloc_size);
17464 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17465  
17466      }
17467    else
17468 @@ -430,8 +428,7 @@
17469        retarray->offset = 0;
17470        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17471  
17472 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17473 -                  * extent[rank-1];
17474 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17475  
17476        if (alloc_size == 0)
17477         {
17478 @@ -440,7 +437,7 @@
17479           return;
17480         }
17481        else
17482 -       retarray->base_addr = xmalloc (alloc_size);
17483 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17484      }
17485    else
17486      {
17487 Index: libgfortran/generated/norm2_r10.c
17488 ===================================================================
17489 --- libgfortran/generated/norm2_r10.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
17490 +++ libgfortran/generated/norm2_r10.c   (.../branches/gcc-4_8-branch)   (revision 217117)
17491 @@ -101,10 +101,9 @@
17492        retarray->offset = 0;
17493        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17494  
17495 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17496 -                  * extent[rank-1];
17497 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17498  
17499 -      retarray->base_addr = xmalloc (alloc_size);
17500 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17501        if (alloc_size == 0)
17502         {
17503           /* Make sure we have a zero-sized array.  */
17504 Index: libgfortran/generated/unpack_c10.c
17505 ===================================================================
17506 --- libgfortran/generated/unpack_c10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
17507 +++ libgfortran/generated/unpack_c10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
17508 @@ -99,7 +99,7 @@
17509           rs *= extent[n];
17510         }
17511        ret->offset = 0;
17512 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
17513 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
17514      }
17515    else
17516      {
17517 @@ -244,7 +244,7 @@
17518           rs *= extent[n];
17519         }
17520        ret->offset = 0;
17521 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
17522 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
17523      }
17524    else
17525      {
17526 Index: libgfortran/generated/spread_r8.c
17527 ===================================================================
17528 --- libgfortran/generated/spread_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
17529 +++ libgfortran/generated/spread_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
17530 @@ -101,8 +101,8 @@
17531         }
17532        ret->offset = 0;
17533  
17534 -      /* xmalloc allocates a single byte for zero size.  */
17535 -      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
17536 +      /* xmallocarray allocates a single byte for zero size.  */
17537 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
17538        if (rs <= 0)
17539          return;
17540      }
17541 @@ -244,7 +244,7 @@
17542  
17543    if (ret->base_addr == NULL)
17544      {
17545 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
17546 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
17547        ret->offset = 0;
17548        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
17549      }
17550 Index: libgfortran/generated/minloc1_16_i16.c
17551 ===================================================================
17552 --- libgfortran/generated/minloc1_16_i16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
17553 +++ libgfortran/generated/minloc1_16_i16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
17554 @@ -98,10 +98,9 @@
17555        retarray->offset = 0;
17556        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17557  
17558 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17559 -                  * extent[rank-1];
17560 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17561  
17562 -      retarray->base_addr = xmalloc (alloc_size);
17563 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17564        if (alloc_size == 0)
17565         {
17566           /* Make sure we have a zero-sized array.  */
17567 @@ -294,8 +293,7 @@
17568  
17569         }
17570  
17571 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17572 -                  * extent[rank-1];
17573 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17574  
17575        retarray->offset = 0;
17576        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17577 @@ -307,7 +305,7 @@
17578           return;
17579         }
17580        else
17581 -       retarray->base_addr = xmalloc (alloc_size);
17582 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17583  
17584      }
17585    else
17586 @@ -485,8 +483,7 @@
17587        retarray->offset = 0;
17588        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17589  
17590 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17591 -                  * extent[rank-1];
17592 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17593  
17594        if (alloc_size == 0)
17595         {
17596 @@ -495,7 +492,7 @@
17597           return;
17598         }
17599        else
17600 -       retarray->base_addr = xmalloc (alloc_size);
17601 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17602      }
17603    else
17604      {
17605 Index: libgfortran/generated/maxloc1_8_r4.c
17606 ===================================================================
17607 --- libgfortran/generated/maxloc1_8_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17608 +++ libgfortran/generated/maxloc1_8_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17609 @@ -98,10 +98,9 @@
17610        retarray->offset = 0;
17611        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17612  
17613 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17614 -                  * extent[rank-1];
17615 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17616  
17617 -      retarray->base_addr = xmalloc (alloc_size);
17618 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17619        if (alloc_size == 0)
17620         {
17621           /* Make sure we have a zero-sized array.  */
17622 @@ -294,8 +293,7 @@
17623  
17624         }
17625  
17626 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17627 -                  * extent[rank-1];
17628 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17629  
17630        retarray->offset = 0;
17631        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17632 @@ -307,7 +305,7 @@
17633           return;
17634         }
17635        else
17636 -       retarray->base_addr = xmalloc (alloc_size);
17637 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17638  
17639      }
17640    else
17641 @@ -485,8 +483,7 @@
17642        retarray->offset = 0;
17643        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17644  
17645 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17646 -                  * extent[rank-1];
17647 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17648  
17649        if (alloc_size == 0)
17650         {
17651 @@ -495,7 +492,7 @@
17652           return;
17653         }
17654        else
17655 -       retarray->base_addr = xmalloc (alloc_size);
17656 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17657      }
17658    else
17659      {
17660 Index: libgfortran/generated/minloc1_16_i1.c
17661 ===================================================================
17662 --- libgfortran/generated/minloc1_16_i1.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
17663 +++ libgfortran/generated/minloc1_16_i1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
17664 @@ -98,10 +98,9 @@
17665        retarray->offset = 0;
17666        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17667  
17668 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17669 -                  * extent[rank-1];
17670 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17671  
17672 -      retarray->base_addr = xmalloc (alloc_size);
17673 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17674        if (alloc_size == 0)
17675         {
17676           /* Make sure we have a zero-sized array.  */
17677 @@ -294,8 +293,7 @@
17678  
17679         }
17680  
17681 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17682 -                  * extent[rank-1];
17683 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17684  
17685        retarray->offset = 0;
17686        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17687 @@ -307,7 +305,7 @@
17688           return;
17689         }
17690        else
17691 -       retarray->base_addr = xmalloc (alloc_size);
17692 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17693  
17694      }
17695    else
17696 @@ -485,8 +483,7 @@
17697        retarray->offset = 0;
17698        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17699  
17700 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17701 -                  * extent[rank-1];
17702 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17703  
17704        if (alloc_size == 0)
17705         {
17706 @@ -495,7 +492,7 @@
17707           return;
17708         }
17709        else
17710 -       retarray->base_addr = xmalloc (alloc_size);
17711 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17712      }
17713    else
17714      {
17715 Index: libgfortran/generated/spread_r16.c
17716 ===================================================================
17717 --- libgfortran/generated/spread_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
17718 +++ libgfortran/generated/spread_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
17719 @@ -101,8 +101,8 @@
17720         }
17721        ret->offset = 0;
17722  
17723 -      /* xmalloc allocates a single byte for zero size.  */
17724 -      ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
17725 +      /* xmallocarray allocates a single byte for zero size.  */
17726 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
17727        if (rs <= 0)
17728          return;
17729      }
17730 @@ -244,7 +244,7 @@
17731  
17732    if (ret->base_addr == NULL)
17733      {
17734 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
17735 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
17736        ret->offset = 0;
17737        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
17738      }
17739 Index: libgfortran/generated/pack_c8.c
17740 ===================================================================
17741 --- libgfortran/generated/pack_c8.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
17742 +++ libgfortran/generated/pack_c8.c     (.../branches/gcc-4_8-branch)   (revision 217117)
17743 @@ -167,8 +167,8 @@
17744  
17745           ret->offset = 0;
17746  
17747 -         /* xmalloc allocates a single byte for zero size.  */
17748 -         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
17749 +         /* xmallocarray allocates a single byte for zero size.  */
17750 +         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
17751  
17752           if (total == 0)
17753             return;
17754 Index: libgfortran/generated/minval_r10.c
17755 ===================================================================
17756 --- libgfortran/generated/minval_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
17757 +++ libgfortran/generated/minval_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
17758 @@ -97,10 +97,9 @@
17759        retarray->offset = 0;
17760        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17761  
17762 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17763 -                  * extent[rank-1];
17764 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17765  
17766 -      retarray->base_addr = xmalloc (alloc_size);
17767 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17768        if (alloc_size == 0)
17769         {
17770           /* Make sure we have a zero-sized array.  */
17771 @@ -286,8 +285,7 @@
17772  
17773         }
17774  
17775 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17776 -                  * extent[rank-1];
17777 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17778  
17779        retarray->offset = 0;
17780        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17781 @@ -299,7 +297,7 @@
17782           return;
17783         }
17784        else
17785 -       retarray->base_addr = xmalloc (alloc_size);
17786 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17787  
17788      }
17789    else
17790 @@ -472,8 +470,7 @@
17791        retarray->offset = 0;
17792        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17793  
17794 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17795 -                  * extent[rank-1];
17796 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17797  
17798        if (alloc_size == 0)
17799         {
17800 @@ -482,7 +479,7 @@
17801           return;
17802         }
17803        else
17804 -       retarray->base_addr = xmalloc (alloc_size);
17805 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17806      }
17807    else
17808      {
17809 Index: libgfortran/generated/parity_l8.c
17810 ===================================================================
17811 --- libgfortran/generated/parity_l8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
17812 +++ libgfortran/generated/parity_l8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
17813 @@ -98,10 +98,9 @@
17814        retarray->offset = 0;
17815        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17816  
17817 -      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17818 -                  * extent[rank-1];
17819 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17820  
17821 -      retarray->base_addr = xmalloc (alloc_size);
17822 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
17823        if (alloc_size == 0)
17824         {
17825           /* Make sure we have a zero-sized array.  */
17826 Index: libgfortran/generated/minval_i4.c
17827 ===================================================================
17828 --- libgfortran/generated/minval_i4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
17829 +++ libgfortran/generated/minval_i4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
17830 @@ -97,10 +97,9 @@
17831        retarray->offset = 0;
17832        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17833  
17834 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17835 -                  * extent[rank-1];
17836 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17837  
17838 -      retarray->base_addr = xmalloc (alloc_size);
17839 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17840        if (alloc_size == 0)
17841         {
17842           /* Make sure we have a zero-sized array.  */
17843 @@ -286,8 +285,7 @@
17844  
17845         }
17846  
17847 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17848 -                  * extent[rank-1];
17849 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17850  
17851        retarray->offset = 0;
17852        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17853 @@ -299,7 +297,7 @@
17854           return;
17855         }
17856        else
17857 -       retarray->base_addr = xmalloc (alloc_size);
17858 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17859  
17860      }
17861    else
17862 @@ -472,8 +470,7 @@
17863        retarray->offset = 0;
17864        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17865  
17866 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17867 -                  * extent[rank-1];
17868 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17869  
17870        if (alloc_size == 0)
17871         {
17872 @@ -482,7 +479,7 @@
17873           return;
17874         }
17875        else
17876 -       retarray->base_addr = xmalloc (alloc_size);
17877 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17878      }
17879    else
17880      {
17881 Index: libgfortran/generated/maxloc1_8_i2.c
17882 ===================================================================
17883 --- libgfortran/generated/maxloc1_8_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
17884 +++ libgfortran/generated/maxloc1_8_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
17885 @@ -98,10 +98,9 @@
17886        retarray->offset = 0;
17887        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17888  
17889 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17890 -                  * extent[rank-1];
17891 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17892  
17893 -      retarray->base_addr = xmalloc (alloc_size);
17894 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17895        if (alloc_size == 0)
17896         {
17897           /* Make sure we have a zero-sized array.  */
17898 @@ -294,8 +293,7 @@
17899  
17900         }
17901  
17902 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17903 -                  * extent[rank-1];
17904 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17905  
17906        retarray->offset = 0;
17907        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17908 @@ -307,7 +305,7 @@
17909           return;
17910         }
17911        else
17912 -       retarray->base_addr = xmalloc (alloc_size);
17913 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17914  
17915      }
17916    else
17917 @@ -485,8 +483,7 @@
17918        retarray->offset = 0;
17919        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17920  
17921 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17922 -                  * extent[rank-1];
17923 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17924  
17925        if (alloc_size == 0)
17926         {
17927 @@ -495,7 +492,7 @@
17928           return;
17929         }
17930        else
17931 -       retarray->base_addr = xmalloc (alloc_size);
17932 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17933      }
17934    else
17935      {
17936 Index: libgfortran/generated/any_l8.c
17937 ===================================================================
17938 --- libgfortran/generated/any_l8.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
17939 +++ libgfortran/generated/any_l8.c      (.../branches/gcc-4_8-branch)   (revision 217117)
17940 @@ -101,8 +101,7 @@
17941        retarray->offset = 0;
17942        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17943  
17944 -      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17945 -                  * extent[rank-1];
17946 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17947  
17948        if (alloc_size == 0)
17949         {
17950 @@ -111,7 +110,7 @@
17951           return;
17952         }
17953        else
17954 -       retarray->base_addr = xmalloc (alloc_size);
17955 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
17956      }
17957    else
17958      {
17959 Index: libgfortran/generated/maxloc0_16_r10.c
17960 ===================================================================
17961 --- libgfortran/generated/maxloc0_16_r10.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
17962 +++ libgfortran/generated/maxloc0_16_r10.c      (.../branches/gcc-4_8-branch)   (revision 217117)
17963 @@ -58,7 +58,7 @@
17964        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17965        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17966        retarray->offset = 0;
17967 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17968 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17969      }
17970    else
17971      {
17972 @@ -199,7 +199,7 @@
17973        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17974        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17975        retarray->offset = 0;
17976 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17977 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17978      }
17979    else
17980      {
17981 @@ -367,7 +367,7 @@
17982        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17983        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17984        retarray->offset = 0;
17985 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17986 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17987      }
17988    else if (unlikely (compile_options.bounds_check))
17989      {
17990 Index: libgfortran/generated/minloc0_4_i16.c
17991 ===================================================================
17992 --- libgfortran/generated/minloc0_4_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
17993 +++ libgfortran/generated/minloc0_4_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
17994 @@ -58,7 +58,7 @@
17995        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17996        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17997        retarray->offset = 0;
17998 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17999 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18000      }
18001    else
18002      {
18003 @@ -199,7 +199,7 @@
18004        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18005        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18006        retarray->offset = 0;
18007 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18008 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18009      }
18010    else
18011      {
18012 @@ -367,7 +367,7 @@
18013        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18014        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18015        retarray->offset = 0;
18016 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18017 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18018      }
18019    else if (unlikely (compile_options.bounds_check))
18020      {
18021 Index: libgfortran/generated/maxloc0_8_r8.c
18022 ===================================================================
18023 --- libgfortran/generated/maxloc0_8_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
18024 +++ libgfortran/generated/maxloc0_8_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
18025 @@ -58,7 +58,7 @@
18026        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18027        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18028        retarray->offset = 0;
18029 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18030 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18031      }
18032    else
18033      {
18034 @@ -199,7 +199,7 @@
18035        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18036        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18037        retarray->offset = 0;
18038 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18039 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18040      }
18041    else
18042      {
18043 @@ -367,7 +367,7 @@
18044        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18045        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18046        retarray->offset = 0;
18047 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18048 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18049      }
18050    else if (unlikely (compile_options.bounds_check))
18051      {
18052 Index: libgfortran/generated/minloc1_4_r10.c
18053 ===================================================================
18054 --- libgfortran/generated/minloc1_4_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18055 +++ libgfortran/generated/minloc1_4_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18056 @@ -98,10 +98,9 @@
18057        retarray->offset = 0;
18058        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18059  
18060 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18061 -                  * extent[rank-1];
18062 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18063  
18064 -      retarray->base_addr = xmalloc (alloc_size);
18065 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18066        if (alloc_size == 0)
18067         {
18068           /* Make sure we have a zero-sized array.  */
18069 @@ -294,8 +293,7 @@
18070  
18071         }
18072  
18073 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18074 -                  * extent[rank-1];
18075 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18076  
18077        retarray->offset = 0;
18078        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18079 @@ -307,7 +305,7 @@
18080           return;
18081         }
18082        else
18083 -       retarray->base_addr = xmalloc (alloc_size);
18084 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18085  
18086      }
18087    else
18088 @@ -485,8 +483,7 @@
18089        retarray->offset = 0;
18090        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18091  
18092 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18093 -                  * extent[rank-1];
18094 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18095  
18096        if (alloc_size == 0)
18097         {
18098 @@ -495,7 +492,7 @@
18099           return;
18100         }
18101        else
18102 -       retarray->base_addr = xmalloc (alloc_size);
18103 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18104      }
18105    else
18106      {
18107 Index: libgfortran/generated/minloc1_8_i16.c
18108 ===================================================================
18109 --- libgfortran/generated/minloc1_8_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18110 +++ libgfortran/generated/minloc1_8_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18111 @@ -98,10 +98,9 @@
18112        retarray->offset = 0;
18113        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18114  
18115 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18116 -                  * extent[rank-1];
18117 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18118  
18119 -      retarray->base_addr = xmalloc (alloc_size);
18120 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18121        if (alloc_size == 0)
18122         {
18123           /* Make sure we have a zero-sized array.  */
18124 @@ -294,8 +293,7 @@
18125  
18126         }
18127  
18128 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18129 -                  * extent[rank-1];
18130 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18131  
18132        retarray->offset = 0;
18133        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18134 @@ -307,7 +305,7 @@
18135           return;
18136         }
18137        else
18138 -       retarray->base_addr = xmalloc (alloc_size);
18139 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18140  
18141      }
18142    else
18143 @@ -485,8 +483,7 @@
18144        retarray->offset = 0;
18145        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18146  
18147 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18148 -                  * extent[rank-1];
18149 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18150  
18151        if (alloc_size == 0)
18152         {
18153 @@ -495,7 +492,7 @@
18154           return;
18155         }
18156        else
18157 -       retarray->base_addr = xmalloc (alloc_size);
18158 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18159      }
18160    else
18161      {
18162 Index: libgfortran/generated/maxloc0_8_r10.c
18163 ===================================================================
18164 --- libgfortran/generated/maxloc0_8_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18165 +++ libgfortran/generated/maxloc0_8_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18166 @@ -58,7 +58,7 @@
18167        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18168        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18169        retarray->offset = 0;
18170 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18171 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18172      }
18173    else
18174      {
18175 @@ -199,7 +199,7 @@
18176        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18177        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18178        retarray->offset = 0;
18179 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18180 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18181      }
18182    else
18183      {
18184 @@ -367,7 +367,7 @@
18185        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18186        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18187        retarray->offset = 0;
18188 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18189 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18190      }
18191    else if (unlikely (compile_options.bounds_check))
18192      {
18193 Index: libgfortran/generated/unpack_i4.c
18194 ===================================================================
18195 --- libgfortran/generated/unpack_i4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18196 +++ libgfortran/generated/unpack_i4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18197 @@ -99,7 +99,7 @@
18198           rs *= extent[n];
18199         }
18200        ret->offset = 0;
18201 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
18202 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
18203      }
18204    else
18205      {
18206 @@ -244,7 +244,7 @@
18207           rs *= extent[n];
18208         }
18209        ret->offset = 0;
18210 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
18211 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
18212      }
18213    else
18214      {
18215 Index: libgfortran/generated/minloc1_16_r4.c
18216 ===================================================================
18217 --- libgfortran/generated/minloc1_16_r4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18218 +++ libgfortran/generated/minloc1_16_r4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18219 @@ -98,10 +98,9 @@
18220        retarray->offset = 0;
18221        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18222  
18223 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18224 -                  * extent[rank-1];
18225 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18226  
18227 -      retarray->base_addr = xmalloc (alloc_size);
18228 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18229        if (alloc_size == 0)
18230         {
18231           /* Make sure we have a zero-sized array.  */
18232 @@ -294,8 +293,7 @@
18233  
18234         }
18235  
18236 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18237 -                  * extent[rank-1];
18238 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18239  
18240        retarray->offset = 0;
18241        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18242 @@ -307,7 +305,7 @@
18243           return;
18244         }
18245        else
18246 -       retarray->base_addr = xmalloc (alloc_size);
18247 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18248  
18249      }
18250    else
18251 @@ -485,8 +483,7 @@
18252        retarray->offset = 0;
18253        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18254  
18255 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18256 -                  * extent[rank-1];
18257 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18258  
18259        if (alloc_size == 0)
18260         {
18261 @@ -495,7 +492,7 @@
18262           return;
18263         }
18264        else
18265 -       retarray->base_addr = xmalloc (alloc_size);
18266 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18267      }
18268    else
18269      {
18270 Index: libgfortran/generated/product_i8.c
18271 ===================================================================
18272 --- libgfortran/generated/product_i8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
18273 +++ libgfortran/generated/product_i8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
18274 @@ -97,10 +97,9 @@
18275        retarray->offset = 0;
18276        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18277  
18278 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18279 -                  * extent[rank-1];
18280 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18281  
18282 -      retarray->base_addr = xmalloc (alloc_size);
18283 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18284        if (alloc_size == 0)
18285         {
18286           /* Make sure we have a zero-sized array.  */
18287 @@ -272,8 +271,7 @@
18288  
18289         }
18290  
18291 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18292 -                  * extent[rank-1];
18293 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18294  
18295        retarray->offset = 0;
18296        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18297 @@ -285,7 +283,7 @@
18298           return;
18299         }
18300        else
18301 -       retarray->base_addr = xmalloc (alloc_size);
18302 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18303  
18304      }
18305    else
18306 @@ -430,8 +428,7 @@
18307        retarray->offset = 0;
18308        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18309  
18310 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18311 -                  * extent[rank-1];
18312 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18313  
18314        if (alloc_size == 0)
18315         {
18316 @@ -440,7 +437,7 @@
18317           return;
18318         }
18319        else
18320 -       retarray->base_addr = xmalloc (alloc_size);
18321 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18322      }
18323    else
18324      {
18325 Index: libgfortran/generated/minloc0_16_r8.c
18326 ===================================================================
18327 --- libgfortran/generated/minloc0_16_r8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18328 +++ libgfortran/generated/minloc0_16_r8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18329 @@ -58,7 +58,7 @@
18330        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18331        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18332        retarray->offset = 0;
18333 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18334 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18335      }
18336    else
18337      {
18338 @@ -199,7 +199,7 @@
18339        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18340        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18341        retarray->offset = 0;
18342 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18343 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18344      }
18345    else
18346      {
18347 @@ -367,7 +367,7 @@
18348        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18349        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18350        retarray->offset = 0;
18351 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18352 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18353      }
18354    else if (unlikely (compile_options.bounds_check))
18355      {
18356 Index: libgfortran/generated/count_2_l.c
18357 ===================================================================
18358 --- libgfortran/generated/count_2_l.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18359 +++ libgfortran/generated/count_2_l.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18360 @@ -101,8 +101,7 @@
18361        retarray->offset = 0;
18362        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18363  
18364 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18365 -                  * extent[rank-1];
18366 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18367  
18368        if (alloc_size == 0)
18369         {
18370 @@ -111,7 +110,7 @@
18371           return;
18372         }
18373        else
18374 -       retarray->base_addr = xmalloc (alloc_size);
18375 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
18376      }
18377    else
18378      {
18379 Index: libgfortran/generated/transpose_r8.c
18380 ===================================================================
18381 --- libgfortran/generated/transpose_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
18382 +++ libgfortran/generated/transpose_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
18383 @@ -60,7 +60,8 @@
18384        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
18385                         GFC_DESCRIPTOR_EXTENT(source, 1));
18386  
18387 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
18388 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
18389 +                                     sizeof (GFC_REAL_8));
18390        ret->offset = 0;
18391      } else if (unlikely (compile_options.bounds_check))
18392      {
18393 Index: libgfortran/generated/cshift1_8.c
18394 ===================================================================
18395 --- libgfortran/generated/cshift1_8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18396 +++ libgfortran/generated/cshift1_8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18397 @@ -80,7 +80,7 @@
18398      {
18399        int i;
18400  
18401 -      ret->base_addr = xmalloc (size * arraysize);
18402 +      ret->base_addr = xmallocarray (arraysize, size);
18403        ret->offset = 0;
18404        ret->dtype = array->dtype;
18405        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
18406 Index: libgfortran/generated/matmul_i4.c
18407 ===================================================================
18408 --- libgfortran/generated/matmul_i4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18409 +++ libgfortran/generated/matmul_i4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18410 @@ -124,7 +124,7 @@
18411          }
18412  
18413        retarray->base_addr
18414 -       = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
18415 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
18416        retarray->offset = 0;
18417      }
18418      else if (unlikely (compile_options.bounds_check))
18419 Index: libgfortran/generated/pack_r10.c
18420 ===================================================================
18421 --- libgfortran/generated/pack_r10.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
18422 +++ libgfortran/generated/pack_r10.c    (.../branches/gcc-4_8-branch)   (revision 217117)
18423 @@ -167,8 +167,8 @@
18424  
18425           ret->offset = 0;
18426  
18427 -         /* xmalloc allocates a single byte for zero size.  */
18428 -         ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
18429 +         /* xmallocarray allocates a single byte for zero size.  */
18430 +         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
18431  
18432           if (total == 0)
18433             return;
18434 Index: libgfortran/generated/minloc1_16_i2.c
18435 ===================================================================
18436 --- libgfortran/generated/minloc1_16_i2.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18437 +++ libgfortran/generated/minloc1_16_i2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18438 @@ -98,10 +98,9 @@
18439        retarray->offset = 0;
18440        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18441  
18442 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18443 -                  * extent[rank-1];
18444 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18445  
18446 -      retarray->base_addr = xmalloc (alloc_size);
18447 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18448        if (alloc_size == 0)
18449         {
18450           /* Make sure we have a zero-sized array.  */
18451 @@ -294,8 +293,7 @@
18452  
18453         }
18454  
18455 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18456 -                  * extent[rank-1];
18457 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18458  
18459        retarray->offset = 0;
18460        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18461 @@ -307,7 +305,7 @@
18462           return;
18463         }
18464        else
18465 -       retarray->base_addr = xmalloc (alloc_size);
18466 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18467  
18468      }
18469    else
18470 @@ -485,8 +483,7 @@
18471        retarray->offset = 0;
18472        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18473  
18474 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18475 -                  * extent[rank-1];
18476 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18477  
18478        if (alloc_size == 0)
18479         {
18480 @@ -495,7 +492,7 @@
18481           return;
18482         }
18483        else
18484 -       retarray->base_addr = xmalloc (alloc_size);
18485 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18486      }
18487    else
18488      {
18489 Index: libgfortran/generated/in_pack_i8.c
18490 ===================================================================
18491 --- libgfortran/generated/in_pack_i8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
18492 +++ libgfortran/generated/in_pack_i8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
18493 @@ -76,7 +76,7 @@
18494      return source->base_addr;
18495  
18496    /* Allocate storage for the destination.  */
18497 -  destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
18498 +  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
18499    dest = destptr;
18500    src = source->base_addr;
18501    stride0 = stride[0];
18502 Index: libgfortran/generated/transpose_r16.c
18503 ===================================================================
18504 --- libgfortran/generated/transpose_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
18505 +++ libgfortran/generated/transpose_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
18506 @@ -60,7 +60,8 @@
18507        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
18508                         GFC_DESCRIPTOR_EXTENT(source, 1));
18509  
18510 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
18511 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
18512 +                                     sizeof (GFC_REAL_16));
18513        ret->offset = 0;
18514      } else if (unlikely (compile_options.bounds_check))
18515      {
18516 Index: libgfortran/generated/minloc1_4_i4.c
18517 ===================================================================
18518 --- libgfortran/generated/minloc1_4_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
18519 +++ libgfortran/generated/minloc1_4_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
18520 @@ -98,10 +98,9 @@
18521        retarray->offset = 0;
18522        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18523  
18524 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18525 -                  * extent[rank-1];
18526 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18527  
18528 -      retarray->base_addr = xmalloc (alloc_size);
18529 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18530        if (alloc_size == 0)
18531         {
18532           /* Make sure we have a zero-sized array.  */
18533 @@ -294,8 +293,7 @@
18534  
18535         }
18536  
18537 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18538 -                  * extent[rank-1];
18539 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18540  
18541        retarray->offset = 0;
18542        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18543 @@ -307,7 +305,7 @@
18544           return;
18545         }
18546        else
18547 -       retarray->base_addr = xmalloc (alloc_size);
18548 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18549  
18550      }
18551    else
18552 @@ -485,8 +483,7 @@
18553        retarray->offset = 0;
18554        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18555  
18556 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18557 -                  * extent[rank-1];
18558 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18559  
18560        if (alloc_size == 0)
18561         {
18562 @@ -495,7 +492,7 @@
18563           return;
18564         }
18565        else
18566 -       retarray->base_addr = xmalloc (alloc_size);
18567 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18568      }
18569    else
18570      {
18571 Index: libgfortran/generated/maxval_i1.c
18572 ===================================================================
18573 --- libgfortran/generated/maxval_i1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18574 +++ libgfortran/generated/maxval_i1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18575 @@ -97,10 +97,9 @@
18576        retarray->offset = 0;
18577        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18578  
18579 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18580 -                  * extent[rank-1];
18581 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18582  
18583 -      retarray->base_addr = xmalloc (alloc_size);
18584 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18585        if (alloc_size == 0)
18586         {
18587           /* Make sure we have a zero-sized array.  */
18588 @@ -286,8 +285,7 @@
18589  
18590         }
18591  
18592 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18593 -                  * extent[rank-1];
18594 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18595  
18596        retarray->offset = 0;
18597        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18598 @@ -299,7 +297,7 @@
18599           return;
18600         }
18601        else
18602 -       retarray->base_addr = xmalloc (alloc_size);
18603 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18604  
18605      }
18606    else
18607 @@ -472,8 +470,7 @@
18608        retarray->offset = 0;
18609        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18610  
18611 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18612 -                  * extent[rank-1];
18613 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18614  
18615        if (alloc_size == 0)
18616         {
18617 @@ -482,7 +479,7 @@
18618           return;
18619         }
18620        else
18621 -       retarray->base_addr = xmalloc (alloc_size);
18622 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18623      }
18624    else
18625      {
18626 Index: libgfortran/generated/product_c16.c
18627 ===================================================================
18628 --- libgfortran/generated/product_c16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
18629 +++ libgfortran/generated/product_c16.c (.../branches/gcc-4_8-branch)   (revision 217117)
18630 @@ -97,10 +97,9 @@
18631        retarray->offset = 0;
18632        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18633  
18634 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18635 -                  * extent[rank-1];
18636 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18637  
18638 -      retarray->base_addr = xmalloc (alloc_size);
18639 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
18640        if (alloc_size == 0)
18641         {
18642           /* Make sure we have a zero-sized array.  */
18643 @@ -272,8 +271,7 @@
18644  
18645         }
18646  
18647 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18648 -                  * extent[rank-1];
18649 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18650  
18651        retarray->offset = 0;
18652        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18653 @@ -285,7 +283,7 @@
18654           return;
18655         }
18656        else
18657 -       retarray->base_addr = xmalloc (alloc_size);
18658 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
18659  
18660      }
18661    else
18662 @@ -430,8 +428,7 @@
18663        retarray->offset = 0;
18664        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18665  
18666 -      alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18667 -                  * extent[rank-1];
18668 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18669  
18670        if (alloc_size == 0)
18671         {
18672 @@ -440,7 +437,7 @@
18673           return;
18674         }
18675        else
18676 -       retarray->base_addr = xmalloc (alloc_size);
18677 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
18678      }
18679    else
18680      {
18681 Index: libgfortran/generated/reshape_r4.c
18682 ===================================================================
18683 --- libgfortran/generated/reshape_r4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
18684 +++ libgfortran/generated/reshape_r4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
18685 @@ -111,11 +111,11 @@
18686        ret->offset = 0;
18687  
18688        if (unlikely (rs < 1))
18689 -        alloc_size = 1;
18690 +        alloc_size = 0;
18691        else
18692 -        alloc_size = rs * sizeof (GFC_REAL_4);
18693 +        alloc_size = rs;
18694  
18695 -      ret->base_addr = xmalloc (alloc_size);
18696 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
18697        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
18698      }
18699  
18700 Index: libgfortran/generated/iany_i8.c
18701 ===================================================================
18702 --- libgfortran/generated/iany_i8.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
18703 +++ libgfortran/generated/iany_i8.c     (.../branches/gcc-4_8-branch)   (revision 217117)
18704 @@ -97,10 +97,9 @@
18705        retarray->offset = 0;
18706        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18707  
18708 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18709 -                  * extent[rank-1];
18710 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18711  
18712 -      retarray->base_addr = xmalloc (alloc_size);
18713 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18714        if (alloc_size == 0)
18715         {
18716           /* Make sure we have a zero-sized array.  */
18717 @@ -272,8 +271,7 @@
18718  
18719         }
18720  
18721 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18722 -                  * extent[rank-1];
18723 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18724  
18725        retarray->offset = 0;
18726        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18727 @@ -285,7 +283,7 @@
18728           return;
18729         }
18730        else
18731 -       retarray->base_addr = xmalloc (alloc_size);
18732 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18733  
18734      }
18735    else
18736 @@ -430,8 +428,7 @@
18737        retarray->offset = 0;
18738        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18739  
18740 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18741 -                  * extent[rank-1];
18742 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18743  
18744        if (alloc_size == 0)
18745         {
18746 @@ -440,7 +437,7 @@
18747           return;
18748         }
18749        else
18750 -       retarray->base_addr = xmalloc (alloc_size);
18751 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18752      }
18753    else
18754      {
18755 Index: libgfortran/generated/cshift1_16.c
18756 ===================================================================
18757 --- libgfortran/generated/cshift1_16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
18758 +++ libgfortran/generated/cshift1_16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
18759 @@ -80,7 +80,7 @@
18760      {
18761        int i;
18762  
18763 -      ret->base_addr = xmalloc (size * arraysize);
18764 +      ret->base_addr = xmallocarray (arraysize, size);
18765        ret->offset = 0;
18766        ret->dtype = array->dtype;
18767        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
18768 Index: libgfortran/generated/maxloc0_4_i1.c
18769 ===================================================================
18770 --- libgfortran/generated/maxloc0_4_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
18771 +++ libgfortran/generated/maxloc0_4_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
18772 @@ -58,7 +58,7 @@
18773        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18774        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18775        retarray->offset = 0;
18776 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18777 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18778      }
18779    else
18780      {
18781 @@ -199,7 +199,7 @@
18782        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18783        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18784        retarray->offset = 0;
18785 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18786 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18787      }
18788    else
18789      {
18790 @@ -367,7 +367,7 @@
18791        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18792        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18793        retarray->offset = 0;
18794 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18795 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18796      }
18797    else if (unlikely (compile_options.bounds_check))
18798      {
18799 Index: libgfortran/generated/minloc0_4_i8.c
18800 ===================================================================
18801 --- libgfortran/generated/minloc0_4_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
18802 +++ libgfortran/generated/minloc0_4_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
18803 @@ -58,7 +58,7 @@
18804        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18805        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18806        retarray->offset = 0;
18807 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18808 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18809      }
18810    else
18811      {
18812 @@ -199,7 +199,7 @@
18813        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18814        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18815        retarray->offset = 0;
18816 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18817 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18818      }
18819    else
18820      {
18821 @@ -367,7 +367,7 @@
18822        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18823        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18824        retarray->offset = 0;
18825 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18826 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18827      }
18828    else if (unlikely (compile_options.bounds_check))
18829      {
18830 Index: libgfortran/generated/spread_c16.c
18831 ===================================================================
18832 --- libgfortran/generated/spread_c16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
18833 +++ libgfortran/generated/spread_c16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
18834 @@ -101,8 +101,8 @@
18835         }
18836        ret->offset = 0;
18837  
18838 -      /* xmalloc allocates a single byte for zero size.  */
18839 -      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
18840 +      /* xmallocarray allocates a single byte for zero size.  */
18841 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
18842        if (rs <= 0)
18843          return;
18844      }
18845 @@ -244,7 +244,7 @@
18846  
18847    if (ret->base_addr == NULL)
18848      {
18849 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
18850 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
18851        ret->offset = 0;
18852        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
18853      }
18854 Index: libgfortran/generated/maxval_r4.c
18855 ===================================================================
18856 --- libgfortran/generated/maxval_r4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18857 +++ libgfortran/generated/maxval_r4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18858 @@ -97,10 +97,9 @@
18859        retarray->offset = 0;
18860        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18861  
18862 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18863 -                  * extent[rank-1];
18864 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18865  
18866 -      retarray->base_addr = xmalloc (alloc_size);
18867 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
18868        if (alloc_size == 0)
18869         {
18870           /* Make sure we have a zero-sized array.  */
18871 @@ -286,8 +285,7 @@
18872  
18873         }
18874  
18875 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18876 -                  * extent[rank-1];
18877 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18878  
18879        retarray->offset = 0;
18880        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18881 @@ -299,7 +297,7 @@
18882           return;
18883         }
18884        else
18885 -       retarray->base_addr = xmalloc (alloc_size);
18886 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
18887  
18888      }
18889    else
18890 @@ -472,8 +470,7 @@
18891        retarray->offset = 0;
18892        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18893  
18894 -      alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18895 -                  * extent[rank-1];
18896 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18897  
18898        if (alloc_size == 0)
18899         {
18900 @@ -482,7 +479,7 @@
18901           return;
18902         }
18903        else
18904 -       retarray->base_addr = xmalloc (alloc_size);
18905 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
18906      }
18907    else
18908      {
18909 Index: libgfortran/generated/minval_r8.c
18910 ===================================================================
18911 --- libgfortran/generated/minval_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
18912 +++ libgfortran/generated/minval_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
18913 @@ -97,10 +97,9 @@
18914        retarray->offset = 0;
18915        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18916  
18917 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18918 -                  * extent[rank-1];
18919 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18920  
18921 -      retarray->base_addr = xmalloc (alloc_size);
18922 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18923        if (alloc_size == 0)
18924         {
18925           /* Make sure we have a zero-sized array.  */
18926 @@ -286,8 +285,7 @@
18927  
18928         }
18929  
18930 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18931 -                  * extent[rank-1];
18932 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18933  
18934        retarray->offset = 0;
18935        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18936 @@ -299,7 +297,7 @@
18937           return;
18938         }
18939        else
18940 -       retarray->base_addr = xmalloc (alloc_size);
18941 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18942  
18943      }
18944    else
18945 @@ -472,8 +470,7 @@
18946        retarray->offset = 0;
18947        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18948  
18949 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18950 -                  * extent[rank-1];
18951 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18952  
18953        if (alloc_size == 0)
18954         {
18955 @@ -482,7 +479,7 @@
18956           return;
18957         }
18958        else
18959 -       retarray->base_addr = xmalloc (alloc_size);
18960 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18961      }
18962    else
18963      {
18964 Index: libgfortran/generated/minloc1_16_r16.c
18965 ===================================================================
18966 --- libgfortran/generated/minloc1_16_r16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
18967 +++ libgfortran/generated/minloc1_16_r16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
18968 @@ -98,10 +98,9 @@
18969        retarray->offset = 0;
18970        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18971  
18972 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18973 -                  * extent[rank-1];
18974 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18975  
18976 -      retarray->base_addr = xmalloc (alloc_size);
18977 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18978        if (alloc_size == 0)
18979         {
18980           /* Make sure we have a zero-sized array.  */
18981 @@ -294,8 +293,7 @@
18982  
18983         }
18984  
18985 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18986 -                  * extent[rank-1];
18987 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18988  
18989        retarray->offset = 0;
18990        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18991 @@ -307,7 +305,7 @@
18992           return;
18993         }
18994        else
18995 -       retarray->base_addr = xmalloc (alloc_size);
18996 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18997  
18998      }
18999    else
19000 @@ -485,8 +483,7 @@
19001        retarray->offset = 0;
19002        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19003  
19004 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19005 -                  * extent[rank-1];
19006 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19007  
19008        if (alloc_size == 0)
19009         {
19010 @@ -495,7 +492,7 @@
19011           return;
19012         }
19013        else
19014 -       retarray->base_addr = xmalloc (alloc_size);
19015 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19016      }
19017    else
19018      {
19019 Index: libgfortran/generated/unpack_i16.c
19020 ===================================================================
19021 --- libgfortran/generated/unpack_i16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
19022 +++ libgfortran/generated/unpack_i16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
19023 @@ -99,7 +99,7 @@
19024           rs *= extent[n];
19025         }
19026        ret->offset = 0;
19027 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
19028 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
19029      }
19030    else
19031      {
19032 @@ -244,7 +244,7 @@
19033           rs *= extent[n];
19034         }
19035        ret->offset = 0;
19036 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
19037 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
19038      }
19039    else
19040      {
19041 Index: libgfortran/generated/sum_i8.c
19042 ===================================================================
19043 --- libgfortran/generated/sum_i8.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
19044 +++ libgfortran/generated/sum_i8.c      (.../branches/gcc-4_8-branch)   (revision 217117)
19045 @@ -97,10 +97,9 @@
19046        retarray->offset = 0;
19047        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19048  
19049 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19050 -                  * extent[rank-1];
19051 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19052  
19053 -      retarray->base_addr = xmalloc (alloc_size);
19054 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19055        if (alloc_size == 0)
19056         {
19057           /* Make sure we have a zero-sized array.  */
19058 @@ -272,8 +271,7 @@
19059  
19060         }
19061  
19062 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19063 -                  * extent[rank-1];
19064 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19065  
19066        retarray->offset = 0;
19067        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19068 @@ -285,7 +283,7 @@
19069           return;
19070         }
19071        else
19072 -       retarray->base_addr = xmalloc (alloc_size);
19073 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19074  
19075      }
19076    else
19077 @@ -430,8 +428,7 @@
19078        retarray->offset = 0;
19079        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19080  
19081 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19082 -                  * extent[rank-1];
19083 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19084  
19085        if (alloc_size == 0)
19086         {
19087 @@ -440,7 +437,7 @@
19088           return;
19089         }
19090        else
19091 -       retarray->base_addr = xmalloc (alloc_size);
19092 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19093      }
19094    else
19095      {
19096 Index: libgfortran/generated/pack_i1.c
19097 ===================================================================
19098 --- libgfortran/generated/pack_i1.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19099 +++ libgfortran/generated/pack_i1.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19100 @@ -167,8 +167,8 @@
19101  
19102           ret->offset = 0;
19103  
19104 -         /* xmalloc allocates a single byte for zero size.  */
19105 -         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
19106 +         /* xmallocarray allocates a single byte for zero size.  */
19107 +         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
19108  
19109           if (total == 0)
19110             return;
19111 Index: libgfortran/generated/any_l16.c
19112 ===================================================================
19113 --- libgfortran/generated/any_l16.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19114 +++ libgfortran/generated/any_l16.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19115 @@ -101,8 +101,7 @@
19116        retarray->offset = 0;
19117        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19118  
19119 -      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19120 -                  * extent[rank-1];
19121 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19122  
19123        if (alloc_size == 0)
19124         {
19125 @@ -111,7 +110,7 @@
19126           return;
19127         }
19128        else
19129 -       retarray->base_addr = xmalloc (alloc_size);
19130 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
19131      }
19132    else
19133      {
19134 Index: libgfortran/generated/spread_i8.c
19135 ===================================================================
19136 --- libgfortran/generated/spread_i8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
19137 +++ libgfortran/generated/spread_i8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
19138 @@ -101,8 +101,8 @@
19139         }
19140        ret->offset = 0;
19141  
19142 -      /* xmalloc allocates a single byte for zero size.  */
19143 -      ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
19144 +      /* xmallocarray allocates a single byte for zero size.  */
19145 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
19146        if (rs <= 0)
19147          return;
19148      }
19149 @@ -244,7 +244,7 @@
19150  
19151    if (ret->base_addr == NULL)
19152      {
19153 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
19154 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
19155        ret->offset = 0;
19156        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
19157      }
19158 Index: libgfortran/generated/maxval_i2.c
19159 ===================================================================
19160 --- libgfortran/generated/maxval_i2.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
19161 +++ libgfortran/generated/maxval_i2.c   (.../branches/gcc-4_8-branch)   (revision 217117)
19162 @@ -97,10 +97,9 @@
19163        retarray->offset = 0;
19164        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19165  
19166 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19167 -                  * extent[rank-1];
19168 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19169  
19170 -      retarray->base_addr = xmalloc (alloc_size);
19171 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
19172        if (alloc_size == 0)
19173         {
19174           /* Make sure we have a zero-sized array.  */
19175 @@ -286,8 +285,7 @@
19176  
19177         }
19178  
19179 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19180 -                  * extent[rank-1];
19181 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19182  
19183        retarray->offset = 0;
19184        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19185 @@ -299,7 +297,7 @@
19186           return;
19187         }
19188        else
19189 -       retarray->base_addr = xmalloc (alloc_size);
19190 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
19191  
19192      }
19193    else
19194 @@ -472,8 +470,7 @@
19195        retarray->offset = 0;
19196        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19197  
19198 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19199 -                  * extent[rank-1];
19200 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19201  
19202        if (alloc_size == 0)
19203         {
19204 @@ -482,7 +479,7 @@
19205           return;
19206         }
19207        else
19208 -       retarray->base_addr = xmalloc (alloc_size);
19209 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
19210      }
19211    else
19212      {
19213 Index: libgfortran/generated/maxloc1_8_i4.c
19214 ===================================================================
19215 --- libgfortran/generated/maxloc1_8_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19216 +++ libgfortran/generated/maxloc1_8_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19217 @@ -98,10 +98,9 @@
19218        retarray->offset = 0;
19219        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19220  
19221 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19222 -                  * extent[rank-1];
19223 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19224  
19225 -      retarray->base_addr = xmalloc (alloc_size);
19226 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19227        if (alloc_size == 0)
19228         {
19229           /* Make sure we have a zero-sized array.  */
19230 @@ -294,8 +293,7 @@
19231  
19232         }
19233  
19234 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19235 -                  * extent[rank-1];
19236 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19237  
19238        retarray->offset = 0;
19239        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19240 @@ -307,7 +305,7 @@
19241           return;
19242         }
19243        else
19244 -       retarray->base_addr = xmalloc (alloc_size);
19245 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19246  
19247      }
19248    else
19249 @@ -485,8 +483,7 @@
19250        retarray->offset = 0;
19251        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19252  
19253 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19254 -                  * extent[rank-1];
19255 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19256  
19257        if (alloc_size == 0)
19258         {
19259 @@ -495,7 +492,7 @@
19260           return;
19261         }
19262        else
19263 -       retarray->base_addr = xmalloc (alloc_size);
19264 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19265      }
19266    else
19267      {
19268 Index: libgfortran/generated/unpack_r8.c
19269 ===================================================================
19270 --- libgfortran/generated/unpack_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
19271 +++ libgfortran/generated/unpack_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
19272 @@ -99,7 +99,7 @@
19273           rs *= extent[n];
19274         }
19275        ret->offset = 0;
19276 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
19277 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
19278      }
19279    else
19280      {
19281 @@ -244,7 +244,7 @@
19282           rs *= extent[n];
19283         }
19284        ret->offset = 0;
19285 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
19286 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
19287      }
19288    else
19289      {
19290 Index: libgfortran/generated/maxloc0_4_r4.c
19291 ===================================================================
19292 --- libgfortran/generated/maxloc0_4_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19293 +++ libgfortran/generated/maxloc0_4_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19294 @@ -58,7 +58,7 @@
19295        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19296        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19297        retarray->offset = 0;
19298 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19299 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19300      }
19301    else
19302      {
19303 @@ -199,7 +199,7 @@
19304        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19305        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19306        retarray->offset = 0;
19307 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19308 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19309      }
19310    else
19311      {
19312 @@ -367,7 +367,7 @@
19313        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19314        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19315        retarray->offset = 0;
19316 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19317 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19318      }
19319    else if (unlikely (compile_options.bounds_check))
19320      {
19321 Index: libgfortran/generated/all_l1.c
19322 ===================================================================
19323 --- libgfortran/generated/all_l1.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
19324 +++ libgfortran/generated/all_l1.c      (.../branches/gcc-4_8-branch)   (revision 217117)
19325 @@ -101,8 +101,7 @@
19326        retarray->offset = 0;
19327        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19328  
19329 -      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19330 -                  * extent[rank-1];
19331 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19332  
19333        if (alloc_size == 0)
19334         {
19335 @@ -111,7 +110,7 @@
19336           return;
19337         }
19338        else
19339 -       retarray->base_addr = xmalloc (alloc_size);
19340 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
19341      }
19342    else
19343      {
19344 Index: libgfortran/generated/matmul_r8.c
19345 ===================================================================
19346 --- libgfortran/generated/matmul_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
19347 +++ libgfortran/generated/matmul_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
19348 @@ -124,7 +124,7 @@
19349          }
19350  
19351        retarray->base_addr
19352 -       = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
19353 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
19354        retarray->offset = 0;
19355      }
19356      else if (unlikely (compile_options.bounds_check))
19357 Index: libgfortran/generated/minloc0_4_r16.c
19358 ===================================================================
19359 --- libgfortran/generated/minloc0_4_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19360 +++ libgfortran/generated/minloc0_4_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19361 @@ -58,7 +58,7 @@
19362        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19363        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19364        retarray->offset = 0;
19365 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19366 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19367      }
19368    else
19369      {
19370 @@ -199,7 +199,7 @@
19371        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19372        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19373        retarray->offset = 0;
19374 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19375 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19376      }
19377    else
19378      {
19379 @@ -367,7 +367,7 @@
19380        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19381        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19382        retarray->offset = 0;
19383 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19384 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19385      }
19386    else if (unlikely (compile_options.bounds_check))
19387      {
19388 Index: libgfortran/generated/maxloc0_4_i2.c
19389 ===================================================================
19390 --- libgfortran/generated/maxloc0_4_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19391 +++ libgfortran/generated/maxloc0_4_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19392 @@ -58,7 +58,7 @@
19393        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19394        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19395        retarray->offset = 0;
19396 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19397 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19398      }
19399    else
19400      {
19401 @@ -199,7 +199,7 @@
19402        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19403        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19404        retarray->offset = 0;
19405 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19406 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19407      }
19408    else
19409      {
19410 @@ -367,7 +367,7 @@
19411        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19412        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19413        retarray->offset = 0;
19414 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19415 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19416      }
19417    else if (unlikely (compile_options.bounds_check))
19418      {
19419 Index: libgfortran/generated/minloc1_8_r16.c
19420 ===================================================================
19421 --- libgfortran/generated/minloc1_8_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19422 +++ libgfortran/generated/minloc1_8_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19423 @@ -98,10 +98,9 @@
19424        retarray->offset = 0;
19425        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19426  
19427 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19428 -                  * extent[rank-1];
19429 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19430  
19431 -      retarray->base_addr = xmalloc (alloc_size);
19432 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19433        if (alloc_size == 0)
19434         {
19435           /* Make sure we have a zero-sized array.  */
19436 @@ -294,8 +293,7 @@
19437  
19438         }
19439  
19440 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19441 -                  * extent[rank-1];
19442 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19443  
19444        retarray->offset = 0;
19445        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19446 @@ -307,7 +305,7 @@
19447           return;
19448         }
19449        else
19450 -       retarray->base_addr = xmalloc (alloc_size);
19451 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19452  
19453      }
19454    else
19455 @@ -485,8 +483,7 @@
19456        retarray->offset = 0;
19457        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19458  
19459 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19460 -                  * extent[rank-1];
19461 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19462  
19463        if (alloc_size == 0)
19464         {
19465 @@ -495,7 +492,7 @@
19466           return;
19467         }
19468        else
19469 -       retarray->base_addr = xmalloc (alloc_size);
19470 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19471      }
19472    else
19473      {
19474 Index: libgfortran/generated/pack_c10.c
19475 ===================================================================
19476 --- libgfortran/generated/pack_c10.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
19477 +++ libgfortran/generated/pack_c10.c    (.../branches/gcc-4_8-branch)   (revision 217117)
19478 @@ -167,8 +167,8 @@
19479  
19480           ret->offset = 0;
19481  
19482 -         /* xmalloc allocates a single byte for zero size.  */
19483 -         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
19484 +         /* xmallocarray allocates a single byte for zero size.  */
19485 +         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
19486  
19487           if (total == 0)
19488             return;
19489 Index: libgfortran/generated/pack_r4.c
19490 ===================================================================
19491 --- libgfortran/generated/pack_r4.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19492 +++ libgfortran/generated/pack_r4.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19493 @@ -167,8 +167,8 @@
19494  
19495           ret->offset = 0;
19496  
19497 -         /* xmalloc allocates a single byte for zero size.  */
19498 -         ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
19499 +         /* xmallocarray allocates a single byte for zero size.  */
19500 +         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
19501  
19502           if (total == 0)
19503             return;
19504 Index: libgfortran/generated/transpose_c16.c
19505 ===================================================================
19506 --- libgfortran/generated/transpose_c16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19507 +++ libgfortran/generated/transpose_c16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19508 @@ -60,7 +60,8 @@
19509        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
19510                         GFC_DESCRIPTOR_EXTENT(source, 1));
19511  
19512 -      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
19513 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
19514 +                                     sizeof (GFC_COMPLEX_16));
19515        ret->offset = 0;
19516      } else if (unlikely (compile_options.bounds_check))
19517      {
19518 Index: libgfortran/generated/maxloc0_8_i8.c
19519 ===================================================================
19520 --- libgfortran/generated/maxloc0_8_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19521 +++ libgfortran/generated/maxloc0_8_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19522 @@ -58,7 +58,7 @@
19523        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19524        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19525        retarray->offset = 0;
19526 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19527 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19528      }
19529    else
19530      {
19531 @@ -199,7 +199,7 @@
19532        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19533        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19534        retarray->offset = 0;
19535 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19536 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19537      }
19538    else
19539      {
19540 @@ -367,7 +367,7 @@
19541        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19542        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19543        retarray->offset = 0;
19544 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19545 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19546      }
19547    else if (unlikely (compile_options.bounds_check))
19548      {
19549 Index: libgfortran/generated/minloc1_4_r8.c
19550 ===================================================================
19551 --- libgfortran/generated/minloc1_4_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19552 +++ libgfortran/generated/minloc1_4_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19553 @@ -98,10 +98,9 @@
19554        retarray->offset = 0;
19555        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19556  
19557 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19558 -                  * extent[rank-1];
19559 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19560  
19561 -      retarray->base_addr = xmalloc (alloc_size);
19562 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19563        if (alloc_size == 0)
19564         {
19565           /* Make sure we have a zero-sized array.  */
19566 @@ -294,8 +293,7 @@
19567  
19568         }
19569  
19570 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19571 -                  * extent[rank-1];
19572 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19573  
19574        retarray->offset = 0;
19575        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19576 @@ -307,7 +305,7 @@
19577           return;
19578         }
19579        else
19580 -       retarray->base_addr = xmalloc (alloc_size);
19581 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19582  
19583      }
19584    else
19585 @@ -485,8 +483,7 @@
19586        retarray->offset = 0;
19587        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19588  
19589 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19590 -                  * extent[rank-1];
19591 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19592  
19593        if (alloc_size == 0)
19594         {
19595 @@ -495,7 +492,7 @@
19596           return;
19597         }
19598        else
19599 -       retarray->base_addr = xmalloc (alloc_size);
19600 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19601      }
19602    else
19603      {
19604 Index: libgfortran/generated/minloc1_16_i4.c
19605 ===================================================================
19606 --- libgfortran/generated/minloc1_16_i4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19607 +++ libgfortran/generated/minloc1_16_i4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19608 @@ -98,10 +98,9 @@
19609        retarray->offset = 0;
19610        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19611  
19612 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19613 -                  * extent[rank-1];
19614 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19615  
19616 -      retarray->base_addr = xmalloc (alloc_size);
19617 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19618        if (alloc_size == 0)
19619         {
19620           /* Make sure we have a zero-sized array.  */
19621 @@ -294,8 +293,7 @@
19622  
19623         }
19624  
19625 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19626 -                  * extent[rank-1];
19627 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19628  
19629        retarray->offset = 0;
19630        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19631 @@ -307,7 +305,7 @@
19632           return;
19633         }
19634        else
19635 -       retarray->base_addr = xmalloc (alloc_size);
19636 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19637  
19638      }
19639    else
19640 @@ -485,8 +483,7 @@
19641        retarray->offset = 0;
19642        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19643  
19644 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19645 -                  * extent[rank-1];
19646 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19647  
19648        if (alloc_size == 0)
19649         {
19650 @@ -495,7 +492,7 @@
19651           return;
19652         }
19653        else
19654 -       retarray->base_addr = xmalloc (alloc_size);
19655 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19656      }
19657    else
19658      {
19659 Index: libgfortran/generated/minloc0_16_i8.c
19660 ===================================================================
19661 --- libgfortran/generated/minloc0_16_i8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19662 +++ libgfortran/generated/minloc0_16_i8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19663 @@ -58,7 +58,7 @@
19664        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19665        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19666        retarray->offset = 0;
19667 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19668 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19669      }
19670    else
19671      {
19672 @@ -199,7 +199,7 @@
19673        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19674        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19675        retarray->offset = 0;
19676 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19677 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19678      }
19679    else
19680      {
19681 @@ -367,7 +367,7 @@
19682        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19683        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19684        retarray->offset = 0;
19685 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19686 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19687      }
19688    else if (unlikely (compile_options.bounds_check))
19689      {
19690 Index: libgfortran/generated/pack_i2.c
19691 ===================================================================
19692 --- libgfortran/generated/pack_i2.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19693 +++ libgfortran/generated/pack_i2.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19694 @@ -167,8 +167,8 @@
19695  
19696           ret->offset = 0;
19697  
19698 -         /* xmalloc allocates a single byte for zero size.  */
19699 -         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
19700 +         /* xmallocarray allocates a single byte for zero size.  */
19701 +         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
19702  
19703           if (total == 0)
19704             return;
19705 Index: libgfortran/generated/transpose_i8.c
19706 ===================================================================
19707 --- libgfortran/generated/transpose_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19708 +++ libgfortran/generated/transpose_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19709 @@ -60,7 +60,8 @@
19710        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
19711                         GFC_DESCRIPTOR_EXTENT(source, 1));
19712  
19713 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
19714 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
19715 +                                     sizeof (GFC_INTEGER_8));
19716        ret->offset = 0;
19717      } else if (unlikely (compile_options.bounds_check))
19718      {
19719 Index: libgfortran/generated/eoshift1_16.c
19720 ===================================================================
19721 --- libgfortran/generated/eoshift1_16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
19722 +++ libgfortran/generated/eoshift1_16.c (.../branches/gcc-4_8-branch)   (revision 217117)
19723 @@ -105,8 +105,8 @@
19724           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
19725  
19726          }
19727 -      /* xmalloc allocates a single byte for zero size.  */
19728 -      ret->base_addr = xmalloc (size * arraysize);
19729 +      /* xmallocarray allocates a single byte for zero size.  */
19730 +      ret->base_addr = xmallocarray (arraysize, size);
19731  
19732      }
19733    else if (unlikely (compile_options.bounds_check))
19734 Index: libgfortran/generated/all_l2.c
19735 ===================================================================
19736 --- libgfortran/generated/all_l2.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
19737 +++ libgfortran/generated/all_l2.c      (.../branches/gcc-4_8-branch)   (revision 217117)
19738 @@ -101,8 +101,7 @@
19739        retarray->offset = 0;
19740        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19741  
19742 -      alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19743 -                  * extent[rank-1];
19744 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19745  
19746        if (alloc_size == 0)
19747         {
19748 @@ -111,7 +110,7 @@
19749           return;
19750         }
19751        else
19752 -       retarray->base_addr = xmalloc (alloc_size);
19753 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
19754      }
19755    else
19756      {
19757 Index: libgfortran/generated/product_c4.c
19758 ===================================================================
19759 --- libgfortran/generated/product_c4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
19760 +++ libgfortran/generated/product_c4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
19761 @@ -97,10 +97,9 @@
19762        retarray->offset = 0;
19763        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19764  
19765 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19766 -                  * extent[rank-1];
19767 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19768  
19769 -      retarray->base_addr = xmalloc (alloc_size);
19770 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
19771        if (alloc_size == 0)
19772         {
19773           /* Make sure we have a zero-sized array.  */
19774 @@ -272,8 +271,7 @@
19775  
19776         }
19777  
19778 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19779 -                  * extent[rank-1];
19780 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19781  
19782        retarray->offset = 0;
19783        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19784 @@ -285,7 +283,7 @@
19785           return;
19786         }
19787        else
19788 -       retarray->base_addr = xmalloc (alloc_size);
19789 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
19790  
19791      }
19792    else
19793 @@ -430,8 +428,7 @@
19794        retarray->offset = 0;
19795        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19796  
19797 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19798 -                  * extent[rank-1];
19799 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19800  
19801        if (alloc_size == 0)
19802         {
19803 @@ -440,7 +437,7 @@
19804           return;
19805         }
19806        else
19807 -       retarray->base_addr = xmalloc (alloc_size);
19808 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
19809      }
19810    else
19811      {
19812 Index: libgfortran/generated/iall_i1.c
19813 ===================================================================
19814 --- libgfortran/generated/iall_i1.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19815 +++ libgfortran/generated/iall_i1.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19816 @@ -97,10 +97,9 @@
19817        retarray->offset = 0;
19818        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19819  
19820 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19821 -                  * extent[rank-1];
19822 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19823  
19824 -      retarray->base_addr = xmalloc (alloc_size);
19825 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19826        if (alloc_size == 0)
19827         {
19828           /* Make sure we have a zero-sized array.  */
19829 @@ -272,8 +271,7 @@
19830  
19831         }
19832  
19833 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19834 -                  * extent[rank-1];
19835 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19836  
19837        retarray->offset = 0;
19838        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19839 @@ -285,7 +283,7 @@
19840           return;
19841         }
19842        else
19843 -       retarray->base_addr = xmalloc (alloc_size);
19844 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19845  
19846      }
19847    else
19848 @@ -430,8 +428,7 @@
19849        retarray->offset = 0;
19850        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19851  
19852 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19853 -                  * extent[rank-1];
19854 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19855  
19856        if (alloc_size == 0)
19857         {
19858 @@ -440,7 +437,7 @@
19859           return;
19860         }
19861        else
19862 -       retarray->base_addr = xmalloc (alloc_size);
19863 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19864      }
19865    else
19866      {
19867 Index: libgfortran/generated/reshape_i4.c
19868 ===================================================================
19869 --- libgfortran/generated/reshape_i4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
19870 +++ libgfortran/generated/reshape_i4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
19871 @@ -111,11 +111,11 @@
19872        ret->offset = 0;
19873  
19874        if (unlikely (rs < 1))
19875 -        alloc_size = 1;
19876 +        alloc_size = 0;
19877        else
19878 -        alloc_size = rs * sizeof (GFC_INTEGER_4);
19879 +        alloc_size = rs;
19880  
19881 -      ret->base_addr = xmalloc (alloc_size);
19882 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19883        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
19884      }
19885  
19886 Index: libgfortran/generated/in_pack_r10.c
19887 ===================================================================
19888 --- libgfortran/generated/in_pack_r10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
19889 +++ libgfortran/generated/in_pack_r10.c (.../branches/gcc-4_8-branch)   (revision 217117)
19890 @@ -76,7 +76,7 @@
19891      return source->base_addr;
19892  
19893    /* Allocate storage for the destination.  */
19894 -  destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
19895 +  destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
19896    dest = destptr;
19897    src = source->base_addr;
19898    stride0 = stride[0];
19899 Index: libgfortran/generated/in_pack_c4.c
19900 ===================================================================
19901 --- libgfortran/generated/in_pack_c4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
19902 +++ libgfortran/generated/in_pack_c4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
19903 @@ -76,7 +76,7 @@
19904      return source->base_addr;
19905  
19906    /* Allocate storage for the destination.  */
19907 -  destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
19908 +  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
19909    dest = destptr;
19910    src = source->base_addr;
19911    stride0 = stride[0];
19912 Index: libgfortran/generated/all_l16.c
19913 ===================================================================
19914 --- libgfortran/generated/all_l16.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
19915 +++ libgfortran/generated/all_l16.c     (.../branches/gcc-4_8-branch)   (revision 217117)
19916 @@ -101,8 +101,7 @@
19917        retarray->offset = 0;
19918        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19919  
19920 -      alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19921 -                  * extent[rank-1];
19922 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19923  
19924        if (alloc_size == 0)
19925         {
19926 @@ -111,7 +110,7 @@
19927           return;
19928         }
19929        else
19930 -       retarray->base_addr = xmalloc (alloc_size);
19931 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
19932      }
19933    else
19934      {
19935 Index: libgfortran/generated/maxloc0_16_i1.c
19936 ===================================================================
19937 --- libgfortran/generated/maxloc0_16_i1.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
19938 +++ libgfortran/generated/maxloc0_16_i1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
19939 @@ -58,7 +58,7 @@
19940        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19941        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19942        retarray->offset = 0;
19943 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19944 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19945      }
19946    else
19947      {
19948 @@ -199,7 +199,7 @@
19949        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19950        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19951        retarray->offset = 0;
19952 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19953 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19954      }
19955    else
19956      {
19957 @@ -367,7 +367,7 @@
19958        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19959        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19960        retarray->offset = 0;
19961 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19962 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19963      }
19964    else if (unlikely (compile_options.bounds_check))
19965      {
19966 Index: libgfortran/generated/maxloc1_8_r8.c
19967 ===================================================================
19968 --- libgfortran/generated/maxloc1_8_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
19969 +++ libgfortran/generated/maxloc1_8_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
19970 @@ -98,10 +98,9 @@
19971        retarray->offset = 0;
19972        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19973  
19974 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19975 -                  * extent[rank-1];
19976 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19977  
19978 -      retarray->base_addr = xmalloc (alloc_size);
19979 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19980        if (alloc_size == 0)
19981         {
19982           /* Make sure we have a zero-sized array.  */
19983 @@ -294,8 +293,7 @@
19984  
19985         }
19986  
19987 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19988 -                  * extent[rank-1];
19989 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19990  
19991        retarray->offset = 0;
19992        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19993 @@ -307,7 +305,7 @@
19994           return;
19995         }
19996        else
19997 -       retarray->base_addr = xmalloc (alloc_size);
19998 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19999  
20000      }
20001    else
20002 @@ -485,8 +483,7 @@
20003        retarray->offset = 0;
20004        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20005  
20006 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20007 -                  * extent[rank-1];
20008 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20009  
20010        if (alloc_size == 0)
20011         {
20012 @@ -495,7 +492,7 @@
20013           return;
20014         }
20015        else
20016 -       retarray->base_addr = xmalloc (alloc_size);
20017 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20018      }
20019    else
20020      {
20021 Index: libgfortran/generated/minval_i16.c
20022 ===================================================================
20023 --- libgfortran/generated/minval_i16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
20024 +++ libgfortran/generated/minval_i16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
20025 @@ -97,10 +97,9 @@
20026        retarray->offset = 0;
20027        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20028  
20029 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20030 -                  * extent[rank-1];
20031 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20032  
20033 -      retarray->base_addr = xmalloc (alloc_size);
20034 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20035        if (alloc_size == 0)
20036         {
20037           /* Make sure we have a zero-sized array.  */
20038 @@ -286,8 +285,7 @@
20039  
20040         }
20041  
20042 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20043 -                  * extent[rank-1];
20044 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20045  
20046        retarray->offset = 0;
20047        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20048 @@ -299,7 +297,7 @@
20049           return;
20050         }
20051        else
20052 -       retarray->base_addr = xmalloc (alloc_size);
20053 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20054  
20055      }
20056    else
20057 @@ -472,8 +470,7 @@
20058        retarray->offset = 0;
20059        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20060  
20061 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20062 -                  * extent[rank-1];
20063 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20064  
20065        if (alloc_size == 0)
20066         {
20067 @@ -482,7 +479,7 @@
20068           return;
20069         }
20070        else
20071 -       retarray->base_addr = xmalloc (alloc_size);
20072 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20073      }
20074    else
20075      {
20076 Index: libgfortran/generated/reshape_r10.c
20077 ===================================================================
20078 --- libgfortran/generated/reshape_r10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
20079 +++ libgfortran/generated/reshape_r10.c (.../branches/gcc-4_8-branch)   (revision 217117)
20080 @@ -111,11 +111,11 @@
20081        ret->offset = 0;
20082  
20083        if (unlikely (rs < 1))
20084 -        alloc_size = 1;
20085 +        alloc_size = 0;
20086        else
20087 -        alloc_size = rs * sizeof (GFC_REAL_10);
20088 +        alloc_size = rs;
20089  
20090 -      ret->base_addr = xmalloc (alloc_size);
20091 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20092        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
20093      }
20094  
20095 Index: libgfortran/generated/unpack_r16.c
20096 ===================================================================
20097 --- libgfortran/generated/unpack_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
20098 +++ libgfortran/generated/unpack_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
20099 @@ -99,7 +99,7 @@
20100           rs *= extent[n];
20101         }
20102        ret->offset = 0;
20103 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
20104 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
20105      }
20106    else
20107      {
20108 @@ -244,7 +244,7 @@
20109           rs *= extent[n];
20110         }
20111        ret->offset = 0;
20112 -      ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
20113 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
20114      }
20115    else
20116      {
20117 Index: libgfortran/generated/maxval_i4.c
20118 ===================================================================
20119 --- libgfortran/generated/maxval_i4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20120 +++ libgfortran/generated/maxval_i4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20121 @@ -97,10 +97,9 @@
20122        retarray->offset = 0;
20123        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20124  
20125 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20126 -                  * extent[rank-1];
20127 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20128  
20129 -      retarray->base_addr = xmalloc (alloc_size);
20130 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20131        if (alloc_size == 0)
20132         {
20133           /* Make sure we have a zero-sized array.  */
20134 @@ -286,8 +285,7 @@
20135  
20136         }
20137  
20138 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20139 -                  * extent[rank-1];
20140 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20141  
20142        retarray->offset = 0;
20143        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20144 @@ -299,7 +297,7 @@
20145           return;
20146         }
20147        else
20148 -       retarray->base_addr = xmalloc (alloc_size);
20149 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20150  
20151      }
20152    else
20153 @@ -472,8 +470,7 @@
20154        retarray->offset = 0;
20155        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20156  
20157 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20158 -                  * extent[rank-1];
20159 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20160  
20161        if (alloc_size == 0)
20162         {
20163 @@ -482,7 +479,7 @@
20164           return;
20165         }
20166        else
20167 -       retarray->base_addr = xmalloc (alloc_size);
20168 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20169      }
20170    else
20171      {
20172 Index: libgfortran/generated/minval_i8.c
20173 ===================================================================
20174 --- libgfortran/generated/minval_i8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20175 +++ libgfortran/generated/minval_i8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20176 @@ -97,10 +97,9 @@
20177        retarray->offset = 0;
20178        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20179  
20180 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20181 -                  * extent[rank-1];
20182 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20183  
20184 -      retarray->base_addr = xmalloc (alloc_size);
20185 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20186        if (alloc_size == 0)
20187         {
20188           /* Make sure we have a zero-sized array.  */
20189 @@ -286,8 +285,7 @@
20190  
20191         }
20192  
20193 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20194 -                  * extent[rank-1];
20195 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20196  
20197        retarray->offset = 0;
20198        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20199 @@ -299,7 +297,7 @@
20200           return;
20201         }
20202        else
20203 -       retarray->base_addr = xmalloc (alloc_size);
20204 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20205  
20206      }
20207    else
20208 @@ -472,8 +470,7 @@
20209        retarray->offset = 0;
20210        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20211  
20212 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20213 -                  * extent[rank-1];
20214 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20215  
20216        if (alloc_size == 0)
20217         {
20218 @@ -482,7 +479,7 @@
20219           return;
20220         }
20221        else
20222 -       retarray->base_addr = xmalloc (alloc_size);
20223 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20224      }
20225    else
20226      {
20227 Index: libgfortran/generated/maxloc0_16_i16.c
20228 ===================================================================
20229 --- libgfortran/generated/maxloc0_16_i16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
20230 +++ libgfortran/generated/maxloc0_16_i16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
20231 @@ -58,7 +58,7 @@
20232        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20233        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20234        retarray->offset = 0;
20235 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20236 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20237      }
20238    else
20239      {
20240 @@ -199,7 +199,7 @@
20241        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20242        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20243        retarray->offset = 0;
20244 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20245 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20246      }
20247    else
20248      {
20249 @@ -367,7 +367,7 @@
20250        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20251        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20252        retarray->offset = 0;
20253 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20254 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20255      }
20256    else if (unlikely (compile_options.bounds_check))
20257      {
20258 Index: libgfortran/generated/shape_i4.c
20259 ===================================================================
20260 --- libgfortran/generated/shape_i4.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
20261 +++ libgfortran/generated/shape_i4.c    (.../branches/gcc-4_8-branch)   (revision 217117)
20262 @@ -49,7 +49,7 @@
20263      {
20264        GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
20265        ret->offset = 0;
20266 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20267 +      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20268      }
20269  
20270    stride = GFC_DESCRIPTOR_STRIDE(ret,0);
20271 Index: libgfortran/generated/minloc1_4_i16.c
20272 ===================================================================
20273 --- libgfortran/generated/minloc1_4_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20274 +++ libgfortran/generated/minloc1_4_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20275 @@ -98,10 +98,9 @@
20276        retarray->offset = 0;
20277        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20278  
20279 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20280 -                  * extent[rank-1];
20281 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20282  
20283 -      retarray->base_addr = xmalloc (alloc_size);
20284 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20285        if (alloc_size == 0)
20286         {
20287           /* Make sure we have a zero-sized array.  */
20288 @@ -294,8 +293,7 @@
20289  
20290         }
20291  
20292 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20293 -                  * extent[rank-1];
20294 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20295  
20296        retarray->offset = 0;
20297        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20298 @@ -307,7 +305,7 @@
20299           return;
20300         }
20301        else
20302 -       retarray->base_addr = xmalloc (alloc_size);
20303 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20304  
20305      }
20306    else
20307 @@ -485,8 +483,7 @@
20308        retarray->offset = 0;
20309        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20310  
20311 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20312 -                  * extent[rank-1];
20313 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20314  
20315        if (alloc_size == 0)
20316         {
20317 @@ -495,7 +492,7 @@
20318           return;
20319         }
20320        else
20321 -       retarray->base_addr = xmalloc (alloc_size);
20322 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20323      }
20324    else
20325      {
20326 Index: libgfortran/generated/maxloc0_4_r10.c
20327 ===================================================================
20328 --- libgfortran/generated/maxloc0_4_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20329 +++ libgfortran/generated/maxloc0_4_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20330 @@ -58,7 +58,7 @@
20331        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20332        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20333        retarray->offset = 0;
20334 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20335 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20336      }
20337    else
20338      {
20339 @@ -199,7 +199,7 @@
20340        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20341        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20342        retarray->offset = 0;
20343 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20344 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20345      }
20346    else
20347      {
20348 @@ -367,7 +367,7 @@
20349        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20350        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20351        retarray->offset = 0;
20352 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20353 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20354      }
20355    else if (unlikely (compile_options.bounds_check))
20356      {
20357 Index: libgfortran/generated/maxloc0_8_i16.c
20358 ===================================================================
20359 --- libgfortran/generated/maxloc0_8_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20360 +++ libgfortran/generated/maxloc0_8_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20361 @@ -58,7 +58,7 @@
20362        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20363        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20364        retarray->offset = 0;
20365 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20366 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20367      }
20368    else
20369      {
20370 @@ -199,7 +199,7 @@
20371        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20372        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20373        retarray->offset = 0;
20374 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20375 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20376      }
20377    else
20378      {
20379 @@ -367,7 +367,7 @@
20380        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20381        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20382        retarray->offset = 0;
20383 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20384 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20385      }
20386    else if (unlikely (compile_options.bounds_check))
20387      {
20388 Index: libgfortran/generated/iall_i2.c
20389 ===================================================================
20390 --- libgfortran/generated/iall_i2.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
20391 +++ libgfortran/generated/iall_i2.c     (.../branches/gcc-4_8-branch)   (revision 217117)
20392 @@ -97,10 +97,9 @@
20393        retarray->offset = 0;
20394        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20395  
20396 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20397 -                  * extent[rank-1];
20398 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20399  
20400 -      retarray->base_addr = xmalloc (alloc_size);
20401 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20402        if (alloc_size == 0)
20403         {
20404           /* Make sure we have a zero-sized array.  */
20405 @@ -272,8 +271,7 @@
20406  
20407         }
20408  
20409 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20410 -                  * extent[rank-1];
20411 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20412  
20413        retarray->offset = 0;
20414        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20415 @@ -285,7 +283,7 @@
20416           return;
20417         }
20418        else
20419 -       retarray->base_addr = xmalloc (alloc_size);
20420 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20421  
20422      }
20423    else
20424 @@ -430,8 +428,7 @@
20425        retarray->offset = 0;
20426        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20427  
20428 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20429 -                  * extent[rank-1];
20430 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20431  
20432        if (alloc_size == 0)
20433         {
20434 @@ -440,7 +437,7 @@
20435           return;
20436         }
20437        else
20438 -       retarray->base_addr = xmalloc (alloc_size);
20439 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20440      }
20441    else
20442      {
20443 Index: libgfortran/generated/maxloc1_8_r10.c
20444 ===================================================================
20445 --- libgfortran/generated/maxloc1_8_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20446 +++ libgfortran/generated/maxloc1_8_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20447 @@ -98,10 +98,9 @@
20448        retarray->offset = 0;
20449        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20450  
20451 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20452 -                  * extent[rank-1];
20453 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20454  
20455 -      retarray->base_addr = xmalloc (alloc_size);
20456 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20457        if (alloc_size == 0)
20458         {
20459           /* Make sure we have a zero-sized array.  */
20460 @@ -294,8 +293,7 @@
20461  
20462         }
20463  
20464 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20465 -                  * extent[rank-1];
20466 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20467  
20468        retarray->offset = 0;
20469        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20470 @@ -307,7 +305,7 @@
20471           return;
20472         }
20473        else
20474 -       retarray->base_addr = xmalloc (alloc_size);
20475 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20476  
20477      }
20478    else
20479 @@ -485,8 +483,7 @@
20480        retarray->offset = 0;
20481        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20482  
20483 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20484 -                  * extent[rank-1];
20485 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20486  
20487        if (alloc_size == 0)
20488         {
20489 @@ -495,7 +492,7 @@
20490           return;
20491         }
20492        else
20493 -       retarray->base_addr = xmalloc (alloc_size);
20494 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20495      }
20496    else
20497      {
20498 Index: libgfortran/generated/maxloc0_16_r4.c
20499 ===================================================================
20500 --- libgfortran/generated/maxloc0_16_r4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20501 +++ libgfortran/generated/maxloc0_16_r4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20502 @@ -58,7 +58,7 @@
20503        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20504        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20505        retarray->offset = 0;
20506 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20507 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20508      }
20509    else
20510      {
20511 @@ -199,7 +199,7 @@
20512        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20513        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20514        retarray->offset = 0;
20515 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20516 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20517      }
20518    else
20519      {
20520 @@ -367,7 +367,7 @@
20521        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20522        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20523        retarray->offset = 0;
20524 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20525 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20526      }
20527    else if (unlikely (compile_options.bounds_check))
20528      {
20529 Index: libgfortran/generated/minloc0_8_i1.c
20530 ===================================================================
20531 --- libgfortran/generated/minloc0_8_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
20532 +++ libgfortran/generated/minloc0_8_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
20533 @@ -58,7 +58,7 @@
20534        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20535        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20536        retarray->offset = 0;
20537 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20538 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20539      }
20540    else
20541      {
20542 @@ -199,7 +199,7 @@
20543        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20544        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20545        retarray->offset = 0;
20546 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20547 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20548      }
20549    else
20550      {
20551 @@ -367,7 +367,7 @@
20552        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20553        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20554        retarray->offset = 0;
20555 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20556 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20557      }
20558    else if (unlikely (compile_options.bounds_check))
20559      {
20560 Index: libgfortran/generated/minloc1_16_r8.c
20561 ===================================================================
20562 --- libgfortran/generated/minloc1_16_r8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20563 +++ libgfortran/generated/minloc1_16_r8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20564 @@ -98,10 +98,9 @@
20565        retarray->offset = 0;
20566        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20567  
20568 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20569 -                  * extent[rank-1];
20570 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20571  
20572 -      retarray->base_addr = xmalloc (alloc_size);
20573 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20574        if (alloc_size == 0)
20575         {
20576           /* Make sure we have a zero-sized array.  */
20577 @@ -294,8 +293,7 @@
20578  
20579         }
20580  
20581 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20582 -                  * extent[rank-1];
20583 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20584  
20585        retarray->offset = 0;
20586        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20587 @@ -307,7 +305,7 @@
20588           return;
20589         }
20590        else
20591 -       retarray->base_addr = xmalloc (alloc_size);
20592 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20593  
20594      }
20595    else
20596 @@ -485,8 +483,7 @@
20597        retarray->offset = 0;
20598        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20599  
20600 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20601 -                  * extent[rank-1];
20602 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20603  
20604        if (alloc_size == 0)
20605         {
20606 @@ -495,7 +492,7 @@
20607           return;
20608         }
20609        else
20610 -       retarray->base_addr = xmalloc (alloc_size);
20611 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20612      }
20613    else
20614      {
20615 Index: libgfortran/generated/unpack_i8.c
20616 ===================================================================
20617 --- libgfortran/generated/unpack_i8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20618 +++ libgfortran/generated/unpack_i8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20619 @@ -99,7 +99,7 @@
20620           rs *= extent[n];
20621         }
20622        ret->offset = 0;
20623 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
20624 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
20625      }
20626    else
20627      {
20628 @@ -244,7 +244,7 @@
20629           rs *= extent[n];
20630         }
20631        ret->offset = 0;
20632 -      ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
20633 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
20634      }
20635    else
20636      {
20637 Index: libgfortran/generated/maxloc0_4_i4.c
20638 ===================================================================
20639 --- libgfortran/generated/maxloc0_4_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
20640 +++ libgfortran/generated/maxloc0_4_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
20641 @@ -58,7 +58,7 @@
20642        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20643        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20644        retarray->offset = 0;
20645 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20646 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20647      }
20648    else
20649      {
20650 @@ -199,7 +199,7 @@
20651        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20652        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20653        retarray->offset = 0;
20654 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20655 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20656      }
20657    else
20658      {
20659 @@ -367,7 +367,7 @@
20660        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20661        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20662        retarray->offset = 0;
20663 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20664 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20665      }
20666    else if (unlikely (compile_options.bounds_check))
20667      {
20668 Index: libgfortran/generated/count_4_l.c
20669 ===================================================================
20670 --- libgfortran/generated/count_4_l.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20671 +++ libgfortran/generated/count_4_l.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20672 @@ -101,8 +101,7 @@
20673        retarray->offset = 0;
20674        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20675  
20676 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20677 -                  * extent[rank-1];
20678 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20679  
20680        if (alloc_size == 0)
20681         {
20682 @@ -111,7 +110,7 @@
20683           return;
20684         }
20685        else
20686 -       retarray->base_addr = xmalloc (alloc_size);
20687 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20688      }
20689    else
20690      {
20691 Index: libgfortran/generated/sum_r10.c
20692 ===================================================================
20693 --- libgfortran/generated/sum_r10.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
20694 +++ libgfortran/generated/sum_r10.c     (.../branches/gcc-4_8-branch)   (revision 217117)
20695 @@ -97,10 +97,9 @@
20696        retarray->offset = 0;
20697        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20698  
20699 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20700 -                  * extent[rank-1];
20701 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20702  
20703 -      retarray->base_addr = xmalloc (alloc_size);
20704 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20705        if (alloc_size == 0)
20706         {
20707           /* Make sure we have a zero-sized array.  */
20708 @@ -272,8 +271,7 @@
20709  
20710         }
20711  
20712 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20713 -                  * extent[rank-1];
20714 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20715  
20716        retarray->offset = 0;
20717        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20718 @@ -285,7 +283,7 @@
20719           return;
20720         }
20721        else
20722 -       retarray->base_addr = xmalloc (alloc_size);
20723 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20724  
20725      }
20726    else
20727 @@ -430,8 +428,7 @@
20728        retarray->offset = 0;
20729        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20730  
20731 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20732 -                  * extent[rank-1];
20733 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20734  
20735        if (alloc_size == 0)
20736         {
20737 @@ -440,7 +437,7 @@
20738           return;
20739         }
20740        else
20741 -       retarray->base_addr = xmalloc (alloc_size);
20742 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20743      }
20744    else
20745      {
20746 Index: libgfortran/generated/sum_c4.c
20747 ===================================================================
20748 --- libgfortran/generated/sum_c4.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
20749 +++ libgfortran/generated/sum_c4.c      (.../branches/gcc-4_8-branch)   (revision 217117)
20750 @@ -97,10 +97,9 @@
20751        retarray->offset = 0;
20752        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20753  
20754 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20755 -                  * extent[rank-1];
20756 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20757  
20758 -      retarray->base_addr = xmalloc (alloc_size);
20759 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
20760        if (alloc_size == 0)
20761         {
20762           /* Make sure we have a zero-sized array.  */
20763 @@ -272,8 +271,7 @@
20764  
20765         }
20766  
20767 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20768 -                  * extent[rank-1];
20769 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20770  
20771        retarray->offset = 0;
20772        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20773 @@ -285,7 +283,7 @@
20774           return;
20775         }
20776        else
20777 -       retarray->base_addr = xmalloc (alloc_size);
20778 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
20779  
20780      }
20781    else
20782 @@ -430,8 +428,7 @@
20783        retarray->offset = 0;
20784        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20785  
20786 -      alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20787 -                  * extent[rank-1];
20788 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20789  
20790        if (alloc_size == 0)
20791         {
20792 @@ -440,7 +437,7 @@
20793           return;
20794         }
20795        else
20796 -       retarray->base_addr = xmalloc (alloc_size);
20797 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
20798      }
20799    else
20800      {
20801 Index: libgfortran/generated/maxloc1_16_r10.c
20802 ===================================================================
20803 --- libgfortran/generated/maxloc1_16_r10.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
20804 +++ libgfortran/generated/maxloc1_16_r10.c      (.../branches/gcc-4_8-branch)   (revision 217117)
20805 @@ -98,10 +98,9 @@
20806        retarray->offset = 0;
20807        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20808  
20809 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20810 -                  * extent[rank-1];
20811 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20812  
20813 -      retarray->base_addr = xmalloc (alloc_size);
20814 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20815        if (alloc_size == 0)
20816         {
20817           /* Make sure we have a zero-sized array.  */
20818 @@ -294,8 +293,7 @@
20819  
20820         }
20821  
20822 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20823 -                  * extent[rank-1];
20824 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20825  
20826        retarray->offset = 0;
20827        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20828 @@ -307,7 +305,7 @@
20829           return;
20830         }
20831        else
20832 -       retarray->base_addr = xmalloc (alloc_size);
20833 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20834  
20835      }
20836    else
20837 @@ -485,8 +483,7 @@
20838        retarray->offset = 0;
20839        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20840  
20841 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20842 -                  * extent[rank-1];
20843 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20844  
20845        if (alloc_size == 0)
20846         {
20847 @@ -495,7 +492,7 @@
20848           return;
20849         }
20850        else
20851 -       retarray->base_addr = xmalloc (alloc_size);
20852 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20853      }
20854    else
20855      {
20856 Index: libgfortran/generated/pack_i16.c
20857 ===================================================================
20858 --- libgfortran/generated/pack_i16.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
20859 +++ libgfortran/generated/pack_i16.c    (.../branches/gcc-4_8-branch)   (revision 217117)
20860 @@ -167,8 +167,8 @@
20861  
20862           ret->offset = 0;
20863  
20864 -         /* xmalloc allocates a single byte for zero size.  */
20865 -         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
20866 +         /* xmallocarray allocates a single byte for zero size.  */
20867 +         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
20868  
20869           if (total == 0)
20870             return;
20871 Index: libgfortran/generated/matmul_i8.c
20872 ===================================================================
20873 --- libgfortran/generated/matmul_i8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20874 +++ libgfortran/generated/matmul_i8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20875 @@ -124,7 +124,7 @@
20876          }
20877  
20878        retarray->base_addr
20879 -       = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
20880 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
20881        retarray->offset = 0;
20882      }
20883      else if (unlikely (compile_options.bounds_check))
20884 Index: libgfortran/generated/maxloc0_16_i2.c
20885 ===================================================================
20886 --- libgfortran/generated/maxloc0_16_i2.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
20887 +++ libgfortran/generated/maxloc0_16_i2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
20888 @@ -58,7 +58,7 @@
20889        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20890        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20891        retarray->offset = 0;
20892 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20893 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20894      }
20895    else
20896      {
20897 @@ -199,7 +199,7 @@
20898        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20899        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20900        retarray->offset = 0;
20901 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20902 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20903      }
20904    else
20905      {
20906 @@ -367,7 +367,7 @@
20907        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20908        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20909        retarray->offset = 0;
20910 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20911 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20912      }
20913    else if (unlikely (compile_options.bounds_check))
20914      {
20915 Index: libgfortran/generated/spread_c4.c
20916 ===================================================================
20917 --- libgfortran/generated/spread_c4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
20918 +++ libgfortran/generated/spread_c4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
20919 @@ -101,8 +101,8 @@
20920         }
20921        ret->offset = 0;
20922  
20923 -      /* xmalloc allocates a single byte for zero size.  */
20924 -      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
20925 +      /* xmallocarray allocates a single byte for zero size.  */
20926 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
20927        if (rs <= 0)
20928          return;
20929      }
20930 @@ -244,7 +244,7 @@
20931  
20932    if (ret->base_addr == NULL)
20933      {
20934 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
20935 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
20936        ret->offset = 0;
20937        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
20938      }
20939 Index: libgfortran/generated/maxval_r10.c
20940 ===================================================================
20941 --- libgfortran/generated/maxval_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
20942 +++ libgfortran/generated/maxval_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
20943 @@ -97,10 +97,9 @@
20944        retarray->offset = 0;
20945        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20946  
20947 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20948 -                  * extent[rank-1];
20949 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20950  
20951 -      retarray->base_addr = xmalloc (alloc_size);
20952 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20953        if (alloc_size == 0)
20954         {
20955           /* Make sure we have a zero-sized array.  */
20956 @@ -286,8 +285,7 @@
20957  
20958         }
20959  
20960 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20961 -                  * extent[rank-1];
20962 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20963  
20964        retarray->offset = 0;
20965        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20966 @@ -299,7 +297,7 @@
20967           return;
20968         }
20969        else
20970 -       retarray->base_addr = xmalloc (alloc_size);
20971 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20972  
20973      }
20974    else
20975 @@ -472,8 +470,7 @@
20976        retarray->offset = 0;
20977        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20978  
20979 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20980 -                  * extent[rank-1];
20981 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20982  
20983        if (alloc_size == 0)
20984         {
20985 @@ -482,7 +479,7 @@
20986           return;
20987         }
20988        else
20989 -       retarray->base_addr = xmalloc (alloc_size);
20990 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20991      }
20992    else
20993      {
20994 Index: libgfortran/generated/pack_i4.c
20995 ===================================================================
20996 --- libgfortran/generated/pack_i4.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
20997 +++ libgfortran/generated/pack_i4.c     (.../branches/gcc-4_8-branch)   (revision 217117)
20998 @@ -167,8 +167,8 @@
20999  
21000           ret->offset = 0;
21001  
21002 -         /* xmalloc allocates a single byte for zero size.  */
21003 -         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
21004 +         /* xmallocarray allocates a single byte for zero size.  */
21005 +         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
21006  
21007           if (total == 0)
21008             return;
21009 Index: libgfortran/generated/maxloc1_4_i1.c
21010 ===================================================================
21011 --- libgfortran/generated/maxloc1_4_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21012 +++ libgfortran/generated/maxloc1_4_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21013 @@ -98,10 +98,9 @@
21014        retarray->offset = 0;
21015        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21016  
21017 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21018 -                  * extent[rank-1];
21019 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21020  
21021 -      retarray->base_addr = xmalloc (alloc_size);
21022 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21023        if (alloc_size == 0)
21024         {
21025           /* Make sure we have a zero-sized array.  */
21026 @@ -294,8 +293,7 @@
21027  
21028         }
21029  
21030 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21031 -                  * extent[rank-1];
21032 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21033  
21034        retarray->offset = 0;
21035        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21036 @@ -307,7 +305,7 @@
21037           return;
21038         }
21039        else
21040 -       retarray->base_addr = xmalloc (alloc_size);
21041 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21042  
21043      }
21044    else
21045 @@ -485,8 +483,7 @@
21046        retarray->offset = 0;
21047        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21048  
21049 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21050 -                  * extent[rank-1];
21051 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21052  
21053        if (alloc_size == 0)
21054         {
21055 @@ -495,7 +492,7 @@
21056           return;
21057         }
21058        else
21059 -       retarray->base_addr = xmalloc (alloc_size);
21060 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21061      }
21062    else
21063      {
21064 Index: libgfortran/generated/matmul_r10.c
21065 ===================================================================
21066 --- libgfortran/generated/matmul_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21067 +++ libgfortran/generated/matmul_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21068 @@ -124,7 +124,7 @@
21069          }
21070  
21071        retarray->base_addr
21072 -       = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
21073 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
21074        retarray->offset = 0;
21075      }
21076      else if (unlikely (compile_options.bounds_check))
21077 Index: libgfortran/generated/minloc1_4_i8.c
21078 ===================================================================
21079 --- libgfortran/generated/minloc1_4_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21080 +++ libgfortran/generated/minloc1_4_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21081 @@ -98,10 +98,9 @@
21082        retarray->offset = 0;
21083        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21084  
21085 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21086 -                  * extent[rank-1];
21087 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21088  
21089 -      retarray->base_addr = xmalloc (alloc_size);
21090 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21091        if (alloc_size == 0)
21092         {
21093           /* Make sure we have a zero-sized array.  */
21094 @@ -294,8 +293,7 @@
21095  
21096         }
21097  
21098 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21099 -                  * extent[rank-1];
21100 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21101  
21102        retarray->offset = 0;
21103        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21104 @@ -307,7 +305,7 @@
21105           return;
21106         }
21107        else
21108 -       retarray->base_addr = xmalloc (alloc_size);
21109 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21110  
21111      }
21112    else
21113 @@ -485,8 +483,7 @@
21114        retarray->offset = 0;
21115        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21116  
21117 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21118 -                  * extent[rank-1];
21119 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21120  
21121        if (alloc_size == 0)
21122         {
21123 @@ -495,7 +492,7 @@
21124           return;
21125         }
21126        else
21127 -       retarray->base_addr = xmalloc (alloc_size);
21128 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21129      }
21130    else
21131      {
21132 Index: libgfortran/generated/minloc0_8_r4.c
21133 ===================================================================
21134 --- libgfortran/generated/minloc0_8_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21135 +++ libgfortran/generated/minloc0_8_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21136 @@ -58,7 +58,7 @@
21137        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21138        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21139        retarray->offset = 0;
21140 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21141 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21142      }
21143    else
21144      {
21145 @@ -199,7 +199,7 @@
21146        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21147        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21148        retarray->offset = 0;
21149 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21150 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21151      }
21152    else
21153      {
21154 @@ -367,7 +367,7 @@
21155        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21156        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21157        retarray->offset = 0;
21158 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21159 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21160      }
21161    else if (unlikely (compile_options.bounds_check))
21162      {
21163 Index: libgfortran/generated/matmul_l4.c
21164 ===================================================================
21165 --- libgfortran/generated/matmul_l4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
21166 +++ libgfortran/generated/matmul_l4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
21167 @@ -88,7 +88,7 @@
21168          }
21169            
21170        retarray->base_addr
21171 -       = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
21172 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
21173        retarray->offset = 0;
21174      }
21175      else if (unlikely (compile_options.bounds_check))
21176 Index: libgfortran/generated/reshape_r8.c
21177 ===================================================================
21178 --- libgfortran/generated/reshape_r8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21179 +++ libgfortran/generated/reshape_r8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21180 @@ -111,11 +111,11 @@
21181        ret->offset = 0;
21182  
21183        if (unlikely (rs < 1))
21184 -        alloc_size = 1;
21185 +        alloc_size = 0;
21186        else
21187 -        alloc_size = rs * sizeof (GFC_REAL_8);
21188 +        alloc_size = rs;
21189  
21190 -      ret->base_addr = xmalloc (alloc_size);
21191 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
21192        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
21193      }
21194  
21195 Index: libgfortran/generated/in_pack_c10.c
21196 ===================================================================
21197 --- libgfortran/generated/in_pack_c10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
21198 +++ libgfortran/generated/in_pack_c10.c (.../branches/gcc-4_8-branch)   (revision 217117)
21199 @@ -76,7 +76,7 @@
21200      return source->base_addr;
21201  
21202    /* Allocate storage for the destination.  */
21203 -  destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
21204 +  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
21205    dest = destptr;
21206    src = source->base_addr;
21207    stride0 = stride[0];
21208 Index: libgfortran/generated/all_l4.c
21209 ===================================================================
21210 --- libgfortran/generated/all_l4.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
21211 +++ libgfortran/generated/all_l4.c      (.../branches/gcc-4_8-branch)   (revision 217117)
21212 @@ -101,8 +101,7 @@
21213        retarray->offset = 0;
21214        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21215  
21216 -      alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21217 -                  * extent[rank-1];
21218 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21219  
21220        if (alloc_size == 0)
21221         {
21222 @@ -111,7 +110,7 @@
21223           return;
21224         }
21225        else
21226 -       retarray->base_addr = xmalloc (alloc_size);
21227 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
21228      }
21229    else
21230      {
21231 Index: libgfortran/generated/minloc0_8_i2.c
21232 ===================================================================
21233 --- libgfortran/generated/minloc0_8_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21234 +++ libgfortran/generated/minloc0_8_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21235 @@ -58,7 +58,7 @@
21236        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21237        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21238        retarray->offset = 0;
21239 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21240 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21241      }
21242    else
21243      {
21244 @@ -199,7 +199,7 @@
21245        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21246        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21247        retarray->offset = 0;
21248 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21249 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21250      }
21251    else
21252      {
21253 @@ -367,7 +367,7 @@
21254        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21255        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21256        retarray->offset = 0;
21257 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21258 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21259      }
21260    else if (unlikely (compile_options.bounds_check))
21261      {
21262 Index: libgfortran/generated/norm2_r16.c
21263 ===================================================================
21264 --- libgfortran/generated/norm2_r16.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
21265 +++ libgfortran/generated/norm2_r16.c   (.../branches/gcc-4_8-branch)   (revision 217117)
21266 @@ -105,10 +105,9 @@
21267        retarray->offset = 0;
21268        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21269  
21270 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21271 -                  * extent[rank-1];
21272 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21273  
21274 -      retarray->base_addr = xmalloc (alloc_size);
21275 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
21276        if (alloc_size == 0)
21277         {
21278           /* Make sure we have a zero-sized array.  */
21279 Index: libgfortran/generated/reshape_c10.c
21280 ===================================================================
21281 --- libgfortran/generated/reshape_c10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
21282 +++ libgfortran/generated/reshape_c10.c (.../branches/gcc-4_8-branch)   (revision 217117)
21283 @@ -111,11 +111,11 @@
21284        ret->offset = 0;
21285  
21286        if (unlikely (rs < 1))
21287 -        alloc_size = 1;
21288 +        alloc_size = 0;
21289        else
21290 -        alloc_size = rs * sizeof (GFC_COMPLEX_10);
21291 +        alloc_size = rs;
21292  
21293 -      ret->base_addr = xmalloc (alloc_size);
21294 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
21295        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
21296      }
21297  
21298 Index: libgfortran/generated/unpack_c16.c
21299 ===================================================================
21300 --- libgfortran/generated/unpack_c16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21301 +++ libgfortran/generated/unpack_c16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21302 @@ -99,7 +99,7 @@
21303           rs *= extent[n];
21304         }
21305        ret->offset = 0;
21306 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
21307 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
21308      }
21309    else
21310      {
21311 @@ -244,7 +244,7 @@
21312           rs *= extent[n];
21313         }
21314        ret->offset = 0;
21315 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
21316 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
21317      }
21318    else
21319      {
21320 Index: libgfortran/generated/maxloc1_4_r4.c
21321 ===================================================================
21322 --- libgfortran/generated/maxloc1_4_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21323 +++ libgfortran/generated/maxloc1_4_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21324 @@ -98,10 +98,9 @@
21325        retarray->offset = 0;
21326        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21327  
21328 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21329 -                  * extent[rank-1];
21330 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21331  
21332 -      retarray->base_addr = xmalloc (alloc_size);
21333 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21334        if (alloc_size == 0)
21335         {
21336           /* Make sure we have a zero-sized array.  */
21337 @@ -294,8 +293,7 @@
21338  
21339         }
21340  
21341 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21342 -                  * extent[rank-1];
21343 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21344  
21345        retarray->offset = 0;
21346        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21347 @@ -307,7 +305,7 @@
21348           return;
21349         }
21350        else
21351 -       retarray->base_addr = xmalloc (alloc_size);
21352 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21353  
21354      }
21355    else
21356 @@ -485,8 +483,7 @@
21357        retarray->offset = 0;
21358        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21359  
21360 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21361 -                  * extent[rank-1];
21362 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21363  
21364        if (alloc_size == 0)
21365         {
21366 @@ -495,7 +492,7 @@
21367           return;
21368         }
21369        else
21370 -       retarray->base_addr = xmalloc (alloc_size);
21371 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21372      }
21373    else
21374      {
21375 Index: libgfortran/generated/maxval_r8.c
21376 ===================================================================
21377 --- libgfortran/generated/maxval_r8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
21378 +++ libgfortran/generated/maxval_r8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
21379 @@ -97,10 +97,9 @@
21380        retarray->offset = 0;
21381        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21382  
21383 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21384 -                  * extent[rank-1];
21385 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21386  
21387 -      retarray->base_addr = xmalloc (alloc_size);
21388 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
21389        if (alloc_size == 0)
21390         {
21391           /* Make sure we have a zero-sized array.  */
21392 @@ -286,8 +285,7 @@
21393  
21394         }
21395  
21396 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21397 -                  * extent[rank-1];
21398 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21399  
21400        retarray->offset = 0;
21401        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21402 @@ -299,7 +297,7 @@
21403           return;
21404         }
21405        else
21406 -       retarray->base_addr = xmalloc (alloc_size);
21407 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
21408  
21409      }
21410    else
21411 @@ -472,8 +470,7 @@
21412        retarray->offset = 0;
21413        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21414  
21415 -      alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21416 -                  * extent[rank-1];
21417 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21418  
21419        if (alloc_size == 0)
21420         {
21421 @@ -482,7 +479,7 @@
21422           return;
21423         }
21424        else
21425 -       retarray->base_addr = xmalloc (alloc_size);
21426 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
21427      }
21428    else
21429      {
21430 Index: libgfortran/generated/transpose_c4.c
21431 ===================================================================
21432 --- libgfortran/generated/transpose_c4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21433 +++ libgfortran/generated/transpose_c4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21434 @@ -60,7 +60,8 @@
21435        GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
21436                         GFC_DESCRIPTOR_EXTENT(source, 1));
21437  
21438 -      ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
21439 +      ret->base_addr = xmallocarray (size0 ((array_t *) ret), 
21440 +                                     sizeof (GFC_COMPLEX_4));
21441        ret->offset = 0;
21442      } else if (unlikely (compile_options.bounds_check))
21443      {
21444 Index: libgfortran/generated/eoshift1_4.c
21445 ===================================================================
21446 --- libgfortran/generated/eoshift1_4.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21447 +++ libgfortran/generated/eoshift1_4.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21448 @@ -105,8 +105,8 @@
21449           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
21450  
21451          }
21452 -      /* xmalloc allocates a single byte for zero size.  */
21453 -      ret->base_addr = xmalloc (size * arraysize);
21454 +      /* xmallocarray allocates a single byte for zero size.  */
21455 +      ret->base_addr = xmallocarray (arraysize, size);
21456  
21457      }
21458    else if (unlikely (compile_options.bounds_check))
21459 Index: libgfortran/generated/minval_r16.c
21460 ===================================================================
21461 --- libgfortran/generated/minval_r16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21462 +++ libgfortran/generated/minval_r16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21463 @@ -97,10 +97,9 @@
21464        retarray->offset = 0;
21465        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21466  
21467 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21468 -                  * extent[rank-1];
21469 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21470  
21471 -      retarray->base_addr = xmalloc (alloc_size);
21472 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
21473        if (alloc_size == 0)
21474         {
21475           /* Make sure we have a zero-sized array.  */
21476 @@ -286,8 +285,7 @@
21477  
21478         }
21479  
21480 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21481 -                  * extent[rank-1];
21482 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21483  
21484        retarray->offset = 0;
21485        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21486 @@ -299,7 +297,7 @@
21487           return;
21488         }
21489        else
21490 -       retarray->base_addr = xmalloc (alloc_size);
21491 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
21492  
21493      }
21494    else
21495 @@ -472,8 +470,7 @@
21496        retarray->offset = 0;
21497        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21498  
21499 -      alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21500 -                  * extent[rank-1];
21501 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21502  
21503        if (alloc_size == 0)
21504         {
21505 @@ -482,7 +479,7 @@
21506           return;
21507         }
21508        else
21509 -       retarray->base_addr = xmalloc (alloc_size);
21510 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
21511      }
21512    else
21513      {
21514 Index: libgfortran/generated/iany_i16.c
21515 ===================================================================
21516 --- libgfortran/generated/iany_i16.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
21517 +++ libgfortran/generated/iany_i16.c    (.../branches/gcc-4_8-branch)   (revision 217117)
21518 @@ -97,10 +97,9 @@
21519        retarray->offset = 0;
21520        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21521  
21522 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21523 -                  * extent[rank-1];
21524 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21525  
21526 -      retarray->base_addr = xmalloc (alloc_size);
21527 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
21528        if (alloc_size == 0)
21529         {
21530           /* Make sure we have a zero-sized array.  */
21531 @@ -272,8 +271,7 @@
21532  
21533         }
21534  
21535 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21536 -                  * extent[rank-1];
21537 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21538  
21539        retarray->offset = 0;
21540        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21541 @@ -285,7 +283,7 @@
21542           return;
21543         }
21544        else
21545 -       retarray->base_addr = xmalloc (alloc_size);
21546 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
21547  
21548      }
21549    else
21550 @@ -430,8 +428,7 @@
21551        retarray->offset = 0;
21552        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21553  
21554 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21555 -                  * extent[rank-1];
21556 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21557  
21558        if (alloc_size == 0)
21559         {
21560 @@ -440,7 +437,7 @@
21561           return;
21562         }
21563        else
21564 -       retarray->base_addr = xmalloc (alloc_size);
21565 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
21566      }
21567    else
21568      {
21569 Index: libgfortran/generated/maxloc1_4_i2.c
21570 ===================================================================
21571 --- libgfortran/generated/maxloc1_4_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21572 +++ libgfortran/generated/maxloc1_4_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21573 @@ -98,10 +98,9 @@
21574        retarray->offset = 0;
21575        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21576  
21577 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21578 -                  * extent[rank-1];
21579 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21580  
21581 -      retarray->base_addr = xmalloc (alloc_size);
21582 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21583        if (alloc_size == 0)
21584         {
21585           /* Make sure we have a zero-sized array.  */
21586 @@ -294,8 +293,7 @@
21587  
21588         }
21589  
21590 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21591 -                  * extent[rank-1];
21592 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21593  
21594        retarray->offset = 0;
21595        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21596 @@ -307,7 +305,7 @@
21597           return;
21598         }
21599        else
21600 -       retarray->base_addr = xmalloc (alloc_size);
21601 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21602  
21603      }
21604    else
21605 @@ -485,8 +483,7 @@
21606        retarray->offset = 0;
21607        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21608  
21609 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21610 -                  * extent[rank-1];
21611 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21612  
21613        if (alloc_size == 0)
21614         {
21615 @@ -495,7 +492,7 @@
21616           return;
21617         }
21618        else
21619 -       retarray->base_addr = xmalloc (alloc_size);
21620 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21621      }
21622    else
21623      {
21624 Index: libgfortran/generated/maxloc1_8_i8.c
21625 ===================================================================
21626 --- libgfortran/generated/maxloc1_8_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21627 +++ libgfortran/generated/maxloc1_8_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21628 @@ -98,10 +98,9 @@
21629        retarray->offset = 0;
21630        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21631  
21632 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21633 -                  * extent[rank-1];
21634 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21635  
21636 -      retarray->base_addr = xmalloc (alloc_size);
21637 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
21638        if (alloc_size == 0)
21639         {
21640           /* Make sure we have a zero-sized array.  */
21641 @@ -294,8 +293,7 @@
21642  
21643         }
21644  
21645 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21646 -                  * extent[rank-1];
21647 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21648  
21649        retarray->offset = 0;
21650        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21651 @@ -307,7 +305,7 @@
21652           return;
21653         }
21654        else
21655 -       retarray->base_addr = xmalloc (alloc_size);
21656 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
21657  
21658      }
21659    else
21660 @@ -485,8 +483,7 @@
21661        retarray->offset = 0;
21662        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21663  
21664 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21665 -                  * extent[rank-1];
21666 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21667  
21668        if (alloc_size == 0)
21669         {
21670 @@ -495,7 +492,7 @@
21671           return;
21672         }
21673        else
21674 -       retarray->base_addr = xmalloc (alloc_size);
21675 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
21676      }
21677    else
21678      {
21679 Index: libgfortran/generated/maxloc0_4_r8.c
21680 ===================================================================
21681 --- libgfortran/generated/maxloc0_4_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
21682 +++ libgfortran/generated/maxloc0_4_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
21683 @@ -58,7 +58,7 @@
21684        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21685        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21686        retarray->offset = 0;
21687 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
21688 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
21689      }
21690    else
21691      {
21692 @@ -199,7 +199,7 @@
21693        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21694        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21695        retarray->offset = 0;
21696 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
21697 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
21698      }
21699    else
21700      {
21701 @@ -367,7 +367,7 @@
21702        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21703        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21704        retarray->offset = 0;
21705 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
21706 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
21707      }
21708    else if (unlikely (compile_options.bounds_check))
21709      {
21710 Index: libgfortran/generated/maxloc0_16_r16.c
21711 ===================================================================
21712 --- libgfortran/generated/maxloc0_16_r16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
21713 +++ libgfortran/generated/maxloc0_16_r16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
21714 @@ -58,7 +58,7 @@
21715        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21716        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21717        retarray->offset = 0;
21718 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21719 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21720      }
21721    else
21722      {
21723 @@ -199,7 +199,7 @@
21724        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21725        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21726        retarray->offset = 0;
21727 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21728 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21729      }
21730    else
21731      {
21732 @@ -367,7 +367,7 @@
21733        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21734        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21735        retarray->offset = 0;
21736 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21737 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21738      }
21739    else if (unlikely (compile_options.bounds_check))
21740      {
21741 Index: libgfortran/generated/sum_c10.c
21742 ===================================================================
21743 --- libgfortran/generated/sum_c10.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
21744 +++ libgfortran/generated/sum_c10.c     (.../branches/gcc-4_8-branch)   (revision 217117)
21745 @@ -97,10 +97,9 @@
21746        retarray->offset = 0;
21747        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21748  
21749 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21750 -                  * extent[rank-1];
21751 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21752  
21753 -      retarray->base_addr = xmalloc (alloc_size);
21754 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
21755        if (alloc_size == 0)
21756         {
21757           /* Make sure we have a zero-sized array.  */
21758 @@ -272,8 +271,7 @@
21759  
21760         }
21761  
21762 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21763 -                  * extent[rank-1];
21764 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21765  
21766        retarray->offset = 0;
21767        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21768 @@ -285,7 +283,7 @@
21769           return;
21770         }
21771        else
21772 -       retarray->base_addr = xmalloc (alloc_size);
21773 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
21774  
21775      }
21776    else
21777 @@ -430,8 +428,7 @@
21778        retarray->offset = 0;
21779        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21780  
21781 -      alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21782 -                  * extent[rank-1];
21783 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21784  
21785        if (alloc_size == 0)
21786         {
21787 @@ -440,7 +437,7 @@
21788           return;
21789         }
21790        else
21791 -       retarray->base_addr = xmalloc (alloc_size);
21792 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
21793      }
21794    else
21795      {
21796 Index: libgfortran/generated/iall_i4.c
21797 ===================================================================
21798 --- libgfortran/generated/iall_i4.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
21799 +++ libgfortran/generated/iall_i4.c     (.../branches/gcc-4_8-branch)   (revision 217117)
21800 @@ -97,10 +97,9 @@
21801        retarray->offset = 0;
21802        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21803  
21804 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21805 -                  * extent[rank-1];
21806 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21807  
21808 -      retarray->base_addr = xmalloc (alloc_size);
21809 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21810        if (alloc_size == 0)
21811         {
21812           /* Make sure we have a zero-sized array.  */
21813 @@ -272,8 +271,7 @@
21814  
21815         }
21816  
21817 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21818 -                  * extent[rank-1];
21819 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21820  
21821        retarray->offset = 0;
21822        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21823 @@ -285,7 +283,7 @@
21824           return;
21825         }
21826        else
21827 -       retarray->base_addr = xmalloc (alloc_size);
21828 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21829  
21830      }
21831    else
21832 @@ -430,8 +428,7 @@
21833        retarray->offset = 0;
21834        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21835  
21836 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21837 -                  * extent[rank-1];
21838 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21839  
21840        if (alloc_size == 0)
21841         {
21842 @@ -440,7 +437,7 @@
21843           return;
21844         }
21845        else
21846 -       retarray->base_addr = xmalloc (alloc_size);
21847 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21848      }
21849    else
21850      {
21851 Index: libgfortran/generated/minloc1_4_r16.c
21852 ===================================================================
21853 --- libgfortran/generated/minloc1_4_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
21854 +++ libgfortran/generated/minloc1_4_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
21855 @@ -98,10 +98,9 @@
21856        retarray->offset = 0;
21857        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21858  
21859 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21860 -                  * extent[rank-1];
21861 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21862  
21863 -      retarray->base_addr = xmalloc (alloc_size);
21864 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21865        if (alloc_size == 0)
21866         {
21867           /* Make sure we have a zero-sized array.  */
21868 @@ -294,8 +293,7 @@
21869  
21870         }
21871  
21872 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21873 -                  * extent[rank-1];
21874 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21875  
21876        retarray->offset = 0;
21877        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21878 @@ -307,7 +305,7 @@
21879           return;
21880         }
21881        else
21882 -       retarray->base_addr = xmalloc (alloc_size);
21883 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21884  
21885      }
21886    else
21887 @@ -485,8 +483,7 @@
21888        retarray->offset = 0;
21889        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21890  
21891 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21892 -                  * extent[rank-1];
21893 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21894  
21895        if (alloc_size == 0)
21896         {
21897 @@ -495,7 +492,7 @@
21898           return;
21899         }
21900        else
21901 -       retarray->base_addr = xmalloc (alloc_size);
21902 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
21903      }
21904    else
21905      {
21906 Index: libgfortran/generated/maxloc0_8_r16.c
21907 ===================================================================
21908 --- libgfortran/generated/maxloc0_8_r16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
21909 +++ libgfortran/generated/maxloc0_8_r16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
21910 @@ -58,7 +58,7 @@
21911        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21912        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21913        retarray->offset = 0;
21914 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21915 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21916      }
21917    else
21918      {
21919 @@ -199,7 +199,7 @@
21920        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21921        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21922        retarray->offset = 0;
21923 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21924 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21925      }
21926    else
21927      {
21928 @@ -367,7 +367,7 @@
21929        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21930        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21931        retarray->offset = 0;
21932 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
21933 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
21934      }
21935    else if (unlikely (compile_options.bounds_check))
21936      {
21937 Index: libgfortran/generated/pack_r8.c
21938 ===================================================================
21939 --- libgfortran/generated/pack_r8.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
21940 +++ libgfortran/generated/pack_r8.c     (.../branches/gcc-4_8-branch)   (revision 217117)
21941 @@ -167,8 +167,8 @@
21942  
21943           ret->offset = 0;
21944  
21945 -         /* xmalloc allocates a single byte for zero size.  */
21946 -         ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
21947 +         /* xmallocarray allocates a single byte for zero size.  */
21948 +         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
21949  
21950           if (total == 0)
21951             return;
21952 Index: libgfortran/generated/matmul_c10.c
21953 ===================================================================
21954 --- libgfortran/generated/matmul_c10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
21955 +++ libgfortran/generated/matmul_c10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
21956 @@ -124,7 +124,7 @@
21957          }
21958  
21959        retarray->base_addr
21960 -       = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
21961 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
21962        retarray->offset = 0;
21963      }
21964      else if (unlikely (compile_options.bounds_check))
21965 Index: libgfortran/generated/maxloc0_16_i4.c
21966 ===================================================================
21967 --- libgfortran/generated/maxloc0_16_i4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
21968 +++ libgfortran/generated/maxloc0_16_i4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
21969 @@ -58,7 +58,7 @@
21970        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21971        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21972        retarray->offset = 0;
21973 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21974 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21975      }
21976    else
21977      {
21978 @@ -199,7 +199,7 @@
21979        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
21980        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21981        retarray->offset = 0;
21982 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21983 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21984      }
21985    else
21986      {
21987 @@ -367,7 +367,7 @@
21988        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
21989        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
21990        retarray->offset = 0;
21991 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
21992 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
21993      }
21994    else if (unlikely (compile_options.bounds_check))
21995      {
21996 Index: libgfortran/generated/pack_r16.c
21997 ===================================================================
21998 --- libgfortran/generated/pack_r16.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
21999 +++ libgfortran/generated/pack_r16.c    (.../branches/gcc-4_8-branch)   (revision 217117)
22000 @@ -167,8 +167,8 @@
22001  
22002           ret->offset = 0;
22003  
22004 -         /* xmalloc allocates a single byte for zero size.  */
22005 -         ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
22006 +         /* xmallocarray allocates a single byte for zero size.  */
22007 +         ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
22008  
22009           if (total == 0)
22010             return;
22011 Index: libgfortran/generated/minloc1_16_i8.c
22012 ===================================================================
22013 --- libgfortran/generated/minloc1_16_i8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22014 +++ libgfortran/generated/minloc1_16_i8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22015 @@ -98,10 +98,9 @@
22016        retarray->offset = 0;
22017        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22018  
22019 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22020 -                  * extent[rank-1];
22021 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22022  
22023 -      retarray->base_addr = xmalloc (alloc_size);
22024 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22025        if (alloc_size == 0)
22026         {
22027           /* Make sure we have a zero-sized array.  */
22028 @@ -294,8 +293,7 @@
22029  
22030         }
22031  
22032 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22033 -                  * extent[rank-1];
22034 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22035  
22036        retarray->offset = 0;
22037        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22038 @@ -307,7 +305,7 @@
22039           return;
22040         }
22041        else
22042 -       retarray->base_addr = xmalloc (alloc_size);
22043 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22044  
22045      }
22046    else
22047 @@ -485,8 +483,7 @@
22048        retarray->offset = 0;
22049        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22050  
22051 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22052 -                  * extent[rank-1];
22053 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22054  
22055        if (alloc_size == 0)
22056         {
22057 @@ -495,7 +492,7 @@
22058           return;
22059         }
22060        else
22061 -       retarray->base_addr = xmalloc (alloc_size);
22062 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22063      }
22064    else
22065      {
22066 Index: libgfortran/generated/minloc0_16_r10.c
22067 ===================================================================
22068 --- libgfortran/generated/minloc0_16_r10.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
22069 +++ libgfortran/generated/minloc0_16_r10.c      (.../branches/gcc-4_8-branch)   (revision 217117)
22070 @@ -58,7 +58,7 @@
22071        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22072        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22073        retarray->offset = 0;
22074 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
22075 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
22076      }
22077    else
22078      {
22079 @@ -199,7 +199,7 @@
22080        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
22081        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22082        retarray->offset = 0;
22083 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
22084 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
22085      }
22086    else
22087      {
22088 @@ -367,7 +367,7 @@
22089        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22090        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22091        retarray->offset = 0;
22092 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
22093 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
22094      }
22095    else if (unlikely (compile_options.bounds_check))
22096      {
22097 Index: libgfortran/generated/unpack_c4.c
22098 ===================================================================
22099 --- libgfortran/generated/unpack_c4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
22100 +++ libgfortran/generated/unpack_c4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
22101 @@ -99,7 +99,7 @@
22102           rs *= extent[n];
22103         }
22104        ret->offset = 0;
22105 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
22106 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
22107      }
22108    else
22109      {
22110 @@ -244,7 +244,7 @@
22111           rs *= extent[n];
22112         }
22113        ret->offset = 0;
22114 -      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
22115 +      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
22116      }
22117    else
22118      {
22119 Index: libgfortran/generated/iparity_i1.c
22120 ===================================================================
22121 --- libgfortran/generated/iparity_i1.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22122 +++ libgfortran/generated/iparity_i1.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22123 @@ -97,10 +97,9 @@
22124        retarray->offset = 0;
22125        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22126  
22127 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22128 -                  * extent[rank-1];
22129 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22130  
22131 -      retarray->base_addr = xmalloc (alloc_size);
22132 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
22133        if (alloc_size == 0)
22134         {
22135           /* Make sure we have a zero-sized array.  */
22136 @@ -272,8 +271,7 @@
22137  
22138         }
22139  
22140 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22141 -                  * extent[rank-1];
22142 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22143  
22144        retarray->offset = 0;
22145        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22146 @@ -285,7 +283,7 @@
22147           return;
22148         }
22149        else
22150 -       retarray->base_addr = xmalloc (alloc_size);
22151 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
22152  
22153      }
22154    else
22155 @@ -430,8 +428,7 @@
22156        retarray->offset = 0;
22157        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22158  
22159 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22160 -                  * extent[rank-1];
22161 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22162  
22163        if (alloc_size == 0)
22164         {
22165 @@ -440,7 +437,7 @@
22166           return;
22167         }
22168        else
22169 -       retarray->base_addr = xmalloc (alloc_size);
22170 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
22171      }
22172    else
22173      {
22174 Index: libgfortran/generated/product_c8.c
22175 ===================================================================
22176 --- libgfortran/generated/product_c8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22177 +++ libgfortran/generated/product_c8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22178 @@ -97,10 +97,9 @@
22179        retarray->offset = 0;
22180        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22181  
22182 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22183 -                  * extent[rank-1];
22184 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22185  
22186 -      retarray->base_addr = xmalloc (alloc_size);
22187 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
22188        if (alloc_size == 0)
22189         {
22190           /* Make sure we have a zero-sized array.  */
22191 @@ -272,8 +271,7 @@
22192  
22193         }
22194  
22195 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22196 -                  * extent[rank-1];
22197 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22198  
22199        retarray->offset = 0;
22200        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22201 @@ -285,7 +283,7 @@
22202           return;
22203         }
22204        else
22205 -       retarray->base_addr = xmalloc (alloc_size);
22206 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
22207  
22208      }
22209    else
22210 @@ -430,8 +428,7 @@
22211        retarray->offset = 0;
22212        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22213  
22214 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22215 -                  * extent[rank-1];
22216 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22217  
22218        if (alloc_size == 0)
22219         {
22220 @@ -440,7 +437,7 @@
22221           return;
22222         }
22223        else
22224 -       retarray->base_addr = xmalloc (alloc_size);
22225 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
22226      }
22227    else
22228      {
22229 Index: libgfortran/generated/in_pack_i16.c
22230 ===================================================================
22231 --- libgfortran/generated/in_pack_i16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
22232 +++ libgfortran/generated/in_pack_i16.c (.../branches/gcc-4_8-branch)   (revision 217117)
22233 @@ -76,7 +76,7 @@
22234      return source->base_addr;
22235  
22236    /* Allocate storage for the destination.  */
22237 -  destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
22238 +  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
22239    dest = destptr;
22240    src = source->base_addr;
22241    stride0 = stride[0];
22242 Index: libgfortran/generated/minloc0_8_i4.c
22243 ===================================================================
22244 --- libgfortran/generated/minloc0_8_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
22245 +++ libgfortran/generated/minloc0_8_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
22246 @@ -58,7 +58,7 @@
22247        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22248        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22249        retarray->offset = 0;
22250 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22251 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22252      }
22253    else
22254      {
22255 @@ -199,7 +199,7 @@
22256        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
22257        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22258        retarray->offset = 0;
22259 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22260 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22261      }
22262    else
22263      {
22264 @@ -367,7 +367,7 @@
22265        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22266        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22267        retarray->offset = 0;
22268 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22269 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22270      }
22271    else if (unlikely (compile_options.bounds_check))
22272      {
22273 Index: libgfortran/generated/matmul_c4.c
22274 ===================================================================
22275 --- libgfortran/generated/matmul_c4.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
22276 +++ libgfortran/generated/matmul_c4.c   (.../branches/gcc-4_8-branch)   (revision 217117)
22277 @@ -124,7 +124,7 @@
22278          }
22279  
22280        retarray->base_addr
22281 -       = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
22282 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
22283        retarray->offset = 0;
22284      }
22285      else if (unlikely (compile_options.bounds_check))
22286 Index: libgfortran/generated/reshape_i8.c
22287 ===================================================================
22288 --- libgfortran/generated/reshape_i8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22289 +++ libgfortran/generated/reshape_i8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22290 @@ -111,11 +111,11 @@
22291        ret->offset = 0;
22292  
22293        if (unlikely (rs < 1))
22294 -        alloc_size = 1;
22295 +        alloc_size = 0;
22296        else
22297 -        alloc_size = rs * sizeof (GFC_INTEGER_8);
22298 +        alloc_size = rs;
22299  
22300 -      ret->base_addr = xmalloc (alloc_size);
22301 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22302        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
22303      }
22304  
22305 Index: libgfortran/generated/in_pack_c8.c
22306 ===================================================================
22307 --- libgfortran/generated/in_pack_c8.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22308 +++ libgfortran/generated/in_pack_c8.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22309 @@ -76,7 +76,7 @@
22310      return source->base_addr;
22311  
22312    /* Allocate storage for the destination.  */
22313 -  destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
22314 +  destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
22315    dest = destptr;
22316    src = source->base_addr;
22317    stride0 = stride[0];
22318 Index: libgfortran/generated/bessel_r10.c
22319 ===================================================================
22320 --- libgfortran/generated/bessel_r10.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22321 +++ libgfortran/generated/bessel_r10.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22322 @@ -55,7 +55,7 @@
22323      {
22324        size_t size = n2 < n1 ? 0 : n2-n1+1; 
22325        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
22326 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
22327 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
22328        ret->offset = 0;
22329      }
22330  
22331 @@ -122,7 +122,7 @@
22332      {
22333        size_t size = n2 < n1 ? 0 : n2-n1+1; 
22334        GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
22335 -      ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
22336 +      ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
22337        ret->offset = 0;
22338      }
22339  
22340 @@ -162,7 +162,7 @@
22341  
22342    x2rev = GFC_REAL_10_LITERAL(2.)/x;
22343  
22344 -  for (i = 2; i <= n1+n2; i++)
22345 +  for (i = 2; i <= n2 - n1; i++)
22346      {
22347  #if defined(GFC_REAL_10_INFINITY)
22348        if (unlikely (last2 == -GFC_REAL_10_INFINITY))
22349 Index: libgfortran/generated/iall_i16.c
22350 ===================================================================
22351 --- libgfortran/generated/iall_i16.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
22352 +++ libgfortran/generated/iall_i16.c    (.../branches/gcc-4_8-branch)   (revision 217117)
22353 @@ -97,10 +97,9 @@
22354        retarray->offset = 0;
22355        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22356  
22357 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22358 -                  * extent[rank-1];
22359 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22360  
22361 -      retarray->base_addr = xmalloc (alloc_size);
22362 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22363        if (alloc_size == 0)
22364         {
22365           /* Make sure we have a zero-sized array.  */
22366 @@ -272,8 +271,7 @@
22367  
22368         }
22369  
22370 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22371 -                  * extent[rank-1];
22372 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22373  
22374        retarray->offset = 0;
22375        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22376 @@ -285,7 +283,7 @@
22377           return;
22378         }
22379        else
22380 -       retarray->base_addr = xmalloc (alloc_size);
22381 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22382  
22383      }
22384    else
22385 @@ -430,8 +428,7 @@
22386        retarray->offset = 0;
22387        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22388  
22389 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22390 -                  * extent[rank-1];
22391 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22392  
22393        if (alloc_size == 0)
22394         {
22395 @@ -440,7 +437,7 @@
22396           return;
22397         }
22398        else
22399 -       retarray->base_addr = xmalloc (alloc_size);
22400 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22401      }
22402    else
22403      {
22404 Index: libgfortran/generated/maxloc1_16_i1.c
22405 ===================================================================
22406 --- libgfortran/generated/maxloc1_16_i1.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22407 +++ libgfortran/generated/maxloc1_16_i1.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22408 @@ -98,10 +98,9 @@
22409        retarray->offset = 0;
22410        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22411  
22412 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22413 -                  * extent[rank-1];
22414 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22415  
22416 -      retarray->base_addr = xmalloc (alloc_size);
22417 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22418        if (alloc_size == 0)
22419         {
22420           /* Make sure we have a zero-sized array.  */
22421 @@ -294,8 +293,7 @@
22422  
22423         }
22424  
22425 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22426 -                  * extent[rank-1];
22427 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22428  
22429        retarray->offset = 0;
22430        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22431 @@ -307,7 +305,7 @@
22432           return;
22433         }
22434        else
22435 -       retarray->base_addr = xmalloc (alloc_size);
22436 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22437  
22438      }
22439    else
22440 @@ -485,8 +483,7 @@
22441        retarray->offset = 0;
22442        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22443  
22444 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22445 -                  * extent[rank-1];
22446 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22447  
22448        if (alloc_size == 0)
22449         {
22450 @@ -495,7 +492,7 @@
22451           return;
22452         }
22453        else
22454 -       retarray->base_addr = xmalloc (alloc_size);
22455 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22456      }
22457    else
22458      {
22459 Index: libgfortran/generated/reshape_i16.c
22460 ===================================================================
22461 --- libgfortran/generated/reshape_i16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
22462 +++ libgfortran/generated/reshape_i16.c (.../branches/gcc-4_8-branch)   (revision 217117)
22463 @@ -111,11 +111,11 @@
22464        ret->offset = 0;
22465  
22466        if (unlikely (rs < 1))
22467 -        alloc_size = 1;
22468 +        alloc_size = 0;
22469        else
22470 -        alloc_size = rs * sizeof (GFC_INTEGER_16);
22471 +        alloc_size = rs;
22472  
22473 -      ret->base_addr = xmalloc (alloc_size);
22474 +      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22475        ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
22476      }
22477  
22478 Index: libgfortran/generated/count_16_l.c
22479 ===================================================================
22480 --- libgfortran/generated/count_16_l.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22481 +++ libgfortran/generated/count_16_l.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22482 @@ -101,8 +101,7 @@
22483        retarray->offset = 0;
22484        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22485  
22486 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22487 -                  * extent[rank-1];
22488 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22489  
22490        if (alloc_size == 0)
22491         {
22492 @@ -111,7 +110,7 @@
22493           return;
22494         }
22495        else
22496 -       retarray->base_addr = xmalloc (alloc_size);
22497 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22498      }
22499    else
22500      {
22501 Index: libgfortran/generated/minloc1_8_i1.c
22502 ===================================================================
22503 --- libgfortran/generated/minloc1_8_i1.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
22504 +++ libgfortran/generated/minloc1_8_i1.c        (.../branches/gcc-4_8-branch)   (revision 217117)
22505 @@ -98,10 +98,9 @@
22506        retarray->offset = 0;
22507        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22508  
22509 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22510 -                  * extent[rank-1];
22511 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22512  
22513 -      retarray->base_addr = xmalloc (alloc_size);
22514 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22515        if (alloc_size == 0)
22516         {
22517           /* Make sure we have a zero-sized array.  */
22518 @@ -294,8 +293,7 @@
22519  
22520         }
22521  
22522 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22523 -                  * extent[rank-1];
22524 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22525  
22526        retarray->offset = 0;
22527        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22528 @@ -307,7 +305,7 @@
22529           return;
22530         }
22531        else
22532 -       retarray->base_addr = xmalloc (alloc_size);
22533 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22534  
22535      }
22536    else
22537 @@ -485,8 +483,7 @@
22538        retarray->offset = 0;
22539        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22540  
22541 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22542 -                  * extent[rank-1];
22543 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22544  
22545        if (alloc_size == 0)
22546         {
22547 @@ -495,7 +492,7 @@
22548           return;
22549         }
22550        else
22551 -       retarray->base_addr = xmalloc (alloc_size);
22552 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22553      }
22554    else
22555      {
22556 Index: libgfortran/generated/maxloc1_4_i4.c
22557 ===================================================================
22558 --- libgfortran/generated/maxloc1_4_i4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
22559 +++ libgfortran/generated/maxloc1_4_i4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
22560 @@ -98,10 +98,9 @@
22561        retarray->offset = 0;
22562        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22563  
22564 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22565 -                  * extent[rank-1];
22566 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22567  
22568 -      retarray->base_addr = xmalloc (alloc_size);
22569 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22570        if (alloc_size == 0)
22571         {
22572           /* Make sure we have a zero-sized array.  */
22573 @@ -294,8 +293,7 @@
22574  
22575         }
22576  
22577 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22578 -                  * extent[rank-1];
22579 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22580  
22581        retarray->offset = 0;
22582        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22583 @@ -307,7 +305,7 @@
22584           return;
22585         }
22586        else
22587 -       retarray->base_addr = xmalloc (alloc_size);
22588 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22589  
22590      }
22591    else
22592 @@ -485,8 +483,7 @@
22593        retarray->offset = 0;
22594        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22595  
22596 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22597 -                  * extent[rank-1];
22598 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22599  
22600        if (alloc_size == 0)
22601         {
22602 @@ -495,7 +492,7 @@
22603           return;
22604         }
22605        else
22606 -       retarray->base_addr = xmalloc (alloc_size);
22607 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22608      }
22609    else
22610      {
22611 Index: libgfortran/generated/maxval_i8.c
22612 ===================================================================
22613 --- libgfortran/generated/maxval_i8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
22614 +++ libgfortran/generated/maxval_i8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
22615 @@ -97,10 +97,9 @@
22616        retarray->offset = 0;
22617        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22618  
22619 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22620 -                  * extent[rank-1];
22621 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22622  
22623 -      retarray->base_addr = xmalloc (alloc_size);
22624 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22625        if (alloc_size == 0)
22626         {
22627           /* Make sure we have a zero-sized array.  */
22628 @@ -286,8 +285,7 @@
22629  
22630         }
22631  
22632 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22633 -                  * extent[rank-1];
22634 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22635  
22636        retarray->offset = 0;
22637        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22638 @@ -299,7 +297,7 @@
22639           return;
22640         }
22641        else
22642 -       retarray->base_addr = xmalloc (alloc_size);
22643 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22644  
22645      }
22646    else
22647 @@ -472,8 +470,7 @@
22648        retarray->offset = 0;
22649        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22650  
22651 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22652 -                  * extent[rank-1];
22653 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22654  
22655        if (alloc_size == 0)
22656         {
22657 @@ -482,7 +479,7 @@
22658           return;
22659         }
22660        else
22661 -       retarray->base_addr = xmalloc (alloc_size);
22662 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22663      }
22664    else
22665      {
22666 Index: libgfortran/generated/eoshift3_16.c
22667 ===================================================================
22668 --- libgfortran/generated/eoshift3_16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
22669 +++ libgfortran/generated/eoshift3_16.c (.../branches/gcc-4_8-branch)   (revision 217117)
22670 @@ -89,7 +89,7 @@
22671      {
22672        int i;
22673  
22674 -      ret->base_addr = xmalloc (size * arraysize);
22675 +      ret->base_addr = xmallocarray (arraysize, size);
22676        ret->offset = 0;
22677        ret->dtype = array->dtype;
22678        for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
22679 @@ -107,8 +107,8 @@
22680           GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
22681  
22682          }
22683 -      /* xmalloc allocates a single byte for zero size.  */
22684 -      ret->base_addr = xmalloc (size * arraysize);
22685 +      /* xmallocarray allocates a single byte for zero size.  */
22686 +      ret->base_addr = xmallocarray (arraysize, size);
22687  
22688      }
22689    else if (unlikely (compile_options.bounds_check))
22690 Index: libgfortran/generated/shape_i8.c
22691 ===================================================================
22692 --- libgfortran/generated/shape_i8.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
22693 +++ libgfortran/generated/shape_i8.c    (.../branches/gcc-4_8-branch)   (revision 217117)
22694 @@ -49,7 +49,7 @@
22695      {
22696        GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
22697        ret->offset = 0;
22698 -      ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22699 +      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22700      }
22701  
22702    stride = GFC_DESCRIPTOR_STRIDE(ret,0);
22703 Index: libgfortran/generated/maxloc0_4_i16.c
22704 ===================================================================
22705 --- libgfortran/generated/maxloc0_4_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22706 +++ libgfortran/generated/maxloc0_4_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22707 @@ -58,7 +58,7 @@
22708        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22709        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22710        retarray->offset = 0;
22711 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
22712 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
22713      }
22714    else
22715      {
22716 @@ -199,7 +199,7 @@
22717        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
22718        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22719        retarray->offset = 0;
22720 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
22721 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
22722      }
22723    else
22724      {
22725 @@ -367,7 +367,7 @@
22726        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22727        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22728        retarray->offset = 0;
22729 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
22730 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
22731      }
22732    else if (unlikely (compile_options.bounds_check))
22733      {
22734 Index: libgfortran/generated/maxloc1_4_r10.c
22735 ===================================================================
22736 --- libgfortran/generated/maxloc1_4_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22737 +++ libgfortran/generated/maxloc1_4_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22738 @@ -98,10 +98,9 @@
22739        retarray->offset = 0;
22740        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22741  
22742 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22743 -                  * extent[rank-1];
22744 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22745  
22746 -      retarray->base_addr = xmalloc (alloc_size);
22747 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22748        if (alloc_size == 0)
22749         {
22750           /* Make sure we have a zero-sized array.  */
22751 @@ -294,8 +293,7 @@
22752  
22753         }
22754  
22755 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22756 -                  * extent[rank-1];
22757 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22758  
22759        retarray->offset = 0;
22760        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22761 @@ -307,7 +305,7 @@
22762           return;
22763         }
22764        else
22765 -       retarray->base_addr = xmalloc (alloc_size);
22766 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22767  
22768      }
22769    else
22770 @@ -485,8 +483,7 @@
22771        retarray->offset = 0;
22772        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22773  
22774 -      alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22775 -                  * extent[rank-1];
22776 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22777  
22778        if (alloc_size == 0)
22779         {
22780 @@ -495,7 +492,7 @@
22781           return;
22782         }
22783        else
22784 -       retarray->base_addr = xmalloc (alloc_size);
22785 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
22786      }
22787    else
22788      {
22789 Index: libgfortran/generated/maxloc1_8_i16.c
22790 ===================================================================
22791 --- libgfortran/generated/maxloc1_8_i16.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22792 +++ libgfortran/generated/maxloc1_8_i16.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22793 @@ -98,10 +98,9 @@
22794        retarray->offset = 0;
22795        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22796  
22797 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22798 -                  * extent[rank-1];
22799 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22800  
22801 -      retarray->base_addr = xmalloc (alloc_size);
22802 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22803        if (alloc_size == 0)
22804         {
22805           /* Make sure we have a zero-sized array.  */
22806 @@ -294,8 +293,7 @@
22807  
22808         }
22809  
22810 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22811 -                  * extent[rank-1];
22812 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22813  
22814        retarray->offset = 0;
22815        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22816 @@ -307,7 +305,7 @@
22817           return;
22818         }
22819        else
22820 -       retarray->base_addr = xmalloc (alloc_size);
22821 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22822  
22823      }
22824    else
22825 @@ -485,8 +483,7 @@
22826        retarray->offset = 0;
22827        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22828  
22829 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22830 -                  * extent[rank-1];
22831 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22832  
22833        if (alloc_size == 0)
22834         {
22835 @@ -495,7 +492,7 @@
22836           return;
22837         }
22838        else
22839 -       retarray->base_addr = xmalloc (alloc_size);
22840 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
22841      }
22842    else
22843      {
22844 Index: libgfortran/generated/minloc0_8_r10.c
22845 ===================================================================
22846 --- libgfortran/generated/minloc0_8_r10.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22847 +++ libgfortran/generated/minloc0_8_r10.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22848 @@ -58,7 +58,7 @@
22849        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22850        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22851        retarray->offset = 0;
22852 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22853 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22854      }
22855    else
22856      {
22857 @@ -199,7 +199,7 @@
22858        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
22859        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22860        retarray->offset = 0;
22861 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22862 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22863      }
22864    else
22865      {
22866 @@ -367,7 +367,7 @@
22867        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22868        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22869        retarray->offset = 0;
22870 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
22871 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
22872      }
22873    else if (unlikely (compile_options.bounds_check))
22874      {
22875 Index: libgfortran/generated/iparity_i2.c
22876 ===================================================================
22877 --- libgfortran/generated/iparity_i2.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
22878 +++ libgfortran/generated/iparity_i2.c  (.../branches/gcc-4_8-branch)   (revision 217117)
22879 @@ -97,10 +97,9 @@
22880        retarray->offset = 0;
22881        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22882  
22883 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22884 -                  * extent[rank-1];
22885 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22886  
22887 -      retarray->base_addr = xmalloc (alloc_size);
22888 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
22889        if (alloc_size == 0)
22890         {
22891           /* Make sure we have a zero-sized array.  */
22892 @@ -272,8 +271,7 @@
22893  
22894         }
22895  
22896 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22897 -                  * extent[rank-1];
22898 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22899  
22900        retarray->offset = 0;
22901        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22902 @@ -285,7 +283,7 @@
22903           return;
22904         }
22905        else
22906 -       retarray->base_addr = xmalloc (alloc_size);
22907 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
22908  
22909      }
22910    else
22911 @@ -430,8 +428,7 @@
22912        retarray->offset = 0;
22913        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22914  
22915 -      alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22916 -                  * extent[rank-1];
22917 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22918  
22919        if (alloc_size == 0)
22920         {
22921 @@ -440,7 +437,7 @@
22922           return;
22923         }
22924        else
22925 -       retarray->base_addr = xmalloc (alloc_size);
22926 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
22927      }
22928    else
22929      {
22930 Index: libgfortran/generated/maxloc1_16_r4.c
22931 ===================================================================
22932 --- libgfortran/generated/maxloc1_16_r4.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22933 +++ libgfortran/generated/maxloc1_16_r4.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22934 @@ -98,10 +98,9 @@
22935        retarray->offset = 0;
22936        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22937  
22938 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22939 -                  * extent[rank-1];
22940 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22941  
22942 -      retarray->base_addr = xmalloc (alloc_size);
22943 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22944        if (alloc_size == 0)
22945         {
22946           /* Make sure we have a zero-sized array.  */
22947 @@ -294,8 +293,7 @@
22948  
22949         }
22950  
22951 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22952 -                  * extent[rank-1];
22953 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22954  
22955        retarray->offset = 0;
22956        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22957 @@ -307,7 +305,7 @@
22958           return;
22959         }
22960        else
22961 -       retarray->base_addr = xmalloc (alloc_size);
22962 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22963  
22964      }
22965    else
22966 @@ -485,8 +483,7 @@
22967        retarray->offset = 0;
22968        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
22969  
22970 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
22971 -                  * extent[rank-1];
22972 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
22973  
22974        if (alloc_size == 0)
22975         {
22976 @@ -495,7 +492,7 @@
22977           return;
22978         }
22979        else
22980 -       retarray->base_addr = xmalloc (alloc_size);
22981 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
22982      }
22983    else
22984      {
22985 Index: libgfortran/generated/maxloc0_16_r8.c
22986 ===================================================================
22987 --- libgfortran/generated/maxloc0_16_r8.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
22988 +++ libgfortran/generated/maxloc0_16_r8.c       (.../branches/gcc-4_8-branch)   (revision 217117)
22989 @@ -58,7 +58,7 @@
22990        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
22991        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
22992        retarray->offset = 0;
22993 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
22994 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
22995      }
22996    else
22997      {
22998 @@ -199,7 +199,7 @@
22999        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
23000        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23001        retarray->offset = 0;
23002 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
23003 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
23004      }
23005    else
23006      {
23007 @@ -367,7 +367,7 @@
23008        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
23009        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23010        retarray->offset = 0;
23011 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
23012 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
23013      }
23014    else if (unlikely (compile_options.bounds_check))
23015      {
23016 Index: libgfortran/generated/sum_i16.c
23017 ===================================================================
23018 --- libgfortran/generated/sum_i16.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
23019 +++ libgfortran/generated/sum_i16.c     (.../branches/gcc-4_8-branch)   (revision 217117)
23020 @@ -97,10 +97,9 @@
23021        retarray->offset = 0;
23022        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23023  
23024 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23025 -                  * extent[rank-1];
23026 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23027  
23028 -      retarray->base_addr = xmalloc (alloc_size);
23029 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23030        if (alloc_size == 0)
23031         {
23032           /* Make sure we have a zero-sized array.  */
23033 @@ -272,8 +271,7 @@
23034  
23035         }
23036  
23037 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23038 -                  * extent[rank-1];
23039 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23040  
23041        retarray->offset = 0;
23042        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23043 @@ -285,7 +283,7 @@
23044           return;
23045         }
23046        else
23047 -       retarray->base_addr = xmalloc (alloc_size);
23048 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23049  
23050      }
23051    else
23052 @@ -430,8 +428,7 @@
23053        retarray->offset = 0;
23054        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23055  
23056 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23057 -                  * extent[rank-1];
23058 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23059  
23060        if (alloc_size == 0)
23061         {
23062 @@ -440,7 +437,7 @@
23063           return;
23064         }
23065        else
23066 -       retarray->base_addr = xmalloc (alloc_size);
23067 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23068      }
23069    else
23070      {
23071 Index: libgfortran/generated/maxloc0_4_i8.c
23072 ===================================================================
23073 --- libgfortran/generated/maxloc0_4_i8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
23074 +++ libgfortran/generated/maxloc0_4_i8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
23075 @@ -58,7 +58,7 @@
23076        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
23077        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23078        retarray->offset = 0;
23079 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
23080 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
23081      }
23082    else
23083      {
23084 @@ -199,7 +199,7 @@
23085        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
23086        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23087        retarray->offset = 0;
23088 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
23089 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
23090      }
23091    else
23092      {
23093 @@ -367,7 +367,7 @@
23094        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
23095        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23096        retarray->offset = 0;
23097 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
23098 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
23099      }
23100    else if (unlikely (compile_options.bounds_check))
23101      {
23102 Index: libgfortran/generated/pack_c16.c
23103 ===================================================================
23104 --- libgfortran/generated/pack_c16.c    (.../tags/gcc_4_8_3_release)    (revision 217117)
23105 +++ libgfortran/generated/pack_c16.c    (.../branches/gcc-4_8-branch)   (revision 217117)
23106 @@ -167,8 +167,8 @@
23107  
23108           ret->offset = 0;
23109  
23110 -         /* xmalloc allocates a single byte for zero size.  */
23111 -         ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
23112 +         /* xmallocarray allocates a single byte for zero size.  */
23113 +         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
23114  
23115           if (total == 0)
23116             return;
23117 Index: libgfortran/generated/maxloc1_16_i16.c
23118 ===================================================================
23119 --- libgfortran/generated/maxloc1_16_i16.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
23120 +++ libgfortran/generated/maxloc1_16_i16.c      (.../branches/gcc-4_8-branch)   (revision 217117)
23121 @@ -98,10 +98,9 @@
23122        retarray->offset = 0;
23123        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23124  
23125 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23126 -                  * extent[rank-1];
23127 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23128  
23129 -      retarray->base_addr = xmalloc (alloc_size);
23130 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23131        if (alloc_size == 0)
23132         {
23133           /* Make sure we have a zero-sized array.  */
23134 @@ -294,8 +293,7 @@
23135  
23136         }
23137  
23138 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23139 -                  * extent[rank-1];
23140 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23141  
23142        retarray->offset = 0;
23143        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23144 @@ -307,7 +305,7 @@
23145           return;
23146         }
23147        else
23148 -       retarray->base_addr = xmalloc (alloc_size);
23149 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23150  
23151      }
23152    else
23153 @@ -485,8 +483,7 @@
23154        retarray->offset = 0;
23155        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23156  
23157 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23158 -                  * extent[rank-1];
23159 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23160  
23161        if (alloc_size == 0)
23162         {
23163 @@ -495,7 +492,7 @@
23164           return;
23165         }
23166        else
23167 -       retarray->base_addr = xmalloc (alloc_size);
23168 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23169      }
23170    else
23171      {
23172 Index: libgfortran/generated/minloc1_8_r4.c
23173 ===================================================================
23174 --- libgfortran/generated/minloc1_8_r4.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
23175 +++ libgfortran/generated/minloc1_8_r4.c        (.../branches/gcc-4_8-branch)   (revision 217117)
23176 @@ -98,10 +98,9 @@
23177        retarray->offset = 0;
23178        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23179  
23180 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23181 -                  * extent[rank-1];
23182 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23183  
23184 -      retarray->base_addr = xmalloc (alloc_size);
23185 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23186        if (alloc_size == 0)
23187         {
23188           /* Make sure we have a zero-sized array.  */
23189 @@ -294,8 +293,7 @@
23190  
23191         }
23192  
23193 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23194 -                  * extent[rank-1];
23195 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23196  
23197        retarray->offset = 0;
23198        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23199 @@ -307,7 +305,7 @@
23200           return;
23201         }
23202        else
23203 -       retarray->base_addr = xmalloc (alloc_size);
23204 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23205  
23206      }
23207    else
23208 @@ -485,8 +483,7 @@
23209        retarray->offset = 0;
23210        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23211  
23212 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23213 -                  * extent[rank-1];
23214 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23215  
23216        if (alloc_size == 0)
23217         {
23218 @@ -495,7 +492,7 @@
23219           return;
23220         }
23221        else
23222 -       retarray->base_addr = xmalloc (alloc_size);
23223 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23224      }
23225    else
23226      {
23227 Index: libgfortran/generated/sum_c8.c
23228 ===================================================================
23229 --- libgfortran/generated/sum_c8.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
23230 +++ libgfortran/generated/sum_c8.c      (.../branches/gcc-4_8-branch)   (revision 217117)
23231 @@ -97,10 +97,9 @@
23232        retarray->offset = 0;
23233        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23234  
23235 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23236 -                  * extent[rank-1];
23237 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23238  
23239 -      retarray->base_addr = xmalloc (alloc_size);
23240 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
23241        if (alloc_size == 0)
23242         {
23243           /* Make sure we have a zero-sized array.  */
23244 @@ -272,8 +271,7 @@
23245  
23246         }
23247  
23248 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23249 -                  * extent[rank-1];
23250 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23251  
23252        retarray->offset = 0;
23253        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23254 @@ -285,7 +283,7 @@
23255           return;
23256         }
23257        else
23258 -       retarray->base_addr = xmalloc (alloc_size);
23259 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
23260  
23261      }
23262    else
23263 @@ -430,8 +428,7 @@
23264        retarray->offset = 0;
23265        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23266  
23267 -      alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23268 -                  * extent[rank-1];
23269 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23270  
23271        if (alloc_size == 0)
23272         {
23273 @@ -440,7 +437,7 @@
23274           return;
23275         }
23276        else
23277 -       retarray->base_addr = xmalloc (alloc_size);
23278 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
23279      }
23280    else
23281      {
23282 Index: libgfortran/generated/maxloc1_16_i2.c
23283 ===================================================================
23284 --- libgfortran/generated/maxloc1_16_i2.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
23285 +++ libgfortran/generated/maxloc1_16_i2.c       (.../branches/gcc-4_8-branch)   (revision 217117)
23286 @@ -98,10 +98,9 @@
23287        retarray->offset = 0;
23288        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23289  
23290 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23291 -                  * extent[rank-1];
23292 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23293  
23294 -      retarray->base_addr = xmalloc (alloc_size);
23295 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23296        if (alloc_size == 0)
23297         {
23298           /* Make sure we have a zero-sized array.  */
23299 @@ -294,8 +293,7 @@
23300  
23301         }
23302  
23303 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23304 -                  * extent[rank-1];
23305 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23306  
23307        retarray->offset = 0;
23308        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23309 @@ -307,7 +305,7 @@
23310           return;
23311         }
23312        else
23313 -       retarray->base_addr = xmalloc (alloc_size);
23314 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23315  
23316      }
23317    else
23318 @@ -485,8 +483,7 @@
23319        retarray->offset = 0;
23320        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23321  
23322 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23323 -                  * extent[rank-1];
23324 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23325  
23326        if (alloc_size == 0)
23327         {
23328 @@ -495,7 +492,7 @@
23329           return;
23330         }
23331        else
23332 -       retarray->base_addr = xmalloc (alloc_size);
23333 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23334      }
23335    else
23336      {
23337 Index: libgfortran/generated/parity_l1.c
23338 ===================================================================
23339 --- libgfortran/generated/parity_l1.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
23340 +++ libgfortran/generated/parity_l1.c   (.../branches/gcc-4_8-branch)   (revision 217117)
23341 @@ -98,10 +98,9 @@
23342        retarray->offset = 0;
23343        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23344  
23345 -      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23346 -                  * extent[rank-1];
23347 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23348  
23349 -      retarray->base_addr = xmalloc (alloc_size);
23350 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
23351        if (alloc_size == 0)
23352         {
23353           /* Make sure we have a zero-sized array.  */
23354 Index: libgfortran/generated/maxval_i16.c
23355 ===================================================================
23356 --- libgfortran/generated/maxval_i16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
23357 +++ libgfortran/generated/maxval_i16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
23358 @@ -97,10 +97,9 @@
23359        retarray->offset = 0;
23360        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23361  
23362 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23363 -                  * extent[rank-1];
23364 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23365  
23366 -      retarray->base_addr = xmalloc (alloc_size);
23367 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23368        if (alloc_size == 0)
23369         {
23370           /* Make sure we have a zero-sized array.  */
23371 @@ -286,8 +285,7 @@
23372  
23373         }
23374  
23375 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23376 -                  * extent[rank-1];
23377 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23378  
23379        retarray->offset = 0;
23380        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23381 @@ -299,7 +297,7 @@
23382           return;
23383         }
23384        else
23385 -       retarray->base_addr = xmalloc (alloc_size);
23386 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23387  
23388      }
23389    else
23390 @@ -472,8 +470,7 @@
23391        retarray->offset = 0;
23392        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23393  
23394 -      alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23395 -                  * extent[rank-1];
23396 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23397  
23398        if (alloc_size == 0)
23399         {
23400 @@ -482,7 +479,7 @@
23401           return;
23402         }
23403        else
23404 -       retarray->base_addr = xmalloc (alloc_size);
23405 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
23406      }
23407    else
23408      {
23409 Index: libgfortran/generated/spread_c8.c
23410 ===================================================================
23411 --- libgfortran/generated/spread_c8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
23412 +++ libgfortran/generated/spread_c8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
23413 @@ -101,8 +101,8 @@
23414         }
23415        ret->offset = 0;
23416  
23417 -      /* xmalloc allocates a single byte for zero size.  */
23418 -      ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
23419 +      /* xmallocarray allocates a single byte for zero size.  */
23420 +      ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
23421        if (rs <= 0)
23422          return;
23423      }
23424 @@ -244,7 +244,7 @@
23425  
23426    if (ret->base_addr == NULL)
23427      {
23428 -      ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
23429 +      ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
23430        ret->offset = 0;
23431        GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
23432      }
23433 Index: libgfortran/generated/matmul_i16.c
23434 ===================================================================
23435 --- libgfortran/generated/matmul_i16.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
23436 +++ libgfortran/generated/matmul_i16.c  (.../branches/gcc-4_8-branch)   (revision 217117)
23437 @@ -124,7 +124,7 @@
23438          }
23439  
23440        retarray->base_addr
23441 -       = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
23442 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
23443        retarray->offset = 0;
23444      }
23445      else if (unlikely (compile_options.bounds_check))
23446 Index: libgfortran/generated/pack_i8.c
23447 ===================================================================
23448 --- libgfortran/generated/pack_i8.c     (.../tags/gcc_4_8_3_release)    (revision 217117)
23449 +++ libgfortran/generated/pack_i8.c     (.../branches/gcc-4_8-branch)   (revision 217117)
23450 @@ -167,8 +167,8 @@
23451  
23452           ret->offset = 0;
23453  
23454 -         /* xmalloc allocates a single byte for zero size.  */
23455 -         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
23456 +         /* xmallocarray allocates a single byte for zero size.  */
23457 +         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
23458  
23459           if (total == 0)
23460             return;
23461 Index: libgfortran/generated/any_l1.c
23462 ===================================================================
23463 --- libgfortran/generated/any_l1.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
23464 +++ libgfortran/generated/any_l1.c      (.../branches/gcc-4_8-branch)   (revision 217117)
23465 @@ -101,8 +101,7 @@
23466        retarray->offset = 0;
23467        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23468  
23469 -      alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23470 -                  * extent[rank-1];
23471 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23472  
23473        if (alloc_size == 0)
23474         {
23475 @@ -111,7 +110,7 @@
23476           return;
23477         }
23478        else
23479 -       retarray->base_addr = xmalloc (alloc_size);
23480 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
23481      }
23482    else
23483      {
23484 Index: libgfortran/generated/minloc1_8_i2.c
23485 ===================================================================
23486 --- libgfortran/generated/minloc1_8_i2.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
23487 +++ libgfortran/generated/minloc1_8_i2.c        (.../branches/gcc-4_8-branch)   (revision 217117)
23488 @@ -98,10 +98,9 @@
23489        retarray->offset = 0;
23490        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23491  
23492 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23493 -                  * extent[rank-1];
23494 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23495  
23496 -      retarray->base_addr = xmalloc (alloc_size);
23497 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23498        if (alloc_size == 0)
23499         {
23500           /* Make sure we have a zero-sized array.  */
23501 @@ -294,8 +293,7 @@
23502  
23503         }
23504  
23505 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23506 -                  * extent[rank-1];
23507 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23508  
23509        retarray->offset = 0;
23510        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23511 @@ -307,7 +305,7 @@
23512           return;
23513         }
23514        else
23515 -       retarray->base_addr = xmalloc (alloc_size);
23516 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23517  
23518      }
23519    else
23520 @@ -485,8 +483,7 @@
23521        retarray->offset = 0;
23522        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23523  
23524 -      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23525 -                  * extent[rank-1];
23526 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23527  
23528        if (alloc_size == 0)
23529         {
23530 @@ -495,7 +492,7 @@
23531           return;
23532         }
23533        else
23534 -       retarray->base_addr = xmalloc (alloc_size);
23535 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
23536      }
23537    else
23538      {
23539 Index: libgfortran/generated/minloc0_8_r8.c
23540 ===================================================================
23541 --- libgfortran/generated/minloc0_8_r8.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
23542 +++ libgfortran/generated/minloc0_8_r8.c        (.../branches/gcc-4_8-branch)   (revision 217117)
23543 @@ -58,7 +58,7 @@
23544        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
23545        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23546        retarray->offset = 0;
23547 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
23548 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
23549      }
23550    else
23551      {
23552 @@ -199,7 +199,7 @@
23553        GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
23554        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23555        retarray->offset = 0;
23556 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
23557 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
23558      }
23559    else
23560      {
23561 @@ -367,7 +367,7 @@
23562        GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
23563        retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
23564        retarray->offset = 0;
23565 -      retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
23566 +      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
23567      }
23568    else if (unlikely (compile_options.bounds_check))
23569      {
23570 Index: libgfortran/generated/matmul_l8.c
23571 ===================================================================
23572 --- libgfortran/generated/matmul_l8.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
23573 +++ libgfortran/generated/matmul_l8.c   (.../branches/gcc-4_8-branch)   (revision 217117)
23574 @@ -88,7 +88,7 @@
23575          }
23576            
23577        retarray->base_addr
23578 -       = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
23579 +       = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
23580        retarray->offset = 0;
23581      }
23582      else if (unlikely (compile_options.bounds_check))
23583 Index: libgfortran/generated/product_r10.c
23584 ===================================================================
23585 --- libgfortran/generated/product_r10.c (.../tags/gcc_4_8_3_release)    (revision 217117)
23586 +++ libgfortran/generated/product_r10.c (.../branches/gcc-4_8-branch)   (revision 217117)
23587 @@ -97,10 +97,9 @@
23588        retarray->offset = 0;
23589        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23590  
23591 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23592 -                  * extent[rank-1];
23593 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23594  
23595 -      retarray->base_addr = xmalloc (alloc_size);
23596 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
23597        if (alloc_size == 0)
23598         {
23599           /* Make sure we have a zero-sized array.  */
23600 @@ -272,8 +271,7 @@
23601  
23602         }
23603  
23604 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23605 -                  * extent[rank-1];
23606 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23607  
23608        retarray->offset = 0;
23609        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23610 @@ -285,7 +283,7 @@
23611           return;
23612         }
23613        else
23614 -       retarray->base_addr = xmalloc (alloc_size);
23615 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
23616  
23617      }
23618    else
23619 @@ -430,8 +428,7 @@
23620        retarray->offset = 0;
23621        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23622  
23623 -      alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23624 -                  * extent[rank-1];
23625 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23626  
23627        if (alloc_size == 0)
23628         {
23629 @@ -440,7 +437,7 @@
23630           return;
23631         }
23632        else
23633 -       retarray->base_addr = xmalloc (alloc_size);
23634 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
23635      }
23636    else
23637      {
23638 Index: libgfortran/generated/product_i1.c
23639 ===================================================================
23640 --- libgfortran/generated/product_i1.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
23641 +++ libgfortran/generated/product_i1.c  (.../branches/gcc-4_8-branch)   (revision 217117)
23642 @@ -97,10 +97,9 @@
23643        retarray->offset = 0;
23644        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23645  
23646 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23647 -                  * extent[rank-1];
23648 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23649  
23650 -      retarray->base_addr = xmalloc (alloc_size);
23651 +      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
23652        if (alloc_size == 0)
23653         {
23654           /* Make sure we have a zero-sized array.  */
23655 @@ -272,8 +271,7 @@
23656  
23657         }
23658  
23659 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23660 -                  * extent[rank-1];
23661 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23662  
23663        retarray->offset = 0;
23664        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23665 @@ -285,7 +283,7 @@
23666           return;
23667         }
23668        else
23669 -       retarray->base_addr = xmalloc (alloc_size);
23670 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
23671  
23672      }
23673    else
23674 @@ -430,8 +428,7 @@
23675        retarray->offset = 0;
23676        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23677  
23678 -      alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23679 -                  * extent[rank-1];
23680 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23681  
23682        if (alloc_size == 0)
23683         {
23684 @@ -440,7 +437,7 @@
23685           return;
23686         }
23687        else
23688 -       retarray->base_addr = xmalloc (alloc_size);
23689 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
23690      }
23691    else
23692      {
23693 Index: libgfortran/generated/all_l8.c
23694 ===================================================================
23695 --- libgfortran/generated/all_l8.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
23696 +++ libgfortran/generated/all_l8.c      (.../branches/gcc-4_8-branch)   (revision 217117)
23697 @@ -101,8 +101,7 @@
23698        retarray->offset = 0;
23699        retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
23700  
23701 -      alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
23702 -                  * extent[rank-1];
23703 +      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
23704  
23705        if (alloc_size == 0)
23706         {
23707 @@ -111,7 +110,7 @@
23708           return;
23709         }
23710        else
23711 -       retarray->base_addr = xmalloc (alloc_size);
23712 +       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
23713      }
23714    else
23715      {
23716 Index: libgfortran/generated/in_pack_r16.c
23717 ===================================================================
23718 --- libgfortran/generated/in_pack_r16.c (.../tags/gcc_4_8_3_release)    (revision 217117)
23719 +++ libgfortran/generated/in_pack_r16.c (.../branches/gcc-4_8-branch)   (revision 217117)
23720 @@ -76,7 +76,7 @@
23721      return source->base_addr;
23722  
23723    /* Allocate storage for the destination.  */
23724 -  destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
23725 +  destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
23726    dest = destptr;
23727    src = source->base_addr;
23728    stride0 = stride[0];
23729 Index: libgfortran/generated/in_pack_i1.c
23730 ===================================================================
23731 --- libgfortran/generated/in_pack_i1.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
23732 +++ libgfortran/generated/in_pack_i1.c  (.../branches/gcc-4_8-branch)   (revision 217117)
23733 @@ -76,7 +76,7 @@
23734      return source->base_addr;
23735  
23736    /* Allocate storage for the destination.  */
23737 -  destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
23738 +  destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
23739    dest = destptr;
23740    src = source->base_addr;
23741    stride0 = stride[0];
23742 Index: libgfortran/libgfortran.h
23743 ===================================================================
23744 --- libgfortran/libgfortran.h   (.../tags/gcc_4_8_3_release)    (revision 217117)
23745 +++ libgfortran/libgfortran.h   (.../branches/gcc-4_8-branch)   (revision 217117)
23746 @@ -751,6 +751,9 @@
23747  extern void *xmalloc (size_t) __attribute__ ((malloc));
23748  internal_proto(xmalloc);
23749  
23750 +extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
23751 +internal_proto(xmallocarray);
23752 +
23753  extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
23754  internal_proto(xcalloc);
23755  
23756 Index: libgfortran/config.h.in
23757 ===================================================================
23758 --- libgfortran/config.h.in     (.../tags/gcc_4_8_3_release)    (revision 217117)
23759 +++ libgfortran/config.h.in     (.../branches/gcc-4_8-branch)   (revision 217117)
23760 @@ -711,6 +711,9 @@
23761  /* Define to 1 if you have the `strtof' function. */
23762  #undef HAVE_STRTOF
23763  
23764 +/* Define to 1 if you have the `strtok_r' function. */
23765 +#undef HAVE_STRTOK_R
23766 +
23767  /* Define to 1 if you have the `strtold' function. */
23768  #undef HAVE_STRTOLD
23769  
23770 Index: libgfortran/io/list_read.c
23771 ===================================================================
23772 --- libgfortran/io/list_read.c  (.../tags/gcc_4_8_3_release)    (revision 217117)
23773 +++ libgfortran/io/list_read.c  (.../branches/gcc-4_8-branch)   (revision 217117)
23774 @@ -2354,7 +2354,7 @@
23775  {
23776    index_type len = strlen (nl->var_name) + 1;
23777    int dim;
23778 -  char * ext_name = (char*)xmalloc (len + 1);
23779 +  char * ext_name = xmalloc (len + 1);
23780    memcpy (ext_name, nl->var_name, len-1);
23781    memcpy (ext_name + len - 1, "%", 2);
23782    for (nl = nl->next; nl; nl = nl->next)
23783 Index: libgfortran/io/unit.c
23784 ===================================================================
23785 --- libgfortran/io/unit.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
23786 +++ libgfortran/io/unit.c       (.../branches/gcc-4_8-branch)   (revision 217117)
23787 @@ -455,7 +455,7 @@
23788      {
23789        iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
23790        iunit->ls = (array_loop_spec *)
23791 -       xmalloc (iunit->rank * sizeof (array_loop_spec));
23792 +       xmallocarray (iunit->rank, sizeof (array_loop_spec));
23793        dtp->internal_unit_len *=
23794         init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
23795  
23796 Index: libgfortran/io/unix.c
23797 ===================================================================
23798 --- libgfortran/io/unix.c       (.../tags/gcc_4_8_3_release)    (revision 217117)
23799 +++ libgfortran/io/unix.c       (.../branches/gcc-4_8-branch)   (revision 217117)
23800 @@ -407,7 +407,9 @@
23801  {
23802    int retval;
23803    
23804 -  if (s->fd != STDOUT_FILENO
23805 +  if (s->fd == -1)
23806 +    retval = -1;
23807 +  else if (s->fd != STDOUT_FILENO
23808        && s->fd != STDERR_FILENO
23809        && s->fd != STDIN_FILENO)
23810      retval = close (s->fd);
23811 @@ -983,7 +985,15 @@
23812  
23813    /* Get the current length of the file. */
23814  
23815 -  fstat (fd, &statbuf);
23816 +  if (fstat (fd, &statbuf) == -1)
23817 +    {
23818 +      s->st_dev = s->st_ino = -1;
23819 +      s->file_length = 0;
23820 +      if (errno == EBADF)
23821 +       s->fd = -1;
23822 +      raw_init (s);
23823 +      return (stream *) s;
23824 +    }
23825  
23826    s->st_dev = statbuf.st_dev;
23827    s->st_ino = statbuf.st_ino;
23828 Index: libgfortran/io/transfer.c
23829 ===================================================================
23830 --- libgfortran/io/transfer.c   (.../tags/gcc_4_8_3_release)    (revision 217117)
23831 +++ libgfortran/io/transfer.c   (.../branches/gcc-4_8-branch)   (revision 217117)
23832 @@ -3776,9 +3776,9 @@
23833    if (nml->var_rank > 0)
23834      {
23835        nml->dim = (descriptor_dimension*)
23836 -                  xmalloc (nml->var_rank * sizeof (descriptor_dimension));
23837 +       xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
23838        nml->ls = (array_loop_spec*)
23839 -                 xmalloc (nml->var_rank * sizeof (array_loop_spec));
23840 +       xmallocarray (nml->var_rank, sizeof (array_loop_spec));
23841      }
23842    else
23843      {
23844 Index: libgfortran/io/write.c
23845 ===================================================================
23846 --- libgfortran/io/write.c      (.../tags/gcc_4_8_3_release)    (revision 217117)
23847 +++ libgfortran/io/write.c      (.../branches/gcc-4_8-branch)   (revision 217117)
23848 @@ -1863,7 +1863,7 @@
23849               base_var_name_len = base ? strlen (base->var_name) : 0;
23850               ext_name_len = base_name_len + base_var_name_len 
23851                 + strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
23852 -             ext_name = (char*)xmalloc (ext_name_len);
23853 +             ext_name = xmalloc (ext_name_len);
23854  
23855               memcpy (ext_name, base_name, base_name_len);
23856               clen = strlen (obj->var_name + base_var_name_len);
23857 @@ -1892,7 +1892,7 @@
23858               /* Now obj_name.  */
23859  
23860               obj_name_len = strlen (obj->var_name) + 1;
23861 -             obj_name = xmalloc (obj_name_len+1);
23862 +             obj_name = xmalloc (obj_name_len + 1);
23863               memcpy (obj_name, obj->var_name, obj_name_len-1);
23864               memcpy (obj_name + obj_name_len-1, "%", 2);
23865  
23866 Index: libada/Makefile.in
23867 ===================================================================
23868 --- libada/Makefile.in  (.../tags/gcc_4_8_3_release)    (revision 217117)
23869 +++ libada/Makefile.in  (.../branches/gcc-4_8-branch)   (revision 217117)
23870 @@ -60,7 +60,7 @@
23871  PICFLAG = @PICFLAG@
23872  GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
23873  GNATLIBCFLAGS= -O2
23874 -GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
23875 +GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
23876         -fexceptions -DIN_RTS @have_getipinfo@
23877  
23878  host_subdir = @host_subdir@
23879 Index: libada/ChangeLog
23880 ===================================================================
23881 --- libada/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
23882 +++ libada/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
23883 @@ -1,3 +1,7 @@
23884 +2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
23885 +
23886 +       * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
23887 +
23888  2014-05-22  Release Manager
23889  
23890         * GCC 4.8.3 released.
23891 Index: libffi/src/powerpc/linux64_closure.S
23892 ===================================================================
23893 --- libffi/src/powerpc/linux64_closure.S        (.../tags/gcc_4_8_3_release)    (revision 217117)
23894 +++ libffi/src/powerpc/linux64_closure.S        (.../branches/gcc-4_8-branch)   (revision 217117)
23895 @@ -381,7 +381,8 @@
23896         .align 3
23897  .LEFDE1:
23898  
23899 -# if defined __ELF__ && defined __linux__
23900 +#endif
23901 +
23902 +#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
23903         .section        .note.GNU-stack,"",@progbits
23904 -# endif
23905  #endif
23906 Index: libffi/src/powerpc/linux64.S
23907 ===================================================================
23908 --- libffi/src/powerpc/linux64.S        (.../tags/gcc_4_8_3_release)    (revision 217117)
23909 +++ libffi/src/powerpc/linux64.S        (.../branches/gcc-4_8-branch)   (revision 217117)
23910 @@ -254,7 +254,8 @@
23911         .align 3
23912  .LEFDE1:
23913  
23914 -# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
23915 +#endif
23916 +
23917 +#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
23918         .section        .note.GNU-stack,"",@progbits
23919 -# endif
23920  #endif
23921 Index: libffi/ChangeLog
23922 ===================================================================
23923 --- libffi/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
23924 +++ libffi/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
23925 @@ -1,3 +1,9 @@
23926 +2014-09-11  Jakub Jelinek  <jakub@redhat.com>
23927 +
23928 +       * src/powerpc/linux64.S: Emit .note.GNU-stack even when
23929 +       POWERPC64 is not defined.
23930 +       * src/powerpc/linux64_closure.S: Likewise.  Also test _CALL_ELF == 2.
23931 +
23932  2014-05-22  Release Manager
23933  
23934         * GCC 4.8.3 released.
23935 Index: libcpp/ChangeLog
23936 ===================================================================
23937 --- libcpp/ChangeLog    (.../tags/gcc_4_8_3_release)    (revision 217117)
23938 +++ libcpp/ChangeLog    (.../branches/gcc-4_8-branch)   (revision 217117)
23939 @@ -1,3 +1,14 @@
23940 +2014-10-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
23941 +
23942 +       Backport from mainline r215873
23943 +       2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
23944 +
23945 +       * lex.c (search_line_fast): Add new version to be used for Power8
23946 +       and later targets when Altivec is enabled.  Restrict the existing
23947 +       Altivec version to big-endian systems so that lvsr is not used on
23948 +       little endian, where it is deprecated.  Remove LE-specific code
23949 +       from the now-BE-only version.
23950 +
23951  2014-05-22  Release Manager
23952  
23953         * GCC 4.8.3 released.
23954 Index: libcpp/lex.c
23955 ===================================================================
23956 --- libcpp/lex.c        (.../tags/gcc_4_8_3_release)    (revision 217117)
23957 +++ libcpp/lex.c        (.../branches/gcc-4_8-branch)   (revision 217117)
23958 @@ -515,9 +515,111 @@
23959    search_line_fast = impl;
23960  }
23961  
23962 -#elif (GCC_VERSION >= 4005) && defined(__ALTIVEC__)
23963 +#elif defined(_ARCH_PWR8) && defined(__ALTIVEC__)
23964  
23965 -/* A vection of the fast scanner using AltiVec vectorized byte compares.  */
23966 +/* A vection of the fast scanner using AltiVec vectorized byte compares
23967 +   and VSX unaligned loads (when VSX is available).  This is otherwise
23968 +   the same as the pre-GCC 5 version.  */
23969 +
23970 +static const uchar *
23971 +search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
23972 +{
23973 +  typedef __attribute__((altivec(vector))) unsigned char vc;
23974 +
23975 +  const vc repl_nl = {
23976 +    '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', 
23977 +    '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n'
23978 +  };
23979 +  const vc repl_cr = {
23980 +    '\r', '\r', '\r', '\r', '\r', '\r', '\r', '\r', 
23981 +    '\r', '\r', '\r', '\r', '\r', '\r', '\r', '\r'
23982 +  };
23983 +  const vc repl_bs = {
23984 +    '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', 
23985 +    '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\'
23986 +  };
23987 +  const vc repl_qm = {
23988 +    '?', '?', '?', '?', '?', '?', '?', '?', 
23989 +    '?', '?', '?', '?', '?', '?', '?', '?', 
23990 +  };
23991 +  const vc zero = { 0 };
23992 +
23993 +  vc data, t;
23994 +
23995 +  /* Main loop processing 16 bytes at a time.  */
23996 +  do
23997 +    {
23998 +      vc m_nl, m_cr, m_bs, m_qm;
23999 +
24000 +      data = *((const vc *)s);
24001 +      s += 16;
24002 +
24003 +      m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
24004 +      m_cr = (vc) __builtin_vec_cmpeq(data, repl_cr);
24005 +      m_bs = (vc) __builtin_vec_cmpeq(data, repl_bs);
24006 +      m_qm = (vc) __builtin_vec_cmpeq(data, repl_qm);
24007 +      t = (m_nl | m_cr) | (m_bs | m_qm);
24008 +
24009 +      /* T now contains 0xff in bytes for which we matched one of the relevant
24010 +        characters.  We want to exit the loop if any byte in T is non-zero.
24011 +        Below is the expansion of vec_any_ne(t, zero).  */
24012 +    }
24013 +  while (!__builtin_vec_vcmpeq_p(/*__CR6_LT_REV*/3, t, zero));
24014 +
24015 +  /* Restore s to to point to the 16 bytes we just processed.  */
24016 +  s -= 16;
24017 +
24018 +  {
24019 +#define N  (sizeof(vc) / sizeof(long))
24020 +
24021 +    union {
24022 +      vc v;
24023 +      /* Statically assert that N is 2 or 4.  */
24024 +      unsigned long l[(N == 2 || N == 4) ? N : -1];
24025 +    } u;
24026 +    unsigned long l, i = 0;
24027 +
24028 +    u.v = t;
24029 +
24030 +    /* Find the first word of T that is non-zero.  */
24031 +    switch (N)
24032 +      {
24033 +      case 4:
24034 +       l = u.l[i++];
24035 +       if (l != 0)
24036 +         break;
24037 +       s += sizeof(unsigned long);
24038 +       l = u.l[i++];
24039 +       if (l != 0)
24040 +         break;
24041 +       s += sizeof(unsigned long);
24042 +      case 2:
24043 +       l = u.l[i++];
24044 +       if (l != 0)
24045 +         break;
24046 +       s += sizeof(unsigned long);
24047 +       l = u.l[i];
24048 +      }
24049 +
24050 +    /* L now contains 0xff in bytes for which we matched one of the
24051 +       relevant characters.  We can find the byte index by finding
24052 +       its bit index and dividing by 8.  */
24053 +#ifdef __BIG_ENDIAN__
24054 +    l = __builtin_clzl(l) >> 3;
24055 +#else
24056 +    l = __builtin_ctzl(l) >> 3;
24057 +#endif
24058 +    return s + l;
24059 +
24060 +#undef N
24061 +  }
24062 +}
24063 +
24064 +#elif (GCC_VERSION >= 4005) && defined(__ALTIVEC__) && defined (__BIG_ENDIAN__)
24065 +
24066 +/* A vection of the fast scanner using AltiVec vectorized byte compares.
24067 +   This cannot be used for little endian because vec_lvsl/lvsr are
24068 +   deprecated for little endian and the code won't work properly.  */
24069  /* ??? Unfortunately, attribute(target("altivec")) is not yet supported,
24070     so we can't compile this function without -maltivec on the command line
24071     (or implied by some other switch).  */
24072 @@ -559,13 +661,8 @@
24073       beginning with all ones and shifting in zeros according to the
24074       mis-alignment.  The LVSR instruction pulls the exact shift we
24075       want from the address.  */
24076 -#ifdef __BIG_ENDIAN__
24077    mask = __builtin_vec_lvsr(0, s);
24078    mask = __builtin_vec_perm(zero, ones, mask);
24079 -#else
24080 -  mask = __builtin_vec_lvsl(0, s);
24081 -  mask = __builtin_vec_perm(ones, zero, mask);
24082 -#endif
24083    data &= mask;
24084  
24085    /* While altivec loads mask addresses, we still need to align S so
24086 @@ -629,11 +726,7 @@
24087      /* L now contains 0xff in bytes for which we matched one of the
24088         relevant characters.  We can find the byte index by finding
24089         its bit index and dividing by 8.  */
24090 -#ifdef __BIG_ENDIAN__
24091      l = __builtin_clzl(l) >> 3;
24092 -#else
24093 -    l = __builtin_ctzl(l) >> 3;
24094 -#endif
24095      return s + l;
24096  
24097  #undef N
24098 Index: .
24099 ===================================================================
24100 --- .   (.../tags/gcc_4_8_3_release)    (revision 217117)
24101 +++ .   (.../branches/gcc-4_8-branch)   (revision 217117)
24102
24103 Property changes on: .
24104 ___________________________________________________________________
24105 Modified: svn:mergeinfo
24106    Merged /trunk:r211733,215049