1
# DP: updates from the 4.8 branch upto 20140930 (r215742).
5
cat > ${dir}LAST_UPDATED <<EOF
6
Tue Sep 30 23:23:25 CEST 2014
7
Tue Sep 30 21:23:25 UTC 2014 (revision 215742)
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: libgcc/ChangeLog
1003
===================================================================
1004
--- a/src/libgcc/ChangeLog (.../tags/gcc_4_8_3_release)
1005
+++ b/src/libgcc/ChangeLog (.../branches/gcc-4_8-branch)
1007
+2014-09-18 Joseph Myers <joseph@codesourcery.com>
1009
+ * config/i386/sfp-machine.h (FP_TRAPPING_EXCEPTIONS): Treat clear
1010
+ bits not set bits as indicating trapping exceptions.
1012
2014-05-22 Release Manager
1014
* GCC 4.8.3 released.
1015
Index: libgcc/config/i386/sfp-machine.h
1016
===================================================================
1017
--- a/src/libgcc/config/i386/sfp-machine.h (.../tags/gcc_4_8_3_release)
1018
+++ b/src/libgcc/config/i386/sfp-machine.h (.../branches/gcc-4_8-branch)
1020
__sfp_handle_exceptions (_fex); \
1023
-#define FP_TRAPPING_EXCEPTIONS ((_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
1024
+#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
1026
#define FP_ROUNDMODE (_fcw & FP_RND_MASK)
1028
Index: gcc/tree-ssa-tail-merge.c
1029
===================================================================
1030
--- a/src/gcc/tree-ssa-tail-merge.c (.../tags/gcc_4_8_3_release)
1031
+++ b/src/gcc/tree-ssa-tail-merge.c (.../branches/gcc-4_8-branch)
1032
@@ -1060,6 +1060,24 @@
1036
+/* Return true if gimple operands T1 and T2 have the same value. */
1039
+gimple_operand_equal_value_p (tree t1, tree t2)
1044
+ if (t1 == NULL_TREE
1045
+ || t2 == NULL_TREE)
1048
+ if (operand_equal_p (t1, t2, 0))
1051
+ return gvn_uses_equal (t1, t2);
1054
/* Return true if gimple statements S1 and S2 are equal. Gimple_bb (s1) and
1055
gimple_bb (s2) are members of SAME_SUCC. */
1057
@@ -1122,8 +1140,9 @@
1058
lhs2 = gimple_get_lhs (s2);
1059
if (TREE_CODE (lhs1) != SSA_NAME
1060
&& TREE_CODE (lhs2) != SSA_NAME)
1061
- return (vn_valueize (gimple_vdef (s1))
1062
- == vn_valueize (gimple_vdef (s2)));
1063
+ return (operand_equal_p (lhs1, lhs2, 0)
1064
+ && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
1065
+ gimple_assign_rhs1 (s2)));
1066
else if (TREE_CODE (lhs1) == SSA_NAME
1067
&& TREE_CODE (lhs2) == SSA_NAME)
1068
return vn_valueize (lhs1) == vn_valueize (lhs2);
1069
Index: gcc/DATESTAMP
1070
===================================================================
1071
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_3_release)
1072
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
1077
===================================================================
1078
--- a/src/gcc/ipa-cp.c (.../tags/gcc_4_8_3_release)
1079
+++ b/src/gcc/ipa-cp.c (.../branches/gcc-4_8-branch)
1081
else if (!opt_for_fn (node->symbol.decl, optimize)
1082
|| !opt_for_fn (node->symbol.decl, flag_ipa_cp))
1083
reason = "non-optimized function";
1084
+ else if (node->tm_clone)
1085
+ reason = "transactional memory clone";
1087
if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
1088
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
1089
@@ -2902,6 +2904,11 @@
1090
intersect_with_agg_replacements (cs->caller, src_idx,
1101
@@ -2917,6 +2924,11 @@
1103
intersect_with_plats (src_plats, &inter, 0);
1112
else if (jfunc->type == IPA_JF_ANCESTOR
1113
@@ -3000,7 +3012,8 @@
1114
vec<cgraph_edge_p> callers)
1116
struct ipa_node_params *dest_info = IPA_NODE_REF (node);
1117
- struct ipa_agg_replacement_value *res = NULL;
1118
+ struct ipa_agg_replacement_value *res;
1119
+ struct ipa_agg_replacement_value **tail = &res;
1120
struct cgraph_edge *cs;
1121
int i, j, count = ipa_get_param_count (dest_info);
1123
@@ -3044,8 +3057,8 @@
1124
v->offset = item->offset;
1125
v->value = item->value;
1126
v->by_ref = plats->aggs_by_ref;
1134
@@ -3052,6 +3065,7 @@
1135
if (inter.exists ())
1142
@@ -3060,7 +3074,8 @@
1143
static struct ipa_agg_replacement_value *
1144
known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function_t> known_aggs)
1146
- struct ipa_agg_replacement_value *res = NULL;
1147
+ struct ipa_agg_replacement_value *res;
1148
+ struct ipa_agg_replacement_value **tail = &res;
1149
struct ipa_agg_jump_function *aggjf;
1150
struct ipa_agg_jf_item *item;
1152
@@ -3074,9 +3089,10 @@
1153
v->offset = item->offset;
1154
v->value = item->value;
1155
v->by_ref = aggjf->by_ref;
1165
Index: gcc/fold-const.c
1166
===================================================================
1167
--- a/src/gcc/fold-const.c (.../tags/gcc_4_8_3_release)
1168
+++ b/src/gcc/fold-const.c (.../branches/gcc-4_8-branch)
1169
@@ -9213,7 +9213,7 @@
1170
/* Transform comparisons of the form X +- C1 CMP Y +- C2 to
1171
X CMP Y +- C2 +- C1 for signed X, Y. This is valid if
1172
the resulting offset is smaller in absolute value than the
1174
+ original one and has the same sign. */
1175
if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
1176
&& (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
1177
&& (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
1178
@@ -9232,19 +9232,20 @@
1181
/* Put the constant on the side where it doesn't overflow and is
1182
- of lower absolute value than before. */
1183
+ of lower absolute value and of same sign than before. */
1184
cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
1185
? MINUS_EXPR : PLUS_EXPR,
1187
if (!TREE_OVERFLOW (cst)
1188
- && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2))
1189
+ && tree_int_cst_compare (const2, cst) == tree_int_cst_sgn (const2)
1190
+ && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const2))
1192
fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
1193
return fold_build2_loc (loc, code, type,
1195
- fold_build2_loc (loc,
1196
- TREE_CODE (arg1), TREE_TYPE (arg1),
1199
+ fold_build2_loc (loc, TREE_CODE (arg1),
1204
cst = int_const_binop (TREE_CODE (arg0) == TREE_CODE (arg1)
1205
@@ -9251,13 +9252,15 @@
1206
? MINUS_EXPR : PLUS_EXPR,
1208
if (!TREE_OVERFLOW (cst)
1209
- && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1))
1210
+ && tree_int_cst_compare (const1, cst) == tree_int_cst_sgn (const1)
1211
+ && tree_int_cst_sgn (cst) == tree_int_cst_sgn (const1))
1213
fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
1214
return fold_build2_loc (loc, code, type,
1215
- fold_build2_loc (loc, TREE_CODE (arg0), TREE_TYPE (arg0),
1218
+ fold_build2_loc (loc, TREE_CODE (arg0),
1225
@@ -11218,7 +11221,6 @@
1227
double_int c1, c2, c3, msk;
1228
int width = TYPE_PRECISION (type), w;
1229
- bool try_simplify = true;
1231
c1 = tree_to_double_int (TREE_OPERAND (arg0, 1));
1232
c2 = tree_to_double_int (arg1);
1233
@@ -11255,20 +11257,7 @@
1237
- /* If X is a tree of the form (Y * K1) & K2, this might conflict
1238
- with that optimization from the BIT_AND_EXPR optimizations.
1239
- This could end up in an infinite recursion. */
1240
- if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR
1241
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1))
1244
- tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
1245
- double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
1247
- try_simplify = (masked != c1);
1250
- if (try_simplify && c3 != c1)
1252
return fold_build2_loc (loc, BIT_IOR_EXPR, type,
1253
fold_build2_loc (loc, BIT_AND_EXPR, type,
1254
TREE_OPERAND (arg0, 0),
1255
@@ -11658,16 +11647,25 @@
1256
&& TREE_CODE (arg0) == MULT_EXPR
1257
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
1259
+ double_int darg1 = tree_to_double_int (arg1);
1261
- = mask_with_tz (type, tree_to_double_int (arg1),
1262
+ = mask_with_tz (type, darg1,
1263
tree_to_double_int (TREE_OPERAND (arg0, 1)));
1265
if (masked.is_zero ())
1266
return omit_two_operands_loc (loc, type, build_zero_cst (type),
1268
- else if (masked != tree_to_double_int (arg1))
1269
- return fold_build2_loc (loc, code, type, op0,
1270
- double_int_to_tree (type, masked));
1271
+ else if (masked != darg1)
1273
+ /* Avoid the transform if arg1 is a mask of some
1274
+ mode which allows further optimizations. */
1275
+ int pop = darg1.popcount ();
1276
+ if (!(pop >= BITS_PER_UNIT
1277
+ && exact_log2 (pop) != -1
1278
+ && double_int::mask (pop) == darg1))
1279
+ return fold_build2_loc (loc, code, type, op0,
1280
+ double_int_to_tree (type, masked));
1284
/* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
1285
Index: gcc/omp-low.c
1286
===================================================================
1287
--- a/src/gcc/omp-low.c (.../tags/gcc_4_8_3_release)
1288
+++ b/src/gcc/omp-low.c (.../branches/gcc-4_8-branch)
1289
@@ -1586,7 +1586,6 @@
1290
TREE_STATIC (decl) = 1;
1291
TREE_USED (decl) = 1;
1292
DECL_ARTIFICIAL (decl) = 1;
1293
- DECL_NAMELESS (decl) = 1;
1294
DECL_IGNORED_P (decl) = 0;
1295
TREE_PUBLIC (decl) = 0;
1296
DECL_UNINLINABLE (decl) = 1;
1298
===================================================================
1299
--- a/src/gcc/toplev.c (.../tags/gcc_4_8_3_release)
1300
+++ b/src/gcc/toplev.c (.../branches/gcc-4_8-branch)
1301
@@ -1036,16 +1036,19 @@
1303
if (warn_stack_usage >= 0)
1305
+ const location_t loc = DECL_SOURCE_LOCATION (current_function_decl);
1307
if (stack_usage_kind == DYNAMIC)
1308
- warning (OPT_Wstack_usage_, "stack usage might be unbounded");
1309
+ warning_at (loc, OPT_Wstack_usage_, "stack usage might be unbounded");
1310
else if (stack_usage > warn_stack_usage)
1312
if (stack_usage_kind == DYNAMIC_BOUNDED)
1313
- warning (OPT_Wstack_usage_, "stack usage might be %wd bytes",
1316
+ OPT_Wstack_usage_, "stack usage might be %wd bytes",
1319
- warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
1321
+ warning_at (loc, OPT_Wstack_usage_, "stack usage is %wd bytes",
1326
Index: gcc/tree-ssa-sccvn.c
1327
===================================================================
1328
--- a/src/gcc/tree-ssa-sccvn.c (.../tags/gcc_4_8_3_release)
1329
+++ b/src/gcc/tree-ssa-sccvn.c (.../branches/gcc-4_8-branch)
1330
@@ -3015,33 +3015,12 @@
1331
/* If all value numbered to the same value, the phi node has that
1335
- if (is_gimple_min_invariant (sameval))
1337
- VN_INFO (PHI_RESULT (phi))->has_constants = true;
1338
- VN_INFO (PHI_RESULT (phi))->expr = sameval;
1342
- VN_INFO (PHI_RESULT (phi))->has_constants = false;
1343
- VN_INFO (PHI_RESULT (phi))->expr = sameval;
1345
+ return set_ssa_val_to (PHI_RESULT (phi), sameval);
1347
- if (TREE_CODE (sameval) == SSA_NAME)
1348
- return visit_copy (PHI_RESULT (phi), sameval);
1350
- return set_ssa_val_to (PHI_RESULT (phi), sameval);
1353
/* Otherwise, see if it is equivalent to a phi node in this block. */
1354
result = vn_phi_lookup (phi);
1357
- if (TREE_CODE (result) == SSA_NAME)
1358
- changed = visit_copy (PHI_RESULT (phi), result);
1360
- changed = set_ssa_val_to (PHI_RESULT (phi), result);
1362
+ changed = set_ssa_val_to (PHI_RESULT (phi), result);
1365
vn_phi_insert (phi, PHI_RESULT (phi));
1366
@@ -3142,24 +3121,18 @@
1367
catch those with constants. The goal here is to simultaneously
1368
combine constants between expressions, but avoid infinite
1369
expansion of expressions during simplification. */
1370
- if (TREE_CODE (op0) == SSA_NAME)
1372
- if (VN_INFO (op0)->has_constants
1373
+ op0 = vn_valueize (op0);
1374
+ if (TREE_CODE (op0) == SSA_NAME
1375
+ && (VN_INFO (op0)->has_constants
1376
|| TREE_CODE_CLASS (code) == tcc_comparison
1377
- || code == COMPLEX_EXPR)
1378
- op0 = valueize_expr (vn_get_expr_for (op0));
1380
- op0 = vn_valueize (op0);
1382
+ || code == COMPLEX_EXPR))
1383
+ op0 = valueize_expr (vn_get_expr_for (op0));
1385
- if (TREE_CODE (op1) == SSA_NAME)
1387
- if (VN_INFO (op1)->has_constants
1388
- || code == COMPLEX_EXPR)
1389
- op1 = valueize_expr (vn_get_expr_for (op1));
1391
- op1 = vn_valueize (op1);
1393
+ op1 = vn_valueize (op1);
1394
+ if (TREE_CODE (op1) == SSA_NAME
1395
+ && (VN_INFO (op1)->has_constants
1396
+ || code == COMPLEX_EXPR))
1397
+ op1 = valueize_expr (vn_get_expr_for (op1));
1399
/* Pointer plus constant can be represented as invariant address.
1400
Do so to allow further propatation, see also tree forwprop. */
1401
@@ -3217,27 +3190,31 @@
1405
- if (VN_INFO (op0)->has_constants)
1406
- op0 = valueize_expr (vn_get_expr_for (op0));
1407
- else if (CONVERT_EXPR_CODE_P (code)
1408
- || code == REALPART_EXPR
1409
- || code == IMAGPART_EXPR
1410
- || code == VIEW_CONVERT_EXPR
1411
- || code == BIT_FIELD_REF)
1412
+ op0 = vn_valueize (op0);
1413
+ if (TREE_CODE (op0) == SSA_NAME)
1415
- /* We want to do tree-combining on conversion-like expressions.
1416
- Make sure we feed only SSA_NAMEs or constants to fold though. */
1417
- tree tem = valueize_expr (vn_get_expr_for (op0));
1418
- if (UNARY_CLASS_P (tem)
1419
- || BINARY_CLASS_P (tem)
1420
- || TREE_CODE (tem) == VIEW_CONVERT_EXPR
1421
- || TREE_CODE (tem) == SSA_NAME
1422
- || TREE_CODE (tem) == CONSTRUCTOR
1423
- || is_gimple_min_invariant (tem))
1425
+ if (VN_INFO (op0)->has_constants)
1426
+ op0 = valueize_expr (vn_get_expr_for (op0));
1427
+ else if (CONVERT_EXPR_CODE_P (code)
1428
+ || code == REALPART_EXPR
1429
+ || code == IMAGPART_EXPR
1430
+ || code == VIEW_CONVERT_EXPR
1431
+ || code == BIT_FIELD_REF)
1433
+ /* We want to do tree-combining on conversion-like expressions.
1434
+ Make sure we feed only SSA_NAMEs or constants to fold though. */
1435
+ tree tem = valueize_expr (vn_get_expr_for (op0));
1436
+ if (UNARY_CLASS_P (tem)
1437
+ || BINARY_CLASS_P (tem)
1438
+ || TREE_CODE (tem) == VIEW_CONVERT_EXPR
1439
+ || TREE_CODE (tem) == SSA_NAME
1440
+ || TREE_CODE (tem) == CONSTRUCTOR
1441
+ || is_gimple_min_invariant (tem))
1446
- /* Avoid folding if nothing changed, but remember the expression. */
1447
+ /* Avoid folding if nothing changed. */
1448
if (op0 == orig_op0)
1451
Index: gcc/cgraphunit.c
1452
===================================================================
1453
--- a/src/gcc/cgraphunit.c (.../tags/gcc_4_8_3_release)
1454
+++ b/src/gcc/cgraphunit.c (.../branches/gcc-4_8-branch)
1455
@@ -1097,7 +1097,7 @@
1456
/* We use local aliases for C++ thunks to force the tailcall
1457
to bind locally. This is a hack - to keep it working do
1458
the following (which is not strictly correct). */
1459
- && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
1460
+ && (TREE_CODE (target_node->symbol.decl) != FUNCTION_DECL
1461
|| ! DECL_VIRTUAL_P (target_node->symbol.decl))
1462
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
1464
Index: gcc/ChangeLog
1465
===================================================================
1466
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_3_release)
1467
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
1469
+2014-09-30 Jakub Jelinek <jakub@redhat.com>
1471
+ PR inline-asm/63282
1472
+ * ifcvt.c (dead_or_predicable): Don't call redirect_jump_1
1473
+ or invert_jump_1 if jump isn't any_condjump_p.
1475
+2014-09-29 Charles Baylis <charles.baylis@linaro.org>
1477
+ Backport from mainline r212303
1479
+ * config/arm/arm-protos.h (arm_legitimate_address_p,
1480
+ arm_is_constant_pool_ref): Add prototypes.
1481
+ * config/arm/arm.c (arm_legitimate_address_p): Remove static.
1482
+ (arm_is_constant_pool_ref) New function.
1483
+ * config/arm/arm.md (unaligned_loadhis, arm_zero_extendhisi2_v6,
1484
+ arm_zero_extendqisi2_v6): Use Uh constraint for memory operand.
1485
+ (arm_extendhisi2, arm_extendhisi2_v6): Use Uh constraint for memory
1486
+ operand and remove pool_range and neg_pool_range attributes.
1487
+ (arm_extendqihi_insn, arm_extendqisi, arm_extendqisi_v6): Remove
1488
+ pool_range and neg_pool_range attributes.
1489
+ * config/arm/constraints.md (Uh): New constraint. (Uq): Don't allow
1490
+ constant pool references.
1492
+2014-09-28 John David Anglin <danglin@gcc.gnu.org>
1494
+ * config/pa/pa.c (pa_output_function_epilogue): Only update
1495
+ last_address when a nonnote insn is found.
1497
+2014-09-25 Oleg Endo <olegendo@gcc.gnu.org>
1499
+ Backport from mainline
1500
+ 2014-09-25 Nick Clifton <nickc@redhat.com>
1501
+ 2014-09-25 Oleg Endo <olegendo@gcc.gnu.org>
1504
+ * config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask,
1505
+ atomic_test_and_set_soft_imask): Fix typo in instruction sequence.
1507
+2014-09-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1509
+ Backport from mainline r215559
1510
+ 2014-09-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1513
+ * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin):
1514
+ Exclude VSX_BUILTIN_XVCMPGEDP_P from special handling.
1516
+2014-09-25 Jakub Jelinek <jakub@redhat.com>
1518
+ PR tree-optimization/63341
1519
+ * tree-vectorizer.h (vect_create_data_ref_ptr,
1520
+ vect_create_addr_base_for_vector_ref): Add another tree argument
1521
+ defaulting to NULL_TREE.
1522
+ * tree-vect-data-refs.c (vect_create_data_ref_ptr): Add byte_offset
1523
+ argument, pass it down to vect_create_addr_base_for_vector_ref.
1524
+ (vect_create_addr_base_for_vector_ref): Add byte_offset argument,
1525
+ add that to base_offset too if non-NULL.
1526
+ * tree-vect-stmts.c (vectorizable_load): Add byte_offset variable,
1527
+ for dr_explicit_realign_optimized set it to vector byte size
1528
+ - 1 instead of setting offset, pass byte_offset down to
1529
+ vect_create_data_ref_ptr.
1531
+2014-09-23 Michael Meissner <meissner@linux.vnet.ibm.com>
1533
+ Back port from trunk:
1534
+ 2014-09-23 Michael Meissner <meissner@linux.vnet.ibm.com>
1536
+ * config/rs6000/rs6000.md (f32_vsx): New mode attributes to
1537
+ refine the constraints used on 32/64-bit floating point moves.
1538
+ (f32_av): Likewise.
1539
+ (f64_vsx): Likewise.
1540
+ (f64_dm): Likewise.
1541
+ (f64_av): Likewise.
1542
+ (BOOL_REGS_OUTPUT): Use wt constraint for TImode instead of wa.
1543
+ (BOOL_REGS_OP1): Likewise.
1544
+ (BOOL_REGS_OP2): Likewise.
1545
+ (BOOL_REGS_UNARY): Likewise.
1546
+ (mov<mode>_hardfloat, SFmode/SDmode): Tighten down constraints for
1547
+ 32/64-bit floating point moves. Do not use wa, instead use ww/ws
1548
+ for moves involving VSX registers. Do not use constraints that
1549
+ target VSX registers for decimal types.
1550
+ (mov<mode>_hardfloat32, DFmode/DDmode): Likewise.
1551
+ (mov<mode>_hardfloat64, DFmode/DDmode): Likewise.
1553
+2014-09-19 Michael Meissner <meissner@linux.vnet.ibm.com>
1555
+ Back port from trunk:
1556
+ 2014-09-19 Michael Meissner <meissner@linux.vnet.ibm.com>
1558
+ * config/rs6000/predicates.md (fusion_gpr_mem_load): Move testing
1559
+ for base_reg_operand to be common between LO_SUM and PLUS.
1560
+ (fusion_gpr_mem_combo): New predicate to match a fused address
1561
+ that combines the addis and memory offset address.
1563
+ * config/rs6000/rs6000-protos.h (fusion_gpr_load_p): Change
1564
+ calling signature.
1565
+ (emit_fusion_gpr_load): Likewise.
1567
+ * config/rs6000/rs6000.c (fusion_gpr_load_p): Change calling
1568
+ signature to pass each argument separately, rather than
1569
+ using an operands array. Rewrite the insns found by peephole2 to
1570
+ be a single insn, rather than hoping the insns will still be
1571
+ together when the peephole pass is done. Drop being called via a
1573
+ (emit_fusion_gpr_load): Change calling signature to be called from
1574
+ the fusion_gpr_load_<mode> insns with a combined memory address
1575
+ instead of the peephole pass passing the addis and offset
1578
+ * config/rs6000/rs6000.md (UNSPEC_FUSION_GPR): New unspec for GPR
1580
+ (power8 fusion peephole): Drop support for doing power8 via a
1581
+ normal peephole that was created by the peephole2 pass.
1582
+ (power8 fusion peephole2): Create a new insn with the fused
1583
+ address, so that the fused operation is kept together after
1584
+ register allocation is done.
1585
+ (fusion_gpr_load_<mode>): Likewise.
1587
+2014-09-17 Jakub Jelinek <jakub@redhat.com>
1590
+ * tree-cfgcleanup.c (fixup_noreturn_call): Don't split block
1591
+ if there are only debug stmts after the noreturn call, instead
1592
+ remove the debug stmts.
1594
+2014-09-10 Michael Meissner <meissner@linux.vnet.ibm.com>
1596
+ * config/rs6000/vsx.md (vsx_fmav4sf4): Use correct constraints for
1597
+ V2DF, V4SF, DF, and DI modes.
1598
+ (vsx_fmav2df2): Likewise.
1599
+ (vsx_float_fix_<mode>2): Likewise.
1600
+ (vsx_reduc_<VEC_reduc_name>_v2df_scalar): Likewise.
1602
+2014-09-10 Alan Modra <amodra@gmail.com>
1605
+ * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend
1608
+2014-09-09 Richard Biener <rguenther@suse.de>
1610
+ Backport from mainline
1611
+ 2014-06-11 Richard Biener <rguenther@suse.de>
1613
+ PR tree-optimization/61452
1614
+ * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
1615
+ expr and has_constants in case we found a leader.
1616
+ (simplify_binary_expression): Always valueize operands first.
1617
+ (simplify_unary_expression): Likewise.
1619
+2014-09-09 Richard Biener <rguenther@suse.de>
1621
+ Backport from mainline
1622
+ 2014-05-05 Richard Biener <rguenther@suse.de>
1624
+ PR middle-end/61010
1625
+ * fold-const.c (fold_binary_loc): Consistently avoid
1626
+ canonicalizing X & CST away from a CST that is the mask
1629
+ 2014-05-28 Richard Biener <rguenther@suse.de>
1631
+ PR middle-end/61045
1632
+ * fold-const.c (fold_comparison): When folding
1633
+ X +- C1 CMP Y +- C2 to X CMP Y +- C2 +- C1 also ensure
1634
+ the sign of the remaining constant operand stays the same.
1636
+ 2014-08-11 Richard Biener <rguenther@suse.de>
1638
+ PR tree-optimization/62075
1639
+ * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly
1640
+ handle uses in patterns.
1642
+2014-09-09 James Greenhalgh <james.greenhalgh@arm.com>
1644
+ Backport from mainline.
1645
+ 2014-09-09 James Greenhalgh <james.greenhalgh@arm.com>
1647
+ * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
1648
+ (-mtune): Likewise.
1649
+ (-mcpu): Likewise.
1651
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
1653
+ PR tree-optimization/60196
1654
+ PR tree-optimization/63189
1655
+ Backported from mainline
1656
+ 2013-09-17 Cong Hou <congh@google.com>
1658
+ * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Fix a bug
1659
+ when checking the dot production pattern. The type of rhs operand
1660
+ of multiply is now checked correctly.
1662
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
1664
+ Backported from mainline
1665
+ 2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
1668
+ * haifa-sched.c (advance_one_cycle): Fix dump.
1669
+ (schedule_block): Don't advance cycle if we are already at the
1670
+ beginning of the cycle.
1672
+2014-09-03 Martin Jambor <mjambor@suse.cz>
1675
+ * ipa-cp.c (intersect_aggregates_with_edge): Handle impermissible
1676
+ pass-trough jump functions correctly.
1678
+2014-09-03 Martin Jambor <mjambor@suse.cz>
1681
+ * ipa-cp.c (find_aggregate_values_for_callers_subset): Chain
1682
+ created replacements in ascending order of offsets.
1683
+ (known_aggs_to_agg_replacement_list): Likewise.
1685
+2014-09-01 Marek Polacek <polacek@redhat.com>
1687
+ Backport from mainline
1688
+ 2014-08-21 Marek Polacek <polacek@redhat.com>
1691
+ * expr.c (is_aligning_offset): Remove logical not.
1693
+2014-09-01 Marek Polacek <polacek@redhat.com>
1695
+ Backport from mainline
1696
+ 2014-08-19 Marek Polacek <polacek@redhat.com>
1699
+ * cgraphunit.c (handle_alias_pairs): Fix condition.
1701
+2014-08-30 John David Anglin <danglin@gcc.gnu.org>
1703
+ * config/pa/pa.c (pa_assemble_integer): Don't add PLABEL relocation
1704
+ prefix to function labels when generating fast indirect calls.
1706
+2014-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
1708
+ * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
1710
+2014-08-26 Marek Polacek <polacek@redhat.com>
1712
+ Backport from mainline
1713
+ 2014-08-26 Marek Polacek <polacek@redhat.com>
1716
+ * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
1717
+ LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
1719
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
1721
+ Backport from mainline
1722
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
1725
+ * config/sh/sh.opt (musermode): Allow negative form.
1726
+ * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
1727
+ targets that don't support it.
1728
+ * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
1729
+ Document -mno-usermode option.
1731
+2014-08-23 John David Anglin <danglin@gcc.gnu.org>
1734
+ * config/pa/pa.c (pa_output_function_epilogue): Don't set
1735
+ last_address when the current function is a thunk.
1736
+ (pa_asm_output_mi_thunk): When we don't have named sections or they
1737
+ are not being used, check that thunk can reach the stub table with a
1740
+2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
1742
+ Backport fro mainline
1743
+ 2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
1746
+ * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
1747
+ documentation to state it is only for VSX operations.
1749
+ * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
1750
+ constraint only active if VSX.
1752
+ * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
1753
+ wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
1754
+ (lfiwzx): Likewise.
1756
+2014-08-15 Tom de Vries <tom@codesourcery.com>
1758
+ Backport from mainline:
1759
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
1761
+ PR rtl-optimization/62004
1762
+ PR rtl-optimization/62030
1763
+ * ifcvt.c (rtx_interchangeable_p): New function.
1764
+ (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
1766
+ 2014-08-05 Richard Biener <rguenther@suse.de>
1768
+ * emit-rtl.h (mem_attrs_eq_p): Declare.
1769
+ * emit-rtl.c (mem_attrs_eq_p): Export.
1771
+2014-08-16 John David Anglin <danglin@gcc.gnu.org>
1773
+ Backport from trunk:
1774
+ 2014-04-06 John David Anglin <danglin@gcc.gnu.org>
1777
+ * config/pa/pa.c (pa_output_function_epilogue): Skip address and code
1778
+ size accounting for thunks.
1779
+ (pa_asm_output_mi_thunk): Use final_start_function() and
1780
+ final_end_function() to output function start and end directives.
1782
+2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
1784
+ Backport from mainline:
1785
+ 2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
1787
+ * doc/invoke.texi (SH options): Document missing processor variant
1788
+ options. Remove references to Hitachi. Undocument deprecated mspace
1791
+2014-08-13 Felix Yang <fei.yang0953@gmail.com>
1793
+ PR tree-optimization/62073
1794
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
1797
+2014-08-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1799
+ Backport from mainline
1800
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
1802
+ PR middle-end/62103
1803
+ * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
1804
+ bitfields, that is when size doesn't match the size of type or the
1805
+ size of the constructor.
1807
+2014-08-12 Michael Meissner <meissner@linux.vnet.ibm.com>
1809
+ Backport patch from mainline
1810
+ 2014-08-11 Michael Meissner <meissner@linux.vnet.ibm.com>
1812
+ * config/rs6000/constraints.md (wh constraint): New constraint,
1813
+ for FP registers if direct move is available.
1814
+ (wi constraint): New constraint, for VSX/FP registers that can
1815
+ handle 64-bit integers.
1816
+ (wj constraint): New constraint for VSX/FP registers that can
1817
+ handle 64-bit integers for direct moves.
1818
+ (wk constraint): New constraint for VSX/FP registers that can
1819
+ handle 64-bit doubles for direct moves.
1820
+ (wy constraint): Make documentation match implementation.
1822
+ * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
1823
+ scalar_in_vmx_p field to simplify tests of whether SFmode or
1824
+ DFmode can go in the Altivec registers.
1825
+ (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
1826
+ (rs6000_setup_reg_addr_masks): Likewise.
1827
+ (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
1828
+ field, and wh/wi/wj/wk constraints.
1829
+ (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
1830
+ the wh/wi/wj/wk constraints.
1831
+ (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
1832
+ upper registers, prefer VSX registers unless the operation is a
1833
+ memory operation with REG+OFFSET addressing.
1835
+ * config/rs6000/vsx.md (VSr mode attribute): Add support for
1836
+ DImode. Change SFmode to use ww constraint instead of d to allow
1837
+ SF registers in the upper registers.
1840
+ (VSr5): Fix thinko in comment.
1841
+ (VSa): New mode attribute that is an alternative to wa, that
1842
+ returns the VSX register class that a mode can go in, but may not
1843
+ be the preferred register class.
1844
+ (VS_64dm): New mode attribute for appropriate register classes for
1845
+ referencing 64-bit elements of vectors for direct moves and normal
1847
+ (VS_64reg): Likewise.
1848
+ (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
1849
+ register allocator to only registers the data type can handle.
1850
+ (vsx_le_perm_load_<mode>): Likewise.
1851
+ (vsx_le_perm_store_<mode>): Likewise.
1852
+ (vsx_xxpermdi2_le_<mode>): Likewise.
1853
+ (vsx_xxpermdi4_le_<mode>): Likewise.
1854
+ (vsx_lxvd2x2_le_<mode>): Likewise.
1855
+ (vsx_lxvd2x4_le_<mode>): Likewise.
1856
+ (vsx_stxvd2x2_le_<mode>): Likewise.
1857
+ (vsx_add<mode>3): Likewise.
1858
+ (vsx_sub<mode>3): Likewise.
1859
+ (vsx_mul<mode>3): Likewise.
1860
+ (vsx_div<mode>3): Likewise.
1861
+ (vsx_tdiv<mode>3_internal): Likewise.
1862
+ (vsx_fre<mode>2): Likewise.
1863
+ (vsx_neg<mode>2): Likewise.
1864
+ (vsx_abs<mode>2): Likewise.
1865
+ (vsx_nabs<mode>2): Likewise.
1866
+ (vsx_smax<mode>3): Likewise.
1867
+ (vsx_smin<mode>3): Likewise.
1868
+ (vsx_sqrt<mode>2): Likewise.
1869
+ (vsx_rsqrte<mode>2): Likewise.
1870
+ (vsx_tsqrt<mode>2_internal): Likewise.
1871
+ (vsx_fms<mode>4): Likewise.
1872
+ (vsx_nfma<mode>4): Likewise.
1873
+ (vsx_eq<mode>): Likewise.
1874
+ (vsx_gt<mode>): Likewise.
1875
+ (vsx_ge<mode>): Likewise.
1876
+ (vsx_eq<mode>_p): Likewise.
1877
+ (vsx_gt<mode>_p): Likewise.
1878
+ (vsx_ge<mode>_p): Likewise.
1879
+ (vsx_xxsel<mode>): Likewise.
1880
+ (vsx_xxsel<mode>_uns): Likewise.
1881
+ (vsx_copysign<mode>3): Likewise.
1882
+ (vsx_float<VSi><mode>2): Likewise.
1883
+ (vsx_floatuns<VSi><mode>2): Likewise.
1884
+ (vsx_fix_trunc<mode><VSi>2): Likewise.
1885
+ (vsx_fixuns_trunc<mode><VSi>2): Likewise.
1886
+ (vsx_x<VSv>r<VSs>i): Likewise.
1887
+ (vsx_x<VSv>r<VSs>ic): Likewise.
1888
+ (vsx_btrunc<mode>2): Likewise.
1889
+ (vsx_b2trunc<mode>2): Likewise.
1890
+ (vsx_floor<mode>2): Likewise.
1891
+ (vsx_ceil<mode>2): Likewise.
1892
+ (vsx_<VS_spdp_insn>): Likewise.
1893
+ (vsx_xscvspdp): Likewise.
1894
+ (vsx_xvcvspuxds): Likewise.
1895
+ (vsx_float_fix_<mode>2): Likewise.
1896
+ (vsx_set_<mode>): Likewise.
1897
+ (vsx_extract_<mode>_internal1): Likewise.
1898
+ (vsx_extract_<mode>_internal2): Likewise.
1899
+ (vsx_extract_<mode>_load): Likewise.
1900
+ (vsx_extract_<mode>_store): Likewise.
1901
+ (vsx_splat_<mode>): Likewise.
1902
+ (vsx_xxspltw_<mode>): Likewise.
1903
+ (vsx_xxspltw_<mode>_direct): Likewise.
1904
+ (vsx_xxmrghw_<mode>): Likewise.
1905
+ (vsx_xxmrglw_<mode>): Likewise.
1906
+ (vsx_xxsldwi_<mode>): Likewise.
1907
+ (vsx_xscvdpspn): Tighten constraints to only use register classes
1909
+ (vsx_xscvspdpn): Likewise.
1910
+ (vsx_xscvdpspn_scalar): Likewise.
1912
+ * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
1913
+ wj, and wk constraints.
1914
+ (GPR_REG_CLASS_P): New helper macro for register classes targeting
1915
+ general purpose registers.
1917
+ * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
1919
+ (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
1920
+ DImode instead of wm. Use wk constraint for direct move of DFmode
1922
+ (extendsidi2_lfiwax): Likewise.
1923
+ (lfiwax): Likewise.
1924
+ (lfiwzx): Likewise.
1925
+ (movdi_internal64): Likewise.
1927
+ * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
1928
+ wk constraints. Make the wy constraint documentation match them
1931
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
1933
+ Backport from mainline
1934
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1936
+ PR tree-optimization/61375
1937
+ * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
1938
+ symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
1939
+ (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
1941
+2014-08-01 Richard Biener <rguenther@suse.de>
1943
+ PR tree-optimization/61964
1944
+ * tree-ssa-tail-merge.c (gimple_operand_equal_value_p): New
1945
+ function merged from trunk.
1946
+ (gimple_equal_p): Handle non-SSA LHS solely by structural
1949
+2014-07-25 Uros Bizjak <ubizjak@gmail.com>
1951
+ * config/alpha/elf.h: Define TARGET_UNWIND_TABLES_DEFAULT.
1953
+2014-07-24 Kyle McMartin <kyle@redhat.com>
1955
+ * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
1957
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1959
+ * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
1961
+ * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
1962
+ function. Issue -Wpsabi warning if future GCC releases will use
1963
+ different field alignment rules for this type.
1964
+ * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
1965
+ * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
1966
+ * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
1968
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1970
+ * config/rs6000/rs6000.c (rs6000_function_arg_boundary): Issue
1971
+ -Wpsabi note when encountering a type where future GCC releases
1972
+ will apply different alignment requirements.
1974
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1976
+ * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
1977
+ does not fit fully into floating-point registers, and there is still
1978
+ space in the register parameter area, issue -Wpsabi note that the ABI
1979
+ will change in a future GCC release.
1981
+2014-07-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1983
+ * config/arm/t-rtems-eabi: Add
1984
+ mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard,
1985
+ mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard,
1986
+ mbig-endian/mthumb/march=armv7-r, and
1987
+ mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
1990
+2014-07-21 Peter Bergner <bergner@vnet.ibm.com>
1992
+ * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
1993
+ (LIBTSAN_EARLY_SPEC): Likewise.
1994
+ (STATIC_LIBASAN_LIBS): Likewise.
1995
+ (STATIC_LIBTSAN_LIBS): Likewise.
1997
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
1999
+ * toplev.c (output_stack_usage): Adjust the location of the warning.
2001
+2014-07-19 Daniel Cederman <cederman@gaisler.com>
2003
+ * config/sparc/sync.md (*membar_storeload_leon3): New insn.
2004
+ (*membar_storeload): Disable for LEON3.
2006
+2014-07-17 Richard Biener <rguenther@suse.de>
2008
+ PR rtl-optimization/61801
2009
+ * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
2010
+ ASM_INPUT don't set reg_pending_barrier if it appears in a
2013
+2014-07-16 Jakub Jelinek <jakub@redhat.com>
2015
+ * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS
2016
+ on the FUNCTION_DECL.
2018
+2014-07-10 Tom G. Christensen <tgc@jupiterrise.com>
2020
+ * doc/install.texi: Remove links to defunct package providers for
2023
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
2025
+ PR middle-end/53590
2026
+ * function.c (allocate_struct_function): Revert r188667 change.
2028
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
2030
+ PR tree-optimization/61684
2031
+ * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
2032
+ rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
2034
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
2036
+ Backport from Mainline
2037
+ 2014-06-20 Jakub Jelinek <jakub@redhat.com>
2038
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
2040
+ PR tree-optimization/61306
2041
+ * tree-ssa-math-opts.c (struct symbolic_number): Store type of
2042
+ expression instead of its size.
2043
+ (do_shift_rotate): Adapt to change in struct symbolic_number. Return
2044
+ false to prevent optimization when the result is unpredictable due to
2045
+ arithmetic right shift of signed type with highest byte is set.
2046
+ (verify_symbolic_number_p): Adapt to change in struct symbolic_number.
2047
+ (find_bswap_1): Likewise. Return NULL to prevent optimization when the
2048
+ result is unpredictable due to sign extension.
2049
+ (find_bswap): Adapt to change in struct symbolic_number.
2051
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
2053
+ Backport from mainline
2054
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
2057
+ * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
2059
+2014-06-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2062
+ * config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
2063
+ extraction other than index 3.
2065
+2014-06-24 Jakub Jelinek <jakub@redhat.com>
2068
+ * config/i386/driver-i386.c (host_detect_local_cpu): For unknown
2069
+ model family 6 CPU with has_longmode never use a CPU without
2072
+2014-06-20 Chung-Lin Tang <cltang@codesourcery.com>
2074
+ Backport from mainline
2076
+ 2014-06-20 Julian Brown <julian@codesourcery.com>
2077
+ Chung-Lin Tang <cltang@codesourcery.com>
2079
+ * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
2080
+ TARGET_THUMB1_ONLY. Add comments.
2082
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
2084
+ Backport from mainline
2085
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
2088
+ * config/i386/i386.md (*floatunssi<mode>2_i387_with_xmm): New
2089
+ define_insn_and_split pattern, merged from *floatunssi<mode>2_1
2090
+ and corresponding splitters. Zero extend general register
2091
+ or memory input operand to XMM temporary. Enable for
2092
+ TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
2093
+ (floatunssi<mode>2): Update expander predicate.
2095
+2014-06-18 Richard Henderson <rth@redhat.com>
2098
+ * config/aarch64/aarch64.md (tlsdesc_small): Clobber CC_REGNUM.
2100
+2014-06-17 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
2102
+ Revert on gcc-4_8-branch.
2103
+ * config/microblaze/microblaze.md: Add movsi4_rev insn pattern.
2104
+ * config/microblaze/predicates.md: Add reg_or_mem_operand predicate.
2106
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
2108
+ Backport from mainline
2111
+ * config/aarch64/aarch64.c (aarch64_layout_arg): Add new local
2112
+ variable 'size'; calculate 'size' right in the front; use
2113
+ 'size' to compute 'nregs' (when 'allocate_ncrn != 0') and
2114
+ pcum->aapcs_stack_words.
2116
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
2118
+ Backport from mainline
2120
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
2122
+ * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
2123
+ (BU_MISC_2): Rename to ...
2124
+ (BU_LDBL128_2): ... this.
2125
+ * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
2126
+ (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
2127
+ * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
2128
+ RS6000_BTM_LDBL128.
2129
+ (rs6000_invalid_builtin): Add long double 128-bit builtin support.
2130
+ (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
2131
+ * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
2132
+ (unpacktf_1): Likewise.
2133
+ * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
2134
+ (__builtin_longdouble_dw1): Likewise.
2135
+ * doc/sourcebuild.texi (longdouble128): Document.
2137
+2014-06-13 Jason Merrill <jason@redhat.com>
2140
+ * common.opt (-fno-gnu-unique): Add.
2141
+ * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
2143
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
2145
+ Backport from 2014-05-09 trunk r210272
2147
+ * config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
2148
+ unsigned int initializers for regno_in, regno_out.
2150
+ Backport from 2014-05-14 trunk r210418
2151
+ * config/avr/avr.h (REG_CLASS_CONTENTS): Use unsigned suffix for
2152
+ shifted values to avoid build warning.
2154
+ Backport from 2014-06-12 trunk r211491
2157
+ * config/avr/avr.md (push<mode>1): Avoid (subreg(mem)) when
2158
+ loading from address spaces.
2160
+2014-06-12 Alan Modra <amodra@gmail.com>
2163
+ * doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document.
2164
+ * doc/tm.texi: Regenerate.
2165
+ * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default.
2166
+ Use throughout in place of REG_PARM_STACK_SPACE.
2167
+ * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add
2168
+ "incoming" param. Pass to rs6000_function_parms_need_stack.
2169
+ (rs6000_function_parms_need_stack): Add "incoming" param, ignore
2170
+ prototype_p when incoming. Use function decl when incoming
2171
+ to handle K&R style functions.
2172
+ * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust.
2173
+ (INCOMING_REG_PARM_STACK_SPACE): Define.
2175
+2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
2177
+ Back port from trunk
2178
+ 2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
2181
+ * config/rs6000/vsx.md (VSX_LE): Split VSX_D into 2 separate
2182
+ iterators, VSX_D that handles 64-bit types, and VSX_LE that
2183
+ handles swapping the two 64-bit double words on little endian
2184
+ systems. Include V1TImode and optionally TImode in VSX_LE so that
2185
+ these types are properly swapped. Change all of the insns and
2186
+ splits that do the 64-bit swaps to use VSX_LE.
2187
+ (vsx_le_perm_load_<mode>): Likewise.
2188
+ (vsx_le_perm_store_<mode>): Likewise.
2189
+ (splitters for little endian memory operations): Likewise.
2190
+ (vsx_xxpermdi2_le_<mode>): Likewise.
2191
+ (vsx_lxvd2x2_le_<mode>): Likewise.
2192
+ (vsx_stxvd2x2_le_<mode>): Likewise.
2194
+2014-06-05 Martin Jambor <mjambor@suse.cz>
2197
+ * ipa-cp.c (determine_versionability): Pretend that tm_clones are
2200
+2014-06-04 Richard Biener <rguenther@suse.de>
2202
+ PR tree-optimization/61383
2203
+ * tree-ssa-ifcombine.c (bb_no_side_effects_p): Make sure
2206
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2208
+ Backport from mainline
2209
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2211
+ PR rtl-optimization/60866
2212
+ * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
2213
+ Default it to -1. Pass it down to init_simplejump_data.
2214
+ (init_simplejump_data): New parameter old_seqno. Pass it down
2215
+ to get_seqno_for_a_jump.
2216
+ (get_seqno_for_a_jump): New parameter old_seqno. Use it for
2217
+ initializing new jump seqno as a last resort. Add comment.
2218
+ (sel_redirect_edge_and_branch): Save old seqno of the conditional
2219
+ jump and pass it down to sel_init_new_insn.
2220
+ (sel_redirect_edge_and_branch_force): Likewise.
2222
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
2224
+ Backport from mainline
2225
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
2227
+ PR rtl-optimization/60901
2228
+ * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
2229
+ bb predecessor belongs to the same scheduling region. Adjust comment.
2231
+2014-06-03 Uros Bizjak <ubizjak@gmail.com>
2233
+ Backport from mainline
2234
+ 2014-06-02 Uros Bizjak <ubizjak@gmail.com>
2237
+ * config/i386/i386.c (ix86_expand_vec_perm) [case V32QImode]: Use
2238
+ GEN_INT (-128) instead of GEN_INT (128) to set MSB of QImode constant.
2240
+2014-05-28 Guozhi Wei <carrot@google.com>
2243
+ * config/aarch64/arm_neon.h (vqdmulh_n_s16): Change the last operand's
2245
+ (vqdmulhq_n_s16): Likewise.
2247
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
2249
+ Backport from mainline
2250
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
2252
+ * double-int.c (div_and_round_double) <ROUND_DIV_EXPR>: Use the proper
2253
+ predicate to detect a negative quotient.
2255
+2014-05-28 Georg-Johann Lay <avr@gjlay.de>
2258
+ * doc/extend.texi (Local Labels): Note that label differences are
2259
+ not supported for AVR.
2261
+2014-05-26 Michael Tautschnig <mt@debian.org>
2264
+ * doc/extend.texi (X86 Built-in Functions): Fix parameter lists of
2265
+ __builtin_ia32_vfrczs[sd] and __builtin_ia32_mpsadbw256.
2267
+2014-05-23 Alan Modra <amodra@gmail.com>
2270
+ * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
2271
+ * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
2272
+ Use "Y" constraint rather than "m".
2274
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2276
+ Backport from mainline
2277
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
2279
+ * config/rs6000/htm.md (ttest): Use correct shift value to get CR0.
2281
+2014-05-22 Richard Earnshaw <rearnsha@arm.com>
2284
+ * arm.md (arm_cmpdi_unsigned): Fix length calculation for Thumb2.
2286
2014-05-22 Release Manager
2288
* GCC 4.8.3 released.
2289
Index: gcc/testsuite/gcc.target/powerpc/pr63335.c
2290
===================================================================
2291
--- a/src/gcc/testsuite/gcc.target/powerpc/pr63335.c (.../tags/gcc_4_8_3_release)
2292
+++ b/src/gcc/testsuite/gcc.target/powerpc/pr63335.c (.../branches/gcc-4_8-branch)
2294
+/* { dg-do run { target { powerpc64*-*-* } } } */
2295
+/* { dg-require-effective-target powerpc_vsx_ok } */
2296
+/* { dg-options "-mvsx" } */
2298
+#include <altivec.h>
2302
+vector double vec = (vector double) {99.0, 99.0};
2306
+ int actual = vec_all_nge(vec, vec);
2310
+ actual = vec_all_nle(vec, vec);
2314
+ actual = vec_any_nge(vec, vec);
2318
+ actual = vec_any_nle(vec, vec);
2324
Index: gcc/testsuite/gcc.target/powerpc/tfmode_off.c
2325
===================================================================
2326
--- a/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../tags/gcc_4_8_3_release)
2327
+++ b/src/gcc/testsuite/gcc.target/powerpc/tfmode_off.c (.../branches/gcc-4_8-branch)
2329
/* { dg-do assemble } */
2330
/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
2331
/* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
2332
+/* { dg-require-effective-target longdouble128 } */
2333
/* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
2335
typedef float TFmode __attribute__ ((mode (TF)));
2336
Index: gcc/testsuite/gcc.target/powerpc/pack02.c
2337
===================================================================
2338
--- a/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../tags/gcc_4_8_3_release)
2339
+++ b/src/gcc/testsuite/gcc.target/powerpc/pack02.c (.../branches/gcc-4_8-branch)
2341
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
2342
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
2343
/* { dg-require-effective-target powerpc_fprs } */
2344
+/* { dg-require-effective-target longdouble128 } */
2345
/* { dg-options "-O2 -mhard-float" } */
2348
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
2349
===================================================================
2350
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../tags/gcc_4_8_3_release)
2351
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c (.../branches/gcc-4_8-branch)
2353
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2354
+/* { dg-options "-mabi=elfv2" } */
2361
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
2365
Index: gcc/testsuite/gcc.target/powerpc/htm-ttest.c
2366
===================================================================
2367
--- a/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../tags/gcc_4_8_3_release)
2368
+++ b/src/gcc/testsuite/gcc.target/powerpc/htm-ttest.c (.../branches/gcc-4_8-branch)
2370
+/* { dg-do compile { target { powerpc*-*-* } } } */
2371
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
2372
+/* { dg-require-effective-target powerpc_htm_ok } */
2373
+/* { dg-options "-O2 -mhtm" } */
2375
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */
2376
+/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */
2378
+#include <htmintrin.h>
2382
+ return _HTM_STATE(__builtin_ttest());
2384
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
2385
===================================================================
2386
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../tags/gcc_4_8_3_release)
2387
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c (.../branches/gcc-4_8-branch)
2389
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2390
+/* { dg-options "-mno-compat-align-parm" } */
2394
+ long a __attribute__((aligned (16)));
2397
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
2401
Index: gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
2402
===================================================================
2403
--- a/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../tags/gcc_4_8_3_release)
2404
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c (.../branches/gcc-4_8-branch)
2406
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2407
+/* { dg-require-effective-target powerpc_altivec_ok } */
2408
+/* { dg-options "-maltivec" } */
2412
+ int a __attribute__((vector_size (8)));
2413
+ }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
2415
Index: gcc/testsuite/gcc.target/alpha/pr61586.c
2416
===================================================================
2417
--- a/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../tags/gcc_4_8_3_release)
2418
+++ b/src/gcc/testsuite/gcc.target/alpha/pr61586.c (.../branches/gcc-4_8-branch)
2420
+/* { dg-do compile } */
2421
+/* { dg-options "-O2 -mieee" } */
2423
+void foo (int *dimensions, double **params, int hh)
2427
+ else if (dimensions[hh] > 0)
2428
+ params[hh][0] = 1.0f;
2430
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c
2431
===================================================================
2432
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../tags/gcc_4_8_3_release)
2433
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c (.../branches/gcc-4_8-branch)
2435
+/* Test AAPCS64 layout and __builtin_va_start.
2437
+ Pass named HFA/HVA argument on stack. */
2439
+/* { dg-do run { target aarch64*-*-* } } */
2441
+#ifndef IN_FRAMEWORK
2442
+#define AAPCS64_TEST_STDARG
2443
+#define TESTFILE "va_arg-14.c"
2444
+#include "type-def.h"
2446
+struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f};
2447
+struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f};
2448
+vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f};
2449
+vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f};
2451
+#include "abitest.h"
2453
+ ARG (float, 1.0f, S0, 0)
2454
+ ARG (float, 2.0f, S1, 1)
2455
+ ARG (float, 3.0f, S2, 2)
2456
+ ARG (float, 4.0f, S3, 3)
2457
+ ARG (float, 5.0f, S4, 4)
2458
+ ARG (float, 6.0f, S5, 5)
2459
+ ARG (float, 7.0f, S6, 6)
2460
+ ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7)
2461
+ /* Previous argument size has been rounded up to the nearest multiple of
2463
+ ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8)
2464
+ /* NSAA is rounded up to the nearest natural alignment of float32x4. */
2465
+ ARG (vf4_t, float32x4, STACK + 32, 9)
2466
+ ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID)
2468
+ LAST_ANON (double, 123456789.987, STACK + 64, 11)
2470
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
2471
===================================================================
2472
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../tags/gcc_4_8_3_release)
2473
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h (.../branches/gcc-4_8-branch)
2488
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c
2489
===================================================================
2490
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../tags/gcc_4_8_3_release)
2491
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c (.../branches/gcc-4_8-branch)
2493
+/* Test AAPCS64 layout and __builtin_va_start.
2495
+ Pass named HFA/HVA argument on stack. */
2497
+/* { dg-do run { target aarch64*-*-* } } */
2499
+#ifndef IN_FRAMEWORK
2500
+#define AAPCS64_TEST_STDARG
2501
+#define TESTFILE "va_arg-13.c"
2503
+struct float_float_t
2515
+#define HAS_DATA_INIT_FUNC
2519
+ float_float.a = 1.2f;
2520
+ float_float.b = 2.2f;
2522
+ float_int.b8 = 4983.80f;
2525
+#include "abitest.h"
2527
+ ARG (float, 1.0f, S0, 0)
2528
+ ARG (float, 2.0f, S1, 1)
2529
+ ARG (float, 3.0f, S2, 2)
2530
+ ARG (float, 4.0f, S3, 3)
2531
+ ARG (float, 5.0f, S4, 4)
2532
+ ARG (float, 6.0f, S5, 5)
2533
+ ARG (float, 7.0f, S6, 6)
2534
+ ARG (struct float_float_t, float_float, STACK, 7)
2535
+ ARG (int, 9, W0, 8)
2536
+ ARG (int, 10, W1, 9)
2537
+ ARG (int, 11, W2, 10)
2538
+ ARG (int, 12, W3, 11)
2539
+ ARG (int, 13, W4, 12)
2540
+ ARG (int, 14, W5, 13)
2541
+ ARG (int, 15, W6, LAST_NAMED_ARG_ID)
2543
+ /* Note on the reason of using 'X7' instead of 'W7' here:
2544
+ Using 'X7' makes sure the test works in the big-endian mode.
2545
+ According to PCS rules B.4 and C.10, the size of float_int is rounded
2546
+ to 8 bytes and prepared in the register X7 as if loaded via LDR from
2547
+ the memory, with the content of the other 4 bytes unspecified. The
2548
+ test framework will only compare the 4 relavent bytes. */
2549
+ ANON (union float_int_t, float_int, X7, 15)
2550
+ LAST_ANON (long long, 12683143434LL, STACK + 8, 16)
2552
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c
2553
===================================================================
2554
--- a/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../tags/gcc_4_8_3_release)
2555
+++ b/src/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c (.../branches/gcc-4_8-branch)
2557
+/* Test AAPCS64 layout and __builtin_va_start.
2559
+ Pass named __128int argument on stack. */
2561
+/* { dg-do run { target aarch64*-*-* } } */
2563
+#ifndef IN_FRAMEWORK
2564
+#define AAPCS64_TEST_STDARG
2565
+#define TESTFILE "va_arg-15.c"
2566
+#include "type-def.h"
2568
+union int128_t qword;
2570
+#define HAS_DATA_INIT_FUNC
2574
+ /* Init signed quad-word integer. */
2575
+ qword.l64 = 0xfdb9753102468aceLL;
2576
+ qword.h64 = 0xeca8642013579bdfLL;
2579
+#include "abitest.h"
2581
+ ARG (int, 1, W0, 0)
2582
+ ARG (int, 2, W1, 1)
2583
+ ARG (int, 3, W2, 2)
2584
+ ARG (int, 4, W3, 3)
2585
+ ARG (int, 5, W4, 4)
2586
+ ARG (int, 6, W5, 5)
2587
+ ARG (int, 7, W6, 6)
2588
+ ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID)
2590
+#ifndef __AAPCS64_BIG_ENDIAN__
2591
+ LAST_ANON (int, 8, STACK + 16, 8)
2593
+ LAST_ANON (int, 8, STACK + 20, 8)
2596
Index: gcc/testsuite/gcc.target/avr/torture/pr61443.c
2597
===================================================================
2598
--- a/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../tags/gcc_4_8_3_release)
2599
+++ b/src/gcc/testsuite/gcc.target/avr/torture/pr61443.c (.../branches/gcc-4_8-branch)
2601
+/* { dg-do run } */
2602
+/* { dg-options "-std=gnu99" } */
2604
+#include <stdlib.h>
2605
+#include <stdarg.h>
2607
+#define NC __attribute__((noinline,noclone))
2609
+void NC vfun (char n, ...)
2620
+ if (11 != va_arg (ap, int))
2624
+ if (2222 != va_arg (ap, int))
2628
+ if (333333 != va_arg (ap, __int24))
2632
+ if (44444444 != va_arg (ap, long))
2636
+ if (8888888888888888 != va_arg (ap, long long))
2645
+void NC boo_qi (const __flash char *p)
2650
+void NC boox_qi (const __memx char *p)
2655
+void NC boo_hi (const __flash int *p)
2660
+void NC boox_hi (const __memx int *p)
2665
+void NC boo_psi (const __flash __int24 *p)
2670
+void NC boox_psi (const __memx __int24 *p)
2675
+void NC boo_si (const __flash long *p)
2680
+void NC boox_si (const __memx long *p)
2685
+void NC boo_di (const __flash long long *p)
2690
+void NC boox_di (const __memx long long *p)
2695
+const __flash char f_qi = 11;
2696
+const __flash int f_hi = 2222;
2697
+const __flash __int24 f_psi = 333333;
2698
+const __flash long f_si = 44444444;
2699
+const __flash long long f_di = 8888888888888888;
2701
+const __memx char x_qi = 11;
2702
+const __memx int x_hi = 2222;
2703
+const __memx __int24 x_psi = 333333;
2704
+const __memx long x_si = 44444444;
2705
+const __memx long long x_di = 8888888888888888;
2709
+__int24 r_psi = 333333;
2710
+long r_si = 44444444;
2711
+long long r_di = 8888888888888888;
2723
+ boox_psi (&x_psi);
2729
+ boox_psi (&r_psi);
2735
Index: gcc/testsuite/gcc.target/i386/pr61923.c
2736
===================================================================
2737
--- a/src/gcc/testsuite/gcc.target/i386/pr61923.c (.../tags/gcc_4_8_3_release)
2738
+++ b/src/gcc/testsuite/gcc.target/i386/pr61923.c (.../branches/gcc-4_8-branch)
2740
+/* PR debug/61923 */
2741
+/* { dg-do compile } */
2742
+/* { dg-options "-O2 -fcompare-debug" } */
2754
+struct ext4_map_blocks
2760
+int ext4_da_map_blocks_ei_0;
2761
+void fn1 (int p1, struct ext4_map_blocks *p2)
2766
+ ext4_da_map_blocks_ei_0++;
2767
+ arch_spinlock_t *lock;
2768
+ switch (sizeof *&lock->tickets.head)
2770
+ asm("" : "+m"(*&lock->tickets.head) : ""(0));
2774
+ fn2 (p2->m_lblk, p2->m_len);
2776
Index: gcc/testsuite/gcc.target/i386/pr61423.c
2777
===================================================================
2778
--- a/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../tags/gcc_4_8_3_release)
2779
+++ b/src/gcc/testsuite/gcc.target/i386/pr61423.c (.../branches/gcc-4_8-branch)
2781
+/* PR target/61423 */
2782
+/* { dg-do run { target ia32 } } */
2783
+/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */
2786
+static unsigned int A[N];
2789
+__attribute__((noinline))
2792
+ unsigned int sum = 0;
2796
+ for (i = 0; i < N; i++)
2809
+ for(i = 0; i < N; i++)
2815
+ __builtin_abort ();
2819
Index: gcc/testsuite/gcc.target/i386/pr60901.c
2820
===================================================================
2821
--- a/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../tags/gcc_4_8_3_release)
2822
+++ b/src/gcc/testsuite/gcc.target/i386/pr60901.c (.../branches/gcc-4_8-branch)
2824
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts" } */
2827
+extern void bar (void);
2828
+extern int baz (int);
2834
+ for (j = 0; j < n; j++)
2836
+ for (i = 1; i < j; i++)
2841
Index: gcc/testsuite/gcc.target/i386/pr61801.c
2842
===================================================================
2843
--- a/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../tags/gcc_4_8_3_release)
2844
+++ b/src/gcc/testsuite/gcc.target/i386/pr61801.c (.../branches/gcc-4_8-branch)
2846
+/* PR rtl-optimization/61801 */
2847
+/* { dg-do compile } */
2848
+/* { dg-options "-Os -fcompare-debug" } */
2862
+ asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
2867
Index: gcc/testsuite/gcc.target/i386/pr61446.c
2868
===================================================================
2869
--- a/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../tags/gcc_4_8_3_release)
2870
+++ b/src/gcc/testsuite/gcc.target/i386/pr61446.c (.../branches/gcc-4_8-branch)
2872
+/* PR rtl-optimization/61446 */
2874
+/* { dg-do compile { target { ia32 } } } */
2875
+/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */
2880
+ const double dfa = a;
2881
+ const unsigned int hi = dfa / 0x1p32f;
2882
+ const unsigned int lo = dfa - (double) hi * 0x1p32f;
2884
+ return ((unsigned long long) hi << (4 * (8))) | lo;
2886
Index: gcc/testsuite/gcc.target/mips/pr62030-octeon.c
2887
===================================================================
2888
--- a/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c (.../tags/gcc_4_8_3_release)
2889
+++ b/src/gcc/testsuite/gcc.target/mips/pr62030-octeon.c (.../branches/gcc-4_8-branch)
2891
+/* { dg-do run } */
2892
+/* { dg-options "-march=octeon" } */
2894
+extern void abort (void);
2898
+ struct node *next;
2899
+ struct node *prev;
2906
+ struct node *first;
2909
+struct head heads[5];
2913
+struct head *head = &heads[2];
2915
+static int __attribute__((noinline))
2918
+ node.prev = (void *)head;
2919
+ head->first = &node;
2921
+ struct node *n = head->first;
2922
+ struct head *h = &heads[k];
2923
+ struct node *next = n->next;
2925
+ if (n->prev == (void *)h)
2928
+ n->prev->next = next;
2930
+ n->next = h->first;
2931
+ return n->next == &node;
2941
Index: gcc/testsuite/gcc.target/sh/pr61996.c
2942
===================================================================
2943
--- a/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../tags/gcc_4_8_3_release)
2944
+++ b/src/gcc/testsuite/gcc.target/sh/pr61996.c (.../branches/gcc-4_8-branch)
2946
+/* Check that the option -musermode has no effect on targets that do not
2947
+ support user/privileged mode and that it does not interfere with option
2948
+ -matomic-model=soft-imask. */
2949
+/* { dg-do compile } */
2950
+/* { dg-options "-matomic-model=soft-imask" } */
2951
+/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } } */
2958
Index: gcc/testsuite/lib/target-supports.exp
2959
===================================================================
2960
--- a/src/gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_8_3_release)
2961
+++ b/src/gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_8-branch)
2962
@@ -1790,6 +1790,15 @@
2966
+# Return 1 if the target supports long double of 128 bits,
2969
+proc check_effective_target_longdouble128 { } {
2970
+ return [check_no_compiler_messages longdouble128 object {
2971
+ int dummy[sizeof(long double) == 16 ? 1 : -1];
2975
# Return 1 if the target supports double of 64 bits,
2978
Index: gcc/testsuite/gfortran.dg/default_format_denormal_2.f90
2979
===================================================================
2980
--- a/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../tags/gcc_4_8_3_release)
2981
+++ b/src/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 (.../branches/gcc-4_8-branch)
2983
! { dg-require-effective-target fortran_large_real }
2984
-! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } }
2985
-! Test XFAILed on these platforms because the system's printf() lacks
2986
+! { dg-do run { xfail powerpc*-apple-darwin* } }
2987
+! Test XFAILed on this platform because the system's printf() lacks
2988
! proper support for denormalized long doubles. See PR24685
2990
! This tests that the default formats for formatted I/O of reals are
2991
Index: gcc/testsuite/gfortran.dg/dot_product_3.f90
2992
===================================================================
2993
--- a/src/gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../tags/gcc_4_8_3_release)
2994
+++ b/src/gcc/testsuite/gfortran.dg/dot_product_3.f90 (.../branches/gcc-4_8-branch)
2996
+! { dg-do compile }
2997
+! { dg-options "-fdump-tree-original" }
2998
+! PR 61999 - this used to ICE.
2999
+! Original test case by A. Kasahara
3001
+ use, intrinsic:: iso_fortran_env, only: output_unit
3005
+ write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
3009
+! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
3010
+! { dg-final { cleanup-tree-dump "original" } }
3011
Index: gcc/testsuite/gfortran.dg/cray_pointers_10.f90
3012
===================================================================
3013
--- a/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../tags/gcc_4_8_3_release)
3014
+++ b/src/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 (.../branches/gcc-4_8-branch)
3017
+! { dg-options "-fcray-pointer" }
3032
+ if (z /= 42) call abort
3034
Index: gcc/testsuite/gfortran.dg/dependency_44.f90
3035
===================================================================
3036
--- a/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../tags/gcc_4_8_3_release)
3037
+++ b/src/gcc/testsuite/gfortran.dg/dependency_44.f90 (.../branches/gcc-4_8-branch)
3040
+! Tests fix for PR61780 in which the loop reversal mechanism was
3041
+! not accounting for the first index being an element so that no
3042
+! loop in this dimension is created.
3044
+! Contributed by Manfred Tietze on clf.
3048
+ integer, parameter :: n = 10, k = 3
3050
+ integer, dimension(n,n) :: y
3051
+ integer :: res1(n), res2(n)
3064
+ y(k,4:n) = y(k,3:n-1)
3068
+ y(k,n:4:-1) = y(k,n-1:3:-1)
3073
+ if (any(res1 /= res2)) call abort ()
3075
Index: gcc/testsuite/gfortran.dg/oldstyle_5.f
3076
===================================================================
3077
--- a/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../tags/gcc_4_8_3_release)
3078
+++ b/src/gcc/testsuite/gfortran.dg/oldstyle_5.f (.../branches/gcc-4_8-branch)
3080
+C { dg-do compile }
3082
+ INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" }
3085
+ INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" }
3088
Index: gcc/testsuite/gfortran.dg/nint_2.f90
3089
===================================================================
3090
--- a/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../tags/gcc_4_8_3_release)
3091
+++ b/src/gcc/testsuite/gfortran.dg/nint_2.f90 (.../branches/gcc-4_8-branch)
3093
! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html
3096
-! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } }
3097
+! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } }
3098
+! Note that this doesn't fail on powerpc64le-*-linux*.
3100
integer(kind=8) :: i1, i2
3102
Index: gcc/testsuite/gfortran.dg/pointer_intent_7.f90
3103
===================================================================
3104
--- a/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 (.../tags/gcc_4_8_3_release)
3105
+++ b/src/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 (.../branches/gcc-4_8-branch)
3109
call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
3110
- call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
3111
+ call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
3112
call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
3113
call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
3115
Index: gcc/testsuite/gfortran.dg/array_assignment_5.f90
3116
===================================================================
3117
--- a/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90 (.../tags/gcc_4_8_3_release)
3118
+++ b/src/gcc/testsuite/gfortran.dg/array_assignment_5.f90 (.../branches/gcc-4_8-branch)
3121
+! { dg-options "-ffrontend-optimize" }
3122
+! PR 62214 - this used to give the wrong result.
3123
+! Original test case by Oliver Fuhrer
3126
+ CHARACTER(LEN=20) :: fullNames(2)
3127
+ CHARACTER(LEN=255) :: pathName
3128
+ CHARACTER(LEN=5) :: fileNames(2)
3130
+ pathName = "/dir1/dir2/"
3131
+ fileNames = (/ "file1", "file2" /)
3132
+ fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
3133
+ if (fullNames(1) /= '/dir1/dir2/file1' .or. &
3134
+ & fullnames(2) /= '/dir1/dir2/file2') call abort
3136
Index: gcc/testsuite/gfortran.dg/pr45636.f90
3137
===================================================================
3138
--- a/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../tags/gcc_4_8_3_release)
3139
+++ b/src/gcc/testsuite/gfortran.dg/pr45636.f90 (.../branches/gcc-4_8-branch)
3144
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
3145
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
3146
! { dg-final { cleanup-tree-dump "forwprop2" } }
3147
Index: gcc/testsuite/gfortran.dg/allocatable_function_8.f90
3148
===================================================================
3149
--- a/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../tags/gcc_4_8_3_release)
3150
+++ b/src/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 (.../branches/gcc-4_8-branch)
3153
+! Test the fix for PR61459.
3155
+! Contributed by John Wingate <johnww@tds.net>
3161
+ public :: f_segfault, f_segfault_plus, f_workaround
3162
+ integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2])
3166
+ function f_segfault(x)
3167
+ real, dimension(:), allocatable :: f_segfault
3168
+ real, dimension(:), intent(in) :: x
3169
+ allocate(f_segfault(2))
3170
+ f_segfault = matmul(b,x)
3171
+ end function f_segfault
3173
+! Sefaulted without the ALLOCATE as well.
3174
+ function f_segfault_plus(x)
3175
+ real, dimension(:), allocatable :: f_segfault_plus
3176
+ real, dimension(:), intent(in) :: x
3177
+ f_segfault_plus = matmul(b,x)
3178
+ end function f_segfault_plus
3180
+ function f_workaround(x)
3181
+ real, dimension(:), allocatable :: f_workaround
3182
+ real, dimension(:), intent(in) :: x
3183
+ real, dimension(:), allocatable :: tmp
3184
+ allocate(f_workaround(2),tmp(2))
3186
+ f_workaround = tmp
3187
+ end function f_workaround
3194
+ real, dimension(2) :: x = 1.0, y
3195
+ y = f_workaround (x)
3196
+ if (any (f_segfault (x) .ne. y)) call abort
3197
+ if (any (f_segfault_plus (x) .ne. y)) call abort
3199
Index: gcc/testsuite/gfortran.dg/bessel_7.f90
3200
===================================================================
3201
--- a/src/gcc/testsuite/gfortran.dg/bessel_7.f90 (.../tags/gcc_4_8_3_release)
3202
+++ b/src/gcc/testsuite/gfortran.dg/bessel_7.f90 (.../branches/gcc-4_8-branch)
3205
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]
3206
real,parameter :: myeps(size(values)) = epsilon(0.0) &
3207
- * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
3208
+ * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
3209
! The following is sufficient for me - the values above are a bit
3211
! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
3212
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-1.c
3213
===================================================================
3214
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../tags/gcc_4_8_3_release)
3215
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c (.../branches/gcc-4_8-branch)
3217
+#ifdef __INT32_TYPE__
3218
+typedef __INT32_TYPE__ int32_t;
3220
+typedef int int32_t;
3223
+#ifdef __UINT32_TYPE__
3224
+typedef __UINT32_TYPE__ uint32_t;
3226
+typedef unsigned uint32_t;
3229
+#define __fake_const_swab32(x) ((uint32_t)( \
3230
+ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
3231
+ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
3232
+ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
3233
+ (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24)))
3235
+/* Previous version of bswap optimization failed to consider sign extension
3236
+ and as a result would replace an expression *not* doing a bswap by a
3239
+__attribute__ ((noinline, noclone)) uint32_t
3240
+fake_bswap32 (uint32_t in)
3242
+ return __fake_const_swab32 (in);
3248
+ if (sizeof (int32_t) * __CHAR_BIT__ != 32)
3250
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
3252
+ if (fake_bswap32 (0x87654321) != 0xffffff87)
3253
+ __builtin_abort ();
3256
Index: gcc/testsuite/gcc.c-torture/execute/pr23135.x
3257
===================================================================
3258
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../tags/gcc_4_8_3_release)
3259
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr23135.x (.../branches/gcc-4_8-branch)
3261
+set additional_flags "-Wno-psabi"
3263
Index: gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
3264
===================================================================
3265
--- a/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c (.../tags/gcc_4_8_3_release)
3266
+++ b/src/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c (.../branches/gcc-4_8-branch)
3274
+static union U u = { 0x12345678 };
3276
+/* Constant folding used to fail to account for endianness when folding a
3282
+#ifdef __BYTE_ORDER__
3283
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
3284
+ return u.b - 0x45678;
3286
+ return u.b - 0x12345;
3291
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-3.c
3292
===================================================================
3293
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../tags/gcc_4_8_3_release)
3294
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c (.../branches/gcc-4_8-branch)
3306
+ __builtin_abort ();
3309
Index: gcc/testsuite/gcc.c-torture/execute/20050604-1.x
3310
===================================================================
3311
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../tags/gcc_4_8_3_release)
3312
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050604-1.x (.../branches/gcc-4_8-branch)
3314
set additional_flags "-mno-mmx"
3317
+set additional_flags "-Wno-psabi"
3319
Index: gcc/testsuite/gcc.c-torture/execute/pr61306-2.c
3320
===================================================================
3321
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../tags/gcc_4_8_3_release)
3322
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c (.../branches/gcc-4_8-branch)
3324
+#ifdef __INT16_TYPE__
3325
+typedef __INT16_TYPE__ int16_t;
3327
+typedef short int16_t;
3330
+#ifdef __UINT32_TYPE__
3331
+typedef __UINT32_TYPE__ uint32_t;
3333
+typedef unsigned uint32_t;
3336
+#define __fake_const_swab32(x) ((uint32_t)( \
3337
+ (((uint32_t) (x) & (uint32_t)0x000000ffUL) << 24) | \
3338
+ (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) << 8) | \
3339
+ (((uint32_t) (x) & (uint32_t)0x00ff0000UL) >> 8) | \
3340
+ (((uint32_t) (x) & (uint32_t)0xff000000UL) >> 24)))
3343
+/* Previous version of bswap optimization failed to consider sign extension
3344
+ and as a result would replace an expression *not* doing a bswap by a
3347
+__attribute__ ((noinline, noclone)) uint32_t
3348
+fake_bswap32 (uint32_t in)
3350
+ return __fake_const_swab32 (in);
3356
+ if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
3358
+ if (sizeof (int16_t) * __CHAR_BIT__ != 16)
3360
+ if (fake_bswap32 (0x81828384) != 0xff838281)
3361
+ __builtin_abort ();
3364
Index: gcc/testsuite/gcc.c-torture/execute/pr61375.c
3365
===================================================================
3366
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../tags/gcc_4_8_3_release)
3367
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr61375.c (.../branches/gcc-4_8-branch)
3369
+#ifdef __UINT64_TYPE__
3370
+typedef __UINT64_TYPE__ uint64_t;
3372
+typedef unsigned long long uint64_t;
3375
+#ifndef __SIZEOF_INT128__
3376
+#define __int128 long long
3379
+/* Some version of bswap optimization would ICE when analyzing a mask constant
3380
+ too big for an HOST_WIDE_INT (PR61375). */
3382
+__attribute__ ((noinline, noclone)) uint64_t
3383
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
3385
+ __int128 mask = (__int128)0xffff << 56;
3386
+ return ((in1 & mask) >> 56) | in2;
3393
+#ifdef __SIZEOF_INT128__
3396
+ if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
3398
+ if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
3400
+ if (uint128_central_bitsi_ior (in, 2) != 0x102)
3401
+ __builtin_abort ();
3404
Index: gcc/testsuite/gcc.c-torture/execute/20050316-1.x
3405
===================================================================
3406
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../tags/gcc_4_8_3_release)
3407
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-1.x (.../branches/gcc-4_8-branch)
3412
+set additional_flags "-Wno-psabi"
3414
Index: gcc/testsuite/gcc.c-torture/execute/20050316-3.x
3415
===================================================================
3416
--- a/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../tags/gcc_4_8_3_release)
3417
+++ b/src/gcc/testsuite/gcc.c-torture/execute/20050316-3.x (.../branches/gcc-4_8-branch)
3419
+set additional_flags "-Wno-psabi"
3421
Index: gcc/testsuite/gcc.c-torture/compile/pr61684.c
3422
===================================================================
3423
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../tags/gcc_4_8_3_release)
3424
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr61684.c (.../branches/gcc-4_8-branch)
3426
+/* PR tree-optimization/61684 */
3431
+static short **e = 0;
3436
+ for (; c < 1; c++)
3439
+ a = d && (c && 1) & *b;
3441
Index: gcc/testsuite/gcc.c-torture/compile/pr63282.c
3442
===================================================================
3443
--- a/src/gcc/testsuite/gcc.c-torture/compile/pr63282.c (.../tags/gcc_4_8_3_release)
3444
+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr63282.c (.../branches/gcc-4_8-branch)
3446
+/* PR inline-asm/63282 */
3453
+ asm volatile goto ("" : : : : a, b);
3459
Index: gcc/testsuite/gnat.dg/opt39.adb
3460
===================================================================
3461
--- a/src/gcc/testsuite/gnat.dg/opt39.adb (.../tags/gcc_4_8_3_release)
3462
+++ b/src/gcc/testsuite/gnat.dg/opt39.adb (.../branches/gcc-4_8-branch)
3464
+-- { dg-do compile }
3465
+-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }
3467
+procedure Opt39 (I : Integer) is
3469
+ type Rec is record
3477
+ procedure Set (A : access Rec; I : Integer) is
3478
+ Tmp : Rec := A.all;
3487
+ Set (R'Access, I);
3489
+ raise Program_Error;
3493
+-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
3494
+-- { dg-final { cleanup-tree-dump "optimized" } }
3495
Index: gcc/testsuite/gnat.dg/overflow_fixed.adb
3496
===================================================================
3497
--- a/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../tags/gcc_4_8_3_release)
3498
+++ b/src/gcc/testsuite/gnat.dg/overflow_fixed.adb (.../branches/gcc-4_8-branch)
3501
+-- { dg-options "-gnato -O" }
3503
+procedure Overflow_Fixed is
3505
+ type Unsigned_8_Bit is mod 2**8;
3507
+ procedure Fixed_To_Eight (Value : Duration) is
3508
+ Item : Unsigned_8_Bit;
3510
+ Item := Unsigned_8_Bit(Value);
3511
+ raise Program_Error;
3513
+ when Constraint_Error => null; -- expected case
3517
+ Fixed_To_Eight (-0.5);
3519
Index: gcc/testsuite/gnat.dg/aliasing1.adb
3520
===================================================================
3521
--- a/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../tags/gcc_4_8_3_release)
3522
+++ b/src/gcc/testsuite/gnat.dg/aliasing1.adb (.../branches/gcc-4_8-branch)
3527
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
3528
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
3529
-- { dg-final { cleanup-tree-dump "optimized" } }
3530
Index: gcc/testsuite/gcc.dg/pr60866.c
3531
===================================================================
3532
--- a/src/gcc/testsuite/gcc.dg/pr60866.c (.../tags/gcc_4_8_3_release)
3533
+++ b/src/gcc/testsuite/gcc.dg/pr60866.c (.../branches/gcc-4_8-branch)
3535
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
3536
+/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns" } */
3541
+foo (int w, int **dnroot, int **dn)
3544
+ int *xchild = xchild;
3545
+ for (; w < n; w++)
3549
+ for (child = *dn; child; child = xchild)
3553
Index: gcc/testsuite/gcc.dg/pr63284.c
3554
===================================================================
3555
--- a/src/gcc/testsuite/gcc.dg/pr63284.c (.../tags/gcc_4_8_3_release)
3556
+++ b/src/gcc/testsuite/gcc.dg/pr63284.c (.../branches/gcc-4_8-branch)
3558
+/* PR debug/63284 */
3559
+/* { dg-do compile } */
3560
+/* { dg-options "-O2 -fcompare-debug" } */
3562
+int a[10], *b, *d, c, f;
3600
Index: gcc/testsuite/gcc.dg/pr61045.c
3601
===================================================================
3602
--- a/src/gcc/testsuite/gcc.dg/pr61045.c (.../tags/gcc_4_8_3_release)
3603
+++ b/src/gcc/testsuite/gcc.dg/pr61045.c (.../branches/gcc-4_8-branch)
3605
+/* { dg-do run } */
3606
+/* { dg-options "-fstrict-overflow" } */
3611
+ int b = __INT_MAX__;
3612
+ int t = (a - 2) > (b - 1);
3614
+ __builtin_abort();
3617
Index: gcc/testsuite/gcc.dg/pr62004.c
3618
===================================================================
3619
--- a/src/gcc/testsuite/gcc.dg/pr62004.c (.../tags/gcc_4_8_3_release)
3620
+++ b/src/gcc/testsuite/gcc.dg/pr62004.c (.../branches/gcc-4_8-branch)
3622
+/* { dg-do run } */
3623
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
3627
+ struct node *next;
3628
+ struct node *prev;
3635
+ struct node *first;
3638
+struct head heads[5];
3642
+struct head *head = &heads[2];
3649
+ node.next = (void*)0;
3651
+ node.prev = (void *)head;
3653
+ head->first = &node;
3655
+ struct node *n = head->first;
3657
+ struct head *h = &heads[k];
3659
+ heads[2].first = n->next;
3661
+ if ((void*)n->prev == (void *)h)
3664
+ /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */
3665
+ p = n->prev->next;
3667
+ return !(p == (void*)0);
3669
Index: gcc/testsuite/gcc.dg/pr51879-18.c
3670
===================================================================
3671
--- a/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../tags/gcc_4_8_3_release)
3672
+++ b/src/gcc/testsuite/gcc.dg/pr51879-18.c (.../branches/gcc-4_8-branch)
3677
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
3678
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
3679
/* { dg-final { cleanup-tree-dump "pre" } } */
3680
Index: gcc/testsuite/gcc.dg/torture/pr61964.c
3681
===================================================================
3682
--- a/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../tags/gcc_4_8_3_release)
3683
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61964.c (.../branches/gcc-4_8-branch)
3685
+/* { dg-do run } */
3687
+extern void abort (void);
3689
+struct node { struct node *next, *prev; } node;
3690
+struct head { struct node *first; } heads[5];
3692
+struct head *head = &heads[2];
3694
+static int __attribute__((noinline))
3697
+ node.prev = (void *)head;
3698
+ head->first = &node;
3700
+ struct node *n = head->first;
3701
+ struct head *h = &heads[k];
3703
+ if (n->prev == (void *)h)
3704
+ h->first = n->next;
3706
+ n->prev->next = n->next;
3708
+ n->next = h->first;
3709
+ return n->next == &node;
3718
Index: gcc/testsuite/gcc.dg/torture/pr61010.c
3719
===================================================================
3720
--- a/src/gcc/testsuite/gcc.dg/torture/pr61010.c (.../tags/gcc_4_8_3_release)
3721
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61010.c (.../branches/gcc-4_8-branch)
3723
+/* { dg-do compile } */
3728
+ unsigned b = (a * 64 & 192) | 63U;
3731
Index: gcc/testsuite/gcc.dg/torture/pr61452.c
3732
===================================================================
3733
--- a/src/gcc/testsuite/gcc.dg/torture/pr61452.c (.../tags/gcc_4_8_3_release)
3734
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61452.c (.../branches/gcc-4_8-branch)
3736
+/* { dg-do run } */
3743
+fn1 (int p1, char p2)
3745
+ return p1 || p2 ? 0 : p2;
3756
+ b = fn1 (g = d = e, g);
3767
Index: gcc/testsuite/gcc.dg/torture/pr61383-1.c
3768
===================================================================
3769
--- a/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../tags/gcc_4_8_3_release)
3770
+++ b/src/gcc/testsuite/gcc.dg/torture/pr61383-1.c (.../branches/gcc-4_8-branch)
3772
+/* { dg-do run } */
3774
+int a, b = 1, c, d, e, f, g;
3783
+ g = g ? 0 : 1 % g;
3785
+ for (; d < 1; d = e)
3807
Index: gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c
3808
===================================================================
3809
--- a/src/gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c (.../tags/gcc_4_8_3_release)
3810
+++ b/src/gcc/testsuite/gcc.dg/torture/float128-exact-underflow.c (.../branches/gcc-4_8-branch)
3812
+/* Test that exact underflow in __float128 signals the underflow
3813
+ exception if trapping is enabled, but does not raise the flag
3816
+/* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* } } */
3817
+/* { dg-options "-D_GNU_SOURCE" } */
3818
+/* { dg-require-effective-target fenv_exceptions } */
3821
+#include <setjmp.h>
3822
+#include <signal.h>
3823
+#include <stdlib.h>
3825
+volatile sig_atomic_t caught_sigfpe;
3829
+handle_sigfpe (int sig)
3831
+ caught_sigfpe = 1;
3832
+ siglongjmp (buf, 1);
3838
+ volatile __float128 a = 0x1p-16382q, b = 0x1p-2q;
3839
+ volatile __float128 r;
3841
+ if (fetestexcept (FE_UNDERFLOW))
3843
+ if (r != 0x1p-16384q)
3845
+ feenableexcept (FE_UNDERFLOW);
3846
+ signal (SIGFPE, handle_sigfpe);
3847
+ if (sigsetjmp (buf, 1) == 0)
3849
+ if (!caught_sigfpe)
3853
Index: gcc/testsuite/gcc.dg/stack-usage-2.c
3854
===================================================================
3855
--- a/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../tags/gcc_4_8_3_release)
3856
+++ b/src/gcc/testsuite/gcc.dg/stack-usage-2.c (.../branches/gcc-4_8-branch)
3858
/* { dg-do compile } */
3859
/* { dg-options "-Wstack-usage=512" } */
3862
+int foo1 (void) /* { dg-bogus "stack usage" } */
3867
-} /* { dg-bogus "stack usage" } */
3871
+int foo2 (void) /* { dg-warning "stack usage is \[0-9\]* bytes" } */
3876
-} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
3880
+int foo3 (void) /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
3882
char arr[1024] __attribute__((aligned (512)));
3885
/* Force dynamic realignment of argument pointer. */
3886
__builtin_apply ((void (*)()) foo2, 0, 0);
3890
-} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
3893
+int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
3898
-} /* { dg-warning "stack usage might be unbounded" } */
3900
Index: gcc/testsuite/gcc.dg/ipa/pr61986.c
3901
===================================================================
3902
--- a/src/gcc/testsuite/gcc.dg/ipa/pr61986.c (.../tags/gcc_4_8_3_release)
3903
+++ b/src/gcc/testsuite/gcc.dg/ipa/pr61986.c (.../branches/gcc-4_8-branch)
3905
+/* { dg-do compile } */
3906
+/* { dg-options "-O3" } */
3916
+static int fn2 (struct S);
3917
+void fn3 (struct S);
3922
+ struct S h = { 0, 0 };
3930
+ struct S j = { 0, 0 };
3949
+ struct S f = { 0, 0 };
3953
Index: gcc/testsuite/gcc.dg/pr62030.c
3954
===================================================================
3955
--- a/src/gcc/testsuite/gcc.dg/pr62030.c (.../tags/gcc_4_8_3_release)
3956
+++ b/src/gcc/testsuite/gcc.dg/pr62030.c (.../branches/gcc-4_8-branch)
3958
+/* { dg-do run } */
3959
+/* { dg-options "-O2" } */
3961
+extern void abort (void);
3965
+ struct node *next;
3966
+ struct node *prev;
3973
+ struct node *first;
3976
+struct head heads[5];
3980
+struct head *head = &heads[2];
3982
+static int __attribute__((noinline))
3985
+ node.prev = (void *)head;
3986
+ head->first = &node;
3988
+ struct node *n = head->first;
3989
+ struct head *h = &heads[k];
3990
+ struct node *next = n->next;
3992
+ if (n->prev == (void *)h)
3995
+ n->prev->next = next;
3997
+ n->next = h->first;
3998
+ return n->next == &node;
4008
Index: gcc/testsuite/gcc.dg/vect/pr63341-2.c
4009
===================================================================
4010
--- a/src/gcc/testsuite/gcc.dg/vect/pr63341-2.c (.../tags/gcc_4_8_3_release)
4011
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63341-2.c (.../branches/gcc-4_8-branch)
4013
+/* PR tree-optimization/63341 */
4014
+/* { dg-do run } */
4016
+#include "tree-vect.h"
4018
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
4019
+struct S { char e __attribute__((aligned (64))); U s[32]; };
4020
+struct S t = {0, {{0x5010}, {0x5111}, {0x5212}, {0x5313}, {0x5414}, {0x5515}, {0x5616}, {0x5717},
4021
+ {0x5818}, {0x5919}, {0x5a1a}, {0x5b1b}, {0x5c1c}, {0x5d1d}, {0x5e1e}, {0x5f1f},
4022
+ {0x6020}, {0x6121}, {0x6222}, {0x6323}, {0x6424}, {0x6525}, {0x6626}, {0x6727},
4023
+ {0x6828}, {0x6929}, {0x6a2a}, {0x6b2b}, {0x6c2c}, {0x6d2d}, {0x6e2e}, {0x6f2f}}};
4024
+unsigned short d[32] = { 1 };
4026
+__attribute__((noinline, noclone)) void
4030
+ for (i = 0; i < 32; i++)
4031
+ d[i] = t.s[i].s + 4;
4032
+ for (i = 0; i < 32; i++)
4033
+ if (d[i] != t.s[i].s + 4)
4036
+ asm volatile ("" : : : "memory");
4047
+/* { dg-final { cleanup-tree-dump "vect" } } */
4048
Index: gcc/testsuite/gcc.dg/vect/pr63189.c
4049
===================================================================
4050
--- a/src/gcc/testsuite/gcc.dg/vect/pr63189.c (.../tags/gcc_4_8_3_release)
4051
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63189.c (.../branches/gcc-4_8-branch)
4053
+/* PR tree-optimization/63189 */
4054
+/* { dg-do run } */
4056
+#include "tree-vect.h"
4058
+short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
4060
+__attribute__((noinline, noclone)) void
4064
+ for (j = 0; j < 8; j++)
4078
+/* { dg-final { cleanup-tree-dump "vect" } } */
4079
Index: gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
4080
===================================================================
4081
--- a/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c (.../tags/gcc_4_8_3_release)
4082
+++ b/src/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c (.../branches/gcc-4_8-branch)
4084
+/* { dg-require-effective-target vect_int } */
4086
+#include <stdarg.h>
4087
+#include "tree-vect.h"
4092
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
4093
+signed int Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
4095
+/* (short, int)->int->int dot product.
4096
+ Not detected as a dot-product pattern. */
4098
+__attribute__ ((noinline)) int
4104
+ for (i = 0; i < len; i++)
4106
+ result += (X[i] * Y[i]);
4112
+/* (int, short)->int->int dot product.
4113
+ Not detected as a dot-product pattern. */
4115
+__attribute__ ((noinline)) int
4121
+ for (i = 0; i < len; i++)
4123
+ result += (Y[i] * X[i]);
4136
+ for (i = 0; i < N; i++)
4140
+ __asm__ volatile ("");
4154
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
4155
+/* { dg-final { cleanup-tree-dump "vect" } } */
4157
Index: gcc/testsuite/gcc.dg/vect/pr62073.c
4158
===================================================================
4159
--- a/src/gcc/testsuite/gcc.dg/vect/pr62073.c (.../tags/gcc_4_8_3_release)
4160
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62073.c (.../branches/gcc-4_8-branch)
4162
+/* { dg-do compile } */
4163
+/* { dg-additional-options "-O1" } */
4173
+int foo (long long p_56, int * p_57)
4180
+ int **l_78 = &l_77;
4185
+ for (g_76 = 1; g_76 >= 0; g_76--)
4188
+ for (l_101 = 4; l_101 >= 0; l_101--)
4193
+ int **l_113 = &l_77;
4201
+/* { dg-final { cleanup-tree-dump "vect" } } */
4202
Index: gcc/testsuite/gcc.dg/vect/pr60196-1.c
4203
===================================================================
4204
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../tags/gcc_4_8_3_release)
4205
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-1.c (.../branches/gcc-4_8-branch)
4207
+/* PR tree-optimization/63189 */
4208
+/* { dg-additional-options "-fwrapv" } */
4209
+/* { dg-do run } */
4211
+#include "tree-vect.h"
4213
+__attribute__((noinline, noclone)) static int
4214
+bar (const short *a, int len)
4219
+ for (x = 0; x < len; x++)
4224
+__attribute__((noinline, noclone)) void
4227
+ short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
4228
+ if (bar (stuff, 9) != 36)
4240
+/* { dg-final { cleanup-tree-dump "vect" } } */
4241
Index: gcc/testsuite/gcc.dg/vect/pr62075.c
4242
===================================================================
4243
--- a/src/gcc/testsuite/gcc.dg/vect/pr62075.c (.../tags/gcc_4_8_3_release)
4244
+++ b/src/gcc/testsuite/gcc.dg/vect/pr62075.c (.../branches/gcc-4_8-branch)
4246
+/* { dg-do compile } */
4259
+ for (i = 0; i < 16; ++i)
4261
+ x->b[i][0] = a[i][0];
4262
+ x->c[i][0] = 0 != a[i][0];
4263
+ x->b[i][1] = a[i][1];
4267
+/* { dg-final { cleanup-tree-dump "vect" } } */
4268
Index: gcc/testsuite/gcc.dg/vect/pr60196-2.c
4269
===================================================================
4270
--- a/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../tags/gcc_4_8_3_release)
4271
+++ b/src/gcc/testsuite/gcc.dg/vect/pr60196-2.c (.../branches/gcc-4_8-branch)
4273
+/* PR tree-optimization/63189 */
4274
+/* { dg-do run } */
4276
+#include "tree-vect.h"
4278
+static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
4279
+static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
4281
+__attribute__((noinline, noclone)) static int
4285
+ for (i = 0; i < 8; ++i)
4286
+ sum += a[i] * b[i];
4290
+__attribute__((noinline, noclone)) void
4305
+/* { dg-final { cleanup-tree-dump "vect" } } */
4306
Index: gcc/testsuite/gcc.dg/vect/pr63341-1.c
4307
===================================================================
4308
--- a/src/gcc/testsuite/gcc.dg/vect/pr63341-1.c (.../tags/gcc_4_8_3_release)
4309
+++ b/src/gcc/testsuite/gcc.dg/vect/pr63341-1.c (.../branches/gcc-4_8-branch)
4311
+/* PR tree-optimization/63341 */
4312
+/* { dg-do run } */
4314
+#include "tree-vect.h"
4316
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
4317
+struct S { char e __attribute__((aligned (64))); U s[32]; };
4318
+struct S t = {0, {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8},
4319
+ {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16},
4320
+ {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24},
4321
+ {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}}};
4322
+unsigned short d[32] = { 1 };
4324
+__attribute__((noinline, noclone)) void
4328
+ for (i = 0; i < 32; i++)
4330
+ if (__builtin_memcmp (d, t.s, sizeof d))
4342
+/* { dg-final { cleanup-tree-dump "vect" } } */
4343
Index: gcc/testsuite/ChangeLog
4344
===================================================================
4345
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_8_3_release)
4346
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_8-branch)
4348
+2014-09-30 Jakub Jelinek <jakub@redhat.com>
4350
+ PR inline-asm/63282
4351
+ * gcc.c-torture/compile/pr63282.c: New test.
4353
+2014-09-26 Jakub Jelinek <jakub@redhat.com>
4355
+ * g++.dg/compat/struct-layout-1_generate.c: Add -Wno-abi
4356
+ to default options.
4358
+2014-09-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4360
+ Backport from mainline r215559
4361
+ 2014-09-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4364
+ * gcc.target/powerpc/pr63335.c: New test.
4366
+2014-09-25 Jakub Jelinek <jakub@redhat.com>
4368
+ PR tree-optimization/63341
4369
+ * gcc.dg/vect/pr63341-1.c: New test.
4370
+ * gcc.dg/vect/pr63341-2.c: New test.
4372
+2014-09-18 Joseph Myers <joseph@codesourcery.com>
4374
+ * gcc.dg/torture/float128-exact-underflow.c: New test.
4376
+2014-09-17 Jakub Jelinek <jakub@redhat.com>
4379
+ * gcc.dg/pr63284.c: New test.
4381
+2014-09-09 Richard Biener <rguenther@suse.de>
4383
+ Backport from mainline
4384
+ 2014-06-11 Richard Biener <rguenther@suse.de>
4386
+ PR tree-optimization/61452
4387
+ * gcc.dg/torture/pr61452.c: New testcase.
4389
+2014-09-09 Richard Biener <rguenther@suse.de>
4391
+ Backport from mainline
4392
+ 2014-05-05 Richard Biener <rguenther@suse.de>
4394
+ PR middle-end/61010
4395
+ * gcc.dg/torture/pr61010.c: New testcase.
4397
+ 2014-05-28 Richard Biener <rguenther@suse.de>
4399
+ PR middle-end/61045
4400
+ * gcc.dg/pr61045.c: New testcase.
4402
+ 2014-08-11 Richard Biener <rguenther@suse.de>
4404
+ PR tree-optimization/62075
4405
+ * gcc.dg/vect/pr62075.c: New testcase.
4407
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
4409
+ PR tree-optimization/60196
4410
+ PR tree-optimization/63189
4411
+ * gcc.dg/vect/pr63189.c: New test.
4412
+ * gcc.dg/vect/pr60196-1.c: New test.
4413
+ * gcc.dg/vect/pr60196-2.c: New test.
4415
+ Backported from mainline
4416
+ 2013-09-17 Cong Hou <congh@google.com>
4418
+ * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product
4419
+ on two arrays with short and int types. This should not be recognized
4420
+ as a dot product pattern.
4422
+2014-09-08 Jakub Jelinek <jakub@redhat.com>
4424
+ Backported from mainline
4425
+ 2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
4428
+ * gcc.target/i386/pr61923.c: New test.
4430
+2014-09-06 John David Anglin <danglin@gcc.gnu.org>
4432
+ PR testsuite/56194
4433
+ * g++.dg/init/const9.C: Skip scan-assembler-not "rodata" on hppa*-*-*.
4435
+2014-09-03 Marek Polacek <polacek@redhat.com>
4437
+ Backport from mainline
4438
+ 2014-09-02 Marek Polacek <polacek@redhat.com>
4441
+ * gfortran.dg/pointer_intent_7.f90: Adjust dg-error.
4443
+2014-09-03 Martin Jambor <mjambor@suse.cz>
4446
+ * g++.dg/ipa/pr62015.C: New test.
4448
+2014-09-03 Martin Jambor <mjambor@suse.cz>
4451
+ * gcc.dg/ipa/pr61986.c: New test.
4453
+2014-08-26 Dominik Vogt <vogt@linux.vnet.ibm.com>
4455
+ * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
4456
+ failure on s390*-*-linux-gnu.
4458
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
4460
+ Backport from mainline
4461
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
4464
+ * gcc.target/sh/pr61996.c: New.
4466
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
4468
+ Backport from trunk
4470
+ * gfortran.dg/array_assignment_5.f90: New test.
4472
+2014-08-15 Tom de Vries <tom@codesourcery.com>
4474
+ Backport from mainline:
4475
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
4477
+ PR rtl-optimization/62004
4478
+ PR rtl-optimization/62030
4479
+ * gcc.dg/pr62004.c: New test.
4480
+ * gcc.dg/pr62030.c: Same.
4481
+ * gcc.target/mips/pr62030-octeon.c: Same.
4483
+2014-08-13 Felix Yang <fei.yang0953@gmail.com>
4485
+ PR tree-optimization/62073
4486
+ * gcc.dg/vect/pr62073.c: New test.
4488
+2014-08-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
4490
+ Backport from mainline
4491
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
4493
+ PR middle-end/62103
4494
+ * gcc.c-torture/execute/bitfld-6.c: New test.
4496
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
4498
+ Backport from trunk
4500
+ * gfortran.dg/dot_product_3.f90: New test case.
4502
+2014-08-07 John David Anglin <danglin@gcc.gnu.org>
4504
+ PR tree-optimization/60707
4505
+ * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
4507
+2014-08-06 Jakub Jelinek <jakub@redhat.com>
4509
+ PR rtl-optimization/61801
4510
+ * gcc.target/i386/pr61801.c: Rewritten.
4512
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
4514
+ Backport from mainline
4515
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
4517
+ PR tree-optimization/61375
4518
+ * gcc.c-torture/execute/pr61375-1.c: New test.
4520
+2014-08-01 Richard Biener <rguenther@suse.de>
4522
+ PR tree-optimization/61964
4523
+ * gcc.dg/torture/pr61964.c: New testcase.
4524
+ * gcc.dg/pr51879-18.c: XFAIL.
4526
+2014-07-28 Richard Biener <rguenther@suse.de>
4528
+ PR rtl-optimization/61801
4529
+ * gcc.target/i386/pr61801.c: Fix testcase.
4531
+2014-07-28 Richard Biener <rguenther@suse.de>
4533
+ PR rtl-optimization/61801
4534
+ * gcc.target/i386/pr61801.c: New testcase.
4536
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4538
+ Backport from mainline:
4539
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4541
+ * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
4543
+ * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
4544
+ * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
4545
+ * gcc.c-torture/execute/20050316-3.x: New file. Add -Wno-psabi.
4546
+ * gcc.c-torture/execute/pr23135.x: Likewise.
4548
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4550
+ Backport from mainline:
4551
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4553
+ * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
4555
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4557
+ Backport from mainline:
4558
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4560
+ * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
4562
+2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4564
+ Backport from mainline:
4565
+ 2014-07-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4567
+ * g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp.
4569
+2014-07-19 Eric Botcazou <ebotcazou@adacore.com>
4571
+ * gcc.dg/stack-usage-2.c: Adjust.
4573
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
4575
+ Backport from trunk.
4577
+ * gfortran.dg/dependency_44.f90 : New test
4579
+2014-07-10 Eric Botcazou <ebotcazou@adacore.com>
4581
+ * gnat.dg/opt39.adb: New test.
4583
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
4587
+ * gfortran.dg/allocatable_function_8.f90 : New test
4589
+2014-07-04 Jakub Jelinek <jakub@redhat.com>
4591
+ PR tree-optimization/61684
4592
+ * gcc.c-torture/compile/pr61684.c: New test.
4594
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
4595
+ Fritz Reese <Reese-Fritz@zai.com>
4597
+ * gfortran.dg/oldstyle_5.f: New test.
4599
+2014-06-30 Thomas Preud'homme <thomas.preudhomme@arm.com>
4601
+ Backport from mainline
4602
+ 2014-06-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
4604
+ PR tree-optimization/61306
4605
+ * gcc.c-torture/execute/pr61306-1.c: New test.
4606
+ * gcc.c-torture/execute/pr61306-2.c: Likewise.
4607
+ * gcc.c-torture/execute/pr61306-3.c: Likewise.
4609
+2014-06-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4611
+ * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*.
4613
+2014-06-27 Uros Bizjak <ubizjak@gmail.com>
4615
+ Backport from mainline
4616
+ 2014-06-26 Uros Bizjak <ubizjak@gmail.com>
4619
+ * gcc.target/alpha/pr61586.c: New test.
4621
+2014-06-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4623
+ * gfortran.dg/default_format_denormal_2.f90: Remove xfail for
4624
+ powerpc*-*-linux*.
4626
+2014-06-18 Uros Bizjak <ubizjak@gmail.com>
4628
+ Backport from mainline
4629
+ 2014-06-13 Ilya Enkovich <ilya.enkovich@intel.com>
4631
+ PR rtl-optimization/61094
4632
+ PR rtl-optimization/61446
4633
+ * gcc.target/i386/pr61446.c : New.
4635
+ Backport from mainline
4636
+ 2014-06-06 Uros Bizjak <ubizjak@gmail.com>
4639
+ * gcc.target/i386/pr61423.c: New test.
4641
+2014-06-17 Yufeng Zhang <yufeng.zhang@arm.com>
4643
+ Backport from mainline
4646
+ * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type.
4647
+ * gcc.target/aarch64/aapcs64/va_arg-13.c: New test.
4648
+ * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto.
4649
+ * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto.
4651
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
4653
+ Backport from trunk.
4655
+ * gfortran.dg/cray_pointers_10.f90: New file.
4657
+2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
4659
+ Backport from mainline
4661
+ 2014-06-13 Peter Bergner <bergner@vnet.ibm.com>
4663
+ * lib/target-supports.exp (check_effective_target_longdouble128): New.
4664
+ * gcc.target/powerpc/pack02.c: Use it.
4665
+ * gcc.target/powerpc/tfmode_off.c: Likewise.
4667
+2014-06-12 Georg-Johann Lay <avr@gjlay.de>
4669
+ Backport from 2014-06-12 trunk r211491
4672
+ * gcc.target/avr/torture/pr61443.c: New test.
4674
+2014-06-04 Richard Biener <rguenther@suse.de>
4676
+ PR tree-optimization/61383
4677
+ * gcc.dg/torture/pr61383-1.c: New testcase.
4679
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
4681
+ Backport from mainline
4682
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
4684
+ PR rtl-optimization/60866
4685
+ * gcc.dg/pr60866.c: New test.
4687
+2014-06-03 Andrey Belevantsev <abel@ispras.ru>
4689
+ Backport from mainline
4690
+ 2014-05-14 Andrey Belevantsev <abel@ispras.ru>
4692
+ PR rtl-optimization/60901
4693
+ * gcc.target/i386/pr60901.c: New test.
4695
+2014-05-28 Eric Botcazou <ebotcazou@adacore.com>
4697
+ Backport from mainline
4698
+ 2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
4700
+ * gnat.dg/overflow_fixed.adb: New test.
4702
+2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
4704
+ * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching.
4706
+2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
4708
+ Backport from mainline
4709
+ 2014-05-22 Peter Bergner <bergner@vnet.ibm.com>
4711
+ * gcc.target/powerpc/htm-ttest.c: New test.
4713
2014-05-22 Release Manager
4715
* GCC 4.8.3 released.
4716
Index: gcc/testsuite/g++.dg/expr/cond12.C
4717
===================================================================
4718
--- a/src/gcc/testsuite/g++.dg/expr/cond12.C (.../tags/gcc_4_8_3_release)
4719
+++ b/src/gcc/testsuite/g++.dg/expr/cond12.C (.../branches/gcc-4_8-branch)
4725
+ X& operator=(const X&){}
4726
+ X& operator=(X&){__builtin_abort();}
4729
+int main(int argv,char**) {
4731
+ ((argv > 2) ? a : b) = X();
4733
Index: gcc/testsuite/g++.dg/init/const9.C
4734
===================================================================
4735
--- a/src/gcc/testsuite/g++.dg/init/const9.C (.../tags/gcc_4_8_3_release)
4736
+++ b/src/gcc/testsuite/g++.dg/init/const9.C (.../branches/gcc-4_8-branch)
4739
-// { dg-final { scan-assembler-not "rodata" } }
4740
+// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
4744
Index: gcc/testsuite/g++.dg/parse/typename7.C
4745
===================================================================
4746
--- a/src/gcc/testsuite/g++.dg/parse/typename7.C (.../tags/gcc_4_8_3_release)
4747
+++ b/src/gcc/testsuite/g++.dg/parse/typename7.C (.../branches/gcc-4_8-branch)
4752
- template<typename> void foo(int); // { dg-message "note" }
4753
- template<typename T> void bar(T t) { // { dg-message "note" }
4754
+ template<typename> void foo(int);
4755
+ template<typename T> void bar(T t) {
4756
this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4757
- // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
4758
template<typename T> void bad(T t) {
4759
foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4764
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
4765
- // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
4767
B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
4769
Index: gcc/testsuite/g++.dg/parse/parameter-declaration-2.C
4770
===================================================================
4771
--- a/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../tags/gcc_4_8_3_release)
4772
+++ b/src/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C (.../branches/gcc-4_8-branch)
4774
-void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
4775
+void f (int i, int p[i]); // { dg-error "use of parameter.*outside function body" }
4776
// { dg-prune-output "array bound" }
4777
Index: gcc/testsuite/g++.dg/parse/ambig7.C
4778
===================================================================
4779
--- a/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../tags/gcc_4_8_3_release)
4780
+++ b/src/gcc/testsuite/g++.dg/parse/ambig7.C (.../branches/gcc-4_8-branch)
4786
+ Helper(int a, void (*pfunc)());
4789
+template <int I> void function();
4794
+Helper testOk(A, function<A>);
4795
+Helper testOk2(int(A), function<B>);
4796
+Helper testOk3((int(A)), function<A>);
4797
+Helper testFail(int(A), function<A>);
4798
Index: gcc/testsuite/g++.dg/compat/struct-layout-1.exp
4799
===================================================================
4800
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../tags/gcc_4_8_3_release)
4801
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp (.../branches/gcc-4_8-branch)
4803
# This must be done after the compat-use-*-compiler definitions.
4806
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
4807
+load_lib g++-dg.exp
4811
# Save variables for the C++ compiler under test, which each test will
4812
Index: gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
4813
===================================================================
4814
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c (.../tags/gcc_4_8_3_release)
4815
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c (.../branches/gcc-4_8-branch)
4817
/* Structure layout test generator.
4818
- Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011, 2012
4819
+ Copyright (C) 2004-2014
4820
Free Software Foundation, Inc.
4821
Contributed by Jakub Jelinek <jakub@redhat.com>.
4826
const char *dg_options[] = {
4827
-"/* { dg-options \"%s-I%s\" } */\n",
4828
+"/* { dg-options \"%s-I%s -Wno-abi\" } */\n",
4829
"/* { dg-options \"%s-I%s -mno-mmx -Wno-abi\" { target i?86-*-* x86_64-*-* } } */\n",
4830
"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* powerpc*-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
4831
"/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target i?86-*-darwin* x86_64-*-darwin* i?86-*-mingw32* x86_64-*-mingw32* i?86-*-cygwin* } } */\n",
4832
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
4833
===================================================================
4834
--- a/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../tags/gcc_4_8_3_release)
4835
+++ b/src/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C (.../branches/gcc-4_8-branch)
4838
+// { dg-do compile { target c++11 } }
4840
+template <class Coord> struct BasePoint
4843
+ constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
4845
+template <class T> struct BaseCoord
4848
+ constexpr BaseCoord (T) : value (1) {}
4850
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
4852
+ typedef BaseCoord Super;
4853
+ constexpr IntCoordTyped (int) : Super (0) {}
4855
+template <class units>
4856
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
4858
+ typedef BasePoint<IntCoordTyped<units> > Super;
4859
+ constexpr IntPointTyped (int, int) : Super (0, 0) {}
4864
+IntPointTyped<A> a (0, 0);
4865
Index: gcc/testsuite/g++.dg/cpp0x/variadic158.C
4866
===================================================================
4867
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../tags/gcc_4_8_3_release)
4868
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic158.C (.../branches/gcc-4_8-branch)
4871
+// { dg-do compile { target c++11 } }
4875
+template <typename>
4877
+ typedef const char* name;
4880
+template <typename VT, typename... Fields>
4881
+void New(const char* name,
4882
+ typename Fixed<Fields>::name... field_names);
4884
+template <typename VT, typename... Fields>
4885
+void CreateMetric(const char* name,
4886
+ typename Fixed<Fields>::name... field_names,
4892
+ CreateMetric<int, const char*>("abcd", "def", Base());
4894
Index: gcc/testsuite/g++.dg/cpp0x/variadic160.C
4895
===================================================================
4896
--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../tags/gcc_4_8_3_release)
4897
+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic160.C (.../branches/gcc-4_8-branch)
4900
+// { dg-do compile { target c++11 } }
4902
+template <typename _CharT> class A;
4903
+template <typename> class B;
4904
+template <class charT> class C;
4905
+template <> class C<char>
4907
+ virtual void xparse (int &, const B<A<char> > &) const;
4909
+template <class T, class charT = char> class G : C<charT>
4913
+ void default_value (const T &);
4914
+ void xparse (int &, const B<A<charT> > &) const;
4916
+template <class T, class charT>
4917
+void validate (int &, const B<A<charT> > &, T *, int);
4918
+template <class T, class charT>
4919
+void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
4921
+ validate (p1, p2, (T *)0, 0);
4923
+template <class T> G<T> *value (T *) { return new G<T>(0); }
4926
+template <typename T> struct D;
4927
+template <typename, int, int, int = 0, int = 0, int = 0 > class F;
4928
+template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
4930
+struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
4932
+ typedef _Scalar Scalar;
4934
+template <typename, int, int, int, int, int _MaxCols> class F
4937
+ typedef typename Eigen::D<F>::Scalar Scalar;
4938
+ F (const Scalar &, const Scalar &, const Scalar &);
4940
+template <class... T>
4941
+void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
4943
+int main (int, char *[])
4945
+ Eigen::F<double, 3, 1> a (0, 0, 0);
4946
+ value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
4948
Index: gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
4949
===================================================================
4950
--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../tags/gcc_4_8_3_release)
4951
+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C (.../branches/gcc-4_8-branch)
4954
+// { dg-do compile { target c++11 } }
4957
+ X& operator=(const X&) = delete;
4958
+ X& operator=(X&& ) = default;
4963
+ *(t ? &a : &b) = X();
4964
+ (t ? a : b) = X();
4966
Index: gcc/testsuite/g++.dg/cpp0x/overload3.C
4967
===================================================================
4968
--- a/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../tags/gcc_4_8_3_release)
4969
+++ b/src/gcc/testsuite/g++.dg/cpp0x/overload3.C (.../branches/gcc-4_8-branch)
4972
+// { dg-options "-std=c++11" }
4976
+void f(X&&); // { dg-message "void f" }
4980
+ operator const X&() const;
4986
+ f(w); // { dg-error "lvalue" }
4988
Index: gcc/testsuite/g++.dg/ipa/pr62015.C
4989
===================================================================
4990
--- a/src/gcc/testsuite/g++.dg/ipa/pr62015.C (.../tags/gcc_4_8_3_release)
4991
+++ b/src/gcc/testsuite/g++.dg/ipa/pr62015.C (.../branches/gcc-4_8-branch)
4993
+/* { dg-do run } */
4994
+/* { dg-options "-O3 -std=c++11" } */
4997
+extern "C" int printf(const char *fmt, ...);
4998
+extern "C" void abort(void);
5001
+ enum _Value { Left, Right, Invalid };
5003
+ constexpr Side() : _value(Invalid) {}
5004
+ constexpr Side(_Value value) : _value(value) {}
5005
+ operator _Value() const { return (_Value)_value; }
5013
+ void adjust(Side side, bool final);
5014
+ void move(Side side);
5019
+ adjust(Side::Invalid, false);
5022
+static void __attribute__((noinline))
5023
+check (int v, int final)
5030
+__attribute__((noinline))
5031
+void A::adjust(Side side, bool final)
5033
+ check ((int)side, final);
5036
+void A::move(Side side)
5038
+ adjust(side, false);
5039
+ adjust(side, true);
5045
+ t.move(Side::Left);
5048
Index: gcc/testsuite/g++.dg/template/local-fn1.C
5049
===================================================================
5050
--- a/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../tags/gcc_4_8_3_release)
5051
+++ b/src/gcc/testsuite/g++.dg/template/local-fn1.C (.../branches/gcc-4_8-branch)
5055
+template <typename T = int>
5061
Index: gcc/testsuite/g++.dg/template/conv14.C
5062
===================================================================
5063
--- a/src/gcc/testsuite/g++.dg/template/conv14.C (.../tags/gcc_4_8_3_release)
5064
+++ b/src/gcc/testsuite/g++.dg/template/conv14.C (.../branches/gcc-4_8-branch)
5070
+template<typename Container, typename Key>
5073
+template<typename Container, typename Key, typename KeyStore = Key>
5079
+ Variant(Container st, const Key& i) : index(i), state(st) {}
5081
+ template<typename T>
5082
+ operator T() const {
5083
+ return Accessor<Container, KeyStore>::template get<T>(state, index);
5087
+class AutoCleanVariant : public Variant<XX*, int> {
5089
+ AutoCleanVariant(XX* st, int i) : Variant<XX*,int>(st,i) {}
5091
+ template<typename T>
5092
+ operator T() const {
5093
+ return Variant<XX*, int>::operator T();
5096
Index: gcc/testsuite/g++.dg/template/friend55.C
5097
===================================================================
5098
--- a/src/gcc/testsuite/g++.dg/template/friend55.C (.../tags/gcc_4_8_3_release)
5099
+++ b/src/gcc/testsuite/g++.dg/template/friend55.C (.../branches/gcc-4_8-branch)
5103
+template <int I> struct A;
5104
+template <int I> class B {
5106
+ template <int A_S> friend void A<A_S>::impl();
5110
+template<int I>struct A { void impl(); };
5113
+template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
5119
Index: gcc/testsuite/g++.dg/template/memclass5.C
5120
===================================================================
5121
--- a/src/gcc/testsuite/g++.dg/template/memclass5.C (.../tags/gcc_4_8_3_release)
5122
+++ b/src/gcc/testsuite/g++.dg/template/memclass5.C (.../branches/gcc-4_8-branch)
5126
+template <typename T>
5129
+ template <typename U>
5132
+ typedef T result2;
5135
+ typedef y<int> zy;
5142
+ typedef double result2;
5147
+ x<int>::zy::result2 xxx;
5148
+ x<int>::y<int>::result2 xxx2;
5150
Index: gcc/testsuite/g++.dg/template/ptrmem27.C
5151
===================================================================
5152
--- a/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../tags/gcc_4_8_3_release)
5153
+++ b/src/gcc/testsuite/g++.dg/template/ptrmem27.C (.../branches/gcc-4_8-branch)
5161
+ int foo(int X::* ptr);
5163
+ template <int X::* ptr>
5167
+int X::foo(int X::* ptr) {
5168
+ int* p = &(this->*ptr); // OK.
5172
+template <int X::* ptr>
5174
+ int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
5177
Index: gcc/cp/tree.c
5178
===================================================================
5179
--- a/src/gcc/cp/tree.c (.../tags/gcc_4_8_3_release)
5180
+++ b/src/gcc/cp/tree.c (.../branches/gcc-4_8-branch)
5183
return lvalue_kind (TREE_OPERAND (ref, 0));
5186
+ case DOTSTAR_EXPR:
5187
+ if (TREE_CODE (ref) == MEMBER_REF)
5188
+ op1_lvalue_kind = clk_ordinary;
5190
+ op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
5191
+ if (TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (ref, 1))))
5192
+ op1_lvalue_kind = clk_none;
5193
+ return op1_lvalue_kind;
5196
op1_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 0));
5197
/* Look at the member designator. */
5198
@@ -3738,6 +3748,10 @@
5200
init_expr = get_target_expr (exp);
5201
exp = TARGET_EXPR_SLOT (init_expr);
5202
+ if (CLASS_TYPE_P (TREE_TYPE (exp)))
5205
+ exp = rvalue (exp);
5209
Index: gcc/cp/ChangeLog
5210
===================================================================
5211
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_8_3_release)
5212
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_8-branch)
5214
+2014-08-07 Jason Merrill <jason@redhat.com>
5217
+ * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
5220
+ * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
5222
+2014-01-27 Jason Merrill <jason@redhat.com>
5226
+ * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
5227
+ list-initialization. A conversion to rvalue ref that involves
5228
+ an lvalue-rvalue conversion is bad.
5229
+ (convert_like_real): Give helpful error message.
5231
+2014-01-29 Jason Merrill <jason@redhat.com>
5234
+ * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
5235
+ have a friend template in a class template.
5236
+ * pt.c (tsubst_friend_function): Look through it.
5237
+ (push_template_decl_real): A friend member template is
5240
+2014-02-21 Jason Merrill <jason@redhat.com>
5243
+ * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
5244
+ of the partial instantiation, not the most general template.
5245
+ (maybe_process_partial_specialization): Reassign everything on
5248
+2014-03-05 Jason Merrill <jason@redhat.com>
5251
+ * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
5252
+ if re-parsing might succeed.
5253
+ * semantics.c (finish_id_expression): Use of a parameter outside
5254
+ the function body is a parse error.
5256
+2014-06-30 Jason Merrill <jason@redhat.com>
5259
+ * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
5262
+ * pt.c (unify_one_argument): Type/expression mismatch just causes
5263
+ deduction failure.
5266
+ * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
5268
+2014-06-17 Jason Merrill <jason@redhat.com>
5271
+ * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
5273
+2014-06-02 Jason Merrill <jason@redhat.com>
5276
+ * pt.c (pack_deducible_p): Handle canonicalization.
5278
2014-05-22 Release Manager
5280
* GCC 4.8.3 released.
5282
===================================================================
5283
--- a/src/gcc/cp/pt.c (.../tags/gcc_4_8_3_release)
5284
+++ b/src/gcc/cp/pt.c (.../branches/gcc-4_8-branch)
5285
@@ -907,11 +907,13 @@
5286
t; t = TREE_CHAIN (t))
5288
tree inst = TREE_VALUE (t);
5289
- if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst))
5290
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)
5291
+ || !COMPLETE_OR_OPEN_TYPE_P (inst))
5293
/* We already have a full specialization of this partial
5294
- instantiation. Reassign it to the new member
5295
- specialization template. */
5296
+ instantiation, or a full specialization has been
5297
+ looked up but not instantiated. Reassign it to the
5298
+ new member specialization template. */
5306
- else if (COMPLETE_OR_OPEN_TYPE_P (inst))
5308
/* But if we've had an implicit instantiation, that's a
5309
problem ([temp.expl.spec]/6). */
5310
error ("specialization %qT after instantiation %qT",
5311
@@ -4308,7 +4310,8 @@
5312
in the template-parameter-list of the definition of a member of a
5315
- if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
5316
+ if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
5317
+ || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
5318
/* You can't have a function template declaration in a local
5319
scope, nor you can you define a member of a class template in a
5321
@@ -4572,7 +4575,8 @@
5322
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
5324
/* See if this is a primary template. */
5325
- if (is_friend && ctx)
5326
+ if (is_friend && ctx
5327
+ && uses_template_parms_level (ctx, processing_template_decl))
5328
/* A friend template that specifies a class context, i.e.
5329
template <typename T> friend void A<T>::f();
5331
@@ -7454,7 +7458,7 @@
5334
/* Let's consider the explicit specialization of a member
5335
- of a class template specialization that is implicitely instantiated,
5336
+ of a class template specialization that is implicitly instantiated,
5340
@@ -7552,9 +7556,9 @@
5342
/* Note this use of the partial instantiation so we can check it
5343
later in maybe_process_partial_specialization. */
5344
- DECL_TEMPLATE_INSTANTIATIONS (templ)
5345
+ DECL_TEMPLATE_INSTANTIATIONS (found)
5346
= tree_cons (arglist, t,
5347
- DECL_TEMPLATE_INSTANTIATIONS (templ));
5348
+ DECL_TEMPLATE_INSTANTIATIONS (found));
5350
if (TREE_CODE (template_type) == ENUMERAL_TYPE && !is_dependent_type)
5351
/* Now that the type has been registered on the instantiations
5352
@@ -8289,10 +8293,17 @@
5354
if (COMPLETE_TYPE_P (context))
5356
+ tree fn = new_friend;
5357
+ /* do_friend adds the TEMPLATE_DECL for any member friend
5358
+ template even if it isn't a member template, i.e.
5359
+ template <class T> friend A<T>::f();
5360
+ Look through it in that case. */
5361
+ if (TREE_CODE (fn) == TEMPLATE_DECL
5362
+ && !PRIMARY_TEMPLATE_P (fn))
5363
+ fn = DECL_TEMPLATE_RESULT (fn);
5364
/* Check to see that the declaration is really present, and,
5365
possibly obtain an improved declaration. */
5366
- tree fn = check_classfn (context,
5367
- new_friend, NULL_TREE);
5368
+ fn = check_classfn (context, fn, NULL_TREE);
5372
@@ -14934,7 +14945,7 @@
5374
for (packs = PACK_EXPANSION_PARAMETER_PACKS (type);
5375
packs; packs = TREE_CHAIN (packs))
5376
- if (TREE_VALUE (packs) == parm)
5377
+ if (template_args_equal (TREE_VALUE (packs), parm))
5379
/* The template parameter pack is used in a function parameter
5380
pack. If this is the end of the parameter list, the
5381
@@ -15502,8 +15513,9 @@
5382
maybe_adjust_types_for_deduction (strict, &parm, &arg, arg_expr);
5385
- gcc_assert ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
5386
- == (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL));
5387
+ if ((TYPE_P (parm) || TREE_CODE (parm) == TEMPLATE_DECL)
5388
+ != (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL))
5389
+ return unify_template_argument_mismatch (explain_p, parm, arg);
5391
/* For deduction from an init-list we need the actual list. */
5392
if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr))
5393
@@ -20009,7 +20021,12 @@
5396
if (BASELINK_P (expression))
5397
- expression = BASELINK_FUNCTIONS (expression);
5399
+ if (BASELINK_OPTYPE (expression)
5400
+ && dependent_type_p (BASELINK_OPTYPE (expression)))
5402
+ expression = BASELINK_FUNCTIONS (expression);
5405
if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
5407
Index: gcc/cp/semantics.c
5408
===================================================================
5409
--- a/src/gcc/cp/semantics.c (.../tags/gcc_4_8_3_release)
5410
+++ b/src/gcc/cp/semantics.c (.../branches/gcc-4_8-branch)
5411
@@ -3108,7 +3108,7 @@
5412
&& DECL_CONTEXT (decl) == NULL_TREE
5413
&& !cp_unevaluated_operand)
5415
- error ("use of parameter %qD outside function body", decl);
5416
+ *error_msg = "use of parameter outside function body";
5417
return error_mark_node;
5420
@@ -7296,7 +7296,9 @@
5421
constructor_elt *inner = base_field_constructor_elt (n, ce->index);
5424
- else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
5425
+ else if (ce->index
5426
+ && (TREE_CODE (ce->index) == NOP_EXPR
5427
+ || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
5429
/* This is an initializer for an empty base; now that we've
5430
checked that it's constant, we can ignore it. */
5431
Index: gcc/cp/parser.c
5432
===================================================================
5433
--- a/src/gcc/cp/parser.c (.../tags/gcc_4_8_3_release)
5434
+++ b/src/gcc/cp/parser.c (.../branches/gcc-4_8-branch)
5435
@@ -12831,7 +12831,12 @@
5436
the effort required to do the parse, nor will we issue duplicate
5437
error messages about problems during instantiation of the
5441
+ /* Don't do this if we had a parse error in a declarator; re-parsing
5442
+ might succeed if a name changes meaning (60361). */
5443
+ && !(cp_parser_error_occurred (parser)
5444
+ && cp_parser_parsing_tentatively (parser)
5445
+ && parser->in_declarator_p))
5447
cp_token *token = cp_lexer_token_at (parser->lexer, start_of_id);
5449
Index: gcc/cp/call.c
5450
===================================================================
5451
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_3_release)
5452
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
5453
@@ -1464,7 +1464,7 @@
5455
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
5456
conv = implicit_conversion (to, from, expr, c_cast_p,
5458
+ flags|LOOKUP_NO_TEMP_BIND, complain);
5459
if (!CLASS_TYPE_P (to)
5460
&& CONSTRUCTOR_NELTS (expr) == 1)
5462
@@ -1624,9 +1624,9 @@
5466
- Otherwise, the reference shall be to a non-volatile const type.
5468
- Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */
5469
+ Otherwise, the reference shall be an lvalue reference to a
5470
+ non-volatile const type, or the reference shall be an rvalue
5472
if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto))
5475
@@ -1664,7 +1664,16 @@
5476
/* This reference binding, unlike those above, requires the
5477
creation of a temporary. */
5478
conv->need_temporary_p = true;
5479
- conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
5480
+ if (TYPE_REF_IS_RVALUE (rto))
5482
+ conv->rvaluedness_matches_p = 1;
5483
+ /* In the second case, if the reference is an rvalue reference and
5484
+ the second standard conversion sequence of the user-defined
5485
+ conversion sequence includes an lvalue-to-rvalue conversion, the
5486
+ program is ill-formed. */
5487
+ if (conv->user_conv_p && next_conversion (conv)->kind == ck_rvalue)
5493
@@ -5811,7 +5820,7 @@
5494
&& convs->kind != ck_list
5495
&& convs->kind != ck_ambig
5496
&& (convs->kind != ck_ref_bind
5497
- || convs->user_conv_p)
5498
+ || (convs->user_conv_p && next_conversion (convs)->bad_p))
5499
&& (convs->kind != ck_rvalue
5500
|| SCALAR_TYPE_P (totype))
5501
&& convs->kind != ck_base)
5502
@@ -6110,7 +6119,8 @@
5503
if (convs->bad_p && !next_conversion (convs)->bad_p)
5505
gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
5506
- && real_lvalue_p (expr));
5507
+ && (real_lvalue_p (expr)
5508
+ || next_conversion(convs)->kind == ck_rvalue));
5510
error_at (loc, "cannot bind %qT lvalue to %qT",
5511
TREE_TYPE (expr), totype);
5512
Index: gcc/cp/friend.c
5513
===================================================================
5514
--- a/src/gcc/cp/friend.c (.../tags/gcc_4_8_3_release)
5515
+++ b/src/gcc/cp/friend.c (.../branches/gcc-4_8-branch)
5516
@@ -502,7 +502,13 @@
5517
? current_template_parms
5520
- if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
5521
+ if ((template_member_p
5522
+ /* Always pull out the TEMPLATE_DECL if we have a friend
5523
+ template in a class template so that it gets tsubsted
5524
+ properly later on (59956). tsubst_friend_function knows
5525
+ how to tell this apart from a member template. */
5526
+ || (class_template_depth && friend_depth))
5527
+ && decl && TREE_CODE (decl) == FUNCTION_DECL)
5528
decl = DECL_TI_TEMPLATE (decl);
5531
Index: gcc/haifa-sched.c
5532
===================================================================
5533
--- a/src/gcc/haifa-sched.c (.../tags/gcc_4_8_3_release)
5534
+++ b/src/gcc/haifa-sched.c (.../branches/gcc-4_8-branch)
5535
@@ -2931,7 +2931,7 @@
5537
advance_state (curr_state);
5538
if (sched_verbose >= 6)
5539
- fprintf (sched_dump, ";;\tAdvanced a state.\n");
5540
+ fprintf (sched_dump, ";;\tAdvance the current state.\n");
5543
/* Update register pressure after scheduling INSN. */
5544
@@ -5964,6 +5964,7 @@
5545
modulo_insns_scheduled = 0;
5547
ls.modulo_epilogue = false;
5548
+ ls.first_cycle_insn_p = true;
5550
/* Loop until all the insns in BB are scheduled. */
5551
while ((*current_sched_info->schedule_more_p) ())
5552
@@ -6034,7 +6035,6 @@
5556
- ls.first_cycle_insn_p = true;
5557
ls.shadows_only_p = false;
5558
cycle_issued_insns = 0;
5559
ls.can_issue_more = issue_rate;
5560
@@ -6321,11 +6321,13 @@
5564
+ ls.first_cycle_insn_p = true;
5566
if (ls.modulo_epilogue)
5569
- advance_one_cycle ();
5570
+ if (!ls.first_cycle_insn_p)
5571
+ advance_one_cycle ();
5572
perform_replacements_new_cycle ();
5575
Index: gcc/double-int.c
5576
===================================================================
5577
--- a/src/gcc/double-int.c (.../tags/gcc_4_8_3_release)
5578
+++ b/src/gcc/double-int.c (.../branches/gcc-4_8-branch)
5580
== (unsigned HOST_WIDE_INT) htwice)
5581
&& (labs_den <= ltwice)))
5585
/* quo = quo - 1; */
5586
add_double (*lquo, *hquo,
5587
(HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
5588
Index: gcc/tree-ssa-math-opts.c
5589
===================================================================
5590
--- a/src/gcc/tree-ssa-math-opts.c (.../tags/gcc_4_8_3_release)
5591
+++ b/src/gcc/tree-ssa-math-opts.c (.../branches/gcc-4_8-branch)
5592
@@ -1537,7 +1537,7 @@
5594
struct symbolic_number {
5595
unsigned HOST_WIDEST_INT n;
5600
/* Perform a SHIFT or ROTATE operation by COUNT bits on symbolic
5601
@@ -1549,13 +1549,15 @@
5602
struct symbolic_number *n,
5605
+ int bitsize = TYPE_PRECISION (n->type);
5610
/* Zero out the extra bits of N in order to avoid them being shifted
5611
into the significant bits. */
5612
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5613
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
5614
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5615
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5619
@@ -1563,20 +1565,24 @@
5623
+ /* Arithmetic shift of signed type: result is dependent on the value. */
5624
+ if (!TYPE_UNSIGNED (n->type)
5625
+ && (n->n & ((unsigned HOST_WIDEST_INT) 0xff << (bitsize - 8))))
5630
- n->n = (n->n << count) | (n->n >> ((n->size * BITS_PER_UNIT) - count));
5631
+ n->n = (n->n << count) | (n->n >> (bitsize - count));
5634
- n->n = (n->n >> count) | (n->n << ((n->size * BITS_PER_UNIT) - count));
5635
+ n->n = (n->n >> count) | (n->n << (bitsize - count));
5640
/* Zero unused bits for size. */
5641
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5642
- n->n &= ((unsigned HOST_WIDEST_INT)1 << (n->size * BITS_PER_UNIT)) - 1;
5643
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5644
+ n->n &= ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5648
@@ -1593,7 +1599,7 @@
5649
if (TREE_CODE (lhs_type) != INTEGER_TYPE)
5652
- if (TYPE_PRECISION (lhs_type) != n->size * BITS_PER_UNIT)
5653
+ if (TYPE_PRECISION (lhs_type) != TYPE_PRECISION (n->type))
5657
@@ -1650,20 +1656,25 @@
5658
to initialize the symbolic number. */
5663
/* Set up the symbolic number N by setting each byte to a
5664
value between 1 and the byte size of rhs1. The highest
5665
order byte is set to n->size and the lowest order
5667
- n->size = TYPE_PRECISION (TREE_TYPE (rhs1));
5668
- if (n->size % BITS_PER_UNIT != 0)
5669
+ n->type = TREE_TYPE (rhs1);
5670
+ size = TYPE_PRECISION (n->type);
5671
+ if (size % BITS_PER_UNIT != 0)
5673
- n->size /= BITS_PER_UNIT;
5674
+ if (size > HOST_BITS_PER_WIDEST_INT)
5676
+ size /= BITS_PER_UNIT;
5677
n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
5678
(unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
5680
- if (n->size < (int)sizeof (HOST_WIDEST_INT))
5681
+ if (size < (int)sizeof (HOST_WIDEST_INT))
5682
n->n &= ((unsigned HOST_WIDEST_INT)1 <<
5683
- (n->size * BITS_PER_UNIT)) - 1;
5684
+ (size * BITS_PER_UNIT)) - 1;
5686
source_expr1 = rhs1;
5688
@@ -1672,12 +1683,12 @@
5693
+ int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
5694
unsigned HOST_WIDEST_INT val = widest_int_cst_value (rhs2);
5695
unsigned HOST_WIDEST_INT tmp = val;
5697
/* Only constants masking full bytes are allowed. */
5698
- for (i = 0; i < n->size; i++, tmp >>= BITS_PER_UNIT)
5699
+ for (i = 0; i < size; i++, tmp >>= BITS_PER_UNIT)
5700
if ((tmp & 0xff) != 0 && (tmp & 0xff) != 0xff)
5703
@@ -1693,12 +1704,24 @@
5708
+ int type_size, old_type_size;
5711
- type_size = TYPE_PRECISION (gimple_expr_type (stmt));
5712
+ type = gimple_expr_type (stmt);
5713
+ type_size = TYPE_PRECISION (type);
5714
if (type_size % BITS_PER_UNIT != 0)
5716
+ if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
5719
+ /* Sign extension: result is dependent on the value. */
5720
+ old_type_size = TYPE_PRECISION (n->type);
5721
+ if (!TYPE_UNSIGNED (n->type)
5722
+ && type_size > old_type_size
5724
+ ((unsigned HOST_WIDEST_INT) 0xff << (old_type_size - 8)))
5727
if (type_size / BITS_PER_UNIT < (int)(sizeof (HOST_WIDEST_INT)))
5729
/* If STMT casts to a smaller type mask out the bits not
5730
@@ -1705,7 +1728,7 @@
5731
belonging to the target type. */
5732
n->n &= ((unsigned HOST_WIDEST_INT)1 << type_size) - 1;
5734
- n->size = type_size / BITS_PER_UNIT;
5739
@@ -1718,7 +1741,7 @@
5741
if (rhs_class == GIMPLE_BINARY_RHS)
5745
struct symbolic_number n1, n2;
5746
unsigned HOST_WIDEST_INT mask;
5748
@@ -1742,11 +1765,12 @@
5749
source_expr2 = find_bswap_1 (rhs2_stmt, &n2, limit - 1);
5751
if (source_expr1 != source_expr2
5752
- || n1.size != n2.size)
5753
+ || TYPE_PRECISION (n1.type) != TYPE_PRECISION (n2.type))
5756
- n->size = n1.size;
5757
- for (i = 0, mask = 0xff; i < n->size; i++, mask <<= BITS_PER_UNIT)
5758
+ n->type = n1.type;
5759
+ size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
5760
+ for (i = 0, mask = 0xff; i < size; i++, mask <<= BITS_PER_UNIT)
5762
unsigned HOST_WIDEST_INT masked1, masked2;
5764
@@ -1785,7 +1809,7 @@
5766
struct symbolic_number n;
5769
+ int limit, bitsize;
5771
/* The last parameter determines the depth search limit. It usually
5772
correlates directly to the number of bytes to be touched. We
5773
@@ -1800,13 +1824,14 @@
5776
/* Zero out the extra bits of N and CMP. */
5777
- if (n.size < (int)sizeof (HOST_WIDEST_INT))
5778
+ bitsize = TYPE_PRECISION (n.type);
5779
+ if (bitsize < 8 * (int)sizeof (HOST_WIDEST_INT))
5781
unsigned HOST_WIDEST_INT mask =
5782
- ((unsigned HOST_WIDEST_INT)1 << (n.size * BITS_PER_UNIT)) - 1;
5783
+ ((unsigned HOST_WIDEST_INT)1 << bitsize) - 1;
5786
- cmp >>= (sizeof (HOST_WIDEST_INT) - n.size) * BITS_PER_UNIT;
5787
+ cmp >>= sizeof (HOST_WIDEST_INT) * BITS_PER_UNIT - bitsize;
5790
/* A complete byte swap should make the symbolic number to start
5791
@@ -1828,7 +1853,7 @@
5792
bool changed = false;
5793
tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
5795
- if (BITS_PER_UNIT != 8)
5796
+ if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
5799
if (sizeof (HOST_WIDEST_INT) < 8)
5801
===================================================================
5802
--- a/src/gcc/ifcvt.c (.../tags/gcc_4_8_3_release)
5803
+++ b/src/gcc/ifcvt.c (.../branches/gcc-4_8-branch)
5804
@@ -294,6 +294,28 @@
5806
return (e) ? e->dest : NULL_BLOCK;
5809
+/* Return true if RTXs A and B can be safely interchanged. */
5812
+rtx_interchangeable_p (const_rtx a, const_rtx b)
5814
+ if (!rtx_equal_p (a, b))
5817
+ if (GET_CODE (a) != MEM)
5820
+ /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
5821
+ reference is not. Interchanging a dead type-unsafe memory reference with
5822
+ a live type-safe one creates a live type-unsafe memory reference, in other
5823
+ words, it makes the program illegal.
5824
+ We check here conservatively whether the two memory references have equal
5825
+ memory attributes. */
5827
+ return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
5831
/* Go through a bunch of insns, converting them to conditional
5832
execution format if possible. Return TRUE if all of the non-note
5833
@@ -1014,6 +1036,9 @@
5834
|| (rtx_equal_p (if_info->a, XEXP (cond, 1))
5835
&& rtx_equal_p (if_info->b, XEXP (cond, 0))))
5837
+ if (!rtx_interchangeable_p (if_info->a, if_info->b))
5840
y = (code == EQ) ? if_info->a : if_info->b;
5842
/* Avoid generating the move if the source is the destination. */
5843
@@ -2483,7 +2508,7 @@
5845
|| insn_b != last_active_insn (else_bb, FALSE)
5846
|| (set_b = single_set (insn_b)) == NULL_RTX
5847
- || ! rtx_equal_p (x, SET_DEST (set_b)))
5848
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
5852
@@ -2496,7 +2521,7 @@
5853
|| BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
5854
|| !NONJUMP_INSN_P (insn_b)
5855
|| (set_b = single_set (insn_b)) == NULL_RTX
5856
- || ! rtx_equal_p (x, SET_DEST (set_b))
5857
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b))
5858
|| ! noce_operand_ok (SET_SRC (set_b))
5859
|| reg_overlap_mentioned_p (x, SET_SRC (set_b))
5860
|| modified_between_p (SET_SRC (set_b), insn_b, jump)
5861
@@ -2562,7 +2587,7 @@
5863
/* Look and see if A and B are really the same. Avoid creating silly
5864
cmove constructs that no one will fix up later. */
5865
- if (rtx_equal_p (a, b))
5866
+ if (rtx_interchangeable_p (a, b))
5868
/* If we have an INSN_B, we don't have to create any new rtl. Just
5869
move the instruction that we already have. If we don't have an
5870
@@ -4246,6 +4271,9 @@
5871
old_dest = JUMP_LABEL (jump);
5872
if (other_bb != new_dest)
5874
+ if (!any_condjump_p (jump))
5877
if (JUMP_P (BB_END (dest_edge->src)))
5878
new_dest_label = JUMP_LABEL (BB_END (dest_edge->src));
5879
else if (new_dest == EXIT_BLOCK_PTR)
5880
Index: gcc/dwarf2out.c
5881
===================================================================
5882
--- a/src/gcc/dwarf2out.c (.../tags/gcc_4_8_3_release)
5883
+++ b/src/gcc/dwarf2out.c (.../branches/gcc-4_8-branch)
5884
@@ -12234,7 +12234,7 @@
5885
op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
5886
VAR_INIT_STATUS_INITIALIZED);
5890
add_loc_descr (&mem_loc_result, op1);
5891
add_loc_descr (&mem_loc_result,
5892
new_loc_descr (DW_OP_plus, 0, 0));
5894
===================================================================
5895
--- a/src/gcc/expr.c (.../tags/gcc_4_8_3_release)
5896
+++ b/src/gcc/expr.c (.../branches/gcc-4_8-branch)
5897
@@ -10603,7 +10603,7 @@
5898
|| !host_integerp (TREE_OPERAND (offset, 1), 1)
5899
|| compare_tree_int (TREE_OPERAND (offset, 1),
5900
BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
5901
- || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
5902
+ || exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
5905
/* Look at the first operand of BIT_AND_EXPR and strip any conversion.
5906
Index: gcc/ada/socket.c
5907
===================================================================
5908
--- a/src/gcc/ada/socket.c (.../tags/gcc_4_8_3_release)
5909
+++ b/src/gcc/ada/socket.c (.../branches/gcc-4_8-branch)
5914
-#if defined(__linux__) || defined(__GLIBC__)
5915
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
5916
(void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
5918
rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
5919
Index: gcc/ada/ChangeLog
5920
===================================================================
5921
--- a/src/gcc/ada/ChangeLog (.../tags/gcc_4_8_3_release)
5922
+++ b/src/gcc/ada/ChangeLog (.../branches/gcc-4_8-branch)
5924
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
5926
+ * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
5927
+ * gsocket.h Add include of <unistd.h> on RTEMS.
5929
+2014-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
5931
+ * s-osinte-rtems.adb: Correct formatting of line in license block.
5933
2014-05-22 Release Manager
5935
* GCC 4.8.3 released.
5936
Index: gcc/ada/s-osinte-rtems.adb
5937
===================================================================
5938
--- a/src/gcc/ada/s-osinte-rtems.adb (.../tags/gcc_4_8_3_release)
5939
+++ b/src/gcc/ada/s-osinte-rtems.adb (.../branches/gcc-4_8-branch)
5941
-- You should have received a copy of the GNU General Public License and --
5942
-- a copy of the GCC Runtime Library Exception along with this program; --
5943
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
5944
--- <http://www.gnu.org/licenses/>.
5945
+-- <http://www.gnu.org/licenses/>. --
5947
-- GNARL was developed by the GNARL team at Florida State University. It is --
5948
-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
5949
Index: gcc/ada/gsocket.h
5950
===================================================================
5951
--- a/src/gcc/ada/gsocket.h (.../tags/gcc_4_8_3_release)
5952
+++ b/src/gcc/ada/gsocket.h (.../branches/gcc-4_8-branch)
5953
@@ -183,6 +183,11 @@
5954
#include <sys/time.h>
5957
+#if defined(__rtems__)
5958
+#include <unistd.h>
5959
+/* Required, for read(), write(), and close() */
5963
* RTEMS has these .h files but not until you have built and installed RTEMS.
5964
* When building a C/C++ toolset, you also build the newlib C library, so the
5965
Index: gcc/tree-ssa-ifcombine.c
5966
===================================================================
5967
--- a/src/gcc/tree-ssa-ifcombine.c (.../tags/gcc_4_8_3_release)
5968
+++ b/src/gcc/tree-ssa-ifcombine.c (.../branches/gcc-4_8-branch)
5969
@@ -105,7 +105,11 @@
5971
gimple stmt = gsi_stmt (gsi);
5973
+ if (is_gimple_debug (stmt))
5976
if (gimple_has_side_effects (stmt)
5977
+ || gimple_could_trap_p (stmt)
5978
|| gimple_vuse (stmt))
5982
while (is_gimple_assign (stmt)
5983
&& ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
5984
&& (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt)))
5985
- <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
5986
+ <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))
5987
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
5988
|| gimple_assign_ssa_name_copy_p (stmt)))
5989
stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
5991
Index: gcc/sel-sched-ir.c
5992
===================================================================
5993
--- a/src/gcc/sel-sched-ir.c (.../tags/gcc_4_8_3_release)
5994
+++ b/src/gcc/sel-sched-ir.c (.../branches/gcc-4_8-branch)
5996
static void free_av_set (basic_block);
5997
static void invalidate_av_set (basic_block);
5998
static void extend_insn_data (void);
5999
-static void sel_init_new_insn (insn_t, int);
6000
+static void sel_init_new_insn (insn_t, int, int = -1);
6001
static void finish_insns (void);
6003
/* Various list functions. */
6004
@@ -4011,9 +4011,10 @@
6008
-/* Compute seqno for INSN by its preds or succs. */
6009
+/* Compute seqno for INSN by its preds or succs. Use OLD_SEQNO to compute
6010
+ seqno in corner cases. */
6012
-get_seqno_for_a_jump (insn_t insn)
6013
+get_seqno_for_a_jump (insn_t insn, int old_seqno)
6017
@@ -4069,8 +4070,16 @@
6019
seqno = get_seqno_by_succs (insn);
6023
+ /* The only case where this could be here legally is that the only
6024
+ unscheduled insn was a conditional jump that got removed and turned
6025
+ into this unconditional one. Initialize from the old seqno
6026
+ of that jump passed down to here. */
6027
+ seqno = old_seqno;
6030
gcc_assert (seqno >= 0);
6035
@@ -4250,22 +4259,24 @@
6038
/* This is used to initialize spurious jumps generated by
6039
- sel_redirect_edge (). */
6040
+ sel_redirect_edge (). OLD_SEQNO is used for initializing seqnos
6041
+ in corner cases within get_seqno_for_a_jump. */
6043
-init_simplejump_data (insn_t insn)
6044
+init_simplejump_data (insn_t insn, int old_seqno)
6046
init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0,
6047
REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0,
6048
vNULL, true, false, false,
6050
- INSN_SEQNO (insn) = get_seqno_for_a_jump (insn);
6051
+ INSN_SEQNO (insn) = get_seqno_for_a_jump (insn, old_seqno);
6052
init_first_time_insn_data (insn);
6055
/* Perform deferred initialization of insns. This is used to process
6056
- a new jump that may be created by redirect_edge. */
6058
-sel_init_new_insn (insn_t insn, int flags)
6059
+ a new jump that may be created by redirect_edge. OLD_SEQNO is used
6060
+ for initializing simplejumps in init_simplejump_data. */
6062
+sel_init_new_insn (insn_t insn, int flags, int old_seqno)
6064
/* We create data structures for bb when the first insn is emitted in it. */
6066
@@ -4292,7 +4303,7 @@
6067
if (flags & INSN_INIT_TODO_SIMPLEJUMP)
6069
extend_insn_data ();
6070
- init_simplejump_data (insn);
6071
+ init_simplejump_data (insn, old_seqno);
6074
gcc_assert (CONTAINING_RGN (BLOCK_NUM (insn))
6075
@@ -5578,8 +5589,7 @@
6078
/* A wrapper for redirect_edge_and_branch_force, which also initializes
6079
- data structures for possibly created bb and insns. Returns the newly
6080
- added bb or NULL, when a bb was not needed. */
6081
+ data structures for possibly created bb and insns. */
6083
sel_redirect_edge_and_branch_force (edge e, basic_block to)
6085
@@ -5586,6 +5596,7 @@
6086
basic_block jump_bb, src, orig_dest = e->dest;
6089
+ int old_seqno = -1;
6091
/* This function is now used only for bookkeeping code creation, where
6092
we'll never get the single pred of orig_dest block and thus will not
6093
@@ -5594,8 +5605,13 @@
6094
&& !single_pred_p (orig_dest));
6096
prev_max_uid = get_max_uid ();
6097
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
6098
+ when the conditional jump being redirected may become unconditional. */
6099
+ if (any_condjump_p (BB_END (src))
6100
+ && INSN_SEQNO (BB_END (src)) >= 0)
6101
+ old_seqno = INSN_SEQNO (BB_END (src));
6103
jump_bb = redirect_edge_and_branch_force (e, to);
6105
if (jump_bb != NULL)
6106
sel_add_bb (jump_bb);
6108
@@ -5607,7 +5623,8 @@
6110
jump = find_new_jump (src, jump_bb, prev_max_uid);
6112
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
6113
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP,
6115
set_immediate_dominator (CDI_DOMINATORS, to,
6116
recompute_dominator (CDI_DOMINATORS, to));
6117
set_immediate_dominator (CDI_DOMINATORS, orig_dest,
6118
@@ -5626,6 +5643,7 @@
6120
bool recompute_toporder_p = false;
6121
bool maybe_unreachable = single_pred_p (orig_dest);
6122
+ int old_seqno = -1;
6124
latch_edge_p = (pipelining_p
6125
&& current_loop_nest
6126
@@ -5634,6 +5652,12 @@
6128
prev_max_uid = get_max_uid ();
6130
+ /* Compute and pass old_seqno down to sel_init_new_insn only for the case
6131
+ when the conditional jump being redirected may become unconditional. */
6132
+ if (any_condjump_p (BB_END (src))
6133
+ && INSN_SEQNO (BB_END (src)) >= 0)
6134
+ old_seqno = INSN_SEQNO (BB_END (src));
6136
redirected = redirect_edge_and_branch (e, to);
6138
gcc_assert (redirected && !last_added_blocks.exists ());
6139
@@ -5654,7 +5678,7 @@
6141
jump = find_new_jump (src, NULL, prev_max_uid);
6143
- sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
6144
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP, old_seqno);
6146
/* Only update dominator info when we don't have unreachable blocks.
6147
Otherwise we'll update in maybe_tidy_empty_bb. */
6148
Index: gcc/fortran/interface.c
6149
===================================================================
6150
--- a/src/gcc/fortran/interface.c (.../tags/gcc_4_8_3_release)
6151
+++ b/src/gcc/fortran/interface.c (.../branches/gcc-4_8-branch)
6152
@@ -1923,7 +1923,7 @@
6153
/* F2008, 12.5.2.5; IR F08/0073. */
6154
if (formal->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL
6155
&& ((CLASS_DATA (formal)->attr.class_pointer
6156
- && !formal->attr.intent == INTENT_IN)
6157
+ && formal->attr.intent != INTENT_IN)
6158
|| CLASS_DATA (formal)->attr.allocatable))
6160
if (actual->ts.type != BT_CLASS)
6161
Index: gcc/fortran/trans-expr.c
6162
===================================================================
6163
--- a/src/gcc/fortran/trans-expr.c (.../tags/gcc_4_8_3_release)
6164
+++ b/src/gcc/fortran/trans-expr.c (.../branches/gcc-4_8-branch)
6165
@@ -7096,7 +7096,7 @@
6167
res_desc = gfc_evaluate_now (desc, &se->pre);
6168
gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
6169
- se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
6170
+ se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
6172
/* Free the lhs after the function call and copy the result data to
6173
the lhs descriptor. */
6174
Index: gcc/fortran/decl.c
6175
===================================================================
6176
--- a/src/gcc/fortran/decl.c (.../tags/gcc_4_8_3_release)
6177
+++ b/src/gcc/fortran/decl.c (.../branches/gcc-4_8-branch)
6178
@@ -1996,6 +1996,13 @@
6179
if (gfc_notify_std (GFC_STD_GNU, "Old-style "
6180
"initialization at %C") == FAILURE)
6182
+ else if (gfc_current_state () == COMP_DERIVED)
6184
+ gfc_error ("Invalid old style initialization for derived type "
6185
+ "component at %C");
6190
return match_old_style_init (name);
6192
Index: gcc/fortran/ChangeLog
6193
===================================================================
6194
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release)
6195
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
6197
+2014-09-03 Marek Polacek <polacek@redhat.com>
6199
+ Backport from trunk
6201
+ * interface.c (compare_parameter): Fix condition.
6203
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
6205
+ Backport from trunk
6207
+ * gfortran.dg/array_assignment_5.f90: New test.
6209
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
6211
+ Backport from trunk
6213
+ * simplify.c (gfc_simplify_dot_product): Convert types of
6214
+ vectors before calculating the result.
6216
+2014-07-19 Paul Thomas <pault@gcc.gnu.org>
6218
+ Backport from trunk.
6220
+ * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
6221
+ that elements are skipped. This then correctly aligns 'reverse'
6222
+ with the scalarizer loops.
6224
+2014-07-08 Paul Thomas <pault@gcc.gnu.org>
6228
+ * trans-expr.c (fcncall_realloc_result): Use the natural type
6229
+ for the address expression of 'res_desc'.
6231
+2014-07-02 Jakub Jelinek <jakub@redhat.com>
6232
+ Fritz Reese <Reese-Fritz@zai.com>
6234
+ * decl.c (variable_decl): Reject old style initialization
6235
+ for derived type components.
6237
+2014-06-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
6239
+ Backport from trunk.
6241
+ * trans-decl.c (gfc_create_module_variable): Don't create
6242
+ Cray-pointee decls twice.
6244
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
6246
+ Backport from mainline
6247
+ PR libfortran/61310
6248
+ * intrinsics.texi (CTIME): Remove mention of locale-dependent
6251
2014-05-22 Release Manager
6253
* GCC 4.8.3 released.
6254
Index: gcc/fortran/frontend-passes.c
6255
===================================================================
6256
--- a/src/gcc/fortran/frontend-passes.c (.../tags/gcc_4_8_3_release)
6257
+++ b/src/gcc/fortran/frontend-passes.c (.../branches/gcc-4_8-branch)
6258
@@ -874,6 +874,10 @@
6262
+ case INTRINSIC_CONCAT:
6263
+ /* Do not do string concatenations. */
6267
/* Binary operators. */
6268
if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
6269
Index: gcc/fortran/trans-decl.c
6270
===================================================================
6271
--- a/src/gcc/fortran/trans-decl.c (.../tags/gcc_4_8_3_release)
6272
+++ b/src/gcc/fortran/trans-decl.c (.../branches/gcc-4_8-branch)
6273
@@ -4084,8 +4084,8 @@
6276
/* Don't generate variables from other modules. Variables from
6277
- COMMONs will already have been generated. */
6278
- if (sym->attr.use_assoc || sym->attr.in_common)
6279
+ COMMONs and Cray pointees will already have been generated. */
6280
+ if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee)
6283
/* Equivalenced variables arrive here after creation. */
6284
Index: gcc/fortran/dependency.c
6285
===================================================================
6286
--- a/src/gcc/fortran/dependency.c (.../tags/gcc_4_8_3_release)
6287
+++ b/src/gcc/fortran/dependency.c (.../branches/gcc-4_8-branch)
6288
@@ -1779,6 +1779,7 @@
6289
gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
6293
gfc_dependency fin_dep;
6294
gfc_dependency this_dep;
6296
@@ -1828,6 +1829,8 @@
6300
+ /* Index for the reverse array. */
6302
for (n=0; n < lref->u.ar.dimen; n++)
6304
/* Assume dependency when either of array reference is vector
6305
@@ -1862,31 +1865,37 @@
6306
The ability to reverse or not is set by previous conditions
6307
in this dimension. If reversal is not activated, the
6308
value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */
6310
+ /* Get the indexing right for the scalarizing loop. If this
6311
+ is an element, there is no corresponding loop. */
6312
+ if (lref->u.ar.dimen_type[n] != DIMEN_ELEMENT)
6315
if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
6316
&& lref->u.ar.dimen_type[n] == DIMEN_RANGE)
6318
/* Set reverse if backward dependence and not inhibited. */
6319
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
6320
- reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
6321
- GFC_REVERSE_SET : reverse[n];
6322
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
6323
+ reverse[m] = (this_dep == GFC_DEP_BACKWARD) ?
6324
+ GFC_REVERSE_SET : reverse[m];
6326
/* Set forward if forward dependence and not inhibited. */
6327
- if (reverse && reverse[n] == GFC_ENABLE_REVERSE)
6328
- reverse[n] = (this_dep == GFC_DEP_FORWARD) ?
6329
- GFC_FORWARD_SET : reverse[n];
6330
+ if (reverse && reverse[m] == GFC_ENABLE_REVERSE)
6331
+ reverse[m] = (this_dep == GFC_DEP_FORWARD) ?
6332
+ GFC_FORWARD_SET : reverse[m];
6334
/* Flag up overlap if dependence not compatible with
6335
the overall state of the expression. */
6336
- if (reverse && reverse[n] == GFC_REVERSE_SET
6337
+ if (reverse && reverse[m] == GFC_REVERSE_SET
6338
&& this_dep == GFC_DEP_FORWARD)
6340
- reverse[n] = GFC_INHIBIT_REVERSE;
6341
+ reverse[m] = GFC_INHIBIT_REVERSE;
6342
this_dep = GFC_DEP_OVERLAP;
6344
- else if (reverse && reverse[n] == GFC_FORWARD_SET
6345
+ else if (reverse && reverse[m] == GFC_FORWARD_SET
6346
&& this_dep == GFC_DEP_BACKWARD)
6348
- reverse[n] = GFC_INHIBIT_REVERSE;
6349
+ reverse[m] = GFC_INHIBIT_REVERSE;
6350
this_dep = GFC_DEP_OVERLAP;
6353
@@ -1893,7 +1902,7 @@
6354
/* If no intention of reversing or reversing is explicitly
6355
inhibited, convert backward dependence to overlap. */
6356
if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
6357
- || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE))
6358
+ || (reverse != NULL && reverse[m] == GFC_INHIBIT_REVERSE))
6359
this_dep = GFC_DEP_OVERLAP;
6362
Index: gcc/fortran/simplify.c
6363
===================================================================
6364
--- a/src/gcc/fortran/simplify.c (.../tags/gcc_4_8_3_release)
6365
+++ b/src/gcc/fortran/simplify.c (.../branches/gcc-4_8-branch)
6366
@@ -1877,6 +1877,9 @@
6368
gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
6373
if (!is_constant_array_expr (vector_a)
6374
|| !is_constant_array_expr (vector_b))
6376
@@ -1883,8 +1886,14 @@
6378
gcc_assert (vector_a->rank == 1);
6379
gcc_assert (vector_b->rank == 1);
6380
- gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
6382
+ temp.expr_type = EXPR_OP;
6383
+ gfc_clear_ts (&temp.ts);
6384
+ temp.value.op.op = INTRINSIC_NONE;
6385
+ temp.value.op.op1 = vector_a;
6386
+ temp.value.op.op2 = vector_b;
6387
+ gfc_type_convert_binary (&temp, 1);
6389
return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
6392
Index: gcc/function.c
6393
===================================================================
6394
--- a/src/gcc/function.c (.../tags/gcc_4_8_3_release)
6395
+++ b/src/gcc/function.c (.../branches/gcc-4_8-branch)
6396
@@ -1354,9 +1354,13 @@
6397
#define STACK_POINTER_OFFSET 0
6400
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
6401
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
6404
/* If not defined, pick an appropriate default for the offset of dynamically
6405
allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
6406
- REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
6407
+ INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
6409
#ifndef STACK_DYNAMIC_OFFSET
6411
@@ -1368,12 +1372,12 @@
6412
`crtl->outgoing_args_size'. Nevertheless, we must allow
6413
for it when allocating stack dynamic objects. */
6415
-#if defined(REG_PARM_STACK_SPACE)
6416
+#ifdef INCOMING_REG_PARM_STACK_SPACE
6417
#define STACK_DYNAMIC_OFFSET(FNDECL) \
6418
((ACCUMULATE_OUTGOING_ARGS \
6419
? (crtl->outgoing_args_size \
6420
+ (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
6421
- : REG_PARM_STACK_SPACE (FNDECL))) \
6422
+ : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
6423
: 0) + (STACK_POINTER_OFFSET))
6425
#define STACK_DYNAMIC_OFFSET(FNDECL) \
6426
@@ -2211,8 +2215,9 @@
6428
all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
6430
-#ifdef REG_PARM_STACK_SPACE
6431
- all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
6432
+#ifdef INCOMING_REG_PARM_STACK_SPACE
6433
+ all->reg_parm_stack_space
6434
+ = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
6438
@@ -4518,6 +4523,7 @@
6439
/* ??? This could be set on a per-function basis by the front-end
6440
but is this worth the hassle? */
6441
cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
6442
+ cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
6446
Index: gcc/tree-vectorizer.h
6447
===================================================================
6448
--- a/src/gcc/tree-vectorizer.h (.../tags/gcc_4_8_3_release)
6449
+++ b/src/gcc/tree-vectorizer.h (.../branches/gcc-4_8-branch)
6451
#define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped
6453
#define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
6454
-(L)->may_misalign_stmts.length () > 0
6455
+((L)->may_misalign_stmts.length () > 0)
6456
#define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \
6457
-(L)->may_alias_ddrs.length () > 0
6458
+((L)->may_alias_ddrs.length () > 0)
6460
#define NITERS_KNOWN_P(n) \
6461
(host_integerp ((n),0) \
6463
extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
6464
extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
6465
tree *, gimple_stmt_iterator *,
6466
- gimple *, bool, bool *);
6467
+ gimple *, bool, bool *,
6468
+ tree = NULL_TREE);
6469
extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
6470
extern tree vect_create_destination_var (tree, tree);
6471
extern bool vect_grouped_store_supported (tree, unsigned HOST_WIDE_INT);
6473
extern int vect_get_place_in_interleaving_chain (gimple, gimple);
6474
extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
6475
extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
6476
- tree, struct loop *);
6477
+ tree, struct loop *,
6478
+ tree = NULL_TREE);
6480
/* In tree-vect-loop.c. */
6481
/* FORNOW: Used in tree-parloops.c. */
6482
Index: gcc/tree-vect-loop.c
6483
===================================================================
6484
--- a/src/gcc/tree-vect-loop.c (.../tags/gcc_4_8_3_release)
6485
+++ b/src/gcc/tree-vect-loop.c (.../branches/gcc-4_8-branch)
6486
@@ -2205,7 +2205,8 @@
6489
def1 = SSA_NAME_DEF_STMT (op1);
6490
- if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
6491
+ if (gimple_bb (def1)
6492
+ && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
6494
&& flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
6495
&& is_gimple_assign (def1))
6496
Index: gcc/tree-vect-data-refs.c
6497
===================================================================
6498
--- a/src/gcc/tree-vect-data-refs.c (.../tags/gcc_4_8_3_release)
6499
+++ b/src/gcc/tree-vect-data-refs.c (.../branches/gcc-4_8-branch)
6500
@@ -3553,6 +3553,9 @@
6502
if LOOP=i_loop: &in (relative to i_loop)
6503
if LOOP=j_loop: &in+i*2B (relative to j_loop)
6504
+ BYTE_OFFSET: Optional, defaulted to NULL. If supplied, it is added to the
6505
+ initial address. Unlike OFFSET, which is number of elements to
6506
+ be added, BYTE_OFFSET is measured in bytes.
6509
1. Return an SSA_NAME whose value is the address of the memory location of
6510
@@ -3566,7 +3569,8 @@
6511
vect_create_addr_base_for_vector_ref (gimple stmt,
6512
gimple_seq *new_stmt_list,
6514
- struct loop *loop)
6515
+ struct loop *loop,
6518
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
6519
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
6520
@@ -3628,7 +3632,17 @@
6521
base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
6522
gimple_seq_add_seq (new_stmt_list, seq);
6526
+ tree tmp = create_tmp_var (sizetype, "offset");
6528
+ byte_offset = fold_convert (sizetype, byte_offset);
6529
+ base_offset = fold_build2 (PLUS_EXPR, sizetype,
6530
+ base_offset, byte_offset);
6531
+ base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
6532
+ gimple_seq_add_seq (new_stmt_list, seq);
6535
/* base + base_offset */
6537
addr_base = fold_build_pointer_plus (data_ref_base, base_offset);
6538
@@ -3692,6 +3706,10 @@
6539
5. BSI: location where the new stmts are to be placed if there is no loop
6540
6. ONLY_INIT: indicate if ap is to be updated in the loop, or remain
6541
pointing to the initial address.
6542
+ 7. BYTE_OFFSET (optional, defaults to NULL): a byte offset to be added
6543
+ to the initial address accessed by the data-ref in STMT. This is
6544
+ similar to OFFSET, but OFFSET is counted in elements, while BYTE_OFFSET
6548
1. Declare a new ptr to vector_type, and have it point to the base of the
6549
@@ -3705,6 +3723,8 @@
6550
initial_address = &a[init];
6551
if OFFSET is supplied:
6552
initial_address = &a[init + OFFSET];
6553
+ if BYTE_OFFSET is supplied:
6554
+ initial_address = &a[init] + BYTE_OFFSET;
6556
Return the initial_address in INITIAL_ADDRESS.
6558
@@ -3722,7 +3742,7 @@
6559
vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
6560
tree offset, tree *initial_address,
6561
gimple_stmt_iterator *gsi, gimple *ptr_incr,
6562
- bool only_init, bool *inv_p)
6563
+ bool only_init, bool *inv_p, tree byte_offset)
6565
const char *base_name;
6566
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
6567
@@ -3881,10 +3901,10 @@
6568
/* (2) Calculate the initial address of the aggregate-pointer, and set
6569
the aggregate-pointer to point to it before the loop. */
6571
- /* Create: (&(base[init_val+offset]) in the loop preheader. */
6572
+ /* Create: (&(base[init_val+offset]+byte_offset) in the loop preheader. */
6574
new_temp = vect_create_addr_base_for_vector_ref (stmt, &new_stmt_list,
6576
+ offset, loop, byte_offset);
6580
Index: gcc/emit-rtl.c
6581
===================================================================
6582
--- a/src/gcc/emit-rtl.c (.../tags/gcc_4_8_3_release)
6583
+++ b/src/gcc/emit-rtl.c (.../branches/gcc-4_8-branch)
6586
/* Return true if the given memory attributes are equal. */
6590
mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
6592
return (p->alias == q->alias
6593
Index: gcc/gimple-fold.c
6594
===================================================================
6595
--- a/src/gcc/gimple-fold.c (.../tags/gcc_4_8_3_release)
6596
+++ b/src/gcc/gimple-fold.c (.../branches/gcc-4_8-branch)
6597
@@ -2955,8 +2955,8 @@
6599
if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
6600
/* VIEW_CONVERT_EXPR is defined only for matching sizes. */
6601
- && operand_equal_p (TYPE_SIZE (type),
6602
- TYPE_SIZE (TREE_TYPE (ctor)), 0))
6603
+ && !compare_tree_int (TYPE_SIZE (type), size)
6604
+ && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
6606
ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
6607
ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
6608
Index: gcc/emit-rtl.h
6609
===================================================================
6610
--- a/src/gcc/emit-rtl.h (.../tags/gcc_4_8_3_release)
6611
+++ b/src/gcc/emit-rtl.h (.../branches/gcc-4_8-branch)
6613
#ifndef GCC_EMIT_RTL_H
6614
#define GCC_EMIT_RTL_H
6616
+/* Return whether two MEM_ATTRs are equal. */
6617
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
6619
/* Set the alias set of MEM to SET. */
6620
extern void set_mem_alias_set (rtx, alias_set_type);
6622
Index: gcc/tree-cfgcleanup.c
6623
===================================================================
6624
--- a/src/gcc/tree-cfgcleanup.c (.../tags/gcc_4_8_3_release)
6625
+++ b/src/gcc/tree-cfgcleanup.c (.../branches/gcc-4_8-branch)
6626
@@ -498,7 +498,20 @@
6628
/* First split basic block if stmt is not last. */
6629
if (stmt != gsi_stmt (gsi_last_bb (bb)))
6630
- split_block (bb, stmt);
6632
+ if (stmt == gsi_stmt (gsi_last_nondebug_bb (bb)))
6634
+ /* Don't split if there are only debug stmts
6635
+ after stmt, that can result in -fcompare-debug
6636
+ failures. Remove the debug stmts instead,
6637
+ they should be all unreachable anyway. */
6638
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
6639
+ for (gsi_next (&gsi); !gsi_end_p (gsi); )
6640
+ gsi_remove (&gsi, true);
6643
+ split_block (bb, stmt);
6646
changed |= remove_fallthru_edge (bb->succs);
6648
Index: gcc/common.opt
6649
===================================================================
6650
--- a/src/gcc/common.opt (.../tags/gcc_4_8_3_release)
6651
+++ b/src/gcc/common.opt (.../branches/gcc-4_8-branch)
6652
@@ -1226,6 +1226,10 @@
6653
Common Report Var(flag_tm)
6654
Enable support for GNU transactional memory
6657
+Common Report Var(flag_gnu_unique) Init(1)
6658
+Use STB_GNU_UNIQUE if supported by the assembler
6662
Does nothing. Preserved for backward compatibility.
6663
Index: gcc/tree-vect-patterns.c
6664
===================================================================
6665
--- a/src/gcc/tree-vect-patterns.c (.../tags/gcc_4_8_3_release)
6666
+++ b/src/gcc/tree-vect-patterns.c (.../branches/gcc-4_8-branch)
6670
oprnd00 = gimple_assign_rhs1 (def_stmt);
6671
- if (!type_conversion_p (oprnd0, stmt, true, &half_type1, &def_stmt,
6672
+ if (!type_conversion_p (oprnd1, stmt, true, &half_type1, &def_stmt,
6676
Index: gcc/sched-deps.c
6677
===================================================================
6678
--- a/src/gcc/sched-deps.c (.../tags/gcc_4_8_3_release)
6679
+++ b/src/gcc/sched-deps.c (.../branches/gcc-4_8-branch)
6680
@@ -2744,7 +2744,8 @@
6681
Consider for instance a volatile asm that changes the fpu rounding
6682
mode. An insn should not be moved across this even if it only uses
6683
pseudo-regs because it might give an incorrectly rounded result. */
6684
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
6685
+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
6686
+ && !DEBUG_INSN_P (insn))
6687
reg_pending_barrier = TRUE_BARRIER;
6689
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
6690
Index: gcc/tree-vect-stmts.c
6691
===================================================================
6692
--- a/src/gcc/tree-vect-stmts.c (.../tags/gcc_4_8_3_release)
6693
+++ b/src/gcc/tree-vect-stmts.c (.../branches/gcc-4_8-branch)
6694
@@ -4319,6 +4319,7 @@
6695
int i, j, group_size;
6696
tree msq = NULL_TREE, lsq;
6697
tree offset = NULL_TREE;
6698
+ tree byte_offset = NULL_TREE;
6699
tree realignment_token = NULL_TREE;
6701
vec<tree> dr_chain = vNULL;
6702
@@ -4934,7 +4935,8 @@
6703
if (alignment_support_scheme == dr_explicit_realign_optimized)
6705
phi = SSA_NAME_DEF_STMT (msq);
6706
- offset = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
6707
+ byte_offset = size_binop (MINUS_EXPR, TYPE_SIZE_UNIT (vectype),
6712
@@ -4955,7 +4957,8 @@
6714
dataref_ptr = vect_create_data_ref_ptr (first_stmt, aggr_type, at_loop,
6715
offset, &dummy, gsi,
6716
- &ptr_incr, false, &inv_p);
6717
+ &ptr_incr, false, &inv_p,
6720
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
6721
TYPE_SIZE_UNIT (aggr_type));
6722
Index: gcc/config/alpha/elf.h
6723
===================================================================
6724
--- a/src/gcc/config/alpha/elf.h (.../tags/gcc_4_8_3_release)
6725
+++ b/src/gcc/config/alpha/elf.h (.../branches/gcc-4_8-branch)
6726
@@ -126,6 +126,10 @@
6727
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
6728
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
6730
+/* This variable should be set to 'true' if the target ABI requires
6731
+ unwinding tables even when exceptions are not used. */
6732
+#define TARGET_UNWIND_TABLES_DEFAULT true
6734
/* Select a format to encode pointers in exception handling data. CODE
6735
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
6736
true if the symbol may be affected by dynamic relocations.
6737
Index: gcc/config/alpha/alpha.c
6738
===================================================================
6739
--- a/src/gcc/config/alpha/alpha.c (.../tags/gcc_4_8_3_release)
6740
+++ b/src/gcc/config/alpha/alpha.c (.../branches/gcc-4_8-branch)
6741
@@ -8658,6 +8658,11 @@
6746
+ /* __builtin_unreachable can expand to no code at all,
6747
+ leaving (barrier) RTXes in the instruction stream. */
6748
+ goto close_shadow_notrapb;
6753
@@ -8673,6 +8678,7 @@
6754
n = emit_insn_before (gen_trapb (), i);
6755
PUT_MODE (n, TImode);
6756
PUT_MODE (i, TImode);
6757
+ close_shadow_notrapb:
6761
Index: gcc/config/elfos.h
6762
===================================================================
6763
--- a/src/gcc/config/elfos.h (.../tags/gcc_4_8_3_release)
6764
+++ b/src/gcc/config/elfos.h (.../branches/gcc-4_8-branch)
6766
/* Write the extra assembler code needed to declare an object properly. */
6768
#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
6769
-#define USE_GNU_UNIQUE_OBJECT 1
6770
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
6772
#define USE_GNU_UNIQUE_OBJECT 0
6774
Index: gcc/config/sparc/sync.md
6775
===================================================================
6776
--- a/src/gcc/config/sparc/sync.md (.../tags/gcc_4_8_3_release)
6777
+++ b/src/gcc/config/sparc/sync.md (.../branches/gcc-4_8-branch)
6780
[(set_attr "type" "multi")])
6782
+;; For LEON3, STB has the effect of membar #StoreLoad.
6783
+(define_insn "*membar_storeload_leon3"
6784
+ [(set (match_operand:BLK 0 "" "")
6785
+ (unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
6787
+ "stb\t%%g0, [%%sp-1]"
6788
+ [(set_attr "type" "store")])
6790
;; For V8, LDSTUB has the effect of membar #StoreLoad.
6791
(define_insn "*membar_storeload"
6792
[(set (match_operand:BLK 0 "" "")
6793
(unspec:BLK [(match_dup 0) (const_int 2)] UNSPEC_MEMBAR))]
6795
+ "TARGET_V8 && !TARGET_LEON3"
6796
"ldstub\t[%%sp-1], %%g0"
6797
[(set_attr "type" "multi")])
6799
Index: gcc/config/i386/i386.md
6800
===================================================================
6801
--- a/src/gcc/config/i386/i386.md (.../tags/gcc_4_8_3_release)
6802
+++ b/src/gcc/config/i386/i386.md (.../branches/gcc-4_8-branch)
6803
@@ -5339,66 +5339,37 @@
6805
;; Avoid store forwarding (partial memory) stall penalty by extending
6806
;; SImode value to DImode through XMM register instead of pushing two
6807
-;; SImode values to stack. Note that even !TARGET_INTER_UNIT_MOVES
6808
-;; targets benefit from this optimization. Also note that fild
6809
-;; loads from memory only.
6810
+;; SImode values to stack. Also note that fild loads from memory only.
6812
-(define_insn "*floatunssi<mode>2_1"
6813
- [(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
6814
+(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
6815
+ [(set (match_operand:X87MODEF 0 "register_operand" "=f")
6816
(unsigned_float:X87MODEF
6817
- (match_operand:SI 1 "nonimmediate_operand" "x,m")))
6818
- (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
6819
- (clobber (match_scratch:SI 3 "=X,x"))]
6820
+ (match_operand:SI 1 "nonimmediate_operand" "rm")))
6821
+ (clobber (match_scratch:DI 3 "=x"))
6822
+ (clobber (match_operand:DI 2 "memory_operand" "=m"))]
6824
&& TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6826
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES"
6828
+ "&& reload_completed"
6829
+ [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
6830
+ (set (match_dup 2) (match_dup 3))
6831
+ (set (match_dup 0)
6832
+ (float:X87MODEF (match_dup 2)))]
6834
[(set_attr "type" "multi")
6835
(set_attr "mode" "<MODE>")])
6838
- [(set (match_operand:X87MODEF 0 "register_operand")
6839
- (unsigned_float:X87MODEF
6840
- (match_operand:SI 1 "register_operand")))
6841
- (clobber (match_operand:DI 2 "memory_operand"))
6842
- (clobber (match_scratch:SI 3))]
6844
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6846
- && reload_completed"
6847
- [(set (match_dup 2) (match_dup 1))
6848
- (set (match_dup 0)
6849
- (float:X87MODEF (match_dup 2)))]
6850
- "operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0);")
6853
- [(set (match_operand:X87MODEF 0 "register_operand")
6854
- (unsigned_float:X87MODEF
6855
- (match_operand:SI 1 "memory_operand")))
6856
- (clobber (match_operand:DI 2 "memory_operand"))
6857
- (clobber (match_scratch:SI 3))]
6859
- && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6861
- && reload_completed"
6862
- [(set (match_dup 2) (match_dup 3))
6863
- (set (match_dup 0)
6864
- (float:X87MODEF (match_dup 2)))]
6866
- emit_move_insn (operands[3], operands[1]);
6867
- operands[3] = simplify_gen_subreg (DImode, operands[3], SImode, 0);
6870
(define_expand "floatunssi<mode>2"
6872
[(set (match_operand:X87MODEF 0 "register_operand")
6873
(unsigned_float:X87MODEF
6874
(match_operand:SI 1 "nonimmediate_operand")))
6875
- (clobber (match_dup 2))
6876
- (clobber (match_scratch:SI 3))])]
6877
+ (clobber (match_scratch:DI 3))
6878
+ (clobber (match_dup 2))])]
6880
&& ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
6882
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES)
6883
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
6885
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
6886
Index: gcc/config/i386/driver-i386.c
6887
===================================================================
6888
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_8_3_release)
6889
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_8-branch)
6890
@@ -713,6 +713,11 @@
6891
/* Assume Core 2. */
6894
+ else if (has_longmode)
6895
+ /* Perhaps some emulator? Assume x86-64, otherwise gcc
6896
+ -march=native would be unusable for 64-bit compilations,
6897
+ as all the CPUs below are 32-bit only. */
6900
/* It is Core Duo. */
6902
Index: gcc/config/i386/i386.c
6903
===================================================================
6904
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_4_8_3_release)
6905
+++ b/src/gcc/config/i386/i386.c (.../branches/gcc-4_8-branch)
6906
@@ -20505,7 +20505,7 @@
6907
t1 = gen_reg_rtx (V32QImode);
6908
t2 = gen_reg_rtx (V32QImode);
6909
t3 = gen_reg_rtx (V32QImode);
6910
- vt2 = GEN_INT (128);
6911
+ vt2 = GEN_INT (-128);
6912
for (i = 0; i < 32; i++)
6914
vt = gen_rtx_CONST_VECTOR (V32QImode, gen_rtvec_v (32, vec));
6915
@@ -24640,13 +24640,17 @@
6919
- /* Assume that region is SCC, i.e. all immediate predecessors
6920
- of non-head block are in the same region. */
6922
+ /* Regions are SCCs with the exception of selective
6923
+ scheduling with pipelining of outer blocks enabled.
6924
+ So also check that immediate predecessors of a non-head
6925
+ block are in the same region. */
6926
FOR_EACH_EDGE (e, ei, bb->preds)
6928
/* Avoid creating of loop-carried dependencies through
6929
- using topological odering in region. */
6930
- if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
6931
+ using topological ordering in the region. */
6932
+ if (rgn == CONTAINING_RGN (e->src->index)
6933
+ && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
6934
add_dependee_for_func_arg (first_arg, e->src);
6937
Index: gcc/config/sh/sh.c
6938
===================================================================
6939
--- a/src/gcc/config/sh/sh.c (.../tags/gcc_4_8_3_release)
6940
+++ b/src/gcc/config/sh/sh.c (.../branches/gcc-4_8-branch)
6941
@@ -808,6 +808,12 @@
6942
targetm.asm_out.aligned_op.di = NULL;
6943
targetm.asm_out.unaligned_op.di = NULL;
6946
+ /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
6947
+ Disable it for everything else. */
6948
+ if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
6949
+ TARGET_USERMODE = false;
6953
if (! strcmp (sh_div_str, "call-div1"))
6954
Index: gcc/config/sh/sync.md
6955
===================================================================
6956
--- a/src/gcc/config/sh/sync.md (.../tags/gcc_4_8_3_release)
6957
+++ b/src/gcc/config/sh/sync.md (.../branches/gcc-4_8-branch)
6961
" mov.<bwl> %3,@%1" "\n"
6965
[(set_attr "length" "20")])
6967
@@ -1353,7 +1353,7 @@
6969
" mov.b @%0,r0" "\n"
6970
" mov.b %1,@%0" "\n"
6975
[(set_attr "length" "16")])
6976
Index: gcc/config/sh/sh.opt
6977
===================================================================
6978
--- a/src/gcc/config/sh/sh.opt (.../tags/gcc_4_8_3_release)
6979
+++ b/src/gcc/config/sh/sh.opt (.../branches/gcc-4_8-branch)
6981
Cost to assume for a multiply insn
6984
-Target Report RejectNegative Var(TARGET_USERMODE)
6985
+Target Var(TARGET_USERMODE)
6986
Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
6988
;; We might want to enable this by default for TARGET_HARD_SH4, because
6989
Index: gcc/config/microblaze/predicates.md
6990
===================================================================
6991
--- a/src/gcc/config/microblaze/predicates.md (.../tags/gcc_4_8_3_release)
6992
+++ b/src/gcc/config/microblaze/predicates.md (.../branches/gcc-4_8-branch)
6994
(ior (match_operand 0 "const_0_operand")
6995
(match_operand 0 "register_operand")))
6997
-(define_predicate "reg_or_mem_operand"
6998
- (ior (match_operand 0 "memory_operand")
6999
- (match_operand 0 "register_operand")))
7001
;; Return if the operand is either the PC or a label_ref.
7002
(define_special_predicate "pc_or_label_operand"
7003
(ior (match_code "pc,label_ref")
7004
Index: gcc/config/microblaze/microblaze.md
7005
===================================================================
7006
--- a/src/gcc/config/microblaze/microblaze.md (.../tags/gcc_4_8_3_release)
7007
+++ b/src/gcc/config/microblaze/microblaze.md (.../branches/gcc-4_8-branch)
7008
@@ -1119,18 +1119,6 @@
7012
-;;Load and store reverse
7013
-(define_insn "movsi4_rev"
7014
- [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Q")
7015
- (bswap:SI (match_operand:SF 1 "reg_or_mem_operand" "Q,r")))]
7020
- [(set_attr "type" "load,store")
7021
- (set_attr "mode" "SI")
7022
- (set_attr "length" "4,4")])
7024
;; 32-bit floating point moves
7026
(define_expand "movsf"
7027
Index: gcc/config/avr/avr-fixed.md
7028
===================================================================
7029
--- a/src/gcc/config/avr/avr-fixed.md (.../tags/gcc_4_8_3_release)
7030
+++ b/src/gcc/config/avr/avr-fixed.md (.../branches/gcc-4_8-branch)
7034
// Input and output of the libgcc function
7035
- const unsigned int regno_in[] = { -1, 22, 22, -1, 18 };
7036
- const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
7037
+ const unsigned int regno_in[] = { -1U, 22, 22, -1U, 18 };
7038
+ const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };
7040
operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE (<MODE>mode)]);
7041
operands[4] = gen_rtx_REG (<MODE>mode, regno_in[(size_t) GET_MODE_SIZE (<MODE>mode)]);
7042
Index: gcc/config/avr/avr.md
7043
===================================================================
7044
--- a/src/gcc/config/avr/avr.md (.../tags/gcc_4_8_3_release)
7045
+++ b/src/gcc/config/avr/avr.md (.../branches/gcc-4_8-branch)
7046
@@ -367,6 +367,15 @@
7051
+ // Avoid (subreg (mem)) for non-generic address spaces below. Because
7052
+ // of the poor addressing capabilities of these spaces it's better to
7053
+ // load them in one chunk. And it avoids PR61443.
7055
+ if (MEM_P (operands[0])
7056
+ && !ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[0])))
7057
+ operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
7059
for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
7061
rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
7062
Index: gcc/config/avr/avr.h
7063
===================================================================
7064
--- a/src/gcc/config/avr/avr.h (.../tags/gcc_4_8_3_release)
7065
+++ b/src/gcc/config/avr/avr.h (.../branches/gcc-4_8-branch)
7066
@@ -250,18 +250,18 @@
7067
#define REG_CLASS_CONTENTS { \
7068
{0x00000000,0x00000000}, /* NO_REGS */ \
7069
{0x00000001,0x00000000}, /* R0_REG */ \
7070
- {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
7071
- {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
7072
- {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
7073
+ {3u << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \
7074
+ {3u << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \
7075
+ {3u << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \
7076
{0x00000000,0x00000003}, /* STACK_REG, STACK */ \
7077
- {(3 << REG_Y) | (3 << REG_Z), \
7078
+ {(3u << REG_Y) | (3u << REG_Z), \
7079
0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \
7080
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \
7081
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z), \
7082
0x00000000}, /* POINTER_REGS, r26 - r31 */ \
7083
- {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \
7084
+ {(3u << REG_X) | (3u << REG_Y) | (3u << REG_Z) | (3u << REG_W), \
7085
0x00000000}, /* ADDW_REGS, r24 - r31 */ \
7086
{0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \
7087
- {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \
7088
+ {(3u << REG_X)|(3u << REG_Y)|(3u << REG_Z)|(3u << REG_W)|(0xffu << 16),\
7089
0x00000000}, /* LD_REGS, r16 - r31 */ \
7090
{0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \
7091
{0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \
7092
Index: gcc/config/aarch64/arm_neon.h
7093
===================================================================
7094
--- a/src/gcc/config/aarch64/arm_neon.h (.../tags/gcc_4_8_3_release)
7095
+++ b/src/gcc/config/aarch64/arm_neon.h (.../branches/gcc-4_8-branch)
7096
@@ -13815,7 +13815,7 @@
7098
__asm__ ("sqdmulh %0.4h,%1.4h,%2.h[0]"
7102
: /* No clobbers */);
7105
@@ -13837,7 +13837,7 @@
7107
__asm__ ("sqdmulh %0.8h,%1.8h,%2.h[0]"
7111
: /* No clobbers */);
7114
Index: gcc/config/aarch64/aarch64.md
7115
===================================================================
7116
--- a/src/gcc/config/aarch64/aarch64.md (.../tags/gcc_4_8_3_release)
7117
+++ b/src/gcc/config/aarch64/aarch64.md (.../branches/gcc-4_8-branch)
7118
@@ -3292,6 +3292,7 @@
7119
(unspec:DI [(match_operand:DI 0 "aarch64_valid_symref" "S")]
7121
(clobber (reg:DI LR_REGNUM))
7122
+ (clobber (reg:CC CC_REGNUM))
7123
(clobber (match_scratch:DI 1 "=r"))]
7125
"adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\tx0, x0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
7126
Index: gcc/config/aarch64/aarch64.c
7127
===================================================================
7128
--- a/src/gcc/config/aarch64/aarch64.c (.../tags/gcc_4_8_3_release)
7129
+++ b/src/gcc/config/aarch64/aarch64.c (.../branches/gcc-4_8-branch)
7130
@@ -1201,6 +1201,7 @@
7131
CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
7132
int ncrn, nvrn, nregs;
7133
bool allocate_ncrn, allocate_nvrn;
7134
+ HOST_WIDE_INT size;
7136
/* We need to do this once per argument. */
7137
if (pcum->aapcs_arg_processed)
7138
@@ -1208,6 +1209,11 @@
7140
pcum->aapcs_arg_processed = true;
7142
+ /* Size in bytes, rounded to the nearest multiple of 8 bytes. */
7144
+ = AARCH64_ROUND_UP (type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode),
7147
allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode);
7148
allocate_nvrn = aarch64_vfp_is_call_candidate (pcum_v,
7150
@@ -1258,10 +1264,8 @@
7153
ncrn = pcum->aapcs_ncrn;
7154
- nregs = ((type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode))
7155
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
7156
+ nregs = size / UNITS_PER_WORD;
7159
/* C6 - C9. though the sign and zero extension semantics are
7160
handled elsewhere. This is the case where the argument fits
7161
entirely general registers. */
7162
@@ -1309,13 +1313,12 @@
7163
pcum->aapcs_nextncrn = NUM_ARG_REGS;
7165
/* The argument is passed on stack; record the needed number of words for
7166
- this argument (we can re-use NREGS) and align the total size if
7168
+ this argument and align the total size if necessary. */
7170
- pcum->aapcs_stack_words = nregs;
7171
+ pcum->aapcs_stack_words = size / UNITS_PER_WORD;
7172
if (aarch64_function_arg_alignment (mode, type) == 16 * BITS_PER_UNIT)
7173
pcum->aapcs_stack_size = AARCH64_ROUND_UP (pcum->aapcs_stack_size,
7174
- 16 / UNITS_PER_WORD) + 1;
7175
+ 16 / UNITS_PER_WORD);
7179
Index: gcc/config/aarch64/aarch64-linux.h
7180
===================================================================
7181
--- a/src/gcc/config/aarch64/aarch64-linux.h (.../tags/gcc_4_8_3_release)
7182
+++ b/src/gcc/config/aarch64/aarch64-linux.h (.../branches/gcc-4_8-branch)
7187
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
7189
#endif /* GCC_AARCH64_LINUX_H */
7190
Index: gcc/config/rs6000/constraints.md
7191
===================================================================
7192
--- a/src/gcc/config/rs6000/constraints.md (.../tags/gcc_4_8_3_release)
7193
+++ b/src/gcc/config/rs6000/constraints.md (.../branches/gcc-4_8-branch)
7195
(define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
7196
"If -mmfpgpr was used, a floating point register or NO_REGS.")
7198
+(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
7199
+ "Floating point register if direct moves are available, or NO_REGS.")
7201
+;; At present, DImode is not allowed in the Altivec registers. If in the
7202
+;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
7203
+(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
7204
+ "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
7206
+(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
7207
+ "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
7209
+(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
7210
+ "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
7212
(define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
7213
"Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
7216
"Floating point register if the STFIWX instruction is enabled or NO_REGS.")
7218
(define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
7219
- "VSX vector register to hold scalar float values or NO_REGS.")
7220
+ "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
7222
(define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
7223
"Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
7224
Index: gcc/config/rs6000/predicates.md
7225
===================================================================
7226
--- a/src/gcc/config/rs6000/predicates.md (.../tags/gcc_4_8_3_release)
7227
+++ b/src/gcc/config/rs6000/predicates.md (.../branches/gcc-4_8-branch)
7228
@@ -1795,7 +1795,7 @@
7229
(define_predicate "fusion_gpr_mem_load"
7230
(match_code "mem,sign_extend,zero_extend")
7233
+ rtx addr, base, offset;
7235
/* Handle sign/zero extend. */
7236
if (GET_CODE (op) == ZERO_EXTEND
7237
@@ -1825,24 +1825,79 @@
7240
addr = XEXP (op, 0);
7241
+ if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
7244
+ base = XEXP (addr, 0);
7245
+ if (!base_reg_operand (base, GET_MODE (base)))
7248
+ offset = XEXP (addr, 1);
7250
if (GET_CODE (addr) == PLUS)
7251
+ return satisfies_constraint_I (offset);
7253
+ else if (GET_CODE (addr) == LO_SUM)
7255
- rtx base = XEXP (addr, 0);
7256
- rtx offset = XEXP (addr, 1);
7257
+ if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
7258
+ return small_toc_ref (offset, GET_MODE (offset));
7260
- return (base_reg_operand (base, GET_MODE (base))
7261
- && satisfies_constraint_I (offset));
7262
+ else if (TARGET_ELF && !TARGET_POWERPC64)
7263
+ return CONSTANT_P (offset);
7266
- else if (GET_CODE (addr) == LO_SUM)
7270
+;; Match a GPR load (lbz, lhz, lwz, ld) that uses a combined address in the
7271
+;; memory field with both the addis and the memory offset. Sign extension
7272
+;; is not handled here, since lha and lwa are not fused.
7273
+(define_predicate "fusion_gpr_mem_combo"
7274
+ (match_code "mem,zero_extend")
7276
+ rtx addr, base, offset;
7278
+ /* Handle zero extend. */
7279
+ if (GET_CODE (op) == ZERO_EXTEND)
7281
- rtx base = XEXP (addr, 0);
7282
- rtx offset = XEXP (addr, 1);
7283
+ op = XEXP (op, 0);
7284
+ mode = GET_MODE (op);
7287
- if (!base_reg_operand (base, GET_MODE (base)))
7299
+ if (!TARGET_POWERPC64)
7303
- else if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
7308
+ addr = XEXP (op, 0);
7309
+ if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
7312
+ base = XEXP (addr, 0);
7313
+ if (!fusion_gpr_addis (base, GET_MODE (base)))
7316
+ offset = XEXP (addr, 1);
7317
+ if (GET_CODE (addr) == PLUS)
7318
+ return satisfies_constraint_I (offset);
7320
+ else if (GET_CODE (addr) == LO_SUM)
7322
+ if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
7323
return small_toc_ref (offset, GET_MODE (offset));
7325
else if (TARGET_ELF && !TARGET_POWERPC64)
7326
Index: gcc/config/rs6000/htm.md
7327
===================================================================
7328
--- a/src/gcc/config/rs6000/htm.md (.../tags/gcc_4_8_3_release)
7329
+++ b/src/gcc/config/rs6000/htm.md (.../branches/gcc-4_8-branch)
7332
UNSPECV_HTM_TABORTWCI))
7333
(set (subreg:CC (match_dup 2) 0) (match_dup 1))
7334
- (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 24)))
7335
+ (set (match_dup 3) (lshiftrt:SI (match_dup 2) (const_int 28)))
7336
(parallel [(set (match_operand:SI 0 "int_reg_operand" "")
7337
(and:SI (match_dup 3) (const_int 15)))
7338
(clobber (scratch:CC))])]
7339
Index: gcc/config/rs6000/freebsd64.h
7340
===================================================================
7341
--- a/src/gcc/config/rs6000/freebsd64.h (.../tags/gcc_4_8_3_release)
7342
+++ b/src/gcc/config/rs6000/freebsd64.h (.../branches/gcc-4_8-branch)
7344
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
7345
#undef ADJUST_FIELD_ALIGN
7346
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
7347
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
7348
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
7351
&& TARGET_ALIGN_NATURAL == 0 \
7352
Index: gcc/config/rs6000/rs6000-protos.h
7353
===================================================================
7354
--- a/src/gcc/config/rs6000/rs6000-protos.h (.../tags/gcc_4_8_3_release)
7355
+++ b/src/gcc/config/rs6000/rs6000-protos.h (.../branches/gcc-4_8-branch)
7357
extern bool gpr_or_gpr_p (rtx, rtx);
7358
extern bool direct_move_p (rtx, rtx);
7359
extern bool quad_load_store_p (rtx, rtx);
7360
-extern bool fusion_gpr_load_p (rtx *, bool);
7361
+extern bool fusion_gpr_load_p (rtx, rtx, rtx, rtx);
7362
extern void expand_fusion_gpr_load (rtx *);
7363
-extern const char *emit_fusion_gpr_load (rtx *);
7364
+extern const char *emit_fusion_gpr_load (rtx, rtx);
7365
extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
7367
extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
7371
extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
7372
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
7373
extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
7375
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
7377
extern rtx rs6000_libcall_value (enum machine_mode);
7378
extern rtx rs6000_va_arg (tree, tree);
7379
extern int function_ok_for_sibcall (tree);
7380
-extern int rs6000_reg_parm_stack_space (tree);
7381
+extern int rs6000_reg_parm_stack_space (tree, bool);
7382
extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
7383
extern bool rs6000_elf_in_small_data_p (const_tree);
7384
#ifdef ARGS_SIZE_RTX
7385
Index: gcc/config/rs6000/rs6000-builtin.def
7386
===================================================================
7387
--- a/src/gcc/config/rs6000/rs6000-builtin.def (.../tags/gcc_4_8_3_release)
7388
+++ b/src/gcc/config/rs6000/rs6000-builtin.def (.../branches/gcc-4_8-branch)
7389
@@ -622,20 +622,13 @@
7390
| RS6000_BTC_TERNARY), \
7391
CODE_FOR_ ## ICODE) /* ICODE */
7393
-/* Miscellaneous builtins. */
7394
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE) \
7395
+/* 128-bit long double floating point builtins. */
7396
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE) \
7397
RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
7398
"__builtin_" NAME, /* NAME */ \
7399
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
7400
+ (RS6000_BTM_HARD_FLOAT /* MASK */ \
7401
+ | RS6000_BTM_LDBL128), \
7402
(RS6000_BTC_ ## ATTR /* ATTR */ \
7403
- | RS6000_BTC_UNARY), \
7404
- CODE_FOR_ ## ICODE) /* ICODE */
7406
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE) \
7407
- RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
7408
- "__builtin_" NAME, /* NAME */ \
7409
- RS6000_BTM_HARD_FLOAT, /* MASK */ \
7410
- (RS6000_BTC_ ## ATTR /* ATTR */ \
7411
| RS6000_BTC_BINARY), \
7412
CODE_FOR_ ## ICODE) /* ICODE */
7414
@@ -1593,10 +1586,8 @@
7415
BU_DFP_MISC_2 (PACK_TD, "pack_dec128", CONST, packtd)
7416
BU_DFP_MISC_2 (UNPACK_TD, "unpack_dec128", CONST, unpacktd)
7418
-BU_MISC_2 (PACK_TF, "pack_longdouble", CONST, packtf)
7419
-BU_MISC_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
7420
-BU_MISC_1 (UNPACK_TF_0, "longdouble_dw0", CONST, unpacktf_0)
7421
-BU_MISC_1 (UNPACK_TF_1, "longdouble_dw1", CONST, unpacktf_1)
7422
+BU_LDBL128_2 (PACK_TF, "pack_longdouble", CONST, packtf)
7423
+BU_LDBL128_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf)
7425
BU_P7_MISC_2 (PACK_V1TI, "pack_vector_int128", CONST, packv1ti)
7426
BU_P7_MISC_2 (UNPACK_V1TI, "unpack_vector_int128", CONST, unpackv1ti)
7427
Index: gcc/config/rs6000/rs6000-c.c
7428
===================================================================
7429
--- a/src/gcc/config/rs6000/rs6000-c.c (.../tags/gcc_4_8_3_release)
7430
+++ b/src/gcc/config/rs6000/rs6000-c.c (.../branches/gcc-4_8-branch)
7431
@@ -4126,7 +4126,8 @@
7432
argument) is reversed. Patch the arguments here before building
7433
the resolved CALL_EXPR. */
7434
if (desc->code == ALTIVEC_BUILTIN_VEC_VCMPGE_P
7435
- && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P)
7436
+ && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P
7437
+ && desc->overloaded_code != VSX_BUILTIN_XVCMPGEDP_P)
7440
t = args[2], args[2] = args[1], args[1] = t;
7441
Index: gcc/config/rs6000/linux64.h
7442
===================================================================
7443
--- a/src/gcc/config/rs6000/linux64.h (.../tags/gcc_4_8_3_release)
7444
+++ b/src/gcc/config/rs6000/linux64.h (.../branches/gcc-4_8-branch)
7446
/* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
7447
#undef ADJUST_FIELD_ALIGN
7448
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
7449
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
7450
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
7453
&& TARGET_ALIGN_NATURAL == 0 \
7454
Index: gcc/config/rs6000/rs6000.c
7455
===================================================================
7456
--- a/src/gcc/config/rs6000/rs6000.c (.../tags/gcc_4_8_3_release)
7457
+++ b/src/gcc/config/rs6000/rs6000.c (.../branches/gcc-4_8-branch)
7459
enum insn_code reload_gpr_vsx; /* INSN to move from GPR to VSX. */
7460
enum insn_code reload_vsx_gpr; /* INSN to move from VSX to GPR. */
7461
addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks. */
7462
+ bool scalar_in_vmx_p; /* Scalar value can go in VMX. */
7465
static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
7466
@@ -1704,8 +1705,7 @@
7468
if (TARGET_VSX && VSX_REGNO_P (regno)
7469
&& (VECTOR_MEM_VSX_P (mode)
7470
- || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
7471
- || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
7472
+ || reg_addr[mode].scalar_in_vmx_p
7473
|| (TARGET_VSX_TIMODE && mode == TImode)
7474
|| (TARGET_VADDUQM && mode == V1TImode)))
7476
@@ -1714,12 +1714,9 @@
7478
if (ALTIVEC_REGNO_P (regno))
7480
- if (mode == SFmode && !TARGET_UPPER_REGS_SF)
7481
+ if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
7484
- if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
7487
return ALTIVEC_REGNO_P (last_regno);
7490
@@ -1897,14 +1894,16 @@
7491
if (rs6000_vector_unit[m] != VECTOR_NONE
7492
|| rs6000_vector_mem[m] != VECTOR_NONE
7493
|| (reg_addr[m].reload_store != CODE_FOR_nothing)
7494
- || (reg_addr[m].reload_load != CODE_FOR_nothing))
7495
+ || (reg_addr[m].reload_load != CODE_FOR_nothing)
7496
+ || reg_addr[m].scalar_in_vmx_p)
7499
- " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
7500
+ " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
7501
rs6000_debug_vector_unit (rs6000_vector_unit[m]),
7502
rs6000_debug_vector_unit (rs6000_vector_mem[m]),
7503
(reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
7504
- (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
7505
+ (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
7506
+ (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
7509
fputs ("\n", stderr);
7510
@@ -2021,6 +2020,10 @@
7511
"wd reg_class = %s\n"
7512
"wf reg_class = %s\n"
7513
"wg reg_class = %s\n"
7514
+ "wh reg_class = %s\n"
7515
+ "wi reg_class = %s\n"
7516
+ "wj reg_class = %s\n"
7517
+ "wk reg_class = %s\n"
7518
"wl reg_class = %s\n"
7519
"wm reg_class = %s\n"
7520
"wr reg_class = %s\n"
7521
@@ -2040,6 +2043,10 @@
7522
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
7523
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
7524
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
7525
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
7526
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
7527
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
7528
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
7529
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
7530
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
7531
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
7532
@@ -2324,6 +2331,8 @@
7534
for (m = 0; m < NUM_MACHINE_MODES; ++m)
7536
+ enum machine_mode m2 = (enum machine_mode)m;
7538
/* SDmode is special in that we want to access it only via REG+REG
7539
addressing on power7 and above, since we want to use the LFIWZX and
7540
STFIWZX instructions to load it. */
7541
@@ -2358,13 +2367,12 @@
7544
&& (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
7545
- && GET_MODE_SIZE (m) <= 8
7546
- && !VECTOR_MODE_P (m)
7547
- && !COMPLEX_MODE_P (m)
7548
+ && GET_MODE_SIZE (m2) <= 8
7549
+ && !VECTOR_MODE_P (m2)
7550
+ && !COMPLEX_MODE_P (m2)
7552
- && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
7553
- && !(m == DFmode && TARGET_UPPER_REGS_DF)
7554
- && !(m == SFmode && TARGET_UPPER_REGS_SF))
7555
+ && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
7556
+ && !reg_addr[m2].scalar_in_vmx_p)
7558
addr_mask |= RELOAD_REG_PRE_INCDEC;
7560
@@ -2595,16 +2603,22 @@
7561
f - Register class to use with traditional SFmode instructions.
7562
v - Altivec register.
7563
wa - Any VSX register.
7564
+ wc - Reserved to represent individual CR bits (used in LLVM).
7565
wd - Preferred register class for V2DFmode.
7566
wf - Preferred register class for V4SFmode.
7567
wg - Float register for power6x move insns.
7568
+ wh - FP register for direct move instructions.
7569
+ wi - FP or VSX register to hold 64-bit integers for VSX insns.
7570
+ wj - FP or VSX register to hold 64-bit integers for direct moves.
7571
+ wk - FP or VSX register to hold 64-bit doubles for direct moves.
7572
wl - Float register if we can do 32-bit signed int loads.
7573
wm - VSX register for ISA 2.07 direct move operations.
7574
+ wn - always NO_REGS.
7575
wr - GPR if 64-bit mode is permitted.
7576
ws - Register class to do ISA 2.06 DF operations.
7577
+ wt - VSX register for TImode in VSX registers.
7578
wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
7579
wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
7580
- wt - VSX register for TImode in VSX registers.
7581
ww - Register class to do SF conversions in with VSX operations.
7582
wx - Float register if we can do 32-bit int stores.
7583
wy - Register class to do ISA 2.07 SF operations.
7584
@@ -2611,21 +2625,22 @@
7585
wz - Float register if we can do 32-bit unsigned int loads. */
7587
if (TARGET_HARD_FLOAT && TARGET_FPRS)
7588
- rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
7589
+ rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS; /* SFmode */
7591
if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
7592
- rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
7593
+ rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS; /* DFmode */
7597
rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
7598
- rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
7599
- rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
7600
+ rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS; /* V2DFmode */
7601
+ rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS; /* V4SFmode */
7602
+ rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS; /* DImode */
7604
if (TARGET_VSX_TIMODE)
7605
- rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
7606
+ rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS; /* TImode */
7608
- if (TARGET_UPPER_REGS_DF)
7609
+ if (TARGET_UPPER_REGS_DF) /* DFmode */
7611
rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
7612
rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
7613
@@ -2639,19 +2654,26 @@
7615
rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
7617
- if (TARGET_MFPGPR)
7618
+ if (TARGET_MFPGPR) /* DFmode */
7619
rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
7622
- rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
7623
+ rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS; /* DImode */
7625
if (TARGET_DIRECT_MOVE)
7626
- rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
7628
+ rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
7629
+ rs6000_constraints[RS6000_CONSTRAINT_wj] /* DImode */
7630
+ = rs6000_constraints[RS6000_CONSTRAINT_wi];
7631
+ rs6000_constraints[RS6000_CONSTRAINT_wk] /* DFmode */
7632
+ = rs6000_constraints[RS6000_CONSTRAINT_ws];
7633
+ rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
7636
if (TARGET_POWERPC64)
7637
rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
7639
- if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
7640
+ if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF) /* SFmode */
7642
rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
7643
rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
7644
@@ -2666,10 +2688,10 @@
7645
rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
7648
- rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
7649
+ rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS; /* DImode */
7652
- rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
7653
+ rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS; /* DImode */
7655
/* Set up the reload helper and direct move functions. */
7656
if (TARGET_VSX || TARGET_ALTIVEC)
7657
@@ -2692,10 +2714,11 @@
7658
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_di_load;
7659
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
7661
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
7662
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
7663
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
7664
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
7665
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
7666
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
7667
+ reg_addr[DFmode].scalar_in_vmx_p = true;
7668
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
7669
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
7671
if (TARGET_P8_VECTOR)
7673
@@ -2703,6 +2726,8 @@
7674
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_di_load;
7675
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_di_store;
7676
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_di_load;
7677
+ if (TARGET_UPPER_REGS_SF)
7678
+ reg_addr[SFmode].scalar_in_vmx_p = true;
7680
if (TARGET_VSX_TIMODE)
7682
@@ -2759,10 +2784,11 @@
7683
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_si_load;
7684
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
7686
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
7687
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
7688
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
7689
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
7690
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
7691
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
7692
+ reg_addr[DFmode].scalar_in_vmx_p = true;
7693
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
7694
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
7696
if (TARGET_P8_VECTOR)
7698
@@ -2770,6 +2796,8 @@
7699
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_si_load;
7700
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_si_store;
7701
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_si_load;
7702
+ if (TARGET_UPPER_REGS_SF)
7703
+ reg_addr[SFmode].scalar_in_vmx_p = true;
7705
if (TARGET_VSX_TIMODE)
7707
@@ -2810,6 +2838,7 @@
7709
for (m = 0; m < NUM_MACHINE_MODES; ++m)
7711
+ enum machine_mode m2 = (enum machine_mode)m;
7712
int reg_size2 = reg_size;
7714
/* TFmode/TDmode always takes 2 registers, even in VSX. */
7715
@@ -2818,7 +2847,7 @@
7716
reg_size2 = UNITS_PER_FP_WORD;
7718
rs6000_class_max_nregs[m][c]
7719
- = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
7720
+ = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
7724
@@ -3014,7 +3043,8 @@
7725
| ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0)
7726
| ((TARGET_HTM) ? RS6000_BTM_HTM : 0)
7727
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0)
7728
- | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0));
7729
+ | ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0)
7730
+ | ((TARGET_LONG_DOUBLE_128) ? RS6000_BTM_LDBL128 : 0));
7733
/* Override command line options. Mostly we process the processor type and
7734
@@ -5861,6 +5891,34 @@
7738
+/* Previous GCC releases forced all vector types to have 16-byte alignment. */
7741
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
7743
+ if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
7745
+ if (computed != 128)
7747
+ static bool warned;
7748
+ if (!warned && warn_psabi)
7751
+ inform (input_location,
7752
+ "the layout of aggregates containing vectors with"
7753
+ " %d-byte alignment will change in a future GCC release",
7754
+ computed / BITS_PER_UNIT);
7757
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
7758
+ keep the special treatment of vector types, but warn if there will
7759
+ be differences in future GCC releases. */
7766
/* AIX increases natural record alignment to doubleword if the first
7767
field is an FP double while the FP fields remain word aligned. */
7769
@@ -6109,7 +6167,8 @@
7772
extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
7773
- gcc_assert (extra >= 0);
7777
if (GET_CODE (addr) == LO_SUM)
7778
/* For lo_sum addresses, we must allow any offset except one that
7779
@@ -9198,14 +9257,51 @@
7780
|| (type && TREE_CODE (type) == VECTOR_TYPE
7781
&& int_size_in_bytes (type) >= 16))
7783
- else if (((TARGET_MACHO && rs6000_darwin64_abi)
7784
- || DEFAULT_ABI == ABI_ELFv2
7785
- || (DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm))
7786
- && mode == BLKmode
7787
- && type && TYPE_ALIGN (type) > 64)
7789
+ /* Aggregate types that need > 8 byte alignment are quadword-aligned
7790
+ in the parameter area in the ELFv2 ABI, and in the AIX ABI unless
7791
+ -mcompat-align-parm is used. */
7792
+ if (((DEFAULT_ABI == ABI_AIX && !rs6000_compat_align_parm)
7793
+ || DEFAULT_ABI == ABI_ELFv2)
7794
+ && type && TYPE_ALIGN (type) > 64)
7796
+ /* "Aggregate" means any AGGREGATE_TYPE except for single-element
7797
+ or homogeneous float/vector aggregates here. We already handled
7798
+ vector aggregates above, but still need to check for float here. */
7799
+ bool aggregate_p = (AGGREGATE_TYPE_P (type)
7800
+ && !SCALAR_FLOAT_MODE_P (elt_mode));
7802
+ /* We used to check for BLKmode instead of the above aggregate type
7803
+ check. Warn when this results in any difference to the ABI. */
7804
+ if (aggregate_p != (mode == BLKmode))
7806
+ static bool warned;
7807
+ if (!warned && warn_psabi)
7810
+ inform (input_location,
7811
+ "the ABI of passing aggregates with %d-byte alignment"
7812
+ " will change in a future GCC release",
7813
+ (int) TYPE_ALIGN (type) / BITS_PER_UNIT);
7817
+ /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
7818
+ keep using the BLKmode check, but warn if there will be differences
7819
+ in future GCC releases. */
7820
+ if (mode == BLKmode)
7824
+ /* Similar for the Darwin64 ABI. Note that for historical reasons we
7825
+ implement the "aggregate type" check as a BLKmode check here; this
7826
+ means certain aggregate types are in fact not aligned. */
7827
+ if (TARGET_MACHO && rs6000_darwin64_abi
7828
+ && mode == BLKmode
7829
+ && type && TYPE_ALIGN (type) > 64)
7832
- return PARM_BOUNDARY;
7834
+ return PARM_BOUNDARY;
7837
/* The offset in words to the start of the parameter save area. */
7838
@@ -10243,6 +10339,7 @@
7841
unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
7844
/* Do we also need to pass this argument in the parameter
7846
@@ -10271,6 +10368,37 @@
7847
rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
7850
+ /* If there were not enough FPRs to hold the argument, the rest
7851
+ usually goes into memory. However, if the current position
7852
+ is still within the register parameter area, a portion may
7853
+ actually have to go into GPRs.
7855
+ Note that it may happen that the portion of the argument
7856
+ passed in the first "half" of the first GPR was already
7857
+ passed in the last FPR as well.
7859
+ For unnamed arguments, we already set up GPRs to cover the
7860
+ whole argument in rs6000_psave_function_arg, so there is
7861
+ nothing further to do at this point.
7863
+ GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
7864
+ GCC releases. To avoid any ABI change on the release branch,
7865
+ we retain that original implementation here, but warn if we
7866
+ encounter a case where the ABI will change in the future. */
7867
+ fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
7868
+ if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
7869
+ && cum->nargs_prototype > 0)
7871
+ static bool warned;
7872
+ if (!warned && warn_psabi)
7875
+ inform (input_location,
7876
+ "the ABI of passing homogeneous float aggregates"
7877
+ " will change in a future GCC release");
7881
return rs6000_finish_function_arg (mode, rvec, k);
7883
else if (align_words < GP_ARG_NUM_REG)
7884
@@ -10497,10 +10625,9 @@
7885
list, or passes any parameter in memory. */
7888
-rs6000_function_parms_need_stack (tree fun)
7889
+rs6000_function_parms_need_stack (tree fun, bool incoming)
7891
- function_args_iterator args_iter;
7893
+ tree fntype, result;
7894
CUMULATIVE_ARGS args_so_far_v;
7895
cumulative_args_t args_so_far;
7897
@@ -10507,26 +10634,57 @@
7899
/* Must be a libcall, all of which only use reg parms. */
7904
- fun = TREE_TYPE (fun);
7905
+ fntype = TREE_TYPE (fun);
7907
/* Varargs functions need the parameter save area. */
7908
- if (!prototype_p (fun) || stdarg_p (fun))
7909
+ if ((!incoming && !prototype_p (fntype)) || stdarg_p (fntype))
7912
- INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fun, NULL_RTX);
7913
+ INIT_CUMULATIVE_INCOMING_ARGS (args_so_far_v, fntype, NULL_RTX);
7914
args_so_far = pack_cumulative_args (&args_so_far_v);
7916
- if (aggregate_value_p (TREE_TYPE (fun), fun))
7917
+ /* When incoming, we will have been passed the function decl.
7918
+ It is necessary to use the decl to handle K&R style functions,
7919
+ where TYPE_ARG_TYPES may not be available. */
7922
- tree type = build_pointer_type (TREE_TYPE (fun));
7923
- rs6000_parm_needs_stack (args_so_far, type);
7924
+ gcc_assert (DECL_P (fun));
7925
+ result = DECL_RESULT (fun);
7928
+ result = TREE_TYPE (fntype);
7930
- FOREACH_FUNCTION_ARGS (fun, arg_type, args_iter)
7931
- if (rs6000_parm_needs_stack (args_so_far, arg_type))
7933
+ if (result && aggregate_value_p (result, fntype))
7935
+ if (!TYPE_P (result))
7936
+ result = TREE_TYPE (result);
7937
+ result = build_pointer_type (result);
7938
+ rs6000_parm_needs_stack (args_so_far, result);
7945
+ for (parm = DECL_ARGUMENTS (fun);
7946
+ parm && parm != void_list_node;
7947
+ parm = TREE_CHAIN (parm))
7948
+ if (rs6000_parm_needs_stack (args_so_far, TREE_TYPE (parm)))
7953
+ function_args_iterator args_iter;
7956
+ FOREACH_FUNCTION_ARGS (fntype, arg_type, args_iter)
7957
+ if (rs6000_parm_needs_stack (args_so_far, arg_type))
7964
@@ -10537,7 +10695,7 @@
7965
all parameters in registers. */
7968
-rs6000_reg_parm_stack_space (tree fun)
7969
+rs6000_reg_parm_stack_space (tree fun, bool incoming)
7971
int reg_parm_stack_space;
7973
@@ -10555,7 +10713,7 @@
7975
/* ??? Recomputing this every time is a bit expensive. Is there
7976
a place to cache this information? */
7977
- if (rs6000_function_parms_need_stack (fun))
7978
+ if (rs6000_function_parms_need_stack (fun, incoming))
7979
reg_parm_stack_space = TARGET_64BIT ? 64 : 32;
7981
reg_parm_stack_space = 0;
7982
@@ -13544,11 +13702,15 @@
7983
else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
7984
== (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
7985
error ("Builtin function %s requires the -mhard-dfp and"
7986
- "-mpower8-vector options", name);
7987
+ " -mpower8-vector options", name);
7988
else if ((fnmask & RS6000_BTM_DFP) != 0)
7989
error ("Builtin function %s requires the -mhard-dfp option", name);
7990
else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
7991
error ("Builtin function %s requires the -mpower8-vector option", name);
7992
+ else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
7993
+ == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
7994
+ error ("Builtin function %s requires the -mhard-float and"
7995
+ " -mlong-double-128 options", name);
7996
else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
7997
error ("Builtin function %s requires the -mhard-float option", name);
7999
@@ -17099,7 +17261,14 @@
8000
prefer Altivec loads.. */
8001
if (rclass == VSX_REGS)
8003
- if (GET_MODE_SIZE (mode) <= 8)
8004
+ if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
8006
+ rtx addr = XEXP (x, 0);
8007
+ if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
8008
+ || legitimate_lo_sum_address_p (mode, addr, false))
8009
+ return FLOAT_REGS;
8011
+ else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
8014
if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
8015
@@ -31413,6 +31582,7 @@
8016
{ "htm", RS6000_BTM_HTM, false, false },
8017
{ "hard-dfp", RS6000_BTM_DFP, false, false },
8018
{ "hard-float", RS6000_BTM_HARD_FLOAT, false, false },
8019
+ { "long-double-128", RS6000_BTM_LDBL128, false, false },
8022
/* Option variables that we want to support inside attribute((target)) and
8023
@@ -32663,25 +32833,14 @@
8025
/* Return true if the peephole2 can combine a load involving a combination of
8026
an addis instruction and a load with an offset that can be fused together on
8031
- operands[0] register set with addis
8032
- operands[1] value set via addis
8033
- operands[2] target register being loaded
8034
- operands[3] D-form memory reference using operands[0].
8036
- In addition, we are passed a boolean that is true if this is a peephole2,
8037
- and we can use see if the addis_reg is dead after the insn and can be
8038
- replaced by the target register. */
8041
-fusion_gpr_load_p (rtx *operands, bool peep2_p)
8042
+fusion_gpr_load_p (rtx addis_reg, /* register set via addis. */
8043
+ rtx addis_value, /* addis value. */
8044
+ rtx target, /* target register that is loaded. */
8045
+ rtx mem) /* bottom part of the memory addr. */
8047
- rtx addis_reg = operands[0];
8048
- rtx addis_value = operands[1];
8049
- rtx target = operands[2];
8050
- rtx mem = operands[3];
8054
@@ -32695,9 +32854,6 @@
8055
if (!fusion_gpr_addis (addis_value, GET_MODE (addis_value)))
8058
- if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
8061
/* Allow sign/zero extension. */
8062
if (GET_CODE (mem) == ZERO_EXTEND
8063
|| (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN))
8064
@@ -32706,22 +32862,22 @@
8068
+ if (!fusion_gpr_mem_load (mem, GET_MODE (mem)))
8071
addr = XEXP (mem, 0); /* either PLUS or LO_SUM. */
8072
if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
8075
/* Validate that the register used to load the high value is either the
8076
- register being loaded, or we can safely replace its use in a peephole2.
8077
+ register being loaded, or we can safely replace its use.
8079
- If this is a peephole2, we assume that there are 2 instructions in the
8080
- peephole (addis and load), so we want to check if the target register was
8081
- not used in the memory address and the register to hold the addis result
8082
- is dead after the peephole. */
8083
+ This function is only called from the peephole2 pass and we assume that
8084
+ there are 2 instructions in the peephole (addis and load), so we want to
8085
+ check if the target register was not used in the memory address and the
8086
+ register to hold the addis result is dead after the peephole. */
8087
if (REGNO (addis_reg) != REGNO (target))
8092
if (reg_mentioned_p (target, mem))
8095
@@ -32762,9 +32918,6 @@
8096
enum machine_mode extend_mode = target_mode;
8097
enum machine_mode ptr_mode = Pmode;
8098
enum rtx_code extend = UNKNOWN;
8099
- rtx addis_reg = ((ptr_mode == target_mode)
8101
- : simplify_subreg (ptr_mode, target, target_mode, 0));
8103
if (GET_CODE (orig_mem) == ZERO_EXTEND
8104
|| (TARGET_P8_FUSION_SIGN && GET_CODE (orig_mem) == SIGN_EXTEND))
8105
@@ -32781,13 +32934,14 @@
8106
gcc_assert (plus_or_lo_sum == PLUS || plus_or_lo_sum == LO_SUM);
8108
offset = XEXP (orig_addr, 1);
8109
- new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_reg, offset);
8110
- new_mem = change_address (orig_mem, target_mode, new_addr);
8111
+ new_addr = gen_rtx_fmt_ee (plus_or_lo_sum, ptr_mode, addis_value, offset);
8112
+ new_mem = replace_equiv_address_nv (orig_mem, new_addr);
8114
if (extend != UNKNOWN)
8115
new_mem = gen_rtx_fmt_e (ZERO_EXTEND, extend_mode, new_mem);
8117
- emit_insn (gen_rtx_SET (VOIDmode, addis_reg, addis_value));
8118
+ new_mem = gen_rtx_UNSPEC (extend_mode, gen_rtvec (1, new_mem),
8119
+ UNSPEC_FUSION_GPR);
8120
emit_insn (gen_rtx_SET (VOIDmode, target, new_mem));
8122
if (extend == SIGN_EXTEND)
8123
@@ -32806,55 +32960,40 @@
8126
/* Return a string to fuse an addis instruction with a gpr load to the same
8127
- register that we loaded up the addis instruction. The code is complicated,
8128
- so we call output_asm_insn directly, and just return "".
8129
+ register that we loaded up the addis instruction. The address that is used
8130
+ is the logical address that was formed during peephole2:
8131
+ (lo_sum (high) (low-part))
8134
- operands[0] register set with addis (must be same reg as target).
8135
- operands[1] value set via addis
8136
- operands[2] target register being loaded
8137
- operands[3] D-form memory reference using operands[0]. */
8138
+ The code is complicated, so we call output_asm_insn directly, and just
8142
-emit_fusion_gpr_load (rtx *operands)
8143
+emit_fusion_gpr_load (rtx target, rtx mem)
8145
- rtx addis_reg = operands[0];
8146
- rtx addis_value = operands[1];
8147
- rtx target = operands[2];
8148
- rtx mem = operands[3];
8153
const char *addis_str = NULL;
8154
const char *load_str = NULL;
8155
- const char *extend_insn = NULL;
8156
const char *mode_name = NULL;
8157
char insn_template[80];
8158
enum machine_mode mode;
8159
const char *comment_str = ASM_COMMENT_START;
8160
- bool sign_p = false;
8162
- gcc_assert (REG_P (addis_reg) && REG_P (target));
8163
- gcc_assert (REGNO (addis_reg) == REGNO (target));
8164
+ if (GET_CODE (mem) == ZERO_EXTEND)
8165
+ mem = XEXP (mem, 0);
8167
+ gcc_assert (REG_P (target) && MEM_P (mem));
8169
if (*comment_str == ' ')
8172
- /* Allow sign/zero extension. */
8173
- if (GET_CODE (mem) == ZERO_EXTEND)
8174
- mem = XEXP (mem, 0);
8176
- else if (GET_CODE (mem) == SIGN_EXTEND && TARGET_P8_FUSION_SIGN)
8179
- mem = XEXP (mem, 0);
8182
- gcc_assert (MEM_P (mem));
8183
addr = XEXP (mem, 0);
8184
if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
8187
+ addis_value = XEXP (addr, 0);
8188
load_offset = XEXP (addr, 1);
8190
/* Now emit the load instruction to the same register. */
8191
@@ -32864,29 +33003,22 @@
8195
- extend_insn = "extsb %0,%0";
8199
mode_name = "short";
8201
- extend_insn = "extsh %0,%0";
8207
- extend_insn = "extsw %0,%0";
8211
- if (TARGET_POWERPC64)
8213
- mode_name = "long";
8217
- gcc_unreachable ();
8218
+ gcc_assert (TARGET_POWERPC64);
8219
+ mode_name = "long";
8224
@@ -33030,14 +33162,6 @@
8226
fatal_insn ("Unable to generate load offset for fusion", load_offset);
8228
- /* Handle sign extension. The peephole2 pass generates this as a separate
8229
- insn, but we handle it just in case it got reattached. */
8232
- gcc_assert (extend_insn != NULL);
8233
- output_asm_insn (extend_insn, fuse_ops);
8239
Index: gcc/config/rs6000/vsx.md
8240
===================================================================
8241
--- a/src/gcc/config/rs6000/vsx.md (.../tags/gcc_4_8_3_release)
8242
+++ b/src/gcc/config/rs6000/vsx.md (.../branches/gcc-4_8-branch)
8244
;; Iterator for the 2 64-bit vector types
8245
(define_mode_iterator VSX_D [V2DF V2DI])
8247
+;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
8248
+;; lxvd2x to properly handle swapping words on little endian
8249
+(define_mode_iterator VSX_LE [V2DF
8252
+ (TI "VECTOR_MEM_VSX_P (TImode)")])
8254
;; Iterator for the 2 32-bit vector types
8255
(define_mode_iterator VSX_W [V4SF V4SI])
8268
-;; Map the register class used for float<->int conversions
8269
+;; Map the register class used for float<->int conversions (floating point side)
8270
+;; VSr2 is the preferred register class, VSr3 is any register class that will
8272
(define_mode_attr VSr2 [(V2DF "wd")
8279
(define_mode_attr VSr3 [(V2DF "wa")
8286
;; Map the register class for sp<->dp float conversions, destination
8287
(define_mode_attr VSr4 [(SF "ws")
8288
@@ -99,12 +113,27 @@
8292
-;; Map the register class for sp<->dp float conversions, destination
8293
+;; Map the register class for sp<->dp float conversions, source
8294
(define_mode_attr VSr5 [(SF "ws")
8299
+;; The VSX register class that a type can occupy, even if it is not the
8300
+;; preferred register class (VSr is the preferred register class that will get
8301
+;; allocated first).
8302
+(define_mode_attr VSa [(V16QI "wa")
8314
;; Same size integer type for floating point data
8315
(define_mode_attr VSi [(V4SF "v4si")
8317
@@ -200,6 +229,16 @@
8321
+;; Map register class for 64-bit element in 128-bit vector for direct moves
8323
+(define_mode_attr VS_64dm [(V2DF "wk")
8326
+;; Map register class for 64-bit element in 128-bit vector for normal register
8327
+;; to register moves
8328
+(define_mode_attr VS_64reg [(V2DF "ws")
8331
;; Constants for creating unspecs
8332
(define_c_enum "unspec"
8335
;; The patterns for LE permuted loads and stores come before the general
8336
;; VSX moves so they match first.
8337
(define_insn_and_split "*vsx_le_perm_load_<mode>"
8338
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
8339
- (match_operand:VSX_D 1 "memory_operand" "Z"))]
8340
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
8341
+ (match_operand:VSX_LE 1 "memory_operand" "Z"))]
8342
"!BYTES_BIG_ENDIAN && TARGET_VSX"
8344
"!BYTES_BIG_ENDIAN && TARGET_VSX"
8346
(set_attr "length" "8")])
8348
(define_insn_and_split "*vsx_le_perm_load_<mode>"
8349
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
8350
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
8351
(match_operand:VSX_W 1 "memory_operand" "Z"))]
8352
"!BYTES_BIG_ENDIAN && TARGET_VSX"
8355
(set_attr "length" "8")])
8357
(define_insn "*vsx_le_perm_store_<mode>"
8358
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
8359
- (match_operand:VSX_D 1 "vsx_register_operand" "+wa"))]
8360
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
8361
+ (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
8362
"!BYTES_BIG_ENDIAN && TARGET_VSX"
8364
[(set_attr "type" "vecstore")
8366
(set_attr "length" "12")])
8369
- [(set (match_operand:VSX_D 0 "memory_operand" "")
8370
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
8371
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
8372
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
8373
"!BYTES_BIG_ENDIAN && TARGET_VSX && !reload_completed"
8377
;; The post-reload split requires that we re-permute the source
8378
;; register in case it is still live.
8380
- [(set (match_operand:VSX_D 0 "memory_operand" "")
8381
- (match_operand:VSX_D 1 "vsx_register_operand" ""))]
8382
+ [(set (match_operand:VSX_LE 0 "memory_operand" "")
8383
+ (match_operand:VSX_LE 1 "vsx_register_operand" ""))]
8384
"!BYTES_BIG_ENDIAN && TARGET_VSX && reload_completed"
8389
(define_insn "*vsx_le_perm_store_<mode>"
8390
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
8391
- (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
8392
+ (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
8393
"!BYTES_BIG_ENDIAN && TARGET_VSX"
8395
[(set_attr "type" "vecstore")
8399
(define_insn "*vsx_mov<mode>"
8400
- [(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")
8401
- (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
8402
+ [(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")
8403
+ (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
8404
"VECTOR_MEM_VSX_P (<MODE>mode)
8405
&& (register_operand (operands[0], <MODE>mode)
8406
|| register_operand (operands[1], <MODE>mode))"
8408
;; instructions are now combined with the insn for the traditional floating
8410
(define_insn "*vsx_add<mode>3"
8411
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8412
- (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8413
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8414
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8415
+ (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8416
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8417
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8418
"xvadd<VSs> %x0,%x1,%x2"
8419
[(set_attr "type" "<VStype_simple>")
8421
(set_attr "fp_type" "<VSfptype_simple>")])
8423
(define_insn "*vsx_sub<mode>3"
8424
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8425
- (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8426
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8427
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8428
+ (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8429
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8430
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8431
"xvsub<VSs> %x0,%x1,%x2"
8432
[(set_attr "type" "<VStype_simple>")
8434
(set_attr "fp_type" "<VSfptype_simple>")])
8436
(define_insn "*vsx_mul<mode>3"
8437
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8438
- (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8439
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8440
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8441
+ (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8442
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8443
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8444
"xvmul<VSs> %x0,%x1,%x2"
8445
[(set_attr "type" "<VStype_simple>")
8447
(set_attr "fp_type" "<VSfptype_mul>")])
8449
(define_insn "*vsx_div<mode>3"
8450
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8451
- (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8452
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8453
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8454
+ (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8455
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8456
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8457
"xvdiv<VSs> %x0,%x1,%x2"
8458
[(set_attr "type" "<VStype_div>")
8461
(define_insn "*vsx_tdiv<mode>3_internal"
8462
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
8463
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
8464
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
8465
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
8466
+ (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
8468
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8469
"x<VSv>tdiv<VSs> %0,%x1,%x2"
8471
(set_attr "fp_type" "<VSfptype_simple>")])
8473
(define_insn "vsx_fre<mode>2"
8474
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8475
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
8476
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8477
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
8479
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8482
(set_attr "fp_type" "<VSfptype_simple>")])
8484
(define_insn "*vsx_neg<mode>2"
8485
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8486
- (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
8487
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8488
+ (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
8489
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8490
"xvneg<VSs> %x0,%x1"
8491
[(set_attr "type" "<VStype_simple>")
8493
(set_attr "fp_type" "<VSfptype_simple>")])
8495
(define_insn "*vsx_abs<mode>2"
8496
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8497
- (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
8498
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8499
+ (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
8500
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8501
"xvabs<VSs> %x0,%x1"
8502
[(set_attr "type" "<VStype_simple>")
8503
@@ -780,10 +819,10 @@
8504
(set_attr "fp_type" "<VSfptype_simple>")])
8506
(define_insn "vsx_nabs<mode>2"
8507
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8508
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8511
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
8512
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
8513
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8514
"xvnabs<VSs> %x0,%x1"
8515
[(set_attr "type" "<VStype_simple>")
8517
(set_attr "fp_type" "<VSfptype_simple>")])
8519
(define_insn "vsx_smax<mode>3"
8520
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8521
- (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8522
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8523
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8524
+ (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8525
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8526
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8527
"xvmax<VSs> %x0,%x1,%x2"
8528
[(set_attr "type" "<VStype_simple>")
8530
(set_attr "fp_type" "<VSfptype_simple>")])
8532
(define_insn "*vsx_smin<mode>3"
8533
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8534
- (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8535
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8536
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8537
+ (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8538
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8539
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8540
"xvmin<VSs> %x0,%x1,%x2"
8541
[(set_attr "type" "<VStype_simple>")
8543
(set_attr "fp_type" "<VSfptype_simple>")])
8545
(define_insn "*vsx_sqrt<mode>2"
8546
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8547
- (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
8548
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8549
+ (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
8550
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8551
"xvsqrt<VSs> %x0,%x1"
8552
[(set_attr "type" "<VStype_sqrt>")
8554
(set_attr "fp_type" "<VSfptype_sqrt>")])
8556
(define_insn "*vsx_rsqrte<mode>2"
8557
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8558
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
8559
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8560
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
8562
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8563
"xvrsqrte<VSs> %x0,%x1"
8566
(define_insn "*vsx_tsqrt<mode>2_internal"
8567
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
8568
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
8569
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
8571
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8572
"x<VSv>tsqrt<VSs> %0,%x1"
8573
@@ -865,11 +904,11 @@
8576
(define_insn "*vsx_fmav4sf4"
8577
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,ws,?wa,?wa,v")
8578
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,wf,?wa,?wa,v")
8580
- (match_operand:V4SF 1 "vsx_register_operand" "%ws,ws,wa,wa,v")
8581
- (match_operand:V4SF 2 "vsx_register_operand" "ws,0,wa,0,v")
8582
- (match_operand:V4SF 3 "vsx_register_operand" "0,ws,0,wa,v")))]
8583
+ (match_operand:V4SF 1 "vsx_register_operand" "%wf,wf,wa,wa,v")
8584
+ (match_operand:V4SF 2 "vsx_register_operand" "wf,0,wa,0,v")
8585
+ (match_operand:V4SF 3 "vsx_register_operand" "0,wf,0,wa,v")))]
8586
"VECTOR_UNIT_VSX_P (V4SFmode)"
8588
xvmaddasp %x0,%x1,%x2
8589
@@ -880,11 +919,11 @@
8590
[(set_attr "type" "vecfloat")])
8592
(define_insn "*vsx_fmav2df4"
8593
- [(set (match_operand:V2DF 0 "vsx_register_operand" "=ws,ws,?wa,?wa")
8594
+ [(set (match_operand:V2DF 0 "vsx_register_operand" "=wd,wd,?wa,?wa")
8596
- (match_operand:V2DF 1 "vsx_register_operand" "%ws,ws,wa,wa")
8597
- (match_operand:V2DF 2 "vsx_register_operand" "ws,0,wa,0")
8598
- (match_operand:V2DF 3 "vsx_register_operand" "0,ws,0,wa")))]
8599
+ (match_operand:V2DF 1 "vsx_register_operand" "%wd,wd,wa,wa")
8600
+ (match_operand:V2DF 2 "vsx_register_operand" "wd,0,wa,0")
8601
+ (match_operand:V2DF 3 "vsx_register_operand" "0,wd,0,wa")))]
8602
"VECTOR_UNIT_VSX_P (V2DFmode)"
8604
xvmaddadp %x0,%x1,%x2
8605
@@ -894,12 +933,12 @@
8606
[(set_attr "type" "vecdouble")])
8608
(define_insn "*vsx_fms<mode>4"
8609
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
8610
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
8612
- (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
8613
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
8614
+ (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
8615
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
8617
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
8618
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
8619
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8621
xvmsuba<VSs> %x0,%x1,%x2
8622
@@ -909,12 +948,12 @@
8623
[(set_attr "type" "<VStype_mul>")])
8625
(define_insn "*vsx_nfma<mode>4"
8626
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
8627
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
8630
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
8631
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
8632
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
8633
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
8634
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
8635
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
8636
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8638
xvnmadda<VSs> %x0,%x1,%x2
8641
;; Vector conditional expressions (no scalar version for these instructions)
8642
(define_insn "vsx_eq<mode>"
8643
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8644
- (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8645
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8646
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8647
+ (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8648
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8649
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8650
"xvcmpeq<VSs> %x0,%x1,%x2"
8651
[(set_attr "type" "<VStype_simple>")
8652
@@ -968,9 +1007,9 @@
8653
(set_attr "fp_type" "<VSfptype_simple>")])
8655
(define_insn "vsx_gt<mode>"
8656
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8657
- (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8658
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8659
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8660
+ (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8661
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8662
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8663
"xvcmpgt<VSs> %x0,%x1,%x2"
8664
[(set_attr "type" "<VStype_simple>")
8665
@@ -977,9 +1016,9 @@
8666
(set_attr "fp_type" "<VSfptype_simple>")])
8668
(define_insn "*vsx_ge<mode>"
8669
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8670
- (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8671
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
8672
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8673
+ (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8674
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
8675
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8676
"xvcmpge<VSs> %x0,%x1,%x2"
8677
[(set_attr "type" "<VStype_simple>")
8678
@@ -990,10 +1029,10 @@
8679
(define_insn "*vsx_eq_<mode>_p"
8682
- [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
8683
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
8684
+ [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
8685
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
8687
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8688
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8689
(eq:VSX_F (match_dup 1)
8691
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8692
@@ -1003,10 +1042,10 @@
8693
(define_insn "*vsx_gt_<mode>_p"
8696
- [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
8697
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
8698
+ [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
8699
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
8701
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8702
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8703
(gt:VSX_F (match_dup 1)
8705
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8706
@@ -1016,10 +1055,10 @@
8707
(define_insn "*vsx_ge_<mode>_p"
8710
- [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
8711
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
8712
+ [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
8713
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
8715
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8716
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8717
(ge:VSX_F (match_dup 1)
8719
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8720
@@ -1028,23 +1067,23 @@
8723
(define_insn "*vsx_xxsel<mode>"
8724
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
8725
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8727
- (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
8728
+ (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
8729
(match_operand:VSX_L 4 "zero_constant" ""))
8730
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
8731
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
8732
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
8733
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
8734
"VECTOR_MEM_VSX_P (<MODE>mode)"
8735
"xxsel %x0,%x3,%x2,%x1"
8736
[(set_attr "type" "vecperm")])
8738
(define_insn "*vsx_xxsel<mode>_uns"
8739
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
8740
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8742
- (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
8743
+ (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
8744
(match_operand:VSX_L 4 "zero_constant" ""))
8745
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
8746
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
8747
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
8748
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
8749
"VECTOR_MEM_VSX_P (<MODE>mode)"
8750
"xxsel %x0,%x3,%x2,%x1"
8751
[(set_attr "type" "vecperm")])
8752
@@ -1051,10 +1090,10 @@
8755
(define_insn "vsx_copysign<mode>3"
8756
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8757
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8759
- [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
8760
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
8761
+ [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
8762
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
8764
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8765
"xvcpsgn<VSs> %x0,%x2,%x1"
8766
@@ -1067,7 +1106,7 @@
8767
;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
8768
;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
8769
(define_insn "vsx_float<VSi><mode>2"
8770
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
8771
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
8772
(float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
8773
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8774
"x<VSv>cvsx<VSc><VSs> %x0,%x1"
8775
@@ -1075,7 +1114,7 @@
8776
(set_attr "fp_type" "<VSfptype_simple>")])
8778
(define_insn "vsx_floatuns<VSi><mode>2"
8779
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
8780
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
8781
(unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
8782
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8783
"x<VSv>cvux<VSc><VSs> %x0,%x1"
8784
@@ -1084,7 +1123,7 @@
8786
(define_insn "vsx_fix_trunc<mode><VSi>2"
8787
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
8788
- (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
8789
+ (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
8790
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8791
"x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
8792
[(set_attr "type" "<VStype_simple>")
8793
@@ -1092,7 +1131,7 @@
8795
(define_insn "vsx_fixuns_trunc<mode><VSi>2"
8796
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
8797
- (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
8798
+ (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
8799
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8800
"x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
8801
[(set_attr "type" "<VStype_simple>")
8802
@@ -1100,8 +1139,8 @@
8804
;; Math rounding functions
8805
(define_insn "vsx_x<VSv>r<VSs>i"
8806
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
8807
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
8808
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8809
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
8810
UNSPEC_VSX_ROUND_I))]
8811
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8812
"x<VSv>r<VSs>i %x0,%x1"
8813
@@ -1109,8 +1148,8 @@
8814
(set_attr "fp_type" "<VSfptype_simple>")])
8816
(define_insn "vsx_x<VSv>r<VSs>ic"
8817
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
8818
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
8819
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8820
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
8821
UNSPEC_VSX_ROUND_IC))]
8822
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8823
"x<VSv>r<VSs>ic %x0,%x1"
8824
@@ -1118,8 +1157,8 @@
8825
(set_attr "fp_type" "<VSfptype_simple>")])
8827
(define_insn "vsx_btrunc<mode>2"
8828
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8829
- (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
8830
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8831
+ (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
8832
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8833
"xvr<VSs>iz %x0,%x1"
8834
[(set_attr "type" "<VStype_simple>")
8835
@@ -1126,8 +1165,8 @@
8836
(set_attr "fp_type" "<VSfptype_simple>")])
8838
(define_insn "*vsx_b2trunc<mode>2"
8839
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
8840
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
8841
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8842
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
8844
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8845
"x<VSv>r<VSs>iz %x0,%x1"
8846
@@ -1135,8 +1174,8 @@
8847
(set_attr "fp_type" "<VSfptype_simple>")])
8849
(define_insn "vsx_floor<mode>2"
8850
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8851
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
8852
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8853
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
8855
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8856
"xvr<VSs>im %x0,%x1"
8857
@@ -1144,8 +1183,8 @@
8858
(set_attr "fp_type" "<VSfptype_simple>")])
8860
(define_insn "vsx_ceil<mode>2"
8861
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
8862
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
8863
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8864
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
8866
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8867
"xvr<VSs>ip %x0,%x1"
8868
@@ -1160,8 +1199,8 @@
8869
;; scalar single precision instructions internally use the double format.
8870
;; Prefer the altivec registers, since we likely will need to do a vperm
8871
(define_insn "vsx_<VS_spdp_insn>"
8872
- [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
8873
- (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
8874
+ [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
8875
+ (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
8876
UNSPEC_VSX_CVSPDP))]
8877
"VECTOR_UNIT_VSX_P (<MODE>mode)"
8878
"<VS_spdp_insn> %x0,%x1"
8879
@@ -1169,8 +1208,8 @@
8881
;; xscvspdp, represent the scalar SF type as V4SF
8882
(define_insn "vsx_xscvspdp"
8883
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
8884
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
8885
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
8886
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
8887
UNSPEC_VSX_CVSPDP))]
8888
"VECTOR_UNIT_VSX_P (V4SFmode)"
8890
@@ -1197,7 +1236,7 @@
8892
;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
8893
(define_insn "vsx_xscvdpspn"
8894
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
8895
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
8896
(unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
8897
UNSPEC_VSX_CVDPSPN))]
8899
@@ -1205,8 +1244,8 @@
8900
[(set_attr "type" "fp")])
8902
(define_insn "vsx_xscvspdpn"
8903
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
8904
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
8905
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
8906
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
8907
UNSPEC_VSX_CVSPDPN))]
8910
@@ -1213,8 +1252,8 @@
8911
[(set_attr "type" "fp")])
8913
(define_insn "vsx_xscvdpspn_scalar"
8914
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
8915
- (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
8916
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
8917
+ (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
8918
UNSPEC_VSX_CVDPSPN))]
8921
@@ -1302,10 +1341,10 @@
8922
;; since the xsrdpiz instruction does not truncate the value if the floating
8923
;; point value is < LONG_MIN or > LONG_MAX.
8924
(define_insn "*vsx_float_fix_<mode>2"
8925
- [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
8926
+ [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8929
- (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
8930
+ (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
8931
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
8932
&& VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
8933
&& !flag_trapping_math && TARGET_FRIZ"
8934
@@ -1318,10 +1357,10 @@
8936
;; Build a V2DF/V2DI vector from two scalars
8937
(define_insn "vsx_concat_<mode>"
8938
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
8939
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
8941
- (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
8942
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
8943
+ (match_operand:<VS_scalar> 1 "vsx_register_operand" "<VS_64reg>,<VSa>")
8944
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")))]
8945
"VECTOR_MEM_VSX_P (<MODE>mode)"
8947
if (BYTES_BIG_ENDIAN)
8948
@@ -1352,9 +1391,9 @@
8949
;; xxpermdi for little endian loads and stores. We need several of
8950
;; these since the form of the PARALLEL differs by mode.
8951
(define_insn "*vsx_xxpermdi2_le_<mode>"
8952
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
8954
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
8955
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
8956
+ (vec_select:VSX_LE
8957
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
8958
(parallel [(const_int 1) (const_int 0)])))]
8959
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8960
"xxpermdi %x0,%x1,%x1,2"
8961
@@ -1361,9 +1400,9 @@
8962
[(set_attr "type" "vecperm")])
8964
(define_insn "*vsx_xxpermdi4_le_<mode>"
8965
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
8966
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
8968
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
8969
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
8970
(parallel [(const_int 2) (const_int 3)
8971
(const_int 0) (const_int 1)])))]
8972
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8973
@@ -1401,9 +1440,9 @@
8974
;; lxvd2x for little endian loads. We need several of
8975
;; these since the form of the PARALLEL differs by mode.
8976
(define_insn "*vsx_lxvd2x2_le_<mode>"
8977
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
8979
- (match_operand:VSX_D 1 "memory_operand" "Z")
8980
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
8981
+ (vec_select:VSX_LE
8982
+ (match_operand:VSX_LE 1 "memory_operand" "Z")
8983
(parallel [(const_int 1) (const_int 0)])))]
8984
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
8986
@@ -1410,7 +1449,7 @@
8987
[(set_attr "type" "vecload")])
8989
(define_insn "*vsx_lxvd2x4_le_<mode>"
8990
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
8991
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
8993
(match_operand:VSX_W 1 "memory_operand" "Z")
8994
(parallel [(const_int 2) (const_int 3)
8995
@@ -1450,9 +1489,9 @@
8996
;; stxvd2x for little endian stores. We need several of
8997
;; these since the form of the PARALLEL differs by mode.
8998
(define_insn "*vsx_stxvd2x2_le_<mode>"
8999
- [(set (match_operand:VSX_D 0 "memory_operand" "=Z")
9001
- (match_operand:VSX_D 1 "vsx_register_operand" "wa")
9002
+ [(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
9003
+ (vec_select:VSX_LE
9004
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
9005
(parallel [(const_int 1) (const_int 0)])))]
9006
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
9008
@@ -1461,7 +1500,7 @@
9009
(define_insn "*vsx_stxvd2x4_le_<mode>"
9010
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
9012
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
9013
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
9014
(parallel [(const_int 2) (const_int 3)
9015
(const_int 0) (const_int 1)])))]
9016
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
9017
@@ -1513,11 +1552,12 @@
9019
;; Set the element of a V2DI/VD2F mode
9020
(define_insn "vsx_set_<mode>"
9021
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
9022
- (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
9023
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
9024
- (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
9026
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
9028
+ [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
9029
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
9030
+ (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
9032
"VECTOR_MEM_VSX_P (<MODE>mode)"
9034
int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
9035
@@ -1582,7 +1622,7 @@
9036
(define_insn_and_split "vsx_extract_v4sf"
9037
[(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
9039
- (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
9040
+ (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
9041
(parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
9042
(clobber (match_scratch:V4SF 3 "=X,0"))]
9043
"VECTOR_UNIT_VSX_P (V4SFmode)"
9044
@@ -1606,7 +1646,7 @@
9046
if (GET_CODE (op3) == SCRATCH)
9047
op3 = gen_reg_rtx (V4SFmode);
9048
- emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
9049
+ emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
9052
emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));
9053
@@ -1765,9 +1805,9 @@
9056
(define_insn "vsx_splat_<mode>"
9057
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
9058
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
9059
(vec_duplicate:VSX_D
9060
- (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
9061
+ (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
9062
"VECTOR_MEM_VSX_P (<MODE>mode)"
9064
xxpermdi %x0,%x1,%x1,0
9065
@@ -1780,10 +1820,10 @@
9068
(define_insn "vsx_xxspltw_<mode>"
9069
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
9070
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
9071
(vec_duplicate:VSX_W
9072
(vec_select:<VS_scalar>
9073
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
9074
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
9076
[(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
9077
"VECTOR_MEM_VSX_P (<MODE>mode)"
9078
@@ -1796,8 +1836,8 @@
9079
[(set_attr "type" "vecperm")])
9081
(define_insn "vsx_xxspltw_<mode>_direct"
9082
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
9083
- (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
9084
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
9085
+ (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
9086
(match_operand:QI 2 "u5bit_cint_operand" "i,i")]
9087
UNSPEC_VSX_XXSPLTW))]
9088
"VECTOR_MEM_VSX_P (<MODE>mode)"
9089
@@ -1806,11 +1846,11 @@
9091
;; V4SF/V4SI interleave
9092
(define_insn "vsx_xxmrghw_<mode>"
9093
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
9094
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
9096
(vec_concat:<VS_double>
9097
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
9098
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
9099
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
9100
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
9101
(parallel [(const_int 0) (const_int 4)
9102
(const_int 1) (const_int 5)])))]
9103
"VECTOR_MEM_VSX_P (<MODE>mode)"
9104
@@ -1823,11 +1863,11 @@
9105
[(set_attr "type" "vecperm")])
9107
(define_insn "vsx_xxmrglw_<mode>"
9108
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
9109
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
9111
(vec_concat:<VS_double>
9112
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
9113
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
9114
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
9115
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
9116
(parallel [(const_int 2) (const_int 6)
9117
(const_int 3) (const_int 7)])))]
9118
"VECTOR_MEM_VSX_P (<MODE>mode)"
9119
@@ -1841,9 +1881,9 @@
9121
;; Shift left double by word immediate
9122
(define_insn "vsx_xxsldwi_<mode>"
9123
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
9124
- (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
9125
- (match_operand:VSX_L 2 "vsx_register_operand" "wa")
9126
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
9127
+ (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
9128
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
9129
(match_operand:QI 3 "u5bit_cint_operand" "i")]
9131
"VECTOR_MEM_VSX_P (<MODE>mode)"
9132
@@ -1924,7 +1964,7 @@
9133
;; to the top element of the V2DF array without doing an extract.
9135
(define_insn_and_split "*vsx_reduc_<VEC_reduc_name>_v2df_scalar"
9136
- [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?wa,ws,?wa")
9137
+ [(set (match_operand:DF 0 "vfloat_operand" "=&ws,&?ws,ws,?ws")
9141
Index: gcc/config/rs6000/rs6000.h
9142
===================================================================
9143
--- a/src/gcc/config/rs6000/rs6000.h (.../tags/gcc_4_8_3_release)
9144
+++ b/src/gcc/config/rs6000/rs6000.h (.../branches/gcc-4_8-branch)
9145
@@ -1438,6 +1438,10 @@
9146
RS6000_CONSTRAINT_wd, /* VSX register for V2DF */
9147
RS6000_CONSTRAINT_wf, /* VSX register for V4SF */
9148
RS6000_CONSTRAINT_wg, /* FPR register for -mmfpgpr */
9149
+ RS6000_CONSTRAINT_wh, /* FPR register for direct moves. */
9150
+ RS6000_CONSTRAINT_wi, /* FPR/VSX register to hold DImode */
9151
+ RS6000_CONSTRAINT_wj, /* FPR/VSX register for DImode direct moves. */
9152
+ RS6000_CONSTRAINT_wk, /* FPR/VSX register for DFmode direct moves. */
9153
RS6000_CONSTRAINT_wl, /* FPR register for LFIWAX */
9154
RS6000_CONSTRAINT_wm, /* VSX register for direct move */
9155
RS6000_CONSTRAINT_wr, /* GPR register if 64-bit */
9156
@@ -1462,6 +1466,9 @@
9157
#define VSX_REG_CLASS_P(CLASS) \
9158
((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
9160
+/* Return whether a given register class targets general purpose registers. */
9161
+#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
9163
/* Given an rtx X being reloaded into a reg required to be
9164
in class CLASS, return the class of reg to actually use.
9165
In general this is just CLASS; but on some machines
9166
@@ -1593,8 +1600,15 @@
9167
/* Define this if stack space is still allocated for a parameter passed
9168
in a register. The value is the number of bytes allocated to this
9170
-#define REG_PARM_STACK_SPACE(FNDECL) rs6000_reg_parm_stack_space((FNDECL))
9171
+#define REG_PARM_STACK_SPACE(FNDECL) \
9172
+ rs6000_reg_parm_stack_space ((FNDECL), false)
9174
+/* Define this macro if space guaranteed when compiling a function body
9175
+ is different to space required when making a call, a situation that
9176
+ can arise with K&R style function definitions. */
9177
+#define INCOMING_REG_PARM_STACK_SPACE(FNDECL) \
9178
+ rs6000_reg_parm_stack_space ((FNDECL), true)
9180
/* Define this if the above stack space is to be considered part of the
9181
space allocated by the caller. */
9182
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
9183
@@ -2483,8 +2497,8 @@
9184
#define RS6000_BTC_SAT RS6000_BTC_MISC /* saturate sets VSCR. */
9186
/* Builtin targets. For now, we reuse the masks for those options that are in
9187
- target flags, and pick two random bits for SPE and paired which aren't in
9189
+ target flags, and pick three random bits for SPE, paired and ldbl128 which
9190
+ aren't in target_flags. */
9191
#define RS6000_BTM_ALWAYS 0 /* Always enabled. */
9192
#define RS6000_BTM_ALTIVEC MASK_ALTIVEC /* VMX/altivec vectors. */
9193
#define RS6000_BTM_VSX MASK_VSX /* VSX (vector/scalar). */
9194
@@ -2501,6 +2515,7 @@
9195
#define RS6000_BTM_CELL MASK_FPRND /* Target is cell powerpc. */
9196
#define RS6000_BTM_DFP MASK_DFP /* Decimal floating point. */
9197
#define RS6000_BTM_HARD_FLOAT MASK_SOFT_FLOAT /* Hardware floating point. */
9198
+#define RS6000_BTM_LDBL128 MASK_MULTIPLE /* 128-bit long double. */
9200
#define RS6000_BTM_COMMON (RS6000_BTM_ALTIVEC \
9202
@@ -2514,7 +2529,8 @@
9203
| RS6000_BTM_POPCNTD \
9206
- | RS6000_BTM_HARD_FLOAT)
9207
+ | RS6000_BTM_HARD_FLOAT \
9208
+ | RS6000_BTM_LDBL128)
9210
/* Define builtin enum index. */
9212
Index: gcc/config/rs6000/rs6000.md
9213
===================================================================
9214
--- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_3_release)
9215
+++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch)
9217
UNSPEC_UNPACK_128BIT
9224
@@ -317,8 +318,25 @@
9225
(define_mode_attr f32_sv [(SF "stxsspx %x1,%y0") (SD "stxsiwzx %x1,%y0")])
9227
; Definitions for 32-bit fpr direct move
9228
-(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
9229
+; At present, the decimal modes are not allowed in the traditional altivec
9230
+; registers, so restrict the constraints to just the traditional FPRs.
9231
+(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
9233
+; Definitions for 32-bit VSX
9234
+(define_mode_attr f32_vsx [(SF "ww") (SD "wn")])
9236
+; Definitions for 32-bit use of altivec registers
9237
+(define_mode_attr f32_av [(SF "wu") (SD "wn")])
9239
+; Definitions for 64-bit VSX
9240
+(define_mode_attr f64_vsx [(DF "ws") (DD "wn")])
9242
+; Definitions for 64-bit direct move
9243
+(define_mode_attr f64_dm [(DF "wk") (DD "wh")])
9245
+; Definitions for 64-bit use of altivec registers
9246
+(define_mode_attr f64_av [(DF "wv") (DD "wn")])
9248
; These modes do not fit in integer registers in 32-bit mode.
9249
; but on e500v2, the gpr are 64 bit registers
9250
(define_mode_iterator DIFD [DI (DF "!TARGET_E500_DOUBLE") DD])
9254
;; Mode attribute for boolean operation register constraints for output
9255
-(define_mode_attr BOOL_REGS_OUTPUT [(TI "&r,r,r,wa,v")
9256
+(define_mode_attr BOOL_REGS_OUTPUT [(TI "&r,r,r,wt,v")
9258
(V16QI "wa,v,&?r,?r,?r")
9259
(V8HI "wa,v,&?r,?r,?r")
9261
(V1TI "wa,v,&?r,?r,?r")])
9263
;; Mode attribute for boolean operation register constraints for operand1
9264
-(define_mode_attr BOOL_REGS_OP1 [(TI "r,0,r,wa,v")
9265
+(define_mode_attr BOOL_REGS_OP1 [(TI "r,0,r,wt,v")
9267
(V16QI "wa,v,r,0,r")
9270
(V1TI "wa,v,r,0,r")])
9272
;; Mode attribute for boolean operation register constraints for operand2
9273
-(define_mode_attr BOOL_REGS_OP2 [(TI "r,r,0,wa,v")
9274
+(define_mode_attr BOOL_REGS_OP2 [(TI "r,r,0,wt,v")
9276
(V16QI "wa,v,r,r,0")
9279
;; Mode attribute for boolean operation register constraints for operand1
9280
;; for one_cmpl. To simplify things, we repeat the constraint where 0
9281
;; is used for operand1 or operand2
9282
-(define_mode_attr BOOL_REGS_UNARY [(TI "r,0,0,wa,v")
9283
+(define_mode_attr BOOL_REGS_UNARY [(TI "r,0,0,wt,v")
9285
(V16QI "wa,v,r,0,0")
9290
(define_insn "*zero_extendsidi2_lfiwzx"
9291
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
9292
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
9293
(zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
9294
"TARGET_POWERPC64 && TARGET_LFIWZX"
9299
(define_insn "*extendsidi2_lfiwax"
9300
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
9301
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
9302
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
9303
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
9304
"TARGET_POWERPC64 && TARGET_LFIWAX"
9309
(define_insn "*extendsidi2_nocell"
9310
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
9311
- (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
9312
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
9313
"TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
9316
@@ -5614,7 +5632,7 @@
9317
; We don't define lfiwax/lfiwzx with the normal definition, because we
9318
; don't want to support putting SImode in FPR registers.
9319
(define_insn "lfiwax"
9320
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
9321
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
9322
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
9324
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
9325
@@ -5694,7 +5712,7 @@
9326
(set_attr "type" "fpload")])
9328
(define_insn "lfiwzx"
9329
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
9330
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
9331
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
9333
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
9334
@@ -9210,8 +9228,8 @@
9337
(define_insn "mov<mode>_hardfloat"
9338
- [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,wu,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
9339
- (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,Z,wu,r,<f32_dm>,r,h,0,G,Fn"))]
9340
+ [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,<f32_lr>,<f32_sm>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
9341
+ (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,j,<f32_lm>,<f32_sr>,Z,<f32_av>,r,<f32_dm>,r, h, 0, G,Fn"))]
9342
"(gpc_reg_operand (operands[0], <MODE>mode)
9343
|| gpc_reg_operand (operands[1], <MODE>mode))
9344
&& (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
9345
@@ -9422,8 +9440,8 @@
9348
(define_insn "*mov<mode>_hardfloat32"
9349
- [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,!r,!r,!r")
9350
- (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,G,H,F"))]
9351
+ [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,!r,!r,!r")
9352
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,G,H,F"))]
9353
"! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
9354
&& (gpc_reg_operand (operands[0], <MODE>mode)
9355
|| gpc_reg_operand (operands[1], <MODE>mode))"
9356
@@ -9491,8 +9509,8 @@
9357
; ld/std require word-aligned displacements -> 'Y' constraint.
9358
; List Y->r and r->Y before r->r for reload.
9359
(define_insn "*mov<mode>_hardfloat64"
9360
- [(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")
9361
- (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"))]
9362
+ [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_vsx>,<f64_vsx>,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,<f64_dm>")
9363
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,<f64_vsx>,j,r,Y,r,r,h,0,G,H,F,wg,r,<f64_dm>,r"))]
9364
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
9365
&& (gpc_reg_operand (operands[0], <MODE>mode)
9366
|| gpc_reg_operand (operands[1], <MODE>mode))"
9367
@@ -10272,8 +10290,8 @@
9368
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
9370
(define_insn "*movdi_internal64"
9371
- [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
9372
- (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
9373
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
9374
+ (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
9376
&& (gpc_reg_operand (operands[0], DImode)
9377
|| gpc_reg_operand (operands[1], DImode))"
9378
@@ -10293,7 +10311,8 @@
9384
+ xxlxor %x0,%x0,%x0"
9385
[(set_attr_alternative "type"
9387
(match_test "update_indexed_address_mem (operands[0], VOIDmode)")
9388
@@ -10334,8 +10353,9 @@
9389
(const_string "mftgpr")
9390
(const_string "mffgpr")
9391
(const_string "mftgpr")
9392
- (const_string "mffgpr")])
9393
- (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
9394
+ (const_string "mffgpr")
9395
+ (const_string "vecsimple")])
9396
+ (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
9398
;; immediate value valid for a single instruction hiding in a const_double
9400
@@ -15751,23 +15771,10 @@
9401
;; a GPR. The addis instruction must be adjacent to the load, and use the same
9402
;; register that is being loaded. The fused ops must be physically adjacent.
9404
-;; We use define_peephole for the actual addis/load, and the register used to
9405
-;; hold the addis value must be the same as the register being loaded. We use
9406
-;; define_peephole2 to change the register used for addis to be the register
9407
-;; being loaded, since we can look at whether it is dead after the load insn.
9408
+;; Find cases where the addis that feeds into a load instruction is either used
9409
+;; once or is the same as the target register, and replace it with the fusion
9413
- [(set (match_operand:P 0 "base_reg_operand" "")
9414
- (match_operand:P 1 "fusion_gpr_addis" ""))
9415
- (set (match_operand:INT1 2 "base_reg_operand" "")
9416
- (match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
9417
- "TARGET_P8_FUSION && fusion_gpr_load_p (operands, false)"
9419
- return emit_fusion_gpr_load (operands);
9421
- [(set_attr "type" "load")
9422
- (set_attr "length" "8")])
9425
[(set (match_operand:P 0 "base_reg_operand" "")
9426
(match_operand:P 1 "fusion_gpr_addis" ""))
9427
@@ -15774,9 +15781,8 @@
9428
(set (match_operand:INT1 2 "base_reg_operand" "")
9429
(match_operand:INT1 3 "fusion_gpr_mem_load" ""))]
9431
- && (REGNO (operands[0]) != REGNO (operands[2])
9432
- || GET_CODE (operands[3]) == SIGN_EXTEND)
9433
- && fusion_gpr_load_p (operands, true)"
9434
+ && fusion_gpr_load_p (operands[0], operands[1], operands[2],
9438
expand_fusion_gpr_load (operands);
9439
@@ -15783,6 +15789,20 @@
9443
+;; Fusion insn, created by the define_peephole2 above (and eventually by
9446
+(define_insn "fusion_gpr_load_<mode>"
9447
+ [(set (match_operand:INT1 0 "base_reg_operand" "=&b")
9448
+ (unspec:INT1 [(match_operand:INT1 1 "fusion_gpr_mem_combo" "")]
9449
+ UNSPEC_FUSION_GPR))]
9450
+ "TARGET_P8_FUSION"
9452
+ return emit_fusion_gpr_load (operands[0], operands[1]);
9454
+ [(set_attr "type" "load")
9455
+ (set_attr "length" "8")])
9458
;; Miscellaneous ISA 2.06 (power7) instructions
9459
(define_insn "addg6s"
9460
@@ -15847,26 +15867,6 @@
9464
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
9465
-;; and __builtin_longdouble_dw1 to optimize glibc. Add support for these
9468
-(define_expand "unpacktf_0"
9469
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
9470
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
9472
- UNSPEC_UNPACK_128BIT))]
9476
-(define_expand "unpacktf_1"
9477
- [(set (match_operand:DF 0 "nonimmediate_operand" "")
9478
- (unspec:DF [(match_operand:TF 1 "register_operand" "")
9480
- UNSPEC_UNPACK_128BIT))]
9484
(define_insn_and_split "unpack<mode>_dm"
9485
[(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
9487
Index: gcc/config/rs6000/sysv4.h
9488
===================================================================
9489
--- a/src/gcc/config/rs6000/sysv4.h (.../tags/gcc_4_8_3_release)
9490
+++ b/src/gcc/config/rs6000/sysv4.h (.../branches/gcc-4_8-branch)
9492
/* An expression for the alignment of a structure field FIELD if the
9493
alignment computed in the usual way is COMPUTED. */
9494
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
9495
- ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
9496
+ (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
9499
#undef BIGGEST_FIELD_ALIGNMENT
9500
@@ -949,3 +949,27 @@
9501
#define TARGET_USES_SYSV4_OPT 1
9503
#undef DBX_REGISTER_NUMBER
9505
+/* Link -lasan early on the command line. For -static-libasan, don't link
9506
+ it for -shared link, the executable should be compiled with -static-libasan
9507
+ in that case, and for executable link link with --{,no-}whole-archive around
9508
+ it to force everything into the executable. And similarly for -ltsan. */
9509
+#if defined(HAVE_LD_STATIC_DYNAMIC)
9510
+#undef LIBASAN_EARLY_SPEC
9511
+#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
9512
+ "%{static-libasan:%{!shared:" \
9513
+ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
9514
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
9515
+#undef LIBTSAN_EARLY_SPEC
9516
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
9517
+ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
9518
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
9521
+/* Additional libraries needed by -static-libasan. */
9522
+#undef STATIC_LIBASAN_LIBS
9523
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
9525
+/* Additional libraries needed by -static-libtsan. */
9526
+#undef STATIC_LIBTSAN_LIBS
9527
+#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
9528
Index: gcc/config/arm/arm.c
9529
===================================================================
9530
--- a/src/gcc/config/arm/arm.c (.../tags/gcc_4_8_3_release)
9531
+++ b/src/gcc/config/arm/arm.c (.../branches/gcc-4_8-branch)
9533
static reg_class_t arm_preferred_reload_class (rtx, reg_class_t);
9534
static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
9535
inline static int thumb1_index_register_rtx_p (rtx, int);
9536
-static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
9537
static int thumb_far_jump_used_p (void);
9538
static bool thumb_force_lr_save (void);
9539
static unsigned arm_size_return_regs (void);
9540
@@ -24476,9 +24475,13 @@
9541
fputs (":\n", file);
9544
- /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */
9545
+ /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn". */
9546
rtx tem = XEXP (DECL_RTL (function), 0);
9547
- tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
9548
+ /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
9549
+ pipeline offset is four rather than eight. Adjust the offset
9551
+ tem = plus_constant (GET_MODE (tem), tem,
9552
+ TARGET_THUMB1_ONLY ? -3 : -7);
9553
tem = gen_rtx_MINUS (GET_MODE (tem),
9555
gen_rtx_SYMBOL_REF (Pmode,
9556
@@ -27462,4 +27465,13 @@
9560
+/* return TRUE if x is a reference to a value in a constant pool */
9562
+arm_is_constant_pool_ref (rtx x)
9565
+ && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
9566
+ && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
9570
Index: gcc/config/arm/arm-protos.h
9571
===================================================================
9572
--- a/src/gcc/config/arm/arm-protos.h (.../tags/gcc_4_8_3_release)
9573
+++ b/src/gcc/config/arm/arm-protos.h (.../branches/gcc-4_8-branch)
9575
extern int legitimate_pic_operand_p (rtx);
9576
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
9577
extern rtx legitimize_tls_address (rtx, rtx);
9578
+extern bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
9579
extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
9580
extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
9581
extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
9584
extern void arm_emit_eabi_attribute (const char *, int, int);
9586
+extern bool arm_is_constant_pool_ref (rtx);
9588
#endif /* ! GCC_ARM_PROTOS_H */
9589
Index: gcc/config/arm/constraints.md
9590
===================================================================
9591
--- a/src/gcc/config/arm/constraints.md (.../tags/gcc_4_8_3_release)
9592
+++ b/src/gcc/config/arm/constraints.md (.../branches/gcc-4_8-branch)
9594
;; in Thumb-2 state: Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py
9596
;; The following memory constraints have been used:
9597
-;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Um, Us
9598
+;; in ARM/Thumb-2 state: Q, Uh, Ut, Uv, Uy, Un, Um, Us
9600
;; in Thumb state: Uu, Uw
9602
@@ -310,6 +310,12 @@
9603
An address valid for loading/storing register exclusive"
9604
(match_operand 0 "mem_noofs_operand"))
9606
+(define_memory_constraint "Uh"
9608
+ An address suitable for byte and half-word loads which does not point inside a constant pool"
9609
+ (and (match_code "mem")
9610
+ (match_test "arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), false) && !arm_is_constant_pool_ref (op)")))
9612
(define_memory_constraint "Ut"
9614
In ARM/Thumb-2 state an address valid for loading/storing opaque structure
9616
(and (match_code "mem")
9617
(match_test "TARGET_ARM
9618
&& arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
9619
- SIGN_EXTEND, 0)")))
9621
+ && !arm_is_constant_pool_ref (op)")))
9623
(define_memory_constraint "Q"
9625
Index: gcc/config/arm/arm.md
9626
===================================================================
9627
--- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_8_3_release)
9628
+++ b/src/gcc/config/arm/arm.md (.../branches/gcc-4_8-branch)
9629
@@ -4047,7 +4047,7 @@
9630
(define_insn "unaligned_loadhis"
9631
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
9633
- (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
9634
+ (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,Uh")]
9635
UNSPEC_UNALIGNED_LOAD)))]
9636
"unaligned_access && TARGET_32BIT"
9637
"ldr%(sh%)\t%0, %1\t@ unaligned"
9638
@@ -4655,7 +4655,7 @@
9640
(define_insn "*arm_zero_extendhisi2_v6"
9641
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
9642
- (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
9643
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
9644
"TARGET_ARM && arm_arch6"
9647
@@ -4748,7 +4748,7 @@
9649
(define_insn "*arm_zero_extendqisi2_v6"
9650
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
9651
- (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
9652
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uh")))]
9653
"TARGET_ARM && arm_arch6"
9656
@@ -4980,7 +4980,7 @@
9658
(define_insn "*arm_extendhisi2"
9659
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
9660
- (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
9661
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
9662
"TARGET_ARM && arm_arch4 && !arm_arch6"
9665
@@ -4987,23 +4987,19 @@
9667
[(set_attr "length" "8,4")
9668
(set_attr "type" "alu_shift,load_byte")
9669
- (set_attr "predicable" "yes")
9670
- (set_attr "pool_range" "*,256")
9671
- (set_attr "neg_pool_range" "*,244")]
9672
+ (set_attr "predicable" "yes")]
9675
;; ??? Check Thumb-2 pool range
9676
(define_insn "*arm_extendhisi2_v6"
9677
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
9678
- (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
9679
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,Uh")))]
9680
"TARGET_32BIT && arm_arch6"
9684
[(set_attr "type" "simple_alu_shift,load_byte")
9685
- (set_attr "predicable" "yes")
9686
- (set_attr "pool_range" "*,256")
9687
- (set_attr "neg_pool_range" "*,244")]
9688
+ (set_attr "predicable" "yes")]
9691
(define_insn "*arm_extendhisi2addsi"
9692
@@ -5045,9 +5041,7 @@
9693
"TARGET_ARM && arm_arch4"
9694
"ldr%(sb%)\\t%0, %1"
9695
[(set_attr "type" "load_byte")
9696
- (set_attr "predicable" "yes")
9697
- (set_attr "pool_range" "256")
9698
- (set_attr "neg_pool_range" "244")]
9699
+ (set_attr "predicable" "yes")]
9702
(define_expand "extendqisi2"
9703
@@ -5087,9 +5081,7 @@
9705
[(set_attr "length" "8,4")
9706
(set_attr "type" "alu_shift,load_byte")
9707
- (set_attr "predicable" "yes")
9708
- (set_attr "pool_range" "*,256")
9709
- (set_attr "neg_pool_range" "*,244")]
9710
+ (set_attr "predicable" "yes")]
9713
(define_insn "*arm_extendqisi_v6"
9714
@@ -5101,9 +5093,7 @@
9717
[(set_attr "type" "simple_alu_shift,load_byte")
9718
- (set_attr "predicable" "yes")
9719
- (set_attr "pool_range" "*,256")
9720
- (set_attr "neg_pool_range" "*,244")]
9721
+ (set_attr "predicable" "yes")]
9724
(define_insn "*arm_extendqisi2addsi"
9725
@@ -7630,12 +7620,13 @@
9727
(define_insn "*arm_cmpdi_unsigned"
9728
[(set (reg:CC_CZ CC_REGNUM)
9729
- (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
9730
- (match_operand:DI 1 "arm_di_operand" "rDi")))]
9731
+ (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r,r")
9732
+ (match_operand:DI 1 "arm_di_operand" "rDi,rDi")))]
9734
"cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
9735
[(set_attr "conds" "set")
9736
- (set_attr "length" "8")]
9737
+ (set_attr "arch" "a,t2")
9738
+ (set_attr "length" "8,10")]
9741
(define_insn "*arm_cmpdi_zero"
9742
Index: gcc/config/arm/t-rtems-eabi
9743
===================================================================
9744
--- a/src/gcc/config/arm/t-rtems-eabi (.../tags/gcc_4_8_3_release)
9745
+++ b/src/gcc/config/arm/t-rtems-eabi (.../branches/gcc-4_8-branch)
9747
# Custom RTEMS EABI multilibs
9749
-MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard
9750
-MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard
9751
+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
9752
+MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard
9754
# Enumeration of multilibs
9756
MULTILIB_EXCEPTIONS =
9757
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
9758
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon
9759
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
9760
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16
9761
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9762
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16
9763
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard
9764
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m
9765
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
9766
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon
9767
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
9768
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16
9769
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
9770
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16
9771
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard
9772
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a
9773
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
9774
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon
9775
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
9776
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16
9777
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
9778
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16
9779
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard
9780
+# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r
9781
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
9782
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon
9783
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
9784
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16
9785
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9786
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16
9787
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard
9788
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m
9789
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard
9790
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon
9791
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
9792
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16
9793
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
9794
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16
9795
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard
9796
+MULTILIB_EXCEPTIONS += mbig-endian/mthumb
9797
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard
9798
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon
9799
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
9800
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16
9801
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9802
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16
9803
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard
9804
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m
9805
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
9806
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon
9807
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
9808
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16
9809
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
9810
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
9811
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard
9812
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a
9813
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard
9814
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon
9815
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
9816
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16
9817
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
9818
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=fpv4-sp-d16
9819
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard
9820
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r
9821
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard
9822
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon
9823
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
9824
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16
9825
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9826
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=fpv4-sp-d16
9827
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfloat-abi=hard
9828
+MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
9829
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon/mfloat-abi=hard
9830
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=neon
9831
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16/mfloat-abi=hard
9832
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=vfpv3-d16
9833
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16/mfloat-abi=hard
9834
+MULTILIB_EXCEPTIONS += mbig-endian/mfpu=fpv4-sp-d16
9835
+MULTILIB_EXCEPTIONS += mbig-endian/mfloat-abi=hard
9836
+MULTILIB_EXCEPTIONS += mbig-endian
9837
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard
9838
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=neon
9839
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
9840
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=vfpv3-d16
9841
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9842
+MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfpu=fpv4-sp-d16
9843
MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=hard
9844
# MULTILIB_EXCEPTIONS += mthumb/march=armv6-m
9845
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard
9846
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=neon
9847
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
9848
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=vfpv3-d16
9849
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
9850
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfpu=fpv4-sp-d16
9851
MULTILIB_EXCEPTIONS += mthumb/march=armv7-a/mfloat-abi=hard
9852
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-a
9853
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard
9854
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=neon
9855
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
9856
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=vfpv3-d16
9857
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
9858
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfpu=fpv4-sp-d16
9859
MULTILIB_EXCEPTIONS += mthumb/march=armv7-r/mfloat-abi=hard
9860
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-r
9861
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard
9862
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=neon
9863
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
9864
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=vfpv3-d16
9865
+# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9866
+MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfpu=fpv4-sp-d16
9867
MULTILIB_EXCEPTIONS += mthumb/march=armv7-m/mfloat-abi=hard
9868
# MULTILIB_EXCEPTIONS += mthumb/march=armv7-m
9869
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon/mfloat-abi=hard
9870
MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
9871
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16/mfloat-abi=hard
9872
+MULTILIB_EXCEPTIONS += mthumb/mfpu=vfpv3-d16
9873
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard
9874
+MULTILIB_EXCEPTIONS += mthumb/mfpu=fpv4-sp-d16
9875
MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard
9876
# MULTILIB_EXCEPTIONS += mthumb
9877
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon/mfloat-abi=hard
9878
MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=neon
9879
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard
9880
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=vfpv3-d16
9881
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9882
+MULTILIB_EXCEPTIONS += march=armv6-m/mfpu=fpv4-sp-d16
9883
MULTILIB_EXCEPTIONS += march=armv6-m/mfloat-abi=hard
9884
MULTILIB_EXCEPTIONS += march=armv6-m
9885
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon/mfloat-abi=hard
9886
MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
9887
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard
9888
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=vfpv3-d16
9889
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard
9890
+MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=fpv4-sp-d16
9891
MULTILIB_EXCEPTIONS += march=armv7-a/mfloat-abi=hard
9892
MULTILIB_EXCEPTIONS += march=armv7-a
9893
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon/mfloat-abi=hard
9894
MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=neon
9895
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard
9896
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=vfpv3-d16
9897
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard
9898
+MULTILIB_EXCEPTIONS += march=armv7-r/mfpu=fpv4-sp-d16
9899
MULTILIB_EXCEPTIONS += march=armv7-r/mfloat-abi=hard
9900
MULTILIB_EXCEPTIONS += march=armv7-r
9901
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon/mfloat-abi=hard
9902
MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=neon
9903
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard
9904
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=vfpv3-d16
9905
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
9906
+MULTILIB_EXCEPTIONS += march=armv7-m/mfpu=fpv4-sp-d16
9907
MULTILIB_EXCEPTIONS += march=armv7-m/mfloat-abi=hard
9908
MULTILIB_EXCEPTIONS += march=armv7-m
9909
MULTILIB_EXCEPTIONS += mfpu=neon/mfloat-abi=hard
9910
MULTILIB_EXCEPTIONS += mfpu=neon
9911
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16/mfloat-abi=hard
9912
+MULTILIB_EXCEPTIONS += mfpu=vfpv3-d16
9913
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16/mfloat-abi=hard
9914
+MULTILIB_EXCEPTIONS += mfpu=fpv4-sp-d16
9915
MULTILIB_EXCEPTIONS += mfloat-abi=hard
9916
Index: gcc/config/pa/pa.c
9917
===================================================================
9918
--- a/src/gcc/config/pa/pa.c (.../tags/gcc_4_8_3_release)
9919
+++ b/src/gcc/config/pa/pa.c (.../branches/gcc-4_8-branch)
9920
@@ -3237,7 +3237,12 @@
9922
&& function_label_operand (x, VOIDmode))
9924
- fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
9925
+ fputs (size == 8? "\t.dword\t" : "\t.word\t", asm_out_file);
9927
+ /* We don't want an OPD when generating fast indirect calls. */
9928
+ if (!TARGET_FAST_INDIRECT_CALLS)
9929
+ fputs ("P%", asm_out_file);
9931
output_addr_const (asm_out_file, x);
9932
fputc ('\n', asm_out_file);
9934
@@ -4160,9 +4165,8 @@
9935
pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
9937
rtx insn = get_last_insn ();
9942
/* pa_expand_epilogue does the dirty work now. We just need
9943
to output the assembler directives which denote the end
9945
@@ -4185,14 +4189,16 @@
9946
if (insn && GET_CODE (insn) == CALL_INSN)
9948
fputs ("\tnop\n", file);
9949
- last_address += 4;
9953
+ extra_nop = false;
9955
fputs ("\t.EXIT\n\t.PROCEND\n", file);
9957
if (TARGET_SOM && TARGET_GAS)
9959
- /* We done with this subspace except possibly for some additional
9960
+ /* We are done with this subspace except possibly for some additional
9961
debug information. Forget that we are in this subspace to ensure
9962
that the next function is output in its own subspace. */
9964
@@ -4199,12 +4205,20 @@
9965
cfun->machine->in_nsubspa = 2;
9968
+ /* Thunks do their own insn accounting. */
9969
+ if (cfun->is_thunk)
9972
if (INSN_ADDRESSES_SET_P ())
9974
+ last_address = extra_nop ? 4 : 0;
9975
insn = get_last_nonnote_insn ();
9976
- last_address += INSN_ADDRESSES (INSN_UID (insn));
9977
- if (INSN_P (insn))
9978
- last_address += insn_default_length (insn);
9981
+ last_address += INSN_ADDRESSES (INSN_UID (insn));
9982
+ if (INSN_P (insn))
9983
+ last_address += insn_default_length (insn);
9985
last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)
9986
& ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1));
9988
@@ -8270,8 +8284,7 @@
9989
xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
9990
xoperands[2] = GEN_INT (delta);
9992
- ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
9993
- fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
9994
+ final_start_function (emit_barrier (), file, 1);
9996
/* Output the thunk. We know that the function is in the same
9997
translation unit (i.e., the same space) as the thunk, and that
9998
@@ -8301,12 +8314,16 @@
9999
|| ((DECL_SECTION_NAME (thunk_fndecl)
10000
== DECL_SECTION_NAME (function))
10001
&& last_address < 262132)))
10002
+ /* In this case, we need to be able to reach the start of
10003
+ the stub table even though the function is likely closer
10004
+ and can be jumped to directly. */
10005
|| (targetm_common.have_named_sections
10006
&& DECL_SECTION_NAME (thunk_fndecl) == NULL
10007
&& DECL_SECTION_NAME (function) == NULL
10008
- && last_address < 262132)
10009
+ && total_code_bytes < MAX_PCREL17F_OFFSET)
10011
|| (!targetm_common.have_named_sections
10012
- && last_address < 262132))))
10013
+ && total_code_bytes < MAX_PCREL17F_OFFSET))))
10016
output_asm_insn ("addil L'%2,%%r26", xoperands);
10017
@@ -8477,17 +8494,8 @@
10021
- fprintf (file, "\t.EXIT\n\t.PROCEND\n");
10022
+ final_end_function ();
10024
- if (TARGET_SOM && TARGET_GAS)
10026
- /* We done with this subspace except possibly for some additional
10027
- debug information. Forget that we are in this subspace to ensure
10028
- that the next function is output in its own subspace. */
10029
- in_section = NULL;
10030
- cfun->machine->in_nsubspa = 2;
10033
if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
10035
switch_to_section (data_section);
10036
Index: gcc/tree-vect-slp.c
10037
===================================================================
10038
--- a/src/gcc/tree-vect-slp.c (.../tags/gcc_4_8_3_release)
10039
+++ b/src/gcc/tree-vect-slp.c (.../branches/gcc-4_8-branch)
10040
@@ -1837,7 +1837,10 @@
10041
&& (stmt_vinfo = vinfo_for_stmt (use_stmt))
10042
&& !STMT_SLP_TYPE (stmt_vinfo)
10043
&& (STMT_VINFO_RELEVANT (stmt_vinfo)
10044
- || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)))
10045
+ || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))
10046
+ || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
10047
+ && STMT_VINFO_RELATED_STMT (stmt_vinfo)
10048
+ && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo)))))
10049
&& !(gimple_code (use_stmt) == GIMPLE_PHI
10050
&& STMT_VINFO_DEF_TYPE (stmt_vinfo)
10051
== vect_reduction_def))
10052
Index: libobjc/encoding.c
10053
===================================================================
10054
--- a/src/libobjc/encoding.c (.../tags/gcc_4_8_3_release)
10055
+++ b/src/libobjc/encoding.c (.../branches/gcc-4_8-branch)
10056
@@ -192,6 +192,8 @@
10057
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
10058
: MAX (COMPUTED, SPECIFIED));})
10060
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
10061
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
10063
/* Skip a variable name, enclosed in quotes ("). */
10065
Index: libobjc/ChangeLog
10066
===================================================================
10067
--- a/src/libobjc/ChangeLog (.../tags/gcc_4_8_3_release)
10068
+++ b/src/libobjc/ChangeLog (.../branches/gcc-4_8-branch)
10070
+2014-07-27 Ulrich Weigand <uweigand@de.ibm.com>
10073
+ * encoding.c (rs6000_special_adjust_field_align_p): Use definition
10074
+ that matches the 4.8 branch ABI.
10076
+2014-07-27 Alan Modra <amodra@gmail.com>
10077
+ Matthias Klose <doko@ubuntu.com>
10081
+ * encoding.c: Define rs6000_special_adjust_field_align_p.
10083
2014-05-22 Release Manager
10085
* GCC 4.8.3 released.
10086
Index: libgfortran/m4/in_pack.m4
10087
===================================================================
10088
--- a/src/libgfortran/m4/in_pack.m4 (.../tags/gcc_4_8_3_release)
10089
+++ b/src/libgfortran/m4/in_pack.m4 (.../branches/gcc-4_8-branch)
10091
return source->base_addr;
10093
/* Allocate storage for the destination. */
10094
- destptr = ('rtype_name` *)xmalloc (ssize * sizeof ('rtype_name`));
10095
+ destptr = xmallocarray (ssize, sizeof ('rtype_name`));
10097
src = source->base_addr;
10098
stride0 = stride[0];
10099
Index: libgfortran/m4/pack.m4
10100
===================================================================
10101
--- a/src/libgfortran/m4/pack.m4 (.../tags/gcc_4_8_3_release)
10102
+++ b/src/libgfortran/m4/pack.m4 (.../branches/gcc-4_8-branch)
10103
@@ -168,8 +168,8 @@
10107
- /* xmalloc allocates a single byte for zero size. */
10108
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * total);
10109
+ /* xmallocarray allocates a single byte for zero size. */
10110
+ ret->base_addr = xmallocarray (total, sizeof ('rtype_name`));
10114
Index: libgfortran/m4/spread.m4
10115
===================================================================
10116
--- a/src/libgfortran/m4/spread.m4 (.../tags/gcc_4_8_3_release)
10117
+++ b/src/libgfortran/m4/spread.m4 (.../branches/gcc-4_8-branch)
10118
@@ -102,8 +102,8 @@
10122
- /* xmalloc allocates a single byte for zero size. */
10123
- ret->base_addr = xmalloc (rs * sizeof('rtype_name`));
10124
+ /* xmallocarray allocates a single byte for zero size. */
10125
+ ret->base_addr = xmallocarray (rs, sizeof('rtype_name`));
10129
@@ -245,7 +245,7 @@
10131
if (ret->base_addr == NULL)
10133
- ret->base_addr = xmalloc (ncopies * sizeof ('rtype_name`));
10134
+ ret->base_addr = xmallocarray (ncopies, sizeof ('rtype_name`));
10136
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
10138
Index: libgfortran/m4/transpose.m4
10139
===================================================================
10140
--- a/src/libgfortran/m4/transpose.m4 (.../tags/gcc_4_8_3_release)
10141
+++ b/src/libgfortran/m4/transpose.m4 (.../branches/gcc-4_8-branch)
10143
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
10144
GFC_DESCRIPTOR_EXTENT(source, 1));
10146
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) ret));
10147
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
10148
+ sizeof ('rtype_name`));
10150
} else if (unlikely (compile_options.bounds_check))
10152
Index: libgfortran/m4/iforeach.m4
10153
===================================================================
10154
--- a/src/libgfortran/m4/iforeach.m4 (.../tags/gcc_4_8_3_release)
10155
+++ b/src/libgfortran/m4/iforeach.m4 (.../branches/gcc-4_8-branch)
10157
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10158
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10159
retarray->offset = 0;
10160
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
10161
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
10165
@@ -133,7 +133,7 @@
10166
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
10167
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10168
retarray->offset = 0;
10169
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
10170
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
10174
@@ -264,7 +264,7 @@
10175
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
10176
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
10177
retarray->offset = 0;
10178
- retarray->base_addr = xmalloc (sizeof (rtype_name) * rank);
10179
+ retarray->base_addr = xmallocarray (rank, sizeof (rtype_name));
10181
else if (unlikely (compile_options.bounds_check))
10183
Index: libgfortran/m4/eoshift1.m4
10184
===================================================================
10185
--- a/src/libgfortran/m4/eoshift1.m4 (.../tags/gcc_4_8_3_release)
10186
+++ b/src/libgfortran/m4/eoshift1.m4 (.../branches/gcc-4_8-branch)
10187
@@ -106,8 +106,8 @@
10188
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
10191
- /* xmalloc allocates a single byte for zero size. */
10192
- ret->base_addr = xmalloc (size * arraysize);
10193
+ /* xmallocarray allocates a single byte for zero size. */
10194
+ ret->base_addr = xmallocarray (arraysize, size);
10197
else if (unlikely (compile_options.bounds_check))
10198
Index: libgfortran/m4/eoshift3.m4
10199
===================================================================
10200
--- a/src/libgfortran/m4/eoshift3.m4 (.../tags/gcc_4_8_3_release)
10201
+++ b/src/libgfortran/m4/eoshift3.m4 (.../branches/gcc-4_8-branch)
10206
- ret->base_addr = xmalloc (size * arraysize);
10207
+ ret->base_addr = xmallocarray (arraysize, size);
10209
ret->dtype = array->dtype;
10210
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
10211
@@ -108,8 +108,8 @@
10212
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
10215
- /* xmalloc allocates a single byte for zero size. */
10216
- ret->base_addr = xmalloc (size * arraysize);
10217
+ /* xmallocarray allocates a single byte for zero size. */
10218
+ ret->base_addr = xmallocarray (arraysize, size);
10221
else if (unlikely (compile_options.bounds_check))
10222
Index: libgfortran/m4/shape.m4
10223
===================================================================
10224
--- a/src/libgfortran/m4/shape.m4 (.../tags/gcc_4_8_3_release)
10225
+++ b/src/libgfortran/m4/shape.m4 (.../branches/gcc-4_8-branch)
10228
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
10230
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * rank);
10231
+ ret->base_addr = xmallocarray (rank, sizeof ('rtype_name`));
10234
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
10235
Index: libgfortran/m4/cshift1.m4
10236
===================================================================
10237
--- a/src/libgfortran/m4/cshift1.m4 (.../tags/gcc_4_8_3_release)
10238
+++ b/src/libgfortran/m4/cshift1.m4 (.../branches/gcc-4_8-branch)
10243
- ret->base_addr = xmalloc (size * arraysize);
10244
+ ret->base_addr = xmallocarray (arraysize, size);
10246
ret->dtype = array->dtype;
10247
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
10248
Index: libgfortran/m4/matmull.m4
10249
===================================================================
10250
--- a/src/libgfortran/m4/matmull.m4 (.../tags/gcc_4_8_3_release)
10251
+++ b/src/libgfortran/m4/matmull.m4 (.../branches/gcc-4_8-branch)
10255
retarray->base_addr
10256
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
10257
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
10258
retarray->offset = 0;
10260
else if (unlikely (compile_options.bounds_check))
10261
Index: libgfortran/m4/bessel.m4
10262
===================================================================
10263
--- a/src/libgfortran/m4/bessel.m4 (.../tags/gcc_4_8_3_release)
10264
+++ b/src/libgfortran/m4/bessel.m4 (.../branches/gcc-4_8-branch)
10267
size_t size = n2 < n1 ? 0 : n2-n1+1;
10268
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
10269
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
10270
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
10274
@@ -123,7 +123,7 @@
10276
size_t size = n2 < n1 ? 0 : n2-n1+1;
10277
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
10278
- ret->base_addr = xmalloc (sizeof ('rtype_name`) * size);
10279
+ ret->base_addr = xmallocarray (size, sizeof ('rtype_name`));
10283
@@ -163,7 +163,7 @@
10285
x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
10287
- for (i = 2; i <= n1+n2; i++)
10288
+ for (i = 2; i <= n2 - n1; i++)
10290
#if defined('rtype_name`_INFINITY)
10291
if (unlikely (last2 == -'rtype_name`_INFINITY))
10292
Index: libgfortran/m4/unpack.m4
10293
===================================================================
10294
--- a/src/libgfortran/m4/unpack.m4 (.../tags/gcc_4_8_3_release)
10295
+++ b/src/libgfortran/m4/unpack.m4 (.../branches/gcc-4_8-branch)
10296
@@ -100,7 +100,7 @@
10300
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
10301
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
10305
@@ -245,7 +245,7 @@
10309
- ret->base_addr = xmalloc (rs * sizeof ('rtype_name`));
10310
+ ret->base_addr = xmallocarray (rs, sizeof ('rtype_name`));
10314
Index: libgfortran/m4/reshape.m4
10315
===================================================================
10316
--- a/src/libgfortran/m4/reshape.m4 (.../tags/gcc_4_8_3_release)
10317
+++ b/src/libgfortran/m4/reshape.m4 (.../branches/gcc-4_8-branch)
10318
@@ -115,11 +115,11 @@
10321
if (unlikely (rs < 1))
10325
- alloc_size = rs * sizeof ('rtype_name`);
10328
- ret->base_addr = xmalloc (alloc_size);
10329
+ ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`));
10330
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
10333
Index: libgfortran/m4/ifunction_logical.m4
10334
===================================================================
10335
--- a/src/libgfortran/m4/ifunction_logical.m4 (.../tags/gcc_4_8_3_release)
10336
+++ b/src/libgfortran/m4/ifunction_logical.m4 (.../branches/gcc-4_8-branch)
10338
retarray->offset = 0;
10339
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10341
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10342
- * extent[rank-1];
10343
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10345
if (alloc_size == 0)
10351
- retarray->base_addr = xmalloc (alloc_size);
10352
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
10356
Index: libgfortran/m4/ifunction.m4
10357
===================================================================
10358
--- a/src/libgfortran/m4/ifunction.m4 (.../tags/gcc_4_8_3_release)
10359
+++ b/src/libgfortran/m4/ifunction.m4 (.../branches/gcc-4_8-branch)
10361
retarray->offset = 0;
10362
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10364
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10365
- * extent[rank-1];
10366
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10368
- retarray->base_addr = xmalloc (alloc_size);
10369
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
10370
if (alloc_size == 0)
10372
/* Make sure we have a zero-sized array. */
10373
@@ -260,8 +259,7 @@
10377
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10378
- * extent[rank-1];
10379
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10381
retarray->offset = 0;
10382
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10383
@@ -273,7 +271,7 @@
10387
- retarray->base_addr = xmalloc (alloc_size);
10388
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
10392
@@ -417,8 +415,7 @@
10393
retarray->offset = 0;
10394
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10396
- alloc_size = sizeof (rtype_name) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10397
- * extent[rank-1];
10398
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10400
if (alloc_size == 0)
10402
@@ -427,7 +424,7 @@
10406
- retarray->base_addr = xmalloc (alloc_size);
10407
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
10411
Index: libgfortran/m4/matmul.m4
10412
===================================================================
10413
--- a/src/libgfortran/m4/matmul.m4 (.../tags/gcc_4_8_3_release)
10414
+++ b/src/libgfortran/m4/matmul.m4 (.../branches/gcc-4_8-branch)
10415
@@ -125,7 +125,7 @@
10418
retarray->base_addr
10419
- = xmalloc (sizeof ('rtype_name`) * size0 ((array_t *) retarray));
10420
+ = xmallocarray (size0 ((array_t *) retarray), sizeof ('rtype_name`));
10421
retarray->offset = 0;
10423
else if (unlikely (compile_options.bounds_check))
10424
Index: libgfortran/runtime/in_pack_generic.c
10425
===================================================================
10426
--- a/src/libgfortran/runtime/in_pack_generic.c (.../tags/gcc_4_8_3_release)
10427
+++ b/src/libgfortran/runtime/in_pack_generic.c (.../branches/gcc-4_8-branch)
10428
@@ -180,7 +180,7 @@
10429
return source->base_addr;
10431
/* Allocate storage for the destination. */
10432
- destptr = xmalloc (ssize * size);
10433
+ destptr = xmallocarray (ssize, size);
10434
dest = (char *)destptr;
10435
src = source->base_addr;
10436
stride0 = stride[0] * size;
10437
Index: libgfortran/runtime/memory.c
10438
===================================================================
10439
--- a/src/libgfortran/runtime/memory.c (.../tags/gcc_4_8_3_release)
10440
+++ b/src/libgfortran/runtime/memory.c (.../branches/gcc-4_8-branch)
10443
#include "libgfortran.h"
10444
#include <stdlib.h>
10445
+#include <errno.h>
10448
+#define SIZE_MAX ((size_t)-1)
10455
@@ -44,12 +49,34 @@
10460
+xmallocarray (size_t nmemb, size_t size)
10464
+ if (!nmemb || !size)
10465
+ size = nmemb = 1;
10466
+ else if (nmemb > SIZE_MAX / size)
10469
+ os_error ("Integer overflow in xmallocarray");
10472
+ p = malloc (nmemb * size);
10475
+ os_error ("Memory allocation failed in xmallocarray");
10481
/* calloc wrapper that aborts on error. */
10484
xcalloc (size_t nmemb, size_t size)
10486
- if (nmemb * size == 0)
10487
+ if (!nmemb || !size)
10490
void *p = calloc (nmemb, size);
10491
Index: libgfortran/runtime/convert_char.c
10492
===================================================================
10493
--- a/src/libgfortran/runtime/convert_char.c (.../tags/gcc_4_8_3_release)
10494
+++ b/src/libgfortran/runtime/convert_char.c (.../branches/gcc-4_8-branch)
10496
gfc_charlen_type i, l;
10498
l = len > 0 ? len : 0;
10499
- *dst = xmalloc ((l + 1) * sizeof (gfc_char4_t));
10500
+ *dst = xmallocarray ((l + 1), sizeof (gfc_char4_t));
10502
for (i = 0; i < l; i++)
10503
(*dst)[i] = src[i];
10505
gfc_charlen_type i, l;
10507
l = len > 0 ? len : 0;
10508
- *dst = xmalloc ((l + 1) * sizeof (unsigned char));
10509
+ *dst = xmalloc (l + 1);
10511
for (i = 0; i < l; i++)
10512
(*dst)[i] = src[i];
10513
Index: libgfortran/runtime/environ.c
10514
===================================================================
10515
--- a/src/libgfortran/runtime/environ.c (.../tags/gcc_4_8_3_release)
10516
+++ b/src/libgfortran/runtime/environ.c (.../branches/gcc-4_8-branch)
10517
@@ -833,7 +833,7 @@
10521
- elist = xmalloc (unit_count * sizeof (exception_t));
10522
+ elist = xmallocarray (unit_count, sizeof (exception_t));
10526
Index: libgfortran/intrinsics/string_intrinsics_inc.c
10527
===================================================================
10528
--- a/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../tags/gcc_4_8_3_release)
10529
+++ b/src/libgfortran/intrinsics/string_intrinsics_inc.c (.../branches/gcc-4_8-branch)
10530
@@ -164,7 +164,7 @@
10533
/* Allocate space for result string. */
10534
- *dest = xmalloc (*len * sizeof (CHARTYPE));
10535
+ *dest = xmallocarray (*len, sizeof (CHARTYPE));
10537
/* Copy string if necessary. */
10538
memcpy (*dest, src, *len * sizeof (CHARTYPE));
10539
@@ -442,7 +442,7 @@
10540
*dest = &zero_length_string;
10543
- CHARTYPE *tmp = xmalloc (*rlen * sizeof (CHARTYPE));
10544
+ CHARTYPE *tmp = xmallocarray (*rlen, sizeof (CHARTYPE));
10545
memcpy (tmp, res, reslen * sizeof (CHARTYPE));
10546
MEMSET (&tmp[reslen], ' ', *rlen - reslen);
10548
Index: libgfortran/intrinsics/pack_generic.c
10549
===================================================================
10550
--- a/src/libgfortran/intrinsics/pack_generic.c (.../tags/gcc_4_8_3_release)
10551
+++ b/src/libgfortran/intrinsics/pack_generic.c (.../branches/gcc-4_8-branch)
10552
@@ -152,8 +152,8 @@
10553
GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
10556
- /* xmalloc allocates a single byte for zero size. */
10557
- ret->base_addr = xmalloc (size * total);
10558
+ /* xmallocarray allocates a single byte for zero size. */
10559
+ ret->base_addr = xmallocarray (total, size);
10562
return; /* In this case, nothing remains to be done. */
10563
@@ -519,7 +519,7 @@
10567
- ret->base_addr = xmalloc (size * total);
10568
+ ret->base_addr = xmallocarray (total, size);
10572
Index: libgfortran/intrinsics/transpose_generic.c
10573
===================================================================
10574
--- a/src/libgfortran/intrinsics/transpose_generic.c (.../tags/gcc_4_8_3_release)
10575
+++ b/src/libgfortran/intrinsics/transpose_generic.c (.../branches/gcc-4_8-branch)
10577
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
10578
GFC_DESCRIPTOR_EXTENT(source, 1));
10580
- ret->base_addr = xmalloc (size * size0 ((array_t*)ret));
10581
+ ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
10584
else if (unlikely (compile_options.bounds_check))
10585
Index: libgfortran/intrinsics/cshift0.c
10586
===================================================================
10587
--- a/src/libgfortran/intrinsics/cshift0.c (.../tags/gcc_4_8_3_release)
10588
+++ b/src/libgfortran/intrinsics/cshift0.c (.../branches/gcc-4_8-branch)
10590
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
10593
- /* xmalloc allocates a single byte for zero size. */
10594
- ret->base_addr = xmalloc (size * arraysize);
10595
+ /* xmallocarray allocates a single byte for zero size. */
10596
+ ret->base_addr = xmallocarray (arraysize, size);
10598
else if (unlikely (compile_options.bounds_check))
10600
Index: libgfortran/intrinsics/ctime.c
10601
===================================================================
10602
--- a/src/libgfortran/intrinsics/ctime.c (.../tags/gcc_4_8_3_release)
10603
+++ b/src/libgfortran/intrinsics/ctime.c (.../branches/gcc-4_8-branch)
10604
@@ -31,31 +31,53 @@
10605
#include <string.h>
10608
-/* strftime-like function that fills a C string with %c format which
10609
- is identical to ctime in the default locale. As ctime and ctime_r
10610
- are poorly specified and their usage not recommended, the
10611
- implementation instead uses strftime. */
10612
+/* Maximum space a ctime-like string might need. A "normal" ctime
10613
+ string is 26 bytes, and in our case 24 bytes as we don't include
10614
+ the trailing newline and null. However, the longest possible year
10615
+ number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a
10616
+ 32-bit signed integer) so an extra 7 bytes are needed. */
10617
+#define CTIME_BUFSZ 31
10620
-strctime (char *s, size_t max, const time_t *timep)
10622
+/* Thread-safe ctime-like function that fills a Fortran
10623
+ string. ctime_r is a portability headache and marked as obsolescent
10624
+ in POSIX 2008, which recommends strftime in its place. However,
10625
+ strftime(..., "%c",...) doesn't produce ctime-like output on
10626
+ MinGW, so do it manually with snprintf. */
10629
+gf_ctime (char *s, size_t max, const time_t timev)
10633
+ char buf[CTIME_BUFSZ + 1];
10634
/* Some targets provide a localtime_r based on a draft of the POSIX
10635
standard where the return type is int rather than the
10636
standardized struct tm*. */
10637
- __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, <m))
10638
+ __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, <m))
10640
- failed = localtime_r (timep, <m) == NULL,
10641
- failed = localtime_r (timep, <m) != 0);
10642
+ failed = localtime_r (&timev, <m) == NULL,
10643
+ failed = localtime_r (&timev, <m) != 0);
10646
- return strftime (s, max, "%c", <m);
10648
+ int n = snprintf (buf, sizeof (buf),
10649
+ "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d",
10650
+ "SunMonTueWedThuFriSat" + ltm.tm_wday * 3,
10651
+ "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3,
10652
+ ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec,
10653
+ 1900 + ltm.tm_year);
10656
+ if ((size_t) n <= max)
10658
+ cf_strcpy (s, max, buf);
10662
+ memset (s, ' ', max);
10666
-/* In the default locale, the date and time representation fits in 26
10667
- bytes. However, other locales might need more space. */
10670
extern void fdate (char **, gfc_charlen_type *);
10671
export_proto(fdate);
10673
fdate (char ** date, gfc_charlen_type * date_len)
10675
time_t now = time(NULL);
10676
- *date = xmalloc (CSZ);
10677
- *date_len = strctime (*date, CSZ, &now);
10678
+ *date = xmalloc (CTIME_BUFSZ);
10679
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
10684
fdate_sub (char * date, gfc_charlen_type date_len)
10686
time_t now = time(NULL);
10687
- char *s = xmalloc (date_len + 1);
10688
- size_t n = strctime (s, date_len + 1, &now);
10689
- fstrcpy (date, date_len, s, n);
10691
+ gf_ctime (date, date_len, now);
10696
PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t)
10699
- *date = xmalloc (CSZ);
10700
- *date_len = strctime (*date, CSZ, &now);
10701
+ *date = xmalloc (CTIME_BUFSZ);
10702
+ *date_len = gf_ctime (*date, CTIME_BUFSZ, now);
10706
@@ -103,8 +122,5 @@
10707
ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len)
10710
- char *s = xmalloc (date_len + 1);
10711
- size_t n = strctime (s, date_len + 1, &now);
10712
- fstrcpy (date, date_len, s, n);
10714
+ gf_ctime (date, date_len, now);
10716
Index: libgfortran/intrinsics/spread_generic.c
10717
===================================================================
10718
--- a/src/libgfortran/intrinsics/spread_generic.c (.../tags/gcc_4_8_3_release)
10719
+++ b/src/libgfortran/intrinsics/spread_generic.c (.../branches/gcc-4_8-branch)
10720
@@ -100,7 +100,7 @@
10721
GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
10724
- ret->base_addr = xmalloc (rs * size);
10725
+ ret->base_addr = xmallocarray (rs, size);
10729
@@ -245,7 +245,7 @@
10731
if (ret->base_addr == NULL)
10733
- ret->base_addr = xmalloc (ncopies * size);
10734
+ ret->base_addr = xmallocarray (ncopies, size);
10736
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
10738
Index: libgfortran/intrinsics/unpack_generic.c
10739
===================================================================
10740
--- a/src/libgfortran/intrinsics/unpack_generic.c (.../tags/gcc_4_8_3_release)
10741
+++ b/src/libgfortran/intrinsics/unpack_generic.c (.../branches/gcc-4_8-branch)
10742
@@ -125,7 +125,7 @@
10746
- ret->base_addr = xmalloc (rs * size);
10747
+ ret->base_addr = xmallocarray (rs, size);
10751
Index: libgfortran/intrinsics/eoshift0.c
10752
===================================================================
10753
--- a/src/libgfortran/intrinsics/eoshift0.c (.../tags/gcc_4_8_3_release)
10754
+++ b/src/libgfortran/intrinsics/eoshift0.c (.../branches/gcc-4_8-branch)
10759
- /* xmalloc allocates a single byte for zero size. */
10760
- ret->base_addr = xmalloc (size * arraysize);
10761
+ /* xmallocarray allocates a single byte for zero size. */
10762
+ ret->base_addr = xmallocarray (arraysize, size);
10764
else if (unlikely (compile_options.bounds_check))
10766
Index: libgfortran/intrinsics/eoshift2.c
10767
===================================================================
10768
--- a/src/libgfortran/intrinsics/eoshift2.c (.../tags/gcc_4_8_3_release)
10769
+++ b/src/libgfortran/intrinsics/eoshift2.c (.../branches/gcc-4_8-branch)
10772
ret->dtype = array->dtype;
10774
- /* xmalloc allocates a single byte for zero size. */
10775
- ret->base_addr = xmalloc (size * arraysize);
10776
+ /* xmallocarray allocates a single byte for zero size. */
10777
+ ret->base_addr = xmallocarray (arraysize, size);
10779
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
10781
Index: libgfortran/intrinsics/reshape_generic.c
10782
===================================================================
10783
--- a/src/libgfortran/intrinsics/reshape_generic.c (.../tags/gcc_4_8_3_release)
10784
+++ b/src/libgfortran/intrinsics/reshape_generic.c (.../branches/gcc-4_8-branch)
10785
@@ -99,11 +99,11 @@
10788
if (unlikely (rs < 1))
10790
+ alloc_size = 0; /* xmalloc will allocate 1 byte. */
10792
- alloc_size = rs * size;
10795
- ret->base_addr = xmalloc (alloc_size);
10796
+ ret->base_addr = xmallocarray (alloc_size, size);
10798
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
10800
Index: libgfortran/ChangeLog
10801
===================================================================
10802
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release)
10803
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
10805
+2014-08-20 Steven G. Kargl <kargl@gcc.gnu.org>
10807
+ PR libgfortran/62188
10808
+ * m4/bessel.m4: Avoid indexing off the end of an array.
10809
+ * generated/bessel_r10.c: Regenerated.
10810
+ * generated/bessel_r16.c: Ditto.
10811
+ * generated/bessel_r4.c: Ditto.
10812
+ * generated/bessel_r8.c: Ditto.
10814
+2014-07-31 Janne Blomqvist <jb@gcc.gnu.org>
10816
+ Backport from mainline
10818
+ * libgfortran.h (xmallocarray): New prototype.
10819
+ * runtime/memory.c (xmallocarray): New function.
10820
+ (xcalloc): Check for nonzero separately instead of multiplying.
10821
+ * generated/*.c: Regenerated.
10822
+ * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of
10824
+ * intrinsics/eoshift0.c (eoshift0): Likewise.
10825
+ * intrinsics/eoshift2.c (eoshift2): Likewise.
10826
+ * intrinsics/pack_generic.c (pack_internal): Likewise.
10827
+ (pack_s_internal): Likewise.
10828
+ * intrinsics/reshape_generic.c (reshape_internal): Likewise.
10829
+ * intrinsics/spread_generic.c (spread_internal): Likewise.
10830
+ (spread_internal_scalar): Likewise.
10831
+ * intrinsics/string_intrinsics_inc.c (string_trim): Likewise.
10832
+ (string_minmax): Likewise.
10833
+ * intrinsics/transpose_generic.c (transpose_internal): Likewise.
10834
+ * intrinsics/unpack_generic.c (unpack_internal): Likewise.
10835
+ * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value.
10836
+ * io/transfer.c (st_set_nml_var): Call xmallocarray instead of
10838
+ * io/unit.c (get_internal_unit): Likewise.
10839
+ (filename_from_unit): Don't cast xmalloc return value.
10840
+ * io/write.c (nml_write_obj): Likewise, formatting.
10841
+ * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray
10842
+ instead of xmalloc.
10843
+ (besse_yn_r'rtype_kind`): Likewise.
10844
+ * m4/cshift1.m4 (cshift1): Likewise.
10845
+ * m4/eoshift1.m4 (eoshift1): Likewise.
10846
+ * m4/eoshift3.m4 (eoshift3): Likewise.
10847
+ * m4/iforeach.m4: Likewise.
10848
+ * m4/ifunction.m4: Likewise.
10849
+ * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code):
10851
+ * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise.
10852
+ * m4/matmul.m4 (matmul_'rtype_code`): Likewise.
10853
+ * m4/matmull.m4 (matmul_'rtype_code`): Likewise.
10854
+ * m4/pack.m4 (pack_'rtype_code`): Likewise.
10855
+ * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise.
10856
+ * m4/shape.m4 (shape_'rtype_kind`): Likewise.
10857
+ * m4/spread.m4 (spread_'rtype_code`): Likewise.
10858
+ (spread_scalar_'rtype_code`): Likewise.
10859
+ * m4/transpose.m4 (transpose_'rtype_code`): Likewise.
10860
+ * m4/unpack.m4 (unpack0_'rtype_code`): Likewise.
10861
+ (unpack1_'rtype_code`): Likewise.
10862
+ * runtime/convert_char.c (convert_char1_to_char4): Likewise.
10863
+ (convert_char4_to_char1): Simplify.
10864
+ * runtime/environ.c (init_unformatted): Call xmallocarray instead
10866
+ * runtime/in_pack_generic.c (internal_pack): Likewise.
10868
+2014-05-26 Janne Blomqvist <jb@gcc.gnu.org>
10870
+ Backport from mainline
10871
+ PR libfortran/61310
10872
+ * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf
10873
+ instead of strftime.
10874
+ (fdate): Use gf_ctime.
10875
+ (fdate_sub): Likewise.
10876
+ (ctime): Likewise.
10877
+ (ctime_sub): Likewise.
10879
+2014-05-25 Janne Blomqvist <jb@gcc.gnu.org>
10881
+ Backport from trunk.
10882
+ PR libfortran/61187
10883
+ * io/unix.c (raw_close): Check if s->fd is -1.
10884
+ (fd_to_stream): Check return value of fstat(), handle error.
10886
2014-05-22 Release Manager
10888
* GCC 4.8.3 released.
10889
Index: libgfortran/generated/spread_r10.c
10890
===================================================================
10891
--- a/src/libgfortran/generated/spread_r10.c (.../tags/gcc_4_8_3_release)
10892
+++ b/src/libgfortran/generated/spread_r10.c (.../branches/gcc-4_8-branch)
10893
@@ -101,8 +101,8 @@
10897
- /* xmalloc allocates a single byte for zero size. */
10898
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_10));
10899
+ /* xmallocarray allocates a single byte for zero size. */
10900
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_10));
10904
@@ -244,7 +244,7 @@
10906
if (ret->base_addr == NULL)
10908
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_10));
10909
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_10));
10911
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
10913
Index: libgfortran/generated/maxloc1_4_r8.c
10914
===================================================================
10915
--- a/src/libgfortran/generated/maxloc1_4_r8.c (.../tags/gcc_4_8_3_release)
10916
+++ b/src/libgfortran/generated/maxloc1_4_r8.c (.../branches/gcc-4_8-branch)
10918
retarray->offset = 0;
10919
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10921
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10922
- * extent[rank-1];
10923
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10925
- retarray->base_addr = xmalloc (alloc_size);
10926
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10927
if (alloc_size == 0)
10929
/* Make sure we have a zero-sized array. */
10930
@@ -294,8 +293,7 @@
10934
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10935
- * extent[rank-1];
10936
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10938
retarray->offset = 0;
10939
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10940
@@ -307,7 +305,7 @@
10944
- retarray->base_addr = xmalloc (alloc_size);
10945
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10949
@@ -485,8 +483,7 @@
10950
retarray->offset = 0;
10951
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10953
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10954
- * extent[rank-1];
10955
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10957
if (alloc_size == 0)
10959
@@ -495,7 +492,7 @@
10963
- retarray->base_addr = xmalloc (alloc_size);
10964
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
10968
Index: libgfortran/generated/norm2_r4.c
10969
===================================================================
10970
--- a/src/libgfortran/generated/norm2_r4.c (.../tags/gcc_4_8_3_release)
10971
+++ b/src/libgfortran/generated/norm2_r4.c (.../branches/gcc-4_8-branch)
10972
@@ -101,10 +101,9 @@
10973
retarray->offset = 0;
10974
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10976
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10977
- * extent[rank-1];
10978
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10980
- retarray->base_addr = xmalloc (alloc_size);
10981
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
10982
if (alloc_size == 0)
10984
/* Make sure we have a zero-sized array. */
10985
Index: libgfortran/generated/parity_l2.c
10986
===================================================================
10987
--- a/src/libgfortran/generated/parity_l2.c (.../tags/gcc_4_8_3_release)
10988
+++ b/src/libgfortran/generated/parity_l2.c (.../branches/gcc-4_8-branch)
10990
retarray->offset = 0;
10991
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
10993
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
10994
- * extent[rank-1];
10995
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
10997
- retarray->base_addr = xmalloc (alloc_size);
10998
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
10999
if (alloc_size == 0)
11001
/* Make sure we have a zero-sized array. */
11002
Index: libgfortran/generated/eoshift3_4.c
11003
===================================================================
11004
--- a/src/libgfortran/generated/eoshift3_4.c (.../tags/gcc_4_8_3_release)
11005
+++ b/src/libgfortran/generated/eoshift3_4.c (.../branches/gcc-4_8-branch)
11010
- ret->base_addr = xmalloc (size * arraysize);
11011
+ ret->base_addr = xmallocarray (arraysize, size);
11013
ret->dtype = array->dtype;
11014
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
11015
@@ -107,8 +107,8 @@
11016
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
11019
- /* xmalloc allocates a single byte for zero size. */
11020
- ret->base_addr = xmalloc (size * arraysize);
11021
+ /* xmallocarray allocates a single byte for zero size. */
11022
+ ret->base_addr = xmallocarray (arraysize, size);
11025
else if (unlikely (compile_options.bounds_check))
11026
Index: libgfortran/generated/transpose_c8.c
11027
===================================================================
11028
--- a/src/libgfortran/generated/transpose_c8.c (.../tags/gcc_4_8_3_release)
11029
+++ b/src/libgfortran/generated/transpose_c8.c (.../branches/gcc-4_8-branch)
11031
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11032
GFC_DESCRIPTOR_EXTENT(source, 1));
11034
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) ret));
11035
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11036
+ sizeof (GFC_COMPLEX_8));
11038
} else if (unlikely (compile_options.bounds_check))
11040
Index: libgfortran/generated/eoshift1_8.c
11041
===================================================================
11042
--- a/src/libgfortran/generated/eoshift1_8.c (.../tags/gcc_4_8_3_release)
11043
+++ b/src/libgfortran/generated/eoshift1_8.c (.../branches/gcc-4_8-branch)
11044
@@ -105,8 +105,8 @@
11045
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
11048
- /* xmalloc allocates a single byte for zero size. */
11049
- ret->base_addr = xmalloc (size * arraysize);
11050
+ /* xmallocarray allocates a single byte for zero size. */
11051
+ ret->base_addr = xmallocarray (arraysize, size);
11054
else if (unlikely (compile_options.bounds_check))
11055
Index: libgfortran/generated/reshape_r16.c
11056
===================================================================
11057
--- a/src/libgfortran/generated/reshape_r16.c (.../tags/gcc_4_8_3_release)
11058
+++ b/src/libgfortran/generated/reshape_r16.c (.../branches/gcc-4_8-branch)
11059
@@ -111,11 +111,11 @@
11062
if (unlikely (rs < 1))
11066
- alloc_size = rs * sizeof (GFC_REAL_16);
11069
- ret->base_addr = xmalloc (alloc_size);
11070
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11071
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
11074
Index: libgfortran/generated/bessel_r4.c
11075
===================================================================
11076
--- a/src/libgfortran/generated/bessel_r4.c (.../tags/gcc_4_8_3_release)
11077
+++ b/src/libgfortran/generated/bessel_r4.c (.../branches/gcc-4_8-branch)
11080
size_t size = n2 < n1 ? 0 : n2-n1+1;
11081
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
11082
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
11083
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
11087
@@ -122,7 +122,7 @@
11089
size_t size = n2 < n1 ? 0 : n2-n1+1;
11090
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
11091
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size);
11092
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
11096
@@ -162,7 +162,7 @@
11098
x2rev = GFC_REAL_4_LITERAL(2.)/x;
11100
- for (i = 2; i <= n1+n2; i++)
11101
+ for (i = 2; i <= n2 - n1; i++)
11103
#if defined(GFC_REAL_4_INFINITY)
11104
if (unlikely (last2 == -GFC_REAL_4_INFINITY))
11105
Index: libgfortran/generated/any_l2.c
11106
===================================================================
11107
--- a/src/libgfortran/generated/any_l2.c (.../tags/gcc_4_8_3_release)
11108
+++ b/src/libgfortran/generated/any_l2.c (.../branches/gcc-4_8-branch)
11109
@@ -101,8 +101,7 @@
11110
retarray->offset = 0;
11111
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11113
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11114
- * extent[rank-1];
11115
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11117
if (alloc_size == 0)
11119
@@ -111,7 +110,7 @@
11123
- retarray->base_addr = xmalloc (alloc_size);
11124
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
11128
Index: libgfortran/generated/product_r4.c
11129
===================================================================
11130
--- a/src/libgfortran/generated/product_r4.c (.../tags/gcc_4_8_3_release)
11131
+++ b/src/libgfortran/generated/product_r4.c (.../branches/gcc-4_8-branch)
11133
retarray->offset = 0;
11134
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11136
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11137
- * extent[rank-1];
11138
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11140
- retarray->base_addr = xmalloc (alloc_size);
11141
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11142
if (alloc_size == 0)
11144
/* Make sure we have a zero-sized array. */
11145
@@ -272,8 +271,7 @@
11149
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11150
- * extent[rank-1];
11151
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11153
retarray->offset = 0;
11154
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11155
@@ -285,7 +283,7 @@
11159
- retarray->base_addr = xmalloc (alloc_size);
11160
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11164
@@ -430,8 +428,7 @@
11165
retarray->offset = 0;
11166
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11168
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11169
- * extent[rank-1];
11170
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11172
if (alloc_size == 0)
11174
@@ -440,7 +437,7 @@
11178
- retarray->base_addr = xmalloc (alloc_size);
11179
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
11183
Index: libgfortran/generated/iany_i1.c
11184
===================================================================
11185
--- a/src/libgfortran/generated/iany_i1.c (.../tags/gcc_4_8_3_release)
11186
+++ b/src/libgfortran/generated/iany_i1.c (.../branches/gcc-4_8-branch)
11188
retarray->offset = 0;
11189
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11191
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11192
- * extent[rank-1];
11193
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11195
- retarray->base_addr = xmalloc (alloc_size);
11196
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11197
if (alloc_size == 0)
11199
/* Make sure we have a zero-sized array. */
11200
@@ -272,8 +271,7 @@
11204
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11205
- * extent[rank-1];
11206
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11208
retarray->offset = 0;
11209
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11210
@@ -285,7 +283,7 @@
11214
- retarray->base_addr = xmalloc (alloc_size);
11215
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11219
@@ -430,8 +428,7 @@
11220
retarray->offset = 0;
11221
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11223
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11224
- * extent[rank-1];
11225
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11227
if (alloc_size == 0)
11229
@@ -440,7 +437,7 @@
11233
- retarray->base_addr = xmalloc (alloc_size);
11234
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11238
Index: libgfortran/generated/parity_l16.c
11239
===================================================================
11240
--- a/src/libgfortran/generated/parity_l16.c (.../tags/gcc_4_8_3_release)
11241
+++ b/src/libgfortran/generated/parity_l16.c (.../branches/gcc-4_8-branch)
11243
retarray->offset = 0;
11244
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11246
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11247
- * extent[rank-1];
11248
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11250
- retarray->base_addr = xmalloc (alloc_size);
11251
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
11252
if (alloc_size == 0)
11254
/* Make sure we have a zero-sized array. */
11255
Index: libgfortran/generated/in_pack_r4.c
11256
===================================================================
11257
--- a/src/libgfortran/generated/in_pack_r4.c (.../tags/gcc_4_8_3_release)
11258
+++ b/src/libgfortran/generated/in_pack_r4.c (.../branches/gcc-4_8-branch)
11260
return source->base_addr;
11262
/* Allocate storage for the destination. */
11263
- destptr = (GFC_REAL_4 *)xmalloc (ssize * sizeof (GFC_REAL_4));
11264
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_4));
11266
src = source->base_addr;
11267
stride0 = stride[0];
11268
Index: libgfortran/generated/product_i2.c
11269
===================================================================
11270
--- a/src/libgfortran/generated/product_i2.c (.../tags/gcc_4_8_3_release)
11271
+++ b/src/libgfortran/generated/product_i2.c (.../branches/gcc-4_8-branch)
11273
retarray->offset = 0;
11274
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11276
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11277
- * extent[rank-1];
11278
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11280
- retarray->base_addr = xmalloc (alloc_size);
11281
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11282
if (alloc_size == 0)
11284
/* Make sure we have a zero-sized array. */
11285
@@ -272,8 +271,7 @@
11289
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11290
- * extent[rank-1];
11291
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11293
retarray->offset = 0;
11294
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11295
@@ -285,7 +283,7 @@
11299
- retarray->base_addr = xmalloc (alloc_size);
11300
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11304
@@ -430,8 +428,7 @@
11305
retarray->offset = 0;
11306
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11308
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11309
- * extent[rank-1];
11310
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11312
if (alloc_size == 0)
11314
@@ -440,7 +437,7 @@
11318
- retarray->base_addr = xmalloc (alloc_size);
11319
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
11323
Index: libgfortran/generated/iparity_i4.c
11324
===================================================================
11325
--- a/src/libgfortran/generated/iparity_i4.c (.../tags/gcc_4_8_3_release)
11326
+++ b/src/libgfortran/generated/iparity_i4.c (.../branches/gcc-4_8-branch)
11328
retarray->offset = 0;
11329
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11331
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11332
- * extent[rank-1];
11333
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11335
- retarray->base_addr = xmalloc (alloc_size);
11336
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11337
if (alloc_size == 0)
11339
/* Make sure we have a zero-sized array. */
11340
@@ -272,8 +271,7 @@
11344
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11345
- * extent[rank-1];
11346
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11348
retarray->offset = 0;
11349
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11350
@@ -285,7 +283,7 @@
11354
- retarray->base_addr = xmalloc (alloc_size);
11355
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11359
@@ -430,8 +428,7 @@
11360
retarray->offset = 0;
11361
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11363
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11364
- * extent[rank-1];
11365
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11367
if (alloc_size == 0)
11369
@@ -440,7 +437,7 @@
11373
- retarray->base_addr = xmalloc (alloc_size);
11374
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
11378
Index: libgfortran/generated/minloc0_4_i1.c
11379
===================================================================
11380
--- a/src/libgfortran/generated/minloc0_4_i1.c (.../tags/gcc_4_8_3_release)
11381
+++ b/src/libgfortran/generated/minloc0_4_i1.c (.../branches/gcc-4_8-branch)
11383
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11384
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11385
retarray->offset = 0;
11386
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11387
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11391
@@ -199,7 +199,7 @@
11392
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11393
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11394
retarray->offset = 0;
11395
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11396
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11400
@@ -367,7 +367,7 @@
11401
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11402
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11403
retarray->offset = 0;
11404
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11405
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11407
else if (unlikely (compile_options.bounds_check))
11409
Index: libgfortran/generated/reshape_c4.c
11410
===================================================================
11411
--- a/src/libgfortran/generated/reshape_c4.c (.../tags/gcc_4_8_3_release)
11412
+++ b/src/libgfortran/generated/reshape_c4.c (.../branches/gcc-4_8-branch)
11413
@@ -111,11 +111,11 @@
11416
if (unlikely (rs < 1))
11420
- alloc_size = rs * sizeof (GFC_COMPLEX_4);
11423
- ret->base_addr = xmalloc (alloc_size);
11424
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
11425
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
11428
Index: libgfortran/generated/maxloc0_4_r16.c
11429
===================================================================
11430
--- a/src/libgfortran/generated/maxloc0_4_r16.c (.../tags/gcc_4_8_3_release)
11431
+++ b/src/libgfortran/generated/maxloc0_4_r16.c (.../branches/gcc-4_8-branch)
11433
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11434
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11435
retarray->offset = 0;
11436
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11437
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11441
@@ -199,7 +199,7 @@
11442
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11443
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11444
retarray->offset = 0;
11445
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11446
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11450
@@ -367,7 +367,7 @@
11451
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11452
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11453
retarray->offset = 0;
11454
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
11455
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
11457
else if (unlikely (compile_options.bounds_check))
11459
Index: libgfortran/generated/iall_i8.c
11460
===================================================================
11461
--- a/src/libgfortran/generated/iall_i8.c (.../tags/gcc_4_8_3_release)
11462
+++ b/src/libgfortran/generated/iall_i8.c (.../branches/gcc-4_8-branch)
11464
retarray->offset = 0;
11465
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11467
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11468
- * extent[rank-1];
11469
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11471
- retarray->base_addr = xmalloc (alloc_size);
11472
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11473
if (alloc_size == 0)
11475
/* Make sure we have a zero-sized array. */
11476
@@ -272,8 +271,7 @@
11480
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11481
- * extent[rank-1];
11482
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11484
retarray->offset = 0;
11485
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11486
@@ -285,7 +283,7 @@
11490
- retarray->base_addr = xmalloc (alloc_size);
11491
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11495
@@ -430,8 +428,7 @@
11496
retarray->offset = 0;
11497
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11499
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11500
- * extent[rank-1];
11501
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11503
if (alloc_size == 0)
11505
@@ -440,7 +437,7 @@
11509
- retarray->base_addr = xmalloc (alloc_size);
11510
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11514
Index: libgfortran/generated/maxloc1_8_r16.c
11515
===================================================================
11516
--- a/src/libgfortran/generated/maxloc1_8_r16.c (.../tags/gcc_4_8_3_release)
11517
+++ b/src/libgfortran/generated/maxloc1_8_r16.c (.../branches/gcc-4_8-branch)
11519
retarray->offset = 0;
11520
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11522
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11523
- * extent[rank-1];
11524
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11526
- retarray->base_addr = xmalloc (alloc_size);
11527
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11528
if (alloc_size == 0)
11530
/* Make sure we have a zero-sized array. */
11531
@@ -294,8 +293,7 @@
11535
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11536
- * extent[rank-1];
11537
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11539
retarray->offset = 0;
11540
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11541
@@ -307,7 +305,7 @@
11545
- retarray->base_addr = xmalloc (alloc_size);
11546
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11550
@@ -485,8 +483,7 @@
11551
retarray->offset = 0;
11552
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11554
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11555
- * extent[rank-1];
11556
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11558
if (alloc_size == 0)
11560
@@ -495,7 +492,7 @@
11564
- retarray->base_addr = xmalloc (alloc_size);
11565
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11569
Index: libgfortran/generated/sum_r16.c
11570
===================================================================
11571
--- a/src/libgfortran/generated/sum_r16.c (.../tags/gcc_4_8_3_release)
11572
+++ b/src/libgfortran/generated/sum_r16.c (.../branches/gcc-4_8-branch)
11574
retarray->offset = 0;
11575
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11577
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11578
- * extent[rank-1];
11579
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11581
- retarray->base_addr = xmalloc (alloc_size);
11582
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11583
if (alloc_size == 0)
11585
/* Make sure we have a zero-sized array. */
11586
@@ -272,8 +271,7 @@
11590
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11591
- * extent[rank-1];
11592
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11594
retarray->offset = 0;
11595
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11596
@@ -285,7 +283,7 @@
11600
- retarray->base_addr = xmalloc (alloc_size);
11601
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11605
@@ -430,8 +428,7 @@
11606
retarray->offset = 0;
11607
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11609
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11610
- * extent[rank-1];
11611
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11613
if (alloc_size == 0)
11615
@@ -440,7 +437,7 @@
11619
- retarray->base_addr = xmalloc (alloc_size);
11620
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11624
Index: libgfortran/generated/sum_i1.c
11625
===================================================================
11626
--- a/src/libgfortran/generated/sum_i1.c (.../tags/gcc_4_8_3_release)
11627
+++ b/src/libgfortran/generated/sum_i1.c (.../branches/gcc-4_8-branch)
11629
retarray->offset = 0;
11630
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11632
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11633
- * extent[rank-1];
11634
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11636
- retarray->base_addr = xmalloc (alloc_size);
11637
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11638
if (alloc_size == 0)
11640
/* Make sure we have a zero-sized array. */
11641
@@ -272,8 +271,7 @@
11645
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11646
- * extent[rank-1];
11647
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11649
retarray->offset = 0;
11650
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11651
@@ -285,7 +283,7 @@
11655
- retarray->base_addr = xmalloc (alloc_size);
11656
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11660
@@ -430,8 +428,7 @@
11661
retarray->offset = 0;
11662
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11664
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11665
- * extent[rank-1];
11666
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11668
if (alloc_size == 0)
11670
@@ -440,7 +437,7 @@
11674
- retarray->base_addr = xmalloc (alloc_size);
11675
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
11679
Index: libgfortran/generated/in_pack_i2.c
11680
===================================================================
11681
--- a/src/libgfortran/generated/in_pack_i2.c (.../tags/gcc_4_8_3_release)
11682
+++ b/src/libgfortran/generated/in_pack_i2.c (.../branches/gcc-4_8-branch)
11684
return source->base_addr;
11686
/* Allocate storage for the destination. */
11687
- destptr = (GFC_INTEGER_2 *)xmalloc (ssize * sizeof (GFC_INTEGER_2));
11688
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_2));
11690
src = source->base_addr;
11691
stride0 = stride[0];
11692
Index: libgfortran/generated/transpose_r10.c
11693
===================================================================
11694
--- a/src/libgfortran/generated/transpose_r10.c (.../tags/gcc_4_8_3_release)
11695
+++ b/src/libgfortran/generated/transpose_r10.c (.../branches/gcc-4_8-branch)
11697
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
11698
GFC_DESCRIPTOR_EXTENT(source, 1));
11700
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) ret));
11701
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
11702
+ sizeof (GFC_REAL_10));
11704
} else if (unlikely (compile_options.bounds_check))
11706
Index: libgfortran/generated/maxloc1_16_r16.c
11707
===================================================================
11708
--- a/src/libgfortran/generated/maxloc1_16_r16.c (.../tags/gcc_4_8_3_release)
11709
+++ b/src/libgfortran/generated/maxloc1_16_r16.c (.../branches/gcc-4_8-branch)
11711
retarray->offset = 0;
11712
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11714
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11715
- * extent[rank-1];
11716
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11718
- retarray->base_addr = xmalloc (alloc_size);
11719
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11720
if (alloc_size == 0)
11722
/* Make sure we have a zero-sized array. */
11723
@@ -294,8 +293,7 @@
11727
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11728
- * extent[rank-1];
11729
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11731
retarray->offset = 0;
11732
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11733
@@ -307,7 +305,7 @@
11737
- retarray->base_addr = xmalloc (alloc_size);
11738
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11742
@@ -485,8 +483,7 @@
11743
retarray->offset = 0;
11744
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11746
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11747
- * extent[rank-1];
11748
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11750
if (alloc_size == 0)
11752
@@ -495,7 +492,7 @@
11756
- retarray->base_addr = xmalloc (alloc_size);
11757
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11761
Index: libgfortran/generated/maxloc1_16_i4.c
11762
===================================================================
11763
--- a/src/libgfortran/generated/maxloc1_16_i4.c (.../tags/gcc_4_8_3_release)
11764
+++ b/src/libgfortran/generated/maxloc1_16_i4.c (.../branches/gcc-4_8-branch)
11766
retarray->offset = 0;
11767
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11769
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11770
- * extent[rank-1];
11771
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11773
- retarray->base_addr = xmalloc (alloc_size);
11774
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11775
if (alloc_size == 0)
11777
/* Make sure we have a zero-sized array. */
11778
@@ -294,8 +293,7 @@
11782
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11783
- * extent[rank-1];
11784
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11786
retarray->offset = 0;
11787
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11788
@@ -307,7 +305,7 @@
11792
- retarray->base_addr = xmalloc (alloc_size);
11793
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11797
@@ -485,8 +483,7 @@
11798
retarray->offset = 0;
11799
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11801
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11802
- * extent[rank-1];
11803
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11805
if (alloc_size == 0)
11807
@@ -495,7 +492,7 @@
11811
- retarray->base_addr = xmalloc (alloc_size);
11812
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
11816
Index: libgfortran/generated/spread_i1.c
11817
===================================================================
11818
--- a/src/libgfortran/generated/spread_i1.c (.../tags/gcc_4_8_3_release)
11819
+++ b/src/libgfortran/generated/spread_i1.c (.../branches/gcc-4_8-branch)
11820
@@ -101,8 +101,8 @@
11824
- /* xmalloc allocates a single byte for zero size. */
11825
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
11826
+ /* xmallocarray allocates a single byte for zero size. */
11827
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
11831
@@ -244,7 +244,7 @@
11833
if (ret->base_addr == NULL)
11835
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
11836
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
11838
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
11840
Index: libgfortran/generated/maxloc0_16_i8.c
11841
===================================================================
11842
--- a/src/libgfortran/generated/maxloc0_16_i8.c (.../tags/gcc_4_8_3_release)
11843
+++ b/src/libgfortran/generated/maxloc0_16_i8.c (.../branches/gcc-4_8-branch)
11845
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11846
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11847
retarray->offset = 0;
11848
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11849
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11853
@@ -199,7 +199,7 @@
11854
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
11855
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11856
retarray->offset = 0;
11857
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11858
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11862
@@ -367,7 +367,7 @@
11863
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
11864
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
11865
retarray->offset = 0;
11866
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
11867
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
11869
else if (unlikely (compile_options.bounds_check))
11871
Index: libgfortran/generated/maxval_r16.c
11872
===================================================================
11873
--- a/src/libgfortran/generated/maxval_r16.c (.../tags/gcc_4_8_3_release)
11874
+++ b/src/libgfortran/generated/maxval_r16.c (.../branches/gcc-4_8-branch)
11876
retarray->offset = 0;
11877
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11879
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11880
- * extent[rank-1];
11881
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11883
- retarray->base_addr = xmalloc (alloc_size);
11884
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11885
if (alloc_size == 0)
11887
/* Make sure we have a zero-sized array. */
11888
@@ -286,8 +285,7 @@
11892
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11893
- * extent[rank-1];
11894
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11896
retarray->offset = 0;
11897
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11898
@@ -299,7 +297,7 @@
11902
- retarray->base_addr = xmalloc (alloc_size);
11903
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11907
@@ -472,8 +470,7 @@
11908
retarray->offset = 0;
11909
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11911
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11912
- * extent[rank-1];
11913
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11915
if (alloc_size == 0)
11917
@@ -482,7 +479,7 @@
11921
- retarray->base_addr = xmalloc (alloc_size);
11922
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
11926
Index: libgfortran/generated/product_c10.c
11927
===================================================================
11928
--- a/src/libgfortran/generated/product_c10.c (.../tags/gcc_4_8_3_release)
11929
+++ b/src/libgfortran/generated/product_c10.c (.../branches/gcc-4_8-branch)
11931
retarray->offset = 0;
11932
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11934
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11935
- * extent[rank-1];
11936
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11938
- retarray->base_addr = xmalloc (alloc_size);
11939
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
11940
if (alloc_size == 0)
11942
/* Make sure we have a zero-sized array. */
11943
@@ -272,8 +271,7 @@
11947
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11948
- * extent[rank-1];
11949
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11951
retarray->offset = 0;
11952
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11953
@@ -285,7 +283,7 @@
11957
- retarray->base_addr = xmalloc (alloc_size);
11958
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
11962
@@ -430,8 +428,7 @@
11963
retarray->offset = 0;
11964
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11966
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11967
- * extent[rank-1];
11968
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11970
if (alloc_size == 0)
11972
@@ -440,7 +437,7 @@
11976
- retarray->base_addr = xmalloc (alloc_size);
11977
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
11981
Index: libgfortran/generated/minloc1_8_i4.c
11982
===================================================================
11983
--- a/src/libgfortran/generated/minloc1_8_i4.c (.../tags/gcc_4_8_3_release)
11984
+++ b/src/libgfortran/generated/minloc1_8_i4.c (.../branches/gcc-4_8-branch)
11986
retarray->offset = 0;
11987
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
11989
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
11990
- * extent[rank-1];
11991
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
11993
- retarray->base_addr = xmalloc (alloc_size);
11994
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
11995
if (alloc_size == 0)
11997
/* Make sure we have a zero-sized array. */
11998
@@ -294,8 +293,7 @@
12002
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12003
- * extent[rank-1];
12004
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12006
retarray->offset = 0;
12007
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12008
@@ -307,7 +305,7 @@
12012
- retarray->base_addr = xmalloc (alloc_size);
12013
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12017
@@ -485,8 +483,7 @@
12018
retarray->offset = 0;
12019
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12021
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12022
- * extent[rank-1];
12023
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12025
if (alloc_size == 0)
12027
@@ -495,7 +492,7 @@
12031
- retarray->base_addr = xmalloc (alloc_size);
12032
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12036
Index: libgfortran/generated/minloc0_16_i16.c
12037
===================================================================
12038
--- a/src/libgfortran/generated/minloc0_16_i16.c (.../tags/gcc_4_8_3_release)
12039
+++ b/src/libgfortran/generated/minloc0_16_i16.c (.../branches/gcc-4_8-branch)
12041
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12042
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12043
retarray->offset = 0;
12044
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12045
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12049
@@ -199,7 +199,7 @@
12050
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12051
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12052
retarray->offset = 0;
12053
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12054
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12058
@@ -367,7 +367,7 @@
12059
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12060
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12061
retarray->offset = 0;
12062
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12063
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12065
else if (unlikely (compile_options.bounds_check))
12067
Index: libgfortran/generated/matmul_r16.c
12068
===================================================================
12069
--- a/src/libgfortran/generated/matmul_r16.c (.../tags/gcc_4_8_3_release)
12070
+++ b/src/libgfortran/generated/matmul_r16.c (.../branches/gcc-4_8-branch)
12071
@@ -124,7 +124,7 @@
12074
retarray->base_addr
12075
- = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) retarray));
12076
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_16));
12077
retarray->offset = 0;
12079
else if (unlikely (compile_options.bounds_check))
12080
Index: libgfortran/generated/minloc0_4_r4.c
12081
===================================================================
12082
--- a/src/libgfortran/generated/minloc0_4_r4.c (.../tags/gcc_4_8_3_release)
12083
+++ b/src/libgfortran/generated/minloc0_4_r4.c (.../branches/gcc-4_8-branch)
12085
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12086
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12087
retarray->offset = 0;
12088
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12089
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12093
@@ -199,7 +199,7 @@
12094
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12095
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12096
retarray->offset = 0;
12097
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12098
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12102
@@ -367,7 +367,7 @@
12103
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12104
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12105
retarray->offset = 0;
12106
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12107
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12109
else if (unlikely (compile_options.bounds_check))
12111
Index: libgfortran/generated/iany_i2.c
12112
===================================================================
12113
--- a/src/libgfortran/generated/iany_i2.c (.../tags/gcc_4_8_3_release)
12114
+++ b/src/libgfortran/generated/iany_i2.c (.../branches/gcc-4_8-branch)
12116
retarray->offset = 0;
12117
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12119
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12120
- * extent[rank-1];
12121
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12123
- retarray->base_addr = xmalloc (alloc_size);
12124
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12125
if (alloc_size == 0)
12127
/* Make sure we have a zero-sized array. */
12128
@@ -272,8 +271,7 @@
12132
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12133
- * extent[rank-1];
12134
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12136
retarray->offset = 0;
12137
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12138
@@ -285,7 +283,7 @@
12142
- retarray->base_addr = xmalloc (alloc_size);
12143
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12147
@@ -430,8 +428,7 @@
12148
retarray->offset = 0;
12149
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12151
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12152
- * extent[rank-1];
12153
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12155
if (alloc_size == 0)
12157
@@ -440,7 +437,7 @@
12161
- retarray->base_addr = xmalloc (alloc_size);
12162
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12166
Index: libgfortran/generated/sum_r4.c
12167
===================================================================
12168
--- a/src/libgfortran/generated/sum_r4.c (.../tags/gcc_4_8_3_release)
12169
+++ b/src/libgfortran/generated/sum_r4.c (.../branches/gcc-4_8-branch)
12171
retarray->offset = 0;
12172
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12174
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12175
- * extent[rank-1];
12176
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12178
- retarray->base_addr = xmalloc (alloc_size);
12179
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12180
if (alloc_size == 0)
12182
/* Make sure we have a zero-sized array. */
12183
@@ -272,8 +271,7 @@
12187
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12188
- * extent[rank-1];
12189
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12191
retarray->offset = 0;
12192
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12193
@@ -285,7 +283,7 @@
12197
- retarray->base_addr = xmalloc (alloc_size);
12198
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12202
@@ -430,8 +428,7 @@
12203
retarray->offset = 0;
12204
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12206
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12207
- * extent[rank-1];
12208
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12210
if (alloc_size == 0)
12212
@@ -440,7 +437,7 @@
12216
- retarray->base_addr = xmalloc (alloc_size);
12217
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
12221
Index: libgfortran/generated/unpack_c8.c
12222
===================================================================
12223
--- a/src/libgfortran/generated/unpack_c8.c (.../tags/gcc_4_8_3_release)
12224
+++ b/src/libgfortran/generated/unpack_c8.c (.../branches/gcc-4_8-branch)
12229
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
12230
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
12234
@@ -244,7 +244,7 @@
12238
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_8));
12239
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_8));
12243
Index: libgfortran/generated/in_pack_c16.c
12244
===================================================================
12245
--- a/src/libgfortran/generated/in_pack_c16.c (.../tags/gcc_4_8_3_release)
12246
+++ b/src/libgfortran/generated/in_pack_c16.c (.../branches/gcc-4_8-branch)
12248
return source->base_addr;
12250
/* Allocate storage for the destination. */
12251
- destptr = (GFC_COMPLEX_16 *)xmalloc (ssize * sizeof (GFC_COMPLEX_16));
12252
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_16));
12254
src = source->base_addr;
12255
stride0 = stride[0];
12256
Index: libgfortran/generated/minloc0_4_i2.c
12257
===================================================================
12258
--- a/src/libgfortran/generated/minloc0_4_i2.c (.../tags/gcc_4_8_3_release)
12259
+++ b/src/libgfortran/generated/minloc0_4_i2.c (.../branches/gcc-4_8-branch)
12261
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12262
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12263
retarray->offset = 0;
12264
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12265
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12269
@@ -199,7 +199,7 @@
12270
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12271
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12272
retarray->offset = 0;
12273
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12274
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12278
@@ -367,7 +367,7 @@
12279
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12280
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12281
retarray->offset = 0;
12282
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12283
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12285
else if (unlikely (compile_options.bounds_check))
12287
Index: libgfortran/generated/spread_c10.c
12288
===================================================================
12289
--- a/src/libgfortran/generated/spread_c10.c (.../tags/gcc_4_8_3_release)
12290
+++ b/src/libgfortran/generated/spread_c10.c (.../branches/gcc-4_8-branch)
12291
@@ -101,8 +101,8 @@
12295
- /* xmalloc allocates a single byte for zero size. */
12296
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_10));
12297
+ /* xmallocarray allocates a single byte for zero size. */
12298
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_10));
12302
@@ -244,7 +244,7 @@
12304
if (ret->base_addr == NULL)
12306
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_10));
12307
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_10));
12309
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12311
Index: libgfortran/generated/maxloc0_8_i1.c
12312
===================================================================
12313
--- a/src/libgfortran/generated/maxloc0_8_i1.c (.../tags/gcc_4_8_3_release)
12314
+++ b/src/libgfortran/generated/maxloc0_8_i1.c (.../branches/gcc-4_8-branch)
12316
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12317
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12318
retarray->offset = 0;
12319
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12320
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12324
@@ -199,7 +199,7 @@
12325
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12326
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12327
retarray->offset = 0;
12328
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12329
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12333
@@ -367,7 +367,7 @@
12334
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12335
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12336
retarray->offset = 0;
12337
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12338
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12340
else if (unlikely (compile_options.bounds_check))
12342
Index: libgfortran/generated/spread_r4.c
12343
===================================================================
12344
--- a/src/libgfortran/generated/spread_r4.c (.../tags/gcc_4_8_3_release)
12345
+++ b/src/libgfortran/generated/spread_r4.c (.../branches/gcc-4_8-branch)
12346
@@ -101,8 +101,8 @@
12350
- /* xmalloc allocates a single byte for zero size. */
12351
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4));
12352
+ /* xmallocarray allocates a single byte for zero size. */
12353
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4));
12357
@@ -244,7 +244,7 @@
12359
if (ret->base_addr == NULL)
12361
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4));
12362
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4));
12364
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12366
Index: libgfortran/generated/minloc0_8_i8.c
12367
===================================================================
12368
--- a/src/libgfortran/generated/minloc0_8_i8.c (.../tags/gcc_4_8_3_release)
12369
+++ b/src/libgfortran/generated/minloc0_8_i8.c (.../branches/gcc-4_8-branch)
12371
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12372
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12373
retarray->offset = 0;
12374
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12375
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12379
@@ -199,7 +199,7 @@
12380
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12381
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12382
retarray->offset = 0;
12383
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12384
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12388
@@ -367,7 +367,7 @@
12389
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12390
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12391
retarray->offset = 0;
12392
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12393
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12395
else if (unlikely (compile_options.bounds_check))
12397
Index: libgfortran/generated/matmul_c8.c
12398
===================================================================
12399
--- a/src/libgfortran/generated/matmul_c8.c (.../tags/gcc_4_8_3_release)
12400
+++ b/src/libgfortran/generated/matmul_c8.c (.../branches/gcc-4_8-branch)
12401
@@ -124,7 +124,7 @@
12404
retarray->base_addr
12405
- = xmalloc (sizeof (GFC_COMPLEX_8) * size0 ((array_t *) retarray));
12406
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_8));
12407
retarray->offset = 0;
12409
else if (unlikely (compile_options.bounds_check))
12410
Index: libgfortran/generated/minloc1_16_r10.c
12411
===================================================================
12412
--- a/src/libgfortran/generated/minloc1_16_r10.c (.../tags/gcc_4_8_3_release)
12413
+++ b/src/libgfortran/generated/minloc1_16_r10.c (.../branches/gcc-4_8-branch)
12415
retarray->offset = 0;
12416
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12418
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12419
- * extent[rank-1];
12420
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12422
- retarray->base_addr = xmalloc (alloc_size);
12423
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12424
if (alloc_size == 0)
12426
/* Make sure we have a zero-sized array. */
12427
@@ -294,8 +293,7 @@
12431
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12432
- * extent[rank-1];
12433
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12435
retarray->offset = 0;
12436
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12437
@@ -307,7 +305,7 @@
12441
- retarray->base_addr = xmalloc (alloc_size);
12442
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12446
@@ -485,8 +483,7 @@
12447
retarray->offset = 0;
12448
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12450
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12451
- * extent[rank-1];
12452
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12454
if (alloc_size == 0)
12456
@@ -495,7 +492,7 @@
12460
- retarray->base_addr = xmalloc (alloc_size);
12461
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12465
Index: libgfortran/generated/sum_i2.c
12466
===================================================================
12467
--- a/src/libgfortran/generated/sum_i2.c (.../tags/gcc_4_8_3_release)
12468
+++ b/src/libgfortran/generated/sum_i2.c (.../branches/gcc-4_8-branch)
12470
retarray->offset = 0;
12471
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12473
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12474
- * extent[rank-1];
12475
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12477
- retarray->base_addr = xmalloc (alloc_size);
12478
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12479
if (alloc_size == 0)
12481
/* Make sure we have a zero-sized array. */
12482
@@ -272,8 +271,7 @@
12486
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12487
- * extent[rank-1];
12488
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12490
retarray->offset = 0;
12491
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12492
@@ -285,7 +283,7 @@
12496
- retarray->base_addr = xmalloc (alloc_size);
12497
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12501
@@ -430,8 +428,7 @@
12502
retarray->offset = 0;
12503
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12505
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12506
- * extent[rank-1];
12507
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12509
if (alloc_size == 0)
12511
@@ -440,7 +437,7 @@
12515
- retarray->base_addr = xmalloc (alloc_size);
12516
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
12520
Index: libgfortran/generated/iparity_i16.c
12521
===================================================================
12522
--- a/src/libgfortran/generated/iparity_i16.c (.../tags/gcc_4_8_3_release)
12523
+++ b/src/libgfortran/generated/iparity_i16.c (.../branches/gcc-4_8-branch)
12525
retarray->offset = 0;
12526
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12528
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12529
- * extent[rank-1];
12530
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12532
- retarray->base_addr = xmalloc (alloc_size);
12533
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12534
if (alloc_size == 0)
12536
/* Make sure we have a zero-sized array. */
12537
@@ -272,8 +271,7 @@
12541
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12542
- * extent[rank-1];
12543
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12545
retarray->offset = 0;
12546
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12547
@@ -285,7 +283,7 @@
12551
- retarray->base_addr = xmalloc (alloc_size);
12552
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12556
@@ -430,8 +428,7 @@
12557
retarray->offset = 0;
12558
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12560
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12561
- * extent[rank-1];
12562
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12564
if (alloc_size == 0)
12566
@@ -440,7 +437,7 @@
12570
- retarray->base_addr = xmalloc (alloc_size);
12571
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
12575
Index: libgfortran/generated/minloc0_16_i1.c
12576
===================================================================
12577
--- a/src/libgfortran/generated/minloc0_16_i1.c (.../tags/gcc_4_8_3_release)
12578
+++ b/src/libgfortran/generated/minloc0_16_i1.c (.../branches/gcc-4_8-branch)
12580
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12581
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12582
retarray->offset = 0;
12583
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12584
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12588
@@ -199,7 +199,7 @@
12589
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12590
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12591
retarray->offset = 0;
12592
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12593
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12597
@@ -367,7 +367,7 @@
12598
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12599
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12600
retarray->offset = 0;
12601
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12602
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12604
else if (unlikely (compile_options.bounds_check))
12606
Index: libgfortran/generated/reshape_c16.c
12607
===================================================================
12608
--- a/src/libgfortran/generated/reshape_c16.c (.../tags/gcc_4_8_3_release)
12609
+++ b/src/libgfortran/generated/reshape_c16.c (.../branches/gcc-4_8-branch)
12610
@@ -111,11 +111,11 @@
12613
if (unlikely (rs < 1))
12617
- alloc_size = rs * sizeof (GFC_COMPLEX_16);
12620
- ret->base_addr = xmalloc (alloc_size);
12621
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
12622
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
12625
Index: libgfortran/generated/pack_c4.c
12626
===================================================================
12627
--- a/src/libgfortran/generated/pack_c4.c (.../tags/gcc_4_8_3_release)
12628
+++ b/src/libgfortran/generated/pack_c4.c (.../branches/gcc-4_8-branch)
12629
@@ -167,8 +167,8 @@
12633
- /* xmalloc allocates a single byte for zero size. */
12634
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * total);
12635
+ /* xmallocarray allocates a single byte for zero size. */
12636
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_4));
12640
Index: libgfortran/generated/parity_l4.c
12641
===================================================================
12642
--- a/src/libgfortran/generated/parity_l4.c (.../tags/gcc_4_8_3_release)
12643
+++ b/src/libgfortran/generated/parity_l4.c (.../branches/gcc-4_8-branch)
12645
retarray->offset = 0;
12646
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12648
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12649
- * extent[rank-1];
12650
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12652
- retarray->base_addr = xmalloc (alloc_size);
12653
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
12654
if (alloc_size == 0)
12656
/* Make sure we have a zero-sized array. */
12657
Index: libgfortran/generated/spread_i2.c
12658
===================================================================
12659
--- a/src/libgfortran/generated/spread_i2.c (.../tags/gcc_4_8_3_release)
12660
+++ b/src/libgfortran/generated/spread_i2.c (.../branches/gcc-4_8-branch)
12661
@@ -101,8 +101,8 @@
12665
- /* xmalloc allocates a single byte for zero size. */
12666
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_2));
12667
+ /* xmallocarray allocates a single byte for zero size. */
12668
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_2));
12672
@@ -244,7 +244,7 @@
12674
if (ret->base_addr == NULL)
12676
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_2));
12677
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_2));
12679
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
12681
Index: libgfortran/generated/any_l4.c
12682
===================================================================
12683
--- a/src/libgfortran/generated/any_l4.c (.../tags/gcc_4_8_3_release)
12684
+++ b/src/libgfortran/generated/any_l4.c (.../branches/gcc-4_8-branch)
12685
@@ -101,8 +101,7 @@
12686
retarray->offset = 0;
12687
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12689
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12690
- * extent[rank-1];
12691
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12693
if (alloc_size == 0)
12695
@@ -111,7 +110,7 @@
12699
- retarray->base_addr = xmalloc (alloc_size);
12700
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
12704
Index: libgfortran/generated/maxloc1_4_i8.c
12705
===================================================================
12706
--- a/src/libgfortran/generated/maxloc1_4_i8.c (.../tags/gcc_4_8_3_release)
12707
+++ b/src/libgfortran/generated/maxloc1_4_i8.c (.../branches/gcc-4_8-branch)
12709
retarray->offset = 0;
12710
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12712
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12713
- * extent[rank-1];
12714
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12716
- retarray->base_addr = xmalloc (alloc_size);
12717
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12718
if (alloc_size == 0)
12720
/* Make sure we have a zero-sized array. */
12721
@@ -294,8 +293,7 @@
12725
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12726
- * extent[rank-1];
12727
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12729
retarray->offset = 0;
12730
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12731
@@ -307,7 +305,7 @@
12735
- retarray->base_addr = xmalloc (alloc_size);
12736
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12740
@@ -485,8 +483,7 @@
12741
retarray->offset = 0;
12742
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12744
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12745
- * extent[rank-1];
12746
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12748
if (alloc_size == 0)
12750
@@ -495,7 +492,7 @@
12754
- retarray->base_addr = xmalloc (alloc_size);
12755
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12759
Index: libgfortran/generated/maxloc0_8_r4.c
12760
===================================================================
12761
--- a/src/libgfortran/generated/maxloc0_8_r4.c (.../tags/gcc_4_8_3_release)
12762
+++ b/src/libgfortran/generated/maxloc0_8_r4.c (.../branches/gcc-4_8-branch)
12764
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12765
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12766
retarray->offset = 0;
12767
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12768
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12772
@@ -199,7 +199,7 @@
12773
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12774
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12775
retarray->offset = 0;
12776
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12777
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12781
@@ -367,7 +367,7 @@
12782
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12783
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12784
retarray->offset = 0;
12785
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12786
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12788
else if (unlikely (compile_options.bounds_check))
12790
Index: libgfortran/generated/maxloc1_4_i16.c
12791
===================================================================
12792
--- a/src/libgfortran/generated/maxloc1_4_i16.c (.../tags/gcc_4_8_3_release)
12793
+++ b/src/libgfortran/generated/maxloc1_4_i16.c (.../branches/gcc-4_8-branch)
12795
retarray->offset = 0;
12796
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12798
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12799
- * extent[rank-1];
12800
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12802
- retarray->base_addr = xmalloc (alloc_size);
12803
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12804
if (alloc_size == 0)
12806
/* Make sure we have a zero-sized array. */
12807
@@ -294,8 +293,7 @@
12811
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12812
- * extent[rank-1];
12813
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12815
retarray->offset = 0;
12816
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12817
@@ -307,7 +305,7 @@
12821
- retarray->base_addr = xmalloc (alloc_size);
12822
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12826
@@ -485,8 +483,7 @@
12827
retarray->offset = 0;
12828
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12830
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12831
- * extent[rank-1];
12832
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12834
if (alloc_size == 0)
12836
@@ -495,7 +492,7 @@
12840
- retarray->base_addr = xmalloc (alloc_size);
12841
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
12845
Index: libgfortran/generated/minloc0_4_r10.c
12846
===================================================================
12847
--- a/src/libgfortran/generated/minloc0_4_r10.c (.../tags/gcc_4_8_3_release)
12848
+++ b/src/libgfortran/generated/minloc0_4_r10.c (.../branches/gcc-4_8-branch)
12850
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12851
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12852
retarray->offset = 0;
12853
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12854
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12858
@@ -199,7 +199,7 @@
12859
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12860
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12861
retarray->offset = 0;
12862
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12863
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12867
@@ -367,7 +367,7 @@
12868
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12869
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12870
retarray->offset = 0;
12871
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
12872
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
12874
else if (unlikely (compile_options.bounds_check))
12876
Index: libgfortran/generated/minloc0_8_i16.c
12877
===================================================================
12878
--- a/src/libgfortran/generated/minloc0_8_i16.c (.../tags/gcc_4_8_3_release)
12879
+++ b/src/libgfortran/generated/minloc0_8_i16.c (.../branches/gcc-4_8-branch)
12881
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12882
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12883
retarray->offset = 0;
12884
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12885
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12889
@@ -199,7 +199,7 @@
12890
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12891
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12892
retarray->offset = 0;
12893
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12894
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12898
@@ -367,7 +367,7 @@
12899
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12900
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12901
retarray->offset = 0;
12902
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
12903
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
12905
else if (unlikely (compile_options.bounds_check))
12907
Index: libgfortran/generated/minloc1_8_r10.c
12908
===================================================================
12909
--- a/src/libgfortran/generated/minloc1_8_r10.c (.../tags/gcc_4_8_3_release)
12910
+++ b/src/libgfortran/generated/minloc1_8_r10.c (.../branches/gcc-4_8-branch)
12912
retarray->offset = 0;
12913
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12915
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12916
- * extent[rank-1];
12917
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12919
- retarray->base_addr = xmalloc (alloc_size);
12920
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12921
if (alloc_size == 0)
12923
/* Make sure we have a zero-sized array. */
12924
@@ -294,8 +293,7 @@
12928
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12929
- * extent[rank-1];
12930
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12932
retarray->offset = 0;
12933
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12934
@@ -307,7 +305,7 @@
12938
- retarray->base_addr = xmalloc (alloc_size);
12939
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12943
@@ -485,8 +483,7 @@
12944
retarray->offset = 0;
12945
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
12947
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
12948
- * extent[rank-1];
12949
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
12951
if (alloc_size == 0)
12953
@@ -495,7 +492,7 @@
12957
- retarray->base_addr = xmalloc (alloc_size);
12958
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
12962
Index: libgfortran/generated/minloc0_16_r4.c
12963
===================================================================
12964
--- a/src/libgfortran/generated/minloc0_16_r4.c (.../tags/gcc_4_8_3_release)
12965
+++ b/src/libgfortran/generated/minloc0_16_r4.c (.../branches/gcc-4_8-branch)
12967
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12968
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12969
retarray->offset = 0;
12970
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12971
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12975
@@ -199,7 +199,7 @@
12976
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
12977
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12978
retarray->offset = 0;
12979
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12980
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12984
@@ -367,7 +367,7 @@
12985
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
12986
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
12987
retarray->offset = 0;
12988
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
12989
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
12991
else if (unlikely (compile_options.bounds_check))
12993
Index: libgfortran/generated/product_i4.c
12994
===================================================================
12995
--- a/src/libgfortran/generated/product_i4.c (.../tags/gcc_4_8_3_release)
12996
+++ b/src/libgfortran/generated/product_i4.c (.../branches/gcc-4_8-branch)
12998
retarray->offset = 0;
12999
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13001
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13002
- * extent[rank-1];
13003
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13005
- retarray->base_addr = xmalloc (alloc_size);
13006
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13007
if (alloc_size == 0)
13009
/* Make sure we have a zero-sized array. */
13010
@@ -272,8 +271,7 @@
13014
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13015
- * extent[rank-1];
13016
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13018
retarray->offset = 0;
13019
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13020
@@ -285,7 +283,7 @@
13024
- retarray->base_addr = xmalloc (alloc_size);
13025
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13029
@@ -430,8 +428,7 @@
13030
retarray->offset = 0;
13031
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13033
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13034
- * extent[rank-1];
13035
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13037
if (alloc_size == 0)
13039
@@ -440,7 +437,7 @@
13043
- retarray->base_addr = xmalloc (alloc_size);
13044
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13048
Index: libgfortran/generated/sum_c16.c
13049
===================================================================
13050
--- a/src/libgfortran/generated/sum_c16.c (.../tags/gcc_4_8_3_release)
13051
+++ b/src/libgfortran/generated/sum_c16.c (.../branches/gcc-4_8-branch)
13053
retarray->offset = 0;
13054
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13056
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13057
- * extent[rank-1];
13058
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13060
- retarray->base_addr = xmalloc (alloc_size);
13061
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
13062
if (alloc_size == 0)
13064
/* Make sure we have a zero-sized array. */
13065
@@ -272,8 +271,7 @@
13069
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13070
- * extent[rank-1];
13071
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13073
retarray->offset = 0;
13074
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13075
@@ -285,7 +283,7 @@
13079
- retarray->base_addr = xmalloc (alloc_size);
13080
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
13084
@@ -430,8 +428,7 @@
13085
retarray->offset = 0;
13086
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13088
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13089
- * extent[rank-1];
13090
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13092
if (alloc_size == 0)
13094
@@ -440,7 +437,7 @@
13098
- retarray->base_addr = xmalloc (alloc_size);
13099
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
13103
Index: libgfortran/generated/transpose_c10.c
13104
===================================================================
13105
--- a/src/libgfortran/generated/transpose_c10.c (.../tags/gcc_4_8_3_release)
13106
+++ b/src/libgfortran/generated/transpose_c10.c (.../branches/gcc-4_8-branch)
13108
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13109
GFC_DESCRIPTOR_EXTENT(source, 1));
13111
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) ret));
13112
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
13113
+ sizeof (GFC_COMPLEX_10));
13115
} else if (unlikely (compile_options.bounds_check))
13117
Index: libgfortran/generated/maxloc1_16_r8.c
13118
===================================================================
13119
--- a/src/libgfortran/generated/maxloc1_16_r8.c (.../tags/gcc_4_8_3_release)
13120
+++ b/src/libgfortran/generated/maxloc1_16_r8.c (.../branches/gcc-4_8-branch)
13122
retarray->offset = 0;
13123
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13125
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13126
- * extent[rank-1];
13127
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13129
- retarray->base_addr = xmalloc (alloc_size);
13130
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13131
if (alloc_size == 0)
13133
/* Make sure we have a zero-sized array. */
13134
@@ -294,8 +293,7 @@
13138
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13139
- * extent[rank-1];
13140
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13142
retarray->offset = 0;
13143
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13144
@@ -307,7 +305,7 @@
13148
- retarray->base_addr = xmalloc (alloc_size);
13149
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13153
@@ -485,8 +483,7 @@
13154
retarray->offset = 0;
13155
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13157
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13158
- * extent[rank-1];
13159
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13161
if (alloc_size == 0)
13163
@@ -495,7 +492,7 @@
13167
- retarray->base_addr = xmalloc (alloc_size);
13168
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13172
Index: libgfortran/generated/transpose_r4.c
13173
===================================================================
13174
--- a/src/libgfortran/generated/transpose_r4.c (.../tags/gcc_4_8_3_release)
13175
+++ b/src/libgfortran/generated/transpose_r4.c (.../branches/gcc-4_8-branch)
13177
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
13178
GFC_DESCRIPTOR_EXTENT(source, 1));
13180
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) ret));
13181
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
13182
+ sizeof (GFC_REAL_4));
13184
} else if (unlikely (compile_options.bounds_check))
13186
Index: libgfortran/generated/cshift1_4.c
13187
===================================================================
13188
--- a/src/libgfortran/generated/cshift1_4.c (.../tags/gcc_4_8_3_release)
13189
+++ b/src/libgfortran/generated/cshift1_4.c (.../branches/gcc-4_8-branch)
13194
- ret->base_addr = xmalloc (size * arraysize);
13195
+ ret->base_addr = xmallocarray (arraysize, size);
13197
ret->dtype = array->dtype;
13198
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
13199
Index: libgfortran/generated/maxloc0_8_i2.c
13200
===================================================================
13201
--- a/src/libgfortran/generated/maxloc0_8_i2.c (.../tags/gcc_4_8_3_release)
13202
+++ b/src/libgfortran/generated/maxloc0_8_i2.c (.../branches/gcc-4_8-branch)
13204
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13205
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13206
retarray->offset = 0;
13207
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13208
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13212
@@ -199,7 +199,7 @@
13213
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13214
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13215
retarray->offset = 0;
13216
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13217
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13221
@@ -367,7 +367,7 @@
13222
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13223
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13224
retarray->offset = 0;
13225
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
13226
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
13228
else if (unlikely (compile_options.bounds_check))
13230
Index: libgfortran/generated/count_8_l.c
13231
===================================================================
13232
--- a/src/libgfortran/generated/count_8_l.c (.../tags/gcc_4_8_3_release)
13233
+++ b/src/libgfortran/generated/count_8_l.c (.../branches/gcc-4_8-branch)
13234
@@ -101,8 +101,7 @@
13235
retarray->offset = 0;
13236
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13238
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13239
- * extent[rank-1];
13240
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13242
if (alloc_size == 0)
13244
@@ -111,7 +110,7 @@
13248
- retarray->base_addr = xmalloc (alloc_size);
13249
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13253
Index: libgfortran/generated/in_pack_i4.c
13254
===================================================================
13255
--- a/src/libgfortran/generated/in_pack_i4.c (.../tags/gcc_4_8_3_release)
13256
+++ b/src/libgfortran/generated/in_pack_i4.c (.../branches/gcc-4_8-branch)
13258
return source->base_addr;
13260
/* Allocate storage for the destination. */
13261
- destptr = (GFC_INTEGER_4 *)xmalloc (ssize * sizeof (GFC_INTEGER_4));
13262
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_4));
13264
src = source->base_addr;
13265
stride0 = stride[0];
13266
Index: libgfortran/generated/minloc0_16_i2.c
13267
===================================================================
13268
--- a/src/libgfortran/generated/minloc0_16_i2.c (.../tags/gcc_4_8_3_release)
13269
+++ b/src/libgfortran/generated/minloc0_16_i2.c (.../branches/gcc-4_8-branch)
13271
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13272
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13273
retarray->offset = 0;
13274
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13275
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13279
@@ -199,7 +199,7 @@
13280
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13281
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13282
retarray->offset = 0;
13283
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13284
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13288
@@ -367,7 +367,7 @@
13289
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13290
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13291
retarray->offset = 0;
13292
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13293
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13295
else if (unlikely (compile_options.bounds_check))
13297
Index: libgfortran/generated/minloc1_8_r8.c
13298
===================================================================
13299
--- a/src/libgfortran/generated/minloc1_8_r8.c (.../tags/gcc_4_8_3_release)
13300
+++ b/src/libgfortran/generated/minloc1_8_r8.c (.../branches/gcc-4_8-branch)
13302
retarray->offset = 0;
13303
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13305
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13306
- * extent[rank-1];
13307
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13309
- retarray->base_addr = xmalloc (alloc_size);
13310
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13311
if (alloc_size == 0)
13313
/* Make sure we have a zero-sized array. */
13314
@@ -294,8 +293,7 @@
13318
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13319
- * extent[rank-1];
13320
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13322
retarray->offset = 0;
13323
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13324
@@ -307,7 +305,7 @@
13328
- retarray->base_addr = xmalloc (alloc_size);
13329
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13333
@@ -485,8 +483,7 @@
13334
retarray->offset = 0;
13335
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13337
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13338
- * extent[rank-1];
13339
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13341
if (alloc_size == 0)
13343
@@ -495,7 +492,7 @@
13347
- retarray->base_addr = xmalloc (alloc_size);
13348
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
13352
Index: libgfortran/generated/matmul_c16.c
13353
===================================================================
13354
--- a/src/libgfortran/generated/matmul_c16.c (.../tags/gcc_4_8_3_release)
13355
+++ b/src/libgfortran/generated/matmul_c16.c (.../branches/gcc-4_8-branch)
13356
@@ -124,7 +124,7 @@
13359
retarray->base_addr
13360
- = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) retarray));
13361
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_16));
13362
retarray->offset = 0;
13364
else if (unlikely (compile_options.bounds_check))
13365
Index: libgfortran/generated/minval_i1.c
13366
===================================================================
13367
--- a/src/libgfortran/generated/minval_i1.c (.../tags/gcc_4_8_3_release)
13368
+++ b/src/libgfortran/generated/minval_i1.c (.../branches/gcc-4_8-branch)
13370
retarray->offset = 0;
13371
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13373
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13374
- * extent[rank-1];
13375
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13377
- retarray->base_addr = xmalloc (alloc_size);
13378
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13379
if (alloc_size == 0)
13381
/* Make sure we have a zero-sized array. */
13382
@@ -286,8 +285,7 @@
13386
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13387
- * extent[rank-1];
13388
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13390
retarray->offset = 0;
13391
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13392
@@ -299,7 +297,7 @@
13396
- retarray->base_addr = xmalloc (alloc_size);
13397
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13401
@@ -472,8 +470,7 @@
13402
retarray->offset = 0;
13403
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13405
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13406
- * extent[rank-1];
13407
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13409
if (alloc_size == 0)
13411
@@ -482,7 +479,7 @@
13415
- retarray->base_addr = xmalloc (alloc_size);
13416
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
13420
Index: libgfortran/generated/shape_i16.c
13421
===================================================================
13422
--- a/src/libgfortran/generated/shape_i16.c (.../tags/gcc_4_8_3_release)
13423
+++ b/src/libgfortran/generated/shape_i16.c (.../branches/gcc-4_8-branch)
13426
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
13428
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13429
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13432
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
13433
Index: libgfortran/generated/iany_i4.c
13434
===================================================================
13435
--- a/src/libgfortran/generated/iany_i4.c (.../tags/gcc_4_8_3_release)
13436
+++ b/src/libgfortran/generated/iany_i4.c (.../branches/gcc-4_8-branch)
13438
retarray->offset = 0;
13439
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13441
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13442
- * extent[rank-1];
13443
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13445
- retarray->base_addr = xmalloc (alloc_size);
13446
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13447
if (alloc_size == 0)
13449
/* Make sure we have a zero-sized array. */
13450
@@ -272,8 +271,7 @@
13454
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13455
- * extent[rank-1];
13456
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13458
retarray->offset = 0;
13459
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13460
@@ -285,7 +283,7 @@
13464
- retarray->base_addr = xmalloc (alloc_size);
13465
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13469
@@ -430,8 +428,7 @@
13470
retarray->offset = 0;
13471
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13473
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13474
- * extent[rank-1];
13475
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13477
if (alloc_size == 0)
13479
@@ -440,7 +437,7 @@
13483
- retarray->base_addr = xmalloc (alloc_size);
13484
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13488
Index: libgfortran/generated/minloc0_16_r16.c
13489
===================================================================
13490
--- a/src/libgfortran/generated/minloc0_16_r16.c (.../tags/gcc_4_8_3_release)
13491
+++ b/src/libgfortran/generated/minloc0_16_r16.c (.../branches/gcc-4_8-branch)
13493
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13494
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13495
retarray->offset = 0;
13496
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13497
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13501
@@ -199,7 +199,7 @@
13502
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13503
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13504
retarray->offset = 0;
13505
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13506
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13510
@@ -367,7 +367,7 @@
13511
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13512
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13513
retarray->offset = 0;
13514
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
13515
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
13517
else if (unlikely (compile_options.bounds_check))
13519
Index: libgfortran/generated/product_i16.c
13520
===================================================================
13521
--- a/src/libgfortran/generated/product_i16.c (.../tags/gcc_4_8_3_release)
13522
+++ b/src/libgfortran/generated/product_i16.c (.../branches/gcc-4_8-branch)
13524
retarray->offset = 0;
13525
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13527
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13528
- * extent[rank-1];
13529
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13531
- retarray->base_addr = xmalloc (alloc_size);
13532
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13533
if (alloc_size == 0)
13535
/* Make sure we have a zero-sized array. */
13536
@@ -272,8 +271,7 @@
13540
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13541
- * extent[rank-1];
13542
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13544
retarray->offset = 0;
13545
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13546
@@ -285,7 +283,7 @@
13550
- retarray->base_addr = xmalloc (alloc_size);
13551
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13555
@@ -430,8 +428,7 @@
13556
retarray->offset = 0;
13557
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13559
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13560
- * extent[rank-1];
13561
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13563
if (alloc_size == 0)
13565
@@ -440,7 +437,7 @@
13569
- retarray->base_addr = xmalloc (alloc_size);
13570
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
13574
Index: libgfortran/generated/unpack_i1.c
13575
===================================================================
13576
--- a/src/libgfortran/generated/unpack_i1.c (.../tags/gcc_4_8_3_release)
13577
+++ b/src/libgfortran/generated/unpack_i1.c (.../branches/gcc-4_8-branch)
13582
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
13583
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
13587
@@ -244,7 +244,7 @@
13591
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_1));
13592
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
13596
Index: libgfortran/generated/minloc0_4_i4.c
13597
===================================================================
13598
--- a/src/libgfortran/generated/minloc0_4_i4.c (.../tags/gcc_4_8_3_release)
13599
+++ b/src/libgfortran/generated/minloc0_4_i4.c (.../branches/gcc-4_8-branch)
13601
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13602
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13603
retarray->offset = 0;
13604
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13605
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13609
@@ -199,7 +199,7 @@
13610
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
13611
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13612
retarray->offset = 0;
13613
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13614
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13618
@@ -367,7 +367,7 @@
13619
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
13620
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
13621
retarray->offset = 0;
13622
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
13623
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
13625
else if (unlikely (compile_options.bounds_check))
13627
Index: libgfortran/generated/matmul_i1.c
13628
===================================================================
13629
--- a/src/libgfortran/generated/matmul_i1.c (.../tags/gcc_4_8_3_release)
13630
+++ b/src/libgfortran/generated/matmul_i1.c (.../branches/gcc-4_8-branch)
13631
@@ -124,7 +124,7 @@
13634
retarray->base_addr
13635
- = xmalloc (sizeof (GFC_INTEGER_1) * size0 ((array_t *) retarray));
13636
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_1));
13637
retarray->offset = 0;
13639
else if (unlikely (compile_options.bounds_check))
13640
Index: libgfortran/generated/minval_r4.c
13641
===================================================================
13642
--- a/src/libgfortran/generated/minval_r4.c (.../tags/gcc_4_8_3_release)
13643
+++ b/src/libgfortran/generated/minval_r4.c (.../branches/gcc-4_8-branch)
13645
retarray->offset = 0;
13646
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13648
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13649
- * extent[rank-1];
13650
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13652
- retarray->base_addr = xmalloc (alloc_size);
13653
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13654
if (alloc_size == 0)
13656
/* Make sure we have a zero-sized array. */
13657
@@ -286,8 +285,7 @@
13661
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13662
- * extent[rank-1];
13663
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13665
retarray->offset = 0;
13666
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13667
@@ -299,7 +297,7 @@
13671
- retarray->base_addr = xmalloc (alloc_size);
13672
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13676
@@ -472,8 +470,7 @@
13677
retarray->offset = 0;
13678
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13680
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13681
- * extent[rank-1];
13682
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13684
if (alloc_size == 0)
13686
@@ -482,7 +479,7 @@
13690
- retarray->base_addr = xmalloc (alloc_size);
13691
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
13695
Index: libgfortran/generated/spread_i16.c
13696
===================================================================
13697
--- a/src/libgfortran/generated/spread_i16.c (.../tags/gcc_4_8_3_release)
13698
+++ b/src/libgfortran/generated/spread_i16.c (.../branches/gcc-4_8-branch)
13699
@@ -101,8 +101,8 @@
13703
- /* xmalloc allocates a single byte for zero size. */
13704
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_16));
13705
+ /* xmallocarray allocates a single byte for zero size. */
13706
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_16));
13710
@@ -244,7 +244,7 @@
13712
if (ret->base_addr == NULL)
13714
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_16));
13715
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_16));
13717
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13719
Index: libgfortran/generated/sum_i4.c
13720
===================================================================
13721
--- a/src/libgfortran/generated/sum_i4.c (.../tags/gcc_4_8_3_release)
13722
+++ b/src/libgfortran/generated/sum_i4.c (.../branches/gcc-4_8-branch)
13724
retarray->offset = 0;
13725
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13727
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13728
- * extent[rank-1];
13729
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13731
- retarray->base_addr = xmalloc (alloc_size);
13732
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13733
if (alloc_size == 0)
13735
/* Make sure we have a zero-sized array. */
13736
@@ -272,8 +271,7 @@
13740
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13741
- * extent[rank-1];
13742
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13744
retarray->offset = 0;
13745
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13746
@@ -285,7 +283,7 @@
13750
- retarray->base_addr = xmalloc (alloc_size);
13751
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13755
@@ -430,8 +428,7 @@
13756
retarray->offset = 0;
13757
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13759
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13760
- * extent[rank-1];
13761
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13763
if (alloc_size == 0)
13765
@@ -440,7 +437,7 @@
13769
- retarray->base_addr = xmalloc (alloc_size);
13770
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13774
Index: libgfortran/generated/unpack_r10.c
13775
===================================================================
13776
--- a/src/libgfortran/generated/unpack_r10.c (.../tags/gcc_4_8_3_release)
13777
+++ b/src/libgfortran/generated/unpack_r10.c (.../branches/gcc-4_8-branch)
13782
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
13783
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
13787
@@ -244,7 +244,7 @@
13791
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_10));
13792
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_10));
13796
Index: libgfortran/generated/bessel_r16.c
13797
===================================================================
13798
--- a/src/libgfortran/generated/bessel_r16.c (.../tags/gcc_4_8_3_release)
13799
+++ b/src/libgfortran/generated/bessel_r16.c (.../branches/gcc-4_8-branch)
13802
size_t size = n2 < n1 ? 0 : n2-n1+1;
13803
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
13804
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
13805
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
13809
@@ -126,7 +126,7 @@
13811
size_t size = n2 < n1 ? 0 : n2-n1+1;
13812
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
13813
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size);
13814
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
13818
@@ -166,7 +166,7 @@
13820
x2rev = GFC_REAL_16_LITERAL(2.)/x;
13822
- for (i = 2; i <= n1+n2; i++)
13823
+ for (i = 2; i <= n2 - n1; i++)
13825
#if defined(GFC_REAL_16_INFINITY)
13826
if (unlikely (last2 == -GFC_REAL_16_INFINITY))
13827
Index: libgfortran/generated/norm2_r8.c
13828
===================================================================
13829
--- a/src/libgfortran/generated/norm2_r8.c (.../tags/gcc_4_8_3_release)
13830
+++ b/src/libgfortran/generated/norm2_r8.c (.../branches/gcc-4_8-branch)
13831
@@ -101,10 +101,9 @@
13832
retarray->offset = 0;
13833
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13835
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13836
- * extent[rank-1];
13837
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13839
- retarray->base_addr = xmalloc (alloc_size);
13840
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
13841
if (alloc_size == 0)
13843
/* Make sure we have a zero-sized array. */
13844
Index: libgfortran/generated/spread_i4.c
13845
===================================================================
13846
--- a/src/libgfortran/generated/spread_i4.c (.../tags/gcc_4_8_3_release)
13847
+++ b/src/libgfortran/generated/spread_i4.c (.../branches/gcc-4_8-branch)
13848
@@ -101,8 +101,8 @@
13852
- /* xmalloc allocates a single byte for zero size. */
13853
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_4));
13854
+ /* xmallocarray allocates a single byte for zero size. */
13855
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_4));
13859
@@ -244,7 +244,7 @@
13861
if (ret->base_addr == NULL)
13863
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_4));
13864
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_4));
13866
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
13868
Index: libgfortran/generated/eoshift3_8.c
13869
===================================================================
13870
--- a/src/libgfortran/generated/eoshift3_8.c (.../tags/gcc_4_8_3_release)
13871
+++ b/src/libgfortran/generated/eoshift3_8.c (.../branches/gcc-4_8-branch)
13876
- ret->base_addr = xmalloc (size * arraysize);
13877
+ ret->base_addr = xmallocarray (arraysize, size);
13879
ret->dtype = array->dtype;
13880
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
13881
@@ -107,8 +107,8 @@
13882
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
13885
- /* xmalloc allocates a single byte for zero size. */
13886
- ret->base_addr = xmalloc (size * arraysize);
13887
+ /* xmallocarray allocates a single byte for zero size. */
13888
+ ret->base_addr = xmallocarray (arraysize, size);
13891
else if (unlikely (compile_options.bounds_check))
13892
Index: libgfortran/generated/minloc1_4_i1.c
13893
===================================================================
13894
--- a/src/libgfortran/generated/minloc1_4_i1.c (.../tags/gcc_4_8_3_release)
13895
+++ b/src/libgfortran/generated/minloc1_4_i1.c (.../branches/gcc-4_8-branch)
13897
retarray->offset = 0;
13898
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13900
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13901
- * extent[rank-1];
13902
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13904
- retarray->base_addr = xmalloc (alloc_size);
13905
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13906
if (alloc_size == 0)
13908
/* Make sure we have a zero-sized array. */
13909
@@ -294,8 +293,7 @@
13913
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13914
- * extent[rank-1];
13915
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13917
retarray->offset = 0;
13918
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13919
@@ -307,7 +305,7 @@
13923
- retarray->base_addr = xmalloc (alloc_size);
13924
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13928
@@ -485,8 +483,7 @@
13929
retarray->offset = 0;
13930
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13932
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13933
- * extent[rank-1];
13934
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13936
if (alloc_size == 0)
13938
@@ -495,7 +492,7 @@
13942
- retarray->base_addr = xmalloc (alloc_size);
13943
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
13947
Index: libgfortran/generated/minval_i2.c
13948
===================================================================
13949
--- a/src/libgfortran/generated/minval_i2.c (.../tags/gcc_4_8_3_release)
13950
+++ b/src/libgfortran/generated/minval_i2.c (.../branches/gcc-4_8-branch)
13952
retarray->offset = 0;
13953
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13955
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13956
- * extent[rank-1];
13957
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13959
- retarray->base_addr = xmalloc (alloc_size);
13960
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
13961
if (alloc_size == 0)
13963
/* Make sure we have a zero-sized array. */
13964
@@ -286,8 +285,7 @@
13968
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13969
- * extent[rank-1];
13970
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13972
retarray->offset = 0;
13973
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13974
@@ -299,7 +297,7 @@
13978
- retarray->base_addr = xmalloc (alloc_size);
13979
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
13983
@@ -472,8 +470,7 @@
13984
retarray->offset = 0;
13985
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
13987
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
13988
- * extent[rank-1];
13989
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
13991
if (alloc_size == 0)
13993
@@ -482,7 +479,7 @@
13997
- retarray->base_addr = xmalloc (alloc_size);
13998
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
14002
Index: libgfortran/generated/bessel_r8.c
14003
===================================================================
14004
--- a/src/libgfortran/generated/bessel_r8.c (.../tags/gcc_4_8_3_release)
14005
+++ b/src/libgfortran/generated/bessel_r8.c (.../branches/gcc-4_8-branch)
14008
size_t size = n2 < n1 ? 0 : n2-n1+1;
14009
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
14010
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
14011
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
14015
@@ -122,7 +122,7 @@
14017
size_t size = n2 < n1 ? 0 : n2-n1+1;
14018
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
14019
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size);
14020
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
14024
@@ -162,7 +162,7 @@
14026
x2rev = GFC_REAL_8_LITERAL(2.)/x;
14028
- for (i = 2; i <= n1+n2; i++)
14029
+ for (i = 2; i <= n2 - n1; i++)
14031
#if defined(GFC_REAL_8_INFINITY)
14032
if (unlikely (last2 == -GFC_REAL_8_INFINITY))
14033
Index: libgfortran/generated/unpack_r4.c
14034
===================================================================
14035
--- a/src/libgfortran/generated/unpack_r4.c (.../tags/gcc_4_8_3_release)
14036
+++ b/src/libgfortran/generated/unpack_r4.c (.../branches/gcc-4_8-branch)
14041
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
14042
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
14046
@@ -244,7 +244,7 @@
14050
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_4));
14051
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_4));
14055
Index: libgfortran/generated/product_r8.c
14056
===================================================================
14057
--- a/src/libgfortran/generated/product_r8.c (.../tags/gcc_4_8_3_release)
14058
+++ b/src/libgfortran/generated/product_r8.c (.../branches/gcc-4_8-branch)
14060
retarray->offset = 0;
14061
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14063
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14064
- * extent[rank-1];
14065
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14067
- retarray->base_addr = xmalloc (alloc_size);
14068
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14069
if (alloc_size == 0)
14071
/* Make sure we have a zero-sized array. */
14072
@@ -272,8 +271,7 @@
14076
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14077
- * extent[rank-1];
14078
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14080
retarray->offset = 0;
14081
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14082
@@ -285,7 +283,7 @@
14086
- retarray->base_addr = xmalloc (alloc_size);
14087
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14091
@@ -430,8 +428,7 @@
14092
retarray->offset = 0;
14093
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14095
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14096
- * extent[rank-1];
14097
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14099
if (alloc_size == 0)
14101
@@ -440,7 +437,7 @@
14105
- retarray->base_addr = xmalloc (alloc_size);
14106
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14110
Index: libgfortran/generated/matmul_r4.c
14111
===================================================================
14112
--- a/src/libgfortran/generated/matmul_r4.c (.../tags/gcc_4_8_3_release)
14113
+++ b/src/libgfortran/generated/matmul_r4.c (.../branches/gcc-4_8-branch)
14114
@@ -124,7 +124,7 @@
14117
retarray->base_addr
14118
- = xmalloc (sizeof (GFC_REAL_4) * size0 ((array_t *) retarray));
14119
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_4));
14120
retarray->offset = 0;
14122
else if (unlikely (compile_options.bounds_check))
14123
Index: libgfortran/generated/unpack_i2.c
14124
===================================================================
14125
--- a/src/libgfortran/generated/unpack_i2.c (.../tags/gcc_4_8_3_release)
14126
+++ b/src/libgfortran/generated/unpack_i2.c (.../branches/gcc-4_8-branch)
14131
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
14132
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
14136
@@ -244,7 +244,7 @@
14140
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_2));
14141
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_2));
14145
Index: libgfortran/generated/in_pack_r8.c
14146
===================================================================
14147
--- a/src/libgfortran/generated/in_pack_r8.c (.../tags/gcc_4_8_3_release)
14148
+++ b/src/libgfortran/generated/in_pack_r8.c (.../branches/gcc-4_8-branch)
14150
return source->base_addr;
14152
/* Allocate storage for the destination. */
14153
- destptr = (GFC_REAL_8 *)xmalloc (ssize * sizeof (GFC_REAL_8));
14154
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_8));
14156
src = source->base_addr;
14157
stride0 = stride[0];
14158
Index: libgfortran/generated/maxloc1_4_r16.c
14159
===================================================================
14160
--- a/src/libgfortran/generated/maxloc1_4_r16.c (.../tags/gcc_4_8_3_release)
14161
+++ b/src/libgfortran/generated/maxloc1_4_r16.c (.../branches/gcc-4_8-branch)
14163
retarray->offset = 0;
14164
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14166
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14167
- * extent[rank-1];
14168
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14170
- retarray->base_addr = xmalloc (alloc_size);
14171
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14172
if (alloc_size == 0)
14174
/* Make sure we have a zero-sized array. */
14175
@@ -294,8 +293,7 @@
14179
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14180
- * extent[rank-1];
14181
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14183
retarray->offset = 0;
14184
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14185
@@ -307,7 +305,7 @@
14189
- retarray->base_addr = xmalloc (alloc_size);
14190
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14194
@@ -485,8 +483,7 @@
14195
retarray->offset = 0;
14196
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14198
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14199
- * extent[rank-1];
14200
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14202
if (alloc_size == 0)
14204
@@ -495,7 +492,7 @@
14208
- retarray->base_addr = xmalloc (alloc_size);
14209
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14213
Index: libgfortran/generated/minloc0_8_r16.c
14214
===================================================================
14215
--- a/src/libgfortran/generated/minloc0_8_r16.c (.../tags/gcc_4_8_3_release)
14216
+++ b/src/libgfortran/generated/minloc0_8_r16.c (.../branches/gcc-4_8-branch)
14218
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14219
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14220
retarray->offset = 0;
14221
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14222
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14226
@@ -199,7 +199,7 @@
14227
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14228
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14229
retarray->offset = 0;
14230
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14231
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14235
@@ -367,7 +367,7 @@
14236
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14237
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14238
retarray->offset = 0;
14239
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14240
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14242
else if (unlikely (compile_options.bounds_check))
14244
Index: libgfortran/generated/reshape_c8.c
14245
===================================================================
14246
--- a/src/libgfortran/generated/reshape_c8.c (.../tags/gcc_4_8_3_release)
14247
+++ b/src/libgfortran/generated/reshape_c8.c (.../branches/gcc-4_8-branch)
14248
@@ -111,11 +111,11 @@
14251
if (unlikely (rs < 1))
14255
- alloc_size = rs * sizeof (GFC_COMPLEX_8);
14258
- ret->base_addr = xmalloc (alloc_size);
14259
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
14260
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
14263
Index: libgfortran/generated/iparity_i8.c
14264
===================================================================
14265
--- a/src/libgfortran/generated/iparity_i8.c (.../tags/gcc_4_8_3_release)
14266
+++ b/src/libgfortran/generated/iparity_i8.c (.../branches/gcc-4_8-branch)
14268
retarray->offset = 0;
14269
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14271
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14272
- * extent[rank-1];
14273
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14275
- retarray->base_addr = xmalloc (alloc_size);
14276
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14277
if (alloc_size == 0)
14279
/* Make sure we have a zero-sized array. */
14280
@@ -272,8 +271,7 @@
14284
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14285
- * extent[rank-1];
14286
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14288
retarray->offset = 0;
14289
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14290
@@ -285,7 +283,7 @@
14294
- retarray->base_addr = xmalloc (alloc_size);
14295
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14299
@@ -430,8 +428,7 @@
14300
retarray->offset = 0;
14301
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14303
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14304
- * extent[rank-1];
14305
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14307
if (alloc_size == 0)
14309
@@ -440,7 +437,7 @@
14313
- retarray->base_addr = xmalloc (alloc_size);
14314
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14318
Index: libgfortran/generated/count_1_l.c
14319
===================================================================
14320
--- a/src/libgfortran/generated/count_1_l.c (.../tags/gcc_4_8_3_release)
14321
+++ b/src/libgfortran/generated/count_1_l.c (.../branches/gcc-4_8-branch)
14322
@@ -101,8 +101,7 @@
14323
retarray->offset = 0;
14324
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14326
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14327
- * extent[rank-1];
14328
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14330
if (alloc_size == 0)
14332
@@ -111,7 +110,7 @@
14336
- retarray->base_addr = xmalloc (alloc_size);
14337
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
14341
Index: libgfortran/generated/maxloc0_8_i4.c
14342
===================================================================
14343
--- a/src/libgfortran/generated/maxloc0_8_i4.c (.../tags/gcc_4_8_3_release)
14344
+++ b/src/libgfortran/generated/maxloc0_8_i4.c (.../branches/gcc-4_8-branch)
14346
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14347
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14348
retarray->offset = 0;
14349
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14350
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14354
@@ -199,7 +199,7 @@
14355
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14356
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14357
retarray->offset = 0;
14358
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14359
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14363
@@ -367,7 +367,7 @@
14364
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14365
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14366
retarray->offset = 0;
14367
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
14368
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
14370
else if (unlikely (compile_options.bounds_check))
14372
Index: libgfortran/generated/matmul_i2.c
14373
===================================================================
14374
--- a/src/libgfortran/generated/matmul_i2.c (.../tags/gcc_4_8_3_release)
14375
+++ b/src/libgfortran/generated/matmul_i2.c (.../branches/gcc-4_8-branch)
14376
@@ -124,7 +124,7 @@
14379
retarray->base_addr
14380
- = xmalloc (sizeof (GFC_INTEGER_2) * size0 ((array_t *) retarray));
14381
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_2));
14382
retarray->offset = 0;
14384
else if (unlikely (compile_options.bounds_check))
14385
Index: libgfortran/generated/minloc1_4_r4.c
14386
===================================================================
14387
--- a/src/libgfortran/generated/minloc1_4_r4.c (.../tags/gcc_4_8_3_release)
14388
+++ b/src/libgfortran/generated/minloc1_4_r4.c (.../branches/gcc-4_8-branch)
14390
retarray->offset = 0;
14391
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14393
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14394
- * extent[rank-1];
14395
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14397
- retarray->base_addr = xmalloc (alloc_size);
14398
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14399
if (alloc_size == 0)
14401
/* Make sure we have a zero-sized array. */
14402
@@ -294,8 +293,7 @@
14406
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14407
- * extent[rank-1];
14408
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14410
retarray->offset = 0;
14411
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14412
@@ -307,7 +305,7 @@
14416
- retarray->base_addr = xmalloc (alloc_size);
14417
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14421
@@ -485,8 +483,7 @@
14422
retarray->offset = 0;
14423
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14425
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14426
- * extent[rank-1];
14427
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14429
if (alloc_size == 0)
14431
@@ -495,7 +492,7 @@
14435
- retarray->base_addr = xmalloc (alloc_size);
14436
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14440
Index: libgfortran/generated/transpose_i16.c
14441
===================================================================
14442
--- a/src/libgfortran/generated/transpose_i16.c (.../tags/gcc_4_8_3_release)
14443
+++ b/src/libgfortran/generated/transpose_i16.c (.../branches/gcc-4_8-branch)
14445
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
14446
GFC_DESCRIPTOR_EXTENT(source, 1));
14448
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) ret));
14449
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
14450
+ sizeof (GFC_INTEGER_16));
14452
} else if (unlikely (compile_options.bounds_check))
14454
Index: libgfortran/generated/minloc0_16_i4.c
14455
===================================================================
14456
--- a/src/libgfortran/generated/minloc0_16_i4.c (.../tags/gcc_4_8_3_release)
14457
+++ b/src/libgfortran/generated/minloc0_16_i4.c (.../branches/gcc-4_8-branch)
14459
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14460
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14461
retarray->offset = 0;
14462
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14463
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14467
@@ -199,7 +199,7 @@
14468
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14469
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14470
retarray->offset = 0;
14471
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14472
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14476
@@ -367,7 +367,7 @@
14477
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14478
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14479
retarray->offset = 0;
14480
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
14481
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
14483
else if (unlikely (compile_options.bounds_check))
14485
Index: libgfortran/generated/transpose_i4.c
14486
===================================================================
14487
--- a/src/libgfortran/generated/transpose_i4.c (.../tags/gcc_4_8_3_release)
14488
+++ b/src/libgfortran/generated/transpose_i4.c (.../branches/gcc-4_8-branch)
14490
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
14491
GFC_DESCRIPTOR_EXTENT(source, 1));
14493
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) ret));
14494
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
14495
+ sizeof (GFC_INTEGER_4));
14497
} else if (unlikely (compile_options.bounds_check))
14499
Index: libgfortran/generated/maxloc1_16_i8.c
14500
===================================================================
14501
--- a/src/libgfortran/generated/maxloc1_16_i8.c (.../tags/gcc_4_8_3_release)
14502
+++ b/src/libgfortran/generated/maxloc1_16_i8.c (.../branches/gcc-4_8-branch)
14504
retarray->offset = 0;
14505
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14507
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14508
- * extent[rank-1];
14509
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14511
- retarray->base_addr = xmalloc (alloc_size);
14512
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14513
if (alloc_size == 0)
14515
/* Make sure we have a zero-sized array. */
14516
@@ -294,8 +293,7 @@
14520
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14521
- * extent[rank-1];
14522
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14524
retarray->offset = 0;
14525
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14526
@@ -307,7 +305,7 @@
14530
- retarray->base_addr = xmalloc (alloc_size);
14531
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14535
@@ -485,8 +483,7 @@
14536
retarray->offset = 0;
14537
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14539
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14540
- * extent[rank-1];
14541
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14543
if (alloc_size == 0)
14545
@@ -495,7 +492,7 @@
14549
- retarray->base_addr = xmalloc (alloc_size);
14550
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14554
Index: libgfortran/generated/minloc1_4_i2.c
14555
===================================================================
14556
--- a/src/libgfortran/generated/minloc1_4_i2.c (.../tags/gcc_4_8_3_release)
14557
+++ b/src/libgfortran/generated/minloc1_4_i2.c (.../branches/gcc-4_8-branch)
14559
retarray->offset = 0;
14560
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14562
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14563
- * extent[rank-1];
14564
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14566
- retarray->base_addr = xmalloc (alloc_size);
14567
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14568
if (alloc_size == 0)
14570
/* Make sure we have a zero-sized array. */
14571
@@ -294,8 +293,7 @@
14575
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14576
- * extent[rank-1];
14577
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14579
retarray->offset = 0;
14580
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14581
@@ -307,7 +305,7 @@
14585
- retarray->base_addr = xmalloc (alloc_size);
14586
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14590
@@ -485,8 +483,7 @@
14591
retarray->offset = 0;
14592
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14594
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14595
- * extent[rank-1];
14596
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14598
if (alloc_size == 0)
14600
@@ -495,7 +492,7 @@
14604
- retarray->base_addr = xmalloc (alloc_size);
14605
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
14609
Index: libgfortran/generated/matmul_l16.c
14610
===================================================================
14611
--- a/src/libgfortran/generated/matmul_l16.c (.../tags/gcc_4_8_3_release)
14612
+++ b/src/libgfortran/generated/matmul_l16.c (.../branches/gcc-4_8-branch)
14616
retarray->base_addr
14617
- = xmalloc (sizeof (GFC_LOGICAL_16) * size0 ((array_t *) retarray));
14618
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_16));
14619
retarray->offset = 0;
14621
else if (unlikely (compile_options.bounds_check))
14622
Index: libgfortran/generated/maxloc1_8_i1.c
14623
===================================================================
14624
--- a/src/libgfortran/generated/maxloc1_8_i1.c (.../tags/gcc_4_8_3_release)
14625
+++ b/src/libgfortran/generated/maxloc1_8_i1.c (.../branches/gcc-4_8-branch)
14627
retarray->offset = 0;
14628
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14630
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14631
- * extent[rank-1];
14632
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14634
- retarray->base_addr = xmalloc (alloc_size);
14635
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14636
if (alloc_size == 0)
14638
/* Make sure we have a zero-sized array. */
14639
@@ -294,8 +293,7 @@
14643
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14644
- * extent[rank-1];
14645
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14647
retarray->offset = 0;
14648
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14649
@@ -307,7 +305,7 @@
14653
- retarray->base_addr = xmalloc (alloc_size);
14654
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14658
@@ -485,8 +483,7 @@
14659
retarray->offset = 0;
14660
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14662
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14663
- * extent[rank-1];
14664
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14666
if (alloc_size == 0)
14668
@@ -495,7 +492,7 @@
14672
- retarray->base_addr = xmalloc (alloc_size);
14673
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14677
Index: libgfortran/generated/minloc1_8_i8.c
14678
===================================================================
14679
--- a/src/libgfortran/generated/minloc1_8_i8.c (.../tags/gcc_4_8_3_release)
14680
+++ b/src/libgfortran/generated/minloc1_8_i8.c (.../branches/gcc-4_8-branch)
14682
retarray->offset = 0;
14683
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14685
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14686
- * extent[rank-1];
14687
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14689
- retarray->base_addr = xmalloc (alloc_size);
14690
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14691
if (alloc_size == 0)
14693
/* Make sure we have a zero-sized array. */
14694
@@ -294,8 +293,7 @@
14698
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14699
- * extent[rank-1];
14700
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14702
retarray->offset = 0;
14703
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14704
@@ -307,7 +305,7 @@
14708
- retarray->base_addr = xmalloc (alloc_size);
14709
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14713
@@ -485,8 +483,7 @@
14714
retarray->offset = 0;
14715
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14717
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14718
- * extent[rank-1];
14719
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14721
if (alloc_size == 0)
14723
@@ -495,7 +492,7 @@
14727
- retarray->base_addr = xmalloc (alloc_size);
14728
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
14732
Index: libgfortran/generated/minloc0_4_r8.c
14733
===================================================================
14734
--- a/src/libgfortran/generated/minloc0_4_r8.c (.../tags/gcc_4_8_3_release)
14735
+++ b/src/libgfortran/generated/minloc0_4_r8.c (.../branches/gcc-4_8-branch)
14737
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14738
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14739
retarray->offset = 0;
14740
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14741
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14745
@@ -199,7 +199,7 @@
14746
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
14747
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14748
retarray->offset = 0;
14749
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14750
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14754
@@ -367,7 +367,7 @@
14755
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
14756
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
14757
retarray->offset = 0;
14758
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
14759
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
14761
else if (unlikely (compile_options.bounds_check))
14763
Index: libgfortran/generated/product_r16.c
14764
===================================================================
14765
--- a/src/libgfortran/generated/product_r16.c (.../tags/gcc_4_8_3_release)
14766
+++ b/src/libgfortran/generated/product_r16.c (.../branches/gcc-4_8-branch)
14768
retarray->offset = 0;
14769
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14771
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14772
- * extent[rank-1];
14773
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14775
- retarray->base_addr = xmalloc (alloc_size);
14776
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14777
if (alloc_size == 0)
14779
/* Make sure we have a zero-sized array. */
14780
@@ -272,8 +271,7 @@
14784
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14785
- * extent[rank-1];
14786
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14788
retarray->offset = 0;
14789
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14790
@@ -285,7 +283,7 @@
14794
- retarray->base_addr = xmalloc (alloc_size);
14795
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14799
@@ -430,8 +428,7 @@
14800
retarray->offset = 0;
14801
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14803
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14804
- * extent[rank-1];
14805
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14807
if (alloc_size == 0)
14809
@@ -440,7 +437,7 @@
14813
- retarray->base_addr = xmalloc (alloc_size);
14814
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
14818
Index: libgfortran/generated/sum_r8.c
14819
===================================================================
14820
--- a/src/libgfortran/generated/sum_r8.c (.../tags/gcc_4_8_3_release)
14821
+++ b/src/libgfortran/generated/sum_r8.c (.../branches/gcc-4_8-branch)
14823
retarray->offset = 0;
14824
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14826
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14827
- * extent[rank-1];
14828
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14830
- retarray->base_addr = xmalloc (alloc_size);
14831
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14832
if (alloc_size == 0)
14834
/* Make sure we have a zero-sized array. */
14835
@@ -272,8 +271,7 @@
14839
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14840
- * extent[rank-1];
14841
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14843
retarray->offset = 0;
14844
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14845
@@ -285,7 +283,7 @@
14849
- retarray->base_addr = xmalloc (alloc_size);
14850
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14854
@@ -430,8 +428,7 @@
14855
retarray->offset = 0;
14856
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14858
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14859
- * extent[rank-1];
14860
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14862
if (alloc_size == 0)
14864
@@ -440,7 +437,7 @@
14868
- retarray->base_addr = xmalloc (alloc_size);
14869
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
14873
Index: libgfortran/generated/norm2_r10.c
14874
===================================================================
14875
--- a/src/libgfortran/generated/norm2_r10.c (.../tags/gcc_4_8_3_release)
14876
+++ b/src/libgfortran/generated/norm2_r10.c (.../branches/gcc-4_8-branch)
14877
@@ -101,10 +101,9 @@
14878
retarray->offset = 0;
14879
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14881
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14882
- * extent[rank-1];
14883
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14885
- retarray->base_addr = xmalloc (alloc_size);
14886
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
14887
if (alloc_size == 0)
14889
/* Make sure we have a zero-sized array. */
14890
Index: libgfortran/generated/unpack_c10.c
14891
===================================================================
14892
--- a/src/libgfortran/generated/unpack_c10.c (.../tags/gcc_4_8_3_release)
14893
+++ b/src/libgfortran/generated/unpack_c10.c (.../branches/gcc-4_8-branch)
14898
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
14899
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
14903
@@ -244,7 +244,7 @@
14907
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_10));
14908
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_10));
14912
Index: libgfortran/generated/spread_r8.c
14913
===================================================================
14914
--- a/src/libgfortran/generated/spread_r8.c (.../tags/gcc_4_8_3_release)
14915
+++ b/src/libgfortran/generated/spread_r8.c (.../branches/gcc-4_8-branch)
14916
@@ -101,8 +101,8 @@
14920
- /* xmalloc allocates a single byte for zero size. */
14921
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
14922
+ /* xmallocarray allocates a single byte for zero size. */
14923
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
14927
@@ -244,7 +244,7 @@
14929
if (ret->base_addr == NULL)
14931
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
14932
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
14934
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
14936
Index: libgfortran/generated/minloc1_16_i16.c
14937
===================================================================
14938
--- a/src/libgfortran/generated/minloc1_16_i16.c (.../tags/gcc_4_8_3_release)
14939
+++ b/src/libgfortran/generated/minloc1_16_i16.c (.../branches/gcc-4_8-branch)
14941
retarray->offset = 0;
14942
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14944
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14945
- * extent[rank-1];
14946
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14948
- retarray->base_addr = xmalloc (alloc_size);
14949
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14950
if (alloc_size == 0)
14952
/* Make sure we have a zero-sized array. */
14953
@@ -294,8 +293,7 @@
14957
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14958
- * extent[rank-1];
14959
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14961
retarray->offset = 0;
14962
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14963
@@ -307,7 +305,7 @@
14967
- retarray->base_addr = xmalloc (alloc_size);
14968
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14972
@@ -485,8 +483,7 @@
14973
retarray->offset = 0;
14974
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14976
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
14977
- * extent[rank-1];
14978
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
14980
if (alloc_size == 0)
14982
@@ -495,7 +492,7 @@
14986
- retarray->base_addr = xmalloc (alloc_size);
14987
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
14991
Index: libgfortran/generated/maxloc1_8_r4.c
14992
===================================================================
14993
--- a/src/libgfortran/generated/maxloc1_8_r4.c (.../tags/gcc_4_8_3_release)
14994
+++ b/src/libgfortran/generated/maxloc1_8_r4.c (.../branches/gcc-4_8-branch)
14996
retarray->offset = 0;
14997
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
14999
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15000
- * extent[rank-1];
15001
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15003
- retarray->base_addr = xmalloc (alloc_size);
15004
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15005
if (alloc_size == 0)
15007
/* Make sure we have a zero-sized array. */
15008
@@ -294,8 +293,7 @@
15012
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15013
- * extent[rank-1];
15014
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15016
retarray->offset = 0;
15017
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15018
@@ -307,7 +305,7 @@
15022
- retarray->base_addr = xmalloc (alloc_size);
15023
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15027
@@ -485,8 +483,7 @@
15028
retarray->offset = 0;
15029
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15031
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15032
- * extent[rank-1];
15033
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15035
if (alloc_size == 0)
15037
@@ -495,7 +492,7 @@
15041
- retarray->base_addr = xmalloc (alloc_size);
15042
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15046
Index: libgfortran/generated/minloc1_16_i1.c
15047
===================================================================
15048
--- a/src/libgfortran/generated/minloc1_16_i1.c (.../tags/gcc_4_8_3_release)
15049
+++ b/src/libgfortran/generated/minloc1_16_i1.c (.../branches/gcc-4_8-branch)
15051
retarray->offset = 0;
15052
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15054
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15055
- * extent[rank-1];
15056
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15058
- retarray->base_addr = xmalloc (alloc_size);
15059
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15060
if (alloc_size == 0)
15062
/* Make sure we have a zero-sized array. */
15063
@@ -294,8 +293,7 @@
15067
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15068
- * extent[rank-1];
15069
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15071
retarray->offset = 0;
15072
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15073
@@ -307,7 +305,7 @@
15077
- retarray->base_addr = xmalloc (alloc_size);
15078
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15082
@@ -485,8 +483,7 @@
15083
retarray->offset = 0;
15084
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15086
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15087
- * extent[rank-1];
15088
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15090
if (alloc_size == 0)
15092
@@ -495,7 +492,7 @@
15096
- retarray->base_addr = xmalloc (alloc_size);
15097
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15101
Index: libgfortran/generated/spread_r16.c
15102
===================================================================
15103
--- a/src/libgfortran/generated/spread_r16.c (.../tags/gcc_4_8_3_release)
15104
+++ b/src/libgfortran/generated/spread_r16.c (.../branches/gcc-4_8-branch)
15105
@@ -101,8 +101,8 @@
15109
- /* xmalloc allocates a single byte for zero size. */
15110
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_16));
15111
+ /* xmallocarray allocates a single byte for zero size. */
15112
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_16));
15116
@@ -244,7 +244,7 @@
15118
if (ret->base_addr == NULL)
15120
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_16));
15121
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_16));
15123
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
15125
Index: libgfortran/generated/pack_c8.c
15126
===================================================================
15127
--- a/src/libgfortran/generated/pack_c8.c (.../tags/gcc_4_8_3_release)
15128
+++ b/src/libgfortran/generated/pack_c8.c (.../branches/gcc-4_8-branch)
15129
@@ -167,8 +167,8 @@
15133
- /* xmalloc allocates a single byte for zero size. */
15134
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_8) * total);
15135
+ /* xmallocarray allocates a single byte for zero size. */
15136
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_8));
15140
Index: libgfortran/generated/minval_r10.c
15141
===================================================================
15142
--- a/src/libgfortran/generated/minval_r10.c (.../tags/gcc_4_8_3_release)
15143
+++ b/src/libgfortran/generated/minval_r10.c (.../branches/gcc-4_8-branch)
15145
retarray->offset = 0;
15146
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15148
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15149
- * extent[rank-1];
15150
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15152
- retarray->base_addr = xmalloc (alloc_size);
15153
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15154
if (alloc_size == 0)
15156
/* Make sure we have a zero-sized array. */
15157
@@ -286,8 +285,7 @@
15161
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15162
- * extent[rank-1];
15163
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15165
retarray->offset = 0;
15166
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15167
@@ -299,7 +297,7 @@
15171
- retarray->base_addr = xmalloc (alloc_size);
15172
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15176
@@ -472,8 +470,7 @@
15177
retarray->offset = 0;
15178
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15180
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15181
- * extent[rank-1];
15182
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15184
if (alloc_size == 0)
15186
@@ -482,7 +479,7 @@
15190
- retarray->base_addr = xmalloc (alloc_size);
15191
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
15195
Index: libgfortran/generated/parity_l8.c
15196
===================================================================
15197
--- a/src/libgfortran/generated/parity_l8.c (.../tags/gcc_4_8_3_release)
15198
+++ b/src/libgfortran/generated/parity_l8.c (.../branches/gcc-4_8-branch)
15200
retarray->offset = 0;
15201
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15203
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15204
- * extent[rank-1];
15205
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15207
- retarray->base_addr = xmalloc (alloc_size);
15208
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
15209
if (alloc_size == 0)
15211
/* Make sure we have a zero-sized array. */
15212
Index: libgfortran/generated/minval_i4.c
15213
===================================================================
15214
--- a/src/libgfortran/generated/minval_i4.c (.../tags/gcc_4_8_3_release)
15215
+++ b/src/libgfortran/generated/minval_i4.c (.../branches/gcc-4_8-branch)
15217
retarray->offset = 0;
15218
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15220
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15221
- * extent[rank-1];
15222
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15224
- retarray->base_addr = xmalloc (alloc_size);
15225
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15226
if (alloc_size == 0)
15228
/* Make sure we have a zero-sized array. */
15229
@@ -286,8 +285,7 @@
15233
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15234
- * extent[rank-1];
15235
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15237
retarray->offset = 0;
15238
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15239
@@ -299,7 +297,7 @@
15243
- retarray->base_addr = xmalloc (alloc_size);
15244
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15248
@@ -472,8 +470,7 @@
15249
retarray->offset = 0;
15250
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15252
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15253
- * extent[rank-1];
15254
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15256
if (alloc_size == 0)
15258
@@ -482,7 +479,7 @@
15262
- retarray->base_addr = xmalloc (alloc_size);
15263
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15267
Index: libgfortran/generated/maxloc1_8_i2.c
15268
===================================================================
15269
--- a/src/libgfortran/generated/maxloc1_8_i2.c (.../tags/gcc_4_8_3_release)
15270
+++ b/src/libgfortran/generated/maxloc1_8_i2.c (.../branches/gcc-4_8-branch)
15272
retarray->offset = 0;
15273
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15275
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15276
- * extent[rank-1];
15277
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15279
- retarray->base_addr = xmalloc (alloc_size);
15280
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15281
if (alloc_size == 0)
15283
/* Make sure we have a zero-sized array. */
15284
@@ -294,8 +293,7 @@
15288
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15289
- * extent[rank-1];
15290
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15292
retarray->offset = 0;
15293
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15294
@@ -307,7 +305,7 @@
15298
- retarray->base_addr = xmalloc (alloc_size);
15299
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15303
@@ -485,8 +483,7 @@
15304
retarray->offset = 0;
15305
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15307
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15308
- * extent[rank-1];
15309
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15311
if (alloc_size == 0)
15313
@@ -495,7 +492,7 @@
15317
- retarray->base_addr = xmalloc (alloc_size);
15318
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15322
Index: libgfortran/generated/any_l8.c
15323
===================================================================
15324
--- a/src/libgfortran/generated/any_l8.c (.../tags/gcc_4_8_3_release)
15325
+++ b/src/libgfortran/generated/any_l8.c (.../branches/gcc-4_8-branch)
15326
@@ -101,8 +101,7 @@
15327
retarray->offset = 0;
15328
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15330
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15331
- * extent[rank-1];
15332
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15334
if (alloc_size == 0)
15336
@@ -111,7 +110,7 @@
15340
- retarray->base_addr = xmalloc (alloc_size);
15341
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
15345
Index: libgfortran/generated/maxloc0_16_r10.c
15346
===================================================================
15347
--- a/src/libgfortran/generated/maxloc0_16_r10.c (.../tags/gcc_4_8_3_release)
15348
+++ b/src/libgfortran/generated/maxloc0_16_r10.c (.../branches/gcc-4_8-branch)
15350
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15351
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15352
retarray->offset = 0;
15353
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15354
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15358
@@ -199,7 +199,7 @@
15359
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15360
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15361
retarray->offset = 0;
15362
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15363
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15367
@@ -367,7 +367,7 @@
15368
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15369
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15370
retarray->offset = 0;
15371
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15372
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15374
else if (unlikely (compile_options.bounds_check))
15376
Index: libgfortran/generated/minloc0_4_i16.c
15377
===================================================================
15378
--- a/src/libgfortran/generated/minloc0_4_i16.c (.../tags/gcc_4_8_3_release)
15379
+++ b/src/libgfortran/generated/minloc0_4_i16.c (.../branches/gcc-4_8-branch)
15381
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15382
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15383
retarray->offset = 0;
15384
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15385
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15389
@@ -199,7 +199,7 @@
15390
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15391
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15392
retarray->offset = 0;
15393
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15394
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15398
@@ -367,7 +367,7 @@
15399
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15400
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15401
retarray->offset = 0;
15402
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
15403
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
15405
else if (unlikely (compile_options.bounds_check))
15407
Index: libgfortran/generated/maxloc0_8_r8.c
15408
===================================================================
15409
--- a/src/libgfortran/generated/maxloc0_8_r8.c (.../tags/gcc_4_8_3_release)
15410
+++ b/src/libgfortran/generated/maxloc0_8_r8.c (.../branches/gcc-4_8-branch)
15412
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15413
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15414
retarray->offset = 0;
15415
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15416
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15420
@@ -199,7 +199,7 @@
15421
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15422
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15423
retarray->offset = 0;
15424
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15425
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15429
@@ -367,7 +367,7 @@
15430
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15431
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15432
retarray->offset = 0;
15433
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15434
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15436
else if (unlikely (compile_options.bounds_check))
15438
Index: libgfortran/generated/minloc1_4_r10.c
15439
===================================================================
15440
--- a/src/libgfortran/generated/minloc1_4_r10.c (.../tags/gcc_4_8_3_release)
15441
+++ b/src/libgfortran/generated/minloc1_4_r10.c (.../branches/gcc-4_8-branch)
15443
retarray->offset = 0;
15444
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15446
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15447
- * extent[rank-1];
15448
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15450
- retarray->base_addr = xmalloc (alloc_size);
15451
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15452
if (alloc_size == 0)
15454
/* Make sure we have a zero-sized array. */
15455
@@ -294,8 +293,7 @@
15459
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15460
- * extent[rank-1];
15461
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15463
retarray->offset = 0;
15464
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15465
@@ -307,7 +305,7 @@
15469
- retarray->base_addr = xmalloc (alloc_size);
15470
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15474
@@ -485,8 +483,7 @@
15475
retarray->offset = 0;
15476
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15478
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15479
- * extent[rank-1];
15480
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15482
if (alloc_size == 0)
15484
@@ -495,7 +492,7 @@
15488
- retarray->base_addr = xmalloc (alloc_size);
15489
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15493
Index: libgfortran/generated/minloc1_8_i16.c
15494
===================================================================
15495
--- a/src/libgfortran/generated/minloc1_8_i16.c (.../tags/gcc_4_8_3_release)
15496
+++ b/src/libgfortran/generated/minloc1_8_i16.c (.../branches/gcc-4_8-branch)
15498
retarray->offset = 0;
15499
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15501
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15502
- * extent[rank-1];
15503
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15505
- retarray->base_addr = xmalloc (alloc_size);
15506
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15507
if (alloc_size == 0)
15509
/* Make sure we have a zero-sized array. */
15510
@@ -294,8 +293,7 @@
15514
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15515
- * extent[rank-1];
15516
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15518
retarray->offset = 0;
15519
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15520
@@ -307,7 +305,7 @@
15524
- retarray->base_addr = xmalloc (alloc_size);
15525
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15529
@@ -485,8 +483,7 @@
15530
retarray->offset = 0;
15531
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15533
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15534
- * extent[rank-1];
15535
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15537
if (alloc_size == 0)
15539
@@ -495,7 +492,7 @@
15543
- retarray->base_addr = xmalloc (alloc_size);
15544
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15548
Index: libgfortran/generated/maxloc0_8_r10.c
15549
===================================================================
15550
--- a/src/libgfortran/generated/maxloc0_8_r10.c (.../tags/gcc_4_8_3_release)
15551
+++ b/src/libgfortran/generated/maxloc0_8_r10.c (.../branches/gcc-4_8-branch)
15553
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15554
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15555
retarray->offset = 0;
15556
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15557
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15561
@@ -199,7 +199,7 @@
15562
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15563
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15564
retarray->offset = 0;
15565
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15566
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15570
@@ -367,7 +367,7 @@
15571
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15572
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15573
retarray->offset = 0;
15574
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
15575
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
15577
else if (unlikely (compile_options.bounds_check))
15579
Index: libgfortran/generated/unpack_i4.c
15580
===================================================================
15581
--- a/src/libgfortran/generated/unpack_i4.c (.../tags/gcc_4_8_3_release)
15582
+++ b/src/libgfortran/generated/unpack_i4.c (.../branches/gcc-4_8-branch)
15587
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
15588
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
15592
@@ -244,7 +244,7 @@
15596
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_4));
15597
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_4));
15601
Index: libgfortran/generated/minloc1_16_r4.c
15602
===================================================================
15603
--- a/src/libgfortran/generated/minloc1_16_r4.c (.../tags/gcc_4_8_3_release)
15604
+++ b/src/libgfortran/generated/minloc1_16_r4.c (.../branches/gcc-4_8-branch)
15606
retarray->offset = 0;
15607
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15609
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15610
- * extent[rank-1];
15611
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15613
- retarray->base_addr = xmalloc (alloc_size);
15614
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15615
if (alloc_size == 0)
15617
/* Make sure we have a zero-sized array. */
15618
@@ -294,8 +293,7 @@
15622
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15623
- * extent[rank-1];
15624
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15626
retarray->offset = 0;
15627
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15628
@@ -307,7 +305,7 @@
15632
- retarray->base_addr = xmalloc (alloc_size);
15633
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15637
@@ -485,8 +483,7 @@
15638
retarray->offset = 0;
15639
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15641
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15642
- * extent[rank-1];
15643
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15645
if (alloc_size == 0)
15647
@@ -495,7 +492,7 @@
15651
- retarray->base_addr = xmalloc (alloc_size);
15652
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15656
Index: libgfortran/generated/product_i8.c
15657
===================================================================
15658
--- a/src/libgfortran/generated/product_i8.c (.../tags/gcc_4_8_3_release)
15659
+++ b/src/libgfortran/generated/product_i8.c (.../branches/gcc-4_8-branch)
15661
retarray->offset = 0;
15662
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15664
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15665
- * extent[rank-1];
15666
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15668
- retarray->base_addr = xmalloc (alloc_size);
15669
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15670
if (alloc_size == 0)
15672
/* Make sure we have a zero-sized array. */
15673
@@ -272,8 +271,7 @@
15677
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15678
- * extent[rank-1];
15679
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15681
retarray->offset = 0;
15682
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15683
@@ -285,7 +283,7 @@
15687
- retarray->base_addr = xmalloc (alloc_size);
15688
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15692
@@ -430,8 +428,7 @@
15693
retarray->offset = 0;
15694
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15696
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15697
- * extent[rank-1];
15698
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15700
if (alloc_size == 0)
15702
@@ -440,7 +437,7 @@
15706
- retarray->base_addr = xmalloc (alloc_size);
15707
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
15711
Index: libgfortran/generated/minloc0_16_r8.c
15712
===================================================================
15713
--- a/src/libgfortran/generated/minloc0_16_r8.c (.../tags/gcc_4_8_3_release)
15714
+++ b/src/libgfortran/generated/minloc0_16_r8.c (.../branches/gcc-4_8-branch)
15716
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15717
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15718
retarray->offset = 0;
15719
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15720
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15724
@@ -199,7 +199,7 @@
15725
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
15726
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15727
retarray->offset = 0;
15728
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15729
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15733
@@ -367,7 +367,7 @@
15734
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
15735
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
15736
retarray->offset = 0;
15737
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
15738
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
15740
else if (unlikely (compile_options.bounds_check))
15742
Index: libgfortran/generated/count_2_l.c
15743
===================================================================
15744
--- a/src/libgfortran/generated/count_2_l.c (.../tags/gcc_4_8_3_release)
15745
+++ b/src/libgfortran/generated/count_2_l.c (.../branches/gcc-4_8-branch)
15746
@@ -101,8 +101,7 @@
15747
retarray->offset = 0;
15748
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15750
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15751
- * extent[rank-1];
15752
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15754
if (alloc_size == 0)
15756
@@ -111,7 +110,7 @@
15760
- retarray->base_addr = xmalloc (alloc_size);
15761
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
15765
Index: libgfortran/generated/transpose_r8.c
15766
===================================================================
15767
--- a/src/libgfortran/generated/transpose_r8.c (.../tags/gcc_4_8_3_release)
15768
+++ b/src/libgfortran/generated/transpose_r8.c (.../branches/gcc-4_8-branch)
15770
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15771
GFC_DESCRIPTOR_EXTENT(source, 1));
15773
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) ret));
15774
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
15775
+ sizeof (GFC_REAL_8));
15777
} else if (unlikely (compile_options.bounds_check))
15779
Index: libgfortran/generated/cshift1_8.c
15780
===================================================================
15781
--- a/src/libgfortran/generated/cshift1_8.c (.../tags/gcc_4_8_3_release)
15782
+++ b/src/libgfortran/generated/cshift1_8.c (.../branches/gcc-4_8-branch)
15787
- ret->base_addr = xmalloc (size * arraysize);
15788
+ ret->base_addr = xmallocarray (arraysize, size);
15790
ret->dtype = array->dtype;
15791
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
15792
Index: libgfortran/generated/matmul_i4.c
15793
===================================================================
15794
--- a/src/libgfortran/generated/matmul_i4.c (.../tags/gcc_4_8_3_release)
15795
+++ b/src/libgfortran/generated/matmul_i4.c (.../branches/gcc-4_8-branch)
15796
@@ -124,7 +124,7 @@
15799
retarray->base_addr
15800
- = xmalloc (sizeof (GFC_INTEGER_4) * size0 ((array_t *) retarray));
15801
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_4));
15802
retarray->offset = 0;
15804
else if (unlikely (compile_options.bounds_check))
15805
Index: libgfortran/generated/pack_r10.c
15806
===================================================================
15807
--- a/src/libgfortran/generated/pack_r10.c (.../tags/gcc_4_8_3_release)
15808
+++ b/src/libgfortran/generated/pack_r10.c (.../branches/gcc-4_8-branch)
15809
@@ -167,8 +167,8 @@
15813
- /* xmalloc allocates a single byte for zero size. */
15814
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * total);
15815
+ /* xmallocarray allocates a single byte for zero size. */
15816
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_10));
15820
Index: libgfortran/generated/minloc1_16_i2.c
15821
===================================================================
15822
--- a/src/libgfortran/generated/minloc1_16_i2.c (.../tags/gcc_4_8_3_release)
15823
+++ b/src/libgfortran/generated/minloc1_16_i2.c (.../branches/gcc-4_8-branch)
15825
retarray->offset = 0;
15826
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15828
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15829
- * extent[rank-1];
15830
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15832
- retarray->base_addr = xmalloc (alloc_size);
15833
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15834
if (alloc_size == 0)
15836
/* Make sure we have a zero-sized array. */
15837
@@ -294,8 +293,7 @@
15841
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15842
- * extent[rank-1];
15843
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15845
retarray->offset = 0;
15846
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15847
@@ -307,7 +305,7 @@
15851
- retarray->base_addr = xmalloc (alloc_size);
15852
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15856
@@ -485,8 +483,7 @@
15857
retarray->offset = 0;
15858
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15860
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15861
- * extent[rank-1];
15862
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15864
if (alloc_size == 0)
15866
@@ -495,7 +492,7 @@
15870
- retarray->base_addr = xmalloc (alloc_size);
15871
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
15875
Index: libgfortran/generated/in_pack_i8.c
15876
===================================================================
15877
--- a/src/libgfortran/generated/in_pack_i8.c (.../tags/gcc_4_8_3_release)
15878
+++ b/src/libgfortran/generated/in_pack_i8.c (.../branches/gcc-4_8-branch)
15880
return source->base_addr;
15882
/* Allocate storage for the destination. */
15883
- destptr = (GFC_INTEGER_8 *)xmalloc (ssize * sizeof (GFC_INTEGER_8));
15884
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_8));
15886
src = source->base_addr;
15887
stride0 = stride[0];
15888
Index: libgfortran/generated/transpose_r16.c
15889
===================================================================
15890
--- a/src/libgfortran/generated/transpose_r16.c (.../tags/gcc_4_8_3_release)
15891
+++ b/src/libgfortran/generated/transpose_r16.c (.../branches/gcc-4_8-branch)
15893
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
15894
GFC_DESCRIPTOR_EXTENT(source, 1));
15896
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * size0 ((array_t *) ret));
15897
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
15898
+ sizeof (GFC_REAL_16));
15900
} else if (unlikely (compile_options.bounds_check))
15902
Index: libgfortran/generated/minloc1_4_i4.c
15903
===================================================================
15904
--- a/src/libgfortran/generated/minloc1_4_i4.c (.../tags/gcc_4_8_3_release)
15905
+++ b/src/libgfortran/generated/minloc1_4_i4.c (.../branches/gcc-4_8-branch)
15907
retarray->offset = 0;
15908
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15910
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15911
- * extent[rank-1];
15912
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15914
- retarray->base_addr = xmalloc (alloc_size);
15915
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15916
if (alloc_size == 0)
15918
/* Make sure we have a zero-sized array. */
15919
@@ -294,8 +293,7 @@
15923
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15924
- * extent[rank-1];
15925
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15927
retarray->offset = 0;
15928
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15929
@@ -307,7 +305,7 @@
15933
- retarray->base_addr = xmalloc (alloc_size);
15934
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15938
@@ -485,8 +483,7 @@
15939
retarray->offset = 0;
15940
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15942
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15943
- * extent[rank-1];
15944
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15946
if (alloc_size == 0)
15948
@@ -495,7 +492,7 @@
15952
- retarray->base_addr = xmalloc (alloc_size);
15953
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
15957
Index: libgfortran/generated/maxval_i1.c
15958
===================================================================
15959
--- a/src/libgfortran/generated/maxval_i1.c (.../tags/gcc_4_8_3_release)
15960
+++ b/src/libgfortran/generated/maxval_i1.c (.../branches/gcc-4_8-branch)
15962
retarray->offset = 0;
15963
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15965
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15966
- * extent[rank-1];
15967
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15969
- retarray->base_addr = xmalloc (alloc_size);
15970
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15971
if (alloc_size == 0)
15973
/* Make sure we have a zero-sized array. */
15974
@@ -286,8 +285,7 @@
15978
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15979
- * extent[rank-1];
15980
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
15982
retarray->offset = 0;
15983
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15984
@@ -299,7 +297,7 @@
15988
- retarray->base_addr = xmalloc (alloc_size);
15989
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
15993
@@ -472,8 +470,7 @@
15994
retarray->offset = 0;
15995
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
15997
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
15998
- * extent[rank-1];
15999
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16001
if (alloc_size == 0)
16003
@@ -482,7 +479,7 @@
16007
- retarray->base_addr = xmalloc (alloc_size);
16008
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
16012
Index: libgfortran/generated/product_c16.c
16013
===================================================================
16014
--- a/src/libgfortran/generated/product_c16.c (.../tags/gcc_4_8_3_release)
16015
+++ b/src/libgfortran/generated/product_c16.c (.../branches/gcc-4_8-branch)
16017
retarray->offset = 0;
16018
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16020
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16021
- * extent[rank-1];
16022
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16024
- retarray->base_addr = xmalloc (alloc_size);
16025
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
16026
if (alloc_size == 0)
16028
/* Make sure we have a zero-sized array. */
16029
@@ -272,8 +271,7 @@
16033
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16034
- * extent[rank-1];
16035
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16037
retarray->offset = 0;
16038
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16039
@@ -285,7 +283,7 @@
16043
- retarray->base_addr = xmalloc (alloc_size);
16044
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
16048
@@ -430,8 +428,7 @@
16049
retarray->offset = 0;
16050
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16052
- alloc_size = sizeof (GFC_COMPLEX_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16053
- * extent[rank-1];
16054
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16056
if (alloc_size == 0)
16058
@@ -440,7 +437,7 @@
16062
- retarray->base_addr = xmalloc (alloc_size);
16063
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
16067
Index: libgfortran/generated/reshape_r4.c
16068
===================================================================
16069
--- a/src/libgfortran/generated/reshape_r4.c (.../tags/gcc_4_8_3_release)
16070
+++ b/src/libgfortran/generated/reshape_r4.c (.../branches/gcc-4_8-branch)
16071
@@ -111,11 +111,11 @@
16074
if (unlikely (rs < 1))
16078
- alloc_size = rs * sizeof (GFC_REAL_4);
16081
- ret->base_addr = xmalloc (alloc_size);
16082
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16083
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
16086
Index: libgfortran/generated/iany_i8.c
16087
===================================================================
16088
--- a/src/libgfortran/generated/iany_i8.c (.../tags/gcc_4_8_3_release)
16089
+++ b/src/libgfortran/generated/iany_i8.c (.../branches/gcc-4_8-branch)
16091
retarray->offset = 0;
16092
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16094
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16095
- * extent[rank-1];
16096
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16098
- retarray->base_addr = xmalloc (alloc_size);
16099
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16100
if (alloc_size == 0)
16102
/* Make sure we have a zero-sized array. */
16103
@@ -272,8 +271,7 @@
16107
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16108
- * extent[rank-1];
16109
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16111
retarray->offset = 0;
16112
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16113
@@ -285,7 +283,7 @@
16117
- retarray->base_addr = xmalloc (alloc_size);
16118
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16122
@@ -430,8 +428,7 @@
16123
retarray->offset = 0;
16124
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16126
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16127
- * extent[rank-1];
16128
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16130
if (alloc_size == 0)
16132
@@ -440,7 +437,7 @@
16136
- retarray->base_addr = xmalloc (alloc_size);
16137
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16141
Index: libgfortran/generated/cshift1_16.c
16142
===================================================================
16143
--- a/src/libgfortran/generated/cshift1_16.c (.../tags/gcc_4_8_3_release)
16144
+++ b/src/libgfortran/generated/cshift1_16.c (.../branches/gcc-4_8-branch)
16149
- ret->base_addr = xmalloc (size * arraysize);
16150
+ ret->base_addr = xmallocarray (arraysize, size);
16152
ret->dtype = array->dtype;
16153
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
16154
Index: libgfortran/generated/maxloc0_4_i1.c
16155
===================================================================
16156
--- a/src/libgfortran/generated/maxloc0_4_i1.c (.../tags/gcc_4_8_3_release)
16157
+++ b/src/libgfortran/generated/maxloc0_4_i1.c (.../branches/gcc-4_8-branch)
16159
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16160
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16161
retarray->offset = 0;
16162
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16163
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16167
@@ -199,7 +199,7 @@
16168
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16169
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16170
retarray->offset = 0;
16171
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16172
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16176
@@ -367,7 +367,7 @@
16177
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16178
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16179
retarray->offset = 0;
16180
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16181
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16183
else if (unlikely (compile_options.bounds_check))
16185
Index: libgfortran/generated/minloc0_4_i8.c
16186
===================================================================
16187
--- a/src/libgfortran/generated/minloc0_4_i8.c (.../tags/gcc_4_8_3_release)
16188
+++ b/src/libgfortran/generated/minloc0_4_i8.c (.../branches/gcc-4_8-branch)
16190
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16191
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16192
retarray->offset = 0;
16193
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16194
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16198
@@ -199,7 +199,7 @@
16199
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16200
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16201
retarray->offset = 0;
16202
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16203
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16207
@@ -367,7 +367,7 @@
16208
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16209
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16210
retarray->offset = 0;
16211
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16212
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16214
else if (unlikely (compile_options.bounds_check))
16216
Index: libgfortran/generated/spread_c16.c
16217
===================================================================
16218
--- a/src/libgfortran/generated/spread_c16.c (.../tags/gcc_4_8_3_release)
16219
+++ b/src/libgfortran/generated/spread_c16.c (.../branches/gcc-4_8-branch)
16220
@@ -101,8 +101,8 @@
16224
- /* xmalloc allocates a single byte for zero size. */
16225
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_16));
16226
+ /* xmallocarray allocates a single byte for zero size. */
16227
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_16));
16231
@@ -244,7 +244,7 @@
16233
if (ret->base_addr == NULL)
16235
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_16));
16236
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_16));
16238
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
16240
Index: libgfortran/generated/maxval_r4.c
16241
===================================================================
16242
--- a/src/libgfortran/generated/maxval_r4.c (.../tags/gcc_4_8_3_release)
16243
+++ b/src/libgfortran/generated/maxval_r4.c (.../branches/gcc-4_8-branch)
16245
retarray->offset = 0;
16246
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16248
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16249
- * extent[rank-1];
16250
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16252
- retarray->base_addr = xmalloc (alloc_size);
16253
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16254
if (alloc_size == 0)
16256
/* Make sure we have a zero-sized array. */
16257
@@ -286,8 +285,7 @@
16261
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16262
- * extent[rank-1];
16263
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16265
retarray->offset = 0;
16266
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16267
@@ -299,7 +297,7 @@
16271
- retarray->base_addr = xmalloc (alloc_size);
16272
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16276
@@ -472,8 +470,7 @@
16277
retarray->offset = 0;
16278
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16280
- alloc_size = sizeof (GFC_REAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16281
- * extent[rank-1];
16282
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16284
if (alloc_size == 0)
16286
@@ -482,7 +479,7 @@
16290
- retarray->base_addr = xmalloc (alloc_size);
16291
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
16295
Index: libgfortran/generated/minval_r8.c
16296
===================================================================
16297
--- a/src/libgfortran/generated/minval_r8.c (.../tags/gcc_4_8_3_release)
16298
+++ b/src/libgfortran/generated/minval_r8.c (.../branches/gcc-4_8-branch)
16300
retarray->offset = 0;
16301
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16303
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16304
- * extent[rank-1];
16305
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16307
- retarray->base_addr = xmalloc (alloc_size);
16308
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16309
if (alloc_size == 0)
16311
/* Make sure we have a zero-sized array. */
16312
@@ -286,8 +285,7 @@
16316
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16317
- * extent[rank-1];
16318
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16320
retarray->offset = 0;
16321
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16322
@@ -299,7 +297,7 @@
16326
- retarray->base_addr = xmalloc (alloc_size);
16327
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16331
@@ -472,8 +470,7 @@
16332
retarray->offset = 0;
16333
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16335
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16336
- * extent[rank-1];
16337
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16339
if (alloc_size == 0)
16341
@@ -482,7 +479,7 @@
16345
- retarray->base_addr = xmalloc (alloc_size);
16346
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
16350
Index: libgfortran/generated/minloc1_16_r16.c
16351
===================================================================
16352
--- a/src/libgfortran/generated/minloc1_16_r16.c (.../tags/gcc_4_8_3_release)
16353
+++ b/src/libgfortran/generated/minloc1_16_r16.c (.../branches/gcc-4_8-branch)
16355
retarray->offset = 0;
16356
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16358
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16359
- * extent[rank-1];
16360
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16362
- retarray->base_addr = xmalloc (alloc_size);
16363
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16364
if (alloc_size == 0)
16366
/* Make sure we have a zero-sized array. */
16367
@@ -294,8 +293,7 @@
16371
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16372
- * extent[rank-1];
16373
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16375
retarray->offset = 0;
16376
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16377
@@ -307,7 +305,7 @@
16381
- retarray->base_addr = xmalloc (alloc_size);
16382
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16386
@@ -485,8 +483,7 @@
16387
retarray->offset = 0;
16388
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16390
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16391
- * extent[rank-1];
16392
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16394
if (alloc_size == 0)
16396
@@ -495,7 +492,7 @@
16400
- retarray->base_addr = xmalloc (alloc_size);
16401
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
16405
Index: libgfortran/generated/unpack_i16.c
16406
===================================================================
16407
--- a/src/libgfortran/generated/unpack_i16.c (.../tags/gcc_4_8_3_release)
16408
+++ b/src/libgfortran/generated/unpack_i16.c (.../branches/gcc-4_8-branch)
16413
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
16414
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
16418
@@ -244,7 +244,7 @@
16422
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_16));
16423
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_16));
16427
Index: libgfortran/generated/sum_i8.c
16428
===================================================================
16429
--- a/src/libgfortran/generated/sum_i8.c (.../tags/gcc_4_8_3_release)
16430
+++ b/src/libgfortran/generated/sum_i8.c (.../branches/gcc-4_8-branch)
16432
retarray->offset = 0;
16433
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16435
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16436
- * extent[rank-1];
16437
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16439
- retarray->base_addr = xmalloc (alloc_size);
16440
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16441
if (alloc_size == 0)
16443
/* Make sure we have a zero-sized array. */
16444
@@ -272,8 +271,7 @@
16448
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16449
- * extent[rank-1];
16450
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16452
retarray->offset = 0;
16453
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16454
@@ -285,7 +283,7 @@
16458
- retarray->base_addr = xmalloc (alloc_size);
16459
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16463
@@ -430,8 +428,7 @@
16464
retarray->offset = 0;
16465
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16467
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16468
- * extent[rank-1];
16469
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16471
if (alloc_size == 0)
16473
@@ -440,7 +437,7 @@
16477
- retarray->base_addr = xmalloc (alloc_size);
16478
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16482
Index: libgfortran/generated/pack_i1.c
16483
===================================================================
16484
--- a/src/libgfortran/generated/pack_i1.c (.../tags/gcc_4_8_3_release)
16485
+++ b/src/libgfortran/generated/pack_i1.c (.../branches/gcc-4_8-branch)
16486
@@ -167,8 +167,8 @@
16490
- /* xmalloc allocates a single byte for zero size. */
16491
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_1) * total);
16492
+ /* xmallocarray allocates a single byte for zero size. */
16493
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_1));
16497
Index: libgfortran/generated/any_l16.c
16498
===================================================================
16499
--- a/src/libgfortran/generated/any_l16.c (.../tags/gcc_4_8_3_release)
16500
+++ b/src/libgfortran/generated/any_l16.c (.../branches/gcc-4_8-branch)
16501
@@ -101,8 +101,7 @@
16502
retarray->offset = 0;
16503
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16505
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16506
- * extent[rank-1];
16507
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16509
if (alloc_size == 0)
16511
@@ -111,7 +110,7 @@
16515
- retarray->base_addr = xmalloc (alloc_size);
16516
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
16520
Index: libgfortran/generated/spread_i8.c
16521
===================================================================
16522
--- a/src/libgfortran/generated/spread_i8.c (.../tags/gcc_4_8_3_release)
16523
+++ b/src/libgfortran/generated/spread_i8.c (.../branches/gcc-4_8-branch)
16524
@@ -101,8 +101,8 @@
16528
- /* xmalloc allocates a single byte for zero size. */
16529
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_8));
16530
+ /* xmallocarray allocates a single byte for zero size. */
16531
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_8));
16535
@@ -244,7 +244,7 @@
16537
if (ret->base_addr == NULL)
16539
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_8));
16540
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_8));
16542
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
16544
Index: libgfortran/generated/maxval_i2.c
16545
===================================================================
16546
--- a/src/libgfortran/generated/maxval_i2.c (.../tags/gcc_4_8_3_release)
16547
+++ b/src/libgfortran/generated/maxval_i2.c (.../branches/gcc-4_8-branch)
16549
retarray->offset = 0;
16550
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16552
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16553
- * extent[rank-1];
16554
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16556
- retarray->base_addr = xmalloc (alloc_size);
16557
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16558
if (alloc_size == 0)
16560
/* Make sure we have a zero-sized array. */
16561
@@ -286,8 +285,7 @@
16565
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16566
- * extent[rank-1];
16567
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16569
retarray->offset = 0;
16570
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16571
@@ -299,7 +297,7 @@
16575
- retarray->base_addr = xmalloc (alloc_size);
16576
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16580
@@ -472,8 +470,7 @@
16581
retarray->offset = 0;
16582
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16584
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16585
- * extent[rank-1];
16586
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16588
if (alloc_size == 0)
16590
@@ -482,7 +479,7 @@
16594
- retarray->base_addr = xmalloc (alloc_size);
16595
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
16599
Index: libgfortran/generated/maxloc1_8_i4.c
16600
===================================================================
16601
--- a/src/libgfortran/generated/maxloc1_8_i4.c (.../tags/gcc_4_8_3_release)
16602
+++ b/src/libgfortran/generated/maxloc1_8_i4.c (.../branches/gcc-4_8-branch)
16604
retarray->offset = 0;
16605
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16607
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16608
- * extent[rank-1];
16609
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16611
- retarray->base_addr = xmalloc (alloc_size);
16612
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16613
if (alloc_size == 0)
16615
/* Make sure we have a zero-sized array. */
16616
@@ -294,8 +293,7 @@
16620
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16621
- * extent[rank-1];
16622
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16624
retarray->offset = 0;
16625
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16626
@@ -307,7 +305,7 @@
16630
- retarray->base_addr = xmalloc (alloc_size);
16631
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16635
@@ -485,8 +483,7 @@
16636
retarray->offset = 0;
16637
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16639
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16640
- * extent[rank-1];
16641
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16643
if (alloc_size == 0)
16645
@@ -495,7 +492,7 @@
16649
- retarray->base_addr = xmalloc (alloc_size);
16650
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16654
Index: libgfortran/generated/unpack_r8.c
16655
===================================================================
16656
--- a/src/libgfortran/generated/unpack_r8.c (.../tags/gcc_4_8_3_release)
16657
+++ b/src/libgfortran/generated/unpack_r8.c (.../branches/gcc-4_8-branch)
16662
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
16663
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
16667
@@ -244,7 +244,7 @@
16671
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_8));
16672
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_8));
16676
Index: libgfortran/generated/maxloc0_4_r4.c
16677
===================================================================
16678
--- a/src/libgfortran/generated/maxloc0_4_r4.c (.../tags/gcc_4_8_3_release)
16679
+++ b/src/libgfortran/generated/maxloc0_4_r4.c (.../branches/gcc-4_8-branch)
16681
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16682
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16683
retarray->offset = 0;
16684
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16685
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16689
@@ -199,7 +199,7 @@
16690
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16691
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16692
retarray->offset = 0;
16693
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16694
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16698
@@ -367,7 +367,7 @@
16699
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16700
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16701
retarray->offset = 0;
16702
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16703
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16705
else if (unlikely (compile_options.bounds_check))
16707
Index: libgfortran/generated/all_l1.c
16708
===================================================================
16709
--- a/src/libgfortran/generated/all_l1.c (.../tags/gcc_4_8_3_release)
16710
+++ b/src/libgfortran/generated/all_l1.c (.../branches/gcc-4_8-branch)
16711
@@ -101,8 +101,7 @@
16712
retarray->offset = 0;
16713
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16715
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16716
- * extent[rank-1];
16717
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16719
if (alloc_size == 0)
16721
@@ -111,7 +110,7 @@
16725
- retarray->base_addr = xmalloc (alloc_size);
16726
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
16730
Index: libgfortran/generated/matmul_r8.c
16731
===================================================================
16732
--- a/src/libgfortran/generated/matmul_r8.c (.../tags/gcc_4_8_3_release)
16733
+++ b/src/libgfortran/generated/matmul_r8.c (.../branches/gcc-4_8-branch)
16734
@@ -124,7 +124,7 @@
16737
retarray->base_addr
16738
- = xmalloc (sizeof (GFC_REAL_8) * size0 ((array_t *) retarray));
16739
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_8));
16740
retarray->offset = 0;
16742
else if (unlikely (compile_options.bounds_check))
16743
Index: libgfortran/generated/minloc0_4_r16.c
16744
===================================================================
16745
--- a/src/libgfortran/generated/minloc0_4_r16.c (.../tags/gcc_4_8_3_release)
16746
+++ b/src/libgfortran/generated/minloc0_4_r16.c (.../branches/gcc-4_8-branch)
16748
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16749
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16750
retarray->offset = 0;
16751
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16752
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16756
@@ -199,7 +199,7 @@
16757
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16758
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16759
retarray->offset = 0;
16760
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16761
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16765
@@ -367,7 +367,7 @@
16766
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16767
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16768
retarray->offset = 0;
16769
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16770
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16772
else if (unlikely (compile_options.bounds_check))
16774
Index: libgfortran/generated/maxloc0_4_i2.c
16775
===================================================================
16776
--- a/src/libgfortran/generated/maxloc0_4_i2.c (.../tags/gcc_4_8_3_release)
16777
+++ b/src/libgfortran/generated/maxloc0_4_i2.c (.../branches/gcc-4_8-branch)
16779
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16780
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16781
retarray->offset = 0;
16782
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16783
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16787
@@ -199,7 +199,7 @@
16788
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16789
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16790
retarray->offset = 0;
16791
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16792
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16796
@@ -367,7 +367,7 @@
16797
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16798
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16799
retarray->offset = 0;
16800
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
16801
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
16803
else if (unlikely (compile_options.bounds_check))
16805
Index: libgfortran/generated/minloc1_8_r16.c
16806
===================================================================
16807
--- a/src/libgfortran/generated/minloc1_8_r16.c (.../tags/gcc_4_8_3_release)
16808
+++ b/src/libgfortran/generated/minloc1_8_r16.c (.../branches/gcc-4_8-branch)
16810
retarray->offset = 0;
16811
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16813
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16814
- * extent[rank-1];
16815
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16817
- retarray->base_addr = xmalloc (alloc_size);
16818
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16819
if (alloc_size == 0)
16821
/* Make sure we have a zero-sized array. */
16822
@@ -294,8 +293,7 @@
16826
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16827
- * extent[rank-1];
16828
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16830
retarray->offset = 0;
16831
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16832
@@ -307,7 +305,7 @@
16836
- retarray->base_addr = xmalloc (alloc_size);
16837
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16841
@@ -485,8 +483,7 @@
16842
retarray->offset = 0;
16843
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16845
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16846
- * extent[rank-1];
16847
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16849
if (alloc_size == 0)
16851
@@ -495,7 +492,7 @@
16855
- retarray->base_addr = xmalloc (alloc_size);
16856
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
16860
Index: libgfortran/generated/pack_c10.c
16861
===================================================================
16862
--- a/src/libgfortran/generated/pack_c10.c (.../tags/gcc_4_8_3_release)
16863
+++ b/src/libgfortran/generated/pack_c10.c (.../branches/gcc-4_8-branch)
16864
@@ -167,8 +167,8 @@
16868
- /* xmalloc allocates a single byte for zero size. */
16869
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_10) * total);
16870
+ /* xmallocarray allocates a single byte for zero size. */
16871
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
16875
Index: libgfortran/generated/pack_r4.c
16876
===================================================================
16877
--- a/src/libgfortran/generated/pack_r4.c (.../tags/gcc_4_8_3_release)
16878
+++ b/src/libgfortran/generated/pack_r4.c (.../branches/gcc-4_8-branch)
16879
@@ -167,8 +167,8 @@
16883
- /* xmalloc allocates a single byte for zero size. */
16884
- ret->base_addr = xmalloc (sizeof (GFC_REAL_4) * total);
16885
+ /* xmallocarray allocates a single byte for zero size. */
16886
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_4));
16890
Index: libgfortran/generated/transpose_c16.c
16891
===================================================================
16892
--- a/src/libgfortran/generated/transpose_c16.c (.../tags/gcc_4_8_3_release)
16893
+++ b/src/libgfortran/generated/transpose_c16.c (.../branches/gcc-4_8-branch)
16895
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
16896
GFC_DESCRIPTOR_EXTENT(source, 1));
16898
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * size0 ((array_t *) ret));
16899
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
16900
+ sizeof (GFC_COMPLEX_16));
16902
} else if (unlikely (compile_options.bounds_check))
16904
Index: libgfortran/generated/maxloc0_8_i8.c
16905
===================================================================
16906
--- a/src/libgfortran/generated/maxloc0_8_i8.c (.../tags/gcc_4_8_3_release)
16907
+++ b/src/libgfortran/generated/maxloc0_8_i8.c (.../branches/gcc-4_8-branch)
16909
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16910
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16911
retarray->offset = 0;
16912
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16913
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16917
@@ -199,7 +199,7 @@
16918
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
16919
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16920
retarray->offset = 0;
16921
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16922
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16926
@@ -367,7 +367,7 @@
16927
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
16928
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
16929
retarray->offset = 0;
16930
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
16931
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
16933
else if (unlikely (compile_options.bounds_check))
16935
Index: libgfortran/generated/minloc1_4_r8.c
16936
===================================================================
16937
--- a/src/libgfortran/generated/minloc1_4_r8.c (.../tags/gcc_4_8_3_release)
16938
+++ b/src/libgfortran/generated/minloc1_4_r8.c (.../branches/gcc-4_8-branch)
16940
retarray->offset = 0;
16941
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16943
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16944
- * extent[rank-1];
16945
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16947
- retarray->base_addr = xmalloc (alloc_size);
16948
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16949
if (alloc_size == 0)
16951
/* Make sure we have a zero-sized array. */
16952
@@ -294,8 +293,7 @@
16956
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16957
- * extent[rank-1];
16958
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16960
retarray->offset = 0;
16961
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16962
@@ -307,7 +305,7 @@
16966
- retarray->base_addr = xmalloc (alloc_size);
16967
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16971
@@ -485,8 +483,7 @@
16972
retarray->offset = 0;
16973
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16975
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16976
- * extent[rank-1];
16977
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
16979
if (alloc_size == 0)
16981
@@ -495,7 +492,7 @@
16985
- retarray->base_addr = xmalloc (alloc_size);
16986
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
16990
Index: libgfortran/generated/minloc1_16_i4.c
16991
===================================================================
16992
--- a/src/libgfortran/generated/minloc1_16_i4.c (.../tags/gcc_4_8_3_release)
16993
+++ b/src/libgfortran/generated/minloc1_16_i4.c (.../branches/gcc-4_8-branch)
16995
retarray->offset = 0;
16996
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
16998
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
16999
- * extent[rank-1];
17000
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17002
- retarray->base_addr = xmalloc (alloc_size);
17003
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17004
if (alloc_size == 0)
17006
/* Make sure we have a zero-sized array. */
17007
@@ -294,8 +293,7 @@
17011
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17012
- * extent[rank-1];
17013
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17015
retarray->offset = 0;
17016
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17017
@@ -307,7 +305,7 @@
17021
- retarray->base_addr = xmalloc (alloc_size);
17022
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17026
@@ -485,8 +483,7 @@
17027
retarray->offset = 0;
17028
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17030
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17031
- * extent[rank-1];
17032
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17034
if (alloc_size == 0)
17036
@@ -495,7 +492,7 @@
17040
- retarray->base_addr = xmalloc (alloc_size);
17041
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17045
Index: libgfortran/generated/minloc0_16_i8.c
17046
===================================================================
17047
--- a/src/libgfortran/generated/minloc0_16_i8.c (.../tags/gcc_4_8_3_release)
17048
+++ b/src/libgfortran/generated/minloc0_16_i8.c (.../branches/gcc-4_8-branch)
17050
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17051
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17052
retarray->offset = 0;
17053
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17054
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17058
@@ -199,7 +199,7 @@
17059
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17060
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17061
retarray->offset = 0;
17062
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17063
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17067
@@ -367,7 +367,7 @@
17068
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17069
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17070
retarray->offset = 0;
17071
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17072
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17074
else if (unlikely (compile_options.bounds_check))
17076
Index: libgfortran/generated/pack_i2.c
17077
===================================================================
17078
--- a/src/libgfortran/generated/pack_i2.c (.../tags/gcc_4_8_3_release)
17079
+++ b/src/libgfortran/generated/pack_i2.c (.../branches/gcc-4_8-branch)
17080
@@ -167,8 +167,8 @@
17084
- /* xmalloc allocates a single byte for zero size. */
17085
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_2) * total);
17086
+ /* xmallocarray allocates a single byte for zero size. */
17087
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_2));
17091
Index: libgfortran/generated/transpose_i8.c
17092
===================================================================
17093
--- a/src/libgfortran/generated/transpose_i8.c (.../tags/gcc_4_8_3_release)
17094
+++ b/src/libgfortran/generated/transpose_i8.c (.../branches/gcc-4_8-branch)
17096
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
17097
GFC_DESCRIPTOR_EXTENT(source, 1));
17099
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) ret));
17100
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
17101
+ sizeof (GFC_INTEGER_8));
17103
} else if (unlikely (compile_options.bounds_check))
17105
Index: libgfortran/generated/eoshift1_16.c
17106
===================================================================
17107
--- a/src/libgfortran/generated/eoshift1_16.c (.../tags/gcc_4_8_3_release)
17108
+++ b/src/libgfortran/generated/eoshift1_16.c (.../branches/gcc-4_8-branch)
17109
@@ -105,8 +105,8 @@
17110
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
17113
- /* xmalloc allocates a single byte for zero size. */
17114
- ret->base_addr = xmalloc (size * arraysize);
17115
+ /* xmallocarray allocates a single byte for zero size. */
17116
+ ret->base_addr = xmallocarray (arraysize, size);
17119
else if (unlikely (compile_options.bounds_check))
17120
Index: libgfortran/generated/all_l2.c
17121
===================================================================
17122
--- a/src/libgfortran/generated/all_l2.c (.../tags/gcc_4_8_3_release)
17123
+++ b/src/libgfortran/generated/all_l2.c (.../branches/gcc-4_8-branch)
17124
@@ -101,8 +101,7 @@
17125
retarray->offset = 0;
17126
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17128
- alloc_size = sizeof (GFC_LOGICAL_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17129
- * extent[rank-1];
17130
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17132
if (alloc_size == 0)
17134
@@ -111,7 +110,7 @@
17138
- retarray->base_addr = xmalloc (alloc_size);
17139
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
17143
Index: libgfortran/generated/product_c4.c
17144
===================================================================
17145
--- a/src/libgfortran/generated/product_c4.c (.../tags/gcc_4_8_3_release)
17146
+++ b/src/libgfortran/generated/product_c4.c (.../branches/gcc-4_8-branch)
17148
retarray->offset = 0;
17149
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17151
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17152
- * extent[rank-1];
17153
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17155
- retarray->base_addr = xmalloc (alloc_size);
17156
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
17157
if (alloc_size == 0)
17159
/* Make sure we have a zero-sized array. */
17160
@@ -272,8 +271,7 @@
17164
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17165
- * extent[rank-1];
17166
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17168
retarray->offset = 0;
17169
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17170
@@ -285,7 +283,7 @@
17174
- retarray->base_addr = xmalloc (alloc_size);
17175
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
17179
@@ -430,8 +428,7 @@
17180
retarray->offset = 0;
17181
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17183
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17184
- * extent[rank-1];
17185
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17187
if (alloc_size == 0)
17189
@@ -440,7 +437,7 @@
17193
- retarray->base_addr = xmalloc (alloc_size);
17194
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
17198
Index: libgfortran/generated/iall_i1.c
17199
===================================================================
17200
--- a/src/libgfortran/generated/iall_i1.c (.../tags/gcc_4_8_3_release)
17201
+++ b/src/libgfortran/generated/iall_i1.c (.../branches/gcc-4_8-branch)
17203
retarray->offset = 0;
17204
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17206
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17207
- * extent[rank-1];
17208
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17210
- retarray->base_addr = xmalloc (alloc_size);
17211
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
17212
if (alloc_size == 0)
17214
/* Make sure we have a zero-sized array. */
17215
@@ -272,8 +271,7 @@
17219
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17220
- * extent[rank-1];
17221
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17223
retarray->offset = 0;
17224
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17225
@@ -285,7 +283,7 @@
17229
- retarray->base_addr = xmalloc (alloc_size);
17230
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
17234
@@ -430,8 +428,7 @@
17235
retarray->offset = 0;
17236
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17238
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17239
- * extent[rank-1];
17240
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17242
if (alloc_size == 0)
17244
@@ -440,7 +437,7 @@
17248
- retarray->base_addr = xmalloc (alloc_size);
17249
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
17253
Index: libgfortran/generated/reshape_i4.c
17254
===================================================================
17255
--- a/src/libgfortran/generated/reshape_i4.c (.../tags/gcc_4_8_3_release)
17256
+++ b/src/libgfortran/generated/reshape_i4.c (.../branches/gcc-4_8-branch)
17257
@@ -111,11 +111,11 @@
17260
if (unlikely (rs < 1))
17264
- alloc_size = rs * sizeof (GFC_INTEGER_4);
17267
- ret->base_addr = xmalloc (alloc_size);
17268
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17269
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
17272
Index: libgfortran/generated/in_pack_r10.c
17273
===================================================================
17274
--- a/src/libgfortran/generated/in_pack_r10.c (.../tags/gcc_4_8_3_release)
17275
+++ b/src/libgfortran/generated/in_pack_r10.c (.../branches/gcc-4_8-branch)
17277
return source->base_addr;
17279
/* Allocate storage for the destination. */
17280
- destptr = (GFC_REAL_10 *)xmalloc (ssize * sizeof (GFC_REAL_10));
17281
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_10));
17283
src = source->base_addr;
17284
stride0 = stride[0];
17285
Index: libgfortran/generated/in_pack_c4.c
17286
===================================================================
17287
--- a/src/libgfortran/generated/in_pack_c4.c (.../tags/gcc_4_8_3_release)
17288
+++ b/src/libgfortran/generated/in_pack_c4.c (.../branches/gcc-4_8-branch)
17290
return source->base_addr;
17292
/* Allocate storage for the destination. */
17293
- destptr = (GFC_COMPLEX_4 *)xmalloc (ssize * sizeof (GFC_COMPLEX_4));
17294
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_4));
17296
src = source->base_addr;
17297
stride0 = stride[0];
17298
Index: libgfortran/generated/all_l16.c
17299
===================================================================
17300
--- a/src/libgfortran/generated/all_l16.c (.../tags/gcc_4_8_3_release)
17301
+++ b/src/libgfortran/generated/all_l16.c (.../branches/gcc-4_8-branch)
17302
@@ -101,8 +101,7 @@
17303
retarray->offset = 0;
17304
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17306
- alloc_size = sizeof (GFC_LOGICAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17307
- * extent[rank-1];
17308
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17310
if (alloc_size == 0)
17312
@@ -111,7 +110,7 @@
17316
- retarray->base_addr = xmalloc (alloc_size);
17317
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
17321
Index: libgfortran/generated/maxloc0_16_i1.c
17322
===================================================================
17323
--- a/src/libgfortran/generated/maxloc0_16_i1.c (.../tags/gcc_4_8_3_release)
17324
+++ b/src/libgfortran/generated/maxloc0_16_i1.c (.../branches/gcc-4_8-branch)
17326
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17327
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17328
retarray->offset = 0;
17329
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17330
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17334
@@ -199,7 +199,7 @@
17335
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17336
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17337
retarray->offset = 0;
17338
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17339
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17343
@@ -367,7 +367,7 @@
17344
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17345
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17346
retarray->offset = 0;
17347
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17348
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17350
else if (unlikely (compile_options.bounds_check))
17352
Index: libgfortran/generated/maxloc1_8_r8.c
17353
===================================================================
17354
--- a/src/libgfortran/generated/maxloc1_8_r8.c (.../tags/gcc_4_8_3_release)
17355
+++ b/src/libgfortran/generated/maxloc1_8_r8.c (.../branches/gcc-4_8-branch)
17357
retarray->offset = 0;
17358
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17360
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17361
- * extent[rank-1];
17362
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17364
- retarray->base_addr = xmalloc (alloc_size);
17365
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17366
if (alloc_size == 0)
17368
/* Make sure we have a zero-sized array. */
17369
@@ -294,8 +293,7 @@
17373
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17374
- * extent[rank-1];
17375
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17377
retarray->offset = 0;
17378
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17379
@@ -307,7 +305,7 @@
17383
- retarray->base_addr = xmalloc (alloc_size);
17384
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17388
@@ -485,8 +483,7 @@
17389
retarray->offset = 0;
17390
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17392
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17393
- * extent[rank-1];
17394
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17396
if (alloc_size == 0)
17398
@@ -495,7 +492,7 @@
17402
- retarray->base_addr = xmalloc (alloc_size);
17403
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17407
Index: libgfortran/generated/minval_i16.c
17408
===================================================================
17409
--- a/src/libgfortran/generated/minval_i16.c (.../tags/gcc_4_8_3_release)
17410
+++ b/src/libgfortran/generated/minval_i16.c (.../branches/gcc-4_8-branch)
17412
retarray->offset = 0;
17413
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17415
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17416
- * extent[rank-1];
17417
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17419
- retarray->base_addr = xmalloc (alloc_size);
17420
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17421
if (alloc_size == 0)
17423
/* Make sure we have a zero-sized array. */
17424
@@ -286,8 +285,7 @@
17428
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17429
- * extent[rank-1];
17430
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17432
retarray->offset = 0;
17433
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17434
@@ -299,7 +297,7 @@
17438
- retarray->base_addr = xmalloc (alloc_size);
17439
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17443
@@ -472,8 +470,7 @@
17444
retarray->offset = 0;
17445
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17447
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17448
- * extent[rank-1];
17449
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17451
if (alloc_size == 0)
17453
@@ -482,7 +479,7 @@
17457
- retarray->base_addr = xmalloc (alloc_size);
17458
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17462
Index: libgfortran/generated/reshape_r10.c
17463
===================================================================
17464
--- a/src/libgfortran/generated/reshape_r10.c (.../tags/gcc_4_8_3_release)
17465
+++ b/src/libgfortran/generated/reshape_r10.c (.../branches/gcc-4_8-branch)
17466
@@ -111,11 +111,11 @@
17469
if (unlikely (rs < 1))
17473
- alloc_size = rs * sizeof (GFC_REAL_10);
17476
- ret->base_addr = xmalloc (alloc_size);
17477
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
17478
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
17481
Index: libgfortran/generated/unpack_r16.c
17482
===================================================================
17483
--- a/src/libgfortran/generated/unpack_r16.c (.../tags/gcc_4_8_3_release)
17484
+++ b/src/libgfortran/generated/unpack_r16.c (.../branches/gcc-4_8-branch)
17489
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
17490
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
17494
@@ -244,7 +244,7 @@
17498
- ret->base_addr = xmalloc (rs * sizeof (GFC_REAL_16));
17499
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_REAL_16));
17503
Index: libgfortran/generated/maxval_i4.c
17504
===================================================================
17505
--- a/src/libgfortran/generated/maxval_i4.c (.../tags/gcc_4_8_3_release)
17506
+++ b/src/libgfortran/generated/maxval_i4.c (.../branches/gcc-4_8-branch)
17508
retarray->offset = 0;
17509
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17511
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17512
- * extent[rank-1];
17513
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17515
- retarray->base_addr = xmalloc (alloc_size);
17516
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17517
if (alloc_size == 0)
17519
/* Make sure we have a zero-sized array. */
17520
@@ -286,8 +285,7 @@
17524
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17525
- * extent[rank-1];
17526
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17528
retarray->offset = 0;
17529
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17530
@@ -299,7 +297,7 @@
17534
- retarray->base_addr = xmalloc (alloc_size);
17535
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17539
@@ -472,8 +470,7 @@
17540
retarray->offset = 0;
17541
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17543
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17544
- * extent[rank-1];
17545
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17547
if (alloc_size == 0)
17549
@@ -482,7 +479,7 @@
17553
- retarray->base_addr = xmalloc (alloc_size);
17554
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17558
Index: libgfortran/generated/minval_i8.c
17559
===================================================================
17560
--- a/src/libgfortran/generated/minval_i8.c (.../tags/gcc_4_8_3_release)
17561
+++ b/src/libgfortran/generated/minval_i8.c (.../branches/gcc-4_8-branch)
17563
retarray->offset = 0;
17564
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17566
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17567
- * extent[rank-1];
17568
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17570
- retarray->base_addr = xmalloc (alloc_size);
17571
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17572
if (alloc_size == 0)
17574
/* Make sure we have a zero-sized array. */
17575
@@ -286,8 +285,7 @@
17579
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17580
- * extent[rank-1];
17581
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17583
retarray->offset = 0;
17584
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17585
@@ -299,7 +297,7 @@
17589
- retarray->base_addr = xmalloc (alloc_size);
17590
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17594
@@ -472,8 +470,7 @@
17595
retarray->offset = 0;
17596
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17598
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17599
- * extent[rank-1];
17600
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17602
if (alloc_size == 0)
17604
@@ -482,7 +479,7 @@
17608
- retarray->base_addr = xmalloc (alloc_size);
17609
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17613
Index: libgfortran/generated/maxloc0_16_i16.c
17614
===================================================================
17615
--- a/src/libgfortran/generated/maxloc0_16_i16.c (.../tags/gcc_4_8_3_release)
17616
+++ b/src/libgfortran/generated/maxloc0_16_i16.c (.../branches/gcc-4_8-branch)
17618
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17619
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17620
retarray->offset = 0;
17621
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17622
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17626
@@ -199,7 +199,7 @@
17627
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17628
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17629
retarray->offset = 0;
17630
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17631
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17635
@@ -367,7 +367,7 @@
17636
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17637
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17638
retarray->offset = 0;
17639
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17640
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17642
else if (unlikely (compile_options.bounds_check))
17644
Index: libgfortran/generated/shape_i4.c
17645
===================================================================
17646
--- a/src/libgfortran/generated/shape_i4.c (.../tags/gcc_4_8_3_release)
17647
+++ b/src/libgfortran/generated/shape_i4.c (.../branches/gcc-4_8-branch)
17650
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
17652
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17653
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17656
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
17657
Index: libgfortran/generated/minloc1_4_i16.c
17658
===================================================================
17659
--- a/src/libgfortran/generated/minloc1_4_i16.c (.../tags/gcc_4_8_3_release)
17660
+++ b/src/libgfortran/generated/minloc1_4_i16.c (.../branches/gcc-4_8-branch)
17662
retarray->offset = 0;
17663
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17665
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17666
- * extent[rank-1];
17667
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17669
- retarray->base_addr = xmalloc (alloc_size);
17670
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17671
if (alloc_size == 0)
17673
/* Make sure we have a zero-sized array. */
17674
@@ -294,8 +293,7 @@
17678
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17679
- * extent[rank-1];
17680
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17682
retarray->offset = 0;
17683
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17684
@@ -307,7 +305,7 @@
17688
- retarray->base_addr = xmalloc (alloc_size);
17689
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17693
@@ -485,8 +483,7 @@
17694
retarray->offset = 0;
17695
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17697
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17698
- * extent[rank-1];
17699
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17701
if (alloc_size == 0)
17703
@@ -495,7 +492,7 @@
17707
- retarray->base_addr = xmalloc (alloc_size);
17708
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
17712
Index: libgfortran/generated/maxloc0_4_r10.c
17713
===================================================================
17714
--- a/src/libgfortran/generated/maxloc0_4_r10.c (.../tags/gcc_4_8_3_release)
17715
+++ b/src/libgfortran/generated/maxloc0_4_r10.c (.../branches/gcc-4_8-branch)
17717
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17718
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17719
retarray->offset = 0;
17720
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17721
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17725
@@ -199,7 +199,7 @@
17726
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17727
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17728
retarray->offset = 0;
17729
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17730
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17734
@@ -367,7 +367,7 @@
17735
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17736
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17737
retarray->offset = 0;
17738
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
17739
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
17741
else if (unlikely (compile_options.bounds_check))
17743
Index: libgfortran/generated/maxloc0_8_i16.c
17744
===================================================================
17745
--- a/src/libgfortran/generated/maxloc0_8_i16.c (.../tags/gcc_4_8_3_release)
17746
+++ b/src/libgfortran/generated/maxloc0_8_i16.c (.../branches/gcc-4_8-branch)
17748
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17749
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17750
retarray->offset = 0;
17751
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17752
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17756
@@ -199,7 +199,7 @@
17757
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17758
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17759
retarray->offset = 0;
17760
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17761
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17765
@@ -367,7 +367,7 @@
17766
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17767
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17768
retarray->offset = 0;
17769
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17770
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17772
else if (unlikely (compile_options.bounds_check))
17774
Index: libgfortran/generated/iall_i2.c
17775
===================================================================
17776
--- a/src/libgfortran/generated/iall_i2.c (.../tags/gcc_4_8_3_release)
17777
+++ b/src/libgfortran/generated/iall_i2.c (.../branches/gcc-4_8-branch)
17779
retarray->offset = 0;
17780
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17782
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17783
- * extent[rank-1];
17784
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17786
- retarray->base_addr = xmalloc (alloc_size);
17787
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
17788
if (alloc_size == 0)
17790
/* Make sure we have a zero-sized array. */
17791
@@ -272,8 +271,7 @@
17795
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17796
- * extent[rank-1];
17797
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17799
retarray->offset = 0;
17800
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17801
@@ -285,7 +283,7 @@
17805
- retarray->base_addr = xmalloc (alloc_size);
17806
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
17810
@@ -430,8 +428,7 @@
17811
retarray->offset = 0;
17812
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17814
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17815
- * extent[rank-1];
17816
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17818
if (alloc_size == 0)
17820
@@ -440,7 +437,7 @@
17824
- retarray->base_addr = xmalloc (alloc_size);
17825
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
17829
Index: libgfortran/generated/maxloc1_8_r10.c
17830
===================================================================
17831
--- a/src/libgfortran/generated/maxloc1_8_r10.c (.../tags/gcc_4_8_3_release)
17832
+++ b/src/libgfortran/generated/maxloc1_8_r10.c (.../branches/gcc-4_8-branch)
17834
retarray->offset = 0;
17835
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17837
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17838
- * extent[rank-1];
17839
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17841
- retarray->base_addr = xmalloc (alloc_size);
17842
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17843
if (alloc_size == 0)
17845
/* Make sure we have a zero-sized array. */
17846
@@ -294,8 +293,7 @@
17850
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17851
- * extent[rank-1];
17852
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17854
retarray->offset = 0;
17855
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17856
@@ -307,7 +305,7 @@
17860
- retarray->base_addr = xmalloc (alloc_size);
17861
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17865
@@ -485,8 +483,7 @@
17866
retarray->offset = 0;
17867
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17869
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17870
- * extent[rank-1];
17871
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17873
if (alloc_size == 0)
17875
@@ -495,7 +492,7 @@
17879
- retarray->base_addr = xmalloc (alloc_size);
17880
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
17884
Index: libgfortran/generated/maxloc0_16_r4.c
17885
===================================================================
17886
--- a/src/libgfortran/generated/maxloc0_16_r4.c (.../tags/gcc_4_8_3_release)
17887
+++ b/src/libgfortran/generated/maxloc0_16_r4.c (.../branches/gcc-4_8-branch)
17889
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17890
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17891
retarray->offset = 0;
17892
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17893
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17897
@@ -199,7 +199,7 @@
17898
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17899
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17900
retarray->offset = 0;
17901
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17902
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17906
@@ -367,7 +367,7 @@
17907
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17908
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17909
retarray->offset = 0;
17910
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
17911
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
17913
else if (unlikely (compile_options.bounds_check))
17915
Index: libgfortran/generated/minloc0_8_i1.c
17916
===================================================================
17917
--- a/src/libgfortran/generated/minloc0_8_i1.c (.../tags/gcc_4_8_3_release)
17918
+++ b/src/libgfortran/generated/minloc0_8_i1.c (.../branches/gcc-4_8-branch)
17920
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17921
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17922
retarray->offset = 0;
17923
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17924
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17928
@@ -199,7 +199,7 @@
17929
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
17930
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17931
retarray->offset = 0;
17932
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17933
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17937
@@ -367,7 +367,7 @@
17938
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
17939
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
17940
retarray->offset = 0;
17941
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
17942
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
17944
else if (unlikely (compile_options.bounds_check))
17946
Index: libgfortran/generated/minloc1_16_r8.c
17947
===================================================================
17948
--- a/src/libgfortran/generated/minloc1_16_r8.c (.../tags/gcc_4_8_3_release)
17949
+++ b/src/libgfortran/generated/minloc1_16_r8.c (.../branches/gcc-4_8-branch)
17951
retarray->offset = 0;
17952
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17954
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17955
- * extent[rank-1];
17956
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17958
- retarray->base_addr = xmalloc (alloc_size);
17959
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17960
if (alloc_size == 0)
17962
/* Make sure we have a zero-sized array. */
17963
@@ -294,8 +293,7 @@
17967
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17968
- * extent[rank-1];
17969
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17971
retarray->offset = 0;
17972
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17973
@@ -307,7 +305,7 @@
17977
- retarray->base_addr = xmalloc (alloc_size);
17978
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
17982
@@ -485,8 +483,7 @@
17983
retarray->offset = 0;
17984
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
17986
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
17987
- * extent[rank-1];
17988
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
17990
if (alloc_size == 0)
17992
@@ -495,7 +492,7 @@
17996
- retarray->base_addr = xmalloc (alloc_size);
17997
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18001
Index: libgfortran/generated/unpack_i8.c
18002
===================================================================
18003
--- a/src/libgfortran/generated/unpack_i8.c (.../tags/gcc_4_8_3_release)
18004
+++ b/src/libgfortran/generated/unpack_i8.c (.../branches/gcc-4_8-branch)
18009
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
18010
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
18014
@@ -244,7 +244,7 @@
18018
- ret->base_addr = xmalloc (rs * sizeof (GFC_INTEGER_8));
18019
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_8));
18023
Index: libgfortran/generated/maxloc0_4_i4.c
18024
===================================================================
18025
--- a/src/libgfortran/generated/maxloc0_4_i4.c (.../tags/gcc_4_8_3_release)
18026
+++ b/src/libgfortran/generated/maxloc0_4_i4.c (.../branches/gcc-4_8-branch)
18028
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18029
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18030
retarray->offset = 0;
18031
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18032
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18036
@@ -199,7 +199,7 @@
18037
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18038
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18039
retarray->offset = 0;
18040
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18041
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18045
@@ -367,7 +367,7 @@
18046
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18047
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18048
retarray->offset = 0;
18049
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
18050
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
18052
else if (unlikely (compile_options.bounds_check))
18054
Index: libgfortran/generated/count_4_l.c
18055
===================================================================
18056
--- a/src/libgfortran/generated/count_4_l.c (.../tags/gcc_4_8_3_release)
18057
+++ b/src/libgfortran/generated/count_4_l.c (.../branches/gcc-4_8-branch)
18058
@@ -101,8 +101,7 @@
18059
retarray->offset = 0;
18060
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18062
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18063
- * extent[rank-1];
18064
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18066
if (alloc_size == 0)
18068
@@ -111,7 +110,7 @@
18072
- retarray->base_addr = xmalloc (alloc_size);
18073
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18077
Index: libgfortran/generated/sum_r10.c
18078
===================================================================
18079
--- a/src/libgfortran/generated/sum_r10.c (.../tags/gcc_4_8_3_release)
18080
+++ b/src/libgfortran/generated/sum_r10.c (.../branches/gcc-4_8-branch)
18082
retarray->offset = 0;
18083
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18085
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18086
- * extent[rank-1];
18087
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18089
- retarray->base_addr = xmalloc (alloc_size);
18090
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18091
if (alloc_size == 0)
18093
/* Make sure we have a zero-sized array. */
18094
@@ -272,8 +271,7 @@
18098
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18099
- * extent[rank-1];
18100
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18102
retarray->offset = 0;
18103
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18104
@@ -285,7 +283,7 @@
18108
- retarray->base_addr = xmalloc (alloc_size);
18109
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18113
@@ -430,8 +428,7 @@
18114
retarray->offset = 0;
18115
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18117
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18118
- * extent[rank-1];
18119
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18121
if (alloc_size == 0)
18123
@@ -440,7 +437,7 @@
18127
- retarray->base_addr = xmalloc (alloc_size);
18128
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18132
Index: libgfortran/generated/sum_c4.c
18133
===================================================================
18134
--- a/src/libgfortran/generated/sum_c4.c (.../tags/gcc_4_8_3_release)
18135
+++ b/src/libgfortran/generated/sum_c4.c (.../branches/gcc-4_8-branch)
18137
retarray->offset = 0;
18138
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18140
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18141
- * extent[rank-1];
18142
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18144
- retarray->base_addr = xmalloc (alloc_size);
18145
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
18146
if (alloc_size == 0)
18148
/* Make sure we have a zero-sized array. */
18149
@@ -272,8 +271,7 @@
18153
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18154
- * extent[rank-1];
18155
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18157
retarray->offset = 0;
18158
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18159
@@ -285,7 +283,7 @@
18163
- retarray->base_addr = xmalloc (alloc_size);
18164
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
18168
@@ -430,8 +428,7 @@
18169
retarray->offset = 0;
18170
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18172
- alloc_size = sizeof (GFC_COMPLEX_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18173
- * extent[rank-1];
18174
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18176
if (alloc_size == 0)
18178
@@ -440,7 +437,7 @@
18182
- retarray->base_addr = xmalloc (alloc_size);
18183
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
18187
Index: libgfortran/generated/maxloc1_16_r10.c
18188
===================================================================
18189
--- a/src/libgfortran/generated/maxloc1_16_r10.c (.../tags/gcc_4_8_3_release)
18190
+++ b/src/libgfortran/generated/maxloc1_16_r10.c (.../branches/gcc-4_8-branch)
18192
retarray->offset = 0;
18193
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18195
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18196
- * extent[rank-1];
18197
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18199
- retarray->base_addr = xmalloc (alloc_size);
18200
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18201
if (alloc_size == 0)
18203
/* Make sure we have a zero-sized array. */
18204
@@ -294,8 +293,7 @@
18208
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18209
- * extent[rank-1];
18210
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18212
retarray->offset = 0;
18213
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18214
@@ -307,7 +305,7 @@
18218
- retarray->base_addr = xmalloc (alloc_size);
18219
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18223
@@ -485,8 +483,7 @@
18224
retarray->offset = 0;
18225
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18227
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18228
- * extent[rank-1];
18229
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18231
if (alloc_size == 0)
18233
@@ -495,7 +492,7 @@
18237
- retarray->base_addr = xmalloc (alloc_size);
18238
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18242
Index: libgfortran/generated/pack_i16.c
18243
===================================================================
18244
--- a/src/libgfortran/generated/pack_i16.c (.../tags/gcc_4_8_3_release)
18245
+++ b/src/libgfortran/generated/pack_i16.c (.../branches/gcc-4_8-branch)
18246
@@ -167,8 +167,8 @@
18250
- /* xmalloc allocates a single byte for zero size. */
18251
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
18252
+ /* xmallocarray allocates a single byte for zero size. */
18253
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
18257
Index: libgfortran/generated/matmul_i8.c
18258
===================================================================
18259
--- a/src/libgfortran/generated/matmul_i8.c (.../tags/gcc_4_8_3_release)
18260
+++ b/src/libgfortran/generated/matmul_i8.c (.../branches/gcc-4_8-branch)
18261
@@ -124,7 +124,7 @@
18264
retarray->base_addr
18265
- = xmalloc (sizeof (GFC_INTEGER_8) * size0 ((array_t *) retarray));
18266
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_8));
18267
retarray->offset = 0;
18269
else if (unlikely (compile_options.bounds_check))
18270
Index: libgfortran/generated/maxloc0_16_i2.c
18271
===================================================================
18272
--- a/src/libgfortran/generated/maxloc0_16_i2.c (.../tags/gcc_4_8_3_release)
18273
+++ b/src/libgfortran/generated/maxloc0_16_i2.c (.../branches/gcc-4_8-branch)
18275
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18276
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18277
retarray->offset = 0;
18278
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18279
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18283
@@ -199,7 +199,7 @@
18284
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18285
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18286
retarray->offset = 0;
18287
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18288
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18292
@@ -367,7 +367,7 @@
18293
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18294
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18295
retarray->offset = 0;
18296
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
18297
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
18299
else if (unlikely (compile_options.bounds_check))
18301
Index: libgfortran/generated/spread_c4.c
18302
===================================================================
18303
--- a/src/libgfortran/generated/spread_c4.c (.../tags/gcc_4_8_3_release)
18304
+++ b/src/libgfortran/generated/spread_c4.c (.../branches/gcc-4_8-branch)
18305
@@ -101,8 +101,8 @@
18309
- /* xmalloc allocates a single byte for zero size. */
18310
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_4));
18311
+ /* xmallocarray allocates a single byte for zero size. */
18312
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_4));
18316
@@ -244,7 +244,7 @@
18318
if (ret->base_addr == NULL)
18320
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_4));
18321
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_4));
18323
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
18325
Index: libgfortran/generated/maxval_r10.c
18326
===================================================================
18327
--- a/src/libgfortran/generated/maxval_r10.c (.../tags/gcc_4_8_3_release)
18328
+++ b/src/libgfortran/generated/maxval_r10.c (.../branches/gcc-4_8-branch)
18330
retarray->offset = 0;
18331
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18333
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18334
- * extent[rank-1];
18335
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18337
- retarray->base_addr = xmalloc (alloc_size);
18338
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18339
if (alloc_size == 0)
18341
/* Make sure we have a zero-sized array. */
18342
@@ -286,8 +285,7 @@
18346
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18347
- * extent[rank-1];
18348
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18350
retarray->offset = 0;
18351
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18352
@@ -299,7 +297,7 @@
18356
- retarray->base_addr = xmalloc (alloc_size);
18357
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18361
@@ -472,8 +470,7 @@
18362
retarray->offset = 0;
18363
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18365
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18366
- * extent[rank-1];
18367
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18369
if (alloc_size == 0)
18371
@@ -482,7 +479,7 @@
18375
- retarray->base_addr = xmalloc (alloc_size);
18376
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
18380
Index: libgfortran/generated/pack_i4.c
18381
===================================================================
18382
--- a/src/libgfortran/generated/pack_i4.c (.../tags/gcc_4_8_3_release)
18383
+++ b/src/libgfortran/generated/pack_i4.c (.../branches/gcc-4_8-branch)
18384
@@ -167,8 +167,8 @@
18388
- /* xmalloc allocates a single byte for zero size. */
18389
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * total);
18390
+ /* xmallocarray allocates a single byte for zero size. */
18391
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_4));
18395
Index: libgfortran/generated/maxloc1_4_i1.c
18396
===================================================================
18397
--- a/src/libgfortran/generated/maxloc1_4_i1.c (.../tags/gcc_4_8_3_release)
18398
+++ b/src/libgfortran/generated/maxloc1_4_i1.c (.../branches/gcc-4_8-branch)
18400
retarray->offset = 0;
18401
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18403
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18404
- * extent[rank-1];
18405
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18407
- retarray->base_addr = xmalloc (alloc_size);
18408
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18409
if (alloc_size == 0)
18411
/* Make sure we have a zero-sized array. */
18412
@@ -294,8 +293,7 @@
18416
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18417
- * extent[rank-1];
18418
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18420
retarray->offset = 0;
18421
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18422
@@ -307,7 +305,7 @@
18426
- retarray->base_addr = xmalloc (alloc_size);
18427
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18431
@@ -485,8 +483,7 @@
18432
retarray->offset = 0;
18433
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18435
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18436
- * extent[rank-1];
18437
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18439
if (alloc_size == 0)
18441
@@ -495,7 +492,7 @@
18445
- retarray->base_addr = xmalloc (alloc_size);
18446
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18450
Index: libgfortran/generated/matmul_r10.c
18451
===================================================================
18452
--- a/src/libgfortran/generated/matmul_r10.c (.../tags/gcc_4_8_3_release)
18453
+++ b/src/libgfortran/generated/matmul_r10.c (.../branches/gcc-4_8-branch)
18454
@@ -124,7 +124,7 @@
18457
retarray->base_addr
18458
- = xmalloc (sizeof (GFC_REAL_10) * size0 ((array_t *) retarray));
18459
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_REAL_10));
18460
retarray->offset = 0;
18462
else if (unlikely (compile_options.bounds_check))
18463
Index: libgfortran/generated/minloc1_4_i8.c
18464
===================================================================
18465
--- a/src/libgfortran/generated/minloc1_4_i8.c (.../tags/gcc_4_8_3_release)
18466
+++ b/src/libgfortran/generated/minloc1_4_i8.c (.../branches/gcc-4_8-branch)
18468
retarray->offset = 0;
18469
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18471
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18472
- * extent[rank-1];
18473
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18475
- retarray->base_addr = xmalloc (alloc_size);
18476
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18477
if (alloc_size == 0)
18479
/* Make sure we have a zero-sized array. */
18480
@@ -294,8 +293,7 @@
18484
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18485
- * extent[rank-1];
18486
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18488
retarray->offset = 0;
18489
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18490
@@ -307,7 +305,7 @@
18494
- retarray->base_addr = xmalloc (alloc_size);
18495
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18499
@@ -485,8 +483,7 @@
18500
retarray->offset = 0;
18501
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18503
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18504
- * extent[rank-1];
18505
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18507
if (alloc_size == 0)
18509
@@ -495,7 +492,7 @@
18513
- retarray->base_addr = xmalloc (alloc_size);
18514
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18518
Index: libgfortran/generated/minloc0_8_r4.c
18519
===================================================================
18520
--- a/src/libgfortran/generated/minloc0_8_r4.c (.../tags/gcc_4_8_3_release)
18521
+++ b/src/libgfortran/generated/minloc0_8_r4.c (.../branches/gcc-4_8-branch)
18523
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18524
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18525
retarray->offset = 0;
18526
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18527
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18531
@@ -199,7 +199,7 @@
18532
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18533
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18534
retarray->offset = 0;
18535
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18536
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18540
@@ -367,7 +367,7 @@
18541
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18542
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18543
retarray->offset = 0;
18544
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18545
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18547
else if (unlikely (compile_options.bounds_check))
18549
Index: libgfortran/generated/matmul_l4.c
18550
===================================================================
18551
--- a/src/libgfortran/generated/matmul_l4.c (.../tags/gcc_4_8_3_release)
18552
+++ b/src/libgfortran/generated/matmul_l4.c (.../branches/gcc-4_8-branch)
18556
retarray->base_addr
18557
- = xmalloc (sizeof (GFC_LOGICAL_4) * size0 ((array_t *) retarray));
18558
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_4));
18559
retarray->offset = 0;
18561
else if (unlikely (compile_options.bounds_check))
18562
Index: libgfortran/generated/reshape_r8.c
18563
===================================================================
18564
--- a/src/libgfortran/generated/reshape_r8.c (.../tags/gcc_4_8_3_release)
18565
+++ b/src/libgfortran/generated/reshape_r8.c (.../branches/gcc-4_8-branch)
18566
@@ -111,11 +111,11 @@
18569
if (unlikely (rs < 1))
18573
- alloc_size = rs * sizeof (GFC_REAL_8);
18576
- ret->base_addr = xmalloc (alloc_size);
18577
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18578
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
18581
Index: libgfortran/generated/in_pack_c10.c
18582
===================================================================
18583
--- a/src/libgfortran/generated/in_pack_c10.c (.../tags/gcc_4_8_3_release)
18584
+++ b/src/libgfortran/generated/in_pack_c10.c (.../branches/gcc-4_8-branch)
18586
return source->base_addr;
18588
/* Allocate storage for the destination. */
18589
- destptr = (GFC_COMPLEX_10 *)xmalloc (ssize * sizeof (GFC_COMPLEX_10));
18590
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_10));
18592
src = source->base_addr;
18593
stride0 = stride[0];
18594
Index: libgfortran/generated/all_l4.c
18595
===================================================================
18596
--- a/src/libgfortran/generated/all_l4.c (.../tags/gcc_4_8_3_release)
18597
+++ b/src/libgfortran/generated/all_l4.c (.../branches/gcc-4_8-branch)
18598
@@ -101,8 +101,7 @@
18599
retarray->offset = 0;
18600
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18602
- alloc_size = sizeof (GFC_LOGICAL_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18603
- * extent[rank-1];
18604
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18606
if (alloc_size == 0)
18608
@@ -111,7 +110,7 @@
18612
- retarray->base_addr = xmalloc (alloc_size);
18613
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
18617
Index: libgfortran/generated/minloc0_8_i2.c
18618
===================================================================
18619
--- a/src/libgfortran/generated/minloc0_8_i2.c (.../tags/gcc_4_8_3_release)
18620
+++ b/src/libgfortran/generated/minloc0_8_i2.c (.../branches/gcc-4_8-branch)
18622
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18623
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18624
retarray->offset = 0;
18625
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18626
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18630
@@ -199,7 +199,7 @@
18631
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
18632
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18633
retarray->offset = 0;
18634
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18635
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18639
@@ -367,7 +367,7 @@
18640
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
18641
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
18642
retarray->offset = 0;
18643
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
18644
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
18646
else if (unlikely (compile_options.bounds_check))
18648
Index: libgfortran/generated/norm2_r16.c
18649
===================================================================
18650
--- a/src/libgfortran/generated/norm2_r16.c (.../tags/gcc_4_8_3_release)
18651
+++ b/src/libgfortran/generated/norm2_r16.c (.../branches/gcc-4_8-branch)
18652
@@ -105,10 +105,9 @@
18653
retarray->offset = 0;
18654
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18656
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18657
- * extent[rank-1];
18658
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18660
- retarray->base_addr = xmalloc (alloc_size);
18661
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
18662
if (alloc_size == 0)
18664
/* Make sure we have a zero-sized array. */
18665
Index: libgfortran/generated/reshape_c10.c
18666
===================================================================
18667
--- a/src/libgfortran/generated/reshape_c10.c (.../tags/gcc_4_8_3_release)
18668
+++ b/src/libgfortran/generated/reshape_c10.c (.../branches/gcc-4_8-branch)
18669
@@ -111,11 +111,11 @@
18672
if (unlikely (rs < 1))
18676
- alloc_size = rs * sizeof (GFC_COMPLEX_10);
18679
- ret->base_addr = xmalloc (alloc_size);
18680
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
18681
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
18684
Index: libgfortran/generated/unpack_c16.c
18685
===================================================================
18686
--- a/src/libgfortran/generated/unpack_c16.c (.../tags/gcc_4_8_3_release)
18687
+++ b/src/libgfortran/generated/unpack_c16.c (.../branches/gcc-4_8-branch)
18692
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
18693
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
18697
@@ -244,7 +244,7 @@
18701
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
18702
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
18706
Index: libgfortran/generated/maxloc1_4_r4.c
18707
===================================================================
18708
--- a/src/libgfortran/generated/maxloc1_4_r4.c (.../tags/gcc_4_8_3_release)
18709
+++ b/src/libgfortran/generated/maxloc1_4_r4.c (.../branches/gcc-4_8-branch)
18711
retarray->offset = 0;
18712
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18714
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18715
- * extent[rank-1];
18716
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18718
- retarray->base_addr = xmalloc (alloc_size);
18719
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18720
if (alloc_size == 0)
18722
/* Make sure we have a zero-sized array. */
18723
@@ -294,8 +293,7 @@
18727
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18728
- * extent[rank-1];
18729
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18731
retarray->offset = 0;
18732
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18733
@@ -307,7 +305,7 @@
18737
- retarray->base_addr = xmalloc (alloc_size);
18738
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18742
@@ -485,8 +483,7 @@
18743
retarray->offset = 0;
18744
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18746
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18747
- * extent[rank-1];
18748
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18750
if (alloc_size == 0)
18752
@@ -495,7 +492,7 @@
18756
- retarray->base_addr = xmalloc (alloc_size);
18757
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18761
Index: libgfortran/generated/maxval_r8.c
18762
===================================================================
18763
--- a/src/libgfortran/generated/maxval_r8.c (.../tags/gcc_4_8_3_release)
18764
+++ b/src/libgfortran/generated/maxval_r8.c (.../branches/gcc-4_8-branch)
18766
retarray->offset = 0;
18767
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18769
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18770
- * extent[rank-1];
18771
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18773
- retarray->base_addr = xmalloc (alloc_size);
18774
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18775
if (alloc_size == 0)
18777
/* Make sure we have a zero-sized array. */
18778
@@ -286,8 +285,7 @@
18782
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18783
- * extent[rank-1];
18784
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18786
retarray->offset = 0;
18787
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18788
@@ -299,7 +297,7 @@
18792
- retarray->base_addr = xmalloc (alloc_size);
18793
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18797
@@ -472,8 +470,7 @@
18798
retarray->offset = 0;
18799
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18801
- alloc_size = sizeof (GFC_REAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18802
- * extent[rank-1];
18803
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18805
if (alloc_size == 0)
18807
@@ -482,7 +479,7 @@
18811
- retarray->base_addr = xmalloc (alloc_size);
18812
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
18816
Index: libgfortran/generated/transpose_c4.c
18817
===================================================================
18818
--- a/src/libgfortran/generated/transpose_c4.c (.../tags/gcc_4_8_3_release)
18819
+++ b/src/libgfortran/generated/transpose_c4.c (.../branches/gcc-4_8-branch)
18821
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
18822
GFC_DESCRIPTOR_EXTENT(source, 1));
18824
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) ret));
18825
+ ret->base_addr = xmallocarray (size0 ((array_t *) ret),
18826
+ sizeof (GFC_COMPLEX_4));
18828
} else if (unlikely (compile_options.bounds_check))
18830
Index: libgfortran/generated/eoshift1_4.c
18831
===================================================================
18832
--- a/src/libgfortran/generated/eoshift1_4.c (.../tags/gcc_4_8_3_release)
18833
+++ b/src/libgfortran/generated/eoshift1_4.c (.../branches/gcc-4_8-branch)
18834
@@ -105,8 +105,8 @@
18835
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
18838
- /* xmalloc allocates a single byte for zero size. */
18839
- ret->base_addr = xmalloc (size * arraysize);
18840
+ /* xmallocarray allocates a single byte for zero size. */
18841
+ ret->base_addr = xmallocarray (arraysize, size);
18844
else if (unlikely (compile_options.bounds_check))
18845
Index: libgfortran/generated/minval_r16.c
18846
===================================================================
18847
--- a/src/libgfortran/generated/minval_r16.c (.../tags/gcc_4_8_3_release)
18848
+++ b/src/libgfortran/generated/minval_r16.c (.../branches/gcc-4_8-branch)
18850
retarray->offset = 0;
18851
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18853
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18854
- * extent[rank-1];
18855
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18857
- retarray->base_addr = xmalloc (alloc_size);
18858
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
18859
if (alloc_size == 0)
18861
/* Make sure we have a zero-sized array. */
18862
@@ -286,8 +285,7 @@
18866
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18867
- * extent[rank-1];
18868
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18870
retarray->offset = 0;
18871
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18872
@@ -299,7 +297,7 @@
18876
- retarray->base_addr = xmalloc (alloc_size);
18877
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
18881
@@ -472,8 +470,7 @@
18882
retarray->offset = 0;
18883
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18885
- alloc_size = sizeof (GFC_REAL_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18886
- * extent[rank-1];
18887
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18889
if (alloc_size == 0)
18891
@@ -482,7 +479,7 @@
18895
- retarray->base_addr = xmalloc (alloc_size);
18896
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
18900
Index: libgfortran/generated/iany_i16.c
18901
===================================================================
18902
--- a/src/libgfortran/generated/iany_i16.c (.../tags/gcc_4_8_3_release)
18903
+++ b/src/libgfortran/generated/iany_i16.c (.../branches/gcc-4_8-branch)
18905
retarray->offset = 0;
18906
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18908
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18909
- * extent[rank-1];
18910
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18912
- retarray->base_addr = xmalloc (alloc_size);
18913
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18914
if (alloc_size == 0)
18916
/* Make sure we have a zero-sized array. */
18917
@@ -272,8 +271,7 @@
18921
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18922
- * extent[rank-1];
18923
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18925
retarray->offset = 0;
18926
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18927
@@ -285,7 +283,7 @@
18931
- retarray->base_addr = xmalloc (alloc_size);
18932
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18936
@@ -430,8 +428,7 @@
18937
retarray->offset = 0;
18938
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18940
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18941
- * extent[rank-1];
18942
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18944
if (alloc_size == 0)
18946
@@ -440,7 +437,7 @@
18950
- retarray->base_addr = xmalloc (alloc_size);
18951
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
18955
Index: libgfortran/generated/maxloc1_4_i2.c
18956
===================================================================
18957
--- a/src/libgfortran/generated/maxloc1_4_i2.c (.../tags/gcc_4_8_3_release)
18958
+++ b/src/libgfortran/generated/maxloc1_4_i2.c (.../branches/gcc-4_8-branch)
18960
retarray->offset = 0;
18961
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18963
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18964
- * extent[rank-1];
18965
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18967
- retarray->base_addr = xmalloc (alloc_size);
18968
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18969
if (alloc_size == 0)
18971
/* Make sure we have a zero-sized array. */
18972
@@ -294,8 +293,7 @@
18976
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18977
- * extent[rank-1];
18978
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18980
retarray->offset = 0;
18981
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18982
@@ -307,7 +305,7 @@
18986
- retarray->base_addr = xmalloc (alloc_size);
18987
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
18991
@@ -485,8 +483,7 @@
18992
retarray->offset = 0;
18993
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
18995
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
18996
- * extent[rank-1];
18997
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
18999
if (alloc_size == 0)
19001
@@ -495,7 +492,7 @@
19005
- retarray->base_addr = xmalloc (alloc_size);
19006
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19010
Index: libgfortran/generated/maxloc1_8_i8.c
19011
===================================================================
19012
--- a/src/libgfortran/generated/maxloc1_8_i8.c (.../tags/gcc_4_8_3_release)
19013
+++ b/src/libgfortran/generated/maxloc1_8_i8.c (.../branches/gcc-4_8-branch)
19015
retarray->offset = 0;
19016
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19018
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19019
- * extent[rank-1];
19020
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19022
- retarray->base_addr = xmalloc (alloc_size);
19023
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19024
if (alloc_size == 0)
19026
/* Make sure we have a zero-sized array. */
19027
@@ -294,8 +293,7 @@
19031
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19032
- * extent[rank-1];
19033
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19035
retarray->offset = 0;
19036
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19037
@@ -307,7 +305,7 @@
19041
- retarray->base_addr = xmalloc (alloc_size);
19042
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19046
@@ -485,8 +483,7 @@
19047
retarray->offset = 0;
19048
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19050
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19051
- * extent[rank-1];
19052
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19054
if (alloc_size == 0)
19056
@@ -495,7 +492,7 @@
19060
- retarray->base_addr = xmalloc (alloc_size);
19061
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19065
Index: libgfortran/generated/maxloc0_4_r8.c
19066
===================================================================
19067
--- a/src/libgfortran/generated/maxloc0_4_r8.c (.../tags/gcc_4_8_3_release)
19068
+++ b/src/libgfortran/generated/maxloc0_4_r8.c (.../branches/gcc-4_8-branch)
19070
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19071
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19072
retarray->offset = 0;
19073
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19074
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19078
@@ -199,7 +199,7 @@
19079
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19080
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19081
retarray->offset = 0;
19082
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19083
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19087
@@ -367,7 +367,7 @@
19088
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19089
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19090
retarray->offset = 0;
19091
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
19092
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
19094
else if (unlikely (compile_options.bounds_check))
19096
Index: libgfortran/generated/maxloc0_16_r16.c
19097
===================================================================
19098
--- a/src/libgfortran/generated/maxloc0_16_r16.c (.../tags/gcc_4_8_3_release)
19099
+++ b/src/libgfortran/generated/maxloc0_16_r16.c (.../branches/gcc-4_8-branch)
19101
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19102
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19103
retarray->offset = 0;
19104
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19105
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19109
@@ -199,7 +199,7 @@
19110
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19111
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19112
retarray->offset = 0;
19113
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19114
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19118
@@ -367,7 +367,7 @@
19119
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19120
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19121
retarray->offset = 0;
19122
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19123
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19125
else if (unlikely (compile_options.bounds_check))
19127
Index: libgfortran/generated/sum_c10.c
19128
===================================================================
19129
--- a/src/libgfortran/generated/sum_c10.c (.../tags/gcc_4_8_3_release)
19130
+++ b/src/libgfortran/generated/sum_c10.c (.../branches/gcc-4_8-branch)
19132
retarray->offset = 0;
19133
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19135
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19136
- * extent[rank-1];
19137
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19139
- retarray->base_addr = xmalloc (alloc_size);
19140
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
19141
if (alloc_size == 0)
19143
/* Make sure we have a zero-sized array. */
19144
@@ -272,8 +271,7 @@
19148
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19149
- * extent[rank-1];
19150
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19152
retarray->offset = 0;
19153
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19154
@@ -285,7 +283,7 @@
19158
- retarray->base_addr = xmalloc (alloc_size);
19159
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
19163
@@ -430,8 +428,7 @@
19164
retarray->offset = 0;
19165
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19167
- alloc_size = sizeof (GFC_COMPLEX_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19168
- * extent[rank-1];
19169
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19171
if (alloc_size == 0)
19173
@@ -440,7 +437,7 @@
19177
- retarray->base_addr = xmalloc (alloc_size);
19178
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
19182
Index: libgfortran/generated/iall_i4.c
19183
===================================================================
19184
--- a/src/libgfortran/generated/iall_i4.c (.../tags/gcc_4_8_3_release)
19185
+++ b/src/libgfortran/generated/iall_i4.c (.../branches/gcc-4_8-branch)
19187
retarray->offset = 0;
19188
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19190
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19191
- * extent[rank-1];
19192
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19194
- retarray->base_addr = xmalloc (alloc_size);
19195
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19196
if (alloc_size == 0)
19198
/* Make sure we have a zero-sized array. */
19199
@@ -272,8 +271,7 @@
19203
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19204
- * extent[rank-1];
19205
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19207
retarray->offset = 0;
19208
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19209
@@ -285,7 +283,7 @@
19213
- retarray->base_addr = xmalloc (alloc_size);
19214
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19218
@@ -430,8 +428,7 @@
19219
retarray->offset = 0;
19220
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19222
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19223
- * extent[rank-1];
19224
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19226
if (alloc_size == 0)
19228
@@ -440,7 +437,7 @@
19232
- retarray->base_addr = xmalloc (alloc_size);
19233
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19237
Index: libgfortran/generated/minloc1_4_r16.c
19238
===================================================================
19239
--- a/src/libgfortran/generated/minloc1_4_r16.c (.../tags/gcc_4_8_3_release)
19240
+++ b/src/libgfortran/generated/minloc1_4_r16.c (.../branches/gcc-4_8-branch)
19242
retarray->offset = 0;
19243
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19245
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19246
- * extent[rank-1];
19247
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19249
- retarray->base_addr = xmalloc (alloc_size);
19250
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19251
if (alloc_size == 0)
19253
/* Make sure we have a zero-sized array. */
19254
@@ -294,8 +293,7 @@
19258
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19259
- * extent[rank-1];
19260
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19262
retarray->offset = 0;
19263
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19264
@@ -307,7 +305,7 @@
19268
- retarray->base_addr = xmalloc (alloc_size);
19269
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19273
@@ -485,8 +483,7 @@
19274
retarray->offset = 0;
19275
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19277
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19278
- * extent[rank-1];
19279
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19281
if (alloc_size == 0)
19283
@@ -495,7 +492,7 @@
19287
- retarray->base_addr = xmalloc (alloc_size);
19288
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19292
Index: libgfortran/generated/maxloc0_8_r16.c
19293
===================================================================
19294
--- a/src/libgfortran/generated/maxloc0_8_r16.c (.../tags/gcc_4_8_3_release)
19295
+++ b/src/libgfortran/generated/maxloc0_8_r16.c (.../branches/gcc-4_8-branch)
19297
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19298
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19299
retarray->offset = 0;
19300
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19301
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19305
@@ -199,7 +199,7 @@
19306
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19307
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19308
retarray->offset = 0;
19309
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19310
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19314
@@ -367,7 +367,7 @@
19315
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19316
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19317
retarray->offset = 0;
19318
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19319
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19321
else if (unlikely (compile_options.bounds_check))
19323
Index: libgfortran/generated/pack_r8.c
19324
===================================================================
19325
--- a/src/libgfortran/generated/pack_r8.c (.../tags/gcc_4_8_3_release)
19326
+++ b/src/libgfortran/generated/pack_r8.c (.../branches/gcc-4_8-branch)
19327
@@ -167,8 +167,8 @@
19331
- /* xmalloc allocates a single byte for zero size. */
19332
- ret->base_addr = xmalloc (sizeof (GFC_REAL_8) * total);
19333
+ /* xmallocarray allocates a single byte for zero size. */
19334
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_8));
19338
Index: libgfortran/generated/matmul_c10.c
19339
===================================================================
19340
--- a/src/libgfortran/generated/matmul_c10.c (.../tags/gcc_4_8_3_release)
19341
+++ b/src/libgfortran/generated/matmul_c10.c (.../branches/gcc-4_8-branch)
19342
@@ -124,7 +124,7 @@
19345
retarray->base_addr
19346
- = xmalloc (sizeof (GFC_COMPLEX_10) * size0 ((array_t *) retarray));
19347
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_10));
19348
retarray->offset = 0;
19350
else if (unlikely (compile_options.bounds_check))
19351
Index: libgfortran/generated/maxloc0_16_i4.c
19352
===================================================================
19353
--- a/src/libgfortran/generated/maxloc0_16_i4.c (.../tags/gcc_4_8_3_release)
19354
+++ b/src/libgfortran/generated/maxloc0_16_i4.c (.../branches/gcc-4_8-branch)
19356
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19357
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19358
retarray->offset = 0;
19359
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19360
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19364
@@ -199,7 +199,7 @@
19365
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19366
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19367
retarray->offset = 0;
19368
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19369
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19373
@@ -367,7 +367,7 @@
19374
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19375
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19376
retarray->offset = 0;
19377
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19378
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19380
else if (unlikely (compile_options.bounds_check))
19382
Index: libgfortran/generated/pack_r16.c
19383
===================================================================
19384
--- a/src/libgfortran/generated/pack_r16.c (.../tags/gcc_4_8_3_release)
19385
+++ b/src/libgfortran/generated/pack_r16.c (.../branches/gcc-4_8-branch)
19386
@@ -167,8 +167,8 @@
19390
- /* xmalloc allocates a single byte for zero size. */
19391
- ret->base_addr = xmalloc (sizeof (GFC_REAL_16) * total);
19392
+ /* xmallocarray allocates a single byte for zero size. */
19393
+ ret->base_addr = xmallocarray (total, sizeof (GFC_REAL_16));
19397
Index: libgfortran/generated/minloc1_16_i8.c
19398
===================================================================
19399
--- a/src/libgfortran/generated/minloc1_16_i8.c (.../tags/gcc_4_8_3_release)
19400
+++ b/src/libgfortran/generated/minloc1_16_i8.c (.../branches/gcc-4_8-branch)
19402
retarray->offset = 0;
19403
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19405
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19406
- * extent[rank-1];
19407
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19409
- retarray->base_addr = xmalloc (alloc_size);
19410
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19411
if (alloc_size == 0)
19413
/* Make sure we have a zero-sized array. */
19414
@@ -294,8 +293,7 @@
19418
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19419
- * extent[rank-1];
19420
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19422
retarray->offset = 0;
19423
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19424
@@ -307,7 +305,7 @@
19428
- retarray->base_addr = xmalloc (alloc_size);
19429
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19433
@@ -485,8 +483,7 @@
19434
retarray->offset = 0;
19435
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19437
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19438
- * extent[rank-1];
19439
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19441
if (alloc_size == 0)
19443
@@ -495,7 +492,7 @@
19447
- retarray->base_addr = xmalloc (alloc_size);
19448
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19452
Index: libgfortran/generated/minloc0_16_r10.c
19453
===================================================================
19454
--- a/src/libgfortran/generated/minloc0_16_r10.c (.../tags/gcc_4_8_3_release)
19455
+++ b/src/libgfortran/generated/minloc0_16_r10.c (.../branches/gcc-4_8-branch)
19457
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19458
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19459
retarray->offset = 0;
19460
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19461
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19465
@@ -199,7 +199,7 @@
19466
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19467
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19468
retarray->offset = 0;
19469
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19470
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19474
@@ -367,7 +367,7 @@
19475
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19476
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19477
retarray->offset = 0;
19478
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
19479
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
19481
else if (unlikely (compile_options.bounds_check))
19483
Index: libgfortran/generated/unpack_c4.c
19484
===================================================================
19485
--- a/src/libgfortran/generated/unpack_c4.c (.../tags/gcc_4_8_3_release)
19486
+++ b/src/libgfortran/generated/unpack_c4.c (.../branches/gcc-4_8-branch)
19491
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
19492
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
19496
@@ -244,7 +244,7 @@
19500
- ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_4));
19501
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_4));
19505
Index: libgfortran/generated/iparity_i1.c
19506
===================================================================
19507
--- a/src/libgfortran/generated/iparity_i1.c (.../tags/gcc_4_8_3_release)
19508
+++ b/src/libgfortran/generated/iparity_i1.c (.../branches/gcc-4_8-branch)
19510
retarray->offset = 0;
19511
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19513
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19514
- * extent[rank-1];
19515
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19517
- retarray->base_addr = xmalloc (alloc_size);
19518
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19519
if (alloc_size == 0)
19521
/* Make sure we have a zero-sized array. */
19522
@@ -272,8 +271,7 @@
19526
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19527
- * extent[rank-1];
19528
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19530
retarray->offset = 0;
19531
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19532
@@ -285,7 +283,7 @@
19536
- retarray->base_addr = xmalloc (alloc_size);
19537
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19541
@@ -430,8 +428,7 @@
19542
retarray->offset = 0;
19543
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19545
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19546
- * extent[rank-1];
19547
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19549
if (alloc_size == 0)
19551
@@ -440,7 +437,7 @@
19555
- retarray->base_addr = xmalloc (alloc_size);
19556
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
19560
Index: libgfortran/generated/product_c8.c
19561
===================================================================
19562
--- a/src/libgfortran/generated/product_c8.c (.../tags/gcc_4_8_3_release)
19563
+++ b/src/libgfortran/generated/product_c8.c (.../branches/gcc-4_8-branch)
19565
retarray->offset = 0;
19566
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19568
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19569
- * extent[rank-1];
19570
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19572
- retarray->base_addr = xmalloc (alloc_size);
19573
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19574
if (alloc_size == 0)
19576
/* Make sure we have a zero-sized array. */
19577
@@ -272,8 +271,7 @@
19581
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19582
- * extent[rank-1];
19583
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19585
retarray->offset = 0;
19586
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19587
@@ -285,7 +283,7 @@
19591
- retarray->base_addr = xmalloc (alloc_size);
19592
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19596
@@ -430,8 +428,7 @@
19597
retarray->offset = 0;
19598
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19600
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19601
- * extent[rank-1];
19602
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19604
if (alloc_size == 0)
19606
@@ -440,7 +437,7 @@
19610
- retarray->base_addr = xmalloc (alloc_size);
19611
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
19615
Index: libgfortran/generated/in_pack_i16.c
19616
===================================================================
19617
--- a/src/libgfortran/generated/in_pack_i16.c (.../tags/gcc_4_8_3_release)
19618
+++ b/src/libgfortran/generated/in_pack_i16.c (.../branches/gcc-4_8-branch)
19620
return source->base_addr;
19622
/* Allocate storage for the destination. */
19623
- destptr = (GFC_INTEGER_16 *)xmalloc (ssize * sizeof (GFC_INTEGER_16));
19624
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_16));
19626
src = source->base_addr;
19627
stride0 = stride[0];
19628
Index: libgfortran/generated/minloc0_8_i4.c
19629
===================================================================
19630
--- a/src/libgfortran/generated/minloc0_8_i4.c (.../tags/gcc_4_8_3_release)
19631
+++ b/src/libgfortran/generated/minloc0_8_i4.c (.../branches/gcc-4_8-branch)
19633
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19634
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19635
retarray->offset = 0;
19636
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19637
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19641
@@ -199,7 +199,7 @@
19642
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
19643
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19644
retarray->offset = 0;
19645
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19646
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19650
@@ -367,7 +367,7 @@
19651
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
19652
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
19653
retarray->offset = 0;
19654
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
19655
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
19657
else if (unlikely (compile_options.bounds_check))
19659
Index: libgfortran/generated/matmul_c4.c
19660
===================================================================
19661
--- a/src/libgfortran/generated/matmul_c4.c (.../tags/gcc_4_8_3_release)
19662
+++ b/src/libgfortran/generated/matmul_c4.c (.../branches/gcc-4_8-branch)
19663
@@ -124,7 +124,7 @@
19666
retarray->base_addr
19667
- = xmalloc (sizeof (GFC_COMPLEX_4) * size0 ((array_t *) retarray));
19668
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_COMPLEX_4));
19669
retarray->offset = 0;
19671
else if (unlikely (compile_options.bounds_check))
19672
Index: libgfortran/generated/reshape_i8.c
19673
===================================================================
19674
--- a/src/libgfortran/generated/reshape_i8.c (.../tags/gcc_4_8_3_release)
19675
+++ b/src/libgfortran/generated/reshape_i8.c (.../branches/gcc-4_8-branch)
19676
@@ -111,11 +111,11 @@
19679
if (unlikely (rs < 1))
19683
- alloc_size = rs * sizeof (GFC_INTEGER_8);
19686
- ret->base_addr = xmalloc (alloc_size);
19687
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19688
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
19691
Index: libgfortran/generated/in_pack_c8.c
19692
===================================================================
19693
--- a/src/libgfortran/generated/in_pack_c8.c (.../tags/gcc_4_8_3_release)
19694
+++ b/src/libgfortran/generated/in_pack_c8.c (.../branches/gcc-4_8-branch)
19696
return source->base_addr;
19698
/* Allocate storage for the destination. */
19699
- destptr = (GFC_COMPLEX_8 *)xmalloc (ssize * sizeof (GFC_COMPLEX_8));
19700
+ destptr = xmallocarray (ssize, sizeof (GFC_COMPLEX_8));
19702
src = source->base_addr;
19703
stride0 = stride[0];
19704
Index: libgfortran/generated/bessel_r10.c
19705
===================================================================
19706
--- a/src/libgfortran/generated/bessel_r10.c (.../tags/gcc_4_8_3_release)
19707
+++ b/src/libgfortran/generated/bessel_r10.c (.../branches/gcc-4_8-branch)
19710
size_t size = n2 < n1 ? 0 : n2-n1+1;
19711
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
19712
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
19713
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
19717
@@ -122,7 +122,7 @@
19719
size_t size = n2 < n1 ? 0 : n2-n1+1;
19720
GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
19721
- ret->base_addr = xmalloc (sizeof (GFC_REAL_10) * size);
19722
+ ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
19726
@@ -162,7 +162,7 @@
19728
x2rev = GFC_REAL_10_LITERAL(2.)/x;
19730
- for (i = 2; i <= n1+n2; i++)
19731
+ for (i = 2; i <= n2 - n1; i++)
19733
#if defined(GFC_REAL_10_INFINITY)
19734
if (unlikely (last2 == -GFC_REAL_10_INFINITY))
19735
Index: libgfortran/generated/iall_i16.c
19736
===================================================================
19737
--- a/src/libgfortran/generated/iall_i16.c (.../tags/gcc_4_8_3_release)
19738
+++ b/src/libgfortran/generated/iall_i16.c (.../branches/gcc-4_8-branch)
19740
retarray->offset = 0;
19741
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19743
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19744
- * extent[rank-1];
19745
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19747
- retarray->base_addr = xmalloc (alloc_size);
19748
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19749
if (alloc_size == 0)
19751
/* Make sure we have a zero-sized array. */
19752
@@ -272,8 +271,7 @@
19756
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19757
- * extent[rank-1];
19758
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19760
retarray->offset = 0;
19761
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19762
@@ -285,7 +283,7 @@
19766
- retarray->base_addr = xmalloc (alloc_size);
19767
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19771
@@ -430,8 +428,7 @@
19772
retarray->offset = 0;
19773
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19775
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19776
- * extent[rank-1];
19777
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19779
if (alloc_size == 0)
19781
@@ -440,7 +437,7 @@
19785
- retarray->base_addr = xmalloc (alloc_size);
19786
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19790
Index: libgfortran/generated/maxloc1_16_i1.c
19791
===================================================================
19792
--- a/src/libgfortran/generated/maxloc1_16_i1.c (.../tags/gcc_4_8_3_release)
19793
+++ b/src/libgfortran/generated/maxloc1_16_i1.c (.../branches/gcc-4_8-branch)
19795
retarray->offset = 0;
19796
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19798
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19799
- * extent[rank-1];
19800
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19802
- retarray->base_addr = xmalloc (alloc_size);
19803
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19804
if (alloc_size == 0)
19806
/* Make sure we have a zero-sized array. */
19807
@@ -294,8 +293,7 @@
19811
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19812
- * extent[rank-1];
19813
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19815
retarray->offset = 0;
19816
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19817
@@ -307,7 +305,7 @@
19821
- retarray->base_addr = xmalloc (alloc_size);
19822
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19826
@@ -485,8 +483,7 @@
19827
retarray->offset = 0;
19828
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19830
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19831
- * extent[rank-1];
19832
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19834
if (alloc_size == 0)
19836
@@ -495,7 +492,7 @@
19840
- retarray->base_addr = xmalloc (alloc_size);
19841
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19845
Index: libgfortran/generated/reshape_i16.c
19846
===================================================================
19847
--- a/src/libgfortran/generated/reshape_i16.c (.../tags/gcc_4_8_3_release)
19848
+++ b/src/libgfortran/generated/reshape_i16.c (.../branches/gcc-4_8-branch)
19849
@@ -111,11 +111,11 @@
19852
if (unlikely (rs < 1))
19856
- alloc_size = rs * sizeof (GFC_INTEGER_16);
19859
- ret->base_addr = xmalloc (alloc_size);
19860
+ ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19861
ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
19864
Index: libgfortran/generated/count_16_l.c
19865
===================================================================
19866
--- a/src/libgfortran/generated/count_16_l.c (.../tags/gcc_4_8_3_release)
19867
+++ b/src/libgfortran/generated/count_16_l.c (.../branches/gcc-4_8-branch)
19868
@@ -101,8 +101,7 @@
19869
retarray->offset = 0;
19870
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19872
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19873
- * extent[rank-1];
19874
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19876
if (alloc_size == 0)
19878
@@ -111,7 +110,7 @@
19882
- retarray->base_addr = xmalloc (alloc_size);
19883
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
19887
Index: libgfortran/generated/minloc1_8_i1.c
19888
===================================================================
19889
--- a/src/libgfortran/generated/minloc1_8_i1.c (.../tags/gcc_4_8_3_release)
19890
+++ b/src/libgfortran/generated/minloc1_8_i1.c (.../branches/gcc-4_8-branch)
19892
retarray->offset = 0;
19893
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19895
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19896
- * extent[rank-1];
19897
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19899
- retarray->base_addr = xmalloc (alloc_size);
19900
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19901
if (alloc_size == 0)
19903
/* Make sure we have a zero-sized array. */
19904
@@ -294,8 +293,7 @@
19908
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19909
- * extent[rank-1];
19910
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19912
retarray->offset = 0;
19913
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19914
@@ -307,7 +305,7 @@
19918
- retarray->base_addr = xmalloc (alloc_size);
19919
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19923
@@ -485,8 +483,7 @@
19924
retarray->offset = 0;
19925
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19927
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19928
- * extent[rank-1];
19929
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19931
if (alloc_size == 0)
19933
@@ -495,7 +492,7 @@
19937
- retarray->base_addr = xmalloc (alloc_size);
19938
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
19942
Index: libgfortran/generated/maxloc1_4_i4.c
19943
===================================================================
19944
--- a/src/libgfortran/generated/maxloc1_4_i4.c (.../tags/gcc_4_8_3_release)
19945
+++ b/src/libgfortran/generated/maxloc1_4_i4.c (.../branches/gcc-4_8-branch)
19947
retarray->offset = 0;
19948
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19950
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19951
- * extent[rank-1];
19952
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19954
- retarray->base_addr = xmalloc (alloc_size);
19955
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19956
if (alloc_size == 0)
19958
/* Make sure we have a zero-sized array. */
19959
@@ -294,8 +293,7 @@
19963
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19964
- * extent[rank-1];
19965
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19967
retarray->offset = 0;
19968
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19969
@@ -307,7 +305,7 @@
19973
- retarray->base_addr = xmalloc (alloc_size);
19974
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19978
@@ -485,8 +483,7 @@
19979
retarray->offset = 0;
19980
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
19982
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
19983
- * extent[rank-1];
19984
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
19986
if (alloc_size == 0)
19988
@@ -495,7 +492,7 @@
19992
- retarray->base_addr = xmalloc (alloc_size);
19993
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
19997
Index: libgfortran/generated/maxval_i8.c
19998
===================================================================
19999
--- a/src/libgfortran/generated/maxval_i8.c (.../tags/gcc_4_8_3_release)
20000
+++ b/src/libgfortran/generated/maxval_i8.c (.../branches/gcc-4_8-branch)
20002
retarray->offset = 0;
20003
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20005
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20006
- * extent[rank-1];
20007
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20009
- retarray->base_addr = xmalloc (alloc_size);
20010
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20011
if (alloc_size == 0)
20013
/* Make sure we have a zero-sized array. */
20014
@@ -286,8 +285,7 @@
20018
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20019
- * extent[rank-1];
20020
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20022
retarray->offset = 0;
20023
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20024
@@ -299,7 +297,7 @@
20028
- retarray->base_addr = xmalloc (alloc_size);
20029
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20033
@@ -472,8 +470,7 @@
20034
retarray->offset = 0;
20035
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20037
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20038
- * extent[rank-1];
20039
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20041
if (alloc_size == 0)
20043
@@ -482,7 +479,7 @@
20047
- retarray->base_addr = xmalloc (alloc_size);
20048
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20052
Index: libgfortran/generated/eoshift3_16.c
20053
===================================================================
20054
--- a/src/libgfortran/generated/eoshift3_16.c (.../tags/gcc_4_8_3_release)
20055
+++ b/src/libgfortran/generated/eoshift3_16.c (.../branches/gcc-4_8-branch)
20060
- ret->base_addr = xmalloc (size * arraysize);
20061
+ ret->base_addr = xmallocarray (arraysize, size);
20063
ret->dtype = array->dtype;
20064
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
20065
@@ -107,8 +107,8 @@
20066
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
20069
- /* xmalloc allocates a single byte for zero size. */
20070
- ret->base_addr = xmalloc (size * arraysize);
20071
+ /* xmallocarray allocates a single byte for zero size. */
20072
+ ret->base_addr = xmallocarray (arraysize, size);
20075
else if (unlikely (compile_options.bounds_check))
20076
Index: libgfortran/generated/shape_i8.c
20077
===================================================================
20078
--- a/src/libgfortran/generated/shape_i8.c (.../tags/gcc_4_8_3_release)
20079
+++ b/src/libgfortran/generated/shape_i8.c (.../branches/gcc-4_8-branch)
20082
GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
20084
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20085
+ ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20088
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
20089
Index: libgfortran/generated/maxloc0_4_i16.c
20090
===================================================================
20091
--- a/src/libgfortran/generated/maxloc0_4_i16.c (.../tags/gcc_4_8_3_release)
20092
+++ b/src/libgfortran/generated/maxloc0_4_i16.c (.../branches/gcc-4_8-branch)
20094
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20095
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20096
retarray->offset = 0;
20097
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20098
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20102
@@ -199,7 +199,7 @@
20103
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20104
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20105
retarray->offset = 0;
20106
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20107
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20111
@@ -367,7 +367,7 @@
20112
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20113
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20114
retarray->offset = 0;
20115
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20116
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20118
else if (unlikely (compile_options.bounds_check))
20120
Index: libgfortran/generated/maxloc1_4_r10.c
20121
===================================================================
20122
--- a/src/libgfortran/generated/maxloc1_4_r10.c (.../tags/gcc_4_8_3_release)
20123
+++ b/src/libgfortran/generated/maxloc1_4_r10.c (.../branches/gcc-4_8-branch)
20125
retarray->offset = 0;
20126
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20128
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20129
- * extent[rank-1];
20130
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20132
- retarray->base_addr = xmalloc (alloc_size);
20133
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20134
if (alloc_size == 0)
20136
/* Make sure we have a zero-sized array. */
20137
@@ -294,8 +293,7 @@
20141
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20142
- * extent[rank-1];
20143
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20145
retarray->offset = 0;
20146
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20147
@@ -307,7 +305,7 @@
20151
- retarray->base_addr = xmalloc (alloc_size);
20152
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20156
@@ -485,8 +483,7 @@
20157
retarray->offset = 0;
20158
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20160
- alloc_size = sizeof (GFC_INTEGER_4) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20161
- * extent[rank-1];
20162
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20164
if (alloc_size == 0)
20166
@@ -495,7 +492,7 @@
20170
- retarray->base_addr = xmalloc (alloc_size);
20171
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
20175
Index: libgfortran/generated/maxloc1_8_i16.c
20176
===================================================================
20177
--- a/src/libgfortran/generated/maxloc1_8_i16.c (.../tags/gcc_4_8_3_release)
20178
+++ b/src/libgfortran/generated/maxloc1_8_i16.c (.../branches/gcc-4_8-branch)
20180
retarray->offset = 0;
20181
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20183
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20184
- * extent[rank-1];
20185
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20187
- retarray->base_addr = xmalloc (alloc_size);
20188
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20189
if (alloc_size == 0)
20191
/* Make sure we have a zero-sized array. */
20192
@@ -294,8 +293,7 @@
20196
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20197
- * extent[rank-1];
20198
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20200
retarray->offset = 0;
20201
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20202
@@ -307,7 +305,7 @@
20206
- retarray->base_addr = xmalloc (alloc_size);
20207
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20211
@@ -485,8 +483,7 @@
20212
retarray->offset = 0;
20213
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20215
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20216
- * extent[rank-1];
20217
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20219
if (alloc_size == 0)
20221
@@ -495,7 +492,7 @@
20225
- retarray->base_addr = xmalloc (alloc_size);
20226
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20230
Index: libgfortran/generated/minloc0_8_r10.c
20231
===================================================================
20232
--- a/src/libgfortran/generated/minloc0_8_r10.c (.../tags/gcc_4_8_3_release)
20233
+++ b/src/libgfortran/generated/minloc0_8_r10.c (.../branches/gcc-4_8-branch)
20235
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20236
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20237
retarray->offset = 0;
20238
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20239
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20243
@@ -199,7 +199,7 @@
20244
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20245
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20246
retarray->offset = 0;
20247
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20248
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20252
@@ -367,7 +367,7 @@
20253
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20254
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20255
retarray->offset = 0;
20256
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20257
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20259
else if (unlikely (compile_options.bounds_check))
20261
Index: libgfortran/generated/iparity_i2.c
20262
===================================================================
20263
--- a/src/libgfortran/generated/iparity_i2.c (.../tags/gcc_4_8_3_release)
20264
+++ b/src/libgfortran/generated/iparity_i2.c (.../branches/gcc-4_8-branch)
20266
retarray->offset = 0;
20267
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20269
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20270
- * extent[rank-1];
20271
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20273
- retarray->base_addr = xmalloc (alloc_size);
20274
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20275
if (alloc_size == 0)
20277
/* Make sure we have a zero-sized array. */
20278
@@ -272,8 +271,7 @@
20282
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20283
- * extent[rank-1];
20284
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20286
retarray->offset = 0;
20287
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20288
@@ -285,7 +283,7 @@
20292
- retarray->base_addr = xmalloc (alloc_size);
20293
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20297
@@ -430,8 +428,7 @@
20298
retarray->offset = 0;
20299
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20301
- alloc_size = sizeof (GFC_INTEGER_2) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20302
- * extent[rank-1];
20303
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20305
if (alloc_size == 0)
20307
@@ -440,7 +437,7 @@
20311
- retarray->base_addr = xmalloc (alloc_size);
20312
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
20316
Index: libgfortran/generated/maxloc1_16_r4.c
20317
===================================================================
20318
--- a/src/libgfortran/generated/maxloc1_16_r4.c (.../tags/gcc_4_8_3_release)
20319
+++ b/src/libgfortran/generated/maxloc1_16_r4.c (.../branches/gcc-4_8-branch)
20321
retarray->offset = 0;
20322
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20324
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20325
- * extent[rank-1];
20326
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20328
- retarray->base_addr = xmalloc (alloc_size);
20329
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20330
if (alloc_size == 0)
20332
/* Make sure we have a zero-sized array. */
20333
@@ -294,8 +293,7 @@
20337
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20338
- * extent[rank-1];
20339
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20341
retarray->offset = 0;
20342
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20343
@@ -307,7 +305,7 @@
20347
- retarray->base_addr = xmalloc (alloc_size);
20348
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20352
@@ -485,8 +483,7 @@
20353
retarray->offset = 0;
20354
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20356
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20357
- * extent[rank-1];
20358
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20360
if (alloc_size == 0)
20362
@@ -495,7 +492,7 @@
20366
- retarray->base_addr = xmalloc (alloc_size);
20367
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20371
Index: libgfortran/generated/maxloc0_16_r8.c
20372
===================================================================
20373
--- a/src/libgfortran/generated/maxloc0_16_r8.c (.../tags/gcc_4_8_3_release)
20374
+++ b/src/libgfortran/generated/maxloc0_16_r8.c (.../branches/gcc-4_8-branch)
20376
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20377
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20378
retarray->offset = 0;
20379
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20380
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20384
@@ -199,7 +199,7 @@
20385
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20386
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20387
retarray->offset = 0;
20388
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20389
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20393
@@ -367,7 +367,7 @@
20394
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20395
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20396
retarray->offset = 0;
20397
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * rank);
20398
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
20400
else if (unlikely (compile_options.bounds_check))
20402
Index: libgfortran/generated/sum_i16.c
20403
===================================================================
20404
--- a/src/libgfortran/generated/sum_i16.c (.../tags/gcc_4_8_3_release)
20405
+++ b/src/libgfortran/generated/sum_i16.c (.../branches/gcc-4_8-branch)
20407
retarray->offset = 0;
20408
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20410
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20411
- * extent[rank-1];
20412
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20414
- retarray->base_addr = xmalloc (alloc_size);
20415
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20416
if (alloc_size == 0)
20418
/* Make sure we have a zero-sized array. */
20419
@@ -272,8 +271,7 @@
20423
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20424
- * extent[rank-1];
20425
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20427
retarray->offset = 0;
20428
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20429
@@ -285,7 +283,7 @@
20433
- retarray->base_addr = xmalloc (alloc_size);
20434
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20438
@@ -430,8 +428,7 @@
20439
retarray->offset = 0;
20440
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20442
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20443
- * extent[rank-1];
20444
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20446
if (alloc_size == 0)
20448
@@ -440,7 +437,7 @@
20452
- retarray->base_addr = xmalloc (alloc_size);
20453
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20457
Index: libgfortran/generated/maxloc0_4_i8.c
20458
===================================================================
20459
--- a/src/libgfortran/generated/maxloc0_4_i8.c (.../tags/gcc_4_8_3_release)
20460
+++ b/src/libgfortran/generated/maxloc0_4_i8.c (.../branches/gcc-4_8-branch)
20462
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20463
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20464
retarray->offset = 0;
20465
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20466
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20470
@@ -199,7 +199,7 @@
20471
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20472
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20473
retarray->offset = 0;
20474
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20475
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20479
@@ -367,7 +367,7 @@
20480
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20481
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20482
retarray->offset = 0;
20483
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_4) * rank);
20484
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
20486
else if (unlikely (compile_options.bounds_check))
20488
Index: libgfortran/generated/pack_c16.c
20489
===================================================================
20490
--- a/src/libgfortran/generated/pack_c16.c (.../tags/gcc_4_8_3_release)
20491
+++ b/src/libgfortran/generated/pack_c16.c (.../branches/gcc-4_8-branch)
20492
@@ -167,8 +167,8 @@
20496
- /* xmalloc allocates a single byte for zero size. */
20497
- ret->base_addr = xmalloc (sizeof (GFC_COMPLEX_16) * total);
20498
+ /* xmallocarray allocates a single byte for zero size. */
20499
+ ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_16));
20503
Index: libgfortran/generated/maxloc1_16_i16.c
20504
===================================================================
20505
--- a/src/libgfortran/generated/maxloc1_16_i16.c (.../tags/gcc_4_8_3_release)
20506
+++ b/src/libgfortran/generated/maxloc1_16_i16.c (.../branches/gcc-4_8-branch)
20508
retarray->offset = 0;
20509
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20511
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20512
- * extent[rank-1];
20513
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20515
- retarray->base_addr = xmalloc (alloc_size);
20516
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20517
if (alloc_size == 0)
20519
/* Make sure we have a zero-sized array. */
20520
@@ -294,8 +293,7 @@
20524
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20525
- * extent[rank-1];
20526
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20528
retarray->offset = 0;
20529
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20530
@@ -307,7 +305,7 @@
20534
- retarray->base_addr = xmalloc (alloc_size);
20535
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20539
@@ -485,8 +483,7 @@
20540
retarray->offset = 0;
20541
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20543
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20544
- * extent[rank-1];
20545
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20547
if (alloc_size == 0)
20549
@@ -495,7 +492,7 @@
20553
- retarray->base_addr = xmalloc (alloc_size);
20554
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20558
Index: libgfortran/generated/minloc1_8_r4.c
20559
===================================================================
20560
--- a/src/libgfortran/generated/minloc1_8_r4.c (.../tags/gcc_4_8_3_release)
20561
+++ b/src/libgfortran/generated/minloc1_8_r4.c (.../branches/gcc-4_8-branch)
20563
retarray->offset = 0;
20564
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20566
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20567
- * extent[rank-1];
20568
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20570
- retarray->base_addr = xmalloc (alloc_size);
20571
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20572
if (alloc_size == 0)
20574
/* Make sure we have a zero-sized array. */
20575
@@ -294,8 +293,7 @@
20579
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20580
- * extent[rank-1];
20581
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20583
retarray->offset = 0;
20584
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20585
@@ -307,7 +305,7 @@
20589
- retarray->base_addr = xmalloc (alloc_size);
20590
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20594
@@ -485,8 +483,7 @@
20595
retarray->offset = 0;
20596
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20598
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20599
- * extent[rank-1];
20600
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20602
if (alloc_size == 0)
20604
@@ -495,7 +492,7 @@
20608
- retarray->base_addr = xmalloc (alloc_size);
20609
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20613
Index: libgfortran/generated/sum_c8.c
20614
===================================================================
20615
--- a/src/libgfortran/generated/sum_c8.c (.../tags/gcc_4_8_3_release)
20616
+++ b/src/libgfortran/generated/sum_c8.c (.../branches/gcc-4_8-branch)
20618
retarray->offset = 0;
20619
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20621
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20622
- * extent[rank-1];
20623
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20625
- retarray->base_addr = xmalloc (alloc_size);
20626
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
20627
if (alloc_size == 0)
20629
/* Make sure we have a zero-sized array. */
20630
@@ -272,8 +271,7 @@
20634
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20635
- * extent[rank-1];
20636
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20638
retarray->offset = 0;
20639
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20640
@@ -285,7 +283,7 @@
20644
- retarray->base_addr = xmalloc (alloc_size);
20645
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
20649
@@ -430,8 +428,7 @@
20650
retarray->offset = 0;
20651
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20653
- alloc_size = sizeof (GFC_COMPLEX_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20654
- * extent[rank-1];
20655
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20657
if (alloc_size == 0)
20659
@@ -440,7 +437,7 @@
20663
- retarray->base_addr = xmalloc (alloc_size);
20664
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
20668
Index: libgfortran/generated/maxloc1_16_i2.c
20669
===================================================================
20670
--- a/src/libgfortran/generated/maxloc1_16_i2.c (.../tags/gcc_4_8_3_release)
20671
+++ b/src/libgfortran/generated/maxloc1_16_i2.c (.../branches/gcc-4_8-branch)
20673
retarray->offset = 0;
20674
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20676
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20677
- * extent[rank-1];
20678
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20680
- retarray->base_addr = xmalloc (alloc_size);
20681
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20682
if (alloc_size == 0)
20684
/* Make sure we have a zero-sized array. */
20685
@@ -294,8 +293,7 @@
20689
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20690
- * extent[rank-1];
20691
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20693
retarray->offset = 0;
20694
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20695
@@ -307,7 +305,7 @@
20699
- retarray->base_addr = xmalloc (alloc_size);
20700
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20704
@@ -485,8 +483,7 @@
20705
retarray->offset = 0;
20706
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20708
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20709
- * extent[rank-1];
20710
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20712
if (alloc_size == 0)
20714
@@ -495,7 +492,7 @@
20718
- retarray->base_addr = xmalloc (alloc_size);
20719
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20723
Index: libgfortran/generated/parity_l1.c
20724
===================================================================
20725
--- a/src/libgfortran/generated/parity_l1.c (.../tags/gcc_4_8_3_release)
20726
+++ b/src/libgfortran/generated/parity_l1.c (.../branches/gcc-4_8-branch)
20728
retarray->offset = 0;
20729
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20731
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20732
- * extent[rank-1];
20733
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20735
- retarray->base_addr = xmalloc (alloc_size);
20736
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
20737
if (alloc_size == 0)
20739
/* Make sure we have a zero-sized array. */
20740
Index: libgfortran/generated/maxval_i16.c
20741
===================================================================
20742
--- a/src/libgfortran/generated/maxval_i16.c (.../tags/gcc_4_8_3_release)
20743
+++ b/src/libgfortran/generated/maxval_i16.c (.../branches/gcc-4_8-branch)
20745
retarray->offset = 0;
20746
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20748
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20749
- * extent[rank-1];
20750
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20752
- retarray->base_addr = xmalloc (alloc_size);
20753
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20754
if (alloc_size == 0)
20756
/* Make sure we have a zero-sized array. */
20757
@@ -286,8 +285,7 @@
20761
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20762
- * extent[rank-1];
20763
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20765
retarray->offset = 0;
20766
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20767
@@ -299,7 +297,7 @@
20771
- retarray->base_addr = xmalloc (alloc_size);
20772
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20776
@@ -472,8 +470,7 @@
20777
retarray->offset = 0;
20778
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20780
- alloc_size = sizeof (GFC_INTEGER_16) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20781
- * extent[rank-1];
20782
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20784
if (alloc_size == 0)
20786
@@ -482,7 +479,7 @@
20790
- retarray->base_addr = xmalloc (alloc_size);
20791
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
20795
Index: libgfortran/generated/spread_c8.c
20796
===================================================================
20797
--- a/src/libgfortran/generated/spread_c8.c (.../tags/gcc_4_8_3_release)
20798
+++ b/src/libgfortran/generated/spread_c8.c (.../branches/gcc-4_8-branch)
20799
@@ -101,8 +101,8 @@
20803
- /* xmalloc allocates a single byte for zero size. */
20804
- ret->base_addr = xmalloc (rs * sizeof(GFC_COMPLEX_8));
20805
+ /* xmallocarray allocates a single byte for zero size. */
20806
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_COMPLEX_8));
20810
@@ -244,7 +244,7 @@
20812
if (ret->base_addr == NULL)
20814
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_COMPLEX_8));
20815
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_COMPLEX_8));
20817
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
20819
Index: libgfortran/generated/matmul_i16.c
20820
===================================================================
20821
--- a/src/libgfortran/generated/matmul_i16.c (.../tags/gcc_4_8_3_release)
20822
+++ b/src/libgfortran/generated/matmul_i16.c (.../branches/gcc-4_8-branch)
20823
@@ -124,7 +124,7 @@
20826
retarray->base_addr
20827
- = xmalloc (sizeof (GFC_INTEGER_16) * size0 ((array_t *) retarray));
20828
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_INTEGER_16));
20829
retarray->offset = 0;
20831
else if (unlikely (compile_options.bounds_check))
20832
Index: libgfortran/generated/pack_i8.c
20833
===================================================================
20834
--- a/src/libgfortran/generated/pack_i8.c (.../tags/gcc_4_8_3_release)
20835
+++ b/src/libgfortran/generated/pack_i8.c (.../branches/gcc-4_8-branch)
20836
@@ -167,8 +167,8 @@
20840
- /* xmalloc allocates a single byte for zero size. */
20841
- ret->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * total);
20842
+ /* xmallocarray allocates a single byte for zero size. */
20843
+ ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_8));
20847
Index: libgfortran/generated/any_l1.c
20848
===================================================================
20849
--- a/src/libgfortran/generated/any_l1.c (.../tags/gcc_4_8_3_release)
20850
+++ b/src/libgfortran/generated/any_l1.c (.../branches/gcc-4_8-branch)
20851
@@ -101,8 +101,7 @@
20852
retarray->offset = 0;
20853
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20855
- alloc_size = sizeof (GFC_LOGICAL_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20856
- * extent[rank-1];
20857
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20859
if (alloc_size == 0)
20861
@@ -111,7 +110,7 @@
20865
- retarray->base_addr = xmalloc (alloc_size);
20866
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
20870
Index: libgfortran/generated/minloc1_8_i2.c
20871
===================================================================
20872
--- a/src/libgfortran/generated/minloc1_8_i2.c (.../tags/gcc_4_8_3_release)
20873
+++ b/src/libgfortran/generated/minloc1_8_i2.c (.../branches/gcc-4_8-branch)
20875
retarray->offset = 0;
20876
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20878
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20879
- * extent[rank-1];
20880
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20882
- retarray->base_addr = xmalloc (alloc_size);
20883
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20884
if (alloc_size == 0)
20886
/* Make sure we have a zero-sized array. */
20887
@@ -294,8 +293,7 @@
20891
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20892
- * extent[rank-1];
20893
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20895
retarray->offset = 0;
20896
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20897
@@ -307,7 +305,7 @@
20901
- retarray->base_addr = xmalloc (alloc_size);
20902
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20906
@@ -485,8 +483,7 @@
20907
retarray->offset = 0;
20908
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20910
- alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20911
- * extent[rank-1];
20912
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20914
if (alloc_size == 0)
20916
@@ -495,7 +492,7 @@
20920
- retarray->base_addr = xmalloc (alloc_size);
20921
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
20925
Index: libgfortran/generated/minloc0_8_r8.c
20926
===================================================================
20927
--- a/src/libgfortran/generated/minloc0_8_r8.c (.../tags/gcc_4_8_3_release)
20928
+++ b/src/libgfortran/generated/minloc0_8_r8.c (.../branches/gcc-4_8-branch)
20930
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20931
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20932
retarray->offset = 0;
20933
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20934
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20938
@@ -199,7 +199,7 @@
20939
GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
20940
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20941
retarray->offset = 0;
20942
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20943
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20947
@@ -367,7 +367,7 @@
20948
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
20949
retarray->dtype = (retarray->dtype & ~GFC_DTYPE_RANK_MASK) | 1;
20950
retarray->offset = 0;
20951
- retarray->base_addr = xmalloc (sizeof (GFC_INTEGER_8) * rank);
20952
+ retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
20954
else if (unlikely (compile_options.bounds_check))
20956
Index: libgfortran/generated/matmul_l8.c
20957
===================================================================
20958
--- a/src/libgfortran/generated/matmul_l8.c (.../tags/gcc_4_8_3_release)
20959
+++ b/src/libgfortran/generated/matmul_l8.c (.../branches/gcc-4_8-branch)
20963
retarray->base_addr
20964
- = xmalloc (sizeof (GFC_LOGICAL_8) * size0 ((array_t *) retarray));
20965
+ = xmallocarray (size0 ((array_t *) retarray), sizeof (GFC_LOGICAL_8));
20966
retarray->offset = 0;
20968
else if (unlikely (compile_options.bounds_check))
20969
Index: libgfortran/generated/product_r10.c
20970
===================================================================
20971
--- a/src/libgfortran/generated/product_r10.c (.../tags/gcc_4_8_3_release)
20972
+++ b/src/libgfortran/generated/product_r10.c (.../branches/gcc-4_8-branch)
20974
retarray->offset = 0;
20975
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20977
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20978
- * extent[rank-1];
20979
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20981
- retarray->base_addr = xmalloc (alloc_size);
20982
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
20983
if (alloc_size == 0)
20985
/* Make sure we have a zero-sized array. */
20986
@@ -272,8 +271,7 @@
20990
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
20991
- * extent[rank-1];
20992
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
20994
retarray->offset = 0;
20995
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
20996
@@ -285,7 +283,7 @@
21000
- retarray->base_addr = xmalloc (alloc_size);
21001
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
21005
@@ -430,8 +428,7 @@
21006
retarray->offset = 0;
21007
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21009
- alloc_size = sizeof (GFC_REAL_10) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21010
- * extent[rank-1];
21011
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21013
if (alloc_size == 0)
21015
@@ -440,7 +437,7 @@
21019
- retarray->base_addr = xmalloc (alloc_size);
21020
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
21024
Index: libgfortran/generated/product_i1.c
21025
===================================================================
21026
--- a/src/libgfortran/generated/product_i1.c (.../tags/gcc_4_8_3_release)
21027
+++ b/src/libgfortran/generated/product_i1.c (.../branches/gcc-4_8-branch)
21029
retarray->offset = 0;
21030
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21032
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21033
- * extent[rank-1];
21034
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21036
- retarray->base_addr = xmalloc (alloc_size);
21037
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
21038
if (alloc_size == 0)
21040
/* Make sure we have a zero-sized array. */
21041
@@ -272,8 +271,7 @@
21045
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21046
- * extent[rank-1];
21047
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21049
retarray->offset = 0;
21050
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21051
@@ -285,7 +283,7 @@
21055
- retarray->base_addr = xmalloc (alloc_size);
21056
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
21060
@@ -430,8 +428,7 @@
21061
retarray->offset = 0;
21062
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21064
- alloc_size = sizeof (GFC_INTEGER_1) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21065
- * extent[rank-1];
21066
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21068
if (alloc_size == 0)
21070
@@ -440,7 +437,7 @@
21074
- retarray->base_addr = xmalloc (alloc_size);
21075
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
21079
Index: libgfortran/generated/all_l8.c
21080
===================================================================
21081
--- a/src/libgfortran/generated/all_l8.c (.../tags/gcc_4_8_3_release)
21082
+++ b/src/libgfortran/generated/all_l8.c (.../branches/gcc-4_8-branch)
21083
@@ -101,8 +101,7 @@
21084
retarray->offset = 0;
21085
retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
21087
- alloc_size = sizeof (GFC_LOGICAL_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
21088
- * extent[rank-1];
21089
+ alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
21091
if (alloc_size == 0)
21093
@@ -111,7 +110,7 @@
21097
- retarray->base_addr = xmalloc (alloc_size);
21098
+ retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
21102
Index: libgfortran/generated/in_pack_r16.c
21103
===================================================================
21104
--- a/src/libgfortran/generated/in_pack_r16.c (.../tags/gcc_4_8_3_release)
21105
+++ b/src/libgfortran/generated/in_pack_r16.c (.../branches/gcc-4_8-branch)
21107
return source->base_addr;
21109
/* Allocate storage for the destination. */
21110
- destptr = (GFC_REAL_16 *)xmalloc (ssize * sizeof (GFC_REAL_16));
21111
+ destptr = xmallocarray (ssize, sizeof (GFC_REAL_16));
21113
src = source->base_addr;
21114
stride0 = stride[0];
21115
Index: libgfortran/generated/in_pack_i1.c
21116
===================================================================
21117
--- a/src/libgfortran/generated/in_pack_i1.c (.../tags/gcc_4_8_3_release)
21118
+++ b/src/libgfortran/generated/in_pack_i1.c (.../branches/gcc-4_8-branch)
21120
return source->base_addr;
21122
/* Allocate storage for the destination. */
21123
- destptr = (GFC_INTEGER_1 *)xmalloc (ssize * sizeof (GFC_INTEGER_1));
21124
+ destptr = xmallocarray (ssize, sizeof (GFC_INTEGER_1));
21126
src = source->base_addr;
21127
stride0 = stride[0];
21128
Index: libgfortran/libgfortran.h
21129
===================================================================
21130
--- a/src/libgfortran/libgfortran.h (.../tags/gcc_4_8_3_release)
21131
+++ b/src/libgfortran/libgfortran.h (.../branches/gcc-4_8-branch)
21132
@@ -751,6 +751,9 @@
21133
extern void *xmalloc (size_t) __attribute__ ((malloc));
21134
internal_proto(xmalloc);
21136
+extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc));
21137
+internal_proto(xmallocarray);
21139
extern void *xcalloc (size_t, size_t) __attribute__ ((malloc));
21140
internal_proto(xcalloc);
21142
Index: libgfortran/io/list_read.c
21143
===================================================================
21144
--- a/src/libgfortran/io/list_read.c (.../tags/gcc_4_8_3_release)
21145
+++ b/src/libgfortran/io/list_read.c (.../branches/gcc-4_8-branch)
21146
@@ -2354,7 +2354,7 @@
21148
index_type len = strlen (nl->var_name) + 1;
21150
- char * ext_name = (char*)xmalloc (len + 1);
21151
+ char * ext_name = xmalloc (len + 1);
21152
memcpy (ext_name, nl->var_name, len-1);
21153
memcpy (ext_name + len - 1, "%", 2);
21154
for (nl = nl->next; nl; nl = nl->next)
21155
Index: libgfortran/io/unit.c
21156
===================================================================
21157
--- a/src/libgfortran/io/unit.c (.../tags/gcc_4_8_3_release)
21158
+++ b/src/libgfortran/io/unit.c (.../branches/gcc-4_8-branch)
21159
@@ -455,7 +455,7 @@
21161
iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
21162
iunit->ls = (array_loop_spec *)
21163
- xmalloc (iunit->rank * sizeof (array_loop_spec));
21164
+ xmallocarray (iunit->rank, sizeof (array_loop_spec));
21165
dtp->internal_unit_len *=
21166
init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
21168
Index: libgfortran/io/unix.c
21169
===================================================================
21170
--- a/src/libgfortran/io/unix.c (.../tags/gcc_4_8_3_release)
21171
+++ b/src/libgfortran/io/unix.c (.../branches/gcc-4_8-branch)
21172
@@ -407,7 +407,9 @@
21176
- if (s->fd != STDOUT_FILENO
21179
+ else if (s->fd != STDOUT_FILENO
21180
&& s->fd != STDERR_FILENO
21181
&& s->fd != STDIN_FILENO)
21182
retval = close (s->fd);
21183
@@ -983,7 +985,15 @@
21185
/* Get the current length of the file. */
21187
- fstat (fd, &statbuf);
21188
+ if (fstat (fd, &statbuf) == -1)
21190
+ s->st_dev = s->st_ino = -1;
21191
+ s->file_length = 0;
21192
+ if (errno == EBADF)
21195
+ return (stream *) s;
21198
s->st_dev = statbuf.st_dev;
21199
s->st_ino = statbuf.st_ino;
21200
Index: libgfortran/io/transfer.c
21201
===================================================================
21202
--- a/src/libgfortran/io/transfer.c (.../tags/gcc_4_8_3_release)
21203
+++ b/src/libgfortran/io/transfer.c (.../branches/gcc-4_8-branch)
21204
@@ -3776,9 +3776,9 @@
21205
if (nml->var_rank > 0)
21207
nml->dim = (descriptor_dimension*)
21208
- xmalloc (nml->var_rank * sizeof (descriptor_dimension));
21209
+ xmallocarray (nml->var_rank, sizeof (descriptor_dimension));
21210
nml->ls = (array_loop_spec*)
21211
- xmalloc (nml->var_rank * sizeof (array_loop_spec));
21212
+ xmallocarray (nml->var_rank, sizeof (array_loop_spec));
21216
Index: libgfortran/io/write.c
21217
===================================================================
21218
--- a/src/libgfortran/io/write.c (.../tags/gcc_4_8_3_release)
21219
+++ b/src/libgfortran/io/write.c (.../branches/gcc-4_8-branch)
21220
@@ -1863,7 +1863,7 @@
21221
base_var_name_len = base ? strlen (base->var_name) : 0;
21222
ext_name_len = base_name_len + base_var_name_len
21223
+ strlen (obj->var_name) + obj->var_rank * NML_DIGITS + 1;
21224
- ext_name = (char*)xmalloc (ext_name_len);
21225
+ ext_name = xmalloc (ext_name_len);
21227
memcpy (ext_name, base_name, base_name_len);
21228
clen = strlen (obj->var_name + base_var_name_len);
21229
@@ -1892,7 +1892,7 @@
21230
/* Now obj_name. */
21232
obj_name_len = strlen (obj->var_name) + 1;
21233
- obj_name = xmalloc (obj_name_len+1);
21234
+ obj_name = xmalloc (obj_name_len + 1);
21235
memcpy (obj_name, obj->var_name, obj_name_len-1);
21236
memcpy (obj_name + obj_name_len-1, "%", 2);
21238
Index: libada/Makefile.in
21239
===================================================================
21240
--- a/src/libada/Makefile.in (.../tags/gcc_4_8_3_release)
21241
+++ b/src/libada/Makefile.in (.../branches/gcc-4_8-branch)
21243
PICFLAG = @PICFLAG@
21244
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
21245
GNATLIBCFLAGS= -g -O2
21246
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
21247
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
21248
-fexceptions -DIN_RTS @have_getipinfo@
21250
host_subdir = @host_subdir@
21251
Index: libada/ChangeLog
21252
===================================================================
21253
--- a/src/libada/ChangeLog (.../tags/gcc_4_8_3_release)
21254
+++ b/src/libada/ChangeLog (.../branches/gcc-4_8-branch)
21256
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
21258
+ * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
21260
2014-05-22 Release Manager
21262
* GCC 4.8.3 released.
21263
Index: libffi/src/powerpc/linux64_closure.S
21264
===================================================================
21265
--- a/src/libffi/src/powerpc/linux64_closure.S (.../tags/gcc_4_8_3_release)
21266
+++ b/src/libffi/src/powerpc/linux64_closure.S (.../branches/gcc-4_8-branch)
21267
@@ -381,7 +381,8 @@
21271
-# if defined __ELF__ && defined __linux__
21274
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
21275
.section .note.GNU-stack,"",@progbits
21278
Index: libffi/src/powerpc/linux64.S
21279
===================================================================
21280
--- a/src/libffi/src/powerpc/linux64.S (.../tags/gcc_4_8_3_release)
21281
+++ b/src/libffi/src/powerpc/linux64.S (.../branches/gcc-4_8-branch)
21282
@@ -254,7 +254,8 @@
21286
-# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
21289
+#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
21290
.section .note.GNU-stack,"",@progbits
21293
Index: libffi/ChangeLog
21294
===================================================================
21295
--- a/src/libffi/ChangeLog (.../tags/gcc_4_8_3_release)
21296
+++ b/src/libffi/ChangeLog (.../branches/gcc-4_8-branch)
21298
+2014-09-11 Jakub Jelinek <jakub@redhat.com>
21300
+ * src/powerpc/linux64.S: Emit .note.GNU-stack even when
21301
+ POWERPC64 is not defined.
21302
+ * src/powerpc/linux64_closure.S: Likewise. Also test _CALL_ELF == 2.
21304
2014-05-22 Release Manager
21306
* GCC 4.8.3 released.
21308
===================================================================
21309
--- a/src/. (.../tags/gcc_4_8_3_release)
21310
+++ b/src/. (.../branches/gcc-4_8-branch)
21312
Property changes on: .
21313
___________________________________________________________________
21314
Modified: svn:mergeinfo
21315
Merged /trunk:r211733,215049