Commit f6cf4810 by Steven G. Kargl

re PR fortran/77942 (ICE: Floating point exception, in gfc_simplify_cshift, at…

re PR fortran/77942 (ICE: Floating point exception, in gfc_simplify_cshift, at fortran/simplify.c:1845)

2016-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77942
	* simplify.c (gfc_simplify_cshift): Check for zero.

2016-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77942
	* gfortran.dg/pr77942.f90

From-SVN: r241008
parent 25607230
2016-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77942
* simplify.c (gfc_simplify_cshift): Check for zero.
2016-10-11 Fritz Reese <fritzoreese@gmail.com> 2016-10-11 Fritz Reese <fritzoreese@gmail.com>
* iresolve.c (get_radians, get_degrees): Fix sloppy commit. * iresolve.c (get_radians, get_degrees): Fix sloppy commit.
...@@ -5,7 +10,7 @@ ...@@ -5,7 +10,7 @@
2016-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2016-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* simplify.c (radians_f): Fix mpdr_mod. * simplify.c (radians_f): Fix mpfr_mod.
* ireolce.c (get_degrees): Declare tmp. * ireolce.c (get_degrees): Declare tmp.
2016-10-11 Fritz Reese <fritzoreese@gmail.com> 2016-10-11 Fritz Reese <fritzoreese@gmail.com>
......
...@@ -1989,7 +1989,7 @@ gfc_simplify_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim) ...@@ -1989,7 +1989,7 @@ gfc_simplify_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
shft = shft < 0 ? 1 - shft : shft; shft = shft < 0 ? 1 - shft : shft;
/* Special case: Shift to the original order! */ /* Special case: Shift to the original order! */
if (shft % sz == 0) if (sz == 0 || shft % sz == 0)
return a; return a;
result = gfc_copy_expr (a); result = gfc_copy_expr (a);
......
2016-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77942
* gfortran.dg/pr77942.f90
2016-10-11 Fritz Reese <fritzoreese@gmail.com> 2016-10-11 Fritz Reese <fritzoreese@gmail.com>
* gfortran.dg/dec_math.f90: New testsuite. * gfortran.dg/dec_math.f90: New testsuite.
......
! { dg-do compile }
program p
character, parameter :: c(2) = 'a'
print *, cshift(c(2:1), 1)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment