Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: gcc/libgfortran/m4/minval.m4

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libgfortran/m4/minloc1.m4 ('k') | gcc/libgfortran/m4/shape.m4 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libgfortran/m4/minval.m4
diff --git a/gcc/libgfortran/m4/minval.m4 b/gcc/libgfortran/m4/minval.m4
index 9b8be5bc0ff161e9baf9c33a6290268b97543e28..3acae2eaa88e647c7bb0e56f3bb295ffef511e44 100644
--- a/gcc/libgfortran/m4/minval.m4
+++ b/gcc/libgfortran/m4/minval.m4
@@ -33,14 +33,55 @@ include(ifunction.m4)dnl
`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
ARRAY_FUNCTION(atype_max,
-` result = atype_max;',
-` if (*src < result)
- result = *src;')
+`#if defined ('atype_inf`)
+ result = atype_inf;
+#else
+ result = atype_max;
+#endif',
+`#if defined ('atype_nan`)
+ if (*src <= result)
+ break;
+ }
+ if (unlikely (n >= len))
+ result = atype_nan;
+ else for (; n < len; n++, src += delta)
+ {
+#endif
+ if (*src < result)
+ result = *src;')
MASKED_ARRAY_FUNCTION(atype_max,
-` result = atype_max;',
-` if (*msrc && *src < result)
- result = *src;')
+`#if defined ('atype_inf`)
+ result = atype_inf;
+#else
+ result = atype_max;
+#endif
+#if defined ('atype_nan`)
+ int non_empty_p = 0;
+#endif',
+`#if defined ('atype_inf`) || defined ('atype_nan`)
+ if (*msrc)
+ {
+#if defined ('atype_nan`)
+ non_empty_p = 1;
+ if (*src <= result)
+#endif
+ break;
+ }
+ }
+ if (unlikely (n >= len))
+ {
+#if defined ('atype_nan`)
+ result = non_empty_p ? atype_nan : atype_max;
+#else
+ result = atype_max;
+#endif
+ }
+ else for (; n < len; n++, src += delta, msrc += mdelta)
+ {
+#endif
+ if (*msrc && *src < result)
+ result = *src;')
SCALAR_ARRAY_FUNCTION(atype_max)
« no previous file with comments | « gcc/libgfortran/m4/minloc1.m4 ('k') | gcc/libgfortran/m4/shape.m4 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698