cshift0.m4 (cshift0_'rtype_code`): Guard use of modulo.

* m4/cshift0.m4 (cshift0_'rtype_code`): Guard use of modulo.

	* generated/cshift0_c10.c: Regenerated.
	* generated/cshift0_c16.c: Regenerated.
	* generated/cshift0_c4.c: Regenerated.
	* generated/cshift0_c8.c: Regenerated.
	* generated/cshift0_i16.c: Regenerated.
	* generated/cshift0_i1.c: Regenerated.
	* generated/cshift0_i2.c: Regenerated.
	* generated/cshift0_i4.c: Regenerated.
	* generated/cshift0_i8.c: Regenerated.
	* generated/cshift0_r10.c: Regenerated.
	* generated/cshift0_r16.c: Regenerated.
	* generated/cshift0_r4.c: Regenerated.
	* generated/cshift0_r8.c: Regenerated.

From-SVN: r186283
This commit is contained in:
Michael Matz 2012-04-10 15:39:22 +00:00 committed by Michael Matz
parent ca18edc55f
commit b43645b852
15 changed files with 116 additions and 42 deletions

View File

@ -1,3 +1,21 @@
2012-04-10 Michael Matz <matz@suse.de>
* m4/cshift0.m4 (cshift0_'rtype_code`): Guard use of modulo.
* generated/cshift0_c10.c: Regenerated.
* generated/cshift0_c16.c: Regenerated.
* generated/cshift0_c4.c: Regenerated.
* generated/cshift0_c8.c: Regenerated.
* generated/cshift0_i16.c: Regenerated.
* generated/cshift0_i1.c: Regenerated.
* generated/cshift0_i2.c: Regenerated.
* generated/cshift0_i4.c: Regenerated.
* generated/cshift0_i8.c: Regenerated.
* generated/cshift0_r10.c: Regenerated.
* generated/cshift0_r16.c: Regenerated.
* generated/cshift0_r4.c: Regenerated.
* generated/cshift0_r8.c: Regenerated.
2012-04-04 Tristan Gingold <gingold@adacore.com>
* libgfortran.h: Include complex.h before math.h

View File

@ -97,9 +97,13 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -97,9 +97,13 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{

View File

@ -98,9 +98,13 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ptrdiff_t shift,
rptr = ret->base_addr;
sptr = array->base_addr;
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
/* Avoid the costly modulo for trivially in-bound shifts. */
if (shift < 0 || shift >= len)
{
shift = len == 0 ? 0 : shift % (ptrdiff_t)len;
if (shift < 0)
shift += len;
}
while (rptr)
{