2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56782
* frontend-passes.c (callback_reduction): Dont't do
any simplification if there is only a single element
which has an iterator.
2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56782
* gfortran.dg/array_constructor_44.f90: New test.
From-SVN: r197610
+2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56782
+ * frontend-passes.c (callback_reduction): Dont't do
+ any simplification if there is only a single element
+ which has an iterator.
+
2013-04-07 Tobias Burnus <burnus@net-b.de>
PR fortran/56849
c = gfc_constructor_first (arg->value.constructor);
- if (c == NULL)
+ /* Don't do any simplififcation if we have
+ - no element in the constructor or
+ - only have a single element in the array which contains an
+ iterator. */
+
+ if (c == NULL || (c->iterator != NULL && gfc_constructor_next (c) == NULL))
return 0;
res = copy_walk_reduction_arg (c->expr, fn);
+2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56782
+ * gfortran.dg/array_constructor_44.f90: New test.
+
2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56871
--- /dev/null
+! { dg-do run }
+! { dg-options "-ffrontend-optimize" }
+! PR 56872 - wrong front-end optimization with a single constructor.
+! Original bug report by Rich Townsend.
+ integer :: k
+ real :: s
+ integer :: m
+ s = 2.0
+ m = 4
+ res = SUM([(s**(REAL(k-1)/REAL(m-1)),k=1,m)])
+ if (abs(res - 5.84732246) > 1e-6) call abort
+ end