1
# DP: updates from the 4.8 branch upto 20140831 (r214767).
5
cat > ${dir}LAST_UPDATED <<EOF
6
Sat Sep 13 11:05:45 CEST 2014
7
Sat Sep 13 09:05:45 UTC 2014 (revision 215236)
11
LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_3_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch \
12
| sed -r 's,^--- (\S+)\t(\S+)(.*)$,--- a/src/\1\t\2,;s,^\+\+\+ (\S+)\t(\S+)(.*)$,+++ b/src/\1\t\2,' \
13
| awk '/^Index:.*\.(class|texi)/ {skip=1; next} /^Index:/ { skip=0 } skip==0'
15
Index: libstdc++-v3/python/libstdcxx/v6/printers.py
16
===================================================================
17
--- a/src/libstdc++-v3/python/libstdcxx/v6/printers.py (.../tags/gcc_4_8_3_release)
18
+++ b/src/libstdc++-v3/python/libstdcxx/v6/printers.py (.../branches/gcc-4_8-branch)
20
-# Pretty-printers for libstc++.
21
+# Pretty-printers for libstdc++.
23
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
31
+### Python 2 + Python 3 compatibility code
33
+# Resources about compatibility:
35
+# * <http://pythonhosted.org/six/>: Documentation of the "six" module
37
+# FIXME: The handling of e.g. std::basic_string (at least on char)
38
+# probably needs updating to work with Python 3's new string rules.
40
+# In particular, Python 3 has a separate type (called byte) for
41
+# bytestrings, and a special b"" syntax for the byte literals; the old
42
+# str() type has been redefined to always store Unicode text.
44
+# We probably can't do much about this until this GDB PR is addressed:
45
+# <https://sourceware.org/bugzilla/show_bug.cgi?id=17138>
47
+if sys.version_info[0] > 2:
50
+ # Python 3 folds these into the normal functions.
53
+ # Also, int subsumes long
58
+ """Compatibility mixin for iterators
60
+ Instead of writing next() methods for iterators, write
61
+ __next__() methods and use this mixin to make them work in
62
+ Python 2 as well as Python 3.
64
+ Idea stolen from the "six" documentation:
65
+ <http://pythonhosted.org/six/#six.Iterator>
69
+ return self.__next__()
71
+ # In Python 2, we still need these from itertools
72
+ from itertools import imap, izip
74
# Try to use the new-style pretty-printing if available.
78
# anything fancier here.
79
field = typ.fields()[0]
80
if not field.is_base_class:
81
- raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
82
+ raise ValueError("Cannot find type %s::%s" % (str(orig), name))
85
class SharedPointerPrinter:
91
+ class _iterator(Iterator):
92
def __init__(self, nodetype, head):
93
self.nodetype = nodetype
94
self.base = head['_M_next']
100
+ def __next__(self):
101
if self.base == self.head:
103
elt = self.base.cast(self.nodetype).dereference()
105
class StdSlistPrinter:
106
"Print a __gnu_cxx::slist"
109
+ class _iterator(Iterator):
110
def __init__(self, nodetype, head):
111
self.nodetype = nodetype
112
self.base = head['_M_head']['_M_next']
118
+ def __next__(self):
121
elt = self.base.cast(self.nodetype).dereference()
123
class StdVectorPrinter:
124
"Print a std::vector"
127
+ class _iterator(Iterator):
128
def __init__ (self, start, finish, bitvec):
136
+ def __next__(self):
138
self.count = self.count + 1
141
class StdTuplePrinter:
145
+ class _iterator(Iterator):
146
def __init__ (self, head):
149
@@ -276,13 +320,13 @@
150
# Set the actual head to the first pair.
151
self.head = self.head.cast (nodes[0].type)
152
elif len (nodes) != 0:
153
- raise ValueError, "Top of tuple tree does not consist of a single node."
154
+ raise ValueError("Top of tuple tree does not consist of a single node.")
161
+ def __next__ (self):
162
nodes = self.head.type.fields ()
163
# Check for further recursions in the inheritance tree.
167
# Check that this iteration has an expected structure.
169
- raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
170
+ raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
172
# - Left node is the next recursion parent.
173
# - Right node is the actual class contained in the tuple.
175
return self.visualizer.display_hint ()
178
-class RbtreeIterator:
179
+class RbtreeIterator(Iterator):
180
def __init__(self, rbtree):
181
self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
182
self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
185
return int (self.size)
188
+ def __next__(self):
189
if self.count == self.size:
193
"Print a std::map or std::multimap"
195
# Turn an RbtreeIterator into a pretty-print iterator.
197
+ class _iter(Iterator):
198
def __init__(self, rbiter, type):
206
+ def __next__(self):
207
if self.count % 2 == 0:
208
- n = self.rbiter.next()
209
+ n = next(self.rbiter)
210
n = n.cast(self.type).dereference()['_M_value_field']
214
"Print a std::set or std::multiset"
216
# Turn an RbtreeIterator into a pretty-print iterator.
218
+ class _iter(Iterator):
219
def __init__(self, rbiter, type):
227
- item = self.rbiter.next()
228
+ def __next__(self):
229
+ item = next(self.rbiter)
230
item = item.cast(self.type).dereference()['_M_value_field']
231
# FIXME: this is weird ... what to do?
232
# Maybe a 'set' display hint?
234
class StdDequePrinter:
238
+ class _iter(Iterator):
239
def __init__(self, node, start, end, last, buffer_size):
247
+ def __next__(self):
248
if self.p == self.last:
252
def display_hint (self):
255
-class Tr1HashtableIterator:
256
+class Tr1HashtableIterator(Iterator):
257
def __init__ (self, hash):
258
self.node = hash['_M_bbegin']['_M_node']['_M_nxt']
259
self.node_type = find_type(hash.type, '__node_type').pointer()
265
+ def __next__ (self):
268
node = self.node.cast(self.node_type)
273
- counter = itertools.imap (self.format_count, itertools.count())
274
- return itertools.izip (counter, Tr1HashtableIterator (self.hashtable()))
275
+ counter = imap (self.format_count, itertools.count())
276
+ return izip (counter, Tr1HashtableIterator (self.hashtable()))
278
class Tr1UnorderedMapPrinter:
279
"Print a tr1::unordered_map"
280
@@ -688,11 +732,11 @@
284
- counter = itertools.imap (self.format_count, itertools.count())
285
+ counter = imap (self.format_count, itertools.count())
286
# Map over the hash table and flatten the result.
287
- data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
288
+ data = self.flatten (imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
289
# Zip the two iterators together.
290
- return itertools.izip (counter, data)
291
+ return izip (counter, data)
293
def display_hint (self):
296
class StdForwardListPrinter:
297
"Print a std::forward_list"
300
+ class _iterator(Iterator):
301
def __init__(self, nodetype, head):
302
self.nodetype = nodetype
303
self.base = head['_M_next']
309
+ def __next__(self):
312
elt = self.base.cast(self.nodetype).dereference()
314
# A small sanity check.
316
if not self.compiled_rx.match(name + '<>'):
317
- raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
318
+ raise ValueError('libstdc++ programming error: "%s" does not match' % name)
319
printer = RxPrinter(name, function)
320
self.subprinters.append(printer)
321
self.lookup[name] = printer
322
Index: libstdc++-v3/scripts/run_doxygen
323
===================================================================
324
--- a/src/libstdc++-v3/scripts/run_doxygen (.../tags/gcc_4_8_3_release)
325
+++ b/src/libstdc++-v3/scripts/run_doxygen (.../branches/gcc-4_8-branch)
330
- # Also drop in the header file and style sheet
331
- doxygen -w latex header.tex doxygen.sty
332
+ # Grrr, Doxygen 1.8.x changed the -w latex options.
333
+ need_footer=`doxygen -h | sed -n -e '/-w latex/s=.*footer.*=true=p'`
335
+ # Also drop in the header file (maybe footer file) and style sheet
336
+ if $need_footer; then
337
+ doxygen -w latex header.tex footer.tex doxygen.sty
339
+ doxygen -w latex header.tex doxygen.sty
343
echo :: LaTeX pages begin with
344
Index: libstdc++-v3/doc/xml/manual/status_cxx2011.xml
345
===================================================================
346
--- a/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml (.../tags/gcc_4_8_3_release)
347
+++ b/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml (.../branches/gcc-4_8-branch)
348
@@ -226,10 +226,12 @@
352
+ <?dbhtml bgcolor="#B0B0B0" ?>
353
<entry>18.8.6</entry>
354
<entry><code>nested_exception</code></entry>
357
+ <entry>Partial</entry>
358
+ <entry>Follows an earlier C++0x draft, not the final specification.
363
@@ -1119,10 +1121,11 @@
367
+ <?dbhtml bgcolor="#B0B0B0" ?>
369
<entry>Class template <code>basic_string</code></entry>
372
+ <entry>Partial</entry>
373
+ <entry>Missing <code>getline</code> overloads for rvalue streams.</entry>
377
Index: libstdc++-v3/doc/html/manual/status.html
378
===================================================================
379
--- a/src/libstdc++-v3/doc/html/manual/status.html (.../tags/gcc_4_8_3_release)
380
+++ b/src/libstdc++-v3/doc/html/manual/status.html (.../branches/gcc-4_8-branch)
382
<code class="code">set_new_handler</code> is not thread-safe.
383
</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>.
384
<code class="code">set_terminate</code> is not thread-safe.
385
- </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">
386
+ </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.
387
+ </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">
388
<span class="emphasis"><em>19</em></span>
389
</td><td colspan="3" align="left">
390
<span class="emphasis"><em>Diagnostics</em></span>
392
<span class="emphasis"><em>21</em></span>
393
</td><td colspan="3" align="left">
394
<span class="emphasis"><em>Strings</em></span>
395
- </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<char></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<char16_t></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<char32_t></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<wchar_t></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.
396
+ </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<char></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<char16_t></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<char32_t></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<wchar_t></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">Missing <code class="code">getline</code> overloads for rvalue streams.</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.
397
Missing <code class="filename"><cuchar></code>
398
</td></tr><tr><td align="left">
399
<span class="emphasis"><em>22</em></span>
400
Index: libstdc++-v3/doc/html/manual/abi.html
401
===================================================================
402
--- a/src/libstdc++-v3/doc/html/manual/abi.html (.../tags/gcc_4_8_3_release)
403
+++ b/src/libstdc++-v3/doc/html/manual/abi.html (.../branches/gcc-4_8-branch)
405
definitions, where the version definition is the maximum for a
406
particular release. Labels are cumulative. If a particular release
407
is not listed, it has the same version labels as the preceding
408
- 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>
409
+ 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>
410
Release versioning on the libstdc++.so binary, implemented in
411
the same way as the libgcc_s.so binary above. Listed is the
412
filename: <code class="constant">DT_SONAME</code> can be deduced from
414
has the same filename and <code class="constant">DT_SONAME</code> as the
416
</p><p>It is versioned as follows:
417
- </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>
418
+ </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>
419
Note 1: Error should be libstdc++.so.3.0.3.
421
Note 2: Not strictly required.
423
GLIBCPP_3.2 for symbols that were introduced in the GCC 3.2.0
424
release.) If a particular release is not listed, it has the same
425
version labels as the preceding release.
426
- </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,
427
+ </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,
428
__GXX_ABI_VERSION. This macro is defined as the version of the
429
compiler v3 ABI, with g++ 3.0 being version 100. This macro will
430
be automatically defined whenever g++ is used (the curious can
431
Index: libstdc++-v3/include/std/future
432
===================================================================
433
--- a/src/libstdc++-v3/include/std/future (.../tags/gcc_4_8_3_release)
434
+++ b/src/libstdc++-v3/include/std/future (.../branches/gcc-4_8-branch)
435
@@ -351,12 +351,14 @@
437
_M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
439
- bool __set = __ignore_failure;
440
+ bool __set = false;
441
// all calls to this function are serialized,
442
// side-effects of invoking __res only happen once
443
call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
447
+ _M_cond.notify_all();
448
+ else if (!__ignore_failure)
449
__throw_future_error(int(future_errc::promise_already_satisfied));
453
lock_guard<mutex> __lock(_M_mutex);
454
_M_result.swap(__res);
456
- _M_cond.notify_all();
460
@@ -983,22 +984,25 @@
462
set_value(const _Res& __r)
464
+ auto __future = _M_future;
465
auto __setter = _State::__setter(this, __r);
466
- _M_future->_M_set_result(std::move(__setter));
467
+ __future->_M_set_result(std::move(__setter));
471
set_value(_Res&& __r)
473
+ auto __future = _M_future;
474
auto __setter = _State::__setter(this, std::move(__r));
475
- _M_future->_M_set_result(std::move(__setter));
476
+ __future->_M_set_result(std::move(__setter));
480
set_exception(exception_ptr __p)
482
+ auto __future = _M_future;
483
auto __setter = _State::__setter(__p, this);
484
- _M_future->_M_set_result(std::move(__setter));
485
+ __future->_M_set_result(std::move(__setter));
489
@@ -1081,15 +1085,17 @@
493
+ auto __future = _M_future;
494
auto __setter = _State::__setter(this, __r);
495
- _M_future->_M_set_result(std::move(__setter));
496
+ __future->_M_set_result(std::move(__setter));
500
set_exception(exception_ptr __p)
502
+ auto __future = _M_future;
503
auto __setter = _State::__setter(__p, this);
504
- _M_future->_M_set_result(std::move(__setter));
505
+ __future->_M_set_result(std::move(__setter));
509
@@ -1166,8 +1172,9 @@
511
set_exception(exception_ptr __p)
513
+ auto __future = _M_future;
514
auto __setter = _State::__setter(__p, this);
515
- _M_future->_M_set_result(std::move(__setter));
516
+ __future->_M_set_result(std::move(__setter));
520
@@ -1193,8 +1200,9 @@
522
promise<void>::set_value()
524
+ auto __future = _M_future;
525
auto __setter = _State::__setter(this);
526
- _M_future->_M_set_result(std::move(__setter));
527
+ __future->_M_set_result(std::move(__setter));
531
Index: libstdc++-v3/include/ext/rope
532
===================================================================
533
--- a/src/libstdc++-v3/include/ext/rope (.../tags/gcc_4_8_3_release)
534
+++ b/src/libstdc++-v3/include/ext/rope (.../branches/gcc-4_8-branch)
535
@@ -1544,7 +1544,7 @@
536
typedef typename _Base::allocator_type allocator_type;
537
using _Base::_M_tree_ptr;
538
using _Base::get_allocator;
539
- using _Base::_M_get_allocator;
540
+ using _Base::_M_get_allocator;
541
typedef __GC_CONST _CharT* _Cstrptr;
543
static _CharT _S_empty_c_str[1];
544
@@ -1876,8 +1876,9 @@
545
const allocator_type& __a = allocator_type())
548
- this->_M_tree_ptr = (0 == __len) ?
549
- 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
550
+ this->_M_tree_ptr = (0 == __len)
552
+ : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
555
rope(const rope& __x, const allocator_type& __a = allocator_type())
556
Index: libstdc++-v3/include/bits/stl_tree.h
557
===================================================================
558
--- a/src/libstdc++-v3/include/bits/stl_tree.h (.../tags/gcc_4_8_3_release)
559
+++ b/src/libstdc++-v3/include/bits/stl_tree.h (.../branches/gcc-4_8-branch)
560
@@ -510,11 +510,11 @@
564
- { return static_cast<_Link_type>(&this->_M_impl._M_header); }
565
+ { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
569
- { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
570
+ { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
572
static const_reference
573
_S_value(_Const_Link_type __x)
574
Index: libstdc++-v3/include/tr2/bool_set
575
===================================================================
576
--- a/src/libstdc++-v3/include/tr2/bool_set (.../tags/gcc_4_8_3_release)
577
+++ b/src/libstdc++-v3/include/tr2/bool_set (.../branches/gcc-4_8-branch)
581
* See N2136, Bool_set: multi-valued logic
582
- * by Herv� Br�nnimann, Guillaume Melquiond, Sylvain Pion.
583
+ * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
585
* The implicit conversion to bool is slippery! I may use the new
586
* explicit conversion. This has been specialized in the language
587
Index: libstdc++-v3/ChangeLog
588
===================================================================
589
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_4_8_3_release)
590
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-4_8-branch)
592
+2014-08-28 Samuel Bronson <naesten@gmail.com>
594
+ Backport r212453 from trunk
595
+ 2014-07-11 Samuel Bronson <naesten@gmail.com>
596
+ Matthias Klose <doko@ubuntu.com>
599
+ * python/libstdcxx/v6/printers.py: Port to Python 2+3
600
+ (imap): New compat function.
602
+ (Iterator): New mixin to allow writing iterators in Python 3 style
603
+ regardless of which version we're running on.
604
+ [Python3] (long) New compat alias for "int".
605
+ * testsuite/lib/gdb-test.exp: Port to Python 2+3 (print syntax)
607
+ Backport r210625 from trunk
608
+ 2014-05-19 Jonathan Wakely <jwakely@redhat.com>
610
+ * python/libstdcxx/v6/printers.py: Use Python3 raise syntax.
612
+2014-08-26 John David Anglin <danglin@gcc.gnu.org>
614
+ * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
616
+2014-08-26 Jonathan Wakely <jwakely@redhat.com>
618
+ * doc/xml/manual/status_cxx2011.xml: Correct status table.
619
+ * doc/html/manual/*: Regenerate.
621
+2014-08-04 Jonathan Wakely <jwakely@redhat.com>
623
+ Backported from mainline
624
+ 2014-07-29 Jonathan Wakely <jwakely@redhat.com>
627
+ * include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
628
+ const allocator_type&)): Pass non-const allocator to
629
+ _S_new_RopeFunction.
630
+ * testsuite/ext/rope/61946.cc: New.
632
+2014-08-04 Zifei Tong <zifeitong@gmail.com>
634
+ * libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
635
+ _GLIBCXX_ prefix to macro.
637
+2014-06-03 Jonathan Wakely <jwakely@redhat.com>
639
+ Backport from mainline
640
+ 2014-04-15 Jonathan Wakely <jwakely@redhat.com>
643
+ * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
645
+ Backport from mainline
646
+ 2014-05-16 Jonathan Wakely <jwakely@redhat.com>
649
+ * include/std/future (__future_base::_State_baseV2::_M_set_result):
650
+ Signal condition variable after call_once returns.
651
+ (__future_base::_State_baseV2::_M_do_set): Do not signal here.
652
+ (promise::set_value, promise::set_exception): Increment the reference
653
+ count on the shared state until the function returns.
654
+ * testsuite/30_threads/promise/60966.cc: New.
656
+2014-05-29 Jonathan Wakely <jwakely@redhat.com>
658
+ * include/tr2/bool_set: Use UTF-8 for accented characters.
659
+ * scripts/run_doxygen: Handle Doxygen 1.8.x change.
661
2014-05-22 Release Manager
663
* GCC 4.8.3 released.
664
Index: libstdc++-v3/libsupc++/atexit_thread.cc
665
===================================================================
666
--- a/src/libstdc++-v3/libsupc++/atexit_thread.cc (.../tags/gcc_4_8_3_release)
667
+++ b/src/libstdc++-v3/libsupc++/atexit_thread.cc (.../branches/gcc-4_8-branch)
670
#include "bits/gthr.h"
672
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
673
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
675
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
678
return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
681
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
682
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
685
// One element in a singly-linked stack of cleanups.
690
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
691
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
692
Index: libstdc++-v3/testsuite/30_threads/promise/60966.cc
693
===================================================================
694
--- a/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc (.../tags/gcc_4_8_3_release)
695
+++ b/src/libstdc++-v3/testsuite/30_threads/promise/60966.cc (.../branches/gcc-4_8-branch)
697
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
698
+// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
699
+// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
700
+// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
701
+// { dg-require-cstdint "" }
702
+// { dg-require-gthreads "" }
703
+// { dg-require-atomic-builtins "" }
705
+// Copyright (C) 2014 Free Software Foundation, Inc.
707
+// This file is part of the GNU ISO C++ Library. This library is free
708
+// software; you can redistribute it and/or modify it under the
709
+// terms of the GNU General Public License as published by the
710
+// Free Software Foundation; either version 3, or (at your option)
711
+// any later version.
713
+// This library is distributed in the hope that it will be useful,
714
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
715
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
716
+// GNU General Public License for more details.
718
+// You should have received a copy of the GNU General Public License along
719
+// with this library; see the file COPYING3. If not see
720
+// <http://www.gnu.org/licenses/>.
723
+// This test hangs if std::promise::~promise() destroys the
724
+// shared state before std::promise::set_value() finishes using it.
730
+const int THREADS = 10;
732
+void run_task(std::promise<void>* pr)
734
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
740
+ std::vector<std::promise<void>*> tasks(THREADS);
741
+ std::vector<std::thread> threads(THREADS);
742
+ std::vector<std::future<void>> futures(THREADS);
744
+ for (int i = 0; i < THREADS; ++i)
746
+ std::promise<void>* task = new std::promise<void>;
748
+ futures[i] = task->get_future();
749
+ threads[i] = std::thread(run_task, task);
752
+ for (int i = 0; i < THREADS; ++i)
754
+ // the temporary future releases the state as soon as wait() returns
755
+ std::future<void>(std::move(futures[i])).wait();
756
+ // state is ready, should now be safe to delete promise, so it
757
+ // releases the shared state too
761
+ for (auto& t : threads)
764
Index: libstdc++-v3/testsuite/ext/rope/61946.cc
765
===================================================================
766
--- a/src/libstdc++-v3/testsuite/ext/rope/61946.cc (.../tags/gcc_4_8_3_release)
767
+++ b/src/libstdc++-v3/testsuite/ext/rope/61946.cc (.../branches/gcc-4_8-branch)
769
+// Copyright (C) 2014 Free Software Foundation, Inc.
771
+// This file is part of the GNU ISO C++ Library. This library is free
772
+// software; you can redistribute it and/or modify it under the
773
+// terms of the GNU General Public License as published by the
774
+// Free Software Foundation; either version 3, or (at your option)
775
+// any later version.
777
+// This library is distributed in the hope that it will be useful,
778
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
779
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
780
+// GNU General Public License for more details.
782
+// You should have received a copy of the GNU General Public License along
783
+// with this library; see the file COPYING3. If not see
784
+// <http://www.gnu.org/licenses/>.
786
+// { dg-do compile }
790
+struct empty_char_prod : __gnu_cxx::char_producer<char>
792
+ virtual void operator()(size_t, size_t, char*) {}
797
+ empty_char_prod* ecp = new empty_char_prod;
798
+ __gnu_cxx::crope excrope( ecp, 10L, true );
800
Index: libstdc++-v3/testsuite/lib/gdb-test.exp
801
===================================================================
802
--- a/src/libstdc++-v3/testsuite/lib/gdb-test.exp (.../tags/gcc_4_8_3_release)
803
+++ b/src/libstdc++-v3/testsuite/lib/gdb-test.exp (.../branches/gcc-4_8-branch)
808
- set do_whatis_tests [gdb_batch_check "python print gdb.type_printers" \
809
+ set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
811
if {!$do_whatis_tests} {
812
send_log "skipping 'whatis' tests - gdb too old"
814
# but not earlier versions.
815
# Return 1 if the version is ok, 0 otherwise.
816
proc gdb_version_check {} {
817
- return [gdb_batch_check "python print gdb.lookup_global_symbol" \
818
+ return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
819
"<built-in function lookup_global_symbol>"]
821
Index: libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
822
===================================================================
823
--- a/src/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt (.../tags/gcc_4_8_3_release)
824
+++ b/src/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt (.../branches/gcc-4_8-branch)
826
FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE6getlocEv@@GLIBCXX_3.4
827
FUNC:_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
828
FUNC:_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
829
+FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
830
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
831
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
832
FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
834
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4
835
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4
836
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4
837
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEj@@GLIBCXX_3.4.18
838
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEjjj@@GLIBCXX_3.4.18
839
FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9
840
FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4
841
FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4
842
@@ -1204,6 +1207,7 @@
843
FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15
844
FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15
845
FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15
846
+FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIxSt5ratioILx1ELx1EEEENS1_IxS2_ILx1ELx1000000000EEEE@@GLIBCXX_3.4.18
847
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4
848
FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1
849
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4
850
@@ -1471,6 +1475,11 @@
851
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4
852
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4
853
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4
854
+FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18
855
+FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18
856
+FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18
857
+FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18
858
+FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18
859
FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4
860
FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4
861
FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4
862
@@ -1900,6 +1909,8 @@
863
FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
864
FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
865
FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
866
+FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
867
+FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
868
FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
869
FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
870
FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
871
@@ -2436,6 +2447,7 @@
872
FUNC:__cxa_guard_release@@CXXABI_1.3
873
FUNC:__cxa_pure_virtual@@CXXABI_1.3
874
FUNC:__cxa_rethrow@@CXXABI_1.3
875
+FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
876
FUNC:__cxa_throw@@CXXABI_1.3
877
FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
878
FUNC:__cxa_vec_cctor@@CXXABI_1.3
879
@@ -2482,6 +2494,7 @@
880
OBJECT:0:CXXABI_1.3.4
881
OBJECT:0:CXXABI_1.3.5
882
OBJECT:0:CXXABI_1.3.6
883
+OBJECT:0:CXXABI_1.3.7
886
OBJECT:0:GLIBCXX_3.4.1
887
@@ -2493,6 +2506,8 @@
888
OBJECT:0:GLIBCXX_3.4.15
889
OBJECT:0:GLIBCXX_3.4.16
890
OBJECT:0:GLIBCXX_3.4.17
891
+OBJECT:0:GLIBCXX_3.4.18
892
+OBJECT:0:GLIBCXX_3.4.19
893
OBJECT:0:GLIBCXX_3.4.2
894
OBJECT:0:GLIBCXX_3.4.3
895
OBJECT:0:GLIBCXX_3.4.4
896
@@ -2992,6 +3007,8 @@
897
OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4
898
OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4
899
OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11
900
+OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19
901
+OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19
902
OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11
903
OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11
904
OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
906
===================================================================
907
--- a/src/configure.ac (.../tags/gcc_4_8_3_release)
908
+++ b/src/configure.ac (.../branches/gcc-4_8-branch)
909
@@ -1154,6 +1154,9 @@
911
host_makefile_frag="config/mh-mingw"
914
+ host_makefile_frag="config/mh-alpha-linux"
917
host_makefile_frag="config/mh-pa-hpux10"
920
===================================================================
921
--- a/src/ChangeLog (.../tags/gcc_4_8_3_release)
922
+++ b/src/ChangeLog (.../branches/gcc-4_8-branch)
924
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
927
+ * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
928
+ * configure: Regenerate.
930
2014-05-22 Release Manager
932
* GCC 4.8.3 released.
933
Index: contrib/ChangeLog
934
===================================================================
935
--- a/src/contrib/ChangeLog (.../tags/gcc_4_8_3_release)
936
+++ b/src/contrib/ChangeLog (.../branches/gcc-4_8-branch)
938
+2014-07-07 Richard Biener <rguenther@suse.de>
940
+ * gennews: Use gcc-3.0/index.html.
942
2014-05-22 Release Manager
944
* GCC 4.8.3 released.
945
Index: contrib/gennews
946
===================================================================
947
--- a/src/contrib/gennews (.../tags/gcc_4_8_3_release)
948
+++ b/src/contrib/gennews (.../branches/gcc-4_8-branch)
950
gcc-3.3/index.html gcc-3.3/changes.html
951
gcc-3.2/index.html gcc-3.2/changes.html
952
gcc-3.1/index.html gcc-3.1/changes.html
953
- gcc-3.0/gcc-3.0.html gcc-3.0/features.html gcc-3.0/caveats.html
954
+ gcc-3.0/index.html gcc-3.0/features.html gcc-3.0/caveats.html
955
gcc-2.95/index.html gcc-2.95/features.html gcc-2.95/caveats.html
956
egcs-1.1/index.html egcs-1.1/features.html egcs-1.1/caveats.html
957
egcs-1.0/index.html egcs-1.0/features.html egcs-1.0/caveats.html"
958
Index: config/mh-alpha-linux
959
===================================================================
960
--- a/src/config/mh-alpha-linux (.../tags/gcc_4_8_3_release)
961
+++ b/src/config/mh-alpha-linux (.../branches/gcc-4_8-branch)
963
+# Prevent GPREL16 relocation truncation
964
+LDFLAGS += -Wl,--no-relax
965
+BOOT_LDFLAGS += -Wl,--no-relax
966
Index: config/ChangeLog
967
===================================================================
968
--- a/src/config/ChangeLog (.../tags/gcc_4_8_3_release)
969
+++ b/src/config/ChangeLog (.../branches/gcc-4_8-branch)
971
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
974
+ * mh-alpha-linux: New file.
976
2014-05-22 Release Manager
978
* GCC 4.8.3 released.
979
Index: libjava/classpath
980
===================================================================
981
--- a/src/libjava/classpath (.../tags/gcc_4_8_3_release)
982
+++ b/src/libjava/classpath (.../branches/gcc-4_8-branch)
984
Property changes on: libjava/classpath
985
___________________________________________________________________
986
Modified: svn:mergeinfo
987
Merged /trunk/libjava/classpath:r211733,215049
989
===================================================================
990
--- a/src/configure (.../tags/gcc_4_8_3_release)
991
+++ b/src/configure (.../branches/gcc-4_8-branch)
992
@@ -3834,6 +3834,9 @@
994
host_makefile_frag="config/mh-mingw"
997
+ host_makefile_frag="config/mh-alpha-linux"
1000
host_makefile_frag="config/mh-pa-hpux10"
1002
Index: gcc/tree-ssa-tail-merge.c
1003
===================================================================
1004
--- a/src/gcc/tree-ssa-tail-merge.c (.../tags/gcc_4_8_3_release)
1005
+++ b/src/gcc/tree-ssa-tail-merge.c (.../branches/gcc-4_8-branch)
1006
@@ -1060,6 +1060,24 @@
1010
+/* Return true if gimple operands T1 and T2 have the same value. */
1013
+gimple_operand_equal_value_p (tree t1, tree t2)
1018
+ if (t1 == NULL_TREE
1019
+ || t2 == NULL_TREE)
1022
+ if (operand_equal_p (t1, t2, 0))
1025
+ return gvn_uses_equal (t1, t2);
1028
/* Return true if gimple statements S1 and S2 are equal. Gimple_bb (s1) and
1029
gimple_bb (s2) are members of SAME_SUCC. */
1031
@@ -1122,8 +1140,9 @@
1032
lhs2 = gimple_get_lhs (s2);
1033
if (TREE_CODE (lhs1) != SSA_NAME
1034
&& TREE_CODE (lhs2) != SSA_NAME)
1035
- return (vn_valueize (gimple_vdef (s1))
1036
- == vn_valueize (gimple_vdef (s2)));
1037
+ return (operand_equal_p (lhs1, lhs2, 0)
1038
+ && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
1039
+ gimple_assign_rhs1 (s2)));
1040
else if (TREE_CODE (lhs1) == SSA_NAME
1041
&& TREE_CODE (lhs2) == SSA_NAME)
1042
return vn_valueize (lhs1) == vn_valueize (lhs2);
1043
Index: gcc/DATESTAMP
1044
===================================================================
1045
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
1046
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
1051
===================================================================
1052
--- a/src/gcc/ipa-cp.c (.../tags/gcc_4_8_3_release)
1053
+++ b/src/gcc/ipa-cp.c (.../branches/gcc-4_8-branch)
1055
else if (!opt_for_fn (node->symbol.decl, optimize)
1056
|| !opt_for_fn (node->symbol.decl, flag_ipa_cp))
1057
reason = "non-optimized function";
1058
+ else if (node->tm_clone)
1059
+ reason = "transactional memory clone";
1061
if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
1062
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
1063
@@ -2902,6 +2904,11 @@
1064
intersect_with_agg_replacements (cs->caller, src_idx,
1075
@@ -2917,6 +2924,11 @@
1077
intersect_with_plats (src_plats, &inter, 0);
1086
else if (jfunc->type == IPA_JF_ANCESTOR
1087
@@ -3000,7 +3012,8 @@
1088
vec<cgraph_edge_p> callers)
1090
struct ipa_node_params *dest_info = IPA_NODE_REF (node);
1091
- struct ipa_agg_replacement_value *res = NULL;
1092
+ struct ipa_agg_replacement_value *res;
1093
+ struct ipa_agg_replacement_value **tail = &res;
1094
struct cgraph_edge *cs;
1095
int i, j, count = ipa_get_param_count (dest_info);
1097
@@ -3044,8 +3057,8 @@
1098
v->offset = item->offset;
1099
v->value = item->value;
1100
v->by_ref = plats->aggs_by_ref;
1108
@@ -3052,6 +3065,7 @@
1109
if (inter.exists ())
1116
@@ -3060,7 +3074,8 @@
1117
static struct ipa_agg_replacement_value *
1118
known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function_t> known_aggs)
1120
- struct ipa_agg_replacement_value *res = NULL;
1121
+ struct ipa_agg_replacement_value *res;
1122
+ struct ipa_agg_replacement_value **tail = &res;
1123
struct ipa_agg_jump_function *aggjf;
1124
struct ipa_agg_jf_item *item;
1126
@@ -3074,9 +3089,10 @@
1127
v->offset = item->offset;
1128
v->value = item->value;
1129
v->by_ref = aggjf->by_ref;
1139
Index: gcc/fold-const.c
1140
===================================================================
1141
--- a/src/gcc/fold-const.c (.../tags/gcc_4_8_3_release)
1142
+++ b/src/gcc/fold-const.c (.../branches/gcc-4_8-branch)
1143
@@ -9213,7 +9213,7 @@
1144
/* Transform comparisons of the form X +- C1 CMP Y +- C2 to
1145
X CMP Y +- C2 +- C1 for signed X, Y. This is valid if
1146
the resulting offset is smaller in absolute value than the
1148
+ original one and has the same sign. */
1149
if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
1150
&& (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
1151
&& (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
1152
@@ -9232,19 +9232,20 @@
1155
/* Put the constant on the side where it doesn't overflow and is
1156
- of lower absolute value than before. */
1157
+ of lower absolute value and of same sign than before. */
1158
cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
1159
? MINUS_EXPR : PLUS_EXPR,
1161
if (!TREE_OVERFLOW (cst)
1162
- && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2))
1163
+ && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2)
1164
+ && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const2))
1166
fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
1167
return fold_build2_loc (loc, code, type,
1169
- fold_build2_loc (loc,
1170
- TREE_CODE (arg1), TREE_TYPE (arg1),
1173
+ fold_build2_loc (loc, TREE_CODE (arg1),
1178
cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
1179
@@ -9251,13 +9252,15 @@
1180
? MINUS_EXPR : PLUS_EXPR,
1182
if (!TREE_OVERFLOW (cst)
1183
- && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1))
1184
+ && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1)
1185
+ && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const1))
1187
fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
1188
return fold_build2_loc (loc, code, type,
1189
- fold_build2_loc (loc, TREE_CODE (arg0), TREE_TYPE (arg0),
1192
+ fold_build2_loc (loc, TREE_CODE (arg0),
1199
@@ -11218,7 +11221,6 @@
1201
double_int c1, c2, c3, msk;
1202
int width = TYPE_PRECISION (type), w;
1203
- bool try_simplify = true;
1205
c1 = tree_to_double_int (TREE_OPERAND (arg0, 1));
1206
c2 = tree_to_double_int (arg1);
1207
@@ -11255,20 +11257,7 @@
1211
- /* If X is a tree of the form (Y * K1) & K2, this might conflict
1212
- with that optimization from the BIT_AND_EXPR optimizations.
1213
- This could end up in an infinite recursion. */
1214
- if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR
1215
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1))
1218
- tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
1219
- double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
1221
- try_simplify = (masked != c1);
1224
- if (try_simplify && c3 != c1)
1226
return fold_build2_loc (loc, BIT_IOR_EXPR, type,
1227
fold_build2_loc (loc, BIT_AND_EXPR, type,
1228
TREE_OPERAND (arg0, 0),
1229
@@ -11658,16 +11647,25 @@
1230
&& TREE_CODE (arg0) == MULT_EXPR
1231
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
1233
+ double_int darg1 = tree_to_double_int (arg1);
1235
- = mask_with_tz (type, tree_to_double_int (arg1),
1236
+ = mask_with_tz (type, darg1,
1237
tree_to_double_int (TREE_OPERAND (arg0, 1)));
1239
if (masked.is_zero ())
1240
return omit_two_operands_loc (loc, type, build_zero_cst (type),
1242
- else if (masked != tree_to_double_int (arg1))
1243
- return fold_build2_loc (loc, code, type, op0,
1244
- double_int_to_tree (type, masked));
1245
+ else if (masked != darg1)
1247
+ /* Avoid the transform if arg1 is a mask of some
1248
+ mode which allows further optimizations. */
1249
+ int pop = darg1.popcount ();
1250
+ if (!(pop >= BITS_PER_UNIT
1251
+ && exact_log2 (pop) != -1
1252
+ && double_int::mask (pop) == darg1))
1253
+ return fold_build2_loc (loc, code, type, op0,
1254
+ double_int_to_tree (type, masked));
1258
/* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
1259
Index: gcc/omp-low.c
1260
===================================================================
1261
--- a/src/gcc/omp-low.c (.../tags/gcc_4_8_3_release)
1262
+++ b/src/gcc/omp-low.c (.../branches/gcc-4_8-branch)
1263
@@ -1586,7 +1586,6 @@
1264
TREE_STATIC (decl) = 1;
1265
TREE_USED (decl) = 1;
1266
DECL_ARTIFICIAL (decl) = 1;
1267
- DECL_NAMELESS (decl) = 1;
1268
DECL_IGNORED_P (decl) = 0;
1269
TREE_PUBLIC (decl) = 0;
1270
DECL_UNINLINABLE (decl) = 1;
1272
===================================================================
1273
--- a/src/gcc/toplev.c (.../tags/gcc_4_8_3_release)
1274
+++ b/src/gcc/toplev.c (.../branches/gcc-4_8-branch)
1275
@@ -1036,16 +1036,19 @@
1277
if (warn_stack_usage >= 0)
1279
+ const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
1281
if (stack_usage_kind == DYNAMIC)
1282
- warning (OPT_Wstack_usage_, "stack usage might be unbounded");
1283
+ warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
1284
else if (stack_usage > warn_stack_usage)
1286
if (stack_usage_kind == DYNAMIC_BOUNDED)
1287
- warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
1290
+ OPT_Wstack_usage_, "stack usage might be %wd bytes",
1293
- warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
1295
+ warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
1300
Index: gcc/tree-ssa-sccvn.c
1301
===================================================================
1302
--- a/src/gcc/tree-ssa-sccvn.c (.../tags/gcc_4_8_3_release)
1303
+++ b/src/gcc/tree-ssa-sccvn.c (.../branches/gcc-4_8-branch)
1304
@@ -3015,33 +3015,12 @@
1305
/* If all value numbered to the same value, the phi node has that
1309
- if (is_gimple_min_invariant (sameval))
1311
- VN_INFO (PHI_RESULT (phi))->has_constants = true;
1312
- VN_INFO (PHI_RESULT (phi))->expr = sameval;
1316
- VN_INFO (PHI_RESULT (phi))->has_constants = false;
1317
- VN_INFO (PHI_RESULT (phi))->expr = sameval;
1319
+ return set_ssa_val_to (PHI_RESULT (phi), sameval);
1321
- if (TREE_CODE (sameval) == SSA_NAME)
1322
- return visit_copy (PHI_RESULT (phi), sameval);
1324
- return set_ssa_val_to (PHI_RESULT (phi), sameval);
1327
/* Otherwise, see if it is equivalent to a phi node in this block. */
1328
result = vn_phi_lookup (phi);
1331
- if (TREE_CODE (result) == SSA_NAME)
1332
- changed = visit_copy (PHI_RESULT (phi), result);
1334
- changed = set_ssa_val_to (PHI_RESULT (phi), result);
1336
+ changed = set_ssa_val_to (PHI_RESULT (phi), result);
1339
vn_phi_insert (phi, PHI_RESULT (phi));
1340
@@ -3142,24 +3121,18 @@
1341
catch those with constants. The goal here is to simultaneously
1342
combine constants between expressions, but avoid infinite
1343
expansion of expressions during simplification. */
1344
- if (TREE_CODE (op0) == SSA_NAME)
1346
- if (VN_INFO (op0)->has_constants
1347
+ op0 = vn_valueize (op0);
1348
+ if (TREE_CODE (op0) == SSA_NAME
1349
+ && (VN_INFO (op0)->has_constants
1350
|| TREE_CODE_CLASS (code) == tcc_comparison
1351
- || code == COMPLEX_EXPR)
1352
- op0 = valueize_expr (vn_get_expr_for (op0));
1354
- op0 = vn_valueize (op0);
1356
+ || code == COMPLEX_EXPR))
1357
+ op0 = valueize_expr (vn_get_expr_for (op0));
1359
- if (TREE_CODE (op1) == SSA_NAME)
1361
- if (VN_INFO (op1)->has_constants
1362
- || code == COMPLEX_EXPR)
1363
- op1 = valueize_expr (vn_get_expr_for (op1));
1365
- op1 = vn_valueize (op1);
1367
+ op1 = vn_valueize (op1);
1368
+ if (TREE_CODE (op1) == SSA_NAME
1369
+ && (VN_INFO (op1)->has_constants
1370
+ || code == COMPLEX_EXPR))
1371
+ op1 = valueize_expr (vn_get_expr_for (op1));
1373
/* Pointer plus constant can be represented as invariant address.
1374
Do so to allow further propatation, see also tree forwprop. */
1375
@@ -3217,27 +3190,31 @@
1379
- if (VN_INFO (op0)->has_constants)
1380
- op0 = valueize_expr (vn_get_expr_for (op0));
1381
- else if (CONVERT_EXPR_CODE_P (code)
1382
- || code == REALPART_EXPR
1383
- || code == IMAGPART_EXPR
1384
- || code == VIEW_CONVERT_EXPR
1385
- || code == BIT_FIELD_REF)
1386
+ op0 = vn_valueize (op0);
1387
+ if (TREE_CODE (op0) == SSA_NAME)
1389
- /* We want to do tree-combining on conversion-like expressions.
1390
- Make sure we feed only SSA_NAMEs or constants to fold though. */
1391
- tree tem = valueize_expr (vn_get_expr_for (op0));
1392
- if (UNARY_CLASS_P (tem)
1393
- || BINARY_CLASS_P (tem)
1394
- || TREE_CODE (tem) == VIEW_CONVERT_EXPR
1395
- || TREE_CODE (tem) == SSA_NAME
1396
- || TREE_CODE (tem) == CONSTRUCTOR
1397
- || is_gimple_min_invariant (tem))
1399
+ if (VN_INFO (op0)->has_constants)
1400
+ op0 = valueize_expr (vn_get_expr_for (op0));
1401
+ else if (CONVERT_EXPR_CODE_P (code)
1402
+ || code == REALPART_EXPR
1403
+ || code == IMAGPART_EXPR
1404
+ || code == VIEW_CONVERT_EXPR
1405
+ || code == BIT_FIELD_REF)
1407
+ /* We want to do tree-combining on conversion-like expressions.
1408
+ Make sure we feed only SSA_NAMEs or constants to fold though. */
1409
+ tree tem = valueize_expr (vn_get_expr_for (op0));
1410
+ if (UNARY_CLASS_P (tem)
1411
+ || BINARY_CLASS_P (tem)
1412
+ || TREE_CODE (tem) == VIEW_CONVERT_EXPR
1413
+ || TREE_CODE (tem) == SSA_NAME
1414
+ || TREE_CODE (tem) == CONSTRUCTOR
1415
+ || is_gimple_min_invariant (tem))
1420
- /* Avoid folding if nothing changed, but remember the expression. */
1421
+ /* Avoid folding if nothing changed. */
1422
if (op0 == orig_op0)
1425
Index: gcc/cgraphunit.c
1426
===================================================================
1427
--- a/src/gcc/cgraphunit.c (.../tags/gcc_4_8_3_release)
1428
+++ b/src/gcc/cgraphunit.c (.../branches/gcc-4_8-branch)
1429
@@ -1097,7 +1097,7 @@
1430
/* We use local aliases for C++ thunks to force the tailcall
1431
to bind locally. This is a hack - to keep it working do
1432
the following (which is not strictly correct). */
1433
- && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
1434
+ && (TREE_CODE (target_node->symbol.decl) != FUNCTION_DECL
1435
|| ! DECL_VIRTUAL_P (target_node->symbol.decl))
1436
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
1438
Index: gcc/ChangeLog
1439
===================================================================
1440
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
1441
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
1443
+2014-09-10 Michael Meissner <meissner@linux.vnet.ibm.com>
1445
+ * config/rs6000/vsx.md (vsx_fmav4sf4): Use correct constraints for
1446
+ V2DF, V4SF, DF, and DI modes.
1447
+ (vsx_fmav2df2): Likewise.
1448
+ (vsx_float_fix_<mode>2): Likewise.
1449
+ (vsx_reduc_<VEC_reduc_name>_v2df_scalar): Likewise.
1451
+2014-09-10 Alan Modra <amodra@gmail.com>
1454
+ * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend
1457
+2014-09-09 Richard Biener <rguenther@suse.de>
1459
+ Backport from mainline
1460
+ 2014-06-11 Richard Biener <rguenther@suse.de>
1462
+ PR tree-optimization/61452
1463
+ * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
1464
+ expr and has_constants in case we found a leader.
1465
+ (simplify_binary_expression): Always valueize operands first.
1466
+ (simplify_unary_expression): Likewise.
1468
+2014-09-09 Richard Biener <rguenther@suse.de>
1470
+ Backport from mainline
1471
+ 2014-05-05 Richard Biener <rguenther@suse.de>
1473
+ PR middle-end/61010
1474
+ * fold-const.c (fold_binary_loc): Consistently avoid
1475
+ canonicalizing X & CST away from a CST that is the mask
1478
+ 2014-05-28 Richard Biener <rguenther@suse.de>
1480
+ PR middle-end/61045
1481
+ * fold-const.c (fold_comparison): When folding
1482
+ X +- C1 CMP Y +- C2 to X CMP Y +- C2 +- C1 also ensure
1483
+ the sign of the remaining constant operand stays the same.
1485
+ 2014-08-11 Richard Biener <rguenther@suse.de>
1487
+ PR tree-optimization/62075
1488
+ * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly
1489
+ handle uses in patterns.
1491
+2014-09-09 James Greenhalgh <james.greenhalgh@arm.com>
1493
+ Backport from mainline.
1494
+ 2014-09-09 James Greenhalgh <james.greenhalgh@arm.com>
1496
+ * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
1497
+ (-mtune): Likewise.
1498
+ (-mcpu): Likewise.
1500
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
1502
+ PR tree-optimization/60196
1503
+ PR tree-optimization/63189
1504
+ Backported from mainline
1505
+ 2013-09-17 Cong Hou <congh@google.com>
1507
+ * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Fix a bug
1508
+ when checking the dot production pattern. The type of rhs operand
1509
+ of multiply is now checked correctly.
1511
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
1513
+ Backported from mainline
1514
+ 2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
1517
+ * haifa-sched.c (advance_one_cycle): Fix dump.
1518
+ (schedule_block): Don't advance cycle if we are already at the
1519
+ beginning of the cycle.
1521
+2014-09-03 Martin Jambor <mjambor@suse.cz>
1524
+ * ipa-cp.c (intersect_aggregates_with_edge): Handle impermissible
1525
+ pass-trough jump functions correctly.
1527
+2014-09-03 Martin Jambor <mjambor@suse.cz>
1530
+ * ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
1531
+ created replacements in ascending order of offsets.
1532
+ (known_aggs_to_agg_replacement_list): Likewise.
1534
+2014-09-01 Marek Polacek <polacek@redhat.com>
1536
+ Backport from mainline
1537
+ 2014-08-21 Marek Polacek <polacek@redhat.com>
1540
+ * expr.c (is_aligning_offset): Remove logical not.
1542
+2014-09-01 Marek Polacek <polacek@redhat.com>
1544
+ Backport from mainline
1545
+ 2014-08-19 Marek Polacek <polacek@redhat.com>
1548
+ * cgraphunit.c (handle_alias_pairs): Fix condition.
1550
+2014-08-30 John David Anglin <danglin@gcc.gnu.org>
1552
+ * config/pa/pa.c (pa_assemble_integer): Don't add PLABEL relocation
1553
+ prefix to function labels when generating fast indirect calls.
1555
+2014-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
1557
+ * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
1559
+2014-08-26 Marek Polacek <polacek@redhat.com>
1561
+ Backport from mainline
1562
+ 2014-08-26 Marek Polacek <polacek@redhat.com>
1565
+ * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
1566
+ LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
1568
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
1570
+ Backport from mainline
1571
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
1574
+ * config/sh/sh.opt (musermode): Allow negative form.
1575
+ * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
1576
+ targets that don't support it.
1577
+ * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
1578
+ Document -mno-usermode option.
1580
+2014-08-23 John David Anglin <danglin@gcc.gnu.org>
1583
+ * config/pa/pa.c (pa_output_function_epilogue): Don't set
1584
+ last_address when the current function is a thunk.
1585
+ (pa_asm_output_mi_thunk): When we don't have named sections or they
1586
+ are not being used, check that thunk can reach the stub table with a
1589
+2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
1591
+ Backport fro mainline
1592
+ 2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
1595
+ * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
1596
+ documentation to state it is only for VSX operations.
1598
+ * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
1599
+ constraint only active if VSX.
1601
+ * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
1602
+ wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
1603
+ (lfiwzx): Likewise.
1605
+2014-08-15 Tom de Vries <tom@codesourcery.com>
1607
+ Backport from mainline:
1608
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
1610
+ PR rtl-optimization/62004
1611
+ PR rtl-optimization/62030
1612
+ * ifcvt.c (rtx_interchangeable_p): New function.
1613
+ (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
1615
+ 2014-08-05 Richard Biener <rguenther@suse.de>
1617
+ * emit-rtl.h (mem_attrs_eq_p): Declare.
1618
+ * emit-rtl.c (mem_attrs_eq_p): Export.
1620
+2014-08-16 John David Anglin <danglin@gcc.gnu.org>
1622
+ Backport from trunk:
1623
+ 2014-04-06 John David Anglin <danglin@gcc.gnu.org>
1626
+ * config/pa/pa.c (pa_output_function_epilogue): Skip address and code
1627
+ size accounting for thunks.
1628
+ (pa_asm_output_mi_thunk): Use final_start_function() and
1629
+ final_end_function() to output function start and end directives.
1631
+2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
1633
+ Backport from mainline:
1634
+ 2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
1636
+ * doc/invoke.texi (SH options): Document missing processor variant
1637
+ options. Remove references to Hitachi. Undocument deprecated mspace
1640
+2014-08-13 Felix Yang <fei.yang0953@gmail.com>
1642
+ PR tree-optimization/62073
1643
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
1646
+2014-08-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1648
+ Backport from mainline
1649
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
1651
+ PR middle-end/62103
1652
+ * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
1653
+ bitfields, that is when size doesn't match the size of type or the
1654
+ size of the constructor.
1656
+2014-08-12 Michael Meissner <meissner@linux.vnet.ibm.com>
1658
+ Backport patch from mainline
1659
+ 2014-08-11 Michael Meissner <meissner@linux.vnet.ibm.com>
1661
+ * config/rs6000/constraints.md (wh constraint): New constraint,
1662
+ for FP registers if direct move is available.
1663
+ (wi constraint): New constraint, for VSX/FP registers that can
1664
+ handle 64-bit integers.
1665
+ (wj constraint): New constraint for VSX/FP registers that can
1666
+ handle 64-bit integers for direct moves.
1667
+ (wk constraint): New constraint for VSX/FP registers that can
1668
+ handle 64-bit doubles for direct moves.
1669
+ (wy constraint): Make documentation match implementation.
1671
+ * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
1672
+ scalar_in_vmx_p field to simplify tests of whether SFmode or
1673
+ DFmode can go in the Altivec registers.
1674
+ (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
1675
+ (rs6000_setup_reg_addr_masks): Likewise.
1676
+ (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
1677
+ field, and wh/wi/wj/wk constraints.
1678
+ (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
1679
+ the wh/wi/wj/wk constraints.
1680
+ (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
1681
+ upper registers, prefer VSX registers unless the operation is a
1682
+ memory operation with REG+OFFSET addressing.
1684
+ * config/rs6000/vsx.md (VSr mode attribute): Add support for
1685
+ DImode. Change SFmode to use ww constraint instead of d to allow
1686
+ SF registers in the upper registers.
1689
+ (VSr5): Fix thinko in comment.
1690
+ (VSa): New mode attribute that is an alternative to wa, that
1691
+ returns the VSX register class that a mode can go in, but may not
1692
+ be the preferred register class.
1693
+ (VS_64dm): New mode attribute for appropriate register classes for
1694
+ referencing 64-bit elements of vectors for direct moves and normal
1696
+ (VS_64reg): Likewise.
1697
+ (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
1698
+ register allocator to only registers the data type can handle.
1699
+ (vsx_le_perm_load_<mode>): Likewise.
1700
+ (vsx_le_perm_store_<mode>): Likewise.
1701
+ (vsx_xxpermdi2_le_<mode>): Likewise.
1702
+ (vsx_xxpermdi4_le_<mode>): Likewise.
1703
+ (vsx_lxvd2x2_le_<mode>): Likewise.
1704
+ (vsx_lxvd2x4_le_<mode>): Likewise.
1705
+ (vsx_stxvd2x2_le_<mode>): Likewise.
1706
+ (vsx_add<mode>3): Likewise.
1707
+ (vsx_sub<mode>3): Likewise.
1708
+ (vsx_mul<mode>3): Likewise.
1709
+ (vsx_div<mode>3): Likewise.
1710
+ (vsx_tdiv<mode>3_internal): Likewise.
1711
+ (vsx_fre<mode>2): Likewise.
1712
+ (vsx_neg<mode>2): Likewise.
1713
+ (vsx_abs<mode>2): Likewise.
1714
+ (vsx_nabs<mode>2): Likewise.
1715
+ (vsx_smax<mode>3): Likewise.
1716
+ (vsx_smin<mode>3): Likewise.
1717
+ (vsx_sqrt<mode>2): Likewise.
1718
+ (vsx_rsqrte<mode>2): Likewise.
1719
+ (vsx_tsqrt<mode>2_internal): Likewise.
1720
+ (vsx_fms<mode>4): Likewise.
1721
+ (vsx_nfma<mode>4): Likewise.
1722
+ (vsx_eq<mode>): Likewise.
1723
+ (vsx_gt<mode>): Likewise.
1724
+ (vsx_ge<mode>): Likewise.
1725
+ (vsx_eq<mode>_p): Likewise.
1726
+ (vsx_gt<mode>_p): Likewise.
1727
+ (vsx_ge<mode>_p): Likewise.
1728
+ (vsx_xxsel<mode>): Likewise.
1729
+ (vsx_xxsel<mode>_uns): Likewise.
1730
+ (vsx_copysign<mode>3): Likewise.
1731
+ (vsx_float<VSi><mode>2): Likewise.
1732
+ (vsx_floatuns<VSi><mode>2): Likewise.
1733
+ (vsx_fix_trunc<mode><VSi>2): Likewise.
1734
+ (vsx_fixuns_trunc<mode><VSi>2): Likewise.
1735
+ (vsx_x<VSv>r<VSs>i): Likewise.
1736
+ (vsx_x<VSv>r<VSs>ic): Likewise.
1737
+ (vsx_btrunc<mode>2): Likewise.
1738
+ (vsx_b2trunc<mode>2): Likewise.
1739
+ (vsx_floor<mode>2): Likewise.
1740
+ (vsx_ceil<mode>2): Likewise.
1741
+ (vsx_<VS_spdp_insn>): Likewise.
1742
+ (vsx_xscvspdp): Likewise.
1743
+ (vsx_xvcvspuxds): Likewise.
1744
+ (vsx_float_fix_<mode>2): Likewise.
1745
+ (vsx_set_<mode>): Likewise.
1746
+ (vsx_extract_<mode>_internal1): Likewise.
1747
+ (vsx_extract_<mode>_internal2): Likewise.
1748
+ (vsx_extract_<mode>_load): Likewise.
1749
+ (vsx_extract_<mode>_store): Likewise.
1750
+ (vsx_splat_<mode>): Likewise.
1751
+ (vsx_xxspltw_<mode>): Likewise.
1752
+ (vsx_xxspltw_<mode>_direct): Likewise.
1753
+ (vsx_xxmrghw_<mode>): Likewise.
1754
+ (vsx_xxmrglw_<mode>): Likewise.
1755
+ (vsx_xxsldwi_<mode>): Likewise.
1756
+ (vsx_xscvdpspn): Tighten constraints to only use register classes
1758
+ (vsx_xscvspdpn): Likewise.
1759
+ (vsx_xscvdpspn_scalar): Likewise.
1761
+ * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
1762
+ wj, and wk constraints.
1763
+ (GPR_REG_CLASS_P): New helper macro for register classes targeting
1764
+ general purpose registers.
1766
+ * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
1768
+ (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
1769
+ DImode instead of wm. Use wk constraint for direct move of DFmode
1771
+ (extendsidi2_lfiwax): Likewise.
1772
+ (lfiwax): Likewise.
1773
+ (lfiwzx): Likewise.
1774
+ (movdi_internal64): Likewise.
1776
+ * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
1777
+ wk constraints. Make the wy constraint documentation match them
1780
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
1782
+ Backport from mainline
1783
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1785
+ PR tree-optimization/61375
1786
+ * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
1787
+ symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
1788
+ (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
1790
+2014-08-01 Richard Biener <rguenther@suse.de>
1792
+ PR tree-optimization/61964
1793
+ * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
1794
+ function merged from trunk.
1795
+ (gimple_equal_p): Handle non-SSA LHS solely by structural
1798
+2014-07-25 Uros Bizjak <ubizjak@gmail.com>
1800
+ * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
1802
+2014-07-24 Kyle McMartin <kyle@redhat.com>
1804
+ * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
1806
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1808
+ * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
1810
+ * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
1811
+ function. Issue -Wpsabi warning if future GCC releases will use
1812
+ different field alignment rules for this type.
1813
+ * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
1814
+ * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
1815
+ * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
1817
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1819
+ * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
1820
+ -Wpsabi note when encountering a type where future GCC releases
1821
+ will apply different alignment requirements.
1823
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1825
+ * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
1826
+ does not fit fully into floating-point registers, and there is still
1827
+ space in the register parameter area, issue -Wpsabi note that the ABI
1828
+ will change in a future GCC release.
1830
+2014-07-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1832
+ * config/arm/t-rtems-eabi: Add
1833
+ mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
1834
+ mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
1835
+ mbig-endian/mthumb/march=armv7-r, and
1836
+ mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
1839
+2014-07-21 Peter Bergner <bergner@vnet.ibm.com>
1841
+ * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
1842
+ (LIBTSAN_EARLY_SPEC): Likewise.
1843
+ (STATIC_LIBASAN_LIBS): Likewise.
1844
+ (STATIC_LIBTSAN_LIBS): Likewise.
1846
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
1848
+ * toplev.c (output_stack_usage): Adjust the location of the warning.
1850
+2014-07-19 Daniel Cederman <cederman@gaisler.com>
1852
+ * config/sparc/sync.md (*membar_storeload_leon3): New insn.
1853
+ (*membar_storeload): Disable for LEON3.
1855
+2014-07-17 Richard Biener <rguenther@suse.de>
1857
+ PR rtl-optimization/61801
1858
+ * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
1859
+ ASM_INPUT don't set reg_pending_barrier if it appears in a
1862
+2014-07-16 Jakub Jelinek <jakub@redhat.com>
1864
+ * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
1865
+ on the FUNCTION_DECL.
1867
+2014-07-10 Tom G. Christensen <tgc@jupiterrise.com>
1869
+ * doc/install.texi: Remove links to defunct package providers for
1872
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
1874
+ PR middle-end/53590
1875
+ * function.c (allocate_struct_function): Revert r188667 change.
1877
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
1879
+ PR tree-optimization/61684
1880
+ * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
1881
+ rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
1883
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
1885
+ Backport from Mainline
1886
+ 2014-06-20 Jakub Jelinek <jakub@redhat.com>
1887
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
1889
+ PR tree-optimization/61306
1890
+ * tree-ssa-math-opts.c (struct symbolic_number): Store type of
1891
+ expression instead of its size.
1892
+ (do_shift_rotate): Adapt to change in struct symbolic_number. Return
1893
+ false to prevent optimization when the result is unpredictable due to
1894
+ arithmetic right shift of signed type with highest byte is set.
1895
+ (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
1896
+ (find_bswap_1): Likewise. Return NULL to prevent optimization when the
1897
+ result is unpredictable due to sign extension.
1898
+ (find_bswap): Adapt to change in struct symbolic_number.
1900
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
1902
+ Backport from mainline
1903
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
1906
+ * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
1908
+2014-06-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1911
+ * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
1912
+ extraction other than index 3.
1914
+2014-06-24 Jakub Jelinek <jakub@redhat.com>
1917
+ * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
1918
+ model family 6 CPU with has_longmode never use a CPU without
1921
+2014-06-20 Chung-Lin Tang <cltang@codesourcery.com>
1923
+ Backport from mainline
1925
+ 2014-06-20 Julian Brown <julian@codesourcery.com>
1926
+ Chung-Lin Tang <cltang@codesourcery.com>
1928
+ * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
1929
+ TARGET_THUMB1_ONLY. Add comments.
1931
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
1933
+ Backport from mainline
1934
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
1937
+ * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
1938
+ define_insn_and_split pattern, merged from *floatunssi<mode>2_1
1939
+ and corresponding splitters. Zero extend general register
1940
+ or memory input operand to XMM temporary. Enable for
1941
+ TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
1942
+ (floatunssi<mode>2): Update expander predicate.
1944
+2014-06-18 Richard Henderson <rth@redhat.com>
1947
+ * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
1949
+2014-06-17 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
1951
+ Revert on gcc-4_8-branch.
1952
+ * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
1953
+ * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
1955
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
1957
+ Backport from mainline
1960
+ * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
1961
+ variable 'size'; calculate 'size' right in the front; use
1962
+ 'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
1963
+ pcum->aapcs_stack_words.
1965
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
1967
+ Backport from mainline
1969
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
1971
+ * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
1972
+ (BU_MISC_2): Rename to ...
1973
+ (BU_LDBL128_2): ... this.
1974
+ * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
1975
+ (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
1976
+ * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
1977
+ RS6000_BTM_LDBL128.
1978
+ (rs6000_invalid_builtin): Add long double 128-bit builtin support.
1979
+ (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
1980
+ * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
1981
+ (unpacktf_1): Likewise.
1982
+ * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
1983
+ (__builtin_longdouble_dw1): Likewise.
1984
+ * doc/sourcebuild.texi (longdouble128): Document.
1986
+2014-06-13 Jason Merrill <jason@redhat.com>
1989
+ * common.opt (-fno-gnu-unique): Add.
1990
+ * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
1992
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
1994
+ Backport from 2014-05-09 trunk r210272
1996
+ * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
1997
+ unsigned int initializers for regno_in, regno_out.
1999
+ Backport from 2014-05-14 trunk r210418
2000
+ * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
2001
+ shifted values to avoid build warning.
2003
+ Backport from 2014-06-12 trunk r211491
2006
+ * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
2007
+ loading from address spaces.
2009
+2014-06-12 Alan Modra <amodra@gmail.com>
2012
+ * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
2013
+ * doc/tm.texi: Regenerate.
2014
+ * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
2015
+ Use throughout in place of REG_PARM_STACK_SPACE.
2016
+ * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
2017
+ "incoming" param. Pass to rs6000_function_parms_need_stack.
2018
+ (rs6000_function_parms_need_stack): Add "incoming" param, ignore
2019
+ prototype_p when incoming. Use function decl when incoming
2020
+ to handle K&R style functions.
2021
+ * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
2022
+ (INCOMING_REG_PARM_STACK_SPACE): Define.
2024
+2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
2026
+ Back port from trunk
2027
+ 2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
2030
+ * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
2031
+ iterators, VSX_D that handles 64-bit types, and VSX_LE that
2032
+ handles swapping the two 64-bit double words on little endian
2033
+ systems. Include V1TImode and optionally TImode in VSX_LE so that
2034
+ these types are properly swapped. Change all of the insns and
2035
+ splits that do the 64-bit swaps to use VSX_LE.
2036
+ (vsx_le_perm_load_<mode>): Likewise.
2037
+ (vsx_le_perm_store_<mode>): Likewise.
2038
+ (splitters for little endian memory operations): Likewise.
2039
+ (vsx_xxpermdi2_le_<mode>): Likewise.
2040
+ (vsx_lxvd2x2_le_<mode>): Likewise.
2041
+ (vsx_stxvd2x2_le_<mode>): Likewise.
2043
+2014-06-05 Martin Jambor <mjambor@suse.cz>
2046
+ * ipa-cp.c (determine_versionability): Pretend that tm_clones are
2049
+2014-06-04 Richard Biener <rguenther@suse.de>
2051
+ PR tree-optimization/61383
2052
+ * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
2055
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2057
+ Backport from mainline
2058
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2060
+ PR rtl-optimization/60866
2061
+ * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
2062
+ Default it to -1. Pass it down to init_simplejump_data.
2063
+ (init_simplejump_data): New parameter old_seqno. Pass it down
2064
+ to get_seqno_for_a_jump.
2065
+ (get_seqno_for_a_jump): New parameter old_seqno. Use it for
2066
+ initializing new jump seqno as a last resort. Add comment.
2067
+ (sel_redirect_edge_and_branch): Save old seqno of the conditional
2068
+ jump and pass it down to sel_init_new_insn.
2069
+ (sel_redirect_edge_and_branch_force): Likewise.
2071
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2073
+ Backport from mainline
2074
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2076
+ PR rtl-optimization/60901
2077
+ * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
2078
+ bb predecessor belongs to the same scheduling region. Adjust comment.
2080
+2014-06-03 Uros Bizjak <ubizjak@gmail.com>
2082
+ Backport from mainline
2083
+ 2014-06-02 Uros Bizjak <ubizjak@gmail.com>
2086
+ * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
2087
+ GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
2089
+2014-05-28 Guozhi Wei <carrot@google.com>
2092
+ * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
2094
+ (vqdmulhq_n_s16): Likewise.
2096
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
2098
+ Backport from mainline
2099
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
2101
+ * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
2102
+ predicate to detect a negative quotient.
2104
+2014-05-28 Georg-Johann Lay <avr@gjlay.de>
2107
+ * doc/extend.texi (Local Labels): Note that label differences are
2108
+ not supported for AVR.
2110
+2014-05-26 Michael Tautschnig <mt@debian.org>
2113
+ * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
2114
+ __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
2116
+2014-05-23 Alan Modra <amodra@gmail.com>
2119
+ * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
2120
+ * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
2121
+ Use "Y" constraint rather than "m".
2123
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2125
+ Backport from mainline
2126
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2128
+ * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
2130
+2014-05-22 Richard Earnshaw <rearnsha@arm.com>
2133
+ * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
2135
2014-05-22 Release Manager
2137
* GCC 4.8.3 released.
2138
Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
2139
===================================================================
2140
--- a/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../tags/gcc_4_8_3_release)
2141
+++ b/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../branches/gcc-4_8-branch)
2143
/* { dg-do assemble } */
2144
/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
2145
/* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
2146
+/* { dg-require-effective-target longdouble128 } */
2147
/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
2149
typedef float TFmode __attribute__ ((mode (TF)));
2150
Index: gcc/testsuite/gcc.target/powerpc/pack02.c
2151
===================================================================
2152
--- a/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../tags/gcc_4_8_3_release)
2153
+++ b/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../branches/gcc-4_8-branch)
2155
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
2156
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
2157
/* { dg-require-effective-target powerpc_fprs } */
2158
+/* { dg-require-effective-target longdouble128 } */
2159
/* { dg-options "-O2 -mhard-float" } */
2162
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
2163
===================================================================
2164
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../tags/gcc_4_8_3_release)
2165
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../branches/gcc-4_8-branch)
2167
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2168
+/* { dg-options "-mabi=elfv2" } */
2175
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
2179
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
2180
===================================================================
2181
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../tags/gcc_4_8_3_release)
2182
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../branches/gcc-4_8-branch)
2184
+/* { dg-do compile { target { powerpc*-*-* } } } */
2185
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
2186
+/* { dg-require-effective-target powerpc_htm_ok } */
2187
+/* { dg-options "-O2 -mhtm" } */
2189
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
2190
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
2192
+#include <htmintrin.h>
2196
+ return _HTM_STATE(__builtin_ttest());
2198
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
2199
===================================================================
2200
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../tags/gcc_4_8_3_release)
2201
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../branches/gcc-4_8-branch)
2203
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2204
+/* { dg-options "-mno-compat-align-parm" } */
2208
+ long a __attribute__((aligned (16)));
2211
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
2215
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
2216
===================================================================
2217
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../tags/gcc_4_8_3_release)
2218
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../branches/gcc-4_8-branch)
2220
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2221
+/* { dg-require-effective-target powerpc_altivec_ok } */
2222
+/* { dg-options "-maltivec" } */
2226
+ int a __attribute__((vector_size (8)));
2227
+ }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
2229
Index: gcc/testsuite/gcc.target/alpha/pr61586.c
2230
===================================================================
2231
--- a/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../tags/gcc_4_8_3_release)
2232
+++ b/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../branches/gcc-4_8-branch)
2234
+/* { dg-do compile } */
2235
+/* { dg-options "-O2 -mieee" } */
2237
+void foo (int *dimensions, double **params, int hh)
2241
+ else if (dimensions[hh] > 0)
2242
+ params[hh][0] = 1.0f;
2244
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
2245
===================================================================
2246
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../tags/gcc_4_8_3_release)
2247
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../branches/gcc-4_8-branch)
2249
+/* Test AAPCS64 layout and __builtin_va_start.
2251
+ Pass named HFA/HVA argument on stack. */
2253
+/* { dg-do run { target aarch64*-*-* } } */
2255
+#ifndef IN_FRAMEWORK
2256
+#define AAPCS64_TEST_STDARG
2257
+#define TESTFILE "va_arg-14.c"
2258
+#include "type-def.h"
2260
+struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
2261
+struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
2262
+vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
2263
+vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
2265
+#include "abitest.h"
2267
+ ARG (float, 1.0f, S0, 0)
2268
+ ARG (float, 2.0f, S1, 1)
2269
+ ARG (float, 3.0f, S2, 2)
2270
+ ARG (float, 4.0f, S3, 3)
2271
+ ARG (float, 5.0f, S4, 4)
2272
+ ARG (float, 6.0f, S5, 5)
2273
+ ARG (float, 7.0f, S6, 6)
2274
+ ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
2275
+ /* Previous argument size has been rounded up to the nearest multiple of
2277
+ ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
2278
+ /* NSAA is rounded up to the nearest natural alignment of float32x4. */
2279
+ ARG (vf4_t, float32x4, STACK + 32, 9)
2280
+ ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
2282
+ LAST_ANON (double, 123456789.987, STACK + 64, 11)
2284
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
2285
===================================================================
2286
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../tags/gcc_4_8_3_release)
2287
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../branches/gcc-4_8-branch)
2302
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
2303
===================================================================
2304
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../tags/gcc_4_8_3_release)
2305
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../branches/gcc-4_8-branch)
2307
+/* Test AAPCS64 layout and __builtin_va_start.
2309
+ Pass named HFA/HVA argument on stack. */
2311
+/* { dg-do run { target aarch64*-*-* } } */
2313
+#ifndef IN_FRAMEWORK
2314
+#define AAPCS64_TEST_STDARG
2315
+#define TESTFILE "va_arg-13.c"
2317
+struct float_float_t
2329
+#define HAS_DATA_INIT_FUNC
2333
+ float_float.a = 1.2f;
2334
+ float_float.b = 2.2f;
2336
+ float_int.b8 = 4983.80f;
2339
+#include "abitest.h"
2341
+ ARG (float, 1.0f, S0, 0)
2342
+ ARG (float, 2.0f, S1, 1)
2343
+ ARG (float, 3.0f, S2, 2)
2344
+ ARG (float, 4.0f, S3, 3)
2345
+ ARG (float, 5.0f, S4, 4)
2346
+ ARG (float, 6.0f, S5, 5)
2347
+ ARG (float, 7.0f, S6, 6)
2348
+ ARG (struct float_float_t, float_float, STACK, 7)
2349
+ ARG (int, 9, W0, 8)
2350
+ ARG (int, 10, W1, 9)
2351
+ ARG (int, 11, W2, 10)
2352
+ ARG (int, 12, W3, 11)
2353
+ ARG (int, 13, W4, 12)
2354
+ ARG (int, 14, W5, 13)
2355
+ ARG (int, 15, W6, LAST_NAMED_ARG_ID)
2357
+ /* Note on the reason of using 'X7' instead of 'W7' here:
2358
+ Using 'X7' makes sure the test works in the big-endian mode.
2359
+ According to PCS rules B.4 and C.10, the size of float_int is rounded
2360
+ to 8 bytes and prepared in the register X7 as if loaded via LDR from
2361
+ the memory, with the content of the other 4 bytes unspecified. The
2362
+ test framework will only compare the 4 relavent bytes. */
2363
+ ANON (union float_int_t, float_int, X7, 15)
2364
+ LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
2366
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
2367
===================================================================
2368
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../tags/gcc_4_8_3_release)
2369
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../branches/gcc-4_8-branch)
2371
+/* Test AAPCS64 layout and __builtin_va_start.
2373
+ Pass named __128int argument on stack. */
2375
+/* { dg-do run { target aarch64*-*-* } } */
2377
+#ifndef IN_FRAMEWORK
2378
+#define AAPCS64_TEST_STDARG
2379
+#define TESTFILE "va_arg-15.c"
2380
+#include "type-def.h"
2382
+union int128_t qword;
2384
+#define HAS_DATA_INIT_FUNC
2388
+ /* Init signed quad-word integer. */
2389
+ qword.l64 = 0xfdb9753102468aceLL;
2390
+ qword.h64 = 0xeca8642013579bdfLL;
2393
+#include "abitest.h"
2395
+ ARG (int, 1, W0, 0)
2396
+ ARG (int, 2, W1, 1)
2397
+ ARG (int, 3, W2, 2)
2398
+ ARG (int, 4, W3, 3)
2399
+ ARG (int, 5, W4, 4)
2400
+ ARG (int, 6, W5, 5)
2401
+ ARG (int, 7, W6, 6)
2402
+ ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
2404
+#ifndef __AAPCS64_BIG_ENDIAN__
2405
+ LAST_ANON (int, 8, STACK + 16, 8)
2407
+ LAST_ANON (int, 8, STACK + 20, 8)
2410
Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
2411
===================================================================
2412
--- a/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../tags/gcc_4_8_3_release)
2413
+++ b/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../branches/gcc-4_8-branch)
2415
+/* { dg-do run } */
2416
+/* { dg-options "-std=gnu99" } */
2418
+#include <stdlib.h>
2419
+#include <stdarg.h>
2421
+#define NC __attribute__((noinline,noclone))
2423
+void NC vfun (char n, ...)
2434
+ if (11 != va_arg (ap, int))
2438
+ if (2222 != va_arg (ap, int))
2442
+ if (333333 != va_arg (ap, __int24))
2446
+ if (44444444 != va_arg (ap, long))
2450
+ if (8888888888888888 != va_arg (ap, long long))
2459
+void NC boo_qi (const __flash char *p)
2464
+void NC boox_qi (const __memx char *p)
2469
+void NC boo_hi (const __flash int *p)
2474
+void NC boox_hi (const __memx int *p)
2479
+void NC boo_psi (const __flash __int24 *p)
2484
+void NC boox_psi (const __memx __int24 *p)
2489
+void NC boo_si (const __flash long *p)
2494
+void NC boox_si (const __memx long *p)
2499
+void NC boo_di (const __flash long long *p)
2504
+void NC boox_di (const __memx long long *p)
2509
+const __flash char f_qi = 11;
2510
+const __flash int f_hi = 2222;
2511
+const __flash __int24 f_psi = 333333;
2512
+const __flash long f_si = 44444444;
2513
+const __flash long long f_di = 8888888888888888;
2515
+const __memx char x_qi = 11;
2516
+const __memx int x_hi = 2222;
2517
+const __memx __int24 x_psi = 333333;
2518
+const __memx long x_si = 44444444;
2519
+const __memx long long x_di = 8888888888888888;
2523
+__int24 r_psi = 333333;
2524
+long r_si = 44444444;
2525
+long long r_di = 8888888888888888;
2537
+ boox_psi (&x_psi);
2543
+ boox_psi (&r_psi);
2549
Index: gcc/testsuite/gcc.target/i386/pr61923.c
2550
===================================================================
2551
--- a/src/gcc/testsuite/gcc.target/i386/pr61923.c (.../tags/gcc_4_8_3_release)
2552
+++ b/src/gcc/testsuite/gcc.target/i386/pr61923.c (.../branches/gcc-4_8-branch)
2554
+/* PR debug/61923 */
2555
+/* { dg-do compile } */
2556
+/* { dg-options "-O2 -fcompare-debug" } */
2568
+struct ext4_map_blocks
2574
+int ext4_da_map_blocks_ei_0;
2575
+void fn1 (int p1, struct ext4_map_blocks *p2)
2580
+ ext4_da_map_blocks_ei_0++;
2581
+ arch_spinlock_t *lock;
2582
+ switch (sizeof *&lock->tickets.head)
2584
+ asm("" : "+m"(*&lock->tickets.head) : ""(0));
2588
+ fn2 (p2->m_lblk, p2->m_len);
2590
Index: gcc/testsuite/gcc.target/i386/pr61423.c
2591
===================================================================
2592
--- a/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../tags/gcc_4_8_3_release)
2593
+++ b/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../branches/gcc-4_8-branch)
2595
+/* PR target/61423 */
2596
+/* { dg-do run { target ia32 } } */
2597
+/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
2600
+static unsigned int A[N];
2603
+__attribute__((noinline))
2606
+ unsigned int sum = 0;
2610
+ for (i = 0; i < N; i++)
2623
+ for(i = 0; i < N; i++)
2629
+ __builtin_abort ();
2633
Index: gcc/testsuite/gcc.target/i386/pr60901.c
2634
===================================================================
2635
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../tags/gcc_4_8_3_release)
2636
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../branches/gcc-4_8-branch)
2638
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts" } */
2641
+extern void bar (void);
2642
+extern int baz (int);
2648
+ for (j = 0; j < n; j++)
2650
+ for (i = 1; i < j; i++)
2655
Index: gcc/testsuite/gcc.target/i386/pr61801.c
2656
===================================================================
2657
--- a/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../tags/gcc_4_8_3_release)
2658
+++ b/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../branches/gcc-4_8-branch)
2660
+/* PR rtl-optimization/61801 */
2661
+/* { dg-do compile } */
2662
+/* { dg-options "-Os -fcompare-debug" } */
2676
+ asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
2681
Index: gcc/testsuite/gcc.target/i386/pr61446.c
2682
===================================================================
2683
--- a/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../tags/gcc_4_8_3_release)
2684
+++ b/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../branches/gcc-4_8-branch)
2686
+/* PR rtl-optimization/61446 */
2688
+/* { dg-do compile { target { ia32 } } } */
2689
+/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
2694
+ const double dfa = a;
2695
+ const unsigned int hi = dfa / 0x1p32f;
2696
+ const unsigned int lo = dfa - (double) hi * 0x1p32f;
2698
+ return ((unsigned long long) hi << (4 * (8))) | lo;
2700
Index: gcc/testsuite/gcc.target/mips/pr62030-octeon.c
2701
===================================================================
2702
--- a/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c (.../tags/gcc_4_8_3_release)
2703
+++ b/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c (.../branches/gcc-4_8-branch)
2705
+/* { dg-do run } */
2706
+/* { dg-options "-march=octeon" } */
2708
+extern void abort (void);
2712
+ struct node *next;
2713
+ struct node *prev;
2720
+ struct node *first;
2723
+struct head heads[5];
2727
+struct head *head = &heads[2];
2729
+static int __attribute__((noinline))
2732
+ node.prev = (void *)head;
2733
+ head->first = &node;
2735
+ struct node *n = head->first;
2736
+ struct head *h = &heads[k];
2737
+ struct node *next = n->next;
2739
+ if (n->prev == (void *)h)
2742
+ n->prev->next = next;
2744
+ n->next = h->first;
2745
+ return n->next == &node;
2755
Index: gcc/testsuite/gcc.target/sh/pr61996.c
2756
===================================================================
2757
--- a/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../tags/gcc_4_8_3_release)
2758
+++ b/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../branches/gcc-4_8-branch)
2760
+/* Check that the option -musermode has no effect on targets that do not
2761
+ support user/privileged mode and that it does not interfere with option
2762
+ -matomic-model=soft-imask. */
2763
+/* { dg-do compile } */
2764
+/* { dg-options "-matomic-model=soft-imask" } */
2765
+/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } } */
2772
Index: gcc/testsuite/lib/target-supports.exp
2773
===================================================================
2774
--- a/src/gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_8_3_release)
2775
+++ b/src/gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_8-branch)
2776
@@ -1790,6 +1790,15 @@
2780
+# Return 1 if the target supports long double of 128 bits,
2783
+proc check_effective_target_longdouble128 { } {
2784
+ return [check_no_compiler_messages longdouble128 object {
2785
+ int dummy[sizeof(long double) == 16 ? 1 : -1];
2789
# Return 1 if the target supports double of 64 bits,
2792
Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
2793
===================================================================
2794
--- a/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../tags/gcc_4_8_3_release)
2795
+++ b/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../branches/gcc-4_8-branch)
2797
! { dg-require-effective-target fortran_large_real }
2798
-! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
2799
-! Test XFAILed on these platforms because the system's printf() lacks
2800
+! { dg-do run { xfail powerpc*-apple-darwin* } }
2801
+! Test XFAILed on this platform because the system's printf() lacks
2802
! proper support for denormalized long doubles. See PR24685
2804
! This tests that the default formats for formatted I/O of reals are
2805
Index: gcc/testsuite/gfortran.dg/dot_product_3.f90
2806
===================================================================
2807
--- a/src/gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../tags/gcc_4_8_3_release)
2808
+++ b/src/gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../branches/gcc-4_8-branch)
2810
+! { dg-do compile }
2811
+! { dg-options "-fdump-tree-original" }
2812
+! PR 61999 - this used to ICE.
2813
+! Original test case by A. Kasahara
2815
+ use, intrinsic:: iso_fortran_env, only: output_unit
2819
+ write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
2823
+! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
2824
+! { dg-final { cleanup-tree-dump "original" } }
2825
Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
2826
===================================================================
2827
--- a/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../tags/gcc_4_8_3_release)
2828
+++ b/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../branches/gcc-4_8-branch)
2831
+! { dg-options "-fcray-pointer" }
2846
+ if (z /= 42) call abort
2848
Index: gcc/testsuite/gfortran.dg/dependency_44.f90
2849
===================================================================
2850
--- a/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../tags/gcc_4_8_3_release)
2851
+++ b/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../branches/gcc-4_8-branch)
2854
+! Tests fix for PR61780 in which the loop reversal mechanism was
2855
+! not accounting for the first index being an element so that no
2856
+! loop in this dimension is created.
2858
+! Contributed by Manfred Tietze on clf.
2862
+ integer, parameter :: n = 10, k = 3
2864
+ integer, dimension(n,n) :: y
2865
+ integer :: res1(n), res2(n)
2878
+ y(k,4:n) = y(k,3:n-1)
2882
+ y(k,n:4:-1) = y(k,n-1:3:-1)
2887
+ if (any(res1 /= res2)) call abort ()
2889
Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
2890
===================================================================
2891
--- a/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../tags/gcc_4_8_3_release)
2892
+++ b/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../branches/gcc-4_8-branch)
2894
+C { dg-do compile }
2896
+ INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
2899
+ INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
2902
Index: gcc/testsuite/gfortran.dg/nint_2.f90
2903
===================================================================
2904
--- a/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../tags/gcc_4_8_3_release)
2905
+++ b/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../branches/gcc-4_8-branch)
2907
! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
2910
-! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
2911
+! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
2912
+! Note that this doesn't fail on powerpc64le-*-linux*.
2914
integer(kind=8) :: i1, i2
2916
Index: gcc/testsuite/gfortran.dg/pointer_intent_7.f90
2917
===================================================================
2918
--- a/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 (.../tags/gcc_4_8_3_release)
2919
+++ b/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 (.../branches/gcc-4_8-branch)
2923
call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
2924
- call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
2925
+ call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
2926
call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
2927
call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
2929
Index: gcc/testsuite/gfortran.dg/array_assignment_5.f90
2930
===================================================================
2931
--- a/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90 (.../tags/gcc_4_8_3_release)
2932
+++ b/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90 (.../branches/gcc-4_8-branch)
2935
+! { dg-options "-ffrontend-optimize" }
2936
+! PR 62214 - this used to give the wrong result.
2937
+! Original test case by Oliver Fuhrer
2940
+ CHARACTER(LEN=20) :: fullNames(2)
2941
+ CHARACTER(LEN=255) :: pathName
2942
+ CHARACTER(LEN=5) :: fileNames(2)
2944
+ pathName = "/dir1/dir2/"
2945
+ fileNames = (/ "file1", "file2" /)
2946
+ fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
2947
+ if (fullNames(1) /= '/dir1/dir2/file1' .or. &
2948
+ & fullnames(2) /= '/dir1/dir2/file2') call abort
2950
Index: gcc/testsuite/gfortran.dg/pr45636.f90
2951
===================================================================
2952
--- a/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../tags/gcc_4_8_3_release)
2953
+++ b/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../branches/gcc-4_8-branch)
2958
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
2959
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
2960
! { dg-final { cleanup-tree-dump "forwprop2" } }
2961
Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
2962
===================================================================
2963
--- a/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../tags/gcc_4_8_3_release)
2964
+++ b/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../branches/gcc-4_8-branch)
2967
+! Test the fix for PR61459.
2969
+! Contributed by John Wingate <johnww@tds.net>
2975
+ public :: f_segfault, f_segfault_plus, f_workaround
2976
+ integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
2980
+ function f_segfault(x)
2981
+ real, dimension(:), allocatable :: f_segfault
2982
+ real, dimension(:), intent(in) :: x
2983
+ allocate(f_segfault(2))
2984
+ f_segfault = matmul(b,x)
2985
+ end function f_segfault
2987
+! Sefaulted without the ALLOCATE as well.
2988
+ function f_segfault_plus(x)
2989
+ real, dimension(:), allocatable :: f_segfault_plus
2990
+ real, dimension(:), intent(in) :: x
2991
+ f_segfault_plus = matmul(b,x)
2992
+ end function f_segfault_plus
2994
+ function f_workaround(x)
2995
+ real, dimension(:), allocatable :: f_workaround
2996
+ real, dimension(:), intent(in) :: x
2997
+ real, dimension(:), allocatable :: tmp
2998
+ allocate(f_workaround(2),tmp(2))
3000
+ f_workaround = tmp
3001
+ end function f_workaround
3008
+ real, dimension(2) :: x = 1.0, y
3009
+ y = f_workaround (x)
3010
+ if (any (f_segfault (x) .ne. y)) call abort
3011
+ if (any (f_segfault_plus (x) .ne. y)) call abort
3013
Index: gcc/testsuite/gfortran.dg/bessel_7.f90
3014
===================================================================
3015
--- a/src/gcc/testsuite/gfortran.dg/bessel_7.f90 (.../tags/gcc_4_8_3_release)
3016
+++ b/src/gcc/testsuite/gfortran.dg/bessel_7.f90 (.../branches/gcc-4_8-branch)
3019
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]
3020
real,parameter :: myeps(size(values)) = epsilon(0.0) &
3021
- * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
3022
+ * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
3023
! The following is sufficient for me - the values above are a bit
3025
! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
3026
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
3027
===================================================================
3028
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../tags/gcc_4_8_3_release)
3029
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../branches/gcc-4_8-branch)
3031
+#ifdef __INT32_TYPE__
3032
+typedef __INT32_TYPE__ int32_t;
3034
+typedef int int32_t;
3037
+#ifdef __UINT32_TYPE__
3038
+typedef __UINT32_TYPE__ uint32_t;
3040
+typedef unsigned uint32_t;
3043
+#define __fake_const_swab32(x) ((uint32_t)( \
3044
+ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
3045
+ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
3046
+ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
3047
+ (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24)))
3049
+/* Previous version of bswap optimization failed to consider sign extension
3050
+ and as a result would replace an expression *not* doing a bswap by a
3053
+__attribute__ ((noinline, noclone)) uint32_t
3054
+fake_bswap32 (uint32_t in)
3056
+ return __fake_const_swab32 (in);
3062
+ if (sizeof (int32_t) * __CHAR_BIT__ != 32)
3064
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
3066
+ if (fake_bswap32 (0x87654321) != 0xffffff87)
3067
+ __builtin_abort ();
3070
Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
3071
===================================================================
3072
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../tags/gcc_4_8_3_release)
3073
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../branches/gcc-4_8-branch)
3075
+set additional_flags "-Wno-psabi"
3077
Index: gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
3078
===================================================================
3079
--- a/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c (.../tags/gcc_4_8_3_release)
3080
+++ b/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c (.../branches/gcc-4_8-branch)
3088
+static union U u = { 0x12345678 };
3090
+/* Constant folding used to fail to account for endianness when folding a
3096
+#ifdef __BYTE_ORDER__
3097
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
3098
+ return u.b - 0x45678;
3100
+ return u.b - 0x12345;
3105
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
3106
===================================================================
3107
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../tags/gcc_4_8_3_release)
3108
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../branches/gcc-4_8-branch)
3120
+ __builtin_abort ();
3123
Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
3124
===================================================================
3125
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../tags/gcc_4_8_3_release)
3126
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../branches/gcc-4_8-branch)
3128
set additional_flags "-mno-mmx"
3131
+set additional_flags "-Wno-psabi"
3133
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
3134
===================================================================
3135
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../tags/gcc_4_8_3_release)
3136
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../branches/gcc-4_8-branch)
3138
+#ifdef __INT16_TYPE__
3139
+typedef __INT16_TYPE__ int16_t;
3141
+typedef short int16_t;
3144
+#ifdef __UINT32_TYPE__
3145
+typedef __UINT32_TYPE__ uint32_t;
3147
+typedef unsigned uint32_t;
3150
+#define __fake_const_swab32(x) ((uint32_t)( \
3151
+ (((uint32_t) (x) & (uint32_t)0x000000ffUL) << 24) | \
3152
+ (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) << 8) | \
3153
+ (((uint32_t) (x) & (uint32_t)0x00ff0000UL) >> 8) | \
3154
+ (((uint32_t) (x) & (uint32_t)0xff000000UL) >> 24)))
3157
+/* Previous version of bswap optimization failed to consider sign extension
3158
+ and as a result would replace an expression *not* doing a bswap by a
3161
+__attribute__ ((noinline, noclone)) uint32_t
3162
+fake_bswap32 (uint32_t in)
3164
+ return __fake_const_swab32 (in);
3170
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
3172
+ if (sizeof (int16_t) * __CHAR_BIT__ != 16)
3174
+ if (fake_bswap32 (0x81828384) != 0xff838281)
3175
+ __builtin_abort ();
3178
Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
3179
===================================================================
3180
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../tags/gcc_4_8_3_release)
3181
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../branches/gcc-4_8-branch)
3183
+#ifdef __UINT64_TYPE__
3184
+typedef __UINT64_TYPE__ uint64_t;
3186
+typedef unsigned long long uint64_t;
3189
+#ifndef __SIZEOF_INT128__
3190
+#define __int128 long long
3193
+/* Some version of bswap optimization would ICE when analyzing a mask constant
3194
+ too big for an HOST_WIDE_INT (PR61375). */
3196
+__attribute__ ((noinline, noclone)) uint64_t
3197
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
3199
+ __int128 mask = (__int128)0xffff << 56;
3200
+ return ((in1 & mask) >> 56) | in2;
3207
+#ifdef __SIZEOF_INT128__
3210
+ if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
3212
+ if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
3214
+ if (uint128_central_bitsi_ior (in, 2) != 0x102)
3215
+ __builtin_abort ();
3218
Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
3219
===================================================================
3220
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../tags/gcc_4_8_3_release)
3221
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../branches/gcc-4_8-branch)
3226
+set additional_flags "-Wno-psabi"
3228
Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
3229
===================================================================
3230
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../tags/gcc_4_8_3_release)
3231
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../branches/gcc-4_8-branch)
3233
+set additional_flags "-Wno-psabi"
3235
Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
3236
===================================================================
3237
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../tags/gcc_4_8_3_release)
3238
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../branches/gcc-4_8-branch)
3240
+/* PR tree-optimization/61684 */
3245
+static short **e = 0;
3250
+ for (; c < 1; c++)
3253
+ a = d && (c && 1) & *b;
3255
Index: gcc/testsuite/gnat.dg/opt39.adb
3256
===================================================================
3257
--- a/src/gcc/testsuite/gnat.dg/opt39.adb (.../tags/gcc_4_8_3_release)
3258
+++ b/src/gcc/testsuite/gnat.dg/opt39.adb (.../branches/gcc-4_8-branch)
3260
+-- { dg-do compile }
3261
+-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
3263
+procedure Opt39 (I : Integer) is
3265
+ type Rec is record
3273
+ procedure Set (A : access Rec; I : Integer) is
3274
+ Tmp : Rec := A.all;
3283
+ Set (R'Access, I);
3285
+ raise Program_Error;
3289
+-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
3290
+-- { dg-final { cleanup-tree-dump "optimized" } }
3291
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
3292
===================================================================
3293
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../tags/gcc_4_8_3_release)
3294
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../branches/gcc-4_8-branch)
3297
+-- { dg-options "-gnato -O" }
3299
+procedure Overflow_Fixed is
3301
+ type Unsigned_8_Bit is mod 2**8;
3303
+ procedure Fixed_To_Eight (Value : Duration) is
3304
+ Item : Unsigned_8_Bit;
3306
+ Item := Unsigned_8_Bit(Value);
3307
+ raise Program_Error;
3309
+ when Constraint_Error => null; -- expected case
3313
+ Fixed_To_Eight (-0.5);
3315
Index: gcc/testsuite/gnat.dg/aliasing1.adb
3316
===================================================================
3317
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../tags/gcc_4_8_3_release)
3318
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../branches/gcc-4_8-branch)
3323
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
3324
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
3325
-- { dg-final { cleanup-tree-dump "optimized" } }
3326
Index: gcc/testsuite/gcc.dg/pr60866.c
3327
===================================================================
3328
--- a/src/gcc/testsuite/gcc.dg/pr60866.c (.../tags/gcc_4_8_3_release)
3329
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c (.../branches/gcc-4_8-branch)
3331
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
3332
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns" } */
3337
+foo (int w, int **dnroot, int **dn)
3340
+ int *xchild = xchild;
3341
+ for (; w < n; w++)
3345
+ for (child = *dn; child; child = xchild)
3349
Index: gcc/testsuite/gcc.dg/pr61045.c
3350
===================================================================
3351
--- a/src/gcc/testsuite/gcc.dg/pr61045.c (.../tags/gcc_4_8_3_release)
3352
+++ b/src/gcc/testsuite/gcc.dg/pr61045.c (.../branches/gcc-4_8-branch)
3354
+/* { dg-do run } */
3355
+/* { dg-options "-fstrict-overflow" } */
3360
+ int b = __INT_MAX__;
3361
+ int t = (a - 2) > (b - 1);
3363
+ __builtin_abort();
3366
Index: gcc/testsuite/gcc.dg/pr62004.c
3367
===================================================================
3368
--- a/src/gcc/testsuite/gcc.dg/pr62004.c (.../tags/gcc_4_8_3_release)
3369
+++ b/src/gcc/testsuite/gcc.dg/pr62004.c (.../branches/gcc-4_8-branch)
3371
+/* { dg-do run } */
3372
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
3376
+ struct node *next;
3377
+ struct node *prev;
3384
+ struct node *first;
3387
+struct head heads[5];
3391
+struct head *head = &heads[2];
3398
+ node.next = (void*)0;
3400
+ node.prev = (void *)head;
3402
+ head->first = &node;
3404
+ struct node *n = head->first;
3406
+ struct head *h = &heads[k];
3408
+ heads[2].first = n->next;
3410
+ if ((void*)n->prev == (void *)h)
3413
+ /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */
3414
+ p = n->prev->next;
3416
+ return !(p == (void*)0);
3418
Index: gcc/testsuite/gcc.dg/pr51879-18.c
3419
===================================================================
3420
--- a/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../tags/gcc_4_8_3_release)
3421
+++ b/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../branches/gcc-4_8-branch)
3426
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
3427
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
3428
/* { dg-final { cleanup-tree-dump "pre" } } */
3429
Index: gcc/testsuite/gcc.dg/torture/pr61964.c
3430
===================================================================
3431
--- a/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../tags/gcc_4_8_3_release)
3432
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../branches/gcc-4_8-branch)
3434
+/* { dg-do run } */
3436
+extern void abort (void);
3438
+struct node { struct node *next, *prev; } node;
3439
+struct head { struct node *first; } heads[5];
3441
+struct head *head = &heads[2];
3443
+static int __attribute__((noinline))
3446
+ node.prev = (void *)head;
3447
+ head->first = &node;
3449
+ struct node *n = head->first;
3450
+ struct head *h = &heads[k];
3452
+ if (n->prev == (void *)h)
3453
+ h->first = n->next;
3455
+ n->prev->next = n->next;
3457
+ n->next = h->first;
3458
+ return n->next == &node;
3467
Index: gcc/testsuite/gcc.dg/torture/pr61010.c
3468
===================================================================
3469
--- a/src/gcc/testsuite/gcc.dg/torture/pr61010.c (.../tags/gcc_4_8_3_release)
3470
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61010.c (.../branches/gcc-4_8-branch)
3472
+/* { dg-do compile } */
3477
+ unsigned b = (a * 64 & 192) | 63U;
3480
Index: gcc/testsuite/gcc.dg/torture/pr61452.c
3481
===================================================================
3482
--- a/src/gcc/testsuite/gcc.dg/torture/pr61452.c (.../tags/gcc_4_8_3_release)
3483
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61452.c (.../branches/gcc-4_8-branch)
3485
+/* { dg-do run } */
3492
+fn1 (int p1, char p2)
3494
+ return p1 || p2 ? 0 : p2;
3505
+ b = fn1 (g = d = e, g);
3516
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
3517
===================================================================
3518
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../tags/gcc_4_8_3_release)
3519
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../branches/gcc-4_8-branch)
3521
+/* { dg-do run } */
3523
+int a, b = 1, c, d, e, f, g;
3532
+ g = g ? 0 : 1 % g;
3534
+ for (; d < 1; d = e)
3556
Index: gcc/testsuite/gcc.dg/stack-usage-2.c
3557
===================================================================
3558
--- a/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../tags/gcc_4_8_3_release)
3559
+++ b/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../branches/gcc-4_8-branch)
3561
/* { dg-do compile } */
3562
/* { dg-options "-Wstack-usage=512" } */
3565
+int foo1 (void) /* { dg-bogus "stack usage" } */
3570
-} /* { dg-bogus "stack usage" } */
3574
+int foo2 (void) /* { dg-warning "stack usage is \[0-9\]* bytes" } */
3579
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
3583
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
3585
char arr[1024] __attribute__((aligned (512)));
3588
/* Force dynamic realignment of argument pointer. */
3589
__builtin_apply ((void (*)()) foo2, 0, 0);
3593
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
3596
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
3601
-} /* { dg-warning "stack usage might be unbounded" } */
3603
Index: gcc/testsuite/gcc.dg/ipa/pr61986.c
3604
===================================================================
3605
--- a/src/gcc/testsuite/gcc.dg/ipa/pr61986.c (.../tags/gcc_4_8_3_release)
3606
+++ b/src/gcc/testsuite/gcc.dg/ipa/pr61986.c (.../branches/gcc-4_8-branch)
3608
+/* { dg-do compile } */
3609
+/* { dg-options "-O3" } */
3619
+static int fn2 (struct S);
3620
+void fn3 (struct S);
3625
+ struct S h = { 0, 0 };
3633
+ struct S j = { 0, 0 };
3652
+ struct S f = { 0, 0 };
3656
Index: gcc/testsuite/gcc.dg/pr62030.c
3657
===================================================================
3658
--- a/src/gcc/testsuite/gcc.dg/pr62030.c (.../tags/gcc_4_8_3_release)
3659
+++ b/src/gcc/testsuite/gcc.dg/pr62030.c (.../branches/gcc-4_8-branch)
3661
+/* { dg-do run } */
3662
+/* { dg-options "-O2" } */
3664
+extern void abort (void);
3668
+ struct node *next;
3669
+ struct node *prev;
3676
+ struct node *first;
3679
+struct head heads[5];
3683
+struct head *head = &heads[2];
3685
+static int __attribute__((noinline))
3688
+ node.prev = (void *)head;
3689
+ head->first = &node;
3691
+ struct node *n = head->first;
3692
+ struct head *h = &heads[k];
3693
+ struct node *next = n->next;
3695
+ if (n->prev == (void *)h)
3698
+ n->prev->next = next;
3700
+ n->next = h->first;
3701
+ return n->next == &node;
3711
Index: gcc/testsuite/gcc.dg/vect/pr63189.c
3712
===================================================================
3713
--- a/src/gcc/testsuite/gcc.dg/vect/pr63189.c (.../tags/gcc_4_8_3_release)
3714
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63189.c (.../branches/gcc-4_8-branch)
3716
+/* PR tree-optimization/63189 */
3717
+/* { dg-do run } */
3719
+#include "tree-vect.h"
3721
+short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
3723
+__attribute__((noinline, noclone)) void
3727
+ for (j = 0; j < 8; j++)
3741
+/* { dg-final { cleanup-tree-dump "vect" } } */
3742
Index: gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
3743
===================================================================
3744
--- a/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c (.../tags/gcc_4_8_3_release)
3745
+++ b/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c (.../branches/gcc-4_8-branch)
3747
+/* { dg-require-effective-target vect_int } */
3749
+#include <stdarg.h>
3750
+#include "tree-vect.h"
3755
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
3756
+signed int Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
3758
+/* (short, int)->int->int dot product.
3759
+ Not detected as a dot-product pattern. */
3761
+__attribute__ ((noinline)) int
3767
+ for (i = 0; i < len; i++)
3769
+ result += (X[i] * Y[i]);
3775
+/* (int, short)->int->int dot product.
3776
+ Not detected as a dot-product pattern. */
3778
+__attribute__ ((noinline)) int
3784
+ for (i = 0; i < len; i++)
3786
+ result += (Y[i] * X[i]);
3799
+ for (i = 0; i < N; i++)
3803
+ __asm__ volatile ("");
3817
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
3818
+/* { dg-final { cleanup-tree-dump "vect" } } */
3820
Index: gcc/testsuite/gcc.dg/vect/pr62073.c
3821
===================================================================
3822
--- a/src/gcc/testsuite/gcc.dg/vect/pr62073.c (.../tags/gcc_4_8_3_release)
3823
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62073.c (.../branches/gcc-4_8-branch)
3825
+/* { dg-do compile } */
3826
+/* { dg-additional-options "-O1" } */
3836
+int foo (long long p_56, int * p_57)
3843
+ int **l_78 = &l_77;
3848
+ for (g_76 = 1; g_76 >= 0; g_76--)
3851
+ for (l_101 = 4; l_101 >= 0; l_101--)
3856
+ int **l_113 = &l_77;
3864
+/* { dg-final { cleanup-tree-dump "vect" } } */
3865
Index: gcc/testsuite/gcc.dg/vect/pr60196-1.c
3866
===================================================================
3867
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../tags/gcc_4_8_3_release)
3868
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../branches/gcc-4_8-branch)
3870
+/* PR tree-optimization/63189 */
3871
+/* { dg-additional-options "-fwrapv" } */
3872
+/* { dg-do run } */
3874
+#include "tree-vect.h"
3876
+__attribute__((noinline, noclone)) static int
3877
+bar (const short *a, int len)
3882
+ for (x = 0; x < len; x++)
3887
+__attribute__((noinline, noclone)) void
3890
+ short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
3891
+ if (bar (stuff, 9) != 36)
3903
+/* { dg-final { cleanup-tree-dump "vect" } } */
3904
Index: gcc/testsuite/gcc.dg/vect/pr62075.c
3905
===================================================================
3906
--- a/src/gcc/testsuite/gcc.dg/vect/pr62075.c (.../tags/gcc_4_8_3_release)
3907
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62075.c (.../branches/gcc-4_8-branch)
3909
+/* { dg-do compile } */
3922
+ for (i = 0; i < 16; ++i)
3924
+ x->b[i][0] = a[i][0];
3925
+ x->c[i][0] = 0 != a[i][0];
3926
+ x->b[i][1] = a[i][1];
3930
+/* { dg-final { cleanup-tree-dump "vect" } } */
3931
Index: gcc/testsuite/gcc.dg/vect/pr60196-2.c
3932
===================================================================
3933
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../tags/gcc_4_8_3_release)
3934
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../branches/gcc-4_8-branch)
3936
+/* PR tree-optimization/63189 */
3937
+/* { dg-do run } */
3939
+#include "tree-vect.h"
3941
+static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
3942
+static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
3944
+__attribute__((noinline, noclone)) static int
3948
+ for (i = 0; i < 8; ++i)
3949
+ sum += a[i] * b[i];
3953
+__attribute__((noinline, noclone)) void
3968
+/* { dg-final { cleanup-tree-dump "vect" } } */
3969
Index: gcc/testsuite/ChangeLog
3970
===================================================================
3971
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_8_3_release)
3972
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_8-branch)
3974
+2014-09-09 Richard Biener <rguenther@suse.de>
3976
+ Backport from mainline
3977
+ 2014-06-11 Richard Biener <rguenther@suse.de>
3979
+ PR tree-optimization/61452
3980
+ * gcc.dg/torture/pr61452.c: New testcase.
3982
+2014-09-09 Richard Biener <rguenther@suse.de>
3984
+ Backport from mainline
3985
+ 2014-05-05 Richard Biener <rguenther@suse.de>
3987
+ PR middle-end/61010
3988
+ * gcc.dg/torture/pr61010.c: New testcase.
3990
+ 2014-05-28 Richard Biener <rguenther@suse.de>
3992
+ PR middle-end/61045
3993
+ * gcc.dg/pr61045.c: New testcase.
3995
+ 2014-08-11 Richard Biener <rguenther@suse.de>
3997
+ PR tree-optimization/62075
3998
+ * gcc.dg/vect/pr62075.c: New testcase.
4000
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
4002
+ PR tree-optimization/60196
4003
+ PR tree-optimization/63189
4004
+ * gcc.dg/vect/pr63189.c: New test.
4005
+ * gcc.dg/vect/pr60196-1.c: New test.
4006
+ * gcc.dg/vect/pr60196-2.c: New test.
4008
+ Backported from mainline
4009
+ 2013-09-17 Cong Hou <congh@google.com>
4011
+ * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product
4012
+ on two arrays with short and int types. This should not be recognized
4013
+ as a dot product pattern.
4015
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
4017
+ Backported from mainline
4018
+ 2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
4021
+ * gcc.target/i386/pr61923.c: New test.
4023
+2014-09-06 John David Anglin <danglin@gcc.gnu.org>
4025
+ PR testsuite/56194
4026
+ * g++.dg/init/const9.C: Skip scan-assembler-not "rodata" on hppa*-*-*.
4028
+2014-09-03 Marek Polacek <polacek@redhat.com>
4030
+ Backport from mainline
4031
+ 2014-09-02 Marek Polacek <polacek@redhat.com>
4034
+ * gfortran.dg/pointer_intent_7.f90: Adjust dg-error.
4036
+2014-09-03 Martin Jambor <mjambor@suse.cz>
4039
+ * g++.dg/ipa/pr62015.C: New test.
4041
+2014-09-03 Martin Jambor <mjambor@suse.cz>
4044
+ * gcc.dg/ipa/pr61986.c: New test.
4046
+2014-08-26 Dominik Vogt <vogt@linux.vnet.ibm.com>
4048
+ * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
4049
+ failure on s390*-*-linux-gnu.
4051
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
4053
+ Backport from mainline
4054
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
4057
+ * gcc.target/sh/pr61996.c: New.
4059
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
4061
+ Backport from trunk
4063
+ * gfortran.dg/array_assignment_5.f90: New test.
4065
+2014-08-15 Tom de Vries <tom@codesourcery.com>
4067
+ Backport from mainline:
4068
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
4070
+ PR rtl-optimization/62004
4071
+ PR rtl-optimization/62030
4072
+ * gcc.dg/pr62004.c: New test.
4073
+ * gcc.dg/pr62030.c: Same.
4074
+ * gcc.target/mips/pr62030-octeon.c: Same.
4076
+2014-08-13 Felix Yang <fei.yang0953@gmail.com>
4078
+ PR tree-optimization/62073
4079
+ * gcc.dg/vect/pr62073.c: New test.
4081
+2014-08-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
4083
+ Backport from mainline
4084
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
4086
+ PR middle-end/62103
4087
+ * gcc.c-torture/execute/bitfld-6.c: New test.
4089
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
4091
+ Backport from trunk
4093
+ * gfortran.dg/dot_product_3.f90: New test case.
4095
+2014-08-07 John David Anglin <danglin@gcc.gnu.org>
4097
+ PR tree-optimization/60707
4098
+ * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
4100
+2014-08-06 Jakub Jelinek <jakub@redhat.com>
4102
+ PR rtl-optimization/61801
4103
+ * gcc.target/i386/pr61801.c: Rewritten.
4105
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
4107
+ Backport from mainline
4108
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
4110
+ PR tree-optimization/61375
4111
+ * gcc.c-torture/execute/pr61375-1.c: New test.
4113
+2014-08-01 Richard Biener <rguenther@suse.de>
4115
+ PR tree-optimization/61964
4116
+ * gcc.dg/torture/pr61964.c: New testcase.
4117
+ * gcc.dg/pr51879-18.c: XFAIL.
4119
+2014-07-28 Richard Biener <rguenther@suse.de>
4121
+ PR rtl-optimization/61801
4122
+ * gcc.target/i386/pr61801.c: Fix testcase.
4124
+2014-07-28 Richard Biener <rguenther@suse.de>
4126
+ PR rtl-optimization/61801
4127
+ * gcc.target/i386/pr61801.c: New testcase.
4129
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4131
+ Backport from mainline:
4132
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4134
+ * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
4136
+ * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
4137
+ * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
4138
+ * gcc.c-torture/execute/20050316-3.x: New file. Add -Wno-psabi.
4139
+ * gcc.c-torture/execute/pr23135.x: Likewise.
4141
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4143
+ Backport from mainline:
4144
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4146
+ * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
4148
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4150
+ Backport from mainline:
4151
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4153
+ * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
4155
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4157
+ Backport from mainline:
4158
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4160
+ * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
4162
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
4164
+ * gcc.dg/stack-usage-2.c: Adjust.
4166
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
4168
+ Backport from trunk.
4170
+ * gfortran.dg/dependency_44.f90 : New test
4172
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
4174
+ * gnat.dg/opt39.adb: New test.
4176
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
4180
+ * gfortran.dg/allocatable_function_8.f90 : New test
4182
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
4184
+ PR tree-optimization/61684
4185
+ * gcc.c-torture/compile/pr61684.c: New test.
4187
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
4188
+ Fritz Reese <Reese-Fritz@zai.com>
4190
+ * gfortran.dg/oldstyle_5.f: New test.
4192
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
4194
+ Backport from mainline
4195
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
4197
+ PR tree-optimization/61306
4198
+ * gcc.c-torture/execute/pr61306-1.c: New test.
4199
+ * gcc.c-torture/execute/pr61306-2.c: Likewise.
4200
+ * gcc.c-torture/execute/pr61306-3.c: Likewise.
4202
+2014-06-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4204
+ * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
4206
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
4208
+ Backport from mainline
4209
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
4212
+ * gcc.target/alpha/pr61586.c: New test.
4214
+2014-06-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4216
+ * gfortran.dg/default_format_denormal_2.f90: Remove xfail for
4217
+ powerpc*-*-linux*.
4219
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
4221
+ Backport from mainline
4222
+ 2014-06-13 Ilya Enkovich <ilya.enkovich@intel.com>
4224
+ PR rtl-optimization/61094
4225
+ PR rtl-optimization/61446
4226
+ * gcc.target/i386/pr61446.c : New.
4228
+ Backport from mainline
4229
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
4232
+ * gcc.target/i386/pr61423.c: New test.
4234
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
4236
+ Backport from mainline
4239
+ * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
4240
+ * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
4241
+ * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
4242
+ * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
4244
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
4246
+ Backport from trunk.
4248
+ * gfortran.dg/cray_pointers_10.f90: New file.
4250
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
4252
+ Backport from mainline
4254
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
4256
+ * lib/target-supports.exp (check_effective_target_longdouble128): New.
4257
+ * gcc.target/powerpc/pack02.c: Use it.
4258
+ * gcc.target/powerpc/tfmode_off.c: Likewise.
4260
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
4262
+ Backport from 2014-06-12 trunk r211491
4265
+ * gcc.target/avr/torture/pr61443.c: New test.
4267
+2014-06-04 Richard Biener <rguenther@suse.de>
4269
+ PR tree-optimization/61383
4270
+ * gcc.dg/torture/pr61383-1.c: New testcase.
4272
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
4274
+ Backport from mainline
4275
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
4277
+ PR rtl-optimization/60866
4278
+ * gcc.dg/pr60866.c: New test.
4280
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
4282
+ Backport from mainline
4283
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
4285
+ PR rtl-optimization/60901
4286
+ * gcc.target/i386/pr60901.c: New test.
4288
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
4290
+ Backport from mainline
4291
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
4293
+ * gnat.dg/overflow_fixed.adb: New test.
4295
+2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
4297
+ * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
4299
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
4301
+ Backport from mainline
4302
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
4304
+ * gcc.target/powerpc/htm-ttest.c: New test.
4306
2014-05-22 Release Manager
4308
* GCC 4.8.3 released.
4309
Index: gcc/testsuite/g++.dg/expr/cond12.C
4310
===================================================================
4311
--- a/src/gcc/testsuite/g++.dg/expr/cond12.C (.../tags/gcc_4_8_3_release)
4312
+++ b/src/gcc/testsuite/g++.dg/expr/cond12.C (.../branches/gcc-4_8-branch)
4318
+ X& operator=(const X&){}
4319
+ X& operator=(X&){__builtin_abort();}
4322
+int main(int argv,char**) {
4324
+ ((argv > 2) ? a : b) = X();
4326
Index: gcc/testsuite/g++.dg/init/const9.C
4327
===================================================================
4328
--- a/src/gcc/testsuite/g++.dg/init/const9.C (.../tags/gcc_4_8_3_release)
4329
+++ b/src/gcc/testsuite/g++.dg/init/const9.C (.../branches/gcc-4_8-branch)
4332
-// { dg-final { scan-assembler-not "rodata" } }
4333
+// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
4337
Index: gcc/testsuite/g++.dg/parse/typename7.C
4338
===================================================================
4339
--- a/src/gcc/testsuite/g++.dg/parse/typename7.C (.../tags/gcc_4_8_3_release)
4340
+++ b/src/gcc/testsuite/g++.dg/parse/typename7.C (.../branches/gcc-4_8-branch)
4345
- template<typename> void foo(int); // { dg-message "note" }
4346
- template<typename T> void bar(T t) { // { dg-message "note" }
4347
+ template<typename> void foo(int);
4348
+ template<typename T> void bar(T t) {
4349
this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4350
- // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
4351
template<typename T> void bad(T t) {
4352
foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4357
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4358
- // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
4360
B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
4362
Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
4363
===================================================================
4364
--- a/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../tags/gcc_4_8_3_release)
4365
+++ b/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../branches/gcc-4_8-branch)
4367
-void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
4368
+void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
4369
// { dg-prune-output "array bound" }
4370
Index: gcc/testsuite/g++.dg/parse/ambig7.C
4371
===================================================================
4372
--- a/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../tags/gcc_4_8_3_release)
4373
+++ b/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../branches/gcc-4_8-branch)
4379
+ Helper(int a, void (*pfunc)());
4382
+template <int I> void function();
4387
+Helper testOk(A, function<A>);
4388
+Helper testOk2(int(A), function<B>);
4389
+Helper testOk3((int(A)), function<A>);
4390
+Helper testFail(int(A), function<A>);
4391
Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
4392
===================================================================
4393
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../tags/gcc_4_8_3_release)
4394
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../branches/gcc-4_8-branch)
4396
# This must be done after the compat-use-*-compiler definitions.
4399
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
4400
+load_lib g++-dg.exp
4404
# Save variables for the C++ compiler under test, which each test will
4405
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
4406
===================================================================
4407
--- a/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../tags/gcc_4_8_3_release)
4408
+++ b/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../branches/gcc-4_8-branch)
4411
+// { dg-do compile { target c++11 } }
4413
+template <class Coord> struct BasePoint
4416
+ constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
4418
+template <class T> struct BaseCoord
4421
+ constexpr BaseCoord (T) : value (1) {}
4423
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
4425
+ typedef BaseCoord Super;
4426
+ constexpr IntCoordTyped (int) : Super (0) {}
4428
+template <class units>
4429
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
4431
+ typedef BasePoint<IntCoordTyped<units> > Super;
4432
+ constexpr IntPointTyped (int, int) : Super (0, 0) {}
4437
+IntPointTyped<A> a (0, 0);
4438
Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
4439
===================================================================
4440
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../tags/gcc_4_8_3_release)
4441
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../branches/gcc-4_8-branch)
4444
+// { dg-do compile { target c++11 } }
4448
+template <typename>
4450
+ typedef const char* name;
4453
+template <typename VT, typename... Fields>
4454
+void New(const char* name,
4455
+ typename Fixed<Fields>::name... field_names);
4457
+template <typename VT, typename... Fields>
4458
+void CreateMetric(const char* name,
4459
+ typename Fixed<Fields>::name... field_names,
4465
+ CreateMetric<int, const char*>("abcd", "def", Base());
4467
Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
4468
===================================================================
4469
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../tags/gcc_4_8_3_release)
4470
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../branches/gcc-4_8-branch)
4473
+// { dg-do compile { target c++11 } }
4475
+template <typename _CharT> class A;
4476
+template <typename> class B;
4477
+template <class charT> class C;
4478
+template <> class C<char>
4480
+ virtual void xparse (int &, const B<A<char> > &) const;
4482
+template <class T, class charT = char> class G : C<charT>
4486
+ void default_value (const T &);
4487
+ void xparse (int &, const B<A<charT> > &) const;
4489
+template <class T, class charT>
4490
+void validate (int &, const B<A<charT> > &, T *, int);
4491
+template <class T, class charT>
4492
+void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
4494
+ validate (p1, p2, (T *)0, 0);
4496
+template <class T> G<T> *value (T *) { return new G<T>(0); }
4499
+template <typename T> struct D;
4500
+template <typename, int, int, int = 0, int = 0, int = 0 > class F;
4501
+template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
4503
+struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
4505
+ typedef _Scalar Scalar;
4507
+template <typename, int, int, int, int, int _MaxCols> class F
4510
+ typedef typename Eigen::D<F>::Scalar Scalar;
4511
+ F (const Scalar &, const Scalar &, const Scalar &);
4513
+template <class... T>
4514
+void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
4516
+int main (int, char *[])
4518
+ Eigen::F<double, 3, 1> a (0, 0, 0);
4519
+ value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
4521
Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
4522
===================================================================
4523
--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../tags/gcc_4_8_3_release)
4524
+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../branches/gcc-4_8-branch)
4527
+// { dg-do compile { target c++11 } }
4530
+ X& operator=(const X&) = delete;
4531
+ X& operator=(X&& ) = default;
4536
+ *(t ? &a : &b) = X();
4537
+ (t ? a : b) = X();
4539
Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
4540
===================================================================
4541
--- a/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../tags/gcc_4_8_3_release)
4542
+++ b/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../branches/gcc-4_8-branch)
4545
+// { dg-options "-std=c++11" }
4549
+void f(X&&); // { dg-message "void f" }
4553
+ operator const X&() const;
4559
+ f(w); // { dg-error "lvalue" }
4561
Index: gcc/testsuite/g++.dg/ipa/pr62015.C
4562
===================================================================
4563
--- a/src/gcc/testsuite/g++.dg/ipa/pr62015.C (.../tags/gcc_4_8_3_release)
4564
+++ b/src/gcc/testsuite/g++.dg/ipa/pr62015.C (.../branches/gcc-4_8-branch)
4566
+/* { dg-do run } */
4567
+/* { dg-options "-O3 -std=c++11" } */
4570
+extern "C" int printf(const char *fmt, ...);
4571
+extern "C" void abort(void);
4574
+ enum _Value { Left, Right, Invalid };
4576
+ constexpr Side() : _value(Invalid) {}
4577
+ constexpr Side(_Value value) : _value(value) {}
4578
+ operator _Value() const { return (_Value)_value; }
4586
+ void adjust(Side side, bool final);
4587
+ void move(Side side);
4592
+ adjust(Side::Invalid, false);
4595
+static void __attribute__((noinline))
4596
+check (int v, int final)
4603
+__attribute__((noinline))
4604
+void A::adjust(Side side, bool final)
4606
+ check ((int)side, final);
4609
+void A::move(Side side)
4611
+ adjust(side, false);
4612
+ adjust(side, true);
4618
+ t.move(Side::Left);
4621
Index: gcc/testsuite/g++.dg/template/local-fn1.C
4622
===================================================================
4623
--- a/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../tags/gcc_4_8_3_release)
4624
+++ b/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../branches/gcc-4_8-branch)
4628
+template <typename T = int>
4634
Index: gcc/testsuite/g++.dg/template/conv14.C
4635
===================================================================
4636
--- a/src/gcc/testsuite/g++.dg/template/conv14.C (.../tags/gcc_4_8_3_release)
4637
+++ b/src/gcc/testsuite/g++.dg/template/conv14.C (.../branches/gcc-4_8-branch)
4643
+template<typename Container, typename Key>
4646
+template<typename Container, typename Key, typename KeyStore = Key>
4652
+ Variant(Container st, const Key& i) : index(i), state(st) {}
4654
+ template<typename T>
4655
+ operator T() const {
4656
+ return Accessor<Container, KeyStore>::template get<T>(state, index);
4660
+class AutoCleanVariant : public Variant<XX*, int> {
4662
+ AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
4664
+ template<typename T>
4665
+ operator T() const {
4666
+ return Variant<XX*, int>::operator T();
4669
Index: gcc/testsuite/g++.dg/template/friend55.C
4670
===================================================================
4671
--- a/src/gcc/testsuite/g++.dg/template/friend55.C (.../tags/gcc_4_8_3_release)
4672
+++ b/src/gcc/testsuite/g++.dg/template/friend55.C (.../branches/gcc-4_8-branch)
4676
+template <int I> struct A;
4677
+template <int I> class B {
4679
+ template <int A_S> friend void A<A_S>::impl();
4683
+template<int I>struct A { void impl(); };
4686
+template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
4692
Index: gcc/testsuite/g++.dg/template/memclass5.C
4693
===================================================================
4694
--- a/src/gcc/testsuite/g++.dg/template/memclass5.C (.../tags/gcc_4_8_3_release)
4695
+++ b/src/gcc/testsuite/g++.dg/template/memclass5.C (.../branches/gcc-4_8-branch)
4699
+template <typename T>
4702
+ template <typename U>
4705
+ typedef T result2;
4708
+ typedef y<int> zy;
4715
+ typedef double result2;
4720
+ x<int>::zy::result2 xxx;
4721
+ x<int>::y<int>::result2 xxx2;
4723
Index: gcc/testsuite/g++.dg/template/ptrmem27.C
4724
===================================================================
4725
--- a/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../tags/gcc_4_8_3_release)
4726
+++ b/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../branches/gcc-4_8-branch)
4734
+ int foo(int X::* ptr);
4736
+ template <int X::* ptr>
4740
+int X::foo(int X::* ptr) {
4741
+ int* p = &(this->*ptr); // OK.
4745
+template <int X::* ptr>
4747
+ int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
4750
Index: gcc/cp/tree.c
4751
===================================================================
4752
--- a/src/gcc/cp/tree.c (.../tags/gcc_4_8_3_release)
4753
+++ b/src/gcc/cp/tree.c (.../branches/gcc-4_8-branch)
4756
return lvalue_kind (TREE_OPERAND (ref, 0));
4759
+ case DOTSTAR_EXPR:
4760
+ if (TREE_CODE (ref) == MEMBER_REF)
4761
+ op1_lvalue_kind = clk_ordinary;
4763
+ op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
4764
+ if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
4765
+ op1_lvalue_kind = clk_none;
4766
+ return op1_lvalue_kind;
4769
op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
4770
/* Look at the member designator. */
4771
@@ -3738,6 +3748,10 @@
4773
init_expr = get_target_expr (exp);
4774
exp = TARGET_EXPR_SLOT (init_expr);
4775
+ if (CLASS_TYPE_P (TREE_TYPE (exp)))
4778
+ exp = rvalue (exp);
4782
Index: gcc/cp/ChangeLog
4783
===================================================================
4784
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_8_3_release)
4785
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_8-branch)
4787
+2014-08-07 Jason Merrill <jason@redhat.com>
4790
+ * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
4793
+ * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
4795
+2014-01-27 Jason Merrill <jason@redhat.com>
4799
+ * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
4800
+ list-initialization. A conversion to rvalue ref that involves
4801
+ an lvalue-rvalue conversion is bad.
4802
+ (convert_like_real): Give helpful error message.
4804
+2014-01-29 Jason Merrill <jason@redhat.com>
4807
+ * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
4808
+ have a friend template in a class template.
4809
+ * pt.c (tsubst_friend_function): Look through it.
4810
+ (push_template_decl_real): A friend member template is
4813
+2014-02-21 Jason Merrill <jason@redhat.com>
4816
+ * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
4817
+ of the partial instantiation, not the most general template.
4818
+ (maybe_process_partial_specialization): Reassign everything on
4821
+2014-03-05 Jason Merrill <jason@redhat.com>
4824
+ * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
4825
+ if re-parsing might succeed.
4826
+ * semantics.c (finish_id_expression): Use of a parameter outside
4827
+ the function body is a parse error.
4829
+2014-06-30 Jason Merrill <jason@redhat.com>
4832
+ * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
4835
+ * pt.c (unify_one_argument): Type/expression mismatch just causes
4836
+ deduction failure.
4839
+ * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
4841
+2014-06-17 Jason Merrill <jason@redhat.com>
4844
+ * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
4846
+2014-06-02 Jason Merrill <jason@redhat.com>
4849
+ * pt.c (pack_deducible_p): Handle canonicalization.
4851
2014-05-22 Release Manager
4853
* GCC 4.8.3 released.
4855
===================================================================
4856
--- a/src/gcc/cp/pt.c (.../tags/gcc_4_8_3_release)
4857
+++ b/src/gcc/cp/pt.c (.../branches/gcc-4_8-branch)
4858
@@ -907,11 +907,13 @@
4859
t; t = TREE_CHAIN (t))
4861
tree inst = TREE_VALUE (t);
4862
- if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
4863
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
4864
+ || !COMPLETE_OR_OPEN_TYPE_P (inst))
4866
/* We already have a full specialization of this partial
4867
- instantiation. Reassign it to the new member
4868
- specialization template. */
4869
+ instantiation, or a full specialization has been
4870
+ looked up but not instantiated. Reassign it to the
4871
+ new member specialization template. */
4879
- else if (COMPLETE_OR_OPEN_TYPE_P (inst))
4881
/* But if we've had an implicit instantiation, that's a
4882
problem ([temp.expl.spec]/6). */
4883
error ("specialization %qT after instantiation %qT",
4884
@@ -4308,7 +4310,8 @@
4885
in the template-parameter-list of the definition of a member of a
4888
- if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
4889
+ if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
4890
+ || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
4891
/* You can't have a function template declaration in a local
4892
scope, nor you can you define a member of a class template in a
4894
@@ -4572,7 +4575,8 @@
4895
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
4897
/* See if this is a primary template. */
4898
- if (is_friend && ctx)
4899
+ if (is_friend && ctx
4900
+ && uses_template_parms_level (ctx, processing_template_decl))
4901
/* A friend template that specifies a class context, i.e.
4902
template <typename T> friend void A<T>::f();
4904
@@ -7454,7 +7458,7 @@
4907
/* Let's consider the explicit specialization of a member
4908
- of a class template specialization that is implicitely instantiated,
4909
+ of a class template specialization that is implicitly instantiated,
4913
@@ -7552,9 +7556,9 @@
4915
/* Note this use of the partial instantiation so we can check it
4916
later in maybe_process_partial_specialization. */
4917
- DECL_TEMPLATE_INSTANTIATIONS (templ)
4918
+ DECL_TEMPLATE_INSTANTIATIONS (found)
4919
= tree_cons (arglist, t,
4920
- DECL_TEMPLATE_INSTANTIATIONS (templ));
4921
+ DECL_TEMPLATE_INSTANTIATIONS (found));
4923
if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
4924
/* Now that the type has been registered on the instantiations
4925
@@ -8289,10 +8293,17 @@
4927
if (COMPLETE_TYPE_P (context))
4929
+ tree fn = new_friend;
4930
+ /* do_friend adds the TEMPLATE_DECL for any member friend
4931
+ template even if it isn't a member template, i.e.
4932
+ template <class T> friend A<T>::f();
4933
+ Look through it in that case. */
4934
+ if (TREE_CODE (fn) == TEMPLATE_DECL
4935
+ && !PRIMARY_TEMPLATE_P (fn))
4936
+ fn = DECL_TEMPLATE_RESULT (fn);
4937
/* Check to see that the declaration is really present, and,
4938
possibly obtain an improved declaration. */
4939
- tree fn = check_classfn (context,
4940
- new_friend, NULL_TREE);
4941
+ fn = check_classfn (context, fn, NULL_TREE);
4945
@@ -14934,7 +14945,7 @@
4947
for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
4948
packs; packs = TREE_CHAIN (packs))
4949
- if (TREE_VALUE (packs) == parm)
4950
+ if (template_args_equal (TREE_VALUE (packs), parm))
4952
/* The template parameter pack is used in a function parameter
4953
pack. If this is the end of the parameter list, the
4954
@@ -15502,8 +15513,9 @@
4955
maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
4958
- gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
4959
- == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
4960
+ if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
4961
+ != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
4962
+ return unify_template_argument_mismatch (explain_p, parm, arg);
4964
/* For deduction from an init-list we need the actual list. */
4965
if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
4966
@@ -20009,7 +20021,12 @@
4969
if (BASELINK_P (expression))
4970
- expression = BASELINK_FUNCTIONS (expression);
4972
+ if (BASELINK_OPTYPE (expression)
4973
+ && dependent_type_p (BASELINK_OPTYPE (expression)))
4975
+ expression = BASELINK_FUNCTIONS (expression);
4978
if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
4980
Index: gcc/cp/semantics.c
4981
===================================================================
4982
--- a/src/gcc/cp/semantics.c (.../tags/gcc_4_8_3_release)
4983
+++ b/src/gcc/cp/semantics.c (.../branches/gcc-4_8-branch)
4984
@@ -3108,7 +3108,7 @@
4985
&& DECL_CONTEXT (decl) == NULL_TREE
4986
&& !cp_unevaluated_operand)
4988
- error ("use of parameter %qD outside function body", decl);
4989
+ *error_msg = "use of parameter outside function body";
4990
return error_mark_node;
4993
@@ -7296,7 +7296,9 @@
4994
constructor_elt *inner = base_field_constructor_elt (n, ce->index);
4997
- else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
4998
+ else if (ce->index
4999
+ && (TREE_CODE (ce->index) == NOP_EXPR
5000
+ || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
5002
/* This is an initializer for an empty base; now that we've
5003
checked that it's constant, we can ignore it. */
5004
Index: gcc/cp/parser.c
5005
===================================================================
5006
--- a/src/gcc/cp/parser.c (.../tags/gcc_4_8_3_release)
5007
+++ b/src/gcc/cp/parser.c (.../branches/gcc-4_8-branch)
5008
@@ -12831,7 +12831,12 @@
5009
the effort required to do the parse, nor will we issue duplicate
5010
error messages about problems during instantiation of the
5014
+ /* Don't do this if we had a parse error in a declarator; re-parsing
5015
+ might succeed if a name changes meaning (60361). */
5016
+ && !(cp_parser_error_occurred (parser)
5017
+ && cp_parser_parsing_tentatively (parser)
5018
+ && parser->in_declarator_p))
5020
cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
5022
Index: gcc/cp/call.c
5023
===================================================================
5024
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_3_release)
5025
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
5026
@@ -1464,7 +1464,7 @@
5028
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
5029
conv = implicit_conversion (to, from, expr, c_cast_p,
5031
+ flags|LOOKUP_NO_TEMP_BIND, complain);
5032
if (!CLASS_TYPE_P (to)
5033
&& CONSTRUCTOR_NELTS (expr) == 1)
5035
@@ -1624,9 +1624,9 @@
5039
- Otherwise, the reference shall be to a non-volatile const type.
5041
- Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
5042
+ Otherwise, the reference shall be an lvalue reference to a
5043
+ non-volatile const type, or the reference shall be an rvalue
5045
if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
5048
@@ -1664,7 +1664,16 @@
5049
/* This reference binding, unlike those above, requires the
5050
creation of a temporary. */
5051
conv->need_temporary_p = true;
5052
- conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
5053
+ if (TYPE_REF_IS_RVALUE (rto))
5055
+ conv->rvaluedness_matches_p = 1;
5056
+ /* In the second case, if the reference is an rvalue reference and
5057
+ the second standard conversion sequence of the user-defined
5058
+ conversion sequence includes an lvalue-to-rvalue conversion, the
5059
+ program is ill-formed. */
5060
+ if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
5066
@@ -5811,7 +5820,7 @@
5067
&& convs->kind != ck_list
5068
&& convs->kind != ck_ambig
5069
&& (convs->kind != ck_ref_bind
5070
- || convs->user_conv_p)
5071
+ || (convs->user_conv_p && next_conversion (convs)->bad_p))
5072
&& (convs->kind != ck_rvalue
5073
|| SCALAR_TYPE_P (totype))
5074
&& convs->kind != ck_base)
5075
@@ -6110,7 +6119,8 @@
5076
if (convs->bad_p && !next_conversion (convs)->bad_p)
5078
gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
5079
- && real_lvalue_p (expr));
5080
+ && (real_lvalue_p (expr)
5081
+ || next_conversion(convs)->kind == ck_rvalue));
5083
error_at (loc, "cannot bind %qT lvalue to %qT",
5084
TREE_TYPE (expr), totype);
5085
Index: gcc/cp/friend.c
5086
===================================================================
5087
--- a/src/gcc/cp/friend.c (.../tags/gcc_4_8_3_release)
5088
+++ b/src/gcc/cp/friend.c (.../branches/gcc-4_8-branch)
5089
@@ -502,7 +502,13 @@
5090
? current_template_parms
5093
- if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
5094
+ if ((template_member_p
5095
+ /* Always pull out the TEMPLATE_DECL if we have a friend
5096
+ template in a class template so that it gets tsubsted
5097
+ properly later on (59956). tsubst_friend_function knows
5098
+ how to tell this apart from a member template. */
5099
+ || (class_template_depth && friend_depth))
5100
+ && decl && TREE_CODE (decl) == FUNCTION_DECL)
5101
decl = DECL_TI_TEMPLATE (decl);
5104
Index: gcc/haifa-sched.c
5105
===================================================================
5106
--- a/src/gcc/haifa-sched.c (.../tags/gcc_4_8_3_release)
5107
+++ b/src/gcc/haifa-sched.c (.../branches/gcc-4_8-branch)
5108
@@ -2931,7 +2931,7 @@
5110
advance_state (curr_state);
5111
if (sched_verbose >= 6)
5112
- fprintf (sched_dump, ";;\tAdvanced a state.\n");
5113
+ fprintf (sched_dump, ";;\tAdvance the current state.\n");
5116
/* Update register pressure after scheduling INSN. */
5117
@@ -5964,6 +5964,7 @@
5118
modulo_insns_scheduled = 0;
5120
ls.modulo_epilogue = false;
5121
+ ls.first_cycle_insn_p = true;
5123
/* Loop until all the insns in BB are scheduled. */
5124
while ((*current_sched_info->schedule_more_p) ())
5125
@@ -6034,7 +6035,6 @@
5129
- ls.first_cycle_insn_p = true;
5130
ls.shadows_only_p = false;
5131
cycle_issued_insns = 0;
5132
ls.can_issue_more = issue_rate;
5133
@@ -6321,11 +6321,13 @@
5137
+ ls.first_cycle_insn_p = true;
5139
if (ls.modulo_epilogue)
5142
- advance_one_cycle ();
5143
+ if (!ls.first_cycle_insn_p)
5144
+ advance_one_cycle ();
5145
perform_replacements_new_cycle ();
5148
Index: gcc/double-int.c
5149
===================================================================
5150
--- a/src/gcc/double-int.c (.../tags/gcc_4_8_3_release)
5151
+++ b/src/gcc/double-int.c (.../branches/gcc-4_8-branch)
5153
== (unsigned HOST_WIDE_INT) htwice)
5154
&& (labs_den <= ltwice)))
5158
/* quo = quo - 1; */
5159
add_double (*lquo, *hquo,
5160
(HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
5161
Index: gcc/tree-ssa-math-opts.c
5162
===================================================================
5163
--- a/src/gcc/tree-ssa-math-opts.c (.../tags/gcc_4_8_3_release)
5164
+++ b/src/gcc/tree-ssa-math-opts.c (.../branches/gcc-4_8-branch)
5165
@@ -1537,7 +1537,7 @@
5167
struct symbolic_number {
5168
unsigned HOST_WIDEST_INT n;
5173
/* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
5174
@@ -1549,13 +1549,15 @@
5175
struct symbolic_number *n,
5178
+ int bitsize = TYPE_PRECISION (n->type);
5183
/* Zero out the extra bits of N in order to avoid them being shifted
5184
into the significant bits. */
5185
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5186
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
5187
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5188
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5192
@@ -1563,20 +1565,24 @@
5196
+ /* Arithmetic shift of signed type: result is dependent on the value. */
5197
+ if (!TYPE_UNSIGNED (n->type)
5198
+ && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
5203
- n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
5204
+ n->n = (n->n << count) | (n->n >> (bitsize - count));
5207
- n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
5208
+ n->n = (n->n >> count) | (n->n << (bitsize - count));
5213
/* Zero unused bits for size. */
5214
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5215
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
5216
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5217
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5221
@@ -1593,7 +1599,7 @@
5222
if (TREE_CODE (lhs_type) != INTEGER_TYPE)
5225
- if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
5226
+ if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
5230
@@ -1650,20 +1656,25 @@
5231
to initialize the symbolic number. */
5236
/* Set up the symbolic number N by setting each byte to a
5237
value between 1 and the byte size of rhs1. The highest
5238
order byte is set to n->size and the lowest order
5240
- n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
5241
- if (n->size % BITS_PER_UNIT != 0)
5242
+ n->type = TREE_TYPE (rhs1);
5243
+ size = TYPE_PRECISION (n->type);
5244
+ if (size % BITS_PER_UNIT != 0)
5246
- n->size /= BITS_PER_UNIT;
5247
+ if (size > HOST_BITS_PER_WIDEST_INT)
5249
+ size /= BITS_PER_UNIT;
5250
n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
5251
(unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
5253
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5254
+ if (size < (int)sizeof (HOST_WIDEST_INT))
5255
n->n &= ((unsigned HOST_WIDEST_INT)1 <<
5256
- (n->size * BITS_PER_UNIT)) - 1;
5257
+ (size * BITS_PER_UNIT)) - 1;
5259
source_expr1 = rhs1;
5261
@@ -1672,12 +1683,12 @@
5266
+ int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
5267
unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
5268
unsigned HOST_WIDEST_INT tmp = val;
5270
/* Only constants masking full bytes are allowed. */
5271
- for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
5272
+ for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
5273
if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
5276
@@ -1693,12 +1704,24 @@
5281
+ int type_size, old_type_size;
5284
- type_size = TYPE_PRECISION (gimple_expr_type (stmt));
5285
+ type = gimple_expr_type (stmt);
5286
+ type_size = TYPE_PRECISION (type);
5287
if (type_size % BITS_PER_UNIT != 0)
5289
+ if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
5292
+ /* Sign extension: result is dependent on the value. */
5293
+ old_type_size = TYPE_PRECISION (n->type);
5294
+ if (!TYPE_UNSIGNED (n->type)
5295
+ && type_size > old_type_size
5297
+ ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
5300
if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
5302
/* If STMT casts to a smaller type mask out the bits not
5303
@@ -1705,7 +1728,7 @@
5304
belonging to the target type. */
5305
n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
5307
- n->size = type_size / BITS_PER_UNIT;
5312
@@ -1718,7 +1741,7 @@
5314
if (rhs_class == GIMPLE_BINARY_RHS)
5318
struct symbolic_number n1, n2;
5319
unsigned HOST_WIDEST_INT mask;
5321
@@ -1742,11 +1765,12 @@
5322
source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
5324
if (source_expr1 != source_expr2
5325
- || n1.size != n2.size)
5326
+ || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
5329
- n->size = n1.size;
5330
- for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
5331
+ n->type = n1.type;
5332
+ size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
5333
+ for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
5335
unsigned HOST_WIDEST_INT masked1, masked2;
5337
@@ -1785,7 +1809,7 @@
5339
struct symbolic_number n;
5342
+ int limit, bitsize;
5344
/* The last parameter determines the depth search limit. It usually
5345
correlates directly to the number of bytes to be touched. We
5346
@@ -1800,13 +1824,14 @@
5349
/* Zero out the extra bits of N and CMP. */
5350
- if (n.size < (int)sizeof (HOST_WIDEST_INT))
5351
+ bitsize = TYPE_PRECISION (n.type);
5352
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5354
unsigned HOST_WIDEST_INT mask =
5355
- ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
5356
+ ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5359
- cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
5360
+ cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
5363
/* A complete byte swap should make the symbolic number to start
5364
@@ -1828,7 +1853,7 @@
5365
bool changed = false;
5366
tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
5368
- if (BITS_PER_UNIT != 8)
5369
+ if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
5372
if (sizeof (HOST_WIDEST_INT) < 8)
5374
===================================================================
5375
--- a/src/gcc/ifcvt.c (.../tags/gcc_4_8_3_release)
5376
+++ b/src/gcc/ifcvt.c (.../branches/gcc-4_8-branch)
5377
@@ -294,6 +294,28 @@
5379
return (e) ? e->dest : NULL_BLOCK;
5382
+/* Return true if RTXs A and B can be safely interchanged. */
5385
+rtx_interchangeable_p (const_rtx a, const_rtx b)
5387
+ if (!rtx_equal_p (a, b))
5390
+ if (GET_CODE (a) != MEM)
5393
+ /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
5394
+ reference is not. Interchanging a dead type-unsafe memory reference with
5395
+ a live type-safe one creates a live type-unsafe memory reference, in other
5396
+ words, it makes the program illegal.
5397
+ We check here conservatively whether the two memory references have equal
5398
+ memory attributes. */
5400
+ return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
5404
/* Go through a bunch of insns, converting them to conditional
5405
execution format if possible. Return TRUE if all of the non-note
5406
@@ -1014,6 +1036,9 @@
5407
|| (rtx_equal_p (if_info->a, XEXP (cond, 1))
5408
&& rtx_equal_p (if_info->b, XEXP (cond, 0))))
5410
+ if (!rtx_interchangeable_p (if_info->a, if_info->b))
5413
y = (code == EQ) ? if_info->a : if_info->b;
5415
/* Avoid generating the move if the source is the destination. */
5416
@@ -2483,7 +2508,7 @@
5418
|| insn_b != last_active_insn (else_bb, FALSE)
5419
|| (set_b = single_set (insn_b)) == NULL_RTX
5420
- || ! rtx_equal_p (x, SET_DEST (set_b)))
5421
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
5425
@@ -2496,7 +2521,7 @@
5426
|| BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
5427
|| !NONJUMP_INSN_P (insn_b)
5428
|| (set_b = single_set (insn_b)) == NULL_RTX
5429
- || ! rtx_equal_p (x, SET_DEST (set_b))
5430
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b))
5431
|| ! noce_operand_ok (SET_SRC (set_b))
5432
|| reg_overlap_mentioned_p (x, SET_SRC (set_b))
5433
|| modified_between_p (SET_SRC (set_b), insn_b, jump)
5434
@@ -2562,7 +2587,7 @@
5436
/* Look and see if A and B are really the same. Avoid creating silly
5437
cmove constructs that no one will fix up later. */
5438
- if (rtx_equal_p (a, b))
5439
+ if (rtx_interchangeable_p (a, b))
5441
/* If we have an INSN_B, we don't have to create any new rtl. Just
5442
move the instruction that we already have. If we don't have an
5443
Index: gcc/dwarf2out.c
5444
===================================================================
5445
--- a/src/gcc/dwarf2out.c (.../tags/gcc_4_8_3_release)
5446
+++ b/src/gcc/dwarf2out.c (.../branches/gcc-4_8-branch)
5447
@@ -12234,7 +12234,7 @@
5448
op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
5449
VAR_INIT_STATUS_INITIALIZED);
5453
add_loc_descr (&mem_loc_result, op1);
5454
add_loc_descr (&mem_loc_result,
5455
new_loc_descr (DW_OP_plus, 0, 0));
5457
===================================================================
5458
--- a/src/gcc/expr.c (.../tags/gcc_4_8_3_release)
5459
+++ b/src/gcc/expr.c (.../branches/gcc-4_8-branch)
5460
@@ -10603,7 +10603,7 @@
5461
|| !host_integerp (TREE_OPERAND (offset, 1), 1)
5462
|| compare_tree_int (TREE_OPERAND (offset, 1),
5463
BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
5464
- || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
5465
+ || exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
5468
/* Look at the first operand of BIT_AND_EXPR and strip any conversion.
5469
Index: gcc/ada/socket.c
5470
===================================================================
5471
--- a/src/gcc/ada/socket.c (.../tags/gcc_4_8_3_release)
5472
+++ b/src/gcc/ada/socket.c (.../branches/gcc-4_8-branch)
5477
-#if defined(__linux__) || defined(__GLIBC__)
5478
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
5479
(void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
5481
rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
5482
Index: gcc/ada/ChangeLog
5483
===================================================================
5484
--- a/src/gcc/ada/ChangeLog (.../tags/gcc_4_8_3_release)
5485
+++ b/src/gcc/ada/ChangeLog (.../branches/gcc-4_8-branch)
5487
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
5489
+ * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
5490
+ * gsocket.h Add include of <unistd.h> on RTEMS.
5492
+2014-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
5494
+ * s-osinte-rtems.adb: Correct formatting of line in license block.
5496
2014-05-22 Release Manager
5498
* GCC 4.8.3 released.
5499
Index: gcc/ada/s-osinte-rtems.adb
5500
===================================================================
5501
--- a/src/gcc/ada/s-osinte-rtems.adb (.../tags/gcc_4_8_3_release)
5502
+++ b/src/gcc/ada/s-osinte-rtems.adb (.../branches/gcc-4_8-branch)
5504
-- You should have received a copy of the GNU General Public License and --
5505
-- a copy of the GCC Runtime Library Exception along with this program; --
5506
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
5507
--- <http://www.gnu.org/licenses/>.
5508
+-- <http://www.gnu.org/licenses/>. --
5510
-- GNARL was developed by the GNARL team at Florida State University. It is --
5511
-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
5512
Index: gcc/ada/gsocket.h
5513
===================================================================
5514
--- a/src/gcc/ada/gsocket.h (.../tags/gcc_4_8_3_release)
5515
+++ b/src/gcc/ada/gsocket.h (.../branches/gcc-4_8-branch)
5516
@@ -183,6 +183,11 @@
5517
#include <sys/time.h>
5520
+#if defined(__rtems__)
5521
+#include <unistd.h>
5522
+/* Required, for read(), write(), and close() */
5526
* RTEMS has these .h files but not until you have built and installed RTEMS.
5527
* When building a C/C++ toolset, you also build the newlib C library, so the
5528
Index: gcc/tree-ssa-ifcombine.c
5529
===================================================================
5530
--- a/src/gcc/tree-ssa-ifcombine.c (.../tags/gcc_4_8_3_release)
5531
+++ b/src/gcc/tree-ssa-ifcombine.c (.../branches/gcc-4_8-branch)
5532
@@ -105,7 +105,11 @@
5534
gimple stmt = gsi_stmt (gsi);
5536
+ if (is_gimple_debug (stmt))
5539
if (gimple_has_side_effects (stmt)
5540
+ || gimple_could_trap_p (stmt)
5541
|| gimple_vuse (stmt))
5545
while (is_gimple_assign (stmt)
5546
&& ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
5547
&& (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
5548
- <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
5549
+ <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
5550
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
5551
|| gimple_assign_ssa_name_copy_p (stmt)))
5552
stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
5554
Index: gcc/sel-sched-ir.c
5555
===================================================================
5556
--- a/src/gcc/sel-sched-ir.c (.../tags/gcc_4_8_3_release)
5557
+++ b/src/gcc/sel-sched-ir.c (.../branches/gcc-4_8-branch)
5559
static void free_av_set (basic_block);
5560
static void invalidate_av_set (basic_block);
5561
static void extend_insn_data (void);
5562
-static void sel_init_new_insn (insn_t, int);
5563
+static void sel_init_new_insn (insn_t, int, int = -1);
5564
static void finish_insns (void);
5566
/* Various list functions. */
5567
@@ -4011,9 +4011,10 @@
5571
-/* Compute seqno for INSN by its preds or succs. */
5572
+/* Compute seqno for INSN by its preds or succs. Use OLD_SEQNO to compute
5573
+ seqno in corner cases. */
5575
-get_seqno_for_a_jump (insn_t insn)
5576
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
5580
@@ -4069,8 +4070,16 @@
5582
seqno = get_seqno_by_succs (insn);
5586
+ /* The only case where this could be here legally is that the only
5587
+ unscheduled insn was a conditional jump that got removed and turned
5588
+ into this unconditional one. Initialize from the old seqno
5589
+ of that jump passed down to here. */
5590
+ seqno = old_seqno;
5593
gcc_assert (seqno >= 0);
5598
@@ -4250,22 +4259,24 @@
5601
/* This is used to initialize spurious jumps generated by
5602
- sel_redirect_edge (). */
5603
+ sel_redirect_edge (). OLD_SEQNO is used for initializing seqnos
5604
+ in corner cases within get_seqno_for_a_jump. */
5606
-init_simplejump_data (insn_t insn)
5607
+init_simplejump_data (insn_t insn, int old_seqno)
5609
init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
5610
REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
5611
vNULL, true, false, false,
5613
- INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
5614
+ INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
5615
init_first_time_insn_data (insn);
5618
/* Perform deferred initialization of insns. This is used to process
5619
- a new jump that may be created by redirect_edge. */
5621
-sel_init_new_insn (insn_t insn, int flags)
5622
+ a new jump that may be created by redirect_edge. OLD_SEQNO is used
5623
+ for initializing simplejumps in init_simplejump_data. */
5625
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
5627
/* We create data structures for bb when the first insn is emitted in it. */
5629
@@ -4292,7 +4303,7 @@
5630
if (flags & INSN_INIT_TODO_SIMPLEJUMP)
5632
extend_insn_data ();
5633
- init_simplejump_data (insn);
5634
+ init_simplejump_data (insn, old_seqno);
5637
gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
5638
@@ -5578,8 +5589,7 @@
5641
/* A wrapper for redirect_edge_and_branch_force, which also initializes
5642
- data structures for possibly created bb and insns. Returns the newly
5643
- added bb or NULL, when a bb was not needed. */
5644
+ data structures for possibly created bb and insns. */
5646
sel_redirect_edge_and_branch_force (edge e, basic_block to)
5648
@@ -5586,6 +5596,7 @@
5649
basic_block jump_bb, src, orig_dest = e->dest;
5652
+ int old_seqno = -1;
5654
/* This function is now used only for bookkeeping code creation, where
5655
we'll never get the single pred of orig_dest block and thus will not
5656
@@ -5594,8 +5605,13 @@
5657
&& !single_pred_p (orig_dest));
5659
prev_max_uid = get_max_uid ();
5660
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
5661
+ when the conditional jump being redirected may become unconditional. */
5662
+ if (any_condjump_p (BB_END (src))
5663
+ && INSN_SEQNO (BB_END (src)) >= 0)
5664
+ old_seqno = INSN_SEQNO (BB_END (src));
5666
jump_bb = redirect_edge_and_branch_force (e, to);
5668
if (jump_bb != NULL)
5669
sel_add_bb (jump_bb);
5671
@@ -5607,7 +5623,8 @@
5673
jump = find_new_jump (src, jump_bb, prev_max_uid);
5675
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
5676
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
5678
set_immediate_dominator (CDI_DOMINATORS, to,
5679
recompute_dominator (CDI_DOMINATORS, to));
5680
set_immediate_dominator (CDI_DOMINATORS, orig_dest,
5681
@@ -5626,6 +5643,7 @@
5683
bool recompute_toporder_p = false;
5684
bool maybe_unreachable = single_pred_p (orig_dest);
5685
+ int old_seqno = -1;
5687
latch_edge_p = (pipelining_p
5688
&& current_loop_nest
5689
@@ -5634,6 +5652,12 @@
5691
prev_max_uid = get_max_uid ();
5693
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
5694
+ when the conditional jump being redirected may become unconditional. */
5695
+ if (any_condjump_p (BB_END (src))
5696
+ && INSN_SEQNO (BB_END (src)) >= 0)
5697
+ old_seqno = INSN_SEQNO (BB_END (src));
5699
redirected = redirect_edge_and_branch (e, to);
5701
gcc_assert (redirected && !last_added_blocks.exists ());
5702
@@ -5654,7 +5678,7 @@
5704
jump = find_new_jump (src, NULL, prev_max_uid);
5706
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
5707
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
5709
/* Only update dominator info when we don't have unreachable blocks.
5710
Otherwise we'll update in maybe_tidy_empty_bb. */
5711
Index: gcc/fortran/interface.c
5712
===================================================================
5713
--- a/src/gcc/fortran/interface.c (.../tags/gcc_4_8_3_release)
5714
+++ b/src/gcc/fortran/interface.c (.../branches/gcc-4_8-branch)
5715
@@ -1923,7 +1923,7 @@
5716
/* F2008, 12.5.2.5; IR F08/0073. */
5717
if (formal->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL
5718
&& ((CLASS_DATA (formal)->attr.class_pointer
5719
- && !formal->attr.intent == INTENT_IN)
5720
+ && formal->attr.intent != INTENT_IN)
5721
|| CLASS_DATA (formal)->attr.allocatable))
5723
if (actual->ts.type != BT_CLASS)
5724
Index: gcc/fortran/trans-expr.c
5725
===================================================================
5726
--- a/src/gcc/fortran/trans-expr.c (.../tags/gcc_4_8_3_release)
5727
+++ b/src/gcc/fortran/trans-expr.c (.../branches/gcc-4_8-branch)
5728
@@ -7096,7 +7096,7 @@
5730
res_desc = gfc_evaluate_now (desc, &se->pre);
5731
gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
5732
- se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
5733
+ se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
5735
/* Free the lhs after the function call and copy the result data to
5736
the lhs descriptor. */
5737
Index: gcc/fortran/decl.c
5738
===================================================================
5739
--- a/src/gcc/fortran/decl.c (.../tags/gcc_4_8_3_release)
5740
+++ b/src/gcc/fortran/decl.c (.../branches/gcc-4_8-branch)
5741
@@ -1996,6 +1996,13 @@
5742
if (gfc_notify_std (GFC_STD_GNU, "Old-style "
5743
"initialization at %C") == FAILURE)
5745
+ else if (gfc_current_state () == COMP_DERIVED)
5747
+ gfc_error ("Invalid old style initialization for derived type "
5748
+ "component at %C");
5753
return match_old_style_init (name);
5755
Index: gcc/fortran/ChangeLog
5756
===================================================================
5757
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
5758
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
5760
+2014-09-03 Marek Polacek <polacek@redhat.com>
5762
+ Backport from trunk
5764
+ * interface.c (compare_parameter): Fix condition.
5766
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
5768
+ Backport from trunk
5770
+ * gfortran.dg/array_assignment_5.f90: New test.
5772
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
5774
+ Backport from trunk
5776
+ * simplify.c (gfc_simplify_dot_product): Convert types of
5777
+ vectors before calculating the result.
5779
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
5781
+ Backport from trunk.
5783
+ * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
5784
+ that elements are skipped. This then correctly aligns 'reverse'
5785
+ with the scalarizer loops.
5787
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
5791
+ * trans-expr.c (fcncall_realloc_result): Use the natural type
5792
+ for the address expression of 'res_desc'.
5794
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
5795
+ Fritz Reese <Reese-Fritz@zai.com>
5797
+ * decl.c (variable_decl): Reject old style initialization
5798
+ for derived type components.
5800
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
5802
+ Backport from trunk.
5804
+ * trans-decl.c (gfc_create_module_variable): Don't create
5805
+ Cray-pointee decls twice.
5807
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
5809
+ Backport from mainline
5810
+ PR libfortran/61310
5811
+ * intrinsics.texi (CTIME): Remove mention of locale-dependent
5814
2014-05-22 Release Manager
5816
* GCC 4.8.3 released.
5817
Index: gcc/fortran/frontend-passes.c
5818
===================================================================
5819
--- a/src/gcc/fortran/frontend-passes.c (.../tags/gcc_4_8_3_release)
5820
+++ b/src/gcc/fortran/frontend-passes.c (.../branches/gcc-4_8-branch)
5821
@@ -874,6 +874,10 @@
5825
+ case INTRINSIC_CONCAT:
5826
+ /* Do not do string concatenations. */
5830
/* Binary operators. */
5831
if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
5832
Index: gcc/fortran/trans-decl.c
5833
===================================================================
5834
--- a/src/gcc/fortran/trans-decl.c (.../tags/gcc_4_8_3_release)
5835
+++ b/src/gcc/fortran/trans-decl.c (.../branches/gcc-4_8-branch)
5836
@@ -4084,8 +4084,8 @@
5839
/* Don't generate variables from other modules. Variables from
5840
- COMMONs will already have been generated. */
5841
- if (sym->attr.use_assoc || sym->attr.in_common)
5842
+ COMMONs and Cray pointees will already have been generated. */
5843
+ if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
5846
/* Equivalenced variables arrive here after creation. */
5847
Index: gcc/fortran/dependency.c
5848
===================================================================
5849
--- a/src/gcc/fortran/dependency.c (.../tags/gcc_4_8_3_release)
5850
+++ b/src/gcc/fortran/dependency.c (.../branches/gcc-4_8-branch)
5851
@@ -1779,6 +1779,7 @@
5852
gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
5856
gfc_dependency fin_dep;
5857
gfc_dependency this_dep;
5859
@@ -1828,6 +1829,8 @@
5863
+ /* Index for the reverse array. */
5865
for (n=0; n < lref->u.ar.dimen; n++)
5867
/* Assume dependency when either of array reference is vector
5868
@@ -1862,31 +1865,37 @@
5869
The ability to reverse or not is set by previous conditions
5870
in this dimension. If reversal is not activated, the
5871
value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */
5873
+ /* Get the indexing right for the scalarizing loop. If this
5874
+ is an element, there is no corresponding loop. */
5875
+ if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
5878
if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
5879
&& lref->u.ar.dimen_type[n] == DIMEN_RANGE)
5881
/* Set reverse if backward dependence and not inhibited. */
5882
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
5883
- reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
5884
- GFC_REVERSE_SET : reverse[n];
5885
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
5886
+ reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
5887
+ GFC_REVERSE_SET : reverse[m];
5889
/* Set forward if forward dependence and not inhibited. */
5890
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
5891
- reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
5892
- GFC_FORWARD_SET : reverse[n];
5893
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
5894
+ reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
5895
+ GFC_FORWARD_SET : reverse[m];
5897
/* Flag up overlap if dependence not compatible with
5898
the overall state of the expression. */
5899
- if (reverse && reverse[n] == GFC_REVERSE_SET
5900
+ if (reverse && reverse[m] == GFC_REVERSE_SET
5901
&& this_dep == GFC_DEP_FORWARD)
5903
- reverse[n] = GFC_INHIBIT_REVERSE;
5904
+ reverse[m] = GFC_INHIBIT_REVERSE;
5905
this_dep = GFC_DEP_OVERLAP;
5907
- else if (reverse && reverse[n] == GFC_FORWARD_SET
5908
+ else if (reverse && reverse[m] == GFC_FORWARD_SET
5909
&& this_dep == GFC_DEP_BACKWARD)
5911
- reverse[n] = GFC_INHIBIT_REVERSE;
5912
+ reverse[m] = GFC_INHIBIT_REVERSE;
5913
this_dep = GFC_DEP_OVERLAP;
5916
@@ -1893,7 +1902,7 @@
5917
/* If no intention of reversing or reversing is explicitly
5918
inhibited, convert backward dependence to overlap. */
5919
if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
5920
- || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
5921
+ || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
5922
this_dep = GFC_DEP_OVERLAP;
5925
Index: gcc/fortran/simplify.c
5926
===================================================================
5927
--- a/src/gcc/fortran/simplify.c (.../tags/gcc_4_8_3_release)
5928
+++ b/src/gcc/fortran/simplify.c (.../branches/gcc-4_8-branch)
5929
@@ -1877,6 +1877,9 @@
5931
gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
5936
if (!is_constant_array_expr (vector_a)
5937
|| !is_constant_array_expr (vector_b))
5939
@@ -1883,8 +1886,14 @@
5941
gcc_assert (vector_a->rank == 1);
5942
gcc_assert (vector_b->rank == 1);
5943
- gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
5945
+ temp.expr_type = EXPR_OP;
5946
+ gfc_clear_ts (&temp.ts);
5947
+ temp.value.op.op = INTRINSIC_NONE;
5948
+ temp.value.op.op1 = vector_a;
5949
+ temp.value.op.op2 = vector_b;
5950
+ gfc_type_convert_binary (&temp, 1);
5952
return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
5955
Index: gcc/function.c
5956
===================================================================
5957
--- a/src/gcc/function.c (.../tags/gcc_4_8_3_release)
5958
+++ b/src/gcc/function.c (.../branches/gcc-4_8-branch)
5959
@@ -1354,9 +1354,13 @@
5960
#define STACK_POINTER_OFFSET 0
5963
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
5964
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
5967
/* If not defined, pick an appropriate default for the offset of dynamically
5968
allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
5969
- REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
5970
+ INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
5972
#ifndef STACK_DYNAMIC_OFFSET
5974
@@ -1368,12 +1372,12 @@
5975
`crtl->outgoing_args_size'. Nevertheless, we must allow
5976
for it when allocating stack dynamic objects. */
5978
-#if defined(REG_PARM_STACK_SPACE)
5979
+#ifdef INCOMING_REG_PARM_STACK_SPACE
5980
#define STACK_DYNAMIC_OFFSET(FNDECL) \
5981
((ACCUMULATE_OUTGOING_ARGS \
5982
? (crtl->outgoing_args_size \
5983
+ (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
5984
- : REG_PARM_STACK_SPACE (FNDECL))) \
5985
+ : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
5986
: 0) + (STACK_POINTER_OFFSET))
5988
#define STACK_DYNAMIC_OFFSET(FNDECL) \
5989
@@ -2211,8 +2215,9 @@
5991
all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
5993
-#ifdef REG_PARM_STACK_SPACE
5994
- all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
5995
+#ifdef INCOMING_REG_PARM_STACK_SPACE
5996
+ all->reg_parm_stack_space
5997
+ = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
6001
@@ -4518,6 +4523,7 @@
6002
/* ??? This could be set on a per-function basis by the front-end
6003
but is this worth the hassle? */
6004
cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
6005
+ cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
6009
Index: gcc/tree-vectorizer.h
6010
===================================================================
6011
--- a/src/gcc/tree-vectorizer.h (.../tags/gcc_4_8_3_release)
6012
+++ b/src/gcc/tree-vectorizer.h (.../branches/gcc-4_8-branch)
6014
#define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped
6016
#define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
6017
-(L)->may_misalign_stmts.length () > 0
6018
+((L)->may_misalign_stmts.length () > 0)
6019
#define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \
6020
-(L)->may_alias_ddrs.length () > 0
6021
+((L)->may_alias_ddrs.length () > 0)
6023
#define NITERS_KNOWN_P(n) \
6024
(host_integerp ((n),0) \
6025
Index: gcc/tree-vect-loop.c
6026
===================================================================
6027
--- a/src/gcc/tree-vect-loop.c (.../tags/gcc_4_8_3_release)
6028
+++ b/src/gcc/tree-vect-loop.c (.../branches/gcc-4_8-branch)
6029
@@ -2205,7 +2205,8 @@
6032
def1 = SSA_NAME_DEF_STMT (op1);
6033
- if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
6034
+ if (gimple_bb (def1)
6035
+ && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
6037
&& flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
6038
&& is_gimple_assign (def1))
6039
Index: gcc/emit-rtl.c
6040
===================================================================
6041
--- a/src/gcc/emit-rtl.c (.../tags/gcc_4_8_3_release)
6042
+++ b/src/gcc/emit-rtl.c (.../branches/gcc-4_8-branch)
6045
/* Return true if the given memory attributes are equal. */
6049
mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
6051
return (p->alias == q->alias
6052
Index: gcc/gimple-fold.c
6053
===================================================================
6054
--- a/src/gcc/gimple-fold.c (.../tags/gcc_4_8_3_release)
6055
+++ b/src/gcc/gimple-fold.c (.../branches/gcc-4_8-branch)
6056
@@ -2955,8 +2955,8 @@
6058
if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
6059
/* VIEW_CONVERT_EXPR is defined only for matching sizes. */
6060
- && operand_equal_p (TYPE_SIZE (type),
6061
- TYPE_SIZE (TREE_TYPE (ctor)), 0))
6062
+ && !compare_tree_int (TYPE_SIZE (type), size)
6063
+ && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
6065
ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
6066
ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
6067
Index: gcc/emit-rtl.h
6068
===================================================================
6069
--- a/src/gcc/emit-rtl.h (.../tags/gcc_4_8_3_release)
6070
+++ b/src/gcc/emit-rtl.h (.../branches/gcc-4_8-branch)
6072
#ifndef GCC_EMIT_RTL_H
6073
#define GCC_EMIT_RTL_H
6075
+/* Return whether two MEM_ATTRs are equal. */
6076
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
6078
/* Set the alias set of MEM to SET. */
6079
extern void set_mem_alias_set (rtx, alias_set_type);
6081
Index: gcc/common.opt
6082
===================================================================
6083
--- a/src/gcc/common.opt (.../tags/gcc_4_8_3_release)
6084
+++ b/src/gcc/common.opt (.../branches/gcc-4_8-branch)
6085
@@ -1226,6 +1226,10 @@
6086
Common Report Var(flag_tm)
6087
Enable support for GNU transactional memory
6090
+Common Report Var(flag_gnu_unique) Init(1)
6091
+Use STB_GNU_UNIQUE if supported by the assembler
6095
Does nothing. Preserved for backward compatibility.
6096
Index: gcc/tree-vect-patterns.c
6097
===================================================================
6098
--- a/src/gcc/tree-vect-patterns.c (.../tags/gcc_4_8_3_release)
6099
+++ b/src/gcc/tree-vect-patterns.c (.../branches/gcc-4_8-branch)
6103
oprnd00 = gimple_assign_rhs1 (def_stmt);
6104
- if (!type_conversion_p (oprnd0, stmt, true, &half_type1, &def_stmt,
6105
+ if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt,
6109
Index: gcc/sched-deps.c
6110
===================================================================
6111
--- a/src/gcc/sched-deps.c (.../tags/gcc_4_8_3_release)
6112
+++ b/src/gcc/sched-deps.c (.../branches/gcc-4_8-branch)
6113
@@ -2744,7 +2744,8 @@
6114
Consider for instance a volatile asm that changes the fpu rounding
6115
mode. An insn should not be moved across this even if it only uses
6116
pseudo-regs because it might give an incorrectly rounded result. */
6117
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
6118
+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
6119
+ && !DEBUG_INSN_P (insn))
6120
reg_pending_barrier = TRUE_BARRIER;
6122
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
6123
Index: gcc/config/alpha/elf.h
6124
===================================================================
6125
--- a/src/gcc/config/alpha/elf.h (.../tags/gcc_4_8_3_release)
6126
+++ b/src/gcc/config/alpha/elf.h (.../branches/gcc-4_8-branch)
6127
@@ -126,6 +126,10 @@
6128
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
6129
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
6131
+/* This variable should be set to 'true' if the target ABI requires
6132
+ unwinding tables even when exceptions are not used. */
6133
+#define TARGET_UNWIND_TABLES_DEFAULT true
6135
/* Select a format to encode pointers in exception handling data. CODE
6136
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
6137
true if the symbol may be affected by dynamic relocations.
6138
Index: gcc/config/alpha/alpha.c
6139
===================================================================
6140
--- a/src/gcc/config/alpha/alpha.c (.../tags/gcc_4_8_3_release)
6141
+++ b/src/gcc/config/alpha/alpha.c (.../branches/gcc-4_8-branch)
6142
@@ -8658,6 +8658,11 @@
6147
+ /* __builtin_unreachable can expand to no code at all,
6148
+ leaving (barrier) RTXes in the instruction stream. */
6149
+ goto close_shadow_notrapb;
6154
@@ -8673,6 +8678,7 @@
6155
n = emit_insn_before (gen_trapb (), i);
6156
PUT_MODE (n, TImode);
6157
PUT_MODE (i, TImode);
6158
+ close_shadow_notrapb:
6162
Index: gcc/config/elfos.h
6163
===================================================================
6164
--- a/src/gcc/config/elfos.h (.../tags/gcc_4_8_3_release)
6165
+++ b/src/gcc/config/elfos.h (.../branches/gcc-4_8-branch)
6167
/* Write the extra assembler code needed to declare an object properly. */
6169
#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
6170
-#define USE_GNU_UNIQUE_OBJECT 1
6171
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
6173
#define USE_GNU_UNIQUE_OBJECT 0
6175
Index: gcc/config/sparc/sync.md
6176
===================================================================
6177
--- a/src/gcc/config/sparc/sync.md (.../tags/gcc_4_8_3_release)
6178
+++ b/src/gcc/config/sparc/sync.md (.../branches/gcc-4_8-branch)
6181
[(set_attr "type" "multi")])
6183
+;; For LEON3, STB has the effect of membar #StoreLoad.
6184
+(define_insn "*membar_storeload_leon3"
6185
+ [(set (match_operand:BLK 0 "" "")
6186
+ (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
6188
+ "stb\t%%g0, [%%sp-1]"
6189
+ [(set_attr "type" "store")])
6191
;; For V8, LDSTUB has the effect of membar #StoreLoad.
6192
(define_insn "*membar_storeload"
6193
[(set (match_operand:BLK 0 "" "")
6194
(unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
6196
+ "TARGET_V8 && !TARGET_LEON3"
6197
"ldstub\t[%%sp-1], %%g0"
6198
[(set_attr "type" "multi")])
6200
Index: gcc/config/i386/i386.md
6201
===================================================================
6202
--- a/src/gcc/config/i386/i386.md (.../tags/gcc_4_8_3_release)
6203
+++ b/src/gcc/config/i386/i386.md (.../branches/gcc-4_8-branch)
6204
@@ -5339,66 +5339,37 @@
6206
;; Avoid store forwarding (partial memory) stall penalty by extending
6207
;; SImode value to DImode through XMM register instead of pushing two
6208
-;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
6209
-;; targets benefit from this optimization. Also note that fild
6210
-;; loads from memory only.
6211
+;; SImode values to stack. Also note that fild loads from memory only.
6213
-(define_insn "*floatunssi<mode>2_1"
6214
- [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
6215
+(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
6216
+ [(set (match_operand:X87MODEF 0 "register_operand" "=f")
6217
(unsigned_float:X87MODEF
6218
- (match_operand:SI 1 "nonimmediate_operand" "x,m")))
6219
- (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
6220
- (clobber (match_scratch:SI 3 "=X,x"))]
6221
+ (match_operand:SI 1 "nonimmediate_operand" "rm")))
6222
+ (clobber (match_scratch:DI 3 "=x"))
6223
+ (clobber (match_operand:DI 2 "memory_operand" "=m"))]
6225
&& TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6227
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
6229
+ "&& reload_completed"
6230
+ [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
6231
+ (set (match_dup 2) (match_dup 3))
6232
+ (set (match_dup 0)
6233
+ (float:X87MODEF (match_dup 2)))]
6235
[(set_attr "type" "multi")
6236
(set_attr "mode" "<MODE>")])
6239
- [(set (match_operand:X87MODEF 0 "register_operand")
6240
- (unsigned_float:X87MODEF
6241
- (match_operand:SI 1 "register_operand")))
6242
- (clobber (match_operand:DI 2 "memory_operand"))
6243
- (clobber (match_scratch:SI 3))]
6245
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6247
- && reload_completed"
6248
- [(set (match_dup 2) (match_dup 1))
6249
- (set (match_dup 0)
6250
- (float:X87MODEF (match_dup 2)))]
6251
- "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
6254
- [(set (match_operand:X87MODEF 0 "register_operand")
6255
- (unsigned_float:X87MODEF
6256
- (match_operand:SI 1 "memory_operand")))
6257
- (clobber (match_operand:DI 2 "memory_operand"))
6258
- (clobber (match_scratch:SI 3))]
6260
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6262
- && reload_completed"
6263
- [(set (match_dup 2) (match_dup 3))
6264
- (set (match_dup 0)
6265
- (float:X87MODEF (match_dup 2)))]
6267
- emit_move_insn (operands[3], operands[1]);
6268
- operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
6271
(define_expand "floatunssi<mode>2"
6273
[(set (match_operand:X87MODEF 0 "register_operand")
6274
(unsigned_float:X87MODEF
6275
(match_operand:SI 1 "nonimmediate_operand")))
6276
- (clobber (match_dup 2))
6277
- (clobber (match_scratch:SI 3))])]
6278
+ (clobber (match_scratch:DI 3))
6279
+ (clobber (match_dup 2))])]
6281
&& ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6283
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
6284
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
6286
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
6287
Index: gcc/config/i386/driver-i386.c
6288
===================================================================
6289
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_8_3_release)
6290
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_8-branch)
6291
@@ -713,6 +713,11 @@
6292
/* Assume Core 2. */
6295
+ else if (has_longmode)
6296
+ /* Perhaps some emulator? Assume x86-64, otherwise gcc
6297
+ -march=native would be unusable for 64-bit compilations,
6298
+ as all the CPUs below are 32-bit only. */
6301
/* It is Core Duo. */
6303
Index: gcc/config/i386/i386.c
6304
===================================================================
6305
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_4_8_3_release)
6306
+++ b/src/gcc/config/i386/i386.c (.../branches/gcc-4_8-branch)
6307
@@ -20505,7 +20505,7 @@
6308
t1 = gen_reg_rtx (V32QImode);
6309
t2 = gen_reg_rtx (V32QImode);
6310
t3 = gen_reg_rtx (V32QImode);
6311
- vt2 = GEN_INT (128);
6312
+ vt2 = GEN_INT (-128);
6313
for (i = 0; i < 32; i++)
6315
vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
6316
@@ -24640,13 +24640,17 @@
6320
- /* Assume that region is SCC, i.e. all immediate predecessors
6321
- of non-head block are in the same region. */
6323
+ /* Regions are SCCs with the exception of selective
6324
+ scheduling with pipelining of outer blocks enabled.
6325
+ So also check that immediate predecessors of a non-head
6326
+ block are in the same region. */
6327
FOR_EACH_EDGE (e, ei, bb->preds)
6329
/* Avoid creating of loop-carried dependencies through
6330
- using topological odering in region. */
6331
- if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
6332
+ using topological ordering in the region. */
6333
+ if (rgn == CONTAINING_RGN (e->src->index)
6334
+ && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
6335
add_dependee_for_func_arg (first_arg, e->src);
6338
Index: gcc/config/sh/sh.c
6339
===================================================================
6340
--- a/src/gcc/config/sh/sh.c (.../tags/gcc_4_8_3_release)
6341
+++ b/src/gcc/config/sh/sh.c (.../branches/gcc-4_8-branch)
6342
@@ -808,6 +808,12 @@
6343
targetm.asm_out.aligned_op.di = NULL;
6344
targetm.asm_out.unaligned_op.di = NULL;
6347
+ /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
6348
+ Disable it for everything else. */
6349
+ if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
6350
+ TARGET_USERMODE = false;
6354
if (! strcmp (sh_div_str, "call-div1"))
6355
Index: gcc/config/sh/sh.opt
6356
===================================================================
6357
--- a/src/gcc/config/sh/sh.opt (.../tags/gcc_4_8_3_release)
6358
+++ b/src/gcc/config/sh/sh.opt (.../branches/gcc-4_8-branch)
6360
Cost to assume for a multiply insn
6363
-Target Report RejectNegative Var(TARGET_USERMODE)
6364
+Target Var(TARGET_USERMODE)
6365
Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
6367
;; We might want to enable this by default for TARGET_HARD_SH4, because
6368
Index: gcc/config/microblaze/predicates.md
6369
===================================================================
6370
--- a/src/gcc/config/microblaze/predicates.md (.../tags/gcc_4_8_3_release)
6371
+++ b/src/gcc/config/microblaze/predicates.md (.../branches/gcc-4_8-branch)
6373
(ior (match_operand 0 "const_0_operand")
6374
(match_operand 0 "register_operand")))
6376
-(define_predicate "reg_or_mem_operand"
6377
- (ior (match_operand 0 "memory_operand")
6378
- (match_operand 0 "register_operand")))
6380
;; Return if the operand is either the PC or a label_ref.
6381
(define_special_predicate "pc_or_label_operand"
6382
(ior (match_code "pc,label_ref")
6383
Index: gcc/config/microblaze/microblaze.md
6384
===================================================================
6385
--- a/src/gcc/config/microblaze/microblaze.md (.../tags/gcc_4_8_3_release)
6386
+++ b/src/gcc/config/microblaze/microblaze.md (.../branches/gcc-4_8-branch)
6387
@@ -1119,18 +1119,6 @@
6391
-;;Load and store reverse
6392
-(define_insn "movsi4_rev"
6393
- [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
6394
- (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
6399
- [(set_attr "type" "load,store")
6400
- (set_attr "mode" "SI")
6401
- (set_attr "length" "4,4")])
6403
;; 32-bit floating point moves
6405
(define_expand "movsf"
6406
Index: gcc/config/avr/avr-fixed.md
6407
===================================================================
6408
--- a/src/gcc/config/avr/avr-fixed.md (.../tags/gcc_4_8_3_release)
6409
+++ b/src/gcc/config/avr/avr-fixed.md (.../branches/gcc-4_8-branch)
6413
// Input and output of the libgcc function
6414
- const unsigned int regno_in[] = { -1, 22, 22, -1, 18 };
6415
- const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
6416
+ const unsigned int regno_in[] = { -1U, 22, 22, -1U, 18 };
6417
+ const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
6419
operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
6420
operands[4] = gen_rtx_REG (<MODE>mode, regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
6421
Index: gcc/config/avr/avr.md
6422
===================================================================
6423
--- a/src/gcc/config/avr/avr.md (.../tags/gcc_4_8_3_release)
6424
+++ b/src/gcc/config/avr/avr.md (.../branches/gcc-4_8-branch)
6425
@@ -367,6 +367,15 @@
6430
+ // Avoid (subreg (mem)) for non-generic address spaces below. Because
6431
+ // of the poor addressing capabilities of these spaces it's better to
6432
+ // load them in one chunk. And it avoids PR61443.
6434
+ if (MEM_P (operands[0])
6435
+ && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
6436
+ operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
6438
for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
6440
rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
6441
Index: gcc/config/avr/avr.h
6442
===================================================================
6443
--- a/src/gcc/config/avr/avr.h (.../tags/gcc_4_8_3_release)
6444
+++ b/src/gcc/config/avr/avr.h (.../branches/gcc-4_8-branch)
6445
@@ -250,18 +250,18 @@
6446
#define REG_CLASS_CONTENTS { \
6447
{0x00000000,0x00000000}, /* NO_REGS */ \
6448
{0x00000001,0x00000000}, /* R0_REG */ \
6449
- {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
6450
- {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
6451
- {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
6452
+ {3u << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
6453
+ {3u << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
6454
+ {3u << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
6455
{0x00000000,0x00000003}, /* STACK_REG, STACK */ \
6456
- {(3 << REG_Y) | (3 << REG_Z), \
6457
+ {(3u << REG_Y) | (3u << REG_Z), \
6458
0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
6459
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
6460
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z), \
6461
0x00000000}, /* POINTER_REGS, r26 - r31 */ \
6462
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
6463
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W), \
6464
0x00000000}, /* ADDW_REGS, r24 - r31 */ \
6465
{0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
6466
- {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
6467
+ {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
6468
0x00000000}, /* LD_REGS, r16 - r31 */ \
6469
{0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
6470
{0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
6471
Index: gcc/config/aarch64/arm_neon.h
6472
===================================================================
6473
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
6474
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
6475
@@ -13815,7 +13815,7 @@
6477
__asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
6481
: /* No clobbers */);
6484
@@ -13837,7 +13837,7 @@
6486
__asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
6490
: /* No clobbers */);
6493
Index: gcc/config/aarch64/aarch64.md
6494
===================================================================
6495
--- a/src/gcc/config/aarch64/aarch64.md (.../tags/gcc_4_8_3_release)
6496
+++ b/src/gcc/config/aarch64/aarch64.md (.../branches/gcc-4_8-branch)
6497
@@ -3292,6 +3292,7 @@
6498
(unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
6500
(clobber (reg:DI LR_REGNUM))
6501
+ (clobber (reg:CC CC_REGNUM))
6502
(clobber (match_scratch:DI 1 "=r"))]
6504
"adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
6505
Index: gcc/config/aarch64/aarch64.c
6506
===================================================================
6507
--- a/src/gcc/config/aarch64/aarch64.c (.../tags/gcc_4_8_3_release)
6508
+++ b/src/gcc/config/aarch64/aarch64.c (.../branches/gcc-4_8-branch)
6509
@@ -1201,6 +1201,7 @@
6510
CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
6511
int ncrn, nvrn, nregs;
6512
bool allocate_ncrn, allocate_nvrn;
6513
+ HOST_WIDE_INT size;
6515
/* We need to do this once per argument. */
6516
if (pcum->aapcs_arg_processed)
6517
@@ -1208,6 +1209,11 @@
6519
pcum->aapcs_arg_processed = true;
6521
+ /* Size in bytes, rounded to the nearest multiple of 8 bytes. */
6523
+ = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
6526
allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
6527
allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
6529
@@ -1258,10 +1264,8 @@
6532
ncrn = pcum->aapcs_ncrn;
6533
- nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
6534
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
6535
+ nregs = size / UNITS_PER_WORD;
6538
/* C6 - C9. though the sign and zero extension semantics are
6539
handled elsewhere. This is the case where the argument fits
6540
entirely general registers. */
6541
@@ -1309,13 +1313,12 @@
6542
pcum->aapcs_nextncrn = NUM_ARG_REGS;
6544
/* The argument is passed on stack; record the needed number of words for
6545
- this argument (we can re-use NREGS) and align the total size if
6547
+ this argument and align the total size if necessary. */
6549
- pcum->aapcs_stack_words = nregs;
6550
+ pcum->aapcs_stack_words = size / UNITS_PER_WORD;
6551
if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
6552
pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
6553
- 16 / UNITS_PER_WORD) + 1;
6554
+ 16 / UNITS_PER_WORD);
6558
Index: gcc/config/aarch64/aarch64-linux.h
6559
===================================================================
6560
--- a/src/gcc/config/aarch64/aarch64-linux.h (.../tags/gcc_4_8_3_release)
6561
+++ b/src/gcc/config/aarch64/aarch64-linux.h (.../branches/gcc-4_8-branch)
6566
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
6568
#endif /* GCC_AARCH64_LINUX_H */
6569
Index: gcc/config/rs6000/constraints.md
6570
===================================================================
6571
--- a/src/gcc/config/rs6000/constraints.md (.../tags/gcc_4_8_3_release)
6572
+++ b/src/gcc/config/rs6000/constraints.md (.../branches/gcc-4_8-branch)
6574
(define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
6575
"If -mmfpgpr was used, a floating point register or NO_REGS.")
6577
+(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
6578
+ "Floating point register if direct moves are available, or NO_REGS.")
6580
+;; At present, DImode is not allowed in the Altivec registers. If in the
6581
+;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
6582
+(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
6583
+ "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
6585
+(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
6586
+ "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
6588
+(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
6589
+ "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
6591
(define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
6592
"Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
6595
"Floating point register if the STFIWX instruction is enabled or NO_REGS.")
6597
(define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
6598
- "VSX vector register to hold scalar float values or NO_REGS.")
6599
+ "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
6601
(define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
6602
"Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
6603
Index: gcc/config/rs6000/htm.md
6604
===================================================================
6605
--- a/src/gcc/config/rs6000/htm.md (.../tags/gcc_4_8_3_release)
6606
+++ b/src/gcc/config/rs6000/htm.md (.../branches/gcc-4_8-branch)
6609
UNSPECV_HTM_TABORTWCI))
6610
(set (subreg:CC (match_dup 2) 0) (match_dup 1))
6611
- (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
6612
+ (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
6613
(parallel [(set (match_operand:SI 0 "int_reg_operand" "")
6614
(and:SI (match_dup 3) (const_int 15)))
6615
(clobber (scratch:CC))])]
6616
Index: gcc/config/rs6000/freebsd64.h
6617
===================================================================
6618
--- a/src/gcc/config/rs6000/freebsd64.h (.../tags/gcc_4_8_3_release)
6619
+++ b/src/gcc/config/rs6000/freebsd64.h (.../branches/gcc-4_8-branch)
6621
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
6622
#undef ADJUST_FIELD_ALIGN
6623
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
6624
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
6625
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
6628
&& TARGET_ALIGN_NATURAL == 0 \
6629
Index: gcc/config/rs6000/rs6000-protos.h
6630
===================================================================
6631
--- a/src/gcc/config/rs6000/rs6000-protos.h (.../tags/gcc_4_8_3_release)
6632
+++ b/src/gcc/config/rs6000/rs6000-protos.h (.../branches/gcc-4_8-branch)
6636
extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
6637
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
6638
extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
6640
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
6642
extern rtx rs6000_libcall_value (enum machine_mode);
6643
extern rtx rs6000_va_arg (tree, tree);
6644
extern int function_ok_for_sibcall (tree);
6645
-extern int rs6000_reg_parm_stack_space (tree);
6646
+extern int rs6000_reg_parm_stack_space (tree, bool);
6647
extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
6648
extern bool rs6000_elf_in_small_data_p (const_tree);
6649
#ifdef ARGS_SIZE_RTX
6650
Index: gcc/config/rs6000/rs6000-builtin.def
6651
===================================================================
6652
--- a/src/gcc/config/rs6000/rs6000-builtin.def (.../tags/gcc_4_8_3_release)
6653
+++ b/src/gcc/config/rs6000/rs6000-builtin.def (.../branches/gcc-4_8-branch)
6654
@@ -622,20 +622,13 @@
6655
| RS6000_BTC_TERNARY), \
6656
CODE_FOR_ ## ICODE) /* ICODE */
6658
-/* Miscellaneous builtins. */
6659
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE) \
6660
+/* 128-bit long double floating point builtins. */
6661
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE) \
6662
RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
6663
"__builtin_" NAME, /* NAME */ \
6664
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
6665
+ (RS6000_BTM_HARD_FLOAT /* MASK */ \
6666
+ | RS6000_BTM_LDBL128), \
6667
(RS6000_BTC_ ## ATTR /* ATTR */ \
6668
- | RS6000_BTC_UNARY), \
6669
- CODE_FOR_ ## ICODE) /* ICODE */
6671
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE) \
6672
- RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
6673
- "__builtin_" NAME, /* NAME */ \
6674
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
6675
- (RS6000_BTC_ ## ATTR /* ATTR */ \
6676
| RS6000_BTC_BINARY), \
6677
CODE_FOR_ ## ICODE) /* ICODE */
6679
@@ -1593,10 +1586,8 @@
6680
BU_DFP_MISC_2 (PACK_TD, "pack_dec128", CONST, packtd)
6681
BU_DFP_MISC_2 (UNPACK_TD, "unpack_dec128", CONST, unpacktd)
6683
-BU_MISC_2 (PACK_TF, "pack_longdouble", CONST, packtf)
6684
-BU_MISC_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
6685
-BU_MISC_1 (UNPACK_TF_0, "longdouble_dw0", CONST, unpacktf_0)
6686
-BU_MISC_1 (UNPACK_TF_1, "longdouble_dw1", CONST, unpacktf_1)
6687
+BU_LDBL128_2 (PACK_TF, "pack_longdouble", CONST, packtf)
6688
+BU_LDBL128_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
6690
BU_P7_MISC_2 (PACK_V1TI, "pack_vector_int128", CONST, packv1ti)
6691
BU_P7_MISC_2 (UNPACK_V1TI, "unpack_vector_int128", CONST, unpackv1ti)
6692
Index: gcc/config/rs6000/linux64.h
6693
===================================================================
6694
--- a/src/gcc/config/rs6000/linux64.h (.../tags/gcc_4_8_3_release)
6695
+++ b/src/gcc/config/rs6000/linux64.h (.../branches/gcc-4_8-branch)
6697
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
6698
#undef ADJUST_FIELD_ALIGN
6699
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
6700
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
6701
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
6704
&& TARGET_ALIGN_NATURAL == 0 \
6705
Index: gcc/config/rs6000/rs6000.c
6706
===================================================================
6707
--- a/src/gcc/config/rs6000/rs6000.c (.../tags/gcc_4_8_3_release)
6708
+++ b/src/gcc/config/rs6000/rs6000.c (.../branches/gcc-4_8-branch)
6710
enum insn_code reload_gpr_vsx; /* INSN to move from GPR to VSX. */
6711
enum insn_code reload_vsx_gpr; /* INSN to move from VSX to GPR. */
6712
addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks. */
6713
+ bool scalar_in_vmx_p; /* Scalar value can go in VMX. */
6716
static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
6717
@@ -1704,8 +1705,7 @@
6719
if (TARGET_VSX && VSX_REGNO_P (regno)
6720
&& (VECTOR_MEM_VSX_P (mode)
6721
- || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
6722
- || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
6723
+ || reg_addr[mode].scalar_in_vmx_p
6724
|| (TARGET_VSX_TIMODE && mode == TImode)
6725
|| (TARGET_VADDUQM && mode == V1TImode)))
6727
@@ -1714,12 +1714,9 @@
6729
if (ALTIVEC_REGNO_P (regno))
6731
- if (mode == SFmode && !TARGET_UPPER_REGS_SF)
6732
+ if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
6735
- if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
6738
return ALTIVEC_REGNO_P (last_regno);
6741
@@ -1897,14 +1894,16 @@
6742
if (rs6000_vector_unit[m] != VECTOR_NONE
6743
|| rs6000_vector_mem[m] != VECTOR_NONE
6744
|| (reg_addr[m].reload_store != CODE_FOR_nothing)
6745
- || (reg_addr[m].reload_load != CODE_FOR_nothing))
6746
+ || (reg_addr[m].reload_load != CODE_FOR_nothing)
6747
+ || reg_addr[m].scalar_in_vmx_p)
6750
- " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
6751
+ " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
6752
rs6000_debug_vector_unit (rs6000_vector_unit[m]),
6753
rs6000_debug_vector_unit (rs6000_vector_mem[m]),
6754
(reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
6755
- (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
6756
+ (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
6757
+ (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
6760
fputs ("\n", stderr);
6761
@@ -2021,6 +2020,10 @@
6762
"wd reg_class = %s\n"
6763
"wf reg_class = %s\n"
6764
"wg reg_class = %s\n"
6765
+ "wh reg_class = %s\n"
6766
+ "wi reg_class = %s\n"
6767
+ "wj reg_class = %s\n"
6768
+ "wk reg_class = %s\n"
6769
"wl reg_class = %s\n"
6770
"wm reg_class = %s\n"
6771
"wr reg_class = %s\n"
6772
@@ -2040,6 +2043,10 @@
6773
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
6774
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
6775
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
6776
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
6777
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
6778
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
6779
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
6780
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
6781
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
6782
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
6783
@@ -2324,6 +2331,8 @@
6785
for (m = 0; m < NUM_MACHINE_MODES; ++m)
6787
+ enum machine_mode m2 = (enum machine_mode)m;
6789
/* SDmode is special in that we want to access it only via REG+REG
6790
addressing on power7 and above, since we want to use the LFIWZX and
6791
STFIWZX instructions to load it. */
6792
@@ -2358,13 +2367,12 @@
6795
&& (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
6796
- && GET_MODE_SIZE (m) <= 8
6797
- && !VECTOR_MODE_P (m)
6798
- && !COMPLEX_MODE_P (m)
6799
+ && GET_MODE_SIZE (m2) <= 8
6800
+ && !VECTOR_MODE_P (m2)
6801
+ && !COMPLEX_MODE_P (m2)
6803
- && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
6804
- && !(m == DFmode && TARGET_UPPER_REGS_DF)
6805
- && !(m == SFmode && TARGET_UPPER_REGS_SF))
6806
+ && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
6807
+ && !reg_addr[m2].scalar_in_vmx_p)
6809
addr_mask |= RELOAD_REG_PRE_INCDEC;
6811
@@ -2595,16 +2603,22 @@
6812
f - Register class to use with traditional SFmode instructions.
6813
v - Altivec register.
6814
wa - Any VSX register.
6815
+ wc - Reserved to represent individual CR bits (used in LLVM).
6816
wd - Preferred register class for V2DFmode.
6817
wf - Preferred register class for V4SFmode.
6818
wg - Float register for power6x move insns.
6819
+ wh - FP register for direct move instructions.
6820
+ wi - FP or VSX register to hold 64-bit integers for VSX insns.
6821
+ wj - FP or VSX register to hold 64-bit integers for direct moves.
6822
+ wk - FP or VSX register to hold 64-bit doubles for direct moves.
6823
wl - Float register if we can do 32-bit signed int loads.
6824
wm - VSX register for ISA 2.07 direct move operations.
6825
+ wn - always NO_REGS.
6826
wr - GPR if 64-bit mode is permitted.
6827
ws - Register class to do ISA 2.06 DF operations.
6828
+ wt - VSX register for TImode in VSX registers.
6829
wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
6830
wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
6831
- wt - VSX register for TImode in VSX registers.
6832
ww - Register class to do SF conversions in with VSX operations.
6833
wx - Float register if we can do 32-bit int stores.
6834
wy - Register class to do ISA 2.07 SF operations.
6835
@@ -2611,21 +2625,22 @@
6836
wz - Float register if we can do 32-bit unsigned int loads. */
6838
if (TARGET_HARD_FLOAT && TARGET_FPRS)
6839
- rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
6840
+ rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS; /* SFmode */
6842
if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
6843
- rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
6844
+ rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS; /* DFmode */
6848
rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
6849
- rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
6850
- rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
6851
+ rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS; /* V2DFmode */
6852
+ rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS; /* V4SFmode */
6853
+ rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS; /* DImode */
6855
if (TARGET_VSX_TIMODE)
6856
- rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
6857
+ rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS; /* TImode */
6859
- if (TARGET_UPPER_REGS_DF)
6860
+ if (TARGET_UPPER_REGS_DF) /* DFmode */
6862
rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
6863
rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
6864
@@ -2639,19 +2654,26 @@
6866
rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
6868
- if (TARGET_MFPGPR)
6869
+ if (TARGET_MFPGPR) /* DFmode */
6870
rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
6873
- rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
6874
+ rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS; /* DImode */
6876
if (TARGET_DIRECT_MOVE)
6877
- rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
6879
+ rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
6880
+ rs6000_constraints[RS6000_CONSTRAINT_wj] /* DImode */
6881
+ = rs6000_constraints[RS6000_CONSTRAINT_wi];
6882
+ rs6000_constraints[RS6000_CONSTRAINT_wk] /* DFmode */
6883
+ = rs6000_constraints[RS6000_CONSTRAINT_ws];
6884
+ rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
6887
if (TARGET_POWERPC64)
6888
rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
6890
- if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
6891
+ if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF) /* SFmode */
6893
rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
6894
rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
6895
@@ -2666,10 +2688,10 @@
6896
rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
6899
- rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
6900
+ rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS; /* DImode */
6903
- rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
6904
+ rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS; /* DImode */
6906
/* Set up the reload helper and direct move functions. */
6907
if (TARGET_VSX || TARGET_ALTIVEC)
6908
@@ -2692,10 +2714,11 @@
6909
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_di_load;
6910
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
6912
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
6913
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
6914
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
6915
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
6916
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
6917
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
6918
+ reg_addr[DFmode].scalar_in_vmx_p = true;
6919
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
6920
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
6922
if (TARGET_P8_VECTOR)
6924
@@ -2703,6 +2726,8 @@
6925
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_di_load;
6926
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_di_store;
6927
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_di_load;
6928
+ if (TARGET_UPPER_REGS_SF)
6929
+ reg_addr[SFmode].scalar_in_vmx_p = true;
6931
if (TARGET_VSX_TIMODE)
6933
@@ -2759,10 +2784,11 @@
6934
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_si_load;
6935
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
6937
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
6938
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
6939
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
6940
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
6941
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
6942
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
6943
+ reg_addr[DFmode].scalar_in_vmx_p = true;
6944
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
6945
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
6947
if (TARGET_P8_VECTOR)
6949
@@ -2770,6 +2796,8 @@
6950
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_si_load;
6951
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_si_store;
6952
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_si_load;
6953
+ if (TARGET_UPPER_REGS_SF)
6954
+ reg_addr[SFmode].scalar_in_vmx_p = true;
6956
if (TARGET_VSX_TIMODE)
6958
@@ -2810,6 +2838,7 @@
6960
for (m = 0; m < NUM_MACHINE_MODES; ++m)
6962
+ enum machine_mode m2 = (enum machine_mode)m;
6963
int reg_size2 = reg_size;
6965
/* TFmode/TDmode always takes 2 registers, even in VSX. */
6966
@@ -2818,7 +2847,7 @@
6967
reg_size2 = UNITS_PER_FP_WORD;
6969
rs6000_class_max_nregs[m][c]
6970
- = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
6971
+ = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
6975
@@ -3014,7 +3043,8 @@
6976
| ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0)
6977
| ((TARGET_HTM) ? RS6000_BTM_HTM : 0)
6978
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0)
6979
- | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0));
6980
+ | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0)
6981
+ | ((TARGET_LONG_DOUBLE_128) ? RS6000_BTM_LDBL128 : 0));
6984
/* Override command line options. Mostly we process the processor type and
6985
@@ -5861,6 +5891,34 @@
6989
+/* Previous GCC releases forced all vector types to have 16-byte alignment. */
6992
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
6994
+ if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
6996
+ if (computed != 128)
6998
+ static bool warned;
6999
+ if (!warned && warn_psabi)
7002
+ inform (input_location,
7003
+ "the layout of aggregates containing vectors with"
7004
+ " %d-byte alignment will change in a future GCC release",
7005
+ computed / BITS_PER_UNIT);
7008
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
7009
+ keep the special treatment of vector types, but warn if there will
7010
+ be differences in future GCC releases. */
7017
/* AIX increases natural record alignment to doubleword if the first
7018
field is an FP double while the FP fields remain word aligned. */
7020
@@ -6109,7 +6167,8 @@
7023
extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
7024
- gcc_assert (extra >= 0);
7028
if (GET_CODE (addr) == LO_SUM)
7029
/* For lo_sum addresses, we must allow any offset except one that
7030
@@ -9198,14 +9257,51 @@
7031
|| (type && TREE_CODE (type) == VECTOR_TYPE
7032
&& int_size_in_bytes (type) >= 16))
7034
- else if (((TARGET_MACHO && rs6000_darwin64_abi)
7035
- || DEFAULT_ABI == ABI_ELFv2
7036
- || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
7037
- && mode == BLKmode
7038
- && type && TYPE_ALIGN (type) > 64)
7040
+ /* Aggregate types that need > 8 byte alignment are quadword-aligned
7041
+ in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
7042
+ -mcompat-align-parm is used. */
7043
+ if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
7044
+ || DEFAULT_ABI == ABI_ELFv2)
7045
+ && type && TYPE_ALIGN (type) > 64)
7047
+ /* "Aggregate" means any AGGREGATE_TYPE except for single-element
7048
+ or homogeneous float/vector aggregates here. We already handled
7049
+ vector aggregates above, but still need to check for float here. */
7050
+ bool aggregate_p = (AGGREGATE_TYPE_P (type)
7051
+ && !SCALAR_FLOAT_MODE_P (elt_mode));
7053
+ /* We used to check for BLKmode instead of the above aggregate type
7054
+ check. Warn when this results in any difference to the ABI. */
7055
+ if (aggregate_p != (mode == BLKmode))
7057
+ static bool warned;
7058
+ if (!warned && warn_psabi)
7061
+ inform (input_location,
7062
+ "the ABI of passing aggregates with %d-byte alignment"
7063
+ " will change in a future GCC release",
7064
+ (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
7068
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
7069
+ keep using the BLKmode check, but warn if there will be differences
7070
+ in future GCC releases. */
7071
+ if (mode == BLKmode)
7075
+ /* Similar for the Darwin64 ABI. Note that for historical reasons we
7076
+ implement the "aggregate type" check as a BLKmode check here; this
7077
+ means certain aggregate types are in fact not aligned. */
7078
+ if (TARGET_MACHO && rs6000_darwin64_abi
7079
+ && mode == BLKmode
7080
+ && type && TYPE_ALIGN (type) > 64)
7083
- return PARM_BOUNDARY;
7085
+ return PARM_BOUNDARY;
7088
/* The offset in words to the start of the parameter save area. */
7089
@@ -10243,6 +10339,7 @@
7092
unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
7095
/* Do we also need to pass this argument in the parameter
7097
@@ -10271,6 +10368,37 @@
7098
rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
7101
+ /* If there were not enough FPRs to hold the argument, the rest
7102
+ usually goes into memory. However, if the current position
7103
+ is still within the register parameter area, a portion may
7104
+ actually have to go into GPRs.
7106
+ Note that it may happen that the portion of the argument
7107
+ passed in the first "half" of the first GPR was already
7108
+ passed in the last FPR as well.
7110
+ For unnamed arguments, we already set up GPRs to cover the
7111
+ whole argument in rs6000_psave_function_arg, so there is
7112
+ nothing further to do at this point.
7114
+ GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
7115
+ GCC releases. To avoid any ABI change on the release branch,
7116
+ we retain that original implementation here, but warn if we
7117
+ encounter a case where the ABI will change in the future. */
7118
+ fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
7119
+ if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
7120
+ && cum->nargs_prototype > 0)
7122
+ static bool warned;
7123
+ if (!warned && warn_psabi)
7126
+ inform (input_location,
7127
+ "the ABI of passing homogeneous float aggregates"
7128
+ " will change in a future GCC release");
7132
return rs6000_finish_function_arg (mode, rvec, k);
7134
else if (align_words < GP_ARG_NUM_REG)
7135
@@ -10497,10 +10625,9 @@
7136
list, or passes any parameter in memory. */
7139
-rs6000_function_parms_need_stack (tree fun)
7140
+rs6000_function_parms_need_stack (tree fun, bool incoming)
7142
- function_args_iterator args_iter;
7144
+ tree fntype, result;
7145
CUMULATIVE_ARGS args_so_far_v;
7146
cumulative_args_t args_so_far;
7148
@@ -10507,26 +10634,57 @@
7150
/* Must be a libcall, all of which only use reg parms. */
7155
- fun = TREE_TYPE (fun);
7156
+ fntype = TREE_TYPE (fun);
7158
/* Varargs functions need the parameter save area. */
7159
- if (!prototype_p (fun) || stdarg_p (fun))
7160
+ if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
7163
- INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
7164
+ INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
7165
args_so_far = pack_cumulative_args (&args_so_far_v);
7167
- if (aggregate_value_p (TREE_TYPE (fun), fun))
7168
+ /* When incoming, we will have been passed the function decl.
7169
+ It is necessary to use the decl to handle K&R style functions,
7170
+ where TYPE_ARG_TYPES may not be available. */
7173
- tree type = build_pointer_type (TREE_TYPE (fun));
7174
- rs6000_parm_needs_stack (args_so_far, type);
7175
+ gcc_assert (DECL_P (fun));
7176
+ result = DECL_RESULT (fun);
7179
+ result = TREE_TYPE (fntype);
7181
- FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
7182
- if (rs6000_parm_needs_stack (args_so_far, arg_type))
7184
+ if (result && aggregate_value_p (result, fntype))
7186
+ if (!TYPE_P (result))
7187
+ result = TREE_TYPE (result);
7188
+ result = build_pointer_type (result);
7189
+ rs6000_parm_needs_stack (args_so_far, result);
7196
+ for (parm = DECL_ARGUMENTS (fun);
7197
+ parm && parm != void_list_node;
7198
+ parm = TREE_CHAIN (parm))
7199
+ if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
7204
+ function_args_iterator args_iter;
7207
+ FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
7208
+ if (rs6000_parm_needs_stack (args_so_far, arg_type))
7215
@@ -10537,7 +10695,7 @@
7216
all parameters in registers. */
7219
-rs6000_reg_parm_stack_space (tree fun)
7220
+rs6000_reg_parm_stack_space (tree fun, bool incoming)
7222
int reg_parm_stack_space;
7224
@@ -10555,7 +10713,7 @@
7226
/* ??? Recomputing this every time is a bit expensive. Is there
7227
a place to cache this information? */
7228
- if (rs6000_function_parms_need_stack (fun))
7229
+ if (rs6000_function_parms_need_stack (fun, incoming))
7230
reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
7232
reg_parm_stack_space = 0;
7233
@@ -13544,11 +13702,15 @@
7234
else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
7235
== (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
7236
error ("Builtin function %s requires the -mhard-dfp and"
7237
- "-mpower8-vector options", name);
7238
+ " -mpower8-vector options", name);
7239
else if ((fnmask & RS6000_BTM_DFP) != 0)
7240
error ("Builtin function %s requires the -mhard-dfp option", name);
7241
else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
7242
error ("Builtin function %s requires the -mpower8-vector option", name);
7243
+ else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
7244
+ == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
7245
+ error ("Builtin function %s requires the -mhard-float and"
7246
+ " -mlong-double-128 options", name);
7247
else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
7248
error ("Builtin function %s requires the -mhard-float option", name);
7250
@@ -17099,7 +17261,14 @@
7251
prefer Altivec loads.. */
7252
if (rclass == VSX_REGS)
7254
- if (GET_MODE_SIZE (mode) <= 8)
7255
+ if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
7257
+ rtx addr = XEXP (x, 0);
7258
+ if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
7259
+ || legitimate_lo_sum_address_p (mode, addr, false))
7260
+ return FLOAT_REGS;
7262
+ else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
7265
if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
7266
@@ -31413,6 +31582,7 @@
7267
{ "htm", RS6000_BTM_HTM, false, false },
7268
{ "hard-dfp", RS6000_BTM_DFP, false, false },
7269
{ "hard-float", RS6000_BTM_HARD_FLOAT, false, false },
7270
+ { "long-double-128", RS6000_BTM_LDBL128, false, false },
7273
/* Option variables that we want to support inside attribute((target)) and
7274
Index: gcc/config/rs6000/vsx.md
7275
===================================================================
7276
--- a/src/gcc/config/rs6000/vsx.md (.../tags/gcc_4_8_3_release)
7277
+++ b/src/gcc/config/rs6000/vsx.md (.../branches/gcc-4_8-branch)
7279
;; Iterator for the 2 64-bit vector types
7280
(define_mode_iterator VSX_D [V2DF V2DI])
7282
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
7283
+;; lxvd2x to properly handle swapping words on little endian
7284
+(define_mode_iterator VSX_LE [V2DF
7287
+ (TI "VECTOR_MEM_VSX_P (TImode)")])
7289
;; Iterator for the 2 32-bit vector types
7290
(define_mode_iterator VSX_W [V4SF V4SI])
7303
-;; Map the register class used for float<->int conversions
7304
+;; Map the register class used for float<->int conversions (floating point side)
7305
+;; VSr2 is the preferred register class, VSr3 is any register class that will
7307
(define_mode_attr VSr2 [(V2DF "wd")
7314
(define_mode_attr VSr3 [(V2DF "wa")
7321
;; Map the register class for sp<->dp float conversions, destination
7322
(define_mode_attr VSr4 [(SF "ws")
7323
@@ -99,12 +113,27 @@
7327
-;; Map the register class for sp<->dp float conversions, destination
7328
+;; Map the register class for sp<->dp float conversions, source
7329
(define_mode_attr VSr5 [(SF "ws")
7334
+;; The VSX register class that a type can occupy, even if it is not the
7335
+;; preferred register class (VSr is the preferred register class that will get
7336
+;; allocated first).
7337
+(define_mode_attr VSa [(V16QI "wa")
7349
;; Same size integer type for floating point data
7350
(define_mode_attr VSi [(V4SF "v4si")
7352
@@ -200,6 +229,16 @@
7356
+;; Map register class for 64-bit element in 128-bit vector for direct moves
7358
+(define_mode_attr VS_64dm [(V2DF "wk")
7361
+;; Map register class for 64-bit element in 128-bit vector for normal register
7362
+;; to register moves
7363
+(define_mode_attr VS_64reg [(V2DF "ws")
7366
;; Constants for creating unspecs
7367
(define_c_enum "unspec"
7370
;; The patterns for LE permuted loads and stores come before the general
7371
;; VSX moves so they match first.
7372
(define_insn_and_split "*vsx_le_perm_load_<mode>"
7373
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
7374
- (match_operand:VSX_D 1 "memory_operand" "Z"))]
7375
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
7376
+ (match_operand:VSX_LE 1 "memory_operand" "Z"))]
7377
"!BYTES_BIG_ENDIAN && TARGET_VSX"
7379
"!BYTES_BIG_ENDIAN && TARGET_VSX"
7381
(set_attr "length" "8")])
7383
(define_insn_and_split "*vsx_le_perm_load_<mode>"
7384
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
7385
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
7386
(match_operand:VSX_W 1 "memory_operand" "Z"))]
7387
"!BYTES_BIG_ENDIAN && TARGET_VSX"
7390
(set_attr "length" "8")])
7392
(define_insn "*vsx_le_perm_store_<mode>"
7393
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
7394
- (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
7395
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
7396
+ (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
7397
"!BYTES_BIG_ENDIAN && TARGET_VSX"
7399
[(set_attr "type" "vecstore")
7401
(set_attr "length" "12")])
7404
- [(set (match_operand:VSX_D 0 "memory_operand" "")
7405
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
7406
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
7407
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
7408
"!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
7412
;; The post-reload split requires that we re-permute the source
7413
;; register in case it is still live.
7415
- [(set (match_operand:VSX_D 0 "memory_operand" "")
7416
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
7417
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
7418
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
7419
"!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
7424
(define_insn "*vsx_le_perm_store_<mode>"
7425
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
7426
- (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
7427
+ (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
7428
"!BYTES_BIG_ENDIAN && TARGET_VSX"
7430
[(set_attr "type" "vecstore")
7434
(define_insn "*vsx_mov<mode>"
7435
- [(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")
7436
- (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
7437
+ [(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")
7438
+ (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
7439
"VECTOR_MEM_VSX_P (<MODE>mode)
7440
&& (register_operand (operands[0], <MODE>mode)
7441
|| register_operand (operands[1], <MODE>mode))"
7443
;; instructions are now combined with the insn for the traditional floating
7445
(define_insn "*vsx_add<mode>3"
7446
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7447
- (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7448
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7449
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7450
+ (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7451
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7452
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7453
"xvadd<VSs> %x0,%x1,%x2"
7454
[(set_attr "type" "<VStype_simple>")
7456
(set_attr "fp_type" "<VSfptype_simple>")])
7458
(define_insn "*vsx_sub<mode>3"
7459
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7460
- (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7461
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7462
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7463
+ (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7464
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7465
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7466
"xvsub<VSs> %x0,%x1,%x2"
7467
[(set_attr "type" "<VStype_simple>")
7469
(set_attr "fp_type" "<VSfptype_simple>")])
7471
(define_insn "*vsx_mul<mode>3"
7472
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7473
- (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7474
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7475
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7476
+ (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7477
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7478
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7479
"xvmul<VSs> %x0,%x1,%x2"
7480
[(set_attr "type" "<VStype_simple>")
7482
(set_attr "fp_type" "<VSfptype_mul>")])
7484
(define_insn "*vsx_div<mode>3"
7485
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7486
- (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7487
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7488
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7489
+ (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7490
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7491
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7492
"xvdiv<VSs> %x0,%x1,%x2"
7493
[(set_attr "type" "<VStype_div>")
7496
(define_insn "*vsx_tdiv<mode>3_internal"
7497
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
7498
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
7499
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
7500
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
7501
+ (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
7503
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7504
"x<VSv>tdiv<VSs> %0,%x1,%x2"
7506
(set_attr "fp_type" "<VSfptype_simple>")])
7508
(define_insn "vsx_fre<mode>2"
7509
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7510
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
7511
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7512
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
7514
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7517
(set_attr "fp_type" "<VSfptype_simple>")])
7519
(define_insn "*vsx_neg<mode>2"
7520
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7521
- (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
7522
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7523
+ (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
7524
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7525
"xvneg<VSs> %x0,%x1"
7526
[(set_attr "type" "<VStype_simple>")
7528
(set_attr "fp_type" "<VSfptype_simple>")])
7530
(define_insn "*vsx_abs<mode>2"
7531
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7532
- (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
7533
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7534
+ (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
7535
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7536
"xvabs<VSs> %x0,%x1"
7537
[(set_attr "type" "<VStype_simple>")
7538
@@ -780,10 +819,10 @@
7539
(set_attr "fp_type" "<VSfptype_simple>")])
7541
(define_insn "vsx_nabs<mode>2"
7542
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7543
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7546
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
7547
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
7548
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7549
"xvnabs<VSs> %x0,%x1"
7550
[(set_attr "type" "<VStype_simple>")
7552
(set_attr "fp_type" "<VSfptype_simple>")])
7554
(define_insn "vsx_smax<mode>3"
7555
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7556
- (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7557
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7558
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7559
+ (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7560
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7561
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7562
"xvmax<VSs> %x0,%x1,%x2"
7563
[(set_attr "type" "<VStype_simple>")
7565
(set_attr "fp_type" "<VSfptype_simple>")])
7567
(define_insn "*vsx_smin<mode>3"
7568
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7569
- (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7570
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7571
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7572
+ (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7573
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7574
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7575
"xvmin<VSs> %x0,%x1,%x2"
7576
[(set_attr "type" "<VStype_simple>")
7578
(set_attr "fp_type" "<VSfptype_simple>")])
7580
(define_insn "*vsx_sqrt<mode>2"
7581
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7582
- (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
7583
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7584
+ (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
7585
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7586
"xvsqrt<VSs> %x0,%x1"
7587
[(set_attr "type" "<VStype_sqrt>")
7589
(set_attr "fp_type" "<VSfptype_sqrt>")])
7591
(define_insn "*vsx_rsqrte<mode>2"
7592
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7593
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
7594
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7595
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
7597
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7598
"xvrsqrte<VSs> %x0,%x1"
7601
(define_insn "*vsx_tsqrt<mode>2_internal"
7602
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
7603
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
7604
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
7606
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7607
"x<VSv>tsqrt<VSs> %0,%x1"
7608
@@ -865,11 +904,11 @@
7611
(define_insn "*vsx_fmav4sf4"
7612
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
7613
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
7615
- (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
7616
- (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
7617
- (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
7618
+ (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
7619
+ (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
7620
+ (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))]
7621
"VECTOR_UNIT_VSX_P (V4SFmode)"
7623
xvmaddasp %x0,%x1,%x2
7624
@@ -880,11 +919,11 @@
7625
[(set_attr "type" "vecfloat")])
7627
(define_insn "*vsx_fmav2df4"
7628
- [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
7629
+ [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
7631
- (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
7632
- (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
7633
- (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
7634
+ (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
7635
+ (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
7636
+ (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))]
7637
"VECTOR_UNIT_VSX_P (V2DFmode)"
7639
xvmaddadp %x0,%x1,%x2
7640
@@ -894,12 +933,12 @@
7641
[(set_attr "type" "vecdouble")])
7643
(define_insn "*vsx_fms<mode>4"
7644
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
7645
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
7647
- (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
7648
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
7649
+ (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
7650
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
7652
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
7653
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
7654
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7656
xvmsuba<VSs> %x0,%x1,%x2
7657
@@ -909,12 +948,12 @@
7658
[(set_attr "type" "<VStype_mul>")])
7660
(define_insn "*vsx_nfma<mode>4"
7661
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
7662
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
7665
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
7666
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
7667
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
7668
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
7669
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
7670
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
7671
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7673
xvnmadda<VSs> %x0,%x1,%x2
7676
;; Vector conditional expressions (no scalar version for these instructions)
7677
(define_insn "vsx_eq<mode>"
7678
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7679
- (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7680
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7681
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7682
+ (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7683
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7684
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7685
"xvcmpeq<VSs> %x0,%x1,%x2"
7686
[(set_attr "type" "<VStype_simple>")
7687
@@ -968,9 +1007,9 @@
7688
(set_attr "fp_type" "<VSfptype_simple>")])
7690
(define_insn "vsx_gt<mode>"
7691
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7692
- (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7693
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7694
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7695
+ (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7696
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7697
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7698
"xvcmpgt<VSs> %x0,%x1,%x2"
7699
[(set_attr "type" "<VStype_simple>")
7700
@@ -977,9 +1016,9 @@
7701
(set_attr "fp_type" "<VSfptype_simple>")])
7703
(define_insn "*vsx_ge<mode>"
7704
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7705
- (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7706
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
7707
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7708
+ (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7709
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
7710
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7711
"xvcmpge<VSs> %x0,%x1,%x2"
7712
[(set_attr "type" "<VStype_simple>")
7713
@@ -990,10 +1029,10 @@
7714
(define_insn "*vsx_eq_<mode>_p"
7717
- [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
7718
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
7719
+ [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
7720
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
7722
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7723
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7724
(eq:VSX_F (match_dup 1)
7726
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7727
@@ -1003,10 +1042,10 @@
7728
(define_insn "*vsx_gt_<mode>_p"
7731
- [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
7732
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
7733
+ [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
7734
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
7736
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7737
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7738
(gt:VSX_F (match_dup 1)
7740
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7741
@@ -1016,10 +1055,10 @@
7742
(define_insn "*vsx_ge_<mode>_p"
7745
- [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
7746
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
7747
+ [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
7748
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
7750
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7751
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7752
(ge:VSX_F (match_dup 1)
7754
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7755
@@ -1028,23 +1067,23 @@
7758
(define_insn "*vsx_xxsel<mode>"
7759
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
7760
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7762
- (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
7763
+ (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
7764
(match_operand:VSX_L 4 "zero_constant" ""))
7765
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
7766
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
7767
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
7768
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
7769
"VECTOR_MEM_VSX_P (<MODE>mode)"
7770
"xxsel %x0,%x3,%x2,%x1"
7771
[(set_attr "type" "vecperm")])
7773
(define_insn "*vsx_xxsel<mode>_uns"
7774
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
7775
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7777
- (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
7778
+ (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
7779
(match_operand:VSX_L 4 "zero_constant" ""))
7780
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
7781
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
7782
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
7783
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
7784
"VECTOR_MEM_VSX_P (<MODE>mode)"
7785
"xxsel %x0,%x3,%x2,%x1"
7786
[(set_attr "type" "vecperm")])
7787
@@ -1051,10 +1090,10 @@
7790
(define_insn "vsx_copysign<mode>3"
7791
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7792
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7794
- [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
7795
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
7796
+ [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
7797
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
7799
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7800
"xvcpsgn<VSs> %x0,%x2,%x1"
7801
@@ -1067,7 +1106,7 @@
7802
;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
7803
;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
7804
(define_insn "vsx_float<VSi><mode>2"
7805
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
7806
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
7807
(float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
7808
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7809
"x<VSv>cvsx<VSc><VSs> %x0,%x1"
7810
@@ -1075,7 +1114,7 @@
7811
(set_attr "fp_type" "<VSfptype_simple>")])
7813
(define_insn "vsx_floatuns<VSi><mode>2"
7814
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
7815
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
7816
(unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
7817
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7818
"x<VSv>cvux<VSc><VSs> %x0,%x1"
7819
@@ -1084,7 +1123,7 @@
7821
(define_insn "vsx_fix_trunc<mode><VSi>2"
7822
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
7823
- (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
7824
+ (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
7825
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7826
"x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
7827
[(set_attr "type" "<VStype_simple>")
7828
@@ -1092,7 +1131,7 @@
7830
(define_insn "vsx_fixuns_trunc<mode><VSi>2"
7831
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
7832
- (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
7833
+ (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
7834
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7835
"x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
7836
[(set_attr "type" "<VStype_simple>")
7837
@@ -1100,8 +1139,8 @@
7839
;; Math rounding functions
7840
(define_insn "vsx_x<VSv>r<VSs>i"
7841
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
7842
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
7843
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7844
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
7845
UNSPEC_VSX_ROUND_I))]
7846
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7847
"x<VSv>r<VSs>i %x0,%x1"
7848
@@ -1109,8 +1148,8 @@
7849
(set_attr "fp_type" "<VSfptype_simple>")])
7851
(define_insn "vsx_x<VSv>r<VSs>ic"
7852
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
7853
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
7854
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7855
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
7856
UNSPEC_VSX_ROUND_IC))]
7857
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7858
"x<VSv>r<VSs>ic %x0,%x1"
7859
@@ -1118,8 +1157,8 @@
7860
(set_attr "fp_type" "<VSfptype_simple>")])
7862
(define_insn "vsx_btrunc<mode>2"
7863
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7864
- (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
7865
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7866
+ (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
7867
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7868
"xvr<VSs>iz %x0,%x1"
7869
[(set_attr "type" "<VStype_simple>")
7870
@@ -1126,8 +1165,8 @@
7871
(set_attr "fp_type" "<VSfptype_simple>")])
7873
(define_insn "*vsx_b2trunc<mode>2"
7874
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
7875
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
7876
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7877
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
7879
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7880
"x<VSv>r<VSs>iz %x0,%x1"
7881
@@ -1135,8 +1174,8 @@
7882
(set_attr "fp_type" "<VSfptype_simple>")])
7884
(define_insn "vsx_floor<mode>2"
7885
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7886
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
7887
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7888
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
7890
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7891
"xvr<VSs>im %x0,%x1"
7892
@@ -1144,8 +1183,8 @@
7893
(set_attr "fp_type" "<VSfptype_simple>")])
7895
(define_insn "vsx_ceil<mode>2"
7896
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
7897
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
7898
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7899
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
7901
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7902
"xvr<VSs>ip %x0,%x1"
7903
@@ -1160,8 +1199,8 @@
7904
;; scalar single precision instructions internally use the double format.
7905
;; Prefer the altivec registers, since we likely will need to do a vperm
7906
(define_insn "vsx_<VS_spdp_insn>"
7907
- [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
7908
- (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
7909
+ [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
7910
+ (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
7911
UNSPEC_VSX_CVSPDP))]
7912
"VECTOR_UNIT_VSX_P (<MODE>mode)"
7913
"<VS_spdp_insn> %x0,%x1"
7914
@@ -1169,8 +1208,8 @@
7916
;; xscvspdp, represent the scalar SF type as V4SF
7917
(define_insn "vsx_xscvspdp"
7918
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
7919
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
7920
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
7921
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
7922
UNSPEC_VSX_CVSPDP))]
7923
"VECTOR_UNIT_VSX_P (V4SFmode)"
7925
@@ -1197,7 +1236,7 @@
7927
;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
7928
(define_insn "vsx_xscvdpspn"
7929
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
7930
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
7931
(unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
7932
UNSPEC_VSX_CVDPSPN))]
7934
@@ -1205,8 +1244,8 @@
7935
[(set_attr "type" "fp")])
7937
(define_insn "vsx_xscvspdpn"
7938
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
7939
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
7940
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
7941
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
7942
UNSPEC_VSX_CVSPDPN))]
7945
@@ -1213,8 +1252,8 @@
7946
[(set_attr "type" "fp")])
7948
(define_insn "vsx_xscvdpspn_scalar"
7949
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
7950
- (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
7951
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
7952
+ (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
7953
UNSPEC_VSX_CVDPSPN))]
7956
@@ -1302,10 +1341,10 @@
7957
;; since the xsrdpiz instruction does not truncate the value if the floating
7958
;; point value is < LONG_MIN or > LONG_MAX.
7959
(define_insn "*vsx_float_fix_<mode>2"
7960
- [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
7961
+ [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7964
- (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
7965
+ (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
7966
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
7967
&& VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
7968
&& !flag_trapping_math && TARGET_FRIZ"
7969
@@ -1318,10 +1357,10 @@
7971
;; Build a V2DF/V2DI vector from two scalars
7972
(define_insn "vsx_concat_<mode>"
7973
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
7974
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
7976
- (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
7977
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
7978
+ (match_operand:<VS_scalar> 1 "vsx_register_operand" "<VS_64reg>,<VSa>")
7979
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")))]
7980
"VECTOR_MEM_VSX_P (<MODE>mode)"
7982
if (BYTES_BIG_ENDIAN)
7983
@@ -1352,9 +1391,9 @@
7984
;; xxpermdi for little endian loads and stores. We need several of
7985
;; these since the form of the PARALLEL differs by mode.
7986
(define_insn "*vsx_xxpermdi2_le_<mode>"
7987
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
7989
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
7990
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
7991
+ (vec_select:VSX_LE
7992
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
7993
(parallel [(const_int 1) (const_int 0)])))]
7994
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
7995
"xxpermdi %x0,%x1,%x1,2"
7996
@@ -1361,9 +1400,9 @@
7997
[(set_attr "type" "vecperm")])
7999
(define_insn "*vsx_xxpermdi4_le_<mode>"
8000
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
8001
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
8003
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
8004
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
8005
(parallel [(const_int 2) (const_int 3)
8006
(const_int 0) (const_int 1)])))]
8007
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8008
@@ -1401,9 +1440,9 @@
8009
;; lxvd2x for little endian loads. We need several of
8010
;; these since the form of the PARALLEL differs by mode.
8011
(define_insn "*vsx_lxvd2x2_le_<mode>"
8012
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
8014
- (match_operand:VSX_D 1 "memory_operand" "Z")
8015
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
8016
+ (vec_select:VSX_LE
8017
+ (match_operand:VSX_LE 1 "memory_operand" "Z")
8018
(parallel [(const_int 1) (const_int 0)])))]
8019
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8021
@@ -1410,7 +1449,7 @@
8022
[(set_attr "type" "vecload")])
8024
(define_insn "*vsx_lxvd2x4_le_<mode>"
8025
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
8026
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
8028
(match_operand:VSX_W 1 "memory_operand" "Z")
8029
(parallel [(const_int 2) (const_int 3)
8030
@@ -1450,9 +1489,9 @@
8031
;; stxvd2x for little endian stores. We need several of
8032
;; these since the form of the PARALLEL differs by mode.
8033
(define_insn "*vsx_stxvd2x2_le_<mode>"
8034
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
8036
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
8037
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
8038
+ (vec_select:VSX_LE
8039
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
8040
(parallel [(const_int 1) (const_int 0)])))]
8041
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8043
@@ -1461,7 +1500,7 @@
8044
(define_insn "*vsx_stxvd2x4_le_<mode>"
8045
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
8047
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
8048
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
8049
(parallel [(const_int 2) (const_int 3)
8050
(const_int 0) (const_int 1)])))]
8051
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8052
@@ -1513,11 +1552,12 @@
8054
;; Set the element of a V2DI/VD2F mode
8055
(define_insn "vsx_set_<mode>"
8056
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
8057
- (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
8058
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
8059
- (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
8061
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
8063
+ [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
8064
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
8065
+ (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
8067
"VECTOR_MEM_VSX_P (<MODE>mode)"
8069
int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
8070
@@ -1582,7 +1622,7 @@
8071
(define_insn_and_split "vsx_extract_v4sf"
8072
[(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
8074
- (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
8075
+ (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
8076
(parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
8077
(clobber (match_scratch:V4SF 3 "=X,0"))]
8078
"VECTOR_UNIT_VSX_P (V4SFmode)"
8079
@@ -1606,7 +1646,7 @@
8081
if (GET_CODE (op3) == SCRATCH)
8082
op3 = gen_reg_rtx (V4SFmode);
8083
- emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
8084
+ emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
8087
emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
8088
@@ -1765,9 +1805,9 @@
8091
(define_insn "vsx_splat_<mode>"
8092
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
8093
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
8094
(vec_duplicate:VSX_D
8095
- (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
8096
+ (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
8097
"VECTOR_MEM_VSX_P (<MODE>mode)"
8099
xxpermdi %x0,%x1,%x1,0
8100
@@ -1780,10 +1820,10 @@
8103
(define_insn "vsx_xxspltw_<mode>"
8104
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
8105
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
8106
(vec_duplicate:VSX_W
8107
(vec_select:<VS_scalar>
8108
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
8109
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
8111
[(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
8112
"VECTOR_MEM_VSX_P (<MODE>mode)"
8113
@@ -1796,8 +1836,8 @@
8114
[(set_attr "type" "vecperm")])
8116
(define_insn "vsx_xxspltw_<mode>_direct"
8117
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
8118
- (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
8119
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
8120
+ (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
8121
(match_operand:QI 2 "u5bit_cint_operand" "i,i")]
8122
UNSPEC_VSX_XXSPLTW))]
8123
"VECTOR_MEM_VSX_P (<MODE>mode)"
8124
@@ -1806,11 +1846,11 @@
8126
;; V4SF/V4SI interleave
8127
(define_insn "vsx_xxmrghw_<mode>"
8128
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
8129
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
8131
(vec_concat:<VS_double>
8132
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
8133
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
8134
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
8135
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
8136
(parallel [(const_int 0) (const_int 4)
8137
(const_int 1) (const_int 5)])))]
8138
"VECTOR_MEM_VSX_P (<MODE>mode)"
8139
@@ -1823,11 +1863,11 @@
8140
[(set_attr "type" "vecperm")])
8142
(define_insn "vsx_xxmrglw_<mode>"
8143
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
8144
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
8146
(vec_concat:<VS_double>
8147
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
8148
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
8149
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
8150
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
8151
(parallel [(const_int 2) (const_int 6)
8152
(const_int 3) (const_int 7)])))]
8153
"VECTOR_MEM_VSX_P (<MODE>mode)"
8154
@@ -1841,9 +1881,9 @@
8156
;; Shift left double by word immediate
8157
(define_insn "vsx_xxsldwi_<mode>"
8158
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
8159
- (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
8160
- (match_operand:VSX_L 2 "vsx_register_operand" "wa")
8161
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
8162
+ (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
8163
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
8164
(match_operand:QI 3 "u5bit_cint_operand" "i")]
8166
"VECTOR_MEM_VSX_P (<MODE>mode)"
8167
@@ -1924,7 +1964,7 @@
8168
;; to the top element of the V2DF array without doing an extract.
8170
(define_insn_and_split "*vsx_reduc_<VEC_reduc_name>_v2df_scalar"
8171
- [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?wa,ws,?wa")
8172
+ [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?ws,ws,?ws")
8176
Index: gcc/config/rs6000/rs6000.h
8177
===================================================================
8178
--- a/src/gcc/config/rs6000/rs6000.h (.../tags/gcc_4_8_3_release)
8179
+++ b/src/gcc/config/rs6000/rs6000.h (.../branches/gcc-4_8-branch)
8180
@@ -1438,6 +1438,10 @@
8181
RS6000_CONSTRAINT_wd, /* VSX register for V2DF */
8182
RS6000_CONSTRAINT_wf, /* VSX register for V4SF */
8183
RS6000_CONSTRAINT_wg, /* FPR register for -mmfpgpr */
8184
+ RS6000_CONSTRAINT_wh, /* FPR register for direct moves. */
8185
+ RS6000_CONSTRAINT_wi, /* FPR/VSX register to hold DImode */
8186
+ RS6000_CONSTRAINT_wj, /* FPR/VSX register for DImode direct moves. */
8187
+ RS6000_CONSTRAINT_wk, /* FPR/VSX register for DFmode direct moves. */
8188
RS6000_CONSTRAINT_wl, /* FPR register for LFIWAX */
8189
RS6000_CONSTRAINT_wm, /* VSX register for direct move */
8190
RS6000_CONSTRAINT_wr, /* GPR register if 64-bit */
8191
@@ -1462,6 +1466,9 @@
8192
#define VSX_REG_CLASS_P(CLASS) \
8193
((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
8195
+/* Return whether a given register class targets general purpose registers. */
8196
+#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
8198
/* Given an rtx X being reloaded into a reg required to be
8199
in class CLASS, return the class of reg to actually use.
8200
In general this is just CLASS; but on some machines
8201
@@ -1593,8 +1600,15 @@
8202
/* Define this if stack space is still allocated for a parameter passed
8203
in a register. The value is the number of bytes allocated to this
8205
-#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
8206
+#define REG_PARM_STACK_SPACE(FNDECL) \
8207
+ rs6000_reg_parm_stack_space ((FNDECL), false)
8209
+/* Define this macro if space guaranteed when compiling a function body
8210
+ is different to space required when making a call, a situation that
8211
+ can arise with K&R style function definitions. */
8212
+#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
8213
+ rs6000_reg_parm_stack_space ((FNDECL), true)
8215
/* Define this if the above stack space is to be considered part of the
8216
space allocated by the caller. */
8217
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
8218
@@ -2483,8 +2497,8 @@
8219
#define RS6000_BTC_SAT RS6000_BTC_MISC /* saturate sets VSCR. */
8221
/* Builtin targets. For now, we reuse the masks for those options that are in
8222
- target flags, and pick two random bits for SPE and paired which aren't in
8224
+ target flags, and pick three random bits for SPE, paired and ldbl128 which
8225
+ aren't in target_flags. */
8226
#define RS6000_BTM_ALWAYS 0 /* Always enabled. */
8227
#define RS6000_BTM_ALTIVEC MASK_ALTIVEC /* VMX/altivec vectors. */
8228
#define RS6000_BTM_VSX MASK_VSX /* VSX (vector/scalar). */
8229
@@ -2501,6 +2515,7 @@
8230
#define RS6000_BTM_CELL MASK_FPRND /* Target is cell powerpc. */
8231
#define RS6000_BTM_DFP MASK_DFP /* Decimal floating point. */
8232
#define RS6000_BTM_HARD_FLOAT MASK_SOFT_FLOAT /* Hardware floating point. */
8233
+#define RS6000_BTM_LDBL128 MASK_MULTIPLE /* 128-bit long double. */
8235
#define RS6000_BTM_COMMON (RS6000_BTM_ALTIVEC \
8237
@@ -2514,7 +2529,8 @@
8238
| RS6000_BTM_POPCNTD \
8241
- | RS6000_BTM_HARD_FLOAT)
8242
+ | RS6000_BTM_HARD_FLOAT \
8243
+ | RS6000_BTM_LDBL128)
8245
/* Define builtin enum index. */
8247
Index: gcc/config/rs6000/rs6000.md
8248
===================================================================
8249
--- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_3_release)
8250
+++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch)
8252
(define_mode_attr f32_sv [(SF "stxsspx %x1,%y0") (SD "stxsiwzx %x1,%y0")])
8254
; Definitions for 32-bit fpr direct move
8255
-(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
8256
+(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
8258
; These modes do not fit in integer registers in 32-bit mode.
8259
; but on e500v2, the gpr are 64 bit registers
8263
(define_insn "*zero_extendsidi2_lfiwzx"
8264
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
8265
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
8266
(zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
8267
"TARGET_POWERPC64 && TARGET_LFIWZX"
8272
(define_insn "*extendsidi2_lfiwax"
8273
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
8274
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
8275
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
8276
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
8277
"TARGET_POWERPC64 && TARGET_LFIWAX"
8282
(define_insn "*extendsidi2_nocell"
8283
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
8284
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
8285
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
8286
"TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
8289
@@ -5614,7 +5614,7 @@
8290
; We don't define lfiwax/lfiwzx with the normal definition, because we
8291
; don't want to support putting SImode in FPR registers.
8292
(define_insn "lfiwax"
8293
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
8294
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
8295
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
8297
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
8298
@@ -5694,7 +5694,7 @@
8299
(set_attr "type" "fpload")])
8301
(define_insn "lfiwzx"
8302
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
8303
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
8304
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
8306
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
8307
@@ -9491,8 +9491,8 @@
8308
; ld/std require word-aligned displacements -> 'Y' constraint.
8309
; List Y->r and r->Y before r->r for reload.
8310
(define_insn "*mov<mode>_hardfloat64"
8311
- [(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")
8312
- (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"))]
8313
+ [(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,wk")
8314
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wk,r"))]
8315
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
8316
&& (gpc_reg_operand (operands[0], <MODE>mode)
8317
|| gpc_reg_operand (operands[1], <MODE>mode))"
8318
@@ -10272,8 +10272,8 @@
8319
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
8321
(define_insn "*movdi_internal64"
8322
- [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
8323
- (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
8324
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
8325
+ (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
8327
&& (gpc_reg_operand (operands[0], DImode)
8328
|| gpc_reg_operand (operands[1], DImode))"
8329
@@ -10293,7 +10293,8 @@
8335
+ xxlxor %x0,%x0,%x0"
8336
[(set_attr_alternative "type"
8338
(match_test "update_indexed_address_mem (operands[0], VOIDmode)")
8339
@@ -10334,8 +10335,9 @@
8340
(const_string "mftgpr")
8341
(const_string "mffgpr")
8342
(const_string "mftgpr")
8343
- (const_string "mffgpr")])
8344
- (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
8345
+ (const_string "mffgpr")
8346
+ (const_string "vecsimple")])
8347
+ (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
8349
;; immediate value valid for a single instruction hiding in a const_double
8351
@@ -15847,26 +15849,6 @@
8355
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
8356
-;; and __builtin_longdouble_dw1 to optimize glibc. Add support for these
8359
-(define_expand "unpacktf_0"
8360
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
8361
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
8363
- UNSPEC_UNPACK_128BIT))]
8367
-(define_expand "unpacktf_1"
8368
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
8369
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
8371
- UNSPEC_UNPACK_128BIT))]
8375
(define_insn_and_split "unpack<mode>_dm"
8376
[(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
8378
Index: gcc/config/rs6000/sysv4.h
8379
===================================================================
8380
--- a/src/gcc/config/rs6000/sysv4.h (.../tags/gcc_4_8_3_release)
8381
+++ b/src/gcc/config/rs6000/sysv4.h (.../branches/gcc-4_8-branch)
8383
/* An expression for the alignment of a structure field FIELD if the
8384
alignment computed in the usual way is COMPUTED. */
8385
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
8386
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
8387
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
8390
#undef BIGGEST_FIELD_ALIGNMENT
8391
@@ -949,3 +949,27 @@
8392
#define TARGET_USES_SYSV4_OPT 1
8394
#undef DBX_REGISTER_NUMBER
8396
+/* Link -lasan early on the command line. For -static-libasan, don't link
8397
+ it for -shared link, the executable should be compiled with -static-libasan
8398
+ in that case, and for executable link link with --{,no-}whole-archive around
8399
+ it to force everything into the executable. And similarly for -ltsan. */
8400
+#if defined(HAVE_LD_STATIC_DYNAMIC)
8401
+#undef LIBASAN_EARLY_SPEC
8402
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
8403
+ "%{static-libasan:%{!shared:" \
8404
+ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
8405
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
8406
+#undef LIBTSAN_EARLY_SPEC
8407
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
8408
+ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
8409
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
8412
+/* Additional libraries needed by -static-libasan. */
8413
+#undef STATIC_LIBASAN_LIBS
8414
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
8416
+/* Additional libraries needed by -static-libtsan. */
8417
+#undef STATIC_LIBTSAN_LIBS
8418
+#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
8419
Index: gcc/config/arm/arm.c
8420
===================================================================
8421
--- a/src/gcc/config/arm/arm.c (.../tags/gcc_4_8_3_release)
8422
+++ b/src/gcc/config/arm/arm.c (.../branches/gcc-4_8-branch)
8423
@@ -24476,9 +24476,13 @@
8424
fputs (":\n", file);
8427
- /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */
8428
+ /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn". */
8429
rtx tem = XEXP (DECL_RTL (function), 0);
8430
- tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
8431
+ /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
8432
+ pipeline offset is four rather than eight. Adjust the offset
8434
+ tem = plus_constant (GET_MODE (tem), tem,
8435
+ TARGET_THUMB1_ONLY ? -3 : -7);
8436
tem = gen_rtx_MINUS (GET_MODE (tem),
8438
gen_rtx_SYMBOL_REF (Pmode,
8439
Index: gcc/config/arm/arm.md
8440
===================================================================
8441
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
8442
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
8443
@@ -7630,12 +7630,13 @@
8445
(define_insn "*arm_cmpdi_unsigned"
8446
[(set (reg:CC_CZ CC_REGNUM)
8447
- (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
8448
- (match_operand:DI 1 "arm_di_operand" "rDi")))]
8449
+ (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
8450
+ (match_operand:DI 1 "arm_di_operand" "rDi,rDi")))]
8452
"cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
8453
[(set_attr "conds" "set")
8454
- (set_attr "length" "8")]
8455
+ (set_attr "arch" "a,t2")
8456
+ (set_attr "length" "8,10")]
8459
(define_insn "*arm_cmpdi_zero"
8460
Index: gcc/config/arm/t-rtems-eabi
8461
===================================================================
8462
--- a/src/gcc/config/arm/t-rtems-eabi (.../tags/gcc_4_8_3_release)
8463
+++ b/src/gcc/config/arm/t-rtems-eabi (.../branches/gcc-4_8-branch)
8465
# Custom RTEMS EABI multilibs
8467
-MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
8468
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
8469
+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
8470
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
8472
# Enumeration of multilibs
8474
MULTILIB_EXCEPTIONS =
8475
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
8476
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
8477
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
8478
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
8479
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8480
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
8481
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
8482
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
8483
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
8484
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
8485
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
8486
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
8487
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
8488
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
8489
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
8490
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
8491
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
8492
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
8493
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
8494
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
8495
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
8496
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
8497
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
8498
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
8499
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
8500
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
8501
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
8502
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
8503
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8504
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
8505
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
8506
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
8507
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
8508
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
8509
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
8510
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
8511
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
8512
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
8513
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
8514
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
8515
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
8516
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
8517
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
8518
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
8519
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8520
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
8521
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
8522
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
8523
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
8524
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
8525
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
8526
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
8527
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
8528
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
8529
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
8530
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
8531
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
8532
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
8533
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
8534
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
8535
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
8536
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
8537
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
8538
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
8539
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
8540
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
8541
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
8542
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
8543
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8544
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
8545
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
8546
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
8547
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
8548
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
8549
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
8550
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
8551
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
8552
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
8553
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
8554
+MULTILIB_EXCEPTIONS += mbig-endian
8555
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
8556
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
8557
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
8558
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
8559
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8560
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
8561
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
8562
# MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
8563
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
8564
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
8565
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
8566
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
8567
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
8568
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
8569
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
8570
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
8571
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
8572
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
8573
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
8574
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
8575
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
8576
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
8577
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
8578
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
8579
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
8580
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
8581
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
8582
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
8583
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8584
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
8585
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
8586
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
8587
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
8588
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
8589
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
8590
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
8591
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
8592
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
8593
MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
8594
# MULTILIB_EXCEPTIONS += mthumb
8595
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
8596
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
8597
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
8598
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
8599
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8600
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
8601
MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
8602
MULTILIB_EXCEPTIONS += march=armv6-m
8603
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
8604
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
8605
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
8606
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
8607
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
8608
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
8609
MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
8610
MULTILIB_EXCEPTIONS += march=armv7-a
8611
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
8612
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
8613
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
8614
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
8615
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
8616
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
8617
MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
8618
MULTILIB_EXCEPTIONS += march=armv7-r
8619
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
8620
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
8621
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
8622
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
8623
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
8624
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
8625
MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
8626
MULTILIB_EXCEPTIONS += march=armv7-m
8627
MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
8628
MULTILIB_EXCEPTIONS += mfpu=neon
8629
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
8630
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
8631
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
8632
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
8633
MULTILIB_EXCEPTIONS += mfloat-abi=hard
8634
Index: gcc/config/pa/pa.c
8635
===================================================================
8636
--- a/src/gcc/config/pa/pa.c (.../tags/gcc_4_8_3_release)
8637
+++ b/src/gcc/config/pa/pa.c (.../branches/gcc-4_8-branch)
8638
@@ -3237,7 +3237,12 @@
8640
&& function_label_operand (x, VOIDmode))
8642
- fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
8643
+ fputs (size == 8? "\t.dword\t" : "\t.word\t", asm_out_file);
8645
+ /* We don't want an OPD when generating fast indirect calls. */
8646
+ if (!TARGET_FAST_INDIRECT_CALLS)
8647
+ fputs ("P%", asm_out_file);
8649
output_addr_const (asm_out_file, x);
8650
fputc ('\n', asm_out_file);
8652
@@ -4160,9 +4165,8 @@
8653
pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
8655
rtx insn = get_last_insn ();
8660
/* pa_expand_epilogue does the dirty work now. We just need
8661
to output the assembler directives which denote the end
8663
@@ -4185,14 +4189,16 @@
8664
if (insn && GET_CODE (insn) == CALL_INSN)
8666
fputs ("\tnop\n", file);
8667
- last_address += 4;
8671
+ extra_nop = false;
8673
fputs ("\t.EXIT\n\t.PROCEND\n", file);
8675
if (TARGET_SOM && TARGET_GAS)
8677
- /* We done with this subspace except possibly for some additional
8678
+ /* We are done with this subspace except possibly for some additional
8679
debug information. Forget that we are in this subspace to ensure
8680
that the next function is output in its own subspace. */
8682
@@ -4199,8 +4205,13 @@
8683
cfun->machine->in_nsubspa = 2;
8686
+ /* Thunks do their own insn accounting. */
8687
+ if (cfun->is_thunk)
8690
if (INSN_ADDRESSES_SET_P ())
8692
+ last_address = extra_nop ? 4 : 0;
8693
insn = get_last_nonnote_insn ();
8694
last_address += INSN_ADDRESSES (INSN_UID (insn));
8696
@@ -8270,8 +8281,7 @@
8697
xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
8698
xoperands[2] = GEN_INT (delta);
8700
- ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
8701
- fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
8702
+ final_start_function (emit_barrier (), file, 1);
8704
/* Output the thunk. We know that the function is in the same
8705
translation unit (i.e., the same space) as the thunk, and that
8706
@@ -8301,12 +8311,16 @@
8707
|| ((DECL_SECTION_NAME (thunk_fndecl)
8708
== DECL_SECTION_NAME (function))
8709
&& last_address < 262132)))
8710
+ /* In this case, we need to be able to reach the start of
8711
+ the stub table even though the function is likely closer
8712
+ and can be jumped to directly. */
8713
|| (targetm_common.have_named_sections
8714
&& DECL_SECTION_NAME (thunk_fndecl) == NULL
8715
&& DECL_SECTION_NAME (function) == NULL
8716
- && last_address < 262132)
8717
+ && total_code_bytes < MAX_PCREL17F_OFFSET)
8719
|| (!targetm_common.have_named_sections
8720
- && last_address < 262132))))
8721
+ && total_code_bytes < MAX_PCREL17F_OFFSET))))
8724
output_asm_insn ("addil L'%2,%%r26", xoperands);
8725
@@ -8477,17 +8491,8 @@
8729
- fprintf (file, "\t.EXIT\n\t.PROCEND\n");
8730
+ final_end_function ();
8732
- if (TARGET_SOM && TARGET_GAS)
8734
- /* We done with this subspace except possibly for some additional
8735
- debug information. Forget that we are in this subspace to ensure
8736
- that the next function is output in its own subspace. */
8737
- in_section = NULL;
8738
- cfun->machine->in_nsubspa = 2;
8741
if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
8743
switch_to_section (data_section);
8744
Index: gcc/tree-vect-slp.c
8745
===================================================================
8746
--- a/src/gcc/tree-vect-slp.c (.../tags/gcc_4_8_3_release)
8747
+++ b/src/gcc/tree-vect-slp.c (.../branches/gcc-4_8-branch)
8748
@@ -1837,7 +1837,10 @@
8749
&& (stmt_vinfo = vinfo_for_stmt (use_stmt))
8750
&& !STMT_SLP_TYPE (stmt_vinfo)
8751
&& (STMT_VINFO_RELEVANT (stmt_vinfo)
8752
- || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))
8753
+ || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))
8754
+ || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
8755
+ && STMT_VINFO_RELATED_STMT (stmt_vinfo)
8756
+ && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo)))))
8757
&& !(gimple_code (use_stmt) == GIMPLE_PHI
8758
&& STMT_VINFO_DEF_TYPE (stmt_vinfo)
8759
== vect_reduction_def))
8760
Index: libobjc/encoding.c
8761
===================================================================
8762
--- a/src/libobjc/encoding.c (.../tags/gcc_4_8_3_release)
8763
+++ b/src/libobjc/encoding.c (.../branches/gcc-4_8-branch)
8765
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
8766
: MAX (COMPUTED, SPECIFIED));})
8768
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
8769
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
8771
/* Skip a variable name, enclosed in quotes ("). */
8773
Index: libobjc/ChangeLog
8774
===================================================================
8775
--- a/src/libobjc/ChangeLog (.../tags/gcc_4_8_3_release)
8776
+++ b/src/libobjc/ChangeLog (.../branches/gcc-4_8-branch)
8778
+2014-07-27 Ulrich Weigand <uweigand@de.ibm.com>
8781
+ * encoding.c (rs6000_special_adjust_field_align_p): Use definition
8782
+ that matches the 4.8 branch ABI.
8784
+2014-07-27 Alan Modra <amodra@gmail.com>
8785
+ Matthias Klose <doko@ubuntu.com>
8789
+ * encoding.c: Define rs6000_special_adjust_field_align_p.
8791
2014-05-22 Release Manager
8793
* GCC 4.8.3 released.
8794
Index: libgfortran/m4/in_pack.m4
8795
===================================================================
8796
--- a/src/libgfortran/m4/in_pack.m4 (.../tags/gcc_4_8_3_release)
8797
+++ b/src/libgfortran/m4/in_pack.m4 (.../branches/gcc-4_8-branch)
8799
return source->base_addr;
8801
/* Allocate storage for the destination. */
8802
- destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
8803
+ destptr = xmallocarray (ssize, sizeof ('rtype_name`));
8805
src = source->base_addr;
8806
stride0 = stride[0];
8807
Index: libgfortran/m4/pack.m4
8808
===================================================================
8809
--- a/src/libgfortran/m4/pack.m4 (.../tags/gcc_4_8_3_release)
8810
+++ b/src/libgfortran/m4/pack.m4 (.../branches/gcc-4_8-branch)
8815
- /* xmalloc allocates a single byte for zero size. */
8816
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
8817
+ /* xmallocarray allocates a single byte for zero size. */
8818
+ ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
8822
Index: libgfortran/m4/spread.m4
8823
===================================================================
8824
--- a/src/libgfortran/m4/spread.m4 (.../tags/gcc_4_8_3_release)
8825
+++ b/src/libgfortran/m4/spread.m4 (.../branches/gcc-4_8-branch)
8830
- /* xmalloc allocates a single byte for zero size. */
8831
- ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
8832
+ /* xmallocarray allocates a single byte for zero size. */
8833
+ ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
8839
if (ret->base_addr == NULL)
8841
- ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
8842
+ ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
8844
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
8846
Index: libgfortran/m4/transpose.m4
8847
===================================================================
8848
--- a/src/libgfortran/m4/transpose.m4 (.../tags/gcc_4_8_3_release)
8849
+++ b/src/libgfortran/m4/transpose.m4 (.../branches/gcc-4_8-branch)
8851
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
8852
GFC_DESCRIPTOR_EXTENT(source, 1));
8854
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
8855
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
8856
+ sizeof ('rtype_name`));
8858
} else if (unlikely (compile_options.bounds_check))
8860
Index: libgfortran/m4/iforeach.m4
8861
===================================================================
8862
--- a/src/libgfortran/m4/iforeach.m4 (.../tags/gcc_4_8_3_release)
8863
+++ b/src/libgfortran/m4/iforeach.m4 (.../branches/gcc-4_8-branch)
8865
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8866
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8867
retarray->offset = 0;
8868
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
8869
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
8874
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
8875
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8876
retarray->offset = 0;
8877
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
8878
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
8883
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
8884
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
8885
retarray->offset = 0;
8886
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
8887
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
8889
else if (unlikely (compile_options.bounds_check))
8891
Index: libgfortran/m4/eoshift1.m4
8892
===================================================================
8893
--- a/src/libgfortran/m4/eoshift1.m4 (.../tags/gcc_4_8_3_release)
8894
+++ b/src/libgfortran/m4/eoshift1.m4 (.../branches/gcc-4_8-branch)
8896
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
8899
- /* xmalloc allocates a single byte for zero size. */
8900
- ret->base_addr = xmalloc (size * arraysize);
8901
+ /* xmallocarray allocates a single byte for zero size. */
8902
+ ret->base_addr = xmallocarray (arraysize, size);
8905
else if (unlikely (compile_options.bounds_check))
8906
Index: libgfortran/m4/eoshift3.m4
8907
===================================================================
8908
--- a/src/libgfortran/m4/eoshift3.m4 (.../tags/gcc_4_8_3_release)
8909
+++ b/src/libgfortran/m4/eoshift3.m4 (.../branches/gcc-4_8-branch)
8914
- ret->base_addr = xmalloc (size * arraysize);
8915
+ ret->base_addr = xmallocarray (arraysize, size);
8917
ret->dtype = array->dtype;
8918
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
8920
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
8923
- /* xmalloc allocates a single byte for zero size. */
8924
- ret->base_addr = xmalloc (size * arraysize);
8925
+ /* xmallocarray allocates a single byte for zero size. */
8926
+ ret->base_addr = xmallocarray (arraysize, size);
8929
else if (unlikely (compile_options.bounds_check))
8930
Index: libgfortran/m4/shape.m4
8931
===================================================================
8932
--- a/src/libgfortran/m4/shape.m4 (.../tags/gcc_4_8_3_release)
8933
+++ b/src/libgfortran/m4/shape.m4 (.../branches/gcc-4_8-branch)
8936
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
8938
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
8939
+ ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
8942
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
8943
Index: libgfortran/m4/cshift1.m4
8944
===================================================================
8945
--- a/src/libgfortran/m4/cshift1.m4 (.../tags/gcc_4_8_3_release)
8946
+++ b/src/libgfortran/m4/cshift1.m4 (.../branches/gcc-4_8-branch)
8951
- ret->base_addr = xmalloc (size * arraysize);
8952
+ ret->base_addr = xmallocarray (arraysize, size);
8954
ret->dtype = array->dtype;
8955
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
8956
Index: libgfortran/m4/matmull.m4
8957
===================================================================
8958
--- a/src/libgfortran/m4/matmull.m4 (.../tags/gcc_4_8_3_release)
8959
+++ b/src/libgfortran/m4/matmull.m4 (.../branches/gcc-4_8-branch)
8964
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
8965
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
8966
retarray->offset = 0;
8968
else if (unlikely (compile_options.bounds_check))
8969
Index: libgfortran/m4/bessel.m4
8970
===================================================================
8971
--- a/src/libgfortran/m4/bessel.m4 (.../tags/gcc_4_8_3_release)
8972
+++ b/src/libgfortran/m4/bessel.m4 (.../branches/gcc-4_8-branch)
8975
size_t size = n2 < n1 ? 0 : n2-n1+1;
8976
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8977
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
8978
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
8984
size_t size = n2 < n1 ? 0 : n2-n1+1;
8985
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
8986
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
8987
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
8993
x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
8995
- for (i = 2; i <= n1+n2; i++)
8996
+ for (i = 2; i <= n2 - n1; i++)
8998
#if defined('rtype_name`_INFINITY)
8999
if (unlikely (last2 == -'rtype_name`_INFINITY))
9000
Index: libgfortran/m4/unpack.m4
9001
===================================================================
9002
--- a/src/libgfortran/m4/unpack.m4 (.../tags/gcc_4_8_3_release)
9003
+++ b/src/libgfortran/m4/unpack.m4 (.../branches/gcc-4_8-branch)
9008
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
9009
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
9017
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
9018
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
9022
Index: libgfortran/m4/reshape.m4
9023
===================================================================
9024
--- a/src/libgfortran/m4/reshape.m4 (.../tags/gcc_4_8_3_release)
9025
+++ b/src/libgfortran/m4/reshape.m4 (.../branches/gcc-4_8-branch)
9026
@@ -115,11 +115,11 @@
9029
if (unlikely (rs < 1))
9033
- alloc_size = rs * sizeof ('rtype_name`);
9036
- ret->base_addr = xmalloc (alloc_size);
9037
+ ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
9038
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
9041
Index: libgfortran/m4/ifunction_logical.m4
9042
===================================================================
9043
--- a/src/libgfortran/m4/ifunction_logical.m4 (.../tags/gcc_4_8_3_release)
9044
+++ b/src/libgfortran/m4/ifunction_logical.m4 (.../branches/gcc-4_8-branch)
9046
retarray->offset = 0;
9047
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9049
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9051
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9053
if (alloc_size == 0)
9059
- retarray->base_addr = xmalloc (alloc_size);
9060
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
9064
Index: libgfortran/m4/ifunction.m4
9065
===================================================================
9066
--- a/src/libgfortran/m4/ifunction.m4 (.../tags/gcc_4_8_3_release)
9067
+++ b/src/libgfortran/m4/ifunction.m4 (.../branches/gcc-4_8-branch)
9069
retarray->offset = 0;
9070
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9072
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9074
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9076
- retarray->base_addr = xmalloc (alloc_size);
9077
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
9078
if (alloc_size == 0)
9080
/* Make sure we have a zero-sized array. */
9085
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9087
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9089
retarray->offset = 0;
9090
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9095
- retarray->base_addr = xmalloc (alloc_size);
9096
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
9101
retarray->offset = 0;
9102
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9104
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9106
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9108
if (alloc_size == 0)
9114
- retarray->base_addr = xmalloc (alloc_size);
9115
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
9119
Index: libgfortran/m4/matmul.m4
9120
===================================================================
9121
--- a/src/libgfortran/m4/matmul.m4 (.../tags/gcc_4_8_3_release)
9122
+++ b/src/libgfortran/m4/matmul.m4 (.../branches/gcc-4_8-branch)
9127
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
9128
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
9129
retarray->offset = 0;
9131
else if (unlikely (compile_options.bounds_check))
9132
Index: libgfortran/runtime/in_pack_generic.c
9133
===================================================================
9134
--- a/src/libgfortran/runtime/in_pack_generic.c (.../tags/gcc_4_8_3_release)
9135
+++ b/src/libgfortran/runtime/in_pack_generic.c (.../branches/gcc-4_8-branch)
9137
return source->base_addr;
9139
/* Allocate storage for the destination. */
9140
- destptr = xmalloc (ssize * size);
9141
+ destptr = xmallocarray (ssize, size);
9142
dest = (char *)destptr;
9143
src = source->base_addr;
9144
stride0 = stride[0] * size;
9145
Index: libgfortran/runtime/memory.c
9146
===================================================================
9147
--- a/src/libgfortran/runtime/memory.c (.../tags/gcc_4_8_3_release)
9148
+++ b/src/libgfortran/runtime/memory.c (.../branches/gcc-4_8-branch)
9151
#include "libgfortran.h"
9156
+#define SIZE_MAX ((size_t)-1)
9168
+xmallocarray (size_t nmemb, size_t size)
9172
+ if (!nmemb || !size)
9174
+ else if (nmemb > SIZE_MAX / size)
9177
+ os_error ("Integer overflow in xmallocarray");
9180
+ p = malloc (nmemb * size);
9183
+ os_error ("Memory allocation failed in xmallocarray");
9189
/* calloc wrapper that aborts on error. */
9192
xcalloc (size_t nmemb, size_t size)
9194
- if (nmemb * size == 0)
9195
+ if (!nmemb || !size)
9198
void *p = calloc (nmemb, size);
9199
Index: libgfortran/runtime/convert_char.c
9200
===================================================================
9201
--- a/src/libgfortran/runtime/convert_char.c (.../tags/gcc_4_8_3_release)
9202
+++ b/src/libgfortran/runtime/convert_char.c (.../branches/gcc-4_8-branch)
9204
gfc_charlen_type i, l;
9206
l = len > 0 ? len : 0;
9207
- *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
9208
+ *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
9210
for (i = 0; i < l; i++)
9213
gfc_charlen_type i, l;
9215
l = len > 0 ? len : 0;
9216
- *dst = xmalloc ((l + 1) * sizeof (unsigned char));
9217
+ *dst = xmalloc (l + 1);
9219
for (i = 0; i < l; i++)
9221
Index: libgfortran/runtime/environ.c
9222
===================================================================
9223
--- a/src/libgfortran/runtime/environ.c (.../tags/gcc_4_8_3_release)
9224
+++ b/src/libgfortran/runtime/environ.c (.../branches/gcc-4_8-branch)
9229
- elist = xmalloc (unit_count * sizeof (exception_t));
9230
+ elist = xmallocarray (unit_count, sizeof (exception_t));
9234
Index: libgfortran/intrinsics/string_intrinsics_inc.c
9235
===================================================================
9236
--- a/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../tags/gcc_4_8_3_release)
9237
+++ b/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../branches/gcc-4_8-branch)
9241
/* Allocate space for result string. */
9242
- *dest = xmalloc (*len * sizeof (CHARTYPE));
9243
+ *dest = xmallocarray (*len, sizeof (CHARTYPE));
9245
/* Copy string if necessary. */
9246
memcpy (*dest, src, *len * sizeof (CHARTYPE));
9248
*dest = &zero_length_string;
9251
- CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
9252
+ CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
9253
memcpy (tmp, res, reslen * sizeof (CHARTYPE));
9254
MEMSET (&tmp[reslen], ' ', *rlen - reslen);
9256
Index: libgfortran/intrinsics/pack_generic.c
9257
===================================================================
9258
--- a/src/libgfortran/intrinsics/pack_generic.c (.../tags/gcc_4_8_3_release)
9259
+++ b/src/libgfortran/intrinsics/pack_generic.c (.../branches/gcc-4_8-branch)
9261
GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
9264
- /* xmalloc allocates a single byte for zero size. */
9265
- ret->base_addr = xmalloc (size * total);
9266
+ /* xmallocarray allocates a single byte for zero size. */
9267
+ ret->base_addr = xmallocarray (total, size);
9270
return; /* In this case, nothing remains to be done. */
9275
- ret->base_addr = xmalloc (size * total);
9276
+ ret->base_addr = xmallocarray (total, size);
9280
Index: libgfortran/intrinsics/transpose_generic.c
9281
===================================================================
9282
--- a/src/libgfortran/intrinsics/transpose_generic.c (.../tags/gcc_4_8_3_release)
9283
+++ b/src/libgfortran/intrinsics/transpose_generic.c (.../branches/gcc-4_8-branch)
9285
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
9286
GFC_DESCRIPTOR_EXTENT(source, 1));
9288
- ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
9289
+ ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
9292
else if (unlikely (compile_options.bounds_check))
9293
Index: libgfortran/intrinsics/cshift0.c
9294
===================================================================
9295
--- a/src/libgfortran/intrinsics/cshift0.c (.../tags/gcc_4_8_3_release)
9296
+++ b/src/libgfortran/intrinsics/cshift0.c (.../branches/gcc-4_8-branch)
9298
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
9301
- /* xmalloc allocates a single byte for zero size. */
9302
- ret->base_addr = xmalloc (size * arraysize);
9303
+ /* xmallocarray allocates a single byte for zero size. */
9304
+ ret->base_addr = xmallocarray (arraysize, size);
9306
else if (unlikely (compile_options.bounds_check))
9308
Index: libgfortran/intrinsics/ctime.c
9309
===================================================================
9310
--- a/src/libgfortran/intrinsics/ctime.c (.../tags/gcc_4_8_3_release)
9311
+++ b/src/libgfortran/intrinsics/ctime.c (.../branches/gcc-4_8-branch)
9316
-/* strftime-like function that fills a C string with %c format which
9317
- is identical to ctime in the default locale. As ctime and ctime_r
9318
- are poorly specified and their usage not recommended, the
9319
- implementation instead uses strftime. */
9320
+/* Maximum space a ctime-like string might need. A "normal" ctime
9321
+ string is 26 bytes, and in our case 24 bytes as we don't include
9322
+ the trailing newline and null. However, the longest possible year
9323
+ number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
9324
+ 32-bit signed integer) so an extra 7 bytes are needed. */
9325
+#define CTIME_BUFSZ 31
9328
-strctime (char *s, size_t max, const time_t *timep)
9330
+/* Thread-safe ctime-like function that fills a Fortran
9331
+ string. ctime_r is a portability headache and marked as obsolescent
9332
+ in POSIX 2008, which recommends strftime in its place. However,
9333
+ strftime(..., "%c",...) doesn't produce ctime-like output on
9334
+ MinGW, so do it manually with snprintf. */
9337
+gf_ctime (char *s, size_t max, const time_t timev)
9341
+ char buf[CTIME_BUFSZ + 1];
9342
/* Some targets provide a localtime_r based on a draft of the POSIX
9343
standard where the return type is int rather than the
9344
standardized struct tm*. */
9345
- __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, <m))
9346
+ __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, <m))
9348
- failed = localtime_r (timep, <m) == NULL,
9349
- failed = localtime_r (timep, <m) != 0);
9350
+ failed = localtime_r (&timev, <m) == NULL,
9351
+ failed = localtime_r (&timev, <m) != 0);
9354
- return strftime (s, max, "%c", <m);
9356
+ int n = snprintf (buf, sizeof (buf),
9357
+ "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
9358
+ "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
9359
+ "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
9360
+ ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec,
9361
+ 1900 + ltm.tm_year);
9364
+ if ((size_t) n <= max)
9366
+ cf_strcpy (s, max, buf);
9370
+ memset (s, ' ', max);
9374
-/* In the default locale, the date and time representation fits in 26
9375
- bytes. However, other locales might need more space. */
9378
extern void fdate (char **, gfc_charlen_type *);
9379
export_proto(fdate);
9381
fdate (char ** date, gfc_charlen_type * date_len)
9383
time_t now = time(NULL);
9384
- *date = xmalloc (CSZ);
9385
- *date_len = strctime (*date, CSZ, &now);
9386
+ *date = xmalloc (CTIME_BUFSZ);
9387
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
9392
fdate_sub (char * date, gfc_charlen_type date_len)
9394
time_t now = time(NULL);
9395
- char *s = xmalloc (date_len + 1);
9396
- size_t n = strctime (s, date_len + 1, &now);
9397
- fstrcpy (date, date_len, s, n);
9399
+ gf_ctime (date, date_len, now);
9404
PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
9407
- *date = xmalloc (CSZ);
9408
- *date_len = strctime (*date, CSZ, &now);
9409
+ *date = xmalloc (CTIME_BUFSZ);
9410
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
9415
ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
9418
- char *s = xmalloc (date_len + 1);
9419
- size_t n = strctime (s, date_len + 1, &now);
9420
- fstrcpy (date, date_len, s, n);
9422
+ gf_ctime (date, date_len, now);
9424
Index: libgfortran/intrinsics/spread_generic.c
9425
===================================================================
9426
--- a/src/libgfortran/intrinsics/spread_generic.c (.../tags/gcc_4_8_3_release)
9427
+++ b/src/libgfortran/intrinsics/spread_generic.c (.../branches/gcc-4_8-branch)
9429
GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
9432
- ret->base_addr = xmalloc (rs * size);
9433
+ ret->base_addr = xmallocarray (rs, size);
9439
if (ret->base_addr == NULL)
9441
- ret->base_addr = xmalloc (ncopies * size);
9442
+ ret->base_addr = xmallocarray (ncopies, size);
9444
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
9446
Index: libgfortran/intrinsics/unpack_generic.c
9447
===================================================================
9448
--- a/src/libgfortran/intrinsics/unpack_generic.c (.../tags/gcc_4_8_3_release)
9449
+++ b/src/libgfortran/intrinsics/unpack_generic.c (.../branches/gcc-4_8-branch)
9454
- ret->base_addr = xmalloc (rs * size);
9455
+ ret->base_addr = xmallocarray (rs, size);
9459
Index: libgfortran/intrinsics/eoshift0.c
9460
===================================================================
9461
--- a/src/libgfortran/intrinsics/eoshift0.c (.../tags/gcc_4_8_3_release)
9462
+++ b/src/libgfortran/intrinsics/eoshift0.c (.../branches/gcc-4_8-branch)
9467
- /* xmalloc allocates a single byte for zero size. */
9468
- ret->base_addr = xmalloc (size * arraysize);
9469
+ /* xmallocarray allocates a single byte for zero size. */
9470
+ ret->base_addr = xmallocarray (arraysize, size);
9472
else if (unlikely (compile_options.bounds_check))
9474
Index: libgfortran/intrinsics/eoshift2.c
9475
===================================================================
9476
--- a/src/libgfortran/intrinsics/eoshift2.c (.../tags/gcc_4_8_3_release)
9477
+++ b/src/libgfortran/intrinsics/eoshift2.c (.../branches/gcc-4_8-branch)
9480
ret->dtype = array->dtype;
9482
- /* xmalloc allocates a single byte for zero size. */
9483
- ret->base_addr = xmalloc (size * arraysize);
9484
+ /* xmallocarray allocates a single byte for zero size. */
9485
+ ret->base_addr = xmallocarray (arraysize, size);
9487
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
9489
Index: libgfortran/intrinsics/reshape_generic.c
9490
===================================================================
9491
--- a/src/libgfortran/intrinsics/reshape_generic.c (.../tags/gcc_4_8_3_release)
9492
+++ b/src/libgfortran/intrinsics/reshape_generic.c (.../branches/gcc-4_8-branch)
9496
if (unlikely (rs < 1))
9498
+ alloc_size = 0; /* xmalloc will allocate 1 byte. */
9500
- alloc_size = rs * size;
9503
- ret->base_addr = xmalloc (alloc_size);
9504
+ ret->base_addr = xmallocarray (alloc_size, size);
9506
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
9508
Index: libgfortran/ChangeLog
9509
===================================================================
9510
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
9511
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
9513
+2014-08-20 Steven G. Kargl <kargl@gcc.gnu.org>
9515
+ PR libgfortran/62188
9516
+ * m4/bessel.m4: Avoid indexing off the end of an array.
9517
+ * generated/bessel_r10.c: Regenerated.
9518
+ * generated/bessel_r16.c: Ditto.
9519
+ * generated/bessel_r4.c: Ditto.
9520
+ * generated/bessel_r8.c: Ditto.
9522
+2014-07-31 Janne Blomqvist <jb@gcc.gnu.org>
9524
+ Backport from mainline
9526
+ * libgfortran.h (xmallocarray): New prototype.
9527
+ * runtime/memory.c (xmallocarray): New function.
9528
+ (xcalloc): Check for nonzero separately instead of multiplying.
9529
+ * generated/*.c: Regenerated.
9530
+ * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
9532
+ * intrinsics/eoshift0.c (eoshift0): Likewise.
9533
+ * intrinsics/eoshift2.c (eoshift2): Likewise.
9534
+ * intrinsics/pack_generic.c (pack_internal): Likewise.
9535
+ (pack_s_internal): Likewise.
9536
+ * intrinsics/reshape_generic.c (reshape_internal): Likewise.
9537
+ * intrinsics/spread_generic.c (spread_internal): Likewise.
9538
+ (spread_internal_scalar): Likewise.
9539
+ * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
9540
+ (string_minmax): Likewise.
9541
+ * intrinsics/transpose_generic.c (transpose_internal): Likewise.
9542
+ * intrinsics/unpack_generic.c (unpack_internal): Likewise.
9543
+ * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
9544
+ * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
9546
+ * io/unit.c (get_internal_unit): Likewise.
9547
+ (filename_from_unit): Don't cast xmalloc return value.
9548
+ * io/write.c (nml_write_obj): Likewise, formatting.
9549
+ * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
9550
+ instead of xmalloc.
9551
+ (besse_yn_r'rtype_kind`): Likewise.
9552
+ * m4/cshift1.m4 (cshift1): Likewise.
9553
+ * m4/eoshift1.m4 (eoshift1): Likewise.
9554
+ * m4/eoshift3.m4 (eoshift3): Likewise.
9555
+ * m4/iforeach.m4: Likewise.
9556
+ * m4/ifunction.m4: Likewise.
9557
+ * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
9559
+ * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
9560
+ * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
9561
+ * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
9562
+ * m4/pack.m4 (pack_'rtype_code`): Likewise.
9563
+ * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
9564
+ * m4/shape.m4 (shape_'rtype_kind`): Likewise.
9565
+ * m4/spread.m4 (spread_'rtype_code`): Likewise.
9566
+ (spread_scalar_'rtype_code`): Likewise.
9567
+ * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
9568
+ * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
9569
+ (unpack1_'rtype_code`): Likewise.
9570
+ * runtime/convert_char.c (convert_char1_to_char4): Likewise.
9571
+ (convert_char4_to_char1): Simplify.
9572
+ * runtime/environ.c (init_unformatted): Call xmallocarray instead
9574
+ * runtime/in_pack_generic.c (internal_pack): Likewise.
9576
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
9578
+ Backport from mainline
9579
+ PR libfortran/61310
9580
+ * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
9581
+ instead of strftime.
9582
+ (fdate): Use gf_ctime.
9583
+ (fdate_sub): Likewise.
9584
+ (ctime): Likewise.
9585
+ (ctime_sub): Likewise.
9587
+2014-05-25 Janne Blomqvist <jb@gcc.gnu.org>
9589
+ Backport from trunk.
9590
+ PR libfortran/61187
9591
+ * io/unix.c (raw_close): Check if s->fd is -1.
9592
+ (fd_to_stream): Check return value of fstat(), handle error.
9594
2014-05-22 Release Manager
9596
* GCC 4.8.3 released.
9597
Index: libgfortran/generated/spread_r10.c
9598
===================================================================
9599
--- a/src/libgfortran/generated/spread_r10.c (.../tags/gcc_4_8_3_release)
9600
+++ b/src/libgfortran/generated/spread_r10.c (.../branches/gcc-4_8-branch)
9605
- /* xmalloc allocates a single byte for zero size. */
9606
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
9607
+ /* xmallocarray allocates a single byte for zero size. */
9608
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
9614
if (ret->base_addr == NULL)
9616
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
9617
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
9619
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
9621
Index: libgfortran/generated/maxloc1_4_r8.c
9622
===================================================================
9623
--- a/src/libgfortran/generated/maxloc1_4_r8.c (.../tags/gcc_4_8_3_release)
9624
+++ b/src/libgfortran/generated/maxloc1_4_r8.c (.../branches/gcc-4_8-branch)
9626
retarray->offset = 0;
9627
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9629
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9631
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9633
- retarray->base_addr = xmalloc (alloc_size);
9634
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9635
if (alloc_size == 0)
9637
/* Make sure we have a zero-sized array. */
9642
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9644
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9646
retarray->offset = 0;
9647
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9652
- retarray->base_addr = xmalloc (alloc_size);
9653
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9658
retarray->offset = 0;
9659
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9661
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9663
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9665
if (alloc_size == 0)
9671
- retarray->base_addr = xmalloc (alloc_size);
9672
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
9676
Index: libgfortran/generated/norm2_r4.c
9677
===================================================================
9678
--- a/src/libgfortran/generated/norm2_r4.c (.../tags/gcc_4_8_3_release)
9679
+++ b/src/libgfortran/generated/norm2_r4.c (.../branches/gcc-4_8-branch)
9680
@@ -101,10 +101,9 @@
9681
retarray->offset = 0;
9682
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9684
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9686
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9688
- retarray->base_addr = xmalloc (alloc_size);
9689
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
9690
if (alloc_size == 0)
9692
/* Make sure we have a zero-sized array. */
9693
Index: libgfortran/generated/parity_l2.c
9694
===================================================================
9695
--- a/src/libgfortran/generated/parity_l2.c (.../tags/gcc_4_8_3_release)
9696
+++ b/src/libgfortran/generated/parity_l2.c (.../branches/gcc-4_8-branch)
9698
retarray->offset = 0;
9699
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9701
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9703
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9705
- retarray->base_addr = xmalloc (alloc_size);
9706
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
9707
if (alloc_size == 0)
9709
/* Make sure we have a zero-sized array. */
9710
Index: libgfortran/generated/eoshift3_4.c
9711
===================================================================
9712
--- a/src/libgfortran/generated/eoshift3_4.c (.../tags/gcc_4_8_3_release)
9713
+++ b/src/libgfortran/generated/eoshift3_4.c (.../branches/gcc-4_8-branch)
9718
- ret->base_addr = xmalloc (size * arraysize);
9719
+ ret->base_addr = xmallocarray (arraysize, size);
9721
ret->dtype = array->dtype;
9722
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
9724
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
9727
- /* xmalloc allocates a single byte for zero size. */
9728
- ret->base_addr = xmalloc (size * arraysize);
9729
+ /* xmallocarray allocates a single byte for zero size. */
9730
+ ret->base_addr = xmallocarray (arraysize, size);
9733
else if (unlikely (compile_options.bounds_check))
9734
Index: libgfortran/generated/transpose_c8.c
9735
===================================================================
9736
--- a/src/libgfortran/generated/transpose_c8.c (.../tags/gcc_4_8_3_release)
9737
+++ b/src/libgfortran/generated/transpose_c8.c (.../branches/gcc-4_8-branch)
9739
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
9740
GFC_DESCRIPTOR_EXTENT(source, 1));
9742
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
9743
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
9744
+ sizeof (GFC_COMPLEX_8));
9746
} else if (unlikely (compile_options.bounds_check))
9748
Index: libgfortran/generated/eoshift1_8.c
9749
===================================================================
9750
--- a/src/libgfortran/generated/eoshift1_8.c (.../tags/gcc_4_8_3_release)
9751
+++ b/src/libgfortran/generated/eoshift1_8.c (.../branches/gcc-4_8-branch)
9753
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
9756
- /* xmalloc allocates a single byte for zero size. */
9757
- ret->base_addr = xmalloc (size * arraysize);
9758
+ /* xmallocarray allocates a single byte for zero size. */
9759
+ ret->base_addr = xmallocarray (arraysize, size);
9762
else if (unlikely (compile_options.bounds_check))
9763
Index: libgfortran/generated/reshape_r16.c
9764
===================================================================
9765
--- a/src/libgfortran/generated/reshape_r16.c (.../tags/gcc_4_8_3_release)
9766
+++ b/src/libgfortran/generated/reshape_r16.c (.../branches/gcc-4_8-branch)
9767
@@ -111,11 +111,11 @@
9770
if (unlikely (rs < 1))
9774
- alloc_size = rs * sizeof (GFC_REAL_16);
9777
- ret->base_addr = xmalloc (alloc_size);
9778
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
9779
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
9782
Index: libgfortran/generated/bessel_r4.c
9783
===================================================================
9784
--- a/src/libgfortran/generated/bessel_r4.c (.../tags/gcc_4_8_3_release)
9785
+++ b/src/libgfortran/generated/bessel_r4.c (.../branches/gcc-4_8-branch)
9788
size_t size = n2 < n1 ? 0 : n2-n1+1;
9789
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
9790
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
9791
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
9797
size_t size = n2 < n1 ? 0 : n2-n1+1;
9798
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
9799
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
9800
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
9806
x2rev = GFC_REAL_4_LITERAL(2.)/x;
9808
- for (i = 2; i <= n1+n2; i++)
9809
+ for (i = 2; i <= n2 - n1; i++)
9811
#if defined(GFC_REAL_4_INFINITY)
9812
if (unlikely (last2 == -GFC_REAL_4_INFINITY))
9813
Index: libgfortran/generated/any_l2.c
9814
===================================================================
9815
--- a/src/libgfortran/generated/any_l2.c (.../tags/gcc_4_8_3_release)
9816
+++ b/src/libgfortran/generated/any_l2.c (.../branches/gcc-4_8-branch)
9818
retarray->offset = 0;
9819
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9821
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9823
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9825
if (alloc_size == 0)
9831
- retarray->base_addr = xmalloc (alloc_size);
9832
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
9836
Index: libgfortran/generated/product_r4.c
9837
===================================================================
9838
--- a/src/libgfortran/generated/product_r4.c (.../tags/gcc_4_8_3_release)
9839
+++ b/src/libgfortran/generated/product_r4.c (.../branches/gcc-4_8-branch)
9841
retarray->offset = 0;
9842
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9844
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9846
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9848
- retarray->base_addr = xmalloc (alloc_size);
9849
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
9850
if (alloc_size == 0)
9852
/* Make sure we have a zero-sized array. */
9857
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9859
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9861
retarray->offset = 0;
9862
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9867
- retarray->base_addr = xmalloc (alloc_size);
9868
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
9873
retarray->offset = 0;
9874
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9876
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9878
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9880
if (alloc_size == 0)
9886
- retarray->base_addr = xmalloc (alloc_size);
9887
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
9891
Index: libgfortran/generated/iany_i1.c
9892
===================================================================
9893
--- a/src/libgfortran/generated/iany_i1.c (.../tags/gcc_4_8_3_release)
9894
+++ b/src/libgfortran/generated/iany_i1.c (.../branches/gcc-4_8-branch)
9896
retarray->offset = 0;
9897
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9899
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9901
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9903
- retarray->base_addr = xmalloc (alloc_size);
9904
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
9905
if (alloc_size == 0)
9907
/* Make sure we have a zero-sized array. */
9912
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9914
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9916
retarray->offset = 0;
9917
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9922
- retarray->base_addr = xmalloc (alloc_size);
9923
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
9928
retarray->offset = 0;
9929
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9931
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9933
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9935
if (alloc_size == 0)
9941
- retarray->base_addr = xmalloc (alloc_size);
9942
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
9946
Index: libgfortran/generated/parity_l16.c
9947
===================================================================
9948
--- a/src/libgfortran/generated/parity_l16.c (.../tags/gcc_4_8_3_release)
9949
+++ b/src/libgfortran/generated/parity_l16.c (.../branches/gcc-4_8-branch)
9951
retarray->offset = 0;
9952
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9954
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9956
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9958
- retarray->base_addr = xmalloc (alloc_size);
9959
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
9960
if (alloc_size == 0)
9962
/* Make sure we have a zero-sized array. */
9963
Index: libgfortran/generated/in_pack_r4.c
9964
===================================================================
9965
--- a/src/libgfortran/generated/in_pack_r4.c (.../tags/gcc_4_8_3_release)
9966
+++ b/src/libgfortran/generated/in_pack_r4.c (.../branches/gcc-4_8-branch)
9968
return source->base_addr;
9970
/* Allocate storage for the destination. */
9971
- destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
9972
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
9974
src = source->base_addr;
9975
stride0 = stride[0];
9976
Index: libgfortran/generated/product_i2.c
9977
===================================================================
9978
--- a/src/libgfortran/generated/product_i2.c (.../tags/gcc_4_8_3_release)
9979
+++ b/src/libgfortran/generated/product_i2.c (.../branches/gcc-4_8-branch)
9981
retarray->offset = 0;
9982
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
9984
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9986
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
9988
- retarray->base_addr = xmalloc (alloc_size);
9989
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
9990
if (alloc_size == 0)
9992
/* Make sure we have a zero-sized array. */
9997
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
9999
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10001
retarray->offset = 0;
10002
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10003
@@ -285,7 +283,7 @@
10007
- retarray->base_addr = xmalloc (alloc_size);
10008
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10012
@@ -430,8 +428,7 @@
10013
retarray->offset = 0;
10014
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10016
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10017
- * extent[rank-1];
10018
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10020
if (alloc_size == 0)
10022
@@ -440,7 +437,7 @@
10026
- retarray->base_addr = xmalloc (alloc_size);
10027
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10031
Index: libgfortran/generated/iparity_i4.c
10032
===================================================================
10033
--- a/src/libgfortran/generated/iparity_i4.c (.../tags/gcc_4_8_3_release)
10034
+++ b/src/libgfortran/generated/iparity_i4.c (.../branches/gcc-4_8-branch)
10036
retarray->offset = 0;
10037
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10039
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10040
- * extent[rank-1];
10041
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10043
- retarray->base_addr = xmalloc (alloc_size);
10044
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10045
if (alloc_size == 0)
10047
/* Make sure we have a zero-sized array. */
10048
@@ -272,8 +271,7 @@
10052
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10053
- * extent[rank-1];
10054
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10056
retarray->offset = 0;
10057
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10058
@@ -285,7 +283,7 @@
10062
- retarray->base_addr = xmalloc (alloc_size);
10063
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10067
@@ -430,8 +428,7 @@
10068
retarray->offset = 0;
10069
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10071
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10072
- * extent[rank-1];
10073
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10075
if (alloc_size == 0)
10077
@@ -440,7 +437,7 @@
10081
- retarray->base_addr = xmalloc (alloc_size);
10082
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10086
Index: libgfortran/generated/minloc0_4_i1.c
10087
===================================================================
10088
--- a/src/libgfortran/generated/minloc0_4_i1.c (.../tags/gcc_4_8_3_release)
10089
+++ b/src/libgfortran/generated/minloc0_4_i1.c (.../branches/gcc-4_8-branch)
10091
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10092
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10093
retarray->offset = 0;
10094
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10095
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10099
@@ -199,7 +199,7 @@
10100
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10101
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10102
retarray->offset = 0;
10103
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10104
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10108
@@ -367,7 +367,7 @@
10109
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10110
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10111
retarray->offset = 0;
10112
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10113
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10115
else if (unlikely (compile_options.bounds_check))
10117
Index: libgfortran/generated/reshape_c4.c
10118
===================================================================
10119
--- a/src/libgfortran/generated/reshape_c4.c (.../tags/gcc_4_8_3_release)
10120
+++ b/src/libgfortran/generated/reshape_c4.c (.../branches/gcc-4_8-branch)
10121
@@ -111,11 +111,11 @@
10124
if (unlikely (rs < 1))
10128
- alloc_size = rs * sizeof (GFC_COMPLEX_4);
10131
- ret->base_addr = xmalloc (alloc_size);
10132
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
10133
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
10136
Index: libgfortran/generated/maxloc0_4_r16.c
10137
===================================================================
10138
--- a/src/libgfortran/generated/maxloc0_4_r16.c (.../tags/gcc_4_8_3_release)
10139
+++ b/src/libgfortran/generated/maxloc0_4_r16.c (.../branches/gcc-4_8-branch)
10141
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10142
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10143
retarray->offset = 0;
10144
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10145
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10149
@@ -199,7 +199,7 @@
10150
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10151
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10152
retarray->offset = 0;
10153
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10154
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10158
@@ -367,7 +367,7 @@
10159
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10160
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10161
retarray->offset = 0;
10162
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10163
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10165
else if (unlikely (compile_options.bounds_check))
10167
Index: libgfortran/generated/iall_i8.c
10168
===================================================================
10169
--- a/src/libgfortran/generated/iall_i8.c (.../tags/gcc_4_8_3_release)
10170
+++ b/src/libgfortran/generated/iall_i8.c (.../branches/gcc-4_8-branch)
10172
retarray->offset = 0;
10173
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10175
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10176
- * extent[rank-1];
10177
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10179
- retarray->base_addr = xmalloc (alloc_size);
10180
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10181
if (alloc_size == 0)
10183
/* Make sure we have a zero-sized array. */
10184
@@ -272,8 +271,7 @@
10188
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10189
- * extent[rank-1];
10190
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10192
retarray->offset = 0;
10193
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10194
@@ -285,7 +283,7 @@
10198
- retarray->base_addr = xmalloc (alloc_size);
10199
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10203
@@ -430,8 +428,7 @@
10204
retarray->offset = 0;
10205
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10207
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10208
- * extent[rank-1];
10209
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10211
if (alloc_size == 0)
10213
@@ -440,7 +437,7 @@
10217
- retarray->base_addr = xmalloc (alloc_size);
10218
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10222
Index: libgfortran/generated/maxloc1_8_r16.c
10223
===================================================================
10224
--- a/src/libgfortran/generated/maxloc1_8_r16.c (.../tags/gcc_4_8_3_release)
10225
+++ b/src/libgfortran/generated/maxloc1_8_r16.c (.../branches/gcc-4_8-branch)
10227
retarray->offset = 0;
10228
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10230
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10231
- * extent[rank-1];
10232
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10234
- retarray->base_addr = xmalloc (alloc_size);
10235
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10236
if (alloc_size == 0)
10238
/* Make sure we have a zero-sized array. */
10239
@@ -294,8 +293,7 @@
10243
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10244
- * extent[rank-1];
10245
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10247
retarray->offset = 0;
10248
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10249
@@ -307,7 +305,7 @@
10253
- retarray->base_addr = xmalloc (alloc_size);
10254
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10258
@@ -485,8 +483,7 @@
10259
retarray->offset = 0;
10260
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10262
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10263
- * extent[rank-1];
10264
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10266
if (alloc_size == 0)
10268
@@ -495,7 +492,7 @@
10272
- retarray->base_addr = xmalloc (alloc_size);
10273
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10277
Index: libgfortran/generated/sum_r16.c
10278
===================================================================
10279
--- a/src/libgfortran/generated/sum_r16.c (.../tags/gcc_4_8_3_release)
10280
+++ b/src/libgfortran/generated/sum_r16.c (.../branches/gcc-4_8-branch)
10282
retarray->offset = 0;
10283
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10285
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10286
- * extent[rank-1];
10287
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10289
- retarray->base_addr = xmalloc (alloc_size);
10290
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10291
if (alloc_size == 0)
10293
/* Make sure we have a zero-sized array. */
10294
@@ -272,8 +271,7 @@
10298
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10299
- * extent[rank-1];
10300
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10302
retarray->offset = 0;
10303
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10304
@@ -285,7 +283,7 @@
10308
- retarray->base_addr = xmalloc (alloc_size);
10309
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10313
@@ -430,8 +428,7 @@
10314
retarray->offset = 0;
10315
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10317
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10318
- * extent[rank-1];
10319
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10321
if (alloc_size == 0)
10323
@@ -440,7 +437,7 @@
10327
- retarray->base_addr = xmalloc (alloc_size);
10328
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10332
Index: libgfortran/generated/sum_i1.c
10333
===================================================================
10334
--- a/src/libgfortran/generated/sum_i1.c (.../tags/gcc_4_8_3_release)
10335
+++ b/src/libgfortran/generated/sum_i1.c (.../branches/gcc-4_8-branch)
10337
retarray->offset = 0;
10338
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10340
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10341
- * extent[rank-1];
10342
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10344
- retarray->base_addr = xmalloc (alloc_size);
10345
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10346
if (alloc_size == 0)
10348
/* Make sure we have a zero-sized array. */
10349
@@ -272,8 +271,7 @@
10353
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10354
- * extent[rank-1];
10355
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10357
retarray->offset = 0;
10358
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10359
@@ -285,7 +283,7 @@
10363
- retarray->base_addr = xmalloc (alloc_size);
10364
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10368
@@ -430,8 +428,7 @@
10369
retarray->offset = 0;
10370
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10372
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10373
- * extent[rank-1];
10374
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10376
if (alloc_size == 0)
10378
@@ -440,7 +437,7 @@
10382
- retarray->base_addr = xmalloc (alloc_size);
10383
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
10387
Index: libgfortran/generated/in_pack_i2.c
10388
===================================================================
10389
--- a/src/libgfortran/generated/in_pack_i2.c (.../tags/gcc_4_8_3_release)
10390
+++ b/src/libgfortran/generated/in_pack_i2.c (.../branches/gcc-4_8-branch)
10392
return source->base_addr;
10394
/* Allocate storage for the destination. */
10395
- destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
10396
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
10398
src = source->base_addr;
10399
stride0 = stride[0];
10400
Index: libgfortran/generated/transpose_r10.c
10401
===================================================================
10402
--- a/src/libgfortran/generated/transpose_r10.c (.../tags/gcc_4_8_3_release)
10403
+++ b/src/libgfortran/generated/transpose_r10.c (.../branches/gcc-4_8-branch)
10405
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
10406
GFC_DESCRIPTOR_EXTENT(source, 1));
10408
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
10409
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
10410
+ sizeof (GFC_REAL_10));
10412
} else if (unlikely (compile_options.bounds_check))
10414
Index: libgfortran/generated/maxloc1_16_r16.c
10415
===================================================================
10416
--- a/src/libgfortran/generated/maxloc1_16_r16.c (.../tags/gcc_4_8_3_release)
10417
+++ b/src/libgfortran/generated/maxloc1_16_r16.c (.../branches/gcc-4_8-branch)
10419
retarray->offset = 0;
10420
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10422
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10423
- * extent[rank-1];
10424
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10426
- retarray->base_addr = xmalloc (alloc_size);
10427
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10428
if (alloc_size == 0)
10430
/* Make sure we have a zero-sized array. */
10431
@@ -294,8 +293,7 @@
10435
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10436
- * extent[rank-1];
10437
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10439
retarray->offset = 0;
10440
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10441
@@ -307,7 +305,7 @@
10445
- retarray->base_addr = xmalloc (alloc_size);
10446
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10450
@@ -485,8 +483,7 @@
10451
retarray->offset = 0;
10452
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10454
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10455
- * extent[rank-1];
10456
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10458
if (alloc_size == 0)
10460
@@ -495,7 +492,7 @@
10464
- retarray->base_addr = xmalloc (alloc_size);
10465
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10469
Index: libgfortran/generated/maxloc1_16_i4.c
10470
===================================================================
10471
--- a/src/libgfortran/generated/maxloc1_16_i4.c (.../tags/gcc_4_8_3_release)
10472
+++ b/src/libgfortran/generated/maxloc1_16_i4.c (.../branches/gcc-4_8-branch)
10474
retarray->offset = 0;
10475
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10477
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10478
- * extent[rank-1];
10479
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10481
- retarray->base_addr = xmalloc (alloc_size);
10482
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10483
if (alloc_size == 0)
10485
/* Make sure we have a zero-sized array. */
10486
@@ -294,8 +293,7 @@
10490
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10491
- * extent[rank-1];
10492
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10494
retarray->offset = 0;
10495
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10496
@@ -307,7 +305,7 @@
10500
- retarray->base_addr = xmalloc (alloc_size);
10501
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10505
@@ -485,8 +483,7 @@
10506
retarray->offset = 0;
10507
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10509
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10510
- * extent[rank-1];
10511
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10513
if (alloc_size == 0)
10515
@@ -495,7 +492,7 @@
10519
- retarray->base_addr = xmalloc (alloc_size);
10520
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
10524
Index: libgfortran/generated/spread_i1.c
10525
===================================================================
10526
--- a/src/libgfortran/generated/spread_i1.c (.../tags/gcc_4_8_3_release)
10527
+++ b/src/libgfortran/generated/spread_i1.c (.../branches/gcc-4_8-branch)
10528
@@ -101,8 +101,8 @@
10532
- /* xmalloc allocates a single byte for zero size. */
10533
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
10534
+ /* xmallocarray allocates a single byte for zero size. */
10535
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
10539
@@ -244,7 +244,7 @@
10541
if (ret->base_addr == NULL)
10543
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
10544
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
10546
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
10548
Index: libgfortran/generated/maxloc0_16_i8.c
10549
===================================================================
10550
--- a/src/libgfortran/generated/maxloc0_16_i8.c (.../tags/gcc_4_8_3_release)
10551
+++ b/src/libgfortran/generated/maxloc0_16_i8.c (.../branches/gcc-4_8-branch)
10553
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10554
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10555
retarray->offset = 0;
10556
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10557
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10561
@@ -199,7 +199,7 @@
10562
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10563
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10564
retarray->offset = 0;
10565
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10566
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10570
@@ -367,7 +367,7 @@
10571
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10572
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10573
retarray->offset = 0;
10574
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10575
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10577
else if (unlikely (compile_options.bounds_check))
10579
Index: libgfortran/generated/maxval_r16.c
10580
===================================================================
10581
--- a/src/libgfortran/generated/maxval_r16.c (.../tags/gcc_4_8_3_release)
10582
+++ b/src/libgfortran/generated/maxval_r16.c (.../branches/gcc-4_8-branch)
10584
retarray->offset = 0;
10585
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10587
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10588
- * extent[rank-1];
10589
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10591
- retarray->base_addr = xmalloc (alloc_size);
10592
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10593
if (alloc_size == 0)
10595
/* Make sure we have a zero-sized array. */
10596
@@ -286,8 +285,7 @@
10600
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10601
- * extent[rank-1];
10602
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10604
retarray->offset = 0;
10605
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10606
@@ -299,7 +297,7 @@
10610
- retarray->base_addr = xmalloc (alloc_size);
10611
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10615
@@ -472,8 +470,7 @@
10616
retarray->offset = 0;
10617
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10619
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10620
- * extent[rank-1];
10621
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10623
if (alloc_size == 0)
10625
@@ -482,7 +479,7 @@
10629
- retarray->base_addr = xmalloc (alloc_size);
10630
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
10634
Index: libgfortran/generated/product_c10.c
10635
===================================================================
10636
--- a/src/libgfortran/generated/product_c10.c (.../tags/gcc_4_8_3_release)
10637
+++ b/src/libgfortran/generated/product_c10.c (.../branches/gcc-4_8-branch)
10639
retarray->offset = 0;
10640
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10642
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10643
- * extent[rank-1];
10644
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10646
- retarray->base_addr = xmalloc (alloc_size);
10647
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
10648
if (alloc_size == 0)
10650
/* Make sure we have a zero-sized array. */
10651
@@ -272,8 +271,7 @@
10655
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10656
- * extent[rank-1];
10657
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10659
retarray->offset = 0;
10660
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10661
@@ -285,7 +283,7 @@
10665
- retarray->base_addr = xmalloc (alloc_size);
10666
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
10670
@@ -430,8 +428,7 @@
10671
retarray->offset = 0;
10672
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10674
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10675
- * extent[rank-1];
10676
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10678
if (alloc_size == 0)
10680
@@ -440,7 +437,7 @@
10684
- retarray->base_addr = xmalloc (alloc_size);
10685
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
10689
Index: libgfortran/generated/minloc1_8_i4.c
10690
===================================================================
10691
--- a/src/libgfortran/generated/minloc1_8_i4.c (.../tags/gcc_4_8_3_release)
10692
+++ b/src/libgfortran/generated/minloc1_8_i4.c (.../branches/gcc-4_8-branch)
10694
retarray->offset = 0;
10695
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10697
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10698
- * extent[rank-1];
10699
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10701
- retarray->base_addr = xmalloc (alloc_size);
10702
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10703
if (alloc_size == 0)
10705
/* Make sure we have a zero-sized array. */
10706
@@ -294,8 +293,7 @@
10710
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10711
- * extent[rank-1];
10712
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10714
retarray->offset = 0;
10715
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10716
@@ -307,7 +305,7 @@
10720
- retarray->base_addr = xmalloc (alloc_size);
10721
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10725
@@ -485,8 +483,7 @@
10726
retarray->offset = 0;
10727
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10729
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10730
- * extent[rank-1];
10731
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10733
if (alloc_size == 0)
10735
@@ -495,7 +492,7 @@
10739
- retarray->base_addr = xmalloc (alloc_size);
10740
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
10744
Index: libgfortran/generated/minloc0_16_i16.c
10745
===================================================================
10746
--- a/src/libgfortran/generated/minloc0_16_i16.c (.../tags/gcc_4_8_3_release)
10747
+++ b/src/libgfortran/generated/minloc0_16_i16.c (.../branches/gcc-4_8-branch)
10749
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10750
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10751
retarray->offset = 0;
10752
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10753
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10757
@@ -199,7 +199,7 @@
10758
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10759
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10760
retarray->offset = 0;
10761
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10762
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10766
@@ -367,7 +367,7 @@
10767
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10768
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10769
retarray->offset = 0;
10770
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
10771
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
10773
else if (unlikely (compile_options.bounds_check))
10775
Index: libgfortran/generated/matmul_r16.c
10776
===================================================================
10777
--- a/src/libgfortran/generated/matmul_r16.c (.../tags/gcc_4_8_3_release)
10778
+++ b/src/libgfortran/generated/matmul_r16.c (.../branches/gcc-4_8-branch)
10779
@@ -124,7 +124,7 @@
10782
retarray->base_addr
10783
- = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
10784
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
10785
retarray->offset = 0;
10787
else if (unlikely (compile_options.bounds_check))
10788
Index: libgfortran/generated/minloc0_4_r4.c
10789
===================================================================
10790
--- a/src/libgfortran/generated/minloc0_4_r4.c (.../tags/gcc_4_8_3_release)
10791
+++ b/src/libgfortran/generated/minloc0_4_r4.c (.../branches/gcc-4_8-branch)
10793
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10794
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10795
retarray->offset = 0;
10796
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10797
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10801
@@ -199,7 +199,7 @@
10802
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10803
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10804
retarray->offset = 0;
10805
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10806
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10810
@@ -367,7 +367,7 @@
10811
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10812
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10813
retarray->offset = 0;
10814
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10815
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10817
else if (unlikely (compile_options.bounds_check))
10819
Index: libgfortran/generated/iany_i2.c
10820
===================================================================
10821
--- a/src/libgfortran/generated/iany_i2.c (.../tags/gcc_4_8_3_release)
10822
+++ b/src/libgfortran/generated/iany_i2.c (.../branches/gcc-4_8-branch)
10824
retarray->offset = 0;
10825
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10827
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10828
- * extent[rank-1];
10829
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10831
- retarray->base_addr = xmalloc (alloc_size);
10832
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10833
if (alloc_size == 0)
10835
/* Make sure we have a zero-sized array. */
10836
@@ -272,8 +271,7 @@
10840
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10841
- * extent[rank-1];
10842
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10844
retarray->offset = 0;
10845
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10846
@@ -285,7 +283,7 @@
10850
- retarray->base_addr = xmalloc (alloc_size);
10851
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10855
@@ -430,8 +428,7 @@
10856
retarray->offset = 0;
10857
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10859
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10860
- * extent[rank-1];
10861
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10863
if (alloc_size == 0)
10865
@@ -440,7 +437,7 @@
10869
- retarray->base_addr = xmalloc (alloc_size);
10870
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
10874
Index: libgfortran/generated/sum_r4.c
10875
===================================================================
10876
--- a/src/libgfortran/generated/sum_r4.c (.../tags/gcc_4_8_3_release)
10877
+++ b/src/libgfortran/generated/sum_r4.c (.../branches/gcc-4_8-branch)
10879
retarray->offset = 0;
10880
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10882
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10883
- * extent[rank-1];
10884
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10886
- retarray->base_addr = xmalloc (alloc_size);
10887
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
10888
if (alloc_size == 0)
10890
/* Make sure we have a zero-sized array. */
10891
@@ -272,8 +271,7 @@
10895
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10896
- * extent[rank-1];
10897
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10899
retarray->offset = 0;
10900
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10901
@@ -285,7 +283,7 @@
10905
- retarray->base_addr = xmalloc (alloc_size);
10906
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
10910
@@ -430,8 +428,7 @@
10911
retarray->offset = 0;
10912
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10914
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10915
- * extent[rank-1];
10916
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10918
if (alloc_size == 0)
10920
@@ -440,7 +437,7 @@
10924
- retarray->base_addr = xmalloc (alloc_size);
10925
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
10929
Index: libgfortran/generated/unpack_c8.c
10930
===================================================================
10931
--- a/src/libgfortran/generated/unpack_c8.c (.../tags/gcc_4_8_3_release)
10932
+++ b/src/libgfortran/generated/unpack_c8.c (.../branches/gcc-4_8-branch)
10937
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
10938
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
10942
@@ -244,7 +244,7 @@
10946
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
10947
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
10951
Index: libgfortran/generated/in_pack_c16.c
10952
===================================================================
10953
--- a/src/libgfortran/generated/in_pack_c16.c (.../tags/gcc_4_8_3_release)
10954
+++ b/src/libgfortran/generated/in_pack_c16.c (.../branches/gcc-4_8-branch)
10956
return source->base_addr;
10958
/* Allocate storage for the destination. */
10959
- destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
10960
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
10962
src = source->base_addr;
10963
stride0 = stride[0];
10964
Index: libgfortran/generated/minloc0_4_i2.c
10965
===================================================================
10966
--- a/src/libgfortran/generated/minloc0_4_i2.c (.../tags/gcc_4_8_3_release)
10967
+++ b/src/libgfortran/generated/minloc0_4_i2.c (.../branches/gcc-4_8-branch)
10969
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10970
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10971
retarray->offset = 0;
10972
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10973
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10977
@@ -199,7 +199,7 @@
10978
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10979
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10980
retarray->offset = 0;
10981
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10982
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10986
@@ -367,7 +367,7 @@
10987
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10988
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10989
retarray->offset = 0;
10990
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
10991
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
10993
else if (unlikely (compile_options.bounds_check))
10995
Index: libgfortran/generated/spread_c10.c
10996
===================================================================
10997
--- a/src/libgfortran/generated/spread_c10.c (.../tags/gcc_4_8_3_release)
10998
+++ b/src/libgfortran/generated/spread_c10.c (.../branches/gcc-4_8-branch)
10999
@@ -101,8 +101,8 @@
11003
- /* xmalloc allocates a single byte for zero size. */
11004
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
11005
+ /* xmallocarray allocates a single byte for zero size. */
11006
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
11010
@@ -244,7 +244,7 @@
11012
if (ret->base_addr == NULL)
11014
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
11015
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
11017
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11019
Index: libgfortran/generated/maxloc0_8_i1.c
11020
===================================================================
11021
--- a/src/libgfortran/generated/maxloc0_8_i1.c (.../tags/gcc_4_8_3_release)
11022
+++ b/src/libgfortran/generated/maxloc0_8_i1.c (.../branches/gcc-4_8-branch)
11024
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11025
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11026
retarray->offset = 0;
11027
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11028
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11032
@@ -199,7 +199,7 @@
11033
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11034
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11035
retarray->offset = 0;
11036
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11037
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11041
@@ -367,7 +367,7 @@
11042
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11043
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11044
retarray->offset = 0;
11045
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11046
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11048
else if (unlikely (compile_options.bounds_check))
11050
Index: libgfortran/generated/spread_r4.c
11051
===================================================================
11052
--- a/src/libgfortran/generated/spread_r4.c (.../tags/gcc_4_8_3_release)
11053
+++ b/src/libgfortran/generated/spread_r4.c (.../branches/gcc-4_8-branch)
11054
@@ -101,8 +101,8 @@
11058
- /* xmalloc allocates a single byte for zero size. */
11059
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
11060
+ /* xmallocarray allocates a single byte for zero size. */
11061
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
11065
@@ -244,7 +244,7 @@
11067
if (ret->base_addr == NULL)
11069
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
11070
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
11072
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11074
Index: libgfortran/generated/minloc0_8_i8.c
11075
===================================================================
11076
--- a/src/libgfortran/generated/minloc0_8_i8.c (.../tags/gcc_4_8_3_release)
11077
+++ b/src/libgfortran/generated/minloc0_8_i8.c (.../branches/gcc-4_8-branch)
11079
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11080
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11081
retarray->offset = 0;
11082
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11083
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11087
@@ -199,7 +199,7 @@
11088
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11089
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11090
retarray->offset = 0;
11091
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11092
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11096
@@ -367,7 +367,7 @@
11097
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11098
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11099
retarray->offset = 0;
11100
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11101
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11103
else if (unlikely (compile_options.bounds_check))
11105
Index: libgfortran/generated/matmul_c8.c
11106
===================================================================
11107
--- a/src/libgfortran/generated/matmul_c8.c (.../tags/gcc_4_8_3_release)
11108
+++ b/src/libgfortran/generated/matmul_c8.c (.../branches/gcc-4_8-branch)
11109
@@ -124,7 +124,7 @@
11112
retarray->base_addr
11113
- = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
11114
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
11115
retarray->offset = 0;
11117
else if (unlikely (compile_options.bounds_check))
11118
Index: libgfortran/generated/minloc1_16_r10.c
11119
===================================================================
11120
--- a/src/libgfortran/generated/minloc1_16_r10.c (.../tags/gcc_4_8_3_release)
11121
+++ b/src/libgfortran/generated/minloc1_16_r10.c (.../branches/gcc-4_8-branch)
11123
retarray->offset = 0;
11124
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11126
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11127
- * extent[rank-1];
11128
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11130
- retarray->base_addr = xmalloc (alloc_size);
11131
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11132
if (alloc_size == 0)
11134
/* Make sure we have a zero-sized array. */
11135
@@ -294,8 +293,7 @@
11139
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11140
- * extent[rank-1];
11141
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11143
retarray->offset = 0;
11144
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11145
@@ -307,7 +305,7 @@
11149
- retarray->base_addr = xmalloc (alloc_size);
11150
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11154
@@ -485,8 +483,7 @@
11155
retarray->offset = 0;
11156
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11158
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11159
- * extent[rank-1];
11160
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11162
if (alloc_size == 0)
11164
@@ -495,7 +492,7 @@
11168
- retarray->base_addr = xmalloc (alloc_size);
11169
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11173
Index: libgfortran/generated/sum_i2.c
11174
===================================================================
11175
--- a/src/libgfortran/generated/sum_i2.c (.../tags/gcc_4_8_3_release)
11176
+++ b/src/libgfortran/generated/sum_i2.c (.../branches/gcc-4_8-branch)
11178
retarray->offset = 0;
11179
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11181
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11182
- * extent[rank-1];
11183
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11185
- retarray->base_addr = xmalloc (alloc_size);
11186
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11187
if (alloc_size == 0)
11189
/* Make sure we have a zero-sized array. */
11190
@@ -272,8 +271,7 @@
11194
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11195
- * extent[rank-1];
11196
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11198
retarray->offset = 0;
11199
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11200
@@ -285,7 +283,7 @@
11204
- retarray->base_addr = xmalloc (alloc_size);
11205
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11209
@@ -430,8 +428,7 @@
11210
retarray->offset = 0;
11211
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11213
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11214
- * extent[rank-1];
11215
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11217
if (alloc_size == 0)
11219
@@ -440,7 +437,7 @@
11223
- retarray->base_addr = xmalloc (alloc_size);
11224
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11228
Index: libgfortran/generated/iparity_i16.c
11229
===================================================================
11230
--- a/src/libgfortran/generated/iparity_i16.c (.../tags/gcc_4_8_3_release)
11231
+++ b/src/libgfortran/generated/iparity_i16.c (.../branches/gcc-4_8-branch)
11233
retarray->offset = 0;
11234
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11236
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11237
- * extent[rank-1];
11238
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11240
- retarray->base_addr = xmalloc (alloc_size);
11241
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11242
if (alloc_size == 0)
11244
/* Make sure we have a zero-sized array. */
11245
@@ -272,8 +271,7 @@
11249
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11250
- * extent[rank-1];
11251
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11253
retarray->offset = 0;
11254
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11255
@@ -285,7 +283,7 @@
11259
- retarray->base_addr = xmalloc (alloc_size);
11260
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11264
@@ -430,8 +428,7 @@
11265
retarray->offset = 0;
11266
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11268
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11269
- * extent[rank-1];
11270
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11272
if (alloc_size == 0)
11274
@@ -440,7 +437,7 @@
11278
- retarray->base_addr = xmalloc (alloc_size);
11279
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11283
Index: libgfortran/generated/minloc0_16_i1.c
11284
===================================================================
11285
--- a/src/libgfortran/generated/minloc0_16_i1.c (.../tags/gcc_4_8_3_release)
11286
+++ b/src/libgfortran/generated/minloc0_16_i1.c (.../branches/gcc-4_8-branch)
11288
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11289
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11290
retarray->offset = 0;
11291
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11292
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11296
@@ -199,7 +199,7 @@
11297
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11298
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11299
retarray->offset = 0;
11300
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11301
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11305
@@ -367,7 +367,7 @@
11306
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11307
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11308
retarray->offset = 0;
11309
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11310
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11312
else if (unlikely (compile_options.bounds_check))
11314
Index: libgfortran/generated/reshape_c16.c
11315
===================================================================
11316
--- a/src/libgfortran/generated/reshape_c16.c (.../tags/gcc_4_8_3_release)
11317
+++ b/src/libgfortran/generated/reshape_c16.c (.../branches/gcc-4_8-branch)
11318
@@ -111,11 +111,11 @@
11321
if (unlikely (rs < 1))
11325
- alloc_size = rs * sizeof (GFC_COMPLEX_16);
11328
- ret->base_addr = xmalloc (alloc_size);
11329
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
11330
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
11333
Index: libgfortran/generated/pack_c4.c
11334
===================================================================
11335
--- a/src/libgfortran/generated/pack_c4.c (.../tags/gcc_4_8_3_release)
11336
+++ b/src/libgfortran/generated/pack_c4.c (.../branches/gcc-4_8-branch)
11337
@@ -167,8 +167,8 @@
11341
- /* xmalloc allocates a single byte for zero size. */
11342
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
11343
+ /* xmallocarray allocates a single byte for zero size. */
11344
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
11348
Index: libgfortran/generated/parity_l4.c
11349
===================================================================
11350
--- a/src/libgfortran/generated/parity_l4.c (.../tags/gcc_4_8_3_release)
11351
+++ b/src/libgfortran/generated/parity_l4.c (.../branches/gcc-4_8-branch)
11353
retarray->offset = 0;
11354
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11356
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11357
- * extent[rank-1];
11358
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11360
- retarray->base_addr = xmalloc (alloc_size);
11361
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
11362
if (alloc_size == 0)
11364
/* Make sure we have a zero-sized array. */
11365
Index: libgfortran/generated/spread_i2.c
11366
===================================================================
11367
--- a/src/libgfortran/generated/spread_i2.c (.../tags/gcc_4_8_3_release)
11368
+++ b/src/libgfortran/generated/spread_i2.c (.../branches/gcc-4_8-branch)
11369
@@ -101,8 +101,8 @@
11373
- /* xmalloc allocates a single byte for zero size. */
11374
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
11375
+ /* xmallocarray allocates a single byte for zero size. */
11376
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
11380
@@ -244,7 +244,7 @@
11382
if (ret->base_addr == NULL)
11384
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
11385
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
11387
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11389
Index: libgfortran/generated/any_l4.c
11390
===================================================================
11391
--- a/src/libgfortran/generated/any_l4.c (.../tags/gcc_4_8_3_release)
11392
+++ b/src/libgfortran/generated/any_l4.c (.../branches/gcc-4_8-branch)
11393
@@ -101,8 +101,7 @@
11394
retarray->offset = 0;
11395
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11397
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11398
- * extent[rank-1];
11399
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11401
if (alloc_size == 0)
11403
@@ -111,7 +110,7 @@
11407
- retarray->base_addr = xmalloc (alloc_size);
11408
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
11412
Index: libgfortran/generated/maxloc1_4_i8.c
11413
===================================================================
11414
--- a/src/libgfortran/generated/maxloc1_4_i8.c (.../tags/gcc_4_8_3_release)
11415
+++ b/src/libgfortran/generated/maxloc1_4_i8.c (.../branches/gcc-4_8-branch)
11417
retarray->offset = 0;
11418
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11420
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11421
- * extent[rank-1];
11422
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11424
- retarray->base_addr = xmalloc (alloc_size);
11425
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11426
if (alloc_size == 0)
11428
/* Make sure we have a zero-sized array. */
11429
@@ -294,8 +293,7 @@
11433
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11434
- * extent[rank-1];
11435
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11437
retarray->offset = 0;
11438
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11439
@@ -307,7 +305,7 @@
11443
- retarray->base_addr = xmalloc (alloc_size);
11444
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11448
@@ -485,8 +483,7 @@
11449
retarray->offset = 0;
11450
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11452
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11453
- * extent[rank-1];
11454
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11456
if (alloc_size == 0)
11458
@@ -495,7 +492,7 @@
11462
- retarray->base_addr = xmalloc (alloc_size);
11463
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11467
Index: libgfortran/generated/maxloc0_8_r4.c
11468
===================================================================
11469
--- a/src/libgfortran/generated/maxloc0_8_r4.c (.../tags/gcc_4_8_3_release)
11470
+++ b/src/libgfortran/generated/maxloc0_8_r4.c (.../branches/gcc-4_8-branch)
11472
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11473
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11474
retarray->offset = 0;
11475
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11476
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11480
@@ -199,7 +199,7 @@
11481
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11482
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11483
retarray->offset = 0;
11484
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11485
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11489
@@ -367,7 +367,7 @@
11490
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11491
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11492
retarray->offset = 0;
11493
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11494
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11496
else if (unlikely (compile_options.bounds_check))
11498
Index: libgfortran/generated/maxloc1_4_i16.c
11499
===================================================================
11500
--- a/src/libgfortran/generated/maxloc1_4_i16.c (.../tags/gcc_4_8_3_release)
11501
+++ b/src/libgfortran/generated/maxloc1_4_i16.c (.../branches/gcc-4_8-branch)
11503
retarray->offset = 0;
11504
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11506
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11507
- * extent[rank-1];
11508
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11510
- retarray->base_addr = xmalloc (alloc_size);
11511
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11512
if (alloc_size == 0)
11514
/* Make sure we have a zero-sized array. */
11515
@@ -294,8 +293,7 @@
11519
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11520
- * extent[rank-1];
11521
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11523
retarray->offset = 0;
11524
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11525
@@ -307,7 +305,7 @@
11529
- retarray->base_addr = xmalloc (alloc_size);
11530
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11534
@@ -485,8 +483,7 @@
11535
retarray->offset = 0;
11536
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11538
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11539
- * extent[rank-1];
11540
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11542
if (alloc_size == 0)
11544
@@ -495,7 +492,7 @@
11548
- retarray->base_addr = xmalloc (alloc_size);
11549
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11553
Index: libgfortran/generated/minloc0_4_r10.c
11554
===================================================================
11555
--- a/src/libgfortran/generated/minloc0_4_r10.c (.../tags/gcc_4_8_3_release)
11556
+++ b/src/libgfortran/generated/minloc0_4_r10.c (.../branches/gcc-4_8-branch)
11558
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11559
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11560
retarray->offset = 0;
11561
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11562
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11566
@@ -199,7 +199,7 @@
11567
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11568
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11569
retarray->offset = 0;
11570
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11571
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11575
@@ -367,7 +367,7 @@
11576
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11577
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11578
retarray->offset = 0;
11579
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11580
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11582
else if (unlikely (compile_options.bounds_check))
11584
Index: libgfortran/generated/minloc0_8_i16.c
11585
===================================================================
11586
--- a/src/libgfortran/generated/minloc0_8_i16.c (.../tags/gcc_4_8_3_release)
11587
+++ b/src/libgfortran/generated/minloc0_8_i16.c (.../branches/gcc-4_8-branch)
11589
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11590
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11591
retarray->offset = 0;
11592
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11593
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11597
@@ -199,7 +199,7 @@
11598
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11599
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11600
retarray->offset = 0;
11601
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11602
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11606
@@ -367,7 +367,7 @@
11607
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11608
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11609
retarray->offset = 0;
11610
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11611
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11613
else if (unlikely (compile_options.bounds_check))
11615
Index: libgfortran/generated/minloc1_8_r10.c
11616
===================================================================
11617
--- a/src/libgfortran/generated/minloc1_8_r10.c (.../tags/gcc_4_8_3_release)
11618
+++ b/src/libgfortran/generated/minloc1_8_r10.c (.../branches/gcc-4_8-branch)
11620
retarray->offset = 0;
11621
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11623
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11624
- * extent[rank-1];
11625
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11627
- retarray->base_addr = xmalloc (alloc_size);
11628
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11629
if (alloc_size == 0)
11631
/* Make sure we have a zero-sized array. */
11632
@@ -294,8 +293,7 @@
11636
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11637
- * extent[rank-1];
11638
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11640
retarray->offset = 0;
11641
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11642
@@ -307,7 +305,7 @@
11646
- retarray->base_addr = xmalloc (alloc_size);
11647
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11651
@@ -485,8 +483,7 @@
11652
retarray->offset = 0;
11653
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11655
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11656
- * extent[rank-1];
11657
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11659
if (alloc_size == 0)
11661
@@ -495,7 +492,7 @@
11665
- retarray->base_addr = xmalloc (alloc_size);
11666
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11670
Index: libgfortran/generated/minloc0_16_r4.c
11671
===================================================================
11672
--- a/src/libgfortran/generated/minloc0_16_r4.c (.../tags/gcc_4_8_3_release)
11673
+++ b/src/libgfortran/generated/minloc0_16_r4.c (.../branches/gcc-4_8-branch)
11675
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11676
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11677
retarray->offset = 0;
11678
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11679
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11683
@@ -199,7 +199,7 @@
11684
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11685
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11686
retarray->offset = 0;
11687
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11688
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11692
@@ -367,7 +367,7 @@
11693
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11694
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11695
retarray->offset = 0;
11696
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11697
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11699
else if (unlikely (compile_options.bounds_check))
11701
Index: libgfortran/generated/product_i4.c
11702
===================================================================
11703
--- a/src/libgfortran/generated/product_i4.c (.../tags/gcc_4_8_3_release)
11704
+++ b/src/libgfortran/generated/product_i4.c (.../branches/gcc-4_8-branch)
11706
retarray->offset = 0;
11707
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11709
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11710
- * extent[rank-1];
11711
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11713
- retarray->base_addr = xmalloc (alloc_size);
11714
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11715
if (alloc_size == 0)
11717
/* Make sure we have a zero-sized array. */
11718
@@ -272,8 +271,7 @@
11722
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11723
- * extent[rank-1];
11724
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11726
retarray->offset = 0;
11727
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11728
@@ -285,7 +283,7 @@
11732
- retarray->base_addr = xmalloc (alloc_size);
11733
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11737
@@ -430,8 +428,7 @@
11738
retarray->offset = 0;
11739
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11741
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11742
- * extent[rank-1];
11743
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11745
if (alloc_size == 0)
11747
@@ -440,7 +437,7 @@
11751
- retarray->base_addr = xmalloc (alloc_size);
11752
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11756
Index: libgfortran/generated/sum_c16.c
11757
===================================================================
11758
--- a/src/libgfortran/generated/sum_c16.c (.../tags/gcc_4_8_3_release)
11759
+++ b/src/libgfortran/generated/sum_c16.c (.../branches/gcc-4_8-branch)
11761
retarray->offset = 0;
11762
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11764
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11765
- * extent[rank-1];
11766
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11768
- retarray->base_addr = xmalloc (alloc_size);
11769
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
11770
if (alloc_size == 0)
11772
/* Make sure we have a zero-sized array. */
11773
@@ -272,8 +271,7 @@
11777
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11778
- * extent[rank-1];
11779
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11781
retarray->offset = 0;
11782
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11783
@@ -285,7 +283,7 @@
11787
- retarray->base_addr = xmalloc (alloc_size);
11788
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
11792
@@ -430,8 +428,7 @@
11793
retarray->offset = 0;
11794
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11796
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11797
- * extent[rank-1];
11798
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11800
if (alloc_size == 0)
11802
@@ -440,7 +437,7 @@
11806
- retarray->base_addr = xmalloc (alloc_size);
11807
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
11811
Index: libgfortran/generated/transpose_c10.c
11812
===================================================================
11813
--- a/src/libgfortran/generated/transpose_c10.c (.../tags/gcc_4_8_3_release)
11814
+++ b/src/libgfortran/generated/transpose_c10.c (.../branches/gcc-4_8-branch)
11816
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11817
GFC_DESCRIPTOR_EXTENT(source, 1));
11819
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
11820
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11821
+ sizeof (GFC_COMPLEX_10));
11823
} else if (unlikely (compile_options.bounds_check))
11825
Index: libgfortran/generated/maxloc1_16_r8.c
11826
===================================================================
11827
--- a/src/libgfortran/generated/maxloc1_16_r8.c (.../tags/gcc_4_8_3_release)
11828
+++ b/src/libgfortran/generated/maxloc1_16_r8.c (.../branches/gcc-4_8-branch)
11830
retarray->offset = 0;
11831
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11833
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11834
- * extent[rank-1];
11835
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11837
- retarray->base_addr = xmalloc (alloc_size);
11838
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11839
if (alloc_size == 0)
11841
/* Make sure we have a zero-sized array. */
11842
@@ -294,8 +293,7 @@
11846
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11847
- * extent[rank-1];
11848
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11850
retarray->offset = 0;
11851
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11852
@@ -307,7 +305,7 @@
11856
- retarray->base_addr = xmalloc (alloc_size);
11857
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11861
@@ -485,8 +483,7 @@
11862
retarray->offset = 0;
11863
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11865
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11866
- * extent[rank-1];
11867
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11869
if (alloc_size == 0)
11871
@@ -495,7 +492,7 @@
11875
- retarray->base_addr = xmalloc (alloc_size);
11876
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11880
Index: libgfortran/generated/transpose_r4.c
11881
===================================================================
11882
--- a/src/libgfortran/generated/transpose_r4.c (.../tags/gcc_4_8_3_release)
11883
+++ b/src/libgfortran/generated/transpose_r4.c (.../branches/gcc-4_8-branch)
11885
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11886
GFC_DESCRIPTOR_EXTENT(source, 1));
11888
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
11889
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11890
+ sizeof (GFC_REAL_4));
11892
} else if (unlikely (compile_options.bounds_check))
11894
Index: libgfortran/generated/cshift1_4.c
11895
===================================================================
11896
--- a/src/libgfortran/generated/cshift1_4.c (.../tags/gcc_4_8_3_release)
11897
+++ b/src/libgfortran/generated/cshift1_4.c (.../branches/gcc-4_8-branch)
11902
- ret->base_addr = xmalloc (size * arraysize);
11903
+ ret->base_addr = xmallocarray (arraysize, size);
11905
ret->dtype = array->dtype;
11906
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
11907
Index: libgfortran/generated/maxloc0_8_i2.c
11908
===================================================================
11909
--- a/src/libgfortran/generated/maxloc0_8_i2.c (.../tags/gcc_4_8_3_release)
11910
+++ b/src/libgfortran/generated/maxloc0_8_i2.c (.../branches/gcc-4_8-branch)
11912
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11913
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11914
retarray->offset = 0;
11915
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11916
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11920
@@ -199,7 +199,7 @@
11921
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11922
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11923
retarray->offset = 0;
11924
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11925
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11929
@@ -367,7 +367,7 @@
11930
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11931
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11932
retarray->offset = 0;
11933
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
11934
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
11936
else if (unlikely (compile_options.bounds_check))
11938
Index: libgfortran/generated/count_8_l.c
11939
===================================================================
11940
--- a/src/libgfortran/generated/count_8_l.c (.../tags/gcc_4_8_3_release)
11941
+++ b/src/libgfortran/generated/count_8_l.c (.../branches/gcc-4_8-branch)
11942
@@ -101,8 +101,7 @@
11943
retarray->offset = 0;
11944
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11946
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11947
- * extent[rank-1];
11948
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11950
if (alloc_size == 0)
11952
@@ -111,7 +110,7 @@
11956
- retarray->base_addr = xmalloc (alloc_size);
11957
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11961
Index: libgfortran/generated/in_pack_i4.c
11962
===================================================================
11963
--- a/src/libgfortran/generated/in_pack_i4.c (.../tags/gcc_4_8_3_release)
11964
+++ b/src/libgfortran/generated/in_pack_i4.c (.../branches/gcc-4_8-branch)
11966
return source->base_addr;
11968
/* Allocate storage for the destination. */
11969
- destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
11970
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
11972
src = source->base_addr;
11973
stride0 = stride[0];
11974
Index: libgfortran/generated/minloc0_16_i2.c
11975
===================================================================
11976
--- a/src/libgfortran/generated/minloc0_16_i2.c (.../tags/gcc_4_8_3_release)
11977
+++ b/src/libgfortran/generated/minloc0_16_i2.c (.../branches/gcc-4_8-branch)
11979
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11980
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11981
retarray->offset = 0;
11982
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11983
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11987
@@ -199,7 +199,7 @@
11988
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11989
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11990
retarray->offset = 0;
11991
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11992
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11996
@@ -367,7 +367,7 @@
11997
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11998
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11999
retarray->offset = 0;
12000
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12001
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12003
else if (unlikely (compile_options.bounds_check))
12005
Index: libgfortran/generated/minloc1_8_r8.c
12006
===================================================================
12007
--- a/src/libgfortran/generated/minloc1_8_r8.c (.../tags/gcc_4_8_3_release)
12008
+++ b/src/libgfortran/generated/minloc1_8_r8.c (.../branches/gcc-4_8-branch)
12010
retarray->offset = 0;
12011
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12013
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12014
- * extent[rank-1];
12015
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12017
- retarray->base_addr = xmalloc (alloc_size);
12018
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12019
if (alloc_size == 0)
12021
/* Make sure we have a zero-sized array. */
12022
@@ -294,8 +293,7 @@
12026
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12027
- * extent[rank-1];
12028
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12030
retarray->offset = 0;
12031
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12032
@@ -307,7 +305,7 @@
12036
- retarray->base_addr = xmalloc (alloc_size);
12037
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12041
@@ -485,8 +483,7 @@
12042
retarray->offset = 0;
12043
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12045
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12046
- * extent[rank-1];
12047
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12049
if (alloc_size == 0)
12051
@@ -495,7 +492,7 @@
12055
- retarray->base_addr = xmalloc (alloc_size);
12056
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12060
Index: libgfortran/generated/matmul_c16.c
12061
===================================================================
12062
--- a/src/libgfortran/generated/matmul_c16.c (.../tags/gcc_4_8_3_release)
12063
+++ b/src/libgfortran/generated/matmul_c16.c (.../branches/gcc-4_8-branch)
12064
@@ -124,7 +124,7 @@
12067
retarray->base_addr
12068
- = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
12069
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
12070
retarray->offset = 0;
12072
else if (unlikely (compile_options.bounds_check))
12073
Index: libgfortran/generated/minval_i1.c
12074
===================================================================
12075
--- a/src/libgfortran/generated/minval_i1.c (.../tags/gcc_4_8_3_release)
12076
+++ b/src/libgfortran/generated/minval_i1.c (.../branches/gcc-4_8-branch)
12078
retarray->offset = 0;
12079
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12081
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12082
- * extent[rank-1];
12083
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12085
- retarray->base_addr = xmalloc (alloc_size);
12086
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12087
if (alloc_size == 0)
12089
/* Make sure we have a zero-sized array. */
12090
@@ -286,8 +285,7 @@
12094
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12095
- * extent[rank-1];
12096
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12098
retarray->offset = 0;
12099
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12100
@@ -299,7 +297,7 @@
12104
- retarray->base_addr = xmalloc (alloc_size);
12105
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12109
@@ -472,8 +470,7 @@
12110
retarray->offset = 0;
12111
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12113
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12114
- * extent[rank-1];
12115
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12117
if (alloc_size == 0)
12119
@@ -482,7 +479,7 @@
12123
- retarray->base_addr = xmalloc (alloc_size);
12124
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
12128
Index: libgfortran/generated/shape_i16.c
12129
===================================================================
12130
--- a/src/libgfortran/generated/shape_i16.c (.../tags/gcc_4_8_3_release)
12131
+++ b/src/libgfortran/generated/shape_i16.c (.../branches/gcc-4_8-branch)
12134
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
12136
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12137
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12140
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
12141
Index: libgfortran/generated/iany_i4.c
12142
===================================================================
12143
--- a/src/libgfortran/generated/iany_i4.c (.../tags/gcc_4_8_3_release)
12144
+++ b/src/libgfortran/generated/iany_i4.c (.../branches/gcc-4_8-branch)
12146
retarray->offset = 0;
12147
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12149
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12150
- * extent[rank-1];
12151
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12153
- retarray->base_addr = xmalloc (alloc_size);
12154
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12155
if (alloc_size == 0)
12157
/* Make sure we have a zero-sized array. */
12158
@@ -272,8 +271,7 @@
12162
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12163
- * extent[rank-1];
12164
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12166
retarray->offset = 0;
12167
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12168
@@ -285,7 +283,7 @@
12172
- retarray->base_addr = xmalloc (alloc_size);
12173
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12177
@@ -430,8 +428,7 @@
12178
retarray->offset = 0;
12179
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12181
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12182
- * extent[rank-1];
12183
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12185
if (alloc_size == 0)
12187
@@ -440,7 +437,7 @@
12191
- retarray->base_addr = xmalloc (alloc_size);
12192
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12196
Index: libgfortran/generated/minloc0_16_r16.c
12197
===================================================================
12198
--- a/src/libgfortran/generated/minloc0_16_r16.c (.../tags/gcc_4_8_3_release)
12199
+++ b/src/libgfortran/generated/minloc0_16_r16.c (.../branches/gcc-4_8-branch)
12201
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12202
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12203
retarray->offset = 0;
12204
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12205
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12209
@@ -199,7 +199,7 @@
12210
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12211
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12212
retarray->offset = 0;
12213
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12214
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12218
@@ -367,7 +367,7 @@
12219
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12220
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12221
retarray->offset = 0;
12222
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12223
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12225
else if (unlikely (compile_options.bounds_check))
12227
Index: libgfortran/generated/product_i16.c
12228
===================================================================
12229
--- a/src/libgfortran/generated/product_i16.c (.../tags/gcc_4_8_3_release)
12230
+++ b/src/libgfortran/generated/product_i16.c (.../branches/gcc-4_8-branch)
12232
retarray->offset = 0;
12233
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12235
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12236
- * extent[rank-1];
12237
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12239
- retarray->base_addr = xmalloc (alloc_size);
12240
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12241
if (alloc_size == 0)
12243
/* Make sure we have a zero-sized array. */
12244
@@ -272,8 +271,7 @@
12248
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12249
- * extent[rank-1];
12250
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12252
retarray->offset = 0;
12253
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12254
@@ -285,7 +283,7 @@
12258
- retarray->base_addr = xmalloc (alloc_size);
12259
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12263
@@ -430,8 +428,7 @@
12264
retarray->offset = 0;
12265
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12267
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12268
- * extent[rank-1];
12269
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12271
if (alloc_size == 0)
12273
@@ -440,7 +437,7 @@
12277
- retarray->base_addr = xmalloc (alloc_size);
12278
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12282
Index: libgfortran/generated/unpack_i1.c
12283
===================================================================
12284
--- a/src/libgfortran/generated/unpack_i1.c (.../tags/gcc_4_8_3_release)
12285
+++ b/src/libgfortran/generated/unpack_i1.c (.../branches/gcc-4_8-branch)
12290
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
12291
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
12295
@@ -244,7 +244,7 @@
12299
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
12300
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
12304
Index: libgfortran/generated/minloc0_4_i4.c
12305
===================================================================
12306
--- a/src/libgfortran/generated/minloc0_4_i4.c (.../tags/gcc_4_8_3_release)
12307
+++ b/src/libgfortran/generated/minloc0_4_i4.c (.../branches/gcc-4_8-branch)
12309
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12310
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12311
retarray->offset = 0;
12312
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12313
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12317
@@ -199,7 +199,7 @@
12318
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12319
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12320
retarray->offset = 0;
12321
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12322
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12326
@@ -367,7 +367,7 @@
12327
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12328
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12329
retarray->offset = 0;
12330
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12331
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12333
else if (unlikely (compile_options.bounds_check))
12335
Index: libgfortran/generated/matmul_i1.c
12336
===================================================================
12337
--- a/src/libgfortran/generated/matmul_i1.c (.../tags/gcc_4_8_3_release)
12338
+++ b/src/libgfortran/generated/matmul_i1.c (.../branches/gcc-4_8-branch)
12339
@@ -124,7 +124,7 @@
12342
retarray->base_addr
12343
- = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
12344
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
12345
retarray->offset = 0;
12347
else if (unlikely (compile_options.bounds_check))
12348
Index: libgfortran/generated/minval_r4.c
12349
===================================================================
12350
--- a/src/libgfortran/generated/minval_r4.c (.../tags/gcc_4_8_3_release)
12351
+++ b/src/libgfortran/generated/minval_r4.c (.../branches/gcc-4_8-branch)
12353
retarray->offset = 0;
12354
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12356
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12357
- * extent[rank-1];
12358
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12360
- retarray->base_addr = xmalloc (alloc_size);
12361
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12362
if (alloc_size == 0)
12364
/* Make sure we have a zero-sized array. */
12365
@@ -286,8 +285,7 @@
12369
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12370
- * extent[rank-1];
12371
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12373
retarray->offset = 0;
12374
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12375
@@ -299,7 +297,7 @@
12379
- retarray->base_addr = xmalloc (alloc_size);
12380
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12384
@@ -472,8 +470,7 @@
12385
retarray->offset = 0;
12386
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12388
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12389
- * extent[rank-1];
12390
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12392
if (alloc_size == 0)
12394
@@ -482,7 +479,7 @@
12398
- retarray->base_addr = xmalloc (alloc_size);
12399
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12403
Index: libgfortran/generated/spread_i16.c
12404
===================================================================
12405
--- a/src/libgfortran/generated/spread_i16.c (.../tags/gcc_4_8_3_release)
12406
+++ b/src/libgfortran/generated/spread_i16.c (.../branches/gcc-4_8-branch)
12407
@@ -101,8 +101,8 @@
12411
- /* xmalloc allocates a single byte for zero size. */
12412
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
12413
+ /* xmallocarray allocates a single byte for zero size. */
12414
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
12418
@@ -244,7 +244,7 @@
12420
if (ret->base_addr == NULL)
12422
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
12423
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
12425
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12427
Index: libgfortran/generated/sum_i4.c
12428
===================================================================
12429
--- a/src/libgfortran/generated/sum_i4.c (.../tags/gcc_4_8_3_release)
12430
+++ b/src/libgfortran/generated/sum_i4.c (.../branches/gcc-4_8-branch)
12432
retarray->offset = 0;
12433
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12435
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12436
- * extent[rank-1];
12437
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12439
- retarray->base_addr = xmalloc (alloc_size);
12440
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12441
if (alloc_size == 0)
12443
/* Make sure we have a zero-sized array. */
12444
@@ -272,8 +271,7 @@
12448
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12449
- * extent[rank-1];
12450
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12452
retarray->offset = 0;
12453
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12454
@@ -285,7 +283,7 @@
12458
- retarray->base_addr = xmalloc (alloc_size);
12459
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12463
@@ -430,8 +428,7 @@
12464
retarray->offset = 0;
12465
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12467
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12468
- * extent[rank-1];
12469
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12471
if (alloc_size == 0)
12473
@@ -440,7 +437,7 @@
12477
- retarray->base_addr = xmalloc (alloc_size);
12478
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12482
Index: libgfortran/generated/unpack_r10.c
12483
===================================================================
12484
--- a/src/libgfortran/generated/unpack_r10.c (.../tags/gcc_4_8_3_release)
12485
+++ b/src/libgfortran/generated/unpack_r10.c (.../branches/gcc-4_8-branch)
12490
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
12491
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
12495
@@ -244,7 +244,7 @@
12499
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
12500
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
12504
Index: libgfortran/generated/bessel_r16.c
12505
===================================================================
12506
--- a/src/libgfortran/generated/bessel_r16.c (.../tags/gcc_4_8_3_release)
12507
+++ b/src/libgfortran/generated/bessel_r16.c (.../branches/gcc-4_8-branch)
12510
size_t size = n2 < n1 ? 0 : n2-n1+1;
12511
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12512
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
12513
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
12517
@@ -126,7 +126,7 @@
12519
size_t size = n2 < n1 ? 0 : n2-n1+1;
12520
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12521
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
12522
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
12526
@@ -166,7 +166,7 @@
12528
x2rev = GFC_REAL_16_LITERAL(2.)/x;
12530
- for (i = 2; i <= n1+n2; i++)
12531
+ for (i = 2; i <= n2 - n1; i++)
12533
#if defined(GFC_REAL_16_INFINITY)
12534
if (unlikely (last2 == -GFC_REAL_16_INFINITY))
12535
Index: libgfortran/generated/norm2_r8.c
12536
===================================================================
12537
--- a/src/libgfortran/generated/norm2_r8.c (.../tags/gcc_4_8_3_release)
12538
+++ b/src/libgfortran/generated/norm2_r8.c (.../branches/gcc-4_8-branch)
12539
@@ -101,10 +101,9 @@
12540
retarray->offset = 0;
12541
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12543
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12544
- * extent[rank-1];
12545
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12547
- retarray->base_addr = xmalloc (alloc_size);
12548
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
12549
if (alloc_size == 0)
12551
/* Make sure we have a zero-sized array. */
12552
Index: libgfortran/generated/spread_i4.c
12553
===================================================================
12554
--- a/src/libgfortran/generated/spread_i4.c (.../tags/gcc_4_8_3_release)
12555
+++ b/src/libgfortran/generated/spread_i4.c (.../branches/gcc-4_8-branch)
12556
@@ -101,8 +101,8 @@
12560
- /* xmalloc allocates a single byte for zero size. */
12561
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
12562
+ /* xmallocarray allocates a single byte for zero size. */
12563
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
12567
@@ -244,7 +244,7 @@
12569
if (ret->base_addr == NULL)
12571
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
12572
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
12574
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12576
Index: libgfortran/generated/eoshift3_8.c
12577
===================================================================
12578
--- a/src/libgfortran/generated/eoshift3_8.c (.../tags/gcc_4_8_3_release)
12579
+++ b/src/libgfortran/generated/eoshift3_8.c (.../branches/gcc-4_8-branch)
12584
- ret->base_addr = xmalloc (size * arraysize);
12585
+ ret->base_addr = xmallocarray (arraysize, size);
12587
ret->dtype = array->dtype;
12588
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
12589
@@ -107,8 +107,8 @@
12590
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
12593
- /* xmalloc allocates a single byte for zero size. */
12594
- ret->base_addr = xmalloc (size * arraysize);
12595
+ /* xmallocarray allocates a single byte for zero size. */
12596
+ ret->base_addr = xmallocarray (arraysize, size);
12599
else if (unlikely (compile_options.bounds_check))
12600
Index: libgfortran/generated/minloc1_4_i1.c
12601
===================================================================
12602
--- a/src/libgfortran/generated/minloc1_4_i1.c (.../tags/gcc_4_8_3_release)
12603
+++ b/src/libgfortran/generated/minloc1_4_i1.c (.../branches/gcc-4_8-branch)
12605
retarray->offset = 0;
12606
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12608
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12609
- * extent[rank-1];
12610
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12612
- retarray->base_addr = xmalloc (alloc_size);
12613
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12614
if (alloc_size == 0)
12616
/* Make sure we have a zero-sized array. */
12617
@@ -294,8 +293,7 @@
12621
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12622
- * extent[rank-1];
12623
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12625
retarray->offset = 0;
12626
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12627
@@ -307,7 +305,7 @@
12631
- retarray->base_addr = xmalloc (alloc_size);
12632
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12636
@@ -485,8 +483,7 @@
12637
retarray->offset = 0;
12638
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12640
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12641
- * extent[rank-1];
12642
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12644
if (alloc_size == 0)
12646
@@ -495,7 +492,7 @@
12650
- retarray->base_addr = xmalloc (alloc_size);
12651
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12655
Index: libgfortran/generated/minval_i2.c
12656
===================================================================
12657
--- a/src/libgfortran/generated/minval_i2.c (.../tags/gcc_4_8_3_release)
12658
+++ b/src/libgfortran/generated/minval_i2.c (.../branches/gcc-4_8-branch)
12660
retarray->offset = 0;
12661
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12663
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12664
- * extent[rank-1];
12665
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12667
- retarray->base_addr = xmalloc (alloc_size);
12668
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12669
if (alloc_size == 0)
12671
/* Make sure we have a zero-sized array. */
12672
@@ -286,8 +285,7 @@
12676
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12677
- * extent[rank-1];
12678
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12680
retarray->offset = 0;
12681
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12682
@@ -299,7 +297,7 @@
12686
- retarray->base_addr = xmalloc (alloc_size);
12687
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12691
@@ -472,8 +470,7 @@
12692
retarray->offset = 0;
12693
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12695
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12696
- * extent[rank-1];
12697
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12699
if (alloc_size == 0)
12701
@@ -482,7 +479,7 @@
12705
- retarray->base_addr = xmalloc (alloc_size);
12706
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12710
Index: libgfortran/generated/bessel_r8.c
12711
===================================================================
12712
--- a/src/libgfortran/generated/bessel_r8.c (.../tags/gcc_4_8_3_release)
12713
+++ b/src/libgfortran/generated/bessel_r8.c (.../branches/gcc-4_8-branch)
12716
size_t size = n2 < n1 ? 0 : n2-n1+1;
12717
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12718
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
12719
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
12723
@@ -122,7 +122,7 @@
12725
size_t size = n2 < n1 ? 0 : n2-n1+1;
12726
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
12727
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
12728
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
12732
@@ -162,7 +162,7 @@
12734
x2rev = GFC_REAL_8_LITERAL(2.)/x;
12736
- for (i = 2; i <= n1+n2; i++)
12737
+ for (i = 2; i <= n2 - n1; i++)
12739
#if defined(GFC_REAL_8_INFINITY)
12740
if (unlikely (last2 == -GFC_REAL_8_INFINITY))
12741
Index: libgfortran/generated/unpack_r4.c
12742
===================================================================
12743
--- a/src/libgfortran/generated/unpack_r4.c (.../tags/gcc_4_8_3_release)
12744
+++ b/src/libgfortran/generated/unpack_r4.c (.../branches/gcc-4_8-branch)
12749
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
12750
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
12754
@@ -244,7 +244,7 @@
12758
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
12759
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
12763
Index: libgfortran/generated/product_r8.c
12764
===================================================================
12765
--- a/src/libgfortran/generated/product_r8.c (.../tags/gcc_4_8_3_release)
12766
+++ b/src/libgfortran/generated/product_r8.c (.../branches/gcc-4_8-branch)
12768
retarray->offset = 0;
12769
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12771
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12772
- * extent[rank-1];
12773
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12775
- retarray->base_addr = xmalloc (alloc_size);
12776
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
12777
if (alloc_size == 0)
12779
/* Make sure we have a zero-sized array. */
12780
@@ -272,8 +271,7 @@
12784
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12785
- * extent[rank-1];
12786
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12788
retarray->offset = 0;
12789
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12790
@@ -285,7 +283,7 @@
12794
- retarray->base_addr = xmalloc (alloc_size);
12795
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
12799
@@ -430,8 +428,7 @@
12800
retarray->offset = 0;
12801
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12803
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12804
- * extent[rank-1];
12805
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12807
if (alloc_size == 0)
12809
@@ -440,7 +437,7 @@
12813
- retarray->base_addr = xmalloc (alloc_size);
12814
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
12818
Index: libgfortran/generated/matmul_r4.c
12819
===================================================================
12820
--- a/src/libgfortran/generated/matmul_r4.c (.../tags/gcc_4_8_3_release)
12821
+++ b/src/libgfortran/generated/matmul_r4.c (.../branches/gcc-4_8-branch)
12822
@@ -124,7 +124,7 @@
12825
retarray->base_addr
12826
- = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
12827
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
12828
retarray->offset = 0;
12830
else if (unlikely (compile_options.bounds_check))
12831
Index: libgfortran/generated/unpack_i2.c
12832
===================================================================
12833
--- a/src/libgfortran/generated/unpack_i2.c (.../tags/gcc_4_8_3_release)
12834
+++ b/src/libgfortran/generated/unpack_i2.c (.../branches/gcc-4_8-branch)
12839
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
12840
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
12844
@@ -244,7 +244,7 @@
12848
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
12849
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
12853
Index: libgfortran/generated/in_pack_r8.c
12854
===================================================================
12855
--- a/src/libgfortran/generated/in_pack_r8.c (.../tags/gcc_4_8_3_release)
12856
+++ b/src/libgfortran/generated/in_pack_r8.c (.../branches/gcc-4_8-branch)
12858
return source->base_addr;
12860
/* Allocate storage for the destination. */
12861
- destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
12862
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
12864
src = source->base_addr;
12865
stride0 = stride[0];
12866
Index: libgfortran/generated/maxloc1_4_r16.c
12867
===================================================================
12868
--- a/src/libgfortran/generated/maxloc1_4_r16.c (.../tags/gcc_4_8_3_release)
12869
+++ b/src/libgfortran/generated/maxloc1_4_r16.c (.../branches/gcc-4_8-branch)
12871
retarray->offset = 0;
12872
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12874
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12875
- * extent[rank-1];
12876
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12878
- retarray->base_addr = xmalloc (alloc_size);
12879
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12880
if (alloc_size == 0)
12882
/* Make sure we have a zero-sized array. */
12883
@@ -294,8 +293,7 @@
12887
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12888
- * extent[rank-1];
12889
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12891
retarray->offset = 0;
12892
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12893
@@ -307,7 +305,7 @@
12897
- retarray->base_addr = xmalloc (alloc_size);
12898
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12902
@@ -485,8 +483,7 @@
12903
retarray->offset = 0;
12904
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12906
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12907
- * extent[rank-1];
12908
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12910
if (alloc_size == 0)
12912
@@ -495,7 +492,7 @@
12916
- retarray->base_addr = xmalloc (alloc_size);
12917
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12921
Index: libgfortran/generated/minloc0_8_r16.c
12922
===================================================================
12923
--- a/src/libgfortran/generated/minloc0_8_r16.c (.../tags/gcc_4_8_3_release)
12924
+++ b/src/libgfortran/generated/minloc0_8_r16.c (.../branches/gcc-4_8-branch)
12926
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12927
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12928
retarray->offset = 0;
12929
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12930
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12934
@@ -199,7 +199,7 @@
12935
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12936
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12937
retarray->offset = 0;
12938
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12939
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12943
@@ -367,7 +367,7 @@
12944
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12945
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12946
retarray->offset = 0;
12947
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12948
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12950
else if (unlikely (compile_options.bounds_check))
12952
Index: libgfortran/generated/reshape_c8.c
12953
===================================================================
12954
--- a/src/libgfortran/generated/reshape_c8.c (.../tags/gcc_4_8_3_release)
12955
+++ b/src/libgfortran/generated/reshape_c8.c (.../branches/gcc-4_8-branch)
12956
@@ -111,11 +111,11 @@
12959
if (unlikely (rs < 1))
12963
- alloc_size = rs * sizeof (GFC_COMPLEX_8);
12966
- ret->base_addr = xmalloc (alloc_size);
12967
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
12968
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
12971
Index: libgfortran/generated/iparity_i8.c
12972
===================================================================
12973
--- a/src/libgfortran/generated/iparity_i8.c (.../tags/gcc_4_8_3_release)
12974
+++ b/src/libgfortran/generated/iparity_i8.c (.../branches/gcc-4_8-branch)
12976
retarray->offset = 0;
12977
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12979
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12980
- * extent[rank-1];
12981
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12983
- retarray->base_addr = xmalloc (alloc_size);
12984
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12985
if (alloc_size == 0)
12987
/* Make sure we have a zero-sized array. */
12988
@@ -272,8 +271,7 @@
12992
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12993
- * extent[rank-1];
12994
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12996
retarray->offset = 0;
12997
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12998
@@ -285,7 +283,7 @@
13002
- retarray->base_addr = xmalloc (alloc_size);
13003
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13007
@@ -430,8 +428,7 @@
13008
retarray->offset = 0;
13009
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13011
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13012
- * extent[rank-1];
13013
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13015
if (alloc_size == 0)
13017
@@ -440,7 +437,7 @@
13021
- retarray->base_addr = xmalloc (alloc_size);
13022
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13026
Index: libgfortran/generated/count_1_l.c
13027
===================================================================
13028
--- a/src/libgfortran/generated/count_1_l.c (.../tags/gcc_4_8_3_release)
13029
+++ b/src/libgfortran/generated/count_1_l.c (.../branches/gcc-4_8-branch)
13030
@@ -101,8 +101,7 @@
13031
retarray->offset = 0;
13032
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13034
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13035
- * extent[rank-1];
13036
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13038
if (alloc_size == 0)
13040
@@ -111,7 +110,7 @@
13044
- retarray->base_addr = xmalloc (alloc_size);
13045
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13049
Index: libgfortran/generated/maxloc0_8_i4.c
13050
===================================================================
13051
--- a/src/libgfortran/generated/maxloc0_8_i4.c (.../tags/gcc_4_8_3_release)
13052
+++ b/src/libgfortran/generated/maxloc0_8_i4.c (.../branches/gcc-4_8-branch)
13054
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13055
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13056
retarray->offset = 0;
13057
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13058
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13062
@@ -199,7 +199,7 @@
13063
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13064
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13065
retarray->offset = 0;
13066
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13067
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13071
@@ -367,7 +367,7 @@
13072
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13073
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13074
retarray->offset = 0;
13075
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13076
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13078
else if (unlikely (compile_options.bounds_check))
13080
Index: libgfortran/generated/matmul_i2.c
13081
===================================================================
13082
--- a/src/libgfortran/generated/matmul_i2.c (.../tags/gcc_4_8_3_release)
13083
+++ b/src/libgfortran/generated/matmul_i2.c (.../branches/gcc-4_8-branch)
13084
@@ -124,7 +124,7 @@
13087
retarray->base_addr
13088
- = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
13089
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
13090
retarray->offset = 0;
13092
else if (unlikely (compile_options.bounds_check))
13093
Index: libgfortran/generated/minloc1_4_r4.c
13094
===================================================================
13095
--- a/src/libgfortran/generated/minloc1_4_r4.c (.../tags/gcc_4_8_3_release)
13096
+++ b/src/libgfortran/generated/minloc1_4_r4.c (.../branches/gcc-4_8-branch)
13098
retarray->offset = 0;
13099
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13101
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13102
- * extent[rank-1];
13103
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13105
- retarray->base_addr = xmalloc (alloc_size);
13106
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13107
if (alloc_size == 0)
13109
/* Make sure we have a zero-sized array. */
13110
@@ -294,8 +293,7 @@
13114
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13115
- * extent[rank-1];
13116
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13118
retarray->offset = 0;
13119
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13120
@@ -307,7 +305,7 @@
13124
- retarray->base_addr = xmalloc (alloc_size);
13125
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13129
@@ -485,8 +483,7 @@
13130
retarray->offset = 0;
13131
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13133
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13134
- * extent[rank-1];
13135
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13137
if (alloc_size == 0)
13139
@@ -495,7 +492,7 @@
13143
- retarray->base_addr = xmalloc (alloc_size);
13144
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13148
Index: libgfortran/generated/transpose_i16.c
13149
===================================================================
13150
--- a/src/libgfortran/generated/transpose_i16.c (.../tags/gcc_4_8_3_release)
13151
+++ b/src/libgfortran/generated/transpose_i16.c (.../branches/gcc-4_8-branch)
13153
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13154
GFC_DESCRIPTOR_EXTENT(source, 1));
13156
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
13157
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
13158
+ sizeof (GFC_INTEGER_16));
13160
} else if (unlikely (compile_options.bounds_check))
13162
Index: libgfortran/generated/minloc0_16_i4.c
13163
===================================================================
13164
--- a/src/libgfortran/generated/minloc0_16_i4.c (.../tags/gcc_4_8_3_release)
13165
+++ b/src/libgfortran/generated/minloc0_16_i4.c (.../branches/gcc-4_8-branch)
13167
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13168
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13169
retarray->offset = 0;
13170
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13171
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13175
@@ -199,7 +199,7 @@
13176
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13177
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13178
retarray->offset = 0;
13179
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13180
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13184
@@ -367,7 +367,7 @@
13185
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13186
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13187
retarray->offset = 0;
13188
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13189
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13191
else if (unlikely (compile_options.bounds_check))
13193
Index: libgfortran/generated/transpose_i4.c
13194
===================================================================
13195
--- a/src/libgfortran/generated/transpose_i4.c (.../tags/gcc_4_8_3_release)
13196
+++ b/src/libgfortran/generated/transpose_i4.c (.../branches/gcc-4_8-branch)
13198
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13199
GFC_DESCRIPTOR_EXTENT(source, 1));
13201
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
13202
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
13203
+ sizeof (GFC_INTEGER_4));
13205
} else if (unlikely (compile_options.bounds_check))
13207
Index: libgfortran/generated/maxloc1_16_i8.c
13208
===================================================================
13209
--- a/src/libgfortran/generated/maxloc1_16_i8.c (.../tags/gcc_4_8_3_release)
13210
+++ b/src/libgfortran/generated/maxloc1_16_i8.c (.../branches/gcc-4_8-branch)
13212
retarray->offset = 0;
13213
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13215
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13216
- * extent[rank-1];
13217
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13219
- retarray->base_addr = xmalloc (alloc_size);
13220
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13221
if (alloc_size == 0)
13223
/* Make sure we have a zero-sized array. */
13224
@@ -294,8 +293,7 @@
13228
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13229
- * extent[rank-1];
13230
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13232
retarray->offset = 0;
13233
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13234
@@ -307,7 +305,7 @@
13238
- retarray->base_addr = xmalloc (alloc_size);
13239
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13243
@@ -485,8 +483,7 @@
13244
retarray->offset = 0;
13245
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13247
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13248
- * extent[rank-1];
13249
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13251
if (alloc_size == 0)
13253
@@ -495,7 +492,7 @@
13257
- retarray->base_addr = xmalloc (alloc_size);
13258
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13262
Index: libgfortran/generated/minloc1_4_i2.c
13263
===================================================================
13264
--- a/src/libgfortran/generated/minloc1_4_i2.c (.../tags/gcc_4_8_3_release)
13265
+++ b/src/libgfortran/generated/minloc1_4_i2.c (.../branches/gcc-4_8-branch)
13267
retarray->offset = 0;
13268
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13270
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13271
- * extent[rank-1];
13272
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13274
- retarray->base_addr = xmalloc (alloc_size);
13275
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13276
if (alloc_size == 0)
13278
/* Make sure we have a zero-sized array. */
13279
@@ -294,8 +293,7 @@
13283
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13284
- * extent[rank-1];
13285
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13287
retarray->offset = 0;
13288
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13289
@@ -307,7 +305,7 @@
13293
- retarray->base_addr = xmalloc (alloc_size);
13294
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13298
@@ -485,8 +483,7 @@
13299
retarray->offset = 0;
13300
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13302
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13303
- * extent[rank-1];
13304
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13306
if (alloc_size == 0)
13308
@@ -495,7 +492,7 @@
13312
- retarray->base_addr = xmalloc (alloc_size);
13313
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13317
Index: libgfortran/generated/matmul_l16.c
13318
===================================================================
13319
--- a/src/libgfortran/generated/matmul_l16.c (.../tags/gcc_4_8_3_release)
13320
+++ b/src/libgfortran/generated/matmul_l16.c (.../branches/gcc-4_8-branch)
13324
retarray->base_addr
13325
- = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
13326
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
13327
retarray->offset = 0;
13329
else if (unlikely (compile_options.bounds_check))
13330
Index: libgfortran/generated/maxloc1_8_i1.c
13331
===================================================================
13332
--- a/src/libgfortran/generated/maxloc1_8_i1.c (.../tags/gcc_4_8_3_release)
13333
+++ b/src/libgfortran/generated/maxloc1_8_i1.c (.../branches/gcc-4_8-branch)
13335
retarray->offset = 0;
13336
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13338
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13339
- * extent[rank-1];
13340
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13342
- retarray->base_addr = xmalloc (alloc_size);
13343
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13344
if (alloc_size == 0)
13346
/* Make sure we have a zero-sized array. */
13347
@@ -294,8 +293,7 @@
13351
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13352
- * extent[rank-1];
13353
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13355
retarray->offset = 0;
13356
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13357
@@ -307,7 +305,7 @@
13361
- retarray->base_addr = xmalloc (alloc_size);
13362
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13366
@@ -485,8 +483,7 @@
13367
retarray->offset = 0;
13368
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13370
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13371
- * extent[rank-1];
13372
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13374
if (alloc_size == 0)
13376
@@ -495,7 +492,7 @@
13380
- retarray->base_addr = xmalloc (alloc_size);
13381
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13385
Index: libgfortran/generated/minloc1_8_i8.c
13386
===================================================================
13387
--- a/src/libgfortran/generated/minloc1_8_i8.c (.../tags/gcc_4_8_3_release)
13388
+++ b/src/libgfortran/generated/minloc1_8_i8.c (.../branches/gcc-4_8-branch)
13390
retarray->offset = 0;
13391
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13393
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13394
- * extent[rank-1];
13395
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13397
- retarray->base_addr = xmalloc (alloc_size);
13398
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13399
if (alloc_size == 0)
13401
/* Make sure we have a zero-sized array. */
13402
@@ -294,8 +293,7 @@
13406
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13407
- * extent[rank-1];
13408
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13410
retarray->offset = 0;
13411
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13412
@@ -307,7 +305,7 @@
13416
- retarray->base_addr = xmalloc (alloc_size);
13417
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13421
@@ -485,8 +483,7 @@
13422
retarray->offset = 0;
13423
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13425
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13426
- * extent[rank-1];
13427
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13429
if (alloc_size == 0)
13431
@@ -495,7 +492,7 @@
13435
- retarray->base_addr = xmalloc (alloc_size);
13436
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13440
Index: libgfortran/generated/minloc0_4_r8.c
13441
===================================================================
13442
--- a/src/libgfortran/generated/minloc0_4_r8.c (.../tags/gcc_4_8_3_release)
13443
+++ b/src/libgfortran/generated/minloc0_4_r8.c (.../branches/gcc-4_8-branch)
13445
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13446
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13447
retarray->offset = 0;
13448
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13449
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13453
@@ -199,7 +199,7 @@
13454
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13455
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13456
retarray->offset = 0;
13457
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13458
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13462
@@ -367,7 +367,7 @@
13463
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13464
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13465
retarray->offset = 0;
13466
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13467
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13469
else if (unlikely (compile_options.bounds_check))
13471
Index: libgfortran/generated/product_r16.c
13472
===================================================================
13473
--- a/src/libgfortran/generated/product_r16.c (.../tags/gcc_4_8_3_release)
13474
+++ b/src/libgfortran/generated/product_r16.c (.../branches/gcc-4_8-branch)
13476
retarray->offset = 0;
13477
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13479
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13480
- * extent[rank-1];
13481
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13483
- retarray->base_addr = xmalloc (alloc_size);
13484
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13485
if (alloc_size == 0)
13487
/* Make sure we have a zero-sized array. */
13488
@@ -272,8 +271,7 @@
13492
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13493
- * extent[rank-1];
13494
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13496
retarray->offset = 0;
13497
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13498
@@ -285,7 +283,7 @@
13502
- retarray->base_addr = xmalloc (alloc_size);
13503
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13507
@@ -430,8 +428,7 @@
13508
retarray->offset = 0;
13509
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13511
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13512
- * extent[rank-1];
13513
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13515
if (alloc_size == 0)
13517
@@ -440,7 +437,7 @@
13521
- retarray->base_addr = xmalloc (alloc_size);
13522
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
13526
Index: libgfortran/generated/sum_r8.c
13527
===================================================================
13528
--- a/src/libgfortran/generated/sum_r8.c (.../tags/gcc_4_8_3_release)
13529
+++ b/src/libgfortran/generated/sum_r8.c (.../branches/gcc-4_8-branch)
13531
retarray->offset = 0;
13532
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13534
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13535
- * extent[rank-1];
13536
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13538
- retarray->base_addr = xmalloc (alloc_size);
13539
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13540
if (alloc_size == 0)
13542
/* Make sure we have a zero-sized array. */
13543
@@ -272,8 +271,7 @@
13547
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13548
- * extent[rank-1];
13549
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13551
retarray->offset = 0;
13552
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13553
@@ -285,7 +283,7 @@
13557
- retarray->base_addr = xmalloc (alloc_size);
13558
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13562
@@ -430,8 +428,7 @@
13563
retarray->offset = 0;
13564
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13566
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13567
- * extent[rank-1];
13568
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13570
if (alloc_size == 0)
13572
@@ -440,7 +437,7 @@
13576
- retarray->base_addr = xmalloc (alloc_size);
13577
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13581
Index: libgfortran/generated/norm2_r10.c
13582
===================================================================
13583
--- a/src/libgfortran/generated/norm2_r10.c (.../tags/gcc_4_8_3_release)
13584
+++ b/src/libgfortran/generated/norm2_r10.c (.../branches/gcc-4_8-branch)
13585
@@ -101,10 +101,9 @@
13586
retarray->offset = 0;
13587
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13589
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13590
- * extent[rank-1];
13591
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13593
- retarray->base_addr = xmalloc (alloc_size);
13594
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13595
if (alloc_size == 0)
13597
/* Make sure we have a zero-sized array. */
13598
Index: libgfortran/generated/unpack_c10.c
13599
===================================================================
13600
--- a/src/libgfortran/generated/unpack_c10.c (.../tags/gcc_4_8_3_release)
13601
+++ b/src/libgfortran/generated/unpack_c10.c (.../branches/gcc-4_8-branch)
13606
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
13607
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
13611
@@ -244,7 +244,7 @@
13615
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
13616
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
13620
Index: libgfortran/generated/spread_r8.c
13621
===================================================================
13622
--- a/src/libgfortran/generated/spread_r8.c (.../tags/gcc_4_8_3_release)
13623
+++ b/src/libgfortran/generated/spread_r8.c (.../branches/gcc-4_8-branch)
13624
@@ -101,8 +101,8 @@
13628
- /* xmalloc allocates a single byte for zero size. */
13629
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
13630
+ /* xmallocarray allocates a single byte for zero size. */
13631
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
13635
@@ -244,7 +244,7 @@
13637
if (ret->base_addr == NULL)
13639
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
13640
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
13642
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13644
Index: libgfortran/generated/minloc1_16_i16.c
13645
===================================================================
13646
--- a/src/libgfortran/generated/minloc1_16_i16.c (.../tags/gcc_4_8_3_release)
13647
+++ b/src/libgfortran/generated/minloc1_16_i16.c (.../branches/gcc-4_8-branch)
13649
retarray->offset = 0;
13650
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13652
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13653
- * extent[rank-1];
13654
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13656
- retarray->base_addr = xmalloc (alloc_size);
13657
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13658
if (alloc_size == 0)
13660
/* Make sure we have a zero-sized array. */
13661
@@ -294,8 +293,7 @@
13665
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13666
- * extent[rank-1];
13667
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13669
retarray->offset = 0;
13670
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13671
@@ -307,7 +305,7 @@
13675
- retarray->base_addr = xmalloc (alloc_size);
13676
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13680
@@ -485,8 +483,7 @@
13681
retarray->offset = 0;
13682
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13684
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13685
- * extent[rank-1];
13686
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13688
if (alloc_size == 0)
13690
@@ -495,7 +492,7 @@
13694
- retarray->base_addr = xmalloc (alloc_size);
13695
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13699
Index: libgfortran/generated/maxloc1_8_r4.c
13700
===================================================================
13701
--- a/src/libgfortran/generated/maxloc1_8_r4.c (.../tags/gcc_4_8_3_release)
13702
+++ b/src/libgfortran/generated/maxloc1_8_r4.c (.../branches/gcc-4_8-branch)
13704
retarray->offset = 0;
13705
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13707
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13708
- * extent[rank-1];
13709
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13711
- retarray->base_addr = xmalloc (alloc_size);
13712
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13713
if (alloc_size == 0)
13715
/* Make sure we have a zero-sized array. */
13716
@@ -294,8 +293,7 @@
13720
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13721
- * extent[rank-1];
13722
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13724
retarray->offset = 0;
13725
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13726
@@ -307,7 +305,7 @@
13730
- retarray->base_addr = xmalloc (alloc_size);
13731
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13735
@@ -485,8 +483,7 @@
13736
retarray->offset = 0;
13737
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13739
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13740
- * extent[rank-1];
13741
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13743
if (alloc_size == 0)
13745
@@ -495,7 +492,7 @@
13749
- retarray->base_addr = xmalloc (alloc_size);
13750
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13754
Index: libgfortran/generated/minloc1_16_i1.c
13755
===================================================================
13756
--- a/src/libgfortran/generated/minloc1_16_i1.c (.../tags/gcc_4_8_3_release)
13757
+++ b/src/libgfortran/generated/minloc1_16_i1.c (.../branches/gcc-4_8-branch)
13759
retarray->offset = 0;
13760
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13762
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13763
- * extent[rank-1];
13764
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13766
- retarray->base_addr = xmalloc (alloc_size);
13767
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13768
if (alloc_size == 0)
13770
/* Make sure we have a zero-sized array. */
13771
@@ -294,8 +293,7 @@
13775
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13776
- * extent[rank-1];
13777
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13779
retarray->offset = 0;
13780
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13781
@@ -307,7 +305,7 @@
13785
- retarray->base_addr = xmalloc (alloc_size);
13786
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13790
@@ -485,8 +483,7 @@
13791
retarray->offset = 0;
13792
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13794
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13795
- * extent[rank-1];
13796
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13798
if (alloc_size == 0)
13800
@@ -495,7 +492,7 @@
13804
- retarray->base_addr = xmalloc (alloc_size);
13805
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13809
Index: libgfortran/generated/spread_r16.c
13810
===================================================================
13811
--- a/src/libgfortran/generated/spread_r16.c (.../tags/gcc_4_8_3_release)
13812
+++ b/src/libgfortran/generated/spread_r16.c (.../branches/gcc-4_8-branch)
13813
@@ -101,8 +101,8 @@
13817
- /* xmalloc allocates a single byte for zero size. */
13818
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
13819
+ /* xmallocarray allocates a single byte for zero size. */
13820
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
13824
@@ -244,7 +244,7 @@
13826
if (ret->base_addr == NULL)
13828
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
13829
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
13831
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13833
Index: libgfortran/generated/pack_c8.c
13834
===================================================================
13835
--- a/src/libgfortran/generated/pack_c8.c (.../tags/gcc_4_8_3_release)
13836
+++ b/src/libgfortran/generated/pack_c8.c (.../branches/gcc-4_8-branch)
13837
@@ -167,8 +167,8 @@
13841
- /* xmalloc allocates a single byte for zero size. */
13842
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
13843
+ /* xmallocarray allocates a single byte for zero size. */
13844
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
13848
Index: libgfortran/generated/minval_r10.c
13849
===================================================================
13850
--- a/src/libgfortran/generated/minval_r10.c (.../tags/gcc_4_8_3_release)
13851
+++ b/src/libgfortran/generated/minval_r10.c (.../branches/gcc-4_8-branch)
13853
retarray->offset = 0;
13854
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13856
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13857
- * extent[rank-1];
13858
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13860
- retarray->base_addr = xmalloc (alloc_size);
13861
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13862
if (alloc_size == 0)
13864
/* Make sure we have a zero-sized array. */
13865
@@ -286,8 +285,7 @@
13869
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13870
- * extent[rank-1];
13871
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13873
retarray->offset = 0;
13874
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13875
@@ -299,7 +297,7 @@
13879
- retarray->base_addr = xmalloc (alloc_size);
13880
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13884
@@ -472,8 +470,7 @@
13885
retarray->offset = 0;
13886
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13888
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13889
- * extent[rank-1];
13890
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13892
if (alloc_size == 0)
13894
@@ -482,7 +479,7 @@
13898
- retarray->base_addr = xmalloc (alloc_size);
13899
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
13903
Index: libgfortran/generated/parity_l8.c
13904
===================================================================
13905
--- a/src/libgfortran/generated/parity_l8.c (.../tags/gcc_4_8_3_release)
13906
+++ b/src/libgfortran/generated/parity_l8.c (.../branches/gcc-4_8-branch)
13908
retarray->offset = 0;
13909
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13911
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13912
- * extent[rank-1];
13913
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13915
- retarray->base_addr = xmalloc (alloc_size);
13916
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
13917
if (alloc_size == 0)
13919
/* Make sure we have a zero-sized array. */
13920
Index: libgfortran/generated/minval_i4.c
13921
===================================================================
13922
--- a/src/libgfortran/generated/minval_i4.c (.../tags/gcc_4_8_3_release)
13923
+++ b/src/libgfortran/generated/minval_i4.c (.../branches/gcc-4_8-branch)
13925
retarray->offset = 0;
13926
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13928
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13929
- * extent[rank-1];
13930
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13932
- retarray->base_addr = xmalloc (alloc_size);
13933
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13934
if (alloc_size == 0)
13936
/* Make sure we have a zero-sized array. */
13937
@@ -286,8 +285,7 @@
13941
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13942
- * extent[rank-1];
13943
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13945
retarray->offset = 0;
13946
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13947
@@ -299,7 +297,7 @@
13951
- retarray->base_addr = xmalloc (alloc_size);
13952
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13956
@@ -472,8 +470,7 @@
13957
retarray->offset = 0;
13958
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13960
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13961
- * extent[rank-1];
13962
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13964
if (alloc_size == 0)
13966
@@ -482,7 +479,7 @@
13970
- retarray->base_addr = xmalloc (alloc_size);
13971
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13975
Index: libgfortran/generated/maxloc1_8_i2.c
13976
===================================================================
13977
--- a/src/libgfortran/generated/maxloc1_8_i2.c (.../tags/gcc_4_8_3_release)
13978
+++ b/src/libgfortran/generated/maxloc1_8_i2.c (.../branches/gcc-4_8-branch)
13980
retarray->offset = 0;
13981
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13983
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13984
- * extent[rank-1];
13985
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13987
- retarray->base_addr = xmalloc (alloc_size);
13988
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13989
if (alloc_size == 0)
13991
/* Make sure we have a zero-sized array. */
13992
@@ -294,8 +293,7 @@
13996
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13997
- * extent[rank-1];
13998
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14000
retarray->offset = 0;
14001
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14002
@@ -307,7 +305,7 @@
14006
- retarray->base_addr = xmalloc (alloc_size);
14007
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14011
@@ -485,8 +483,7 @@
14012
retarray->offset = 0;
14013
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14015
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14016
- * extent[rank-1];
14017
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14019
if (alloc_size == 0)
14021
@@ -495,7 +492,7 @@
14025
- retarray->base_addr = xmalloc (alloc_size);
14026
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14030
Index: libgfortran/generated/any_l8.c
14031
===================================================================
14032
--- a/src/libgfortran/generated/any_l8.c (.../tags/gcc_4_8_3_release)
14033
+++ b/src/libgfortran/generated/any_l8.c (.../branches/gcc-4_8-branch)
14034
@@ -101,8 +101,7 @@
14035
retarray->offset = 0;
14036
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14038
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14039
- * extent[rank-1];
14040
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14042
if (alloc_size == 0)
14044
@@ -111,7 +110,7 @@
14048
- retarray->base_addr = xmalloc (alloc_size);
14049
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
14053
Index: libgfortran/generated/maxloc0_16_r10.c
14054
===================================================================
14055
--- a/src/libgfortran/generated/maxloc0_16_r10.c (.../tags/gcc_4_8_3_release)
14056
+++ b/src/libgfortran/generated/maxloc0_16_r10.c (.../branches/gcc-4_8-branch)
14058
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14059
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14060
retarray->offset = 0;
14061
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14062
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14066
@@ -199,7 +199,7 @@
14067
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14068
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14069
retarray->offset = 0;
14070
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14071
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14075
@@ -367,7 +367,7 @@
14076
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14077
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14078
retarray->offset = 0;
14079
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14080
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14082
else if (unlikely (compile_options.bounds_check))
14084
Index: libgfortran/generated/minloc0_4_i16.c
14085
===================================================================
14086
--- a/src/libgfortran/generated/minloc0_4_i16.c (.../tags/gcc_4_8_3_release)
14087
+++ b/src/libgfortran/generated/minloc0_4_i16.c (.../branches/gcc-4_8-branch)
14089
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14090
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14091
retarray->offset = 0;
14092
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14093
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14097
@@ -199,7 +199,7 @@
14098
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14099
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14100
retarray->offset = 0;
14101
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14102
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14106
@@ -367,7 +367,7 @@
14107
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14108
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14109
retarray->offset = 0;
14110
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14111
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14113
else if (unlikely (compile_options.bounds_check))
14115
Index: libgfortran/generated/maxloc0_8_r8.c
14116
===================================================================
14117
--- a/src/libgfortran/generated/maxloc0_8_r8.c (.../tags/gcc_4_8_3_release)
14118
+++ b/src/libgfortran/generated/maxloc0_8_r8.c (.../branches/gcc-4_8-branch)
14120
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14121
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14122
retarray->offset = 0;
14123
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14124
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14128
@@ -199,7 +199,7 @@
14129
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14130
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14131
retarray->offset = 0;
14132
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14133
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14137
@@ -367,7 +367,7 @@
14138
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14139
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14140
retarray->offset = 0;
14141
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14142
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14144
else if (unlikely (compile_options.bounds_check))
14146
Index: libgfortran/generated/minloc1_4_r10.c
14147
===================================================================
14148
--- a/src/libgfortran/generated/minloc1_4_r10.c (.../tags/gcc_4_8_3_release)
14149
+++ b/src/libgfortran/generated/minloc1_4_r10.c (.../branches/gcc-4_8-branch)
14151
retarray->offset = 0;
14152
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14154
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14155
- * extent[rank-1];
14156
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14158
- retarray->base_addr = xmalloc (alloc_size);
14159
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14160
if (alloc_size == 0)
14162
/* Make sure we have a zero-sized array. */
14163
@@ -294,8 +293,7 @@
14167
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14168
- * extent[rank-1];
14169
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14171
retarray->offset = 0;
14172
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14173
@@ -307,7 +305,7 @@
14177
- retarray->base_addr = xmalloc (alloc_size);
14178
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14182
@@ -485,8 +483,7 @@
14183
retarray->offset = 0;
14184
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14186
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14187
- * extent[rank-1];
14188
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14190
if (alloc_size == 0)
14192
@@ -495,7 +492,7 @@
14196
- retarray->base_addr = xmalloc (alloc_size);
14197
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14201
Index: libgfortran/generated/minloc1_8_i16.c
14202
===================================================================
14203
--- a/src/libgfortran/generated/minloc1_8_i16.c (.../tags/gcc_4_8_3_release)
14204
+++ b/src/libgfortran/generated/minloc1_8_i16.c (.../branches/gcc-4_8-branch)
14206
retarray->offset = 0;
14207
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14209
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14210
- * extent[rank-1];
14211
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14213
- retarray->base_addr = xmalloc (alloc_size);
14214
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14215
if (alloc_size == 0)
14217
/* Make sure we have a zero-sized array. */
14218
@@ -294,8 +293,7 @@
14222
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14223
- * extent[rank-1];
14224
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14226
retarray->offset = 0;
14227
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14228
@@ -307,7 +305,7 @@
14232
- retarray->base_addr = xmalloc (alloc_size);
14233
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14237
@@ -485,8 +483,7 @@
14238
retarray->offset = 0;
14239
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14241
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14242
- * extent[rank-1];
14243
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14245
if (alloc_size == 0)
14247
@@ -495,7 +492,7 @@
14251
- retarray->base_addr = xmalloc (alloc_size);
14252
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14256
Index: libgfortran/generated/maxloc0_8_r10.c
14257
===================================================================
14258
--- a/src/libgfortran/generated/maxloc0_8_r10.c (.../tags/gcc_4_8_3_release)
14259
+++ b/src/libgfortran/generated/maxloc0_8_r10.c (.../branches/gcc-4_8-branch)
14261
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14262
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14263
retarray->offset = 0;
14264
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14265
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14269
@@ -199,7 +199,7 @@
14270
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14271
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14272
retarray->offset = 0;
14273
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14274
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14278
@@ -367,7 +367,7 @@
14279
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14280
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14281
retarray->offset = 0;
14282
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14283
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14285
else if (unlikely (compile_options.bounds_check))
14287
Index: libgfortran/generated/unpack_i4.c
14288
===================================================================
14289
--- a/src/libgfortran/generated/unpack_i4.c (.../tags/gcc_4_8_3_release)
14290
+++ b/src/libgfortran/generated/unpack_i4.c (.../branches/gcc-4_8-branch)
14295
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
14296
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
14300
@@ -244,7 +244,7 @@
14304
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
14305
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
14309
Index: libgfortran/generated/minloc1_16_r4.c
14310
===================================================================
14311
--- a/src/libgfortran/generated/minloc1_16_r4.c (.../tags/gcc_4_8_3_release)
14312
+++ b/src/libgfortran/generated/minloc1_16_r4.c (.../branches/gcc-4_8-branch)
14314
retarray->offset = 0;
14315
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14317
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14318
- * extent[rank-1];
14319
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14321
- retarray->base_addr = xmalloc (alloc_size);
14322
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14323
if (alloc_size == 0)
14325
/* Make sure we have a zero-sized array. */
14326
@@ -294,8 +293,7 @@
14330
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14331
- * extent[rank-1];
14332
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14334
retarray->offset = 0;
14335
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14336
@@ -307,7 +305,7 @@
14340
- retarray->base_addr = xmalloc (alloc_size);
14341
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14345
@@ -485,8 +483,7 @@
14346
retarray->offset = 0;
14347
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14349
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14350
- * extent[rank-1];
14351
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14353
if (alloc_size == 0)
14355
@@ -495,7 +492,7 @@
14359
- retarray->base_addr = xmalloc (alloc_size);
14360
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14364
Index: libgfortran/generated/product_i8.c
14365
===================================================================
14366
--- a/src/libgfortran/generated/product_i8.c (.../tags/gcc_4_8_3_release)
14367
+++ b/src/libgfortran/generated/product_i8.c (.../branches/gcc-4_8-branch)
14369
retarray->offset = 0;
14370
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14372
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14373
- * extent[rank-1];
14374
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14376
- retarray->base_addr = xmalloc (alloc_size);
14377
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14378
if (alloc_size == 0)
14380
/* Make sure we have a zero-sized array. */
14381
@@ -272,8 +271,7 @@
14385
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14386
- * extent[rank-1];
14387
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14389
retarray->offset = 0;
14390
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14391
@@ -285,7 +283,7 @@
14395
- retarray->base_addr = xmalloc (alloc_size);
14396
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14400
@@ -430,8 +428,7 @@
14401
retarray->offset = 0;
14402
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14404
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14405
- * extent[rank-1];
14406
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14408
if (alloc_size == 0)
14410
@@ -440,7 +437,7 @@
14414
- retarray->base_addr = xmalloc (alloc_size);
14415
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14419
Index: libgfortran/generated/minloc0_16_r8.c
14420
===================================================================
14421
--- a/src/libgfortran/generated/minloc0_16_r8.c (.../tags/gcc_4_8_3_release)
14422
+++ b/src/libgfortran/generated/minloc0_16_r8.c (.../branches/gcc-4_8-branch)
14424
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14425
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14426
retarray->offset = 0;
14427
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14428
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14432
@@ -199,7 +199,7 @@
14433
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14434
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14435
retarray->offset = 0;
14436
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14437
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14441
@@ -367,7 +367,7 @@
14442
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14443
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14444
retarray->offset = 0;
14445
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14446
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14448
else if (unlikely (compile_options.bounds_check))
14450
Index: libgfortran/generated/count_2_l.c
14451
===================================================================
14452
--- a/src/libgfortran/generated/count_2_l.c (.../tags/gcc_4_8_3_release)
14453
+++ b/src/libgfortran/generated/count_2_l.c (.../branches/gcc-4_8-branch)
14454
@@ -101,8 +101,7 @@
14455
retarray->offset = 0;
14456
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14458
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14459
- * extent[rank-1];
14460
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14462
if (alloc_size == 0)
14464
@@ -111,7 +110,7 @@
14468
- retarray->base_addr = xmalloc (alloc_size);
14469
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
14473
Index: libgfortran/generated/transpose_r8.c
14474
===================================================================
14475
--- a/src/libgfortran/generated/transpose_r8.c (.../tags/gcc_4_8_3_release)
14476
+++ b/src/libgfortran/generated/transpose_r8.c (.../branches/gcc-4_8-branch)
14478
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
14479
GFC_DESCRIPTOR_EXTENT(source, 1));
14481
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
14482
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
14483
+ sizeof (GFC_REAL_8));
14485
} else if (unlikely (compile_options.bounds_check))
14487
Index: libgfortran/generated/cshift1_8.c
14488
===================================================================
14489
--- a/src/libgfortran/generated/cshift1_8.c (.../tags/gcc_4_8_3_release)
14490
+++ b/src/libgfortran/generated/cshift1_8.c (.../branches/gcc-4_8-branch)
14495
- ret->base_addr = xmalloc (size * arraysize);
14496
+ ret->base_addr = xmallocarray (arraysize, size);
14498
ret->dtype = array->dtype;
14499
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
14500
Index: libgfortran/generated/matmul_i4.c
14501
===================================================================
14502
--- a/src/libgfortran/generated/matmul_i4.c (.../tags/gcc_4_8_3_release)
14503
+++ b/src/libgfortran/generated/matmul_i4.c (.../branches/gcc-4_8-branch)
14504
@@ -124,7 +124,7 @@
14507
retarray->base_addr
14508
- = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
14509
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
14510
retarray->offset = 0;
14512
else if (unlikely (compile_options.bounds_check))
14513
Index: libgfortran/generated/pack_r10.c
14514
===================================================================
14515
--- a/src/libgfortran/generated/pack_r10.c (.../tags/gcc_4_8_3_release)
14516
+++ b/src/libgfortran/generated/pack_r10.c (.../branches/gcc-4_8-branch)
14517
@@ -167,8 +167,8 @@
14521
- /* xmalloc allocates a single byte for zero size. */
14522
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
14523
+ /* xmallocarray allocates a single byte for zero size. */
14524
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
14528
Index: libgfortran/generated/minloc1_16_i2.c
14529
===================================================================
14530
--- a/src/libgfortran/generated/minloc1_16_i2.c (.../tags/gcc_4_8_3_release)
14531
+++ b/src/libgfortran/generated/minloc1_16_i2.c (.../branches/gcc-4_8-branch)
14533
retarray->offset = 0;
14534
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14536
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14537
- * extent[rank-1];
14538
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14540
- retarray->base_addr = xmalloc (alloc_size);
14541
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14542
if (alloc_size == 0)
14544
/* Make sure we have a zero-sized array. */
14545
@@ -294,8 +293,7 @@
14549
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14550
- * extent[rank-1];
14551
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14553
retarray->offset = 0;
14554
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14555
@@ -307,7 +305,7 @@
14559
- retarray->base_addr = xmalloc (alloc_size);
14560
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14564
@@ -485,8 +483,7 @@
14565
retarray->offset = 0;
14566
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14568
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14569
- * extent[rank-1];
14570
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14572
if (alloc_size == 0)
14574
@@ -495,7 +492,7 @@
14578
- retarray->base_addr = xmalloc (alloc_size);
14579
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14583
Index: libgfortran/generated/in_pack_i8.c
14584
===================================================================
14585
--- a/src/libgfortran/generated/in_pack_i8.c (.../tags/gcc_4_8_3_release)
14586
+++ b/src/libgfortran/generated/in_pack_i8.c (.../branches/gcc-4_8-branch)
14588
return source->base_addr;
14590
/* Allocate storage for the destination. */
14591
- destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
14592
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
14594
src = source->base_addr;
14595
stride0 = stride[0];
14596
Index: libgfortran/generated/transpose_r16.c
14597
===================================================================
14598
--- a/src/libgfortran/generated/transpose_r16.c (.../tags/gcc_4_8_3_release)
14599
+++ b/src/libgfortran/generated/transpose_r16.c (.../branches/gcc-4_8-branch)
14601
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
14602
GFC_DESCRIPTOR_EXTENT(source, 1));
14604
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
14605
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
14606
+ sizeof (GFC_REAL_16));
14608
} else if (unlikely (compile_options.bounds_check))
14610
Index: libgfortran/generated/minloc1_4_i4.c
14611
===================================================================
14612
--- a/src/libgfortran/generated/minloc1_4_i4.c (.../tags/gcc_4_8_3_release)
14613
+++ b/src/libgfortran/generated/minloc1_4_i4.c (.../branches/gcc-4_8-branch)
14615
retarray->offset = 0;
14616
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14618
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14619
- * extent[rank-1];
14620
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14622
- retarray->base_addr = xmalloc (alloc_size);
14623
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14624
if (alloc_size == 0)
14626
/* Make sure we have a zero-sized array. */
14627
@@ -294,8 +293,7 @@
14631
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14632
- * extent[rank-1];
14633
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14635
retarray->offset = 0;
14636
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14637
@@ -307,7 +305,7 @@
14641
- retarray->base_addr = xmalloc (alloc_size);
14642
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14646
@@ -485,8 +483,7 @@
14647
retarray->offset = 0;
14648
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14650
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14651
- * extent[rank-1];
14652
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14654
if (alloc_size == 0)
14656
@@ -495,7 +492,7 @@
14660
- retarray->base_addr = xmalloc (alloc_size);
14661
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14665
Index: libgfortran/generated/maxval_i1.c
14666
===================================================================
14667
--- a/src/libgfortran/generated/maxval_i1.c (.../tags/gcc_4_8_3_release)
14668
+++ b/src/libgfortran/generated/maxval_i1.c (.../branches/gcc-4_8-branch)
14670
retarray->offset = 0;
14671
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14673
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14674
- * extent[rank-1];
14675
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14677
- retarray->base_addr = xmalloc (alloc_size);
14678
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14679
if (alloc_size == 0)
14681
/* Make sure we have a zero-sized array. */
14682
@@ -286,8 +285,7 @@
14686
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14687
- * extent[rank-1];
14688
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14690
retarray->offset = 0;
14691
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14692
@@ -299,7 +297,7 @@
14696
- retarray->base_addr = xmalloc (alloc_size);
14697
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14701
@@ -472,8 +470,7 @@
14702
retarray->offset = 0;
14703
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14705
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14706
- * extent[rank-1];
14707
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14709
if (alloc_size == 0)
14711
@@ -482,7 +479,7 @@
14715
- retarray->base_addr = xmalloc (alloc_size);
14716
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14720
Index: libgfortran/generated/product_c16.c
14721
===================================================================
14722
--- a/src/libgfortran/generated/product_c16.c (.../tags/gcc_4_8_3_release)
14723
+++ b/src/libgfortran/generated/product_c16.c (.../branches/gcc-4_8-branch)
14725
retarray->offset = 0;
14726
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14728
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14729
- * extent[rank-1];
14730
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14732
- retarray->base_addr = xmalloc (alloc_size);
14733
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
14734
if (alloc_size == 0)
14736
/* Make sure we have a zero-sized array. */
14737
@@ -272,8 +271,7 @@
14741
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14742
- * extent[rank-1];
14743
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14745
retarray->offset = 0;
14746
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14747
@@ -285,7 +283,7 @@
14751
- retarray->base_addr = xmalloc (alloc_size);
14752
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
14756
@@ -430,8 +428,7 @@
14757
retarray->offset = 0;
14758
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14760
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14761
- * extent[rank-1];
14762
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14764
if (alloc_size == 0)
14766
@@ -440,7 +437,7 @@
14770
- retarray->base_addr = xmalloc (alloc_size);
14771
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
14775
Index: libgfortran/generated/reshape_r4.c
14776
===================================================================
14777
--- a/src/libgfortran/generated/reshape_r4.c (.../tags/gcc_4_8_3_release)
14778
+++ b/src/libgfortran/generated/reshape_r4.c (.../branches/gcc-4_8-branch)
14779
@@ -111,11 +111,11 @@
14782
if (unlikely (rs < 1))
14786
- alloc_size = rs * sizeof (GFC_REAL_4);
14789
- ret->base_addr = xmalloc (alloc_size);
14790
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14791
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
14794
Index: libgfortran/generated/iany_i8.c
14795
===================================================================
14796
--- a/src/libgfortran/generated/iany_i8.c (.../tags/gcc_4_8_3_release)
14797
+++ b/src/libgfortran/generated/iany_i8.c (.../branches/gcc-4_8-branch)
14799
retarray->offset = 0;
14800
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14802
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14803
- * extent[rank-1];
14804
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14806
- retarray->base_addr = xmalloc (alloc_size);
14807
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14808
if (alloc_size == 0)
14810
/* Make sure we have a zero-sized array. */
14811
@@ -272,8 +271,7 @@
14815
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14816
- * extent[rank-1];
14817
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14819
retarray->offset = 0;
14820
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14821
@@ -285,7 +283,7 @@
14825
- retarray->base_addr = xmalloc (alloc_size);
14826
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14830
@@ -430,8 +428,7 @@
14831
retarray->offset = 0;
14832
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14834
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14835
- * extent[rank-1];
14836
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14838
if (alloc_size == 0)
14840
@@ -440,7 +437,7 @@
14844
- retarray->base_addr = xmalloc (alloc_size);
14845
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14849
Index: libgfortran/generated/cshift1_16.c
14850
===================================================================
14851
--- a/src/libgfortran/generated/cshift1_16.c (.../tags/gcc_4_8_3_release)
14852
+++ b/src/libgfortran/generated/cshift1_16.c (.../branches/gcc-4_8-branch)
14857
- ret->base_addr = xmalloc (size * arraysize);
14858
+ ret->base_addr = xmallocarray (arraysize, size);
14860
ret->dtype = array->dtype;
14861
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
14862
Index: libgfortran/generated/maxloc0_4_i1.c
14863
===================================================================
14864
--- a/src/libgfortran/generated/maxloc0_4_i1.c (.../tags/gcc_4_8_3_release)
14865
+++ b/src/libgfortran/generated/maxloc0_4_i1.c (.../branches/gcc-4_8-branch)
14867
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14868
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14869
retarray->offset = 0;
14870
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14871
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14875
@@ -199,7 +199,7 @@
14876
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14877
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14878
retarray->offset = 0;
14879
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14880
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14884
@@ -367,7 +367,7 @@
14885
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14886
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14887
retarray->offset = 0;
14888
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14889
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14891
else if (unlikely (compile_options.bounds_check))
14893
Index: libgfortran/generated/minloc0_4_i8.c
14894
===================================================================
14895
--- a/src/libgfortran/generated/minloc0_4_i8.c (.../tags/gcc_4_8_3_release)
14896
+++ b/src/libgfortran/generated/minloc0_4_i8.c (.../branches/gcc-4_8-branch)
14898
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14899
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14900
retarray->offset = 0;
14901
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14902
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14906
@@ -199,7 +199,7 @@
14907
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14908
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14909
retarray->offset = 0;
14910
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14911
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14915
@@ -367,7 +367,7 @@
14916
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14917
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14918
retarray->offset = 0;
14919
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14920
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14922
else if (unlikely (compile_options.bounds_check))
14924
Index: libgfortran/generated/spread_c16.c
14925
===================================================================
14926
--- a/src/libgfortran/generated/spread_c16.c (.../tags/gcc_4_8_3_release)
14927
+++ b/src/libgfortran/generated/spread_c16.c (.../branches/gcc-4_8-branch)
14928
@@ -101,8 +101,8 @@
14932
- /* xmalloc allocates a single byte for zero size. */
14933
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
14934
+ /* xmallocarray allocates a single byte for zero size. */
14935
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
14939
@@ -244,7 +244,7 @@
14941
if (ret->base_addr == NULL)
14943
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
14944
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
14946
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
14948
Index: libgfortran/generated/maxval_r4.c
14949
===================================================================
14950
--- a/src/libgfortran/generated/maxval_r4.c (.../tags/gcc_4_8_3_release)
14951
+++ b/src/libgfortran/generated/maxval_r4.c (.../branches/gcc-4_8-branch)
14953
retarray->offset = 0;
14954
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14956
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14957
- * extent[rank-1];
14958
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14960
- retarray->base_addr = xmalloc (alloc_size);
14961
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14962
if (alloc_size == 0)
14964
/* Make sure we have a zero-sized array. */
14965
@@ -286,8 +285,7 @@
14969
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14970
- * extent[rank-1];
14971
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14973
retarray->offset = 0;
14974
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14975
@@ -299,7 +297,7 @@
14979
- retarray->base_addr = xmalloc (alloc_size);
14980
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
14984
@@ -472,8 +470,7 @@
14985
retarray->offset = 0;
14986
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14988
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14989
- * extent[rank-1];
14990
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14992
if (alloc_size == 0)
14994
@@ -482,7 +479,7 @@
14998
- retarray->base_addr = xmalloc (alloc_size);
14999
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
15003
Index: libgfortran/generated/minval_r8.c
15004
===================================================================
15005
--- a/src/libgfortran/generated/minval_r8.c (.../tags/gcc_4_8_3_release)
15006
+++ b/src/libgfortran/generated/minval_r8.c (.../branches/gcc-4_8-branch)
15008
retarray->offset = 0;
15009
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15011
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15012
- * extent[rank-1];
15013
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15015
- retarray->base_addr = xmalloc (alloc_size);
15016
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
15017
if (alloc_size == 0)
15019
/* Make sure we have a zero-sized array. */
15020
@@ -286,8 +285,7 @@
15024
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15025
- * extent[rank-1];
15026
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15028
retarray->offset = 0;
15029
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15030
@@ -299,7 +297,7 @@
15034
- retarray->base_addr = xmalloc (alloc_size);
15035
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
15039
@@ -472,8 +470,7 @@
15040
retarray->offset = 0;
15041
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15043
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15044
- * extent[rank-1];
15045
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15047
if (alloc_size == 0)
15049
@@ -482,7 +479,7 @@
15053
- retarray->base_addr = xmalloc (alloc_size);
15054
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
15058
Index: libgfortran/generated/minloc1_16_r16.c
15059
===================================================================
15060
--- a/src/libgfortran/generated/minloc1_16_r16.c (.../tags/gcc_4_8_3_release)
15061
+++ b/src/libgfortran/generated/minloc1_16_r16.c (.../branches/gcc-4_8-branch)
15063
retarray->offset = 0;
15064
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15066
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15067
- * extent[rank-1];
15068
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15070
- retarray->base_addr = xmalloc (alloc_size);
15071
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15072
if (alloc_size == 0)
15074
/* Make sure we have a zero-sized array. */
15075
@@ -294,8 +293,7 @@
15079
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15080
- * extent[rank-1];
15081
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15083
retarray->offset = 0;
15084
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15085
@@ -307,7 +305,7 @@
15089
- retarray->base_addr = xmalloc (alloc_size);
15090
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15094
@@ -485,8 +483,7 @@
15095
retarray->offset = 0;
15096
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15098
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15099
- * extent[rank-1];
15100
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15102
if (alloc_size == 0)
15104
@@ -495,7 +492,7 @@
15108
- retarray->base_addr = xmalloc (alloc_size);
15109
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15113
Index: libgfortran/generated/unpack_i16.c
15114
===================================================================
15115
--- a/src/libgfortran/generated/unpack_i16.c (.../tags/gcc_4_8_3_release)
15116
+++ b/src/libgfortran/generated/unpack_i16.c (.../branches/gcc-4_8-branch)
15121
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
15122
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
15126
@@ -244,7 +244,7 @@
15130
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
15131
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
15135
Index: libgfortran/generated/sum_i8.c
15136
===================================================================
15137
--- a/src/libgfortran/generated/sum_i8.c (.../tags/gcc_4_8_3_release)
15138
+++ b/src/libgfortran/generated/sum_i8.c (.../branches/gcc-4_8-branch)
15140
retarray->offset = 0;
15141
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15143
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15144
- * extent[rank-1];
15145
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15147
- retarray->base_addr = xmalloc (alloc_size);
15148
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15149
if (alloc_size == 0)
15151
/* Make sure we have a zero-sized array. */
15152
@@ -272,8 +271,7 @@
15156
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15157
- * extent[rank-1];
15158
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15160
retarray->offset = 0;
15161
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15162
@@ -285,7 +283,7 @@
15166
- retarray->base_addr = xmalloc (alloc_size);
15167
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15171
@@ -430,8 +428,7 @@
15172
retarray->offset = 0;
15173
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15175
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15176
- * extent[rank-1];
15177
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15179
if (alloc_size == 0)
15181
@@ -440,7 +437,7 @@
15185
- retarray->base_addr = xmalloc (alloc_size);
15186
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15190
Index: libgfortran/generated/pack_i1.c
15191
===================================================================
15192
--- a/src/libgfortran/generated/pack_i1.c (.../tags/gcc_4_8_3_release)
15193
+++ b/src/libgfortran/generated/pack_i1.c (.../branches/gcc-4_8-branch)
15194
@@ -167,8 +167,8 @@
15198
- /* xmalloc allocates a single byte for zero size. */
15199
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
15200
+ /* xmallocarray allocates a single byte for zero size. */
15201
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
15205
Index: libgfortran/generated/any_l16.c
15206
===================================================================
15207
--- a/src/libgfortran/generated/any_l16.c (.../tags/gcc_4_8_3_release)
15208
+++ b/src/libgfortran/generated/any_l16.c (.../branches/gcc-4_8-branch)
15209
@@ -101,8 +101,7 @@
15210
retarray->offset = 0;
15211
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15213
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15214
- * extent[rank-1];
15215
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15217
if (alloc_size == 0)
15219
@@ -111,7 +110,7 @@
15223
- retarray->base_addr = xmalloc (alloc_size);
15224
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
15228
Index: libgfortran/generated/spread_i8.c
15229
===================================================================
15230
--- a/src/libgfortran/generated/spread_i8.c (.../tags/gcc_4_8_3_release)
15231
+++ b/src/libgfortran/generated/spread_i8.c (.../branches/gcc-4_8-branch)
15232
@@ -101,8 +101,8 @@
15236
- /* xmalloc allocates a single byte for zero size. */
15237
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
15238
+ /* xmallocarray allocates a single byte for zero size. */
15239
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
15243
@@ -244,7 +244,7 @@
15245
if (ret->base_addr == NULL)
15247
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
15248
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
15250
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
15252
Index: libgfortran/generated/maxval_i2.c
15253
===================================================================
15254
--- a/src/libgfortran/generated/maxval_i2.c (.../tags/gcc_4_8_3_release)
15255
+++ b/src/libgfortran/generated/maxval_i2.c (.../branches/gcc-4_8-branch)
15257
retarray->offset = 0;
15258
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15260
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15261
- * extent[rank-1];
15262
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15264
- retarray->base_addr = xmalloc (alloc_size);
15265
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15266
if (alloc_size == 0)
15268
/* Make sure we have a zero-sized array. */
15269
@@ -286,8 +285,7 @@
15273
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15274
- * extent[rank-1];
15275
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15277
retarray->offset = 0;
15278
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15279
@@ -299,7 +297,7 @@
15283
- retarray->base_addr = xmalloc (alloc_size);
15284
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15288
@@ -472,8 +470,7 @@
15289
retarray->offset = 0;
15290
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15292
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15293
- * extent[rank-1];
15294
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15296
if (alloc_size == 0)
15298
@@ -482,7 +479,7 @@
15302
- retarray->base_addr = xmalloc (alloc_size);
15303
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15307
Index: libgfortran/generated/maxloc1_8_i4.c
15308
===================================================================
15309
--- a/src/libgfortran/generated/maxloc1_8_i4.c (.../tags/gcc_4_8_3_release)
15310
+++ b/src/libgfortran/generated/maxloc1_8_i4.c (.../branches/gcc-4_8-branch)
15312
retarray->offset = 0;
15313
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15315
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15316
- * extent[rank-1];
15317
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15319
- retarray->base_addr = xmalloc (alloc_size);
15320
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15321
if (alloc_size == 0)
15323
/* Make sure we have a zero-sized array. */
15324
@@ -294,8 +293,7 @@
15328
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15329
- * extent[rank-1];
15330
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15332
retarray->offset = 0;
15333
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15334
@@ -307,7 +305,7 @@
15338
- retarray->base_addr = xmalloc (alloc_size);
15339
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15343
@@ -485,8 +483,7 @@
15344
retarray->offset = 0;
15345
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15347
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15348
- * extent[rank-1];
15349
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15351
if (alloc_size == 0)
15353
@@ -495,7 +492,7 @@
15357
- retarray->base_addr = xmalloc (alloc_size);
15358
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15362
Index: libgfortran/generated/unpack_r8.c
15363
===================================================================
15364
--- a/src/libgfortran/generated/unpack_r8.c (.../tags/gcc_4_8_3_release)
15365
+++ b/src/libgfortran/generated/unpack_r8.c (.../branches/gcc-4_8-branch)
15370
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
15371
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
15375
@@ -244,7 +244,7 @@
15379
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
15380
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
15384
Index: libgfortran/generated/maxloc0_4_r4.c
15385
===================================================================
15386
--- a/src/libgfortran/generated/maxloc0_4_r4.c (.../tags/gcc_4_8_3_release)
15387
+++ b/src/libgfortran/generated/maxloc0_4_r4.c (.../branches/gcc-4_8-branch)
15389
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15390
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15391
retarray->offset = 0;
15392
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15393
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15397
@@ -199,7 +199,7 @@
15398
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15399
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15400
retarray->offset = 0;
15401
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15402
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15406
@@ -367,7 +367,7 @@
15407
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15408
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15409
retarray->offset = 0;
15410
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15411
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15413
else if (unlikely (compile_options.bounds_check))
15415
Index: libgfortran/generated/all_l1.c
15416
===================================================================
15417
--- a/src/libgfortran/generated/all_l1.c (.../tags/gcc_4_8_3_release)
15418
+++ b/src/libgfortran/generated/all_l1.c (.../branches/gcc-4_8-branch)
15419
@@ -101,8 +101,7 @@
15420
retarray->offset = 0;
15421
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15423
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15424
- * extent[rank-1];
15425
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15427
if (alloc_size == 0)
15429
@@ -111,7 +110,7 @@
15433
- retarray->base_addr = xmalloc (alloc_size);
15434
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
15438
Index: libgfortran/generated/matmul_r8.c
15439
===================================================================
15440
--- a/src/libgfortran/generated/matmul_r8.c (.../tags/gcc_4_8_3_release)
15441
+++ b/src/libgfortran/generated/matmul_r8.c (.../branches/gcc-4_8-branch)
15442
@@ -124,7 +124,7 @@
15445
retarray->base_addr
15446
- = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
15447
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
15448
retarray->offset = 0;
15450
else if (unlikely (compile_options.bounds_check))
15451
Index: libgfortran/generated/minloc0_4_r16.c
15452
===================================================================
15453
--- a/src/libgfortran/generated/minloc0_4_r16.c (.../tags/gcc_4_8_3_release)
15454
+++ b/src/libgfortran/generated/minloc0_4_r16.c (.../branches/gcc-4_8-branch)
15456
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15457
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15458
retarray->offset = 0;
15459
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15460
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15464
@@ -199,7 +199,7 @@
15465
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15466
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15467
retarray->offset = 0;
15468
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15469
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15473
@@ -367,7 +367,7 @@
15474
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15475
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15476
retarray->offset = 0;
15477
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15478
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15480
else if (unlikely (compile_options.bounds_check))
15482
Index: libgfortran/generated/maxloc0_4_i2.c
15483
===================================================================
15484
--- a/src/libgfortran/generated/maxloc0_4_i2.c (.../tags/gcc_4_8_3_release)
15485
+++ b/src/libgfortran/generated/maxloc0_4_i2.c (.../branches/gcc-4_8-branch)
15487
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15488
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15489
retarray->offset = 0;
15490
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15491
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15495
@@ -199,7 +199,7 @@
15496
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15497
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15498
retarray->offset = 0;
15499
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15500
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15504
@@ -367,7 +367,7 @@
15505
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15506
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15507
retarray->offset = 0;
15508
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15509
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15511
else if (unlikely (compile_options.bounds_check))
15513
Index: libgfortran/generated/minloc1_8_r16.c
15514
===================================================================
15515
--- a/src/libgfortran/generated/minloc1_8_r16.c (.../tags/gcc_4_8_3_release)
15516
+++ b/src/libgfortran/generated/minloc1_8_r16.c (.../branches/gcc-4_8-branch)
15518
retarray->offset = 0;
15519
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15521
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15522
- * extent[rank-1];
15523
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15525
- retarray->base_addr = xmalloc (alloc_size);
15526
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15527
if (alloc_size == 0)
15529
/* Make sure we have a zero-sized array. */
15530
@@ -294,8 +293,7 @@
15534
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15535
- * extent[rank-1];
15536
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15538
retarray->offset = 0;
15539
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15540
@@ -307,7 +305,7 @@
15544
- retarray->base_addr = xmalloc (alloc_size);
15545
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15549
@@ -485,8 +483,7 @@
15550
retarray->offset = 0;
15551
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15553
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15554
- * extent[rank-1];
15555
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15557
if (alloc_size == 0)
15559
@@ -495,7 +492,7 @@
15563
- retarray->base_addr = xmalloc (alloc_size);
15564
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15568
Index: libgfortran/generated/pack_c10.c
15569
===================================================================
15570
--- a/src/libgfortran/generated/pack_c10.c (.../tags/gcc_4_8_3_release)
15571
+++ b/src/libgfortran/generated/pack_c10.c (.../branches/gcc-4_8-branch)
15572
@@ -167,8 +167,8 @@
15576
- /* xmalloc allocates a single byte for zero size. */
15577
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
15578
+ /* xmallocarray allocates a single byte for zero size. */
15579
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
15583
Index: libgfortran/generated/pack_r4.c
15584
===================================================================
15585
--- a/src/libgfortran/generated/pack_r4.c (.../tags/gcc_4_8_3_release)
15586
+++ b/src/libgfortran/generated/pack_r4.c (.../branches/gcc-4_8-branch)
15587
@@ -167,8 +167,8 @@
15591
- /* xmalloc allocates a single byte for zero size. */
15592
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
15593
+ /* xmallocarray allocates a single byte for zero size. */
15594
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
15598
Index: libgfortran/generated/transpose_c16.c
15599
===================================================================
15600
--- a/src/libgfortran/generated/transpose_c16.c (.../tags/gcc_4_8_3_release)
15601
+++ b/src/libgfortran/generated/transpose_c16.c (.../branches/gcc-4_8-branch)
15603
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15604
GFC_DESCRIPTOR_EXTENT(source, 1));
15606
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
15607
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
15608
+ sizeof (GFC_COMPLEX_16));
15610
} else if (unlikely (compile_options.bounds_check))
15612
Index: libgfortran/generated/maxloc0_8_i8.c
15613
===================================================================
15614
--- a/src/libgfortran/generated/maxloc0_8_i8.c (.../tags/gcc_4_8_3_release)
15615
+++ b/src/libgfortran/generated/maxloc0_8_i8.c (.../branches/gcc-4_8-branch)
15617
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15618
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15619
retarray->offset = 0;
15620
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15621
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15625
@@ -199,7 +199,7 @@
15626
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15627
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15628
retarray->offset = 0;
15629
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15630
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15634
@@ -367,7 +367,7 @@
15635
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15636
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15637
retarray->offset = 0;
15638
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15639
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15641
else if (unlikely (compile_options.bounds_check))
15643
Index: libgfortran/generated/minloc1_4_r8.c
15644
===================================================================
15645
--- a/src/libgfortran/generated/minloc1_4_r8.c (.../tags/gcc_4_8_3_release)
15646
+++ b/src/libgfortran/generated/minloc1_4_r8.c (.../branches/gcc-4_8-branch)
15648
retarray->offset = 0;
15649
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15651
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15652
- * extent[rank-1];
15653
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15655
- retarray->base_addr = xmalloc (alloc_size);
15656
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15657
if (alloc_size == 0)
15659
/* Make sure we have a zero-sized array. */
15660
@@ -294,8 +293,7 @@
15664
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15665
- * extent[rank-1];
15666
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15668
retarray->offset = 0;
15669
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15670
@@ -307,7 +305,7 @@
15674
- retarray->base_addr = xmalloc (alloc_size);
15675
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15679
@@ -485,8 +483,7 @@
15680
retarray->offset = 0;
15681
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15683
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15684
- * extent[rank-1];
15685
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15687
if (alloc_size == 0)
15689
@@ -495,7 +492,7 @@
15693
- retarray->base_addr = xmalloc (alloc_size);
15694
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15698
Index: libgfortran/generated/minloc1_16_i4.c
15699
===================================================================
15700
--- a/src/libgfortran/generated/minloc1_16_i4.c (.../tags/gcc_4_8_3_release)
15701
+++ b/src/libgfortran/generated/minloc1_16_i4.c (.../branches/gcc-4_8-branch)
15703
retarray->offset = 0;
15704
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15706
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15707
- * extent[rank-1];
15708
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15710
- retarray->base_addr = xmalloc (alloc_size);
15711
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15712
if (alloc_size == 0)
15714
/* Make sure we have a zero-sized array. */
15715
@@ -294,8 +293,7 @@
15719
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15720
- * extent[rank-1];
15721
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15723
retarray->offset = 0;
15724
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15725
@@ -307,7 +305,7 @@
15729
- retarray->base_addr = xmalloc (alloc_size);
15730
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15734
@@ -485,8 +483,7 @@
15735
retarray->offset = 0;
15736
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15738
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15739
- * extent[rank-1];
15740
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15742
if (alloc_size == 0)
15744
@@ -495,7 +492,7 @@
15748
- retarray->base_addr = xmalloc (alloc_size);
15749
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15753
Index: libgfortran/generated/minloc0_16_i8.c
15754
===================================================================
15755
--- a/src/libgfortran/generated/minloc0_16_i8.c (.../tags/gcc_4_8_3_release)
15756
+++ b/src/libgfortran/generated/minloc0_16_i8.c (.../branches/gcc-4_8-branch)
15758
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15759
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15760
retarray->offset = 0;
15761
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15762
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15766
@@ -199,7 +199,7 @@
15767
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15768
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15769
retarray->offset = 0;
15770
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15771
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15775
@@ -367,7 +367,7 @@
15776
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15777
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15778
retarray->offset = 0;
15779
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15780
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15782
else if (unlikely (compile_options.bounds_check))
15784
Index: libgfortran/generated/pack_i2.c
15785
===================================================================
15786
--- a/src/libgfortran/generated/pack_i2.c (.../tags/gcc_4_8_3_release)
15787
+++ b/src/libgfortran/generated/pack_i2.c (.../branches/gcc-4_8-branch)
15788
@@ -167,8 +167,8 @@
15792
- /* xmalloc allocates a single byte for zero size. */
15793
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
15794
+ /* xmallocarray allocates a single byte for zero size. */
15795
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
15799
Index: libgfortran/generated/transpose_i8.c
15800
===================================================================
15801
--- a/src/libgfortran/generated/transpose_i8.c (.../tags/gcc_4_8_3_release)
15802
+++ b/src/libgfortran/generated/transpose_i8.c (.../branches/gcc-4_8-branch)
15804
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15805
GFC_DESCRIPTOR_EXTENT(source, 1));
15807
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
15808
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
15809
+ sizeof (GFC_INTEGER_8));
15811
} else if (unlikely (compile_options.bounds_check))
15813
Index: libgfortran/generated/eoshift1_16.c
15814
===================================================================
15815
--- a/src/libgfortran/generated/eoshift1_16.c (.../tags/gcc_4_8_3_release)
15816
+++ b/src/libgfortran/generated/eoshift1_16.c (.../branches/gcc-4_8-branch)
15817
@@ -105,8 +105,8 @@
15818
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
15821
- /* xmalloc allocates a single byte for zero size. */
15822
- ret->base_addr = xmalloc (size * arraysize);
15823
+ /* xmallocarray allocates a single byte for zero size. */
15824
+ ret->base_addr = xmallocarray (arraysize, size);
15827
else if (unlikely (compile_options.bounds_check))
15828
Index: libgfortran/generated/all_l2.c
15829
===================================================================
15830
--- a/src/libgfortran/generated/all_l2.c (.../tags/gcc_4_8_3_release)
15831
+++ b/src/libgfortran/generated/all_l2.c (.../branches/gcc-4_8-branch)
15832
@@ -101,8 +101,7 @@
15833
retarray->offset = 0;
15834
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15836
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15837
- * extent[rank-1];
15838
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15840
if (alloc_size == 0)
15842
@@ -111,7 +110,7 @@
15846
- retarray->base_addr = xmalloc (alloc_size);
15847
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
15851
Index: libgfortran/generated/product_c4.c
15852
===================================================================
15853
--- a/src/libgfortran/generated/product_c4.c (.../tags/gcc_4_8_3_release)
15854
+++ b/src/libgfortran/generated/product_c4.c (.../branches/gcc-4_8-branch)
15856
retarray->offset = 0;
15857
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15859
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15860
- * extent[rank-1];
15861
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15863
- retarray->base_addr = xmalloc (alloc_size);
15864
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
15865
if (alloc_size == 0)
15867
/* Make sure we have a zero-sized array. */
15868
@@ -272,8 +271,7 @@
15872
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15873
- * extent[rank-1];
15874
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15876
retarray->offset = 0;
15877
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15878
@@ -285,7 +283,7 @@
15882
- retarray->base_addr = xmalloc (alloc_size);
15883
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
15887
@@ -430,8 +428,7 @@
15888
retarray->offset = 0;
15889
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15891
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15892
- * extent[rank-1];
15893
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15895
if (alloc_size == 0)
15897
@@ -440,7 +437,7 @@
15901
- retarray->base_addr = xmalloc (alloc_size);
15902
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
15906
Index: libgfortran/generated/iall_i1.c
15907
===================================================================
15908
--- a/src/libgfortran/generated/iall_i1.c (.../tags/gcc_4_8_3_release)
15909
+++ b/src/libgfortran/generated/iall_i1.c (.../branches/gcc-4_8-branch)
15911
retarray->offset = 0;
15912
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15914
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15915
- * extent[rank-1];
15916
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15918
- retarray->base_addr = xmalloc (alloc_size);
15919
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15920
if (alloc_size == 0)
15922
/* Make sure we have a zero-sized array. */
15923
@@ -272,8 +271,7 @@
15927
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15928
- * extent[rank-1];
15929
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15931
retarray->offset = 0;
15932
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15933
@@ -285,7 +283,7 @@
15937
- retarray->base_addr = xmalloc (alloc_size);
15938
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15942
@@ -430,8 +428,7 @@
15943
retarray->offset = 0;
15944
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15946
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15947
- * extent[rank-1];
15948
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15950
if (alloc_size == 0)
15952
@@ -440,7 +437,7 @@
15956
- retarray->base_addr = xmalloc (alloc_size);
15957
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15961
Index: libgfortran/generated/reshape_i4.c
15962
===================================================================
15963
--- a/src/libgfortran/generated/reshape_i4.c (.../tags/gcc_4_8_3_release)
15964
+++ b/src/libgfortran/generated/reshape_i4.c (.../branches/gcc-4_8-branch)
15965
@@ -111,11 +111,11 @@
15968
if (unlikely (rs < 1))
15972
- alloc_size = rs * sizeof (GFC_INTEGER_4);
15975
- ret->base_addr = xmalloc (alloc_size);
15976
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15977
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
15980
Index: libgfortran/generated/in_pack_r10.c
15981
===================================================================
15982
--- a/src/libgfortran/generated/in_pack_r10.c (.../tags/gcc_4_8_3_release)
15983
+++ b/src/libgfortran/generated/in_pack_r10.c (.../branches/gcc-4_8-branch)
15985
return source->base_addr;
15987
/* Allocate storage for the destination. */
15988
- destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
15989
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
15991
src = source->base_addr;
15992
stride0 = stride[0];
15993
Index: libgfortran/generated/in_pack_c4.c
15994
===================================================================
15995
--- a/src/libgfortran/generated/in_pack_c4.c (.../tags/gcc_4_8_3_release)
15996
+++ b/src/libgfortran/generated/in_pack_c4.c (.../branches/gcc-4_8-branch)
15998
return source->base_addr;
16000
/* Allocate storage for the destination. */
16001
- destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
16002
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
16004
src = source->base_addr;
16005
stride0 = stride[0];
16006
Index: libgfortran/generated/all_l16.c
16007
===================================================================
16008
--- a/src/libgfortran/generated/all_l16.c (.../tags/gcc_4_8_3_release)
16009
+++ b/src/libgfortran/generated/all_l16.c (.../branches/gcc-4_8-branch)
16010
@@ -101,8 +101,7 @@
16011
retarray->offset = 0;
16012
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16014
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16015
- * extent[rank-1];
16016
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16018
if (alloc_size == 0)
16020
@@ -111,7 +110,7 @@
16024
- retarray->base_addr = xmalloc (alloc_size);
16025
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
16029
Index: libgfortran/generated/maxloc0_16_i1.c
16030
===================================================================
16031
--- a/src/libgfortran/generated/maxloc0_16_i1.c (.../tags/gcc_4_8_3_release)
16032
+++ b/src/libgfortran/generated/maxloc0_16_i1.c (.../branches/gcc-4_8-branch)
16034
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16035
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16036
retarray->offset = 0;
16037
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16038
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16042
@@ -199,7 +199,7 @@
16043
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16044
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16045
retarray->offset = 0;
16046
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16047
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16051
@@ -367,7 +367,7 @@
16052
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16053
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16054
retarray->offset = 0;
16055
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16056
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16058
else if (unlikely (compile_options.bounds_check))
16060
Index: libgfortran/generated/maxloc1_8_r8.c
16061
===================================================================
16062
--- a/src/libgfortran/generated/maxloc1_8_r8.c (.../tags/gcc_4_8_3_release)
16063
+++ b/src/libgfortran/generated/maxloc1_8_r8.c (.../branches/gcc-4_8-branch)
16065
retarray->offset = 0;
16066
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16068
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16069
- * extent[rank-1];
16070
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16072
- retarray->base_addr = xmalloc (alloc_size);
16073
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16074
if (alloc_size == 0)
16076
/* Make sure we have a zero-sized array. */
16077
@@ -294,8 +293,7 @@
16081
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16082
- * extent[rank-1];
16083
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16085
retarray->offset = 0;
16086
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16087
@@ -307,7 +305,7 @@
16091
- retarray->base_addr = xmalloc (alloc_size);
16092
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16096
@@ -485,8 +483,7 @@
16097
retarray->offset = 0;
16098
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16100
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16101
- * extent[rank-1];
16102
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16104
if (alloc_size == 0)
16106
@@ -495,7 +492,7 @@
16110
- retarray->base_addr = xmalloc (alloc_size);
16111
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16115
Index: libgfortran/generated/minval_i16.c
16116
===================================================================
16117
--- a/src/libgfortran/generated/minval_i16.c (.../tags/gcc_4_8_3_release)
16118
+++ b/src/libgfortran/generated/minval_i16.c (.../branches/gcc-4_8-branch)
16120
retarray->offset = 0;
16121
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16123
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16124
- * extent[rank-1];
16125
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16127
- retarray->base_addr = xmalloc (alloc_size);
16128
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16129
if (alloc_size == 0)
16131
/* Make sure we have a zero-sized array. */
16132
@@ -286,8 +285,7 @@
16136
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16137
- * extent[rank-1];
16138
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16140
retarray->offset = 0;
16141
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16142
@@ -299,7 +297,7 @@
16146
- retarray->base_addr = xmalloc (alloc_size);
16147
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16151
@@ -472,8 +470,7 @@
16152
retarray->offset = 0;
16153
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16155
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16156
- * extent[rank-1];
16157
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16159
if (alloc_size == 0)
16161
@@ -482,7 +479,7 @@
16165
- retarray->base_addr = xmalloc (alloc_size);
16166
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16170
Index: libgfortran/generated/reshape_r10.c
16171
===================================================================
16172
--- a/src/libgfortran/generated/reshape_r10.c (.../tags/gcc_4_8_3_release)
16173
+++ b/src/libgfortran/generated/reshape_r10.c (.../branches/gcc-4_8-branch)
16174
@@ -111,11 +111,11 @@
16177
if (unlikely (rs < 1))
16181
- alloc_size = rs * sizeof (GFC_REAL_10);
16184
- ret->base_addr = xmalloc (alloc_size);
16185
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
16186
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
16189
Index: libgfortran/generated/unpack_r16.c
16190
===================================================================
16191
--- a/src/libgfortran/generated/unpack_r16.c (.../tags/gcc_4_8_3_release)
16192
+++ b/src/libgfortran/generated/unpack_r16.c (.../branches/gcc-4_8-branch)
16197
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
16198
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
16202
@@ -244,7 +244,7 @@
16206
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
16207
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
16211
Index: libgfortran/generated/maxval_i4.c
16212
===================================================================
16213
--- a/src/libgfortran/generated/maxval_i4.c (.../tags/gcc_4_8_3_release)
16214
+++ b/src/libgfortran/generated/maxval_i4.c (.../branches/gcc-4_8-branch)
16216
retarray->offset = 0;
16217
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16219
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16220
- * extent[rank-1];
16221
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16223
- retarray->base_addr = xmalloc (alloc_size);
16224
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16225
if (alloc_size == 0)
16227
/* Make sure we have a zero-sized array. */
16228
@@ -286,8 +285,7 @@
16232
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16233
- * extent[rank-1];
16234
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16236
retarray->offset = 0;
16237
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16238
@@ -299,7 +297,7 @@
16242
- retarray->base_addr = xmalloc (alloc_size);
16243
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16247
@@ -472,8 +470,7 @@
16248
retarray->offset = 0;
16249
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16251
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16252
- * extent[rank-1];
16253
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16255
if (alloc_size == 0)
16257
@@ -482,7 +479,7 @@
16261
- retarray->base_addr = xmalloc (alloc_size);
16262
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16266
Index: libgfortran/generated/minval_i8.c
16267
===================================================================
16268
--- a/src/libgfortran/generated/minval_i8.c (.../tags/gcc_4_8_3_release)
16269
+++ b/src/libgfortran/generated/minval_i8.c (.../branches/gcc-4_8-branch)
16271
retarray->offset = 0;
16272
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16274
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16275
- * extent[rank-1];
16276
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16278
- retarray->base_addr = xmalloc (alloc_size);
16279
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16280
if (alloc_size == 0)
16282
/* Make sure we have a zero-sized array. */
16283
@@ -286,8 +285,7 @@
16287
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16288
- * extent[rank-1];
16289
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16291
retarray->offset = 0;
16292
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16293
@@ -299,7 +297,7 @@
16297
- retarray->base_addr = xmalloc (alloc_size);
16298
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16302
@@ -472,8 +470,7 @@
16303
retarray->offset = 0;
16304
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16306
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16307
- * extent[rank-1];
16308
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16310
if (alloc_size == 0)
16312
@@ -482,7 +479,7 @@
16316
- retarray->base_addr = xmalloc (alloc_size);
16317
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16321
Index: libgfortran/generated/maxloc0_16_i16.c
16322
===================================================================
16323
--- a/src/libgfortran/generated/maxloc0_16_i16.c (.../tags/gcc_4_8_3_release)
16324
+++ b/src/libgfortran/generated/maxloc0_16_i16.c (.../branches/gcc-4_8-branch)
16326
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16327
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16328
retarray->offset = 0;
16329
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16330
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16334
@@ -199,7 +199,7 @@
16335
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16336
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16337
retarray->offset = 0;
16338
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16339
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16343
@@ -367,7 +367,7 @@
16344
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16345
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16346
retarray->offset = 0;
16347
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16348
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16350
else if (unlikely (compile_options.bounds_check))
16352
Index: libgfortran/generated/shape_i4.c
16353
===================================================================
16354
--- a/src/libgfortran/generated/shape_i4.c (.../tags/gcc_4_8_3_release)
16355
+++ b/src/libgfortran/generated/shape_i4.c (.../branches/gcc-4_8-branch)
16358
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
16360
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16361
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16364
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
16365
Index: libgfortran/generated/minloc1_4_i16.c
16366
===================================================================
16367
--- a/src/libgfortran/generated/minloc1_4_i16.c (.../tags/gcc_4_8_3_release)
16368
+++ b/src/libgfortran/generated/minloc1_4_i16.c (.../branches/gcc-4_8-branch)
16370
retarray->offset = 0;
16371
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
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];
16377
- retarray->base_addr = xmalloc (alloc_size);
16378
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16379
if (alloc_size == 0)
16381
/* Make sure we have a zero-sized array. */
16382
@@ -294,8 +293,7 @@
16386
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16387
- * extent[rank-1];
16388
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16390
retarray->offset = 0;
16391
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16392
@@ -307,7 +305,7 @@
16396
- retarray->base_addr = xmalloc (alloc_size);
16397
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16401
@@ -485,8 +483,7 @@
16402
retarray->offset = 0;
16403
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16405
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16406
- * extent[rank-1];
16407
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16409
if (alloc_size == 0)
16411
@@ -495,7 +492,7 @@
16415
- retarray->base_addr = xmalloc (alloc_size);
16416
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16420
Index: libgfortran/generated/maxloc0_4_r10.c
16421
===================================================================
16422
--- a/src/libgfortran/generated/maxloc0_4_r10.c (.../tags/gcc_4_8_3_release)
16423
+++ b/src/libgfortran/generated/maxloc0_4_r10.c (.../branches/gcc-4_8-branch)
16425
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16426
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16427
retarray->offset = 0;
16428
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16429
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16433
@@ -199,7 +199,7 @@
16434
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16435
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16436
retarray->offset = 0;
16437
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16438
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16442
@@ -367,7 +367,7 @@
16443
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16444
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16445
retarray->offset = 0;
16446
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16447
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16449
else if (unlikely (compile_options.bounds_check))
16451
Index: libgfortran/generated/maxloc0_8_i16.c
16452
===================================================================
16453
--- a/src/libgfortran/generated/maxloc0_8_i16.c (.../tags/gcc_4_8_3_release)
16454
+++ b/src/libgfortran/generated/maxloc0_8_i16.c (.../branches/gcc-4_8-branch)
16456
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16457
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16458
retarray->offset = 0;
16459
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16460
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16464
@@ -199,7 +199,7 @@
16465
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16466
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16467
retarray->offset = 0;
16468
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16469
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16473
@@ -367,7 +367,7 @@
16474
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16475
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16476
retarray->offset = 0;
16477
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16478
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16480
else if (unlikely (compile_options.bounds_check))
16482
Index: libgfortran/generated/iall_i2.c
16483
===================================================================
16484
--- a/src/libgfortran/generated/iall_i2.c (.../tags/gcc_4_8_3_release)
16485
+++ b/src/libgfortran/generated/iall_i2.c (.../branches/gcc-4_8-branch)
16487
retarray->offset = 0;
16488
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16490
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16491
- * extent[rank-1];
16492
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16494
- retarray->base_addr = xmalloc (alloc_size);
16495
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16496
if (alloc_size == 0)
16498
/* Make sure we have a zero-sized array. */
16499
@@ -272,8 +271,7 @@
16503
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16504
- * extent[rank-1];
16505
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16507
retarray->offset = 0;
16508
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16509
@@ -285,7 +283,7 @@
16513
- retarray->base_addr = xmalloc (alloc_size);
16514
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16518
@@ -430,8 +428,7 @@
16519
retarray->offset = 0;
16520
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16522
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16523
- * extent[rank-1];
16524
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16526
if (alloc_size == 0)
16528
@@ -440,7 +437,7 @@
16532
- retarray->base_addr = xmalloc (alloc_size);
16533
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16537
Index: libgfortran/generated/maxloc1_8_r10.c
16538
===================================================================
16539
--- a/src/libgfortran/generated/maxloc1_8_r10.c (.../tags/gcc_4_8_3_release)
16540
+++ b/src/libgfortran/generated/maxloc1_8_r10.c (.../branches/gcc-4_8-branch)
16542
retarray->offset = 0;
16543
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16545
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16546
- * extent[rank-1];
16547
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16549
- retarray->base_addr = xmalloc (alloc_size);
16550
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16551
if (alloc_size == 0)
16553
/* Make sure we have a zero-sized array. */
16554
@@ -294,8 +293,7 @@
16558
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16559
- * extent[rank-1];
16560
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16562
retarray->offset = 0;
16563
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16564
@@ -307,7 +305,7 @@
16568
- retarray->base_addr = xmalloc (alloc_size);
16569
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16573
@@ -485,8 +483,7 @@
16574
retarray->offset = 0;
16575
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16577
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16578
- * extent[rank-1];
16579
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16581
if (alloc_size == 0)
16583
@@ -495,7 +492,7 @@
16587
- retarray->base_addr = xmalloc (alloc_size);
16588
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16592
Index: libgfortran/generated/maxloc0_16_r4.c
16593
===================================================================
16594
--- a/src/libgfortran/generated/maxloc0_16_r4.c (.../tags/gcc_4_8_3_release)
16595
+++ b/src/libgfortran/generated/maxloc0_16_r4.c (.../branches/gcc-4_8-branch)
16597
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16598
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16599
retarray->offset = 0;
16600
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16601
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16605
@@ -199,7 +199,7 @@
16606
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16607
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16608
retarray->offset = 0;
16609
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16610
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16614
@@ -367,7 +367,7 @@
16615
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16616
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16617
retarray->offset = 0;
16618
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16619
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16621
else if (unlikely (compile_options.bounds_check))
16623
Index: libgfortran/generated/minloc0_8_i1.c
16624
===================================================================
16625
--- a/src/libgfortran/generated/minloc0_8_i1.c (.../tags/gcc_4_8_3_release)
16626
+++ b/src/libgfortran/generated/minloc0_8_i1.c (.../branches/gcc-4_8-branch)
16628
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16629
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16630
retarray->offset = 0;
16631
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16632
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16636
@@ -199,7 +199,7 @@
16637
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16638
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16639
retarray->offset = 0;
16640
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16641
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16645
@@ -367,7 +367,7 @@
16646
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16647
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16648
retarray->offset = 0;
16649
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16650
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16652
else if (unlikely (compile_options.bounds_check))
16654
Index: libgfortran/generated/minloc1_16_r8.c
16655
===================================================================
16656
--- a/src/libgfortran/generated/minloc1_16_r8.c (.../tags/gcc_4_8_3_release)
16657
+++ b/src/libgfortran/generated/minloc1_16_r8.c (.../branches/gcc-4_8-branch)
16659
retarray->offset = 0;
16660
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16662
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16663
- * extent[rank-1];
16664
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16666
- retarray->base_addr = xmalloc (alloc_size);
16667
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16668
if (alloc_size == 0)
16670
/* Make sure we have a zero-sized array. */
16671
@@ -294,8 +293,7 @@
16675
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16676
- * extent[rank-1];
16677
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16679
retarray->offset = 0;
16680
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16681
@@ -307,7 +305,7 @@
16685
- retarray->base_addr = xmalloc (alloc_size);
16686
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16690
@@ -485,8 +483,7 @@
16691
retarray->offset = 0;
16692
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16694
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16695
- * extent[rank-1];
16696
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16698
if (alloc_size == 0)
16700
@@ -495,7 +492,7 @@
16704
- retarray->base_addr = xmalloc (alloc_size);
16705
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16709
Index: libgfortran/generated/unpack_i8.c
16710
===================================================================
16711
--- a/src/libgfortran/generated/unpack_i8.c (.../tags/gcc_4_8_3_release)
16712
+++ b/src/libgfortran/generated/unpack_i8.c (.../branches/gcc-4_8-branch)
16717
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
16718
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
16722
@@ -244,7 +244,7 @@
16726
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
16727
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
16731
Index: libgfortran/generated/maxloc0_4_i4.c
16732
===================================================================
16733
--- a/src/libgfortran/generated/maxloc0_4_i4.c (.../tags/gcc_4_8_3_release)
16734
+++ b/src/libgfortran/generated/maxloc0_4_i4.c (.../branches/gcc-4_8-branch)
16736
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16737
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16738
retarray->offset = 0;
16739
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16740
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16744
@@ -199,7 +199,7 @@
16745
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16746
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16747
retarray->offset = 0;
16748
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16749
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16753
@@ -367,7 +367,7 @@
16754
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16755
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16756
retarray->offset = 0;
16757
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16758
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16760
else if (unlikely (compile_options.bounds_check))
16762
Index: libgfortran/generated/count_4_l.c
16763
===================================================================
16764
--- a/src/libgfortran/generated/count_4_l.c (.../tags/gcc_4_8_3_release)
16765
+++ b/src/libgfortran/generated/count_4_l.c (.../branches/gcc-4_8-branch)
16766
@@ -101,8 +101,7 @@
16767
retarray->offset = 0;
16768
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16770
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16771
- * extent[rank-1];
16772
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16774
if (alloc_size == 0)
16776
@@ -111,7 +110,7 @@
16780
- retarray->base_addr = xmalloc (alloc_size);
16781
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16785
Index: libgfortran/generated/sum_r10.c
16786
===================================================================
16787
--- a/src/libgfortran/generated/sum_r10.c (.../tags/gcc_4_8_3_release)
16788
+++ b/src/libgfortran/generated/sum_r10.c (.../branches/gcc-4_8-branch)
16790
retarray->offset = 0;
16791
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16793
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16794
- * extent[rank-1];
16795
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16797
- retarray->base_addr = xmalloc (alloc_size);
16798
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
16799
if (alloc_size == 0)
16801
/* Make sure we have a zero-sized array. */
16802
@@ -272,8 +271,7 @@
16806
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16807
- * extent[rank-1];
16808
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16810
retarray->offset = 0;
16811
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16812
@@ -285,7 +283,7 @@
16816
- retarray->base_addr = xmalloc (alloc_size);
16817
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
16821
@@ -430,8 +428,7 @@
16822
retarray->offset = 0;
16823
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16825
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16826
- * extent[rank-1];
16827
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16829
if (alloc_size == 0)
16831
@@ -440,7 +437,7 @@
16835
- retarray->base_addr = xmalloc (alloc_size);
16836
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
16840
Index: libgfortran/generated/sum_c4.c
16841
===================================================================
16842
--- a/src/libgfortran/generated/sum_c4.c (.../tags/gcc_4_8_3_release)
16843
+++ b/src/libgfortran/generated/sum_c4.c (.../branches/gcc-4_8-branch)
16845
retarray->offset = 0;
16846
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16848
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16849
- * extent[rank-1];
16850
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16852
- retarray->base_addr = xmalloc (alloc_size);
16853
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
16854
if (alloc_size == 0)
16856
/* Make sure we have a zero-sized array. */
16857
@@ -272,8 +271,7 @@
16861
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16862
- * extent[rank-1];
16863
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16865
retarray->offset = 0;
16866
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16867
@@ -285,7 +283,7 @@
16871
- retarray->base_addr = xmalloc (alloc_size);
16872
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
16876
@@ -430,8 +428,7 @@
16877
retarray->offset = 0;
16878
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16880
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16881
- * extent[rank-1];
16882
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16884
if (alloc_size == 0)
16886
@@ -440,7 +437,7 @@
16890
- retarray->base_addr = xmalloc (alloc_size);
16891
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
16895
Index: libgfortran/generated/maxloc1_16_r10.c
16896
===================================================================
16897
--- a/src/libgfortran/generated/maxloc1_16_r10.c (.../tags/gcc_4_8_3_release)
16898
+++ b/src/libgfortran/generated/maxloc1_16_r10.c (.../branches/gcc-4_8-branch)
16900
retarray->offset = 0;
16901
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16903
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16904
- * extent[rank-1];
16905
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16907
- retarray->base_addr = xmalloc (alloc_size);
16908
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16909
if (alloc_size == 0)
16911
/* Make sure we have a zero-sized array. */
16912
@@ -294,8 +293,7 @@
16916
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16917
- * extent[rank-1];
16918
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16920
retarray->offset = 0;
16921
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16922
@@ -307,7 +305,7 @@
16926
- retarray->base_addr = xmalloc (alloc_size);
16927
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16931
@@ -485,8 +483,7 @@
16932
retarray->offset = 0;
16933
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16935
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16936
- * extent[rank-1];
16937
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16939
if (alloc_size == 0)
16941
@@ -495,7 +492,7 @@
16945
- retarray->base_addr = xmalloc (alloc_size);
16946
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16950
Index: libgfortran/generated/pack_i16.c
16951
===================================================================
16952
--- a/src/libgfortran/generated/pack_i16.c (.../tags/gcc_4_8_3_release)
16953
+++ b/src/libgfortran/generated/pack_i16.c (.../branches/gcc-4_8-branch)
16954
@@ -167,8 +167,8 @@
16958
- /* xmalloc allocates a single byte for zero size. */
16959
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
16960
+ /* xmallocarray allocates a single byte for zero size. */
16961
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
16965
Index: libgfortran/generated/matmul_i8.c
16966
===================================================================
16967
--- a/src/libgfortran/generated/matmul_i8.c (.../tags/gcc_4_8_3_release)
16968
+++ b/src/libgfortran/generated/matmul_i8.c (.../branches/gcc-4_8-branch)
16969
@@ -124,7 +124,7 @@
16972
retarray->base_addr
16973
- = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
16974
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
16975
retarray->offset = 0;
16977
else if (unlikely (compile_options.bounds_check))
16978
Index: libgfortran/generated/maxloc0_16_i2.c
16979
===================================================================
16980
--- a/src/libgfortran/generated/maxloc0_16_i2.c (.../tags/gcc_4_8_3_release)
16981
+++ b/src/libgfortran/generated/maxloc0_16_i2.c (.../branches/gcc-4_8-branch)
16983
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16984
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16985
retarray->offset = 0;
16986
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16987
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
16991
@@ -199,7 +199,7 @@
16992
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16993
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16994
retarray->offset = 0;
16995
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
16996
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17000
@@ -367,7 +367,7 @@
17001
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17002
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17003
retarray->offset = 0;
17004
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17005
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17007
else if (unlikely (compile_options.bounds_check))
17009
Index: libgfortran/generated/spread_c4.c
17010
===================================================================
17011
--- a/src/libgfortran/generated/spread_c4.c (.../tags/gcc_4_8_3_release)
17012
+++ b/src/libgfortran/generated/spread_c4.c (.../branches/gcc-4_8-branch)
17013
@@ -101,8 +101,8 @@
17017
- /* xmalloc allocates a single byte for zero size. */
17018
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
17019
+ /* xmallocarray allocates a single byte for zero size. */
17020
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
17024
@@ -244,7 +244,7 @@
17026
if (ret->base_addr == NULL)
17028
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
17029
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
17031
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
17033
Index: libgfortran/generated/maxval_r10.c
17034
===================================================================
17035
--- a/src/libgfortran/generated/maxval_r10.c (.../tags/gcc_4_8_3_release)
17036
+++ b/src/libgfortran/generated/maxval_r10.c (.../branches/gcc-4_8-branch)
17038
retarray->offset = 0;
17039
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17041
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17042
- * extent[rank-1];
17043
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17045
- retarray->base_addr = xmalloc (alloc_size);
17046
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17047
if (alloc_size == 0)
17049
/* Make sure we have a zero-sized array. */
17050
@@ -286,8 +285,7 @@
17054
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17055
- * extent[rank-1];
17056
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17058
retarray->offset = 0;
17059
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17060
@@ -299,7 +297,7 @@
17064
- retarray->base_addr = xmalloc (alloc_size);
17065
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17069
@@ -472,8 +470,7 @@
17070
retarray->offset = 0;
17071
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17073
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17074
- * extent[rank-1];
17075
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17077
if (alloc_size == 0)
17079
@@ -482,7 +479,7 @@
17083
- retarray->base_addr = xmalloc (alloc_size);
17084
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17088
Index: libgfortran/generated/pack_i4.c
17089
===================================================================
17090
--- a/src/libgfortran/generated/pack_i4.c (.../tags/gcc_4_8_3_release)
17091
+++ b/src/libgfortran/generated/pack_i4.c (.../branches/gcc-4_8-branch)
17092
@@ -167,8 +167,8 @@
17096
- /* xmalloc allocates a single byte for zero size. */
17097
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
17098
+ /* xmallocarray allocates a single byte for zero size. */
17099
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
17103
Index: libgfortran/generated/maxloc1_4_i1.c
17104
===================================================================
17105
--- a/src/libgfortran/generated/maxloc1_4_i1.c (.../tags/gcc_4_8_3_release)
17106
+++ b/src/libgfortran/generated/maxloc1_4_i1.c (.../branches/gcc-4_8-branch)
17108
retarray->offset = 0;
17109
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17111
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17112
- * extent[rank-1];
17113
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17115
- retarray->base_addr = xmalloc (alloc_size);
17116
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17117
if (alloc_size == 0)
17119
/* Make sure we have a zero-sized array. */
17120
@@ -294,8 +293,7 @@
17124
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17125
- * extent[rank-1];
17126
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17128
retarray->offset = 0;
17129
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17130
@@ -307,7 +305,7 @@
17134
- retarray->base_addr = xmalloc (alloc_size);
17135
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17139
@@ -485,8 +483,7 @@
17140
retarray->offset = 0;
17141
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17143
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17144
- * extent[rank-1];
17145
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17147
if (alloc_size == 0)
17149
@@ -495,7 +492,7 @@
17153
- retarray->base_addr = xmalloc (alloc_size);
17154
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17158
Index: libgfortran/generated/matmul_r10.c
17159
===================================================================
17160
--- a/src/libgfortran/generated/matmul_r10.c (.../tags/gcc_4_8_3_release)
17161
+++ b/src/libgfortran/generated/matmul_r10.c (.../branches/gcc-4_8-branch)
17162
@@ -124,7 +124,7 @@
17165
retarray->base_addr
17166
- = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
17167
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
17168
retarray->offset = 0;
17170
else if (unlikely (compile_options.bounds_check))
17171
Index: libgfortran/generated/minloc1_4_i8.c
17172
===================================================================
17173
--- a/src/libgfortran/generated/minloc1_4_i8.c (.../tags/gcc_4_8_3_release)
17174
+++ b/src/libgfortran/generated/minloc1_4_i8.c (.../branches/gcc-4_8-branch)
17176
retarray->offset = 0;
17177
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17179
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17180
- * extent[rank-1];
17181
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17183
- retarray->base_addr = xmalloc (alloc_size);
17184
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17185
if (alloc_size == 0)
17187
/* Make sure we have a zero-sized array. */
17188
@@ -294,8 +293,7 @@
17192
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17193
- * extent[rank-1];
17194
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17196
retarray->offset = 0;
17197
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17198
@@ -307,7 +305,7 @@
17202
- retarray->base_addr = xmalloc (alloc_size);
17203
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17207
@@ -485,8 +483,7 @@
17208
retarray->offset = 0;
17209
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17211
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17212
- * extent[rank-1];
17213
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17215
if (alloc_size == 0)
17217
@@ -495,7 +492,7 @@
17221
- retarray->base_addr = xmalloc (alloc_size);
17222
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17226
Index: libgfortran/generated/minloc0_8_r4.c
17227
===================================================================
17228
--- a/src/libgfortran/generated/minloc0_8_r4.c (.../tags/gcc_4_8_3_release)
17229
+++ b/src/libgfortran/generated/minloc0_8_r4.c (.../branches/gcc-4_8-branch)
17231
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17232
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17233
retarray->offset = 0;
17234
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17235
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17239
@@ -199,7 +199,7 @@
17240
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17241
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17242
retarray->offset = 0;
17243
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17244
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17248
@@ -367,7 +367,7 @@
17249
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17250
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17251
retarray->offset = 0;
17252
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17253
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17255
else if (unlikely (compile_options.bounds_check))
17257
Index: libgfortran/generated/matmul_l4.c
17258
===================================================================
17259
--- a/src/libgfortran/generated/matmul_l4.c (.../tags/gcc_4_8_3_release)
17260
+++ b/src/libgfortran/generated/matmul_l4.c (.../branches/gcc-4_8-branch)
17264
retarray->base_addr
17265
- = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
17266
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
17267
retarray->offset = 0;
17269
else if (unlikely (compile_options.bounds_check))
17270
Index: libgfortran/generated/reshape_r8.c
17271
===================================================================
17272
--- a/src/libgfortran/generated/reshape_r8.c (.../tags/gcc_4_8_3_release)
17273
+++ b/src/libgfortran/generated/reshape_r8.c (.../branches/gcc-4_8-branch)
17274
@@ -111,11 +111,11 @@
17277
if (unlikely (rs < 1))
17281
- alloc_size = rs * sizeof (GFC_REAL_8);
17284
- ret->base_addr = xmalloc (alloc_size);
17285
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17286
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
17289
Index: libgfortran/generated/in_pack_c10.c
17290
===================================================================
17291
--- a/src/libgfortran/generated/in_pack_c10.c (.../tags/gcc_4_8_3_release)
17292
+++ b/src/libgfortran/generated/in_pack_c10.c (.../branches/gcc-4_8-branch)
17294
return source->base_addr;
17296
/* Allocate storage for the destination. */
17297
- destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
17298
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
17300
src = source->base_addr;
17301
stride0 = stride[0];
17302
Index: libgfortran/generated/all_l4.c
17303
===================================================================
17304
--- a/src/libgfortran/generated/all_l4.c (.../tags/gcc_4_8_3_release)
17305
+++ b/src/libgfortran/generated/all_l4.c (.../branches/gcc-4_8-branch)
17306
@@ -101,8 +101,7 @@
17307
retarray->offset = 0;
17308
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17310
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17311
- * extent[rank-1];
17312
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17314
if (alloc_size == 0)
17316
@@ -111,7 +110,7 @@
17320
- retarray->base_addr = xmalloc (alloc_size);
17321
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
17325
Index: libgfortran/generated/minloc0_8_i2.c
17326
===================================================================
17327
--- a/src/libgfortran/generated/minloc0_8_i2.c (.../tags/gcc_4_8_3_release)
17328
+++ b/src/libgfortran/generated/minloc0_8_i2.c (.../branches/gcc-4_8-branch)
17330
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17331
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17332
retarray->offset = 0;
17333
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17334
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17338
@@ -199,7 +199,7 @@
17339
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17340
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17341
retarray->offset = 0;
17342
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17343
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17347
@@ -367,7 +367,7 @@
17348
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17349
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17350
retarray->offset = 0;
17351
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17352
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17354
else if (unlikely (compile_options.bounds_check))
17356
Index: libgfortran/generated/norm2_r16.c
17357
===================================================================
17358
--- a/src/libgfortran/generated/norm2_r16.c (.../tags/gcc_4_8_3_release)
17359
+++ b/src/libgfortran/generated/norm2_r16.c (.../branches/gcc-4_8-branch)
17360
@@ -105,10 +105,9 @@
17361
retarray->offset = 0;
17362
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17364
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17365
- * extent[rank-1];
17366
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17368
- retarray->base_addr = xmalloc (alloc_size);
17369
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17370
if (alloc_size == 0)
17372
/* Make sure we have a zero-sized array. */
17373
Index: libgfortran/generated/reshape_c10.c
17374
===================================================================
17375
--- a/src/libgfortran/generated/reshape_c10.c (.../tags/gcc_4_8_3_release)
17376
+++ b/src/libgfortran/generated/reshape_c10.c (.../branches/gcc-4_8-branch)
17377
@@ -111,11 +111,11 @@
17380
if (unlikely (rs < 1))
17384
- alloc_size = rs * sizeof (GFC_COMPLEX_10);
17387
- ret->base_addr = xmalloc (alloc_size);
17388
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
17389
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
17392
Index: libgfortran/generated/unpack_c16.c
17393
===================================================================
17394
--- a/src/libgfortran/generated/unpack_c16.c (.../tags/gcc_4_8_3_release)
17395
+++ b/src/libgfortran/generated/unpack_c16.c (.../branches/gcc-4_8-branch)
17400
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
17401
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
17405
@@ -244,7 +244,7 @@
17409
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
17410
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
17414
Index: libgfortran/generated/maxloc1_4_r4.c
17415
===================================================================
17416
--- a/src/libgfortran/generated/maxloc1_4_r4.c (.../tags/gcc_4_8_3_release)
17417
+++ b/src/libgfortran/generated/maxloc1_4_r4.c (.../branches/gcc-4_8-branch)
17419
retarray->offset = 0;
17420
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17422
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17423
- * extent[rank-1];
17424
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17426
- retarray->base_addr = xmalloc (alloc_size);
17427
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17428
if (alloc_size == 0)
17430
/* Make sure we have a zero-sized array. */
17431
@@ -294,8 +293,7 @@
17435
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17436
- * extent[rank-1];
17437
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17439
retarray->offset = 0;
17440
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17441
@@ -307,7 +305,7 @@
17445
- retarray->base_addr = xmalloc (alloc_size);
17446
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17450
@@ -485,8 +483,7 @@
17451
retarray->offset = 0;
17452
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17454
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17455
- * extent[rank-1];
17456
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17458
if (alloc_size == 0)
17460
@@ -495,7 +492,7 @@
17464
- retarray->base_addr = xmalloc (alloc_size);
17465
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17469
Index: libgfortran/generated/maxval_r8.c
17470
===================================================================
17471
--- a/src/libgfortran/generated/maxval_r8.c (.../tags/gcc_4_8_3_release)
17472
+++ b/src/libgfortran/generated/maxval_r8.c (.../branches/gcc-4_8-branch)
17474
retarray->offset = 0;
17475
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17477
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17478
- * extent[rank-1];
17479
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17481
- retarray->base_addr = xmalloc (alloc_size);
17482
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17483
if (alloc_size == 0)
17485
/* Make sure we have a zero-sized array. */
17486
@@ -286,8 +285,7 @@
17490
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17491
- * extent[rank-1];
17492
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17494
retarray->offset = 0;
17495
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17496
@@ -299,7 +297,7 @@
17500
- retarray->base_addr = xmalloc (alloc_size);
17501
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17505
@@ -472,8 +470,7 @@
17506
retarray->offset = 0;
17507
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17509
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17510
- * extent[rank-1];
17511
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17513
if (alloc_size == 0)
17515
@@ -482,7 +479,7 @@
17519
- retarray->base_addr = xmalloc (alloc_size);
17520
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
17524
Index: libgfortran/generated/transpose_c4.c
17525
===================================================================
17526
--- a/src/libgfortran/generated/transpose_c4.c (.../tags/gcc_4_8_3_release)
17527
+++ b/src/libgfortran/generated/transpose_c4.c (.../branches/gcc-4_8-branch)
17529
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
17530
GFC_DESCRIPTOR_EXTENT(source, 1));
17532
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
17533
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
17534
+ sizeof (GFC_COMPLEX_4));
17536
} else if (unlikely (compile_options.bounds_check))
17538
Index: libgfortran/generated/eoshift1_4.c
17539
===================================================================
17540
--- a/src/libgfortran/generated/eoshift1_4.c (.../tags/gcc_4_8_3_release)
17541
+++ b/src/libgfortran/generated/eoshift1_4.c (.../branches/gcc-4_8-branch)
17542
@@ -105,8 +105,8 @@
17543
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
17546
- /* xmalloc allocates a single byte for zero size. */
17547
- ret->base_addr = xmalloc (size * arraysize);
17548
+ /* xmallocarray allocates a single byte for zero size. */
17549
+ ret->base_addr = xmallocarray (arraysize, size);
17552
else if (unlikely (compile_options.bounds_check))
17553
Index: libgfortran/generated/minval_r16.c
17554
===================================================================
17555
--- a/src/libgfortran/generated/minval_r16.c (.../tags/gcc_4_8_3_release)
17556
+++ b/src/libgfortran/generated/minval_r16.c (.../branches/gcc-4_8-branch)
17558
retarray->offset = 0;
17559
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17561
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17562
- * extent[rank-1];
17563
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17565
- retarray->base_addr = xmalloc (alloc_size);
17566
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17567
if (alloc_size == 0)
17569
/* Make sure we have a zero-sized array. */
17570
@@ -286,8 +285,7 @@
17574
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17575
- * extent[rank-1];
17576
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17578
retarray->offset = 0;
17579
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17580
@@ -299,7 +297,7 @@
17584
- retarray->base_addr = xmalloc (alloc_size);
17585
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17589
@@ -472,8 +470,7 @@
17590
retarray->offset = 0;
17591
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17593
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17594
- * extent[rank-1];
17595
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17597
if (alloc_size == 0)
17599
@@ -482,7 +479,7 @@
17603
- retarray->base_addr = xmalloc (alloc_size);
17604
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
17608
Index: libgfortran/generated/iany_i16.c
17609
===================================================================
17610
--- a/src/libgfortran/generated/iany_i16.c (.../tags/gcc_4_8_3_release)
17611
+++ b/src/libgfortran/generated/iany_i16.c (.../branches/gcc-4_8-branch)
17613
retarray->offset = 0;
17614
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17616
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17617
- * extent[rank-1];
17618
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17620
- retarray->base_addr = xmalloc (alloc_size);
17621
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17622
if (alloc_size == 0)
17624
/* Make sure we have a zero-sized array. */
17625
@@ -272,8 +271,7 @@
17629
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17630
- * extent[rank-1];
17631
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17633
retarray->offset = 0;
17634
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17635
@@ -285,7 +283,7 @@
17639
- retarray->base_addr = xmalloc (alloc_size);
17640
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17644
@@ -430,8 +428,7 @@
17645
retarray->offset = 0;
17646
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17648
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17649
- * extent[rank-1];
17650
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17652
if (alloc_size == 0)
17654
@@ -440,7 +437,7 @@
17658
- retarray->base_addr = xmalloc (alloc_size);
17659
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17663
Index: libgfortran/generated/maxloc1_4_i2.c
17664
===================================================================
17665
--- a/src/libgfortran/generated/maxloc1_4_i2.c (.../tags/gcc_4_8_3_release)
17666
+++ b/src/libgfortran/generated/maxloc1_4_i2.c (.../branches/gcc-4_8-branch)
17668
retarray->offset = 0;
17669
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17671
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17672
- * extent[rank-1];
17673
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17675
- retarray->base_addr = xmalloc (alloc_size);
17676
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17677
if (alloc_size == 0)
17679
/* Make sure we have a zero-sized array. */
17680
@@ -294,8 +293,7 @@
17684
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17685
- * extent[rank-1];
17686
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17688
retarray->offset = 0;
17689
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17690
@@ -307,7 +305,7 @@
17694
- retarray->base_addr = xmalloc (alloc_size);
17695
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17699
@@ -485,8 +483,7 @@
17700
retarray->offset = 0;
17701
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17703
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17704
- * extent[rank-1];
17705
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17707
if (alloc_size == 0)
17709
@@ -495,7 +492,7 @@
17713
- retarray->base_addr = xmalloc (alloc_size);
17714
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17718
Index: libgfortran/generated/maxloc1_8_i8.c
17719
===================================================================
17720
--- a/src/libgfortran/generated/maxloc1_8_i8.c (.../tags/gcc_4_8_3_release)
17721
+++ b/src/libgfortran/generated/maxloc1_8_i8.c (.../branches/gcc-4_8-branch)
17723
retarray->offset = 0;
17724
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17726
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17727
- * extent[rank-1];
17728
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17730
- retarray->base_addr = xmalloc (alloc_size);
17731
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17732
if (alloc_size == 0)
17734
/* Make sure we have a zero-sized array. */
17735
@@ -294,8 +293,7 @@
17739
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17740
- * extent[rank-1];
17741
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17743
retarray->offset = 0;
17744
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17745
@@ -307,7 +305,7 @@
17749
- retarray->base_addr = xmalloc (alloc_size);
17750
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17754
@@ -485,8 +483,7 @@
17755
retarray->offset = 0;
17756
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17758
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17759
- * extent[rank-1];
17760
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17762
if (alloc_size == 0)
17764
@@ -495,7 +492,7 @@
17768
- retarray->base_addr = xmalloc (alloc_size);
17769
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17773
Index: libgfortran/generated/maxloc0_4_r8.c
17774
===================================================================
17775
--- a/src/libgfortran/generated/maxloc0_4_r8.c (.../tags/gcc_4_8_3_release)
17776
+++ b/src/libgfortran/generated/maxloc0_4_r8.c (.../branches/gcc-4_8-branch)
17778
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17779
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17780
retarray->offset = 0;
17781
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17782
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17786
@@ -199,7 +199,7 @@
17787
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17788
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17789
retarray->offset = 0;
17790
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17791
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17795
@@ -367,7 +367,7 @@
17796
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17797
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17798
retarray->offset = 0;
17799
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17800
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17802
else if (unlikely (compile_options.bounds_check))
17804
Index: libgfortran/generated/maxloc0_16_r16.c
17805
===================================================================
17806
--- a/src/libgfortran/generated/maxloc0_16_r16.c (.../tags/gcc_4_8_3_release)
17807
+++ b/src/libgfortran/generated/maxloc0_16_r16.c (.../branches/gcc-4_8-branch)
17809
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17810
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17811
retarray->offset = 0;
17812
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17813
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17817
@@ -199,7 +199,7 @@
17818
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17819
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17820
retarray->offset = 0;
17821
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17822
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17826
@@ -367,7 +367,7 @@
17827
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17828
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17829
retarray->offset = 0;
17830
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17831
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17833
else if (unlikely (compile_options.bounds_check))
17835
Index: libgfortran/generated/sum_c10.c
17836
===================================================================
17837
--- a/src/libgfortran/generated/sum_c10.c (.../tags/gcc_4_8_3_release)
17838
+++ b/src/libgfortran/generated/sum_c10.c (.../branches/gcc-4_8-branch)
17840
retarray->offset = 0;
17841
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17843
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17844
- * extent[rank-1];
17845
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17847
- retarray->base_addr = xmalloc (alloc_size);
17848
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
17849
if (alloc_size == 0)
17851
/* Make sure we have a zero-sized array. */
17852
@@ -272,8 +271,7 @@
17856
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17857
- * extent[rank-1];
17858
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17860
retarray->offset = 0;
17861
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17862
@@ -285,7 +283,7 @@
17866
- retarray->base_addr = xmalloc (alloc_size);
17867
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
17871
@@ -430,8 +428,7 @@
17872
retarray->offset = 0;
17873
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17875
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17876
- * extent[rank-1];
17877
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17879
if (alloc_size == 0)
17881
@@ -440,7 +437,7 @@
17885
- retarray->base_addr = xmalloc (alloc_size);
17886
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
17890
Index: libgfortran/generated/iall_i4.c
17891
===================================================================
17892
--- a/src/libgfortran/generated/iall_i4.c (.../tags/gcc_4_8_3_release)
17893
+++ b/src/libgfortran/generated/iall_i4.c (.../branches/gcc-4_8-branch)
17895
retarray->offset = 0;
17896
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17898
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17899
- * extent[rank-1];
17900
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17902
- retarray->base_addr = xmalloc (alloc_size);
17903
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17904
if (alloc_size == 0)
17906
/* Make sure we have a zero-sized array. */
17907
@@ -272,8 +271,7 @@
17911
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17912
- * extent[rank-1];
17913
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17915
retarray->offset = 0;
17916
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17917
@@ -285,7 +283,7 @@
17921
- retarray->base_addr = xmalloc (alloc_size);
17922
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17926
@@ -430,8 +428,7 @@
17927
retarray->offset = 0;
17928
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17930
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17931
- * extent[rank-1];
17932
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17934
if (alloc_size == 0)
17936
@@ -440,7 +437,7 @@
17940
- retarray->base_addr = xmalloc (alloc_size);
17941
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17945
Index: libgfortran/generated/minloc1_4_r16.c
17946
===================================================================
17947
--- a/src/libgfortran/generated/minloc1_4_r16.c (.../tags/gcc_4_8_3_release)
17948
+++ b/src/libgfortran/generated/minloc1_4_r16.c (.../branches/gcc-4_8-branch)
17950
retarray->offset = 0;
17951
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17953
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17954
- * extent[rank-1];
17955
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17957
- retarray->base_addr = xmalloc (alloc_size);
17958
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17959
if (alloc_size == 0)
17961
/* Make sure we have a zero-sized array. */
17962
@@ -294,8 +293,7 @@
17966
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17967
- * extent[rank-1];
17968
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17970
retarray->offset = 0;
17971
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17972
@@ -307,7 +305,7 @@
17976
- retarray->base_addr = xmalloc (alloc_size);
17977
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17981
@@ -485,8 +483,7 @@
17982
retarray->offset = 0;
17983
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17985
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17986
- * extent[rank-1];
17987
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17989
if (alloc_size == 0)
17991
@@ -495,7 +492,7 @@
17995
- retarray->base_addr = xmalloc (alloc_size);
17996
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18000
Index: libgfortran/generated/maxloc0_8_r16.c
18001
===================================================================
18002
--- a/src/libgfortran/generated/maxloc0_8_r16.c (.../tags/gcc_4_8_3_release)
18003
+++ b/src/libgfortran/generated/maxloc0_8_r16.c (.../branches/gcc-4_8-branch)
18005
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18006
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18007
retarray->offset = 0;
18008
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18009
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18013
@@ -199,7 +199,7 @@
18014
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18015
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18016
retarray->offset = 0;
18017
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18018
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18022
@@ -367,7 +367,7 @@
18023
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18024
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18025
retarray->offset = 0;
18026
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18027
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18029
else if (unlikely (compile_options.bounds_check))
18031
Index: libgfortran/generated/pack_r8.c
18032
===================================================================
18033
--- a/src/libgfortran/generated/pack_r8.c (.../tags/gcc_4_8_3_release)
18034
+++ b/src/libgfortran/generated/pack_r8.c (.../branches/gcc-4_8-branch)
18035
@@ -167,8 +167,8 @@
18039
- /* xmalloc allocates a single byte for zero size. */
18040
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
18041
+ /* xmallocarray allocates a single byte for zero size. */
18042
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
18046
Index: libgfortran/generated/matmul_c10.c
18047
===================================================================
18048
--- a/src/libgfortran/generated/matmul_c10.c (.../tags/gcc_4_8_3_release)
18049
+++ b/src/libgfortran/generated/matmul_c10.c (.../branches/gcc-4_8-branch)
18050
@@ -124,7 +124,7 @@
18053
retarray->base_addr
18054
- = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
18055
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
18056
retarray->offset = 0;
18058
else if (unlikely (compile_options.bounds_check))
18059
Index: libgfortran/generated/maxloc0_16_i4.c
18060
===================================================================
18061
--- a/src/libgfortran/generated/maxloc0_16_i4.c (.../tags/gcc_4_8_3_release)
18062
+++ b/src/libgfortran/generated/maxloc0_16_i4.c (.../branches/gcc-4_8-branch)
18064
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18065
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18066
retarray->offset = 0;
18067
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18068
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18072
@@ -199,7 +199,7 @@
18073
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18074
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18075
retarray->offset = 0;
18076
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18077
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18081
@@ -367,7 +367,7 @@
18082
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18083
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18084
retarray->offset = 0;
18085
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18086
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18088
else if (unlikely (compile_options.bounds_check))
18090
Index: libgfortran/generated/pack_r16.c
18091
===================================================================
18092
--- a/src/libgfortran/generated/pack_r16.c (.../tags/gcc_4_8_3_release)
18093
+++ b/src/libgfortran/generated/pack_r16.c (.../branches/gcc-4_8-branch)
18094
@@ -167,8 +167,8 @@
18098
- /* xmalloc allocates a single byte for zero size. */
18099
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
18100
+ /* xmallocarray allocates a single byte for zero size. */
18101
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
18105
Index: libgfortran/generated/minloc1_16_i8.c
18106
===================================================================
18107
--- a/src/libgfortran/generated/minloc1_16_i8.c (.../tags/gcc_4_8_3_release)
18108
+++ b/src/libgfortran/generated/minloc1_16_i8.c (.../branches/gcc-4_8-branch)
18110
retarray->offset = 0;
18111
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18113
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18114
- * extent[rank-1];
18115
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18117
- retarray->base_addr = xmalloc (alloc_size);
18118
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18119
if (alloc_size == 0)
18121
/* Make sure we have a zero-sized array. */
18122
@@ -294,8 +293,7 @@
18126
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18127
- * extent[rank-1];
18128
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18130
retarray->offset = 0;
18131
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18132
@@ -307,7 +305,7 @@
18136
- retarray->base_addr = xmalloc (alloc_size);
18137
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18141
@@ -485,8 +483,7 @@
18142
retarray->offset = 0;
18143
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18145
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18146
- * extent[rank-1];
18147
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18149
if (alloc_size == 0)
18151
@@ -495,7 +492,7 @@
18155
- retarray->base_addr = xmalloc (alloc_size);
18156
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18160
Index: libgfortran/generated/minloc0_16_r10.c
18161
===================================================================
18162
--- a/src/libgfortran/generated/minloc0_16_r10.c (.../tags/gcc_4_8_3_release)
18163
+++ b/src/libgfortran/generated/minloc0_16_r10.c (.../branches/gcc-4_8-branch)
18165
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18166
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18167
retarray->offset = 0;
18168
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18169
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18173
@@ -199,7 +199,7 @@
18174
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18175
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18176
retarray->offset = 0;
18177
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18178
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18182
@@ -367,7 +367,7 @@
18183
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18184
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18185
retarray->offset = 0;
18186
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18187
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18189
else if (unlikely (compile_options.bounds_check))
18191
Index: libgfortran/generated/unpack_c4.c
18192
===================================================================
18193
--- a/src/libgfortran/generated/unpack_c4.c (.../tags/gcc_4_8_3_release)
18194
+++ b/src/libgfortran/generated/unpack_c4.c (.../branches/gcc-4_8-branch)
18199
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
18200
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
18204
@@ -244,7 +244,7 @@
18208
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
18209
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
18213
Index: libgfortran/generated/iparity_i1.c
18214
===================================================================
18215
--- a/src/libgfortran/generated/iparity_i1.c (.../tags/gcc_4_8_3_release)
18216
+++ b/src/libgfortran/generated/iparity_i1.c (.../branches/gcc-4_8-branch)
18218
retarray->offset = 0;
18219
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18221
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18222
- * extent[rank-1];
18223
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18225
- retarray->base_addr = xmalloc (alloc_size);
18226
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18227
if (alloc_size == 0)
18229
/* Make sure we have a zero-sized array. */
18230
@@ -272,8 +271,7 @@
18234
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18235
- * extent[rank-1];
18236
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18238
retarray->offset = 0;
18239
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18240
@@ -285,7 +283,7 @@
18244
- retarray->base_addr = xmalloc (alloc_size);
18245
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18249
@@ -430,8 +428,7 @@
18250
retarray->offset = 0;
18251
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18253
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18254
- * extent[rank-1];
18255
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18257
if (alloc_size == 0)
18259
@@ -440,7 +437,7 @@
18263
- retarray->base_addr = xmalloc (alloc_size);
18264
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
18268
Index: libgfortran/generated/product_c8.c
18269
===================================================================
18270
--- a/src/libgfortran/generated/product_c8.c (.../tags/gcc_4_8_3_release)
18271
+++ b/src/libgfortran/generated/product_c8.c (.../branches/gcc-4_8-branch)
18273
retarray->offset = 0;
18274
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18276
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18277
- * extent[rank-1];
18278
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18280
- retarray->base_addr = xmalloc (alloc_size);
18281
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
18282
if (alloc_size == 0)
18284
/* Make sure we have a zero-sized array. */
18285
@@ -272,8 +271,7 @@
18289
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18290
- * extent[rank-1];
18291
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18293
retarray->offset = 0;
18294
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18295
@@ -285,7 +283,7 @@
18299
- retarray->base_addr = xmalloc (alloc_size);
18300
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
18304
@@ -430,8 +428,7 @@
18305
retarray->offset = 0;
18306
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18308
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18309
- * extent[rank-1];
18310
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18312
if (alloc_size == 0)
18314
@@ -440,7 +437,7 @@
18318
- retarray->base_addr = xmalloc (alloc_size);
18319
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
18323
Index: libgfortran/generated/in_pack_i16.c
18324
===================================================================
18325
--- a/src/libgfortran/generated/in_pack_i16.c (.../tags/gcc_4_8_3_release)
18326
+++ b/src/libgfortran/generated/in_pack_i16.c (.../branches/gcc-4_8-branch)
18328
return source->base_addr;
18330
/* Allocate storage for the destination. */
18331
- destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
18332
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
18334
src = source->base_addr;
18335
stride0 = stride[0];
18336
Index: libgfortran/generated/minloc0_8_i4.c
18337
===================================================================
18338
--- a/src/libgfortran/generated/minloc0_8_i4.c (.../tags/gcc_4_8_3_release)
18339
+++ b/src/libgfortran/generated/minloc0_8_i4.c (.../branches/gcc-4_8-branch)
18341
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18342
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18343
retarray->offset = 0;
18344
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18345
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18349
@@ -199,7 +199,7 @@
18350
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18351
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18352
retarray->offset = 0;
18353
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18354
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18358
@@ -367,7 +367,7 @@
18359
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18360
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18361
retarray->offset = 0;
18362
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18363
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18365
else if (unlikely (compile_options.bounds_check))
18367
Index: libgfortran/generated/matmul_c4.c
18368
===================================================================
18369
--- a/src/libgfortran/generated/matmul_c4.c (.../tags/gcc_4_8_3_release)
18370
+++ b/src/libgfortran/generated/matmul_c4.c (.../branches/gcc-4_8-branch)
18371
@@ -124,7 +124,7 @@
18374
retarray->base_addr
18375
- = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
18376
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
18377
retarray->offset = 0;
18379
else if (unlikely (compile_options.bounds_check))
18380
Index: libgfortran/generated/reshape_i8.c
18381
===================================================================
18382
--- a/src/libgfortran/generated/reshape_i8.c (.../tags/gcc_4_8_3_release)
18383
+++ b/src/libgfortran/generated/reshape_i8.c (.../branches/gcc-4_8-branch)
18384
@@ -111,11 +111,11 @@
18387
if (unlikely (rs < 1))
18391
- alloc_size = rs * sizeof (GFC_INTEGER_8);
18394
- ret->base_addr = xmalloc (alloc_size);
18395
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18396
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
18399
Index: libgfortran/generated/in_pack_c8.c
18400
===================================================================
18401
--- a/src/libgfortran/generated/in_pack_c8.c (.../tags/gcc_4_8_3_release)
18402
+++ b/src/libgfortran/generated/in_pack_c8.c (.../branches/gcc-4_8-branch)
18404
return source->base_addr;
18406
/* Allocate storage for the destination. */
18407
- destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
18408
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
18410
src = source->base_addr;
18411
stride0 = stride[0];
18412
Index: libgfortran/generated/bessel_r10.c
18413
===================================================================
18414
--- a/src/libgfortran/generated/bessel_r10.c (.../tags/gcc_4_8_3_release)
18415
+++ b/src/libgfortran/generated/bessel_r10.c (.../branches/gcc-4_8-branch)
18418
size_t size = n2 < n1 ? 0 : n2-n1+1;
18419
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
18420
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
18421
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
18425
@@ -122,7 +122,7 @@
18427
size_t size = n2 < n1 ? 0 : n2-n1+1;
18428
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
18429
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
18430
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
18434
@@ -162,7 +162,7 @@
18436
x2rev = GFC_REAL_10_LITERAL(2.)/x;
18438
- for (i = 2; i <= n1+n2; i++)
18439
+ for (i = 2; i <= n2 - n1; i++)
18441
#if defined(GFC_REAL_10_INFINITY)
18442
if (unlikely (last2 == -GFC_REAL_10_INFINITY))
18443
Index: libgfortran/generated/iall_i16.c
18444
===================================================================
18445
--- a/src/libgfortran/generated/iall_i16.c (.../tags/gcc_4_8_3_release)
18446
+++ b/src/libgfortran/generated/iall_i16.c (.../branches/gcc-4_8-branch)
18448
retarray->offset = 0;
18449
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18451
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18452
- * extent[rank-1];
18453
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18455
- retarray->base_addr = xmalloc (alloc_size);
18456
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18457
if (alloc_size == 0)
18459
/* Make sure we have a zero-sized array. */
18460
@@ -272,8 +271,7 @@
18464
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18465
- * extent[rank-1];
18466
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18468
retarray->offset = 0;
18469
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18470
@@ -285,7 +283,7 @@
18474
- retarray->base_addr = xmalloc (alloc_size);
18475
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18479
@@ -430,8 +428,7 @@
18480
retarray->offset = 0;
18481
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18483
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18484
- * extent[rank-1];
18485
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18487
if (alloc_size == 0)
18489
@@ -440,7 +437,7 @@
18493
- retarray->base_addr = xmalloc (alloc_size);
18494
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18498
Index: libgfortran/generated/maxloc1_16_i1.c
18499
===================================================================
18500
--- a/src/libgfortran/generated/maxloc1_16_i1.c (.../tags/gcc_4_8_3_release)
18501
+++ b/src/libgfortran/generated/maxloc1_16_i1.c (.../branches/gcc-4_8-branch)
18503
retarray->offset = 0;
18504
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18506
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18507
- * extent[rank-1];
18508
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18510
- retarray->base_addr = xmalloc (alloc_size);
18511
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18512
if (alloc_size == 0)
18514
/* Make sure we have a zero-sized array. */
18515
@@ -294,8 +293,7 @@
18519
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18520
- * extent[rank-1];
18521
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18523
retarray->offset = 0;
18524
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18525
@@ -307,7 +305,7 @@
18529
- retarray->base_addr = xmalloc (alloc_size);
18530
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18534
@@ -485,8 +483,7 @@
18535
retarray->offset = 0;
18536
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18538
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18539
- * extent[rank-1];
18540
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18542
if (alloc_size == 0)
18544
@@ -495,7 +492,7 @@
18548
- retarray->base_addr = xmalloc (alloc_size);
18549
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18553
Index: libgfortran/generated/reshape_i16.c
18554
===================================================================
18555
--- a/src/libgfortran/generated/reshape_i16.c (.../tags/gcc_4_8_3_release)
18556
+++ b/src/libgfortran/generated/reshape_i16.c (.../branches/gcc-4_8-branch)
18557
@@ -111,11 +111,11 @@
18560
if (unlikely (rs < 1))
18564
- alloc_size = rs * sizeof (GFC_INTEGER_16);
18567
- ret->base_addr = xmalloc (alloc_size);
18568
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18569
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
18572
Index: libgfortran/generated/count_16_l.c
18573
===================================================================
18574
--- a/src/libgfortran/generated/count_16_l.c (.../tags/gcc_4_8_3_release)
18575
+++ b/src/libgfortran/generated/count_16_l.c (.../branches/gcc-4_8-branch)
18576
@@ -101,8 +101,7 @@
18577
retarray->offset = 0;
18578
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18580
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18581
- * extent[rank-1];
18582
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18584
if (alloc_size == 0)
18586
@@ -111,7 +110,7 @@
18590
- retarray->base_addr = xmalloc (alloc_size);
18591
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18595
Index: libgfortran/generated/minloc1_8_i1.c
18596
===================================================================
18597
--- a/src/libgfortran/generated/minloc1_8_i1.c (.../tags/gcc_4_8_3_release)
18598
+++ b/src/libgfortran/generated/minloc1_8_i1.c (.../branches/gcc-4_8-branch)
18600
retarray->offset = 0;
18601
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18603
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18604
- * extent[rank-1];
18605
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18607
- retarray->base_addr = xmalloc (alloc_size);
18608
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18609
if (alloc_size == 0)
18611
/* Make sure we have a zero-sized array. */
18612
@@ -294,8 +293,7 @@
18616
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18617
- * extent[rank-1];
18618
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18620
retarray->offset = 0;
18621
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18622
@@ -307,7 +305,7 @@
18626
- retarray->base_addr = xmalloc (alloc_size);
18627
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18631
@@ -485,8 +483,7 @@
18632
retarray->offset = 0;
18633
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18635
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18636
- * extent[rank-1];
18637
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18639
if (alloc_size == 0)
18641
@@ -495,7 +492,7 @@
18645
- retarray->base_addr = xmalloc (alloc_size);
18646
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18650
Index: libgfortran/generated/maxloc1_4_i4.c
18651
===================================================================
18652
--- a/src/libgfortran/generated/maxloc1_4_i4.c (.../tags/gcc_4_8_3_release)
18653
+++ b/src/libgfortran/generated/maxloc1_4_i4.c (.../branches/gcc-4_8-branch)
18655
retarray->offset = 0;
18656
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18658
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18659
- * extent[rank-1];
18660
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18662
- retarray->base_addr = xmalloc (alloc_size);
18663
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18664
if (alloc_size == 0)
18666
/* Make sure we have a zero-sized array. */
18667
@@ -294,8 +293,7 @@
18671
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18672
- * extent[rank-1];
18673
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18675
retarray->offset = 0;
18676
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18677
@@ -307,7 +305,7 @@
18681
- retarray->base_addr = xmalloc (alloc_size);
18682
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18686
@@ -485,8 +483,7 @@
18687
retarray->offset = 0;
18688
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18690
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18691
- * extent[rank-1];
18692
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18694
if (alloc_size == 0)
18696
@@ -495,7 +492,7 @@
18700
- retarray->base_addr = xmalloc (alloc_size);
18701
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18705
Index: libgfortran/generated/maxval_i8.c
18706
===================================================================
18707
--- a/src/libgfortran/generated/maxval_i8.c (.../tags/gcc_4_8_3_release)
18708
+++ b/src/libgfortran/generated/maxval_i8.c (.../branches/gcc-4_8-branch)
18710
retarray->offset = 0;
18711
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18713
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18714
- * extent[rank-1];
18715
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18717
- retarray->base_addr = xmalloc (alloc_size);
18718
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18719
if (alloc_size == 0)
18721
/* Make sure we have a zero-sized array. */
18722
@@ -286,8 +285,7 @@
18726
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18727
- * extent[rank-1];
18728
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18730
retarray->offset = 0;
18731
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18732
@@ -299,7 +297,7 @@
18736
- retarray->base_addr = xmalloc (alloc_size);
18737
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18741
@@ -472,8 +470,7 @@
18742
retarray->offset = 0;
18743
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18745
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18746
- * extent[rank-1];
18747
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18749
if (alloc_size == 0)
18751
@@ -482,7 +479,7 @@
18755
- retarray->base_addr = xmalloc (alloc_size);
18756
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18760
Index: libgfortran/generated/eoshift3_16.c
18761
===================================================================
18762
--- a/src/libgfortran/generated/eoshift3_16.c (.../tags/gcc_4_8_3_release)
18763
+++ b/src/libgfortran/generated/eoshift3_16.c (.../branches/gcc-4_8-branch)
18768
- ret->base_addr = xmalloc (size * arraysize);
18769
+ ret->base_addr = xmallocarray (arraysize, size);
18771
ret->dtype = array->dtype;
18772
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
18773
@@ -107,8 +107,8 @@
18774
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
18777
- /* xmalloc allocates a single byte for zero size. */
18778
- ret->base_addr = xmalloc (size * arraysize);
18779
+ /* xmallocarray allocates a single byte for zero size. */
18780
+ ret->base_addr = xmallocarray (arraysize, size);
18783
else if (unlikely (compile_options.bounds_check))
18784
Index: libgfortran/generated/shape_i8.c
18785
===================================================================
18786
--- a/src/libgfortran/generated/shape_i8.c (.../tags/gcc_4_8_3_release)
18787
+++ b/src/libgfortran/generated/shape_i8.c (.../branches/gcc-4_8-branch)
18790
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
18792
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18793
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18796
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
18797
Index: libgfortran/generated/maxloc0_4_i16.c
18798
===================================================================
18799
--- a/src/libgfortran/generated/maxloc0_4_i16.c (.../tags/gcc_4_8_3_release)
18800
+++ b/src/libgfortran/generated/maxloc0_4_i16.c (.../branches/gcc-4_8-branch)
18802
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18803
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18804
retarray->offset = 0;
18805
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18806
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18810
@@ -199,7 +199,7 @@
18811
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18812
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18813
retarray->offset = 0;
18814
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18815
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18819
@@ -367,7 +367,7 @@
18820
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18821
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18822
retarray->offset = 0;
18823
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18824
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18826
else if (unlikely (compile_options.bounds_check))
18828
Index: libgfortran/generated/maxloc1_4_r10.c
18829
===================================================================
18830
--- a/src/libgfortran/generated/maxloc1_4_r10.c (.../tags/gcc_4_8_3_release)
18831
+++ b/src/libgfortran/generated/maxloc1_4_r10.c (.../branches/gcc-4_8-branch)
18833
retarray->offset = 0;
18834
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18836
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18837
- * extent[rank-1];
18838
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18840
- retarray->base_addr = xmalloc (alloc_size);
18841
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18842
if (alloc_size == 0)
18844
/* Make sure we have a zero-sized array. */
18845
@@ -294,8 +293,7 @@
18849
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18850
- * extent[rank-1];
18851
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18853
retarray->offset = 0;
18854
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18855
@@ -307,7 +305,7 @@
18859
- retarray->base_addr = xmalloc (alloc_size);
18860
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18864
@@ -485,8 +483,7 @@
18865
retarray->offset = 0;
18866
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18868
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18869
- * extent[rank-1];
18870
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18872
if (alloc_size == 0)
18874
@@ -495,7 +492,7 @@
18878
- retarray->base_addr = xmalloc (alloc_size);
18879
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18883
Index: libgfortran/generated/maxloc1_8_i16.c
18884
===================================================================
18885
--- a/src/libgfortran/generated/maxloc1_8_i16.c (.../tags/gcc_4_8_3_release)
18886
+++ b/src/libgfortran/generated/maxloc1_8_i16.c (.../branches/gcc-4_8-branch)
18888
retarray->offset = 0;
18889
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18891
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18892
- * extent[rank-1];
18893
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18895
- retarray->base_addr = xmalloc (alloc_size);
18896
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18897
if (alloc_size == 0)
18899
/* Make sure we have a zero-sized array. */
18900
@@ -294,8 +293,7 @@
18904
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18905
- * extent[rank-1];
18906
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18908
retarray->offset = 0;
18909
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18910
@@ -307,7 +305,7 @@
18914
- retarray->base_addr = xmalloc (alloc_size);
18915
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18919
@@ -485,8 +483,7 @@
18920
retarray->offset = 0;
18921
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18923
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18924
- * extent[rank-1];
18925
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18927
if (alloc_size == 0)
18929
@@ -495,7 +492,7 @@
18933
- retarray->base_addr = xmalloc (alloc_size);
18934
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
18938
Index: libgfortran/generated/minloc0_8_r10.c
18939
===================================================================
18940
--- a/src/libgfortran/generated/minloc0_8_r10.c (.../tags/gcc_4_8_3_release)
18941
+++ b/src/libgfortran/generated/minloc0_8_r10.c (.../branches/gcc-4_8-branch)
18943
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18944
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18945
retarray->offset = 0;
18946
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18947
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18951
@@ -199,7 +199,7 @@
18952
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18953
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18954
retarray->offset = 0;
18955
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18956
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18960
@@ -367,7 +367,7 @@
18961
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18962
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18963
retarray->offset = 0;
18964
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18965
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18967
else if (unlikely (compile_options.bounds_check))
18969
Index: libgfortran/generated/iparity_i2.c
18970
===================================================================
18971
--- a/src/libgfortran/generated/iparity_i2.c (.../tags/gcc_4_8_3_release)
18972
+++ b/src/libgfortran/generated/iparity_i2.c (.../branches/gcc-4_8-branch)
18974
retarray->offset = 0;
18975
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18977
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18978
- * extent[rank-1];
18979
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18981
- retarray->base_addr = xmalloc (alloc_size);
18982
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
18983
if (alloc_size == 0)
18985
/* Make sure we have a zero-sized array. */
18986
@@ -272,8 +271,7 @@
18990
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18991
- * extent[rank-1];
18992
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18994
retarray->offset = 0;
18995
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18996
@@ -285,7 +283,7 @@
19000
- retarray->base_addr = xmalloc (alloc_size);
19001
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
19005
@@ -430,8 +428,7 @@
19006
retarray->offset = 0;
19007
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19009
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19010
- * extent[rank-1];
19011
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19013
if (alloc_size == 0)
19015
@@ -440,7 +437,7 @@
19019
- retarray->base_addr = xmalloc (alloc_size);
19020
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
19024
Index: libgfortran/generated/maxloc1_16_r4.c
19025
===================================================================
19026
--- a/src/libgfortran/generated/maxloc1_16_r4.c (.../tags/gcc_4_8_3_release)
19027
+++ b/src/libgfortran/generated/maxloc1_16_r4.c (.../branches/gcc-4_8-branch)
19029
retarray->offset = 0;
19030
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19032
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19033
- * extent[rank-1];
19034
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19036
- retarray->base_addr = xmalloc (alloc_size);
19037
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19038
if (alloc_size == 0)
19040
/* Make sure we have a zero-sized array. */
19041
@@ -294,8 +293,7 @@
19045
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19046
- * extent[rank-1];
19047
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19049
retarray->offset = 0;
19050
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19051
@@ -307,7 +305,7 @@
19055
- retarray->base_addr = xmalloc (alloc_size);
19056
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19060
@@ -485,8 +483,7 @@
19061
retarray->offset = 0;
19062
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19064
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19065
- * extent[rank-1];
19066
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19068
if (alloc_size == 0)
19070
@@ -495,7 +492,7 @@
19074
- retarray->base_addr = xmalloc (alloc_size);
19075
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19079
Index: libgfortran/generated/maxloc0_16_r8.c
19080
===================================================================
19081
--- a/src/libgfortran/generated/maxloc0_16_r8.c (.../tags/gcc_4_8_3_release)
19082
+++ b/src/libgfortran/generated/maxloc0_16_r8.c (.../branches/gcc-4_8-branch)
19084
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19085
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19086
retarray->offset = 0;
19087
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19088
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19092
@@ -199,7 +199,7 @@
19093
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19094
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19095
retarray->offset = 0;
19096
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19097
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19101
@@ -367,7 +367,7 @@
19102
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19103
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19104
retarray->offset = 0;
19105
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19106
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19108
else if (unlikely (compile_options.bounds_check))
19110
Index: libgfortran/generated/sum_i16.c
19111
===================================================================
19112
--- a/src/libgfortran/generated/sum_i16.c (.../tags/gcc_4_8_3_release)
19113
+++ b/src/libgfortran/generated/sum_i16.c (.../branches/gcc-4_8-branch)
19115
retarray->offset = 0;
19116
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19118
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19119
- * extent[rank-1];
19120
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19122
- retarray->base_addr = xmalloc (alloc_size);
19123
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19124
if (alloc_size == 0)
19126
/* Make sure we have a zero-sized array. */
19127
@@ -272,8 +271,7 @@
19131
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19132
- * extent[rank-1];
19133
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19135
retarray->offset = 0;
19136
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19137
@@ -285,7 +283,7 @@
19141
- retarray->base_addr = xmalloc (alloc_size);
19142
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19146
@@ -430,8 +428,7 @@
19147
retarray->offset = 0;
19148
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19150
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19151
- * extent[rank-1];
19152
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19154
if (alloc_size == 0)
19156
@@ -440,7 +437,7 @@
19160
- retarray->base_addr = xmalloc (alloc_size);
19161
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19165
Index: libgfortran/generated/maxloc0_4_i8.c
19166
===================================================================
19167
--- a/src/libgfortran/generated/maxloc0_4_i8.c (.../tags/gcc_4_8_3_release)
19168
+++ b/src/libgfortran/generated/maxloc0_4_i8.c (.../branches/gcc-4_8-branch)
19170
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19171
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19172
retarray->offset = 0;
19173
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19174
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19178
@@ -199,7 +199,7 @@
19179
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19180
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19181
retarray->offset = 0;
19182
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19183
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19187
@@ -367,7 +367,7 @@
19188
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19189
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19190
retarray->offset = 0;
19191
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19192
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19194
else if (unlikely (compile_options.bounds_check))
19196
Index: libgfortran/generated/pack_c16.c
19197
===================================================================
19198
--- a/src/libgfortran/generated/pack_c16.c (.../tags/gcc_4_8_3_release)
19199
+++ b/src/libgfortran/generated/pack_c16.c (.../branches/gcc-4_8-branch)
19200
@@ -167,8 +167,8 @@
19204
- /* xmalloc allocates a single byte for zero size. */
19205
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
19206
+ /* xmallocarray allocates a single byte for zero size. */
19207
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
19211
Index: libgfortran/generated/maxloc1_16_i16.c
19212
===================================================================
19213
--- a/src/libgfortran/generated/maxloc1_16_i16.c (.../tags/gcc_4_8_3_release)
19214
+++ b/src/libgfortran/generated/maxloc1_16_i16.c (.../branches/gcc-4_8-branch)
19216
retarray->offset = 0;
19217
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19219
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19220
- * extent[rank-1];
19221
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19223
- retarray->base_addr = xmalloc (alloc_size);
19224
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19225
if (alloc_size == 0)
19227
/* Make sure we have a zero-sized array. */
19228
@@ -294,8 +293,7 @@
19232
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19233
- * extent[rank-1];
19234
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19236
retarray->offset = 0;
19237
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19238
@@ -307,7 +305,7 @@
19242
- retarray->base_addr = xmalloc (alloc_size);
19243
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19247
@@ -485,8 +483,7 @@
19248
retarray->offset = 0;
19249
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19251
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19252
- * extent[rank-1];
19253
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19255
if (alloc_size == 0)
19257
@@ -495,7 +492,7 @@
19261
- retarray->base_addr = xmalloc (alloc_size);
19262
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19266
Index: libgfortran/generated/minloc1_8_r4.c
19267
===================================================================
19268
--- a/src/libgfortran/generated/minloc1_8_r4.c (.../tags/gcc_4_8_3_release)
19269
+++ b/src/libgfortran/generated/minloc1_8_r4.c (.../branches/gcc-4_8-branch)
19271
retarray->offset = 0;
19272
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19274
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19275
- * extent[rank-1];
19276
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19278
- retarray->base_addr = xmalloc (alloc_size);
19279
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19280
if (alloc_size == 0)
19282
/* Make sure we have a zero-sized array. */
19283
@@ -294,8 +293,7 @@
19287
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19288
- * extent[rank-1];
19289
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19291
retarray->offset = 0;
19292
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19293
@@ -307,7 +305,7 @@
19297
- retarray->base_addr = xmalloc (alloc_size);
19298
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19302
@@ -485,8 +483,7 @@
19303
retarray->offset = 0;
19304
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19306
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19307
- * extent[rank-1];
19308
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19310
if (alloc_size == 0)
19312
@@ -495,7 +492,7 @@
19316
- retarray->base_addr = xmalloc (alloc_size);
19317
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19321
Index: libgfortran/generated/sum_c8.c
19322
===================================================================
19323
--- a/src/libgfortran/generated/sum_c8.c (.../tags/gcc_4_8_3_release)
19324
+++ b/src/libgfortran/generated/sum_c8.c (.../branches/gcc-4_8-branch)
19326
retarray->offset = 0;
19327
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19329
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19330
- * extent[rank-1];
19331
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19333
- retarray->base_addr = xmalloc (alloc_size);
19334
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19335
if (alloc_size == 0)
19337
/* Make sure we have a zero-sized array. */
19338
@@ -272,8 +271,7 @@
19342
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19343
- * extent[rank-1];
19344
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19346
retarray->offset = 0;
19347
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19348
@@ -285,7 +283,7 @@
19352
- retarray->base_addr = xmalloc (alloc_size);
19353
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19357
@@ -430,8 +428,7 @@
19358
retarray->offset = 0;
19359
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19361
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19362
- * extent[rank-1];
19363
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19365
if (alloc_size == 0)
19367
@@ -440,7 +437,7 @@
19371
- retarray->base_addr = xmalloc (alloc_size);
19372
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19376
Index: libgfortran/generated/maxloc1_16_i2.c
19377
===================================================================
19378
--- a/src/libgfortran/generated/maxloc1_16_i2.c (.../tags/gcc_4_8_3_release)
19379
+++ b/src/libgfortran/generated/maxloc1_16_i2.c (.../branches/gcc-4_8-branch)
19381
retarray->offset = 0;
19382
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19384
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19385
- * extent[rank-1];
19386
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19388
- retarray->base_addr = xmalloc (alloc_size);
19389
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19390
if (alloc_size == 0)
19392
/* Make sure we have a zero-sized array. */
19393
@@ -294,8 +293,7 @@
19397
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19398
- * extent[rank-1];
19399
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19401
retarray->offset = 0;
19402
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19403
@@ -307,7 +305,7 @@
19407
- retarray->base_addr = xmalloc (alloc_size);
19408
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19412
@@ -485,8 +483,7 @@
19413
retarray->offset = 0;
19414
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19416
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19417
- * extent[rank-1];
19418
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19420
if (alloc_size == 0)
19422
@@ -495,7 +492,7 @@
19426
- retarray->base_addr = xmalloc (alloc_size);
19427
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19431
Index: libgfortran/generated/parity_l1.c
19432
===================================================================
19433
--- a/src/libgfortran/generated/parity_l1.c (.../tags/gcc_4_8_3_release)
19434
+++ b/src/libgfortran/generated/parity_l1.c (.../branches/gcc-4_8-branch)
19436
retarray->offset = 0;
19437
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19439
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19440
- * extent[rank-1];
19441
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19443
- retarray->base_addr = xmalloc (alloc_size);
19444
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
19445
if (alloc_size == 0)
19447
/* Make sure we have a zero-sized array. */
19448
Index: libgfortran/generated/maxval_i16.c
19449
===================================================================
19450
--- a/src/libgfortran/generated/maxval_i16.c (.../tags/gcc_4_8_3_release)
19451
+++ b/src/libgfortran/generated/maxval_i16.c (.../branches/gcc-4_8-branch)
19453
retarray->offset = 0;
19454
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19456
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19457
- * extent[rank-1];
19458
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19460
- retarray->base_addr = xmalloc (alloc_size);
19461
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19462
if (alloc_size == 0)
19464
/* Make sure we have a zero-sized array. */
19465
@@ -286,8 +285,7 @@
19469
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19470
- * extent[rank-1];
19471
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19473
retarray->offset = 0;
19474
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19475
@@ -299,7 +297,7 @@
19479
- retarray->base_addr = xmalloc (alloc_size);
19480
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19484
@@ -472,8 +470,7 @@
19485
retarray->offset = 0;
19486
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19488
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19489
- * extent[rank-1];
19490
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19492
if (alloc_size == 0)
19494
@@ -482,7 +479,7 @@
19498
- retarray->base_addr = xmalloc (alloc_size);
19499
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19503
Index: libgfortran/generated/spread_c8.c
19504
===================================================================
19505
--- a/src/libgfortran/generated/spread_c8.c (.../tags/gcc_4_8_3_release)
19506
+++ b/src/libgfortran/generated/spread_c8.c (.../branches/gcc-4_8-branch)
19507
@@ -101,8 +101,8 @@
19511
- /* xmalloc allocates a single byte for zero size. */
19512
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
19513
+ /* xmallocarray allocates a single byte for zero size. */
19514
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
19518
@@ -244,7 +244,7 @@
19520
if (ret->base_addr == NULL)
19522
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
19523
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
19525
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
19527
Index: libgfortran/generated/matmul_i16.c
19528
===================================================================
19529
--- a/src/libgfortran/generated/matmul_i16.c (.../tags/gcc_4_8_3_release)
19530
+++ b/src/libgfortran/generated/matmul_i16.c (.../branches/gcc-4_8-branch)
19531
@@ -124,7 +124,7 @@
19534
retarray->base_addr
19535
- = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
19536
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
19537
retarray->offset = 0;
19539
else if (unlikely (compile_options.bounds_check))
19540
Index: libgfortran/generated/pack_i8.c
19541
===================================================================
19542
--- a/src/libgfortran/generated/pack_i8.c (.../tags/gcc_4_8_3_release)
19543
+++ b/src/libgfortran/generated/pack_i8.c (.../branches/gcc-4_8-branch)
19544
@@ -167,8 +167,8 @@
19548
- /* xmalloc allocates a single byte for zero size. */
19549
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
19550
+ /* xmallocarray allocates a single byte for zero size. */
19551
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
19555
Index: libgfortran/generated/any_l1.c
19556
===================================================================
19557
--- a/src/libgfortran/generated/any_l1.c (.../tags/gcc_4_8_3_release)
19558
+++ b/src/libgfortran/generated/any_l1.c (.../branches/gcc-4_8-branch)
19559
@@ -101,8 +101,7 @@
19560
retarray->offset = 0;
19561
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19563
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19564
- * extent[rank-1];
19565
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19567
if (alloc_size == 0)
19569
@@ -111,7 +110,7 @@
19573
- retarray->base_addr = xmalloc (alloc_size);
19574
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
19578
Index: libgfortran/generated/minloc1_8_i2.c
19579
===================================================================
19580
--- a/src/libgfortran/generated/minloc1_8_i2.c (.../tags/gcc_4_8_3_release)
19581
+++ b/src/libgfortran/generated/minloc1_8_i2.c (.../branches/gcc-4_8-branch)
19583
retarray->offset = 0;
19584
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19586
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19587
- * extent[rank-1];
19588
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19590
- retarray->base_addr = xmalloc (alloc_size);
19591
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19592
if (alloc_size == 0)
19594
/* Make sure we have a zero-sized array. */
19595
@@ -294,8 +293,7 @@
19599
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19600
- * extent[rank-1];
19601
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19603
retarray->offset = 0;
19604
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19605
@@ -307,7 +305,7 @@
19609
- retarray->base_addr = xmalloc (alloc_size);
19610
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19614
@@ -485,8 +483,7 @@
19615
retarray->offset = 0;
19616
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19618
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19619
- * extent[rank-1];
19620
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19622
if (alloc_size == 0)
19624
@@ -495,7 +492,7 @@
19628
- retarray->base_addr = xmalloc (alloc_size);
19629
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19633
Index: libgfortran/generated/minloc0_8_r8.c
19634
===================================================================
19635
--- a/src/libgfortran/generated/minloc0_8_r8.c (.../tags/gcc_4_8_3_release)
19636
+++ b/src/libgfortran/generated/minloc0_8_r8.c (.../branches/gcc-4_8-branch)
19638
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19639
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19640
retarray->offset = 0;
19641
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19642
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19646
@@ -199,7 +199,7 @@
19647
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19648
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19649
retarray->offset = 0;
19650
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19651
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19655
@@ -367,7 +367,7 @@
19656
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19657
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19658
retarray->offset = 0;
19659
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19660
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19662
else if (unlikely (compile_options.bounds_check))
19664
Index: libgfortran/generated/matmul_l8.c
19665
===================================================================
19666
--- a/src/libgfortran/generated/matmul_l8.c (.../tags/gcc_4_8_3_release)
19667
+++ b/src/libgfortran/generated/matmul_l8.c (.../branches/gcc-4_8-branch)
19671
retarray->base_addr
19672
- = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
19673
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
19674
retarray->offset = 0;
19676
else if (unlikely (compile_options.bounds_check))
19677
Index: libgfortran/generated/product_r10.c
19678
===================================================================
19679
--- a/src/libgfortran/generated/product_r10.c (.../tags/gcc_4_8_3_release)
19680
+++ b/src/libgfortran/generated/product_r10.c (.../branches/gcc-4_8-branch)
19682
retarray->offset = 0;
19683
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19685
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19686
- * extent[rank-1];
19687
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19689
- retarray->base_addr = xmalloc (alloc_size);
19690
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
19691
if (alloc_size == 0)
19693
/* Make sure we have a zero-sized array. */
19694
@@ -272,8 +271,7 @@
19698
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19699
- * extent[rank-1];
19700
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19702
retarray->offset = 0;
19703
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19704
@@ -285,7 +283,7 @@
19708
- retarray->base_addr = xmalloc (alloc_size);
19709
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
19713
@@ -430,8 +428,7 @@
19714
retarray->offset = 0;
19715
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19717
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19718
- * extent[rank-1];
19719
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19721
if (alloc_size == 0)
19723
@@ -440,7 +437,7 @@
19727
- retarray->base_addr = xmalloc (alloc_size);
19728
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
19732
Index: libgfortran/generated/product_i1.c
19733
===================================================================
19734
--- a/src/libgfortran/generated/product_i1.c (.../tags/gcc_4_8_3_release)
19735
+++ b/src/libgfortran/generated/product_i1.c (.../branches/gcc-4_8-branch)
19737
retarray->offset = 0;
19738
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19740
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19741
- * extent[rank-1];
19742
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19744
- retarray->base_addr = xmalloc (alloc_size);
19745
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19746
if (alloc_size == 0)
19748
/* Make sure we have a zero-sized array. */
19749
@@ -272,8 +271,7 @@
19753
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19754
- * extent[rank-1];
19755
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19757
retarray->offset = 0;
19758
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19759
@@ -285,7 +283,7 @@
19763
- retarray->base_addr = xmalloc (alloc_size);
19764
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19768
@@ -430,8 +428,7 @@
19769
retarray->offset = 0;
19770
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19772
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19773
- * extent[rank-1];
19774
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19776
if (alloc_size == 0)
19778
@@ -440,7 +437,7 @@
19782
- retarray->base_addr = xmalloc (alloc_size);
19783
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19787
Index: libgfortran/generated/all_l8.c
19788
===================================================================
19789
--- a/src/libgfortran/generated/all_l8.c (.../tags/gcc_4_8_3_release)
19790
+++ b/src/libgfortran/generated/all_l8.c (.../branches/gcc-4_8-branch)
19791
@@ -101,8 +101,7 @@
19792
retarray->offset = 0;
19793
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19795
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19796
- * extent[rank-1];
19797
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19799
if (alloc_size == 0)
19801
@@ -111,7 +110,7 @@
19805
- retarray->base_addr = xmalloc (alloc_size);
19806
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
19810
Index: libgfortran/generated/in_pack_r16.c
19811
===================================================================
19812
--- a/src/libgfortran/generated/in_pack_r16.c (.../tags/gcc_4_8_3_release)
19813
+++ b/src/libgfortran/generated/in_pack_r16.c (.../branches/gcc-4_8-branch)
19815
return source->base_addr;
19817
/* Allocate storage for the destination. */
19818
- destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
19819
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
19821
src = source->base_addr;
19822
stride0 = stride[0];
19823
Index: libgfortran/generated/in_pack_i1.c
19824
===================================================================
19825
--- a/src/libgfortran/generated/in_pack_i1.c (.../tags/gcc_4_8_3_release)
19826
+++ b/src/libgfortran/generated/in_pack_i1.c (.../branches/gcc-4_8-branch)
19828
return source->base_addr;
19830
/* Allocate storage for the destination. */
19831
- destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
19832
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
19834
src = source->base_addr;
19835
stride0 = stride[0];
19836
Index: libgfortran/libgfortran.h
19837
===================================================================
19838
--- a/src/libgfortran/libgfortran.h (.../tags/gcc_4_8_3_release)
19839
+++ b/src/libgfortran/libgfortran.h (.../branches/gcc-4_8-branch)
19840
@@ -751,6 +751,9 @@
19841
extern void *xmalloc (size_t) __attribute__ ((malloc));
19842
internal_proto(xmalloc);
19844
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
19845
+internal_proto(xmallocarray);
19847
extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
19848
internal_proto(xcalloc);
19850
Index: libgfortran/io/list_read.c
19851
===================================================================
19852
--- a/src/libgfortran/io/list_read.c (.../tags/gcc_4_8_3_release)
19853
+++ b/src/libgfortran/io/list_read.c (.../branches/gcc-4_8-branch)
19854
@@ -2354,7 +2354,7 @@
19856
index_type len = strlen (nl->var_name) + 1;
19858
- char * ext_name = (char*)xmalloc (len + 1);
19859
+ char * ext_name = xmalloc (len + 1);
19860
memcpy (ext_name, nl->var_name, len-1);
19861
memcpy (ext_name + len - 1, "%", 2);
19862
for (nl = nl->next; nl; nl = nl->next)
19863
Index: libgfortran/io/unit.c
19864
===================================================================
19865
--- a/src/libgfortran/io/unit.c (.../tags/gcc_4_8_3_release)
19866
+++ b/src/libgfortran/io/unit.c (.../branches/gcc-4_8-branch)
19867
@@ -455,7 +455,7 @@
19869
iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
19870
iunit->ls = (array_loop_spec *)
19871
- xmalloc (iunit->rank * sizeof (array_loop_spec));
19872
+ xmallocarray (iunit->rank, sizeof (array_loop_spec));
19873
dtp->internal_unit_len *=
19874
init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
19876
Index: libgfortran/io/unix.c
19877
===================================================================
19878
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
19879
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
19880
@@ -407,7 +407,9 @@
19884
- if (s->fd != STDOUT_FILENO
19887
+ else if (s->fd != STDOUT_FILENO
19888
&& s->fd != STDERR_FILENO
19889
&& s->fd != STDIN_FILENO)
19890
retval = close (s->fd);
19891
@@ -983,7 +985,15 @@
19893
/* Get the current length of the file. */
19895
- fstat (fd, &statbuf);
19896
+ if (fstat (fd, &statbuf) == -1)
19898
+ s->st_dev = s->st_ino = -1;
19899
+ s->file_length = 0;
19900
+ if (errno == EBADF)
19903
+ return (stream *) s;
19906
s->st_dev = statbuf.st_dev;
19907
s->st_ino = statbuf.st_ino;
19908
Index: libgfortran/io/transfer.c
19909
===================================================================
19910
--- a/src/libgfortran/io/transfer.c (.../tags/gcc_4_8_3_release)
19911
+++ b/src/libgfortran/io/transfer.c (.../branches/gcc-4_8-branch)
19912
@@ -3776,9 +3776,9 @@
19913
if (nml->var_rank > 0)
19915
nml->dim = (descriptor_dimension*)
19916
- xmalloc (nml->var_rank * sizeof (descriptor_dimension));
19917
+ xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
19918
nml->ls = (array_loop_spec*)
19919
- xmalloc (nml->var_rank * sizeof (array_loop_spec));
19920
+ xmallocarray (nml->var_rank, sizeof (array_loop_spec));
19924
Index: libgfortran/io/write.c
19925
===================================================================
19926
--- a/src/libgfortran/io/write.c (.../tags/gcc_4_8_3_release)
19927
+++ b/src/libgfortran/io/write.c (.../branches/gcc-4_8-branch)
19928
@@ -1863,7 +1863,7 @@
19929
base_var_name_len = base ? strlen (base->var_name) : 0;
19930
ext_name_len = base_name_len + base_var_name_len
19931
+ strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
19932
- ext_name = (char*)xmalloc (ext_name_len);
19933
+ ext_name = xmalloc (ext_name_len);
19935
memcpy (ext_name, base_name, base_name_len);
19936
clen = strlen (obj->var_name + base_var_name_len);
19937
@@ -1892,7 +1892,7 @@
19938
/* Now obj_name. */
19940
obj_name_len = strlen (obj->var_name) + 1;
19941
- obj_name = xmalloc (obj_name_len+1);
19942
+ obj_name = xmalloc (obj_name_len + 1);
19943
memcpy (obj_name, obj->var_name, obj_name_len-1);
19944
memcpy (obj_name + obj_name_len-1, "%", 2);
19946
Index: libada/Makefile.in
19947
===================================================================
19948
--- a/src/libada/Makefile.in (.../tags/gcc_4_8_3_release)
19949
+++ b/src/libada/Makefile.in (.../branches/gcc-4_8-branch)
19951
PICFLAG = @PICFLAG@
19952
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
19953
GNATLIBCFLAGS= -g -O2
19954
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
19955
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
19956
-fexceptions -DIN_RTS @have_getipinfo@
19958
host_subdir = @host_subdir@
19959
Index: libada/ChangeLog
19960
===================================================================
19961
--- a/src/libada/ChangeLog (.../tags/gcc_4_8_3_release)
19962
+++ b/src/libada/ChangeLog (.../branches/gcc-4_8-branch)
19964
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
19966
+ * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
19968
2014-05-22 Release Manager
19970
* GCC 4.8.3 released.
19971
Index: libffi/src/powerpc/linux64_closure.S
19972
===================================================================
19973
--- a/src/libffi/src/powerpc/linux64_closure.S (.../tags/gcc_4_8_3_release)
19974
+++ b/src/libffi/src/powerpc/linux64_closure.S (.../branches/gcc-4_8-branch)
19975
@@ -381,7 +381,8 @@
19979
-# if defined __ELF__ && defined __linux__
19982
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
19983
.section .note.GNU-stack,"",@progbits
19986
Index: libffi/src/powerpc/linux64.S
19987
===================================================================
19988
--- a/src/libffi/src/powerpc/linux64.S (.../tags/gcc_4_8_3_release)
19989
+++ b/src/libffi/src/powerpc/linux64.S (.../branches/gcc-4_8-branch)
19990
@@ -254,7 +254,8 @@
19994
-# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
19997
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
19998
.section .note.GNU-stack,"",@progbits
20001
Index: libffi/ChangeLog
20002
===================================================================
20003
--- a/src/libffi/ChangeLog (.../tags/gcc_4_8_3_release)
20004
+++ b/src/libffi/ChangeLog (.../branches/gcc-4_8-branch)
20006
+2014-09-11 Jakub Jelinek <jakub@redhat.com>
20008
+ * src/powerpc/linux64.S: Emit .note.GNU-stack even when
20009
+ POWERPC64 is not defined.
20010
+ * src/powerpc/linux64_closure.S: Likewise. Also test _CALL_ELF == 2.
20012
2014-05-22 Release Manager
20014
* GCC 4.8.3 released.
20016
===================================================================
20017
--- a/src/. (.../tags/gcc_4_8_3_release)
20018
+++ b/src/. (.../branches/gcc-4_8-branch)
20020
Property changes on: .
20021
___________________________________________________________________
20022
Modified: svn:mergeinfo
20023
Merged /trunk:r211733,215049