Fix a few vect gimple testcases for LLP64 targets (e.g. mingw) [PR113548]
Checks
Commit Message
This fixes of the vect testcases which uses the gimple FE for LLP64 targets.
The testcases use directly `unsigned long` for the addition to pointers
when they should be using `__SIZETYPE__`. This changes to use that instead.
gcc/testsuite/ChangeLog:
PR testsuite/113548
* gcc.dg/vect/slp-reduc-10a.c: Use `__SIZETYPE__` instead of `unsigned long`.
* gcc.dg/vect/slp-reduc-10b.c: Likewise.
* gcc.dg/vect/slp-reduc-10c.c: Likewise.
* gcc.dg/vect/slp-reduc-10d.c: Likewise.
* gcc.dg/vect/slp-reduc-10e.c: Likewise.
* gcc.dg/vect/vect-cond-arith-2.c: Likewise.
* gcc.dg/vect/vect-ifcvt-19.c: Likewise.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c | 20 +++++++++----------
gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c | 20 +++++++++----------
gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c | 6 +++---
gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c | 6 +++---
gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c | 6 +++---
gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c | 8 ++++----
gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c | 8 ++++----
7 files changed, 37 insertions(+), 37 deletions(-)
Comments
On Thu, Jan 25, 2024 at 1:46 AM Andrew Pinski <quic_apinski@quicinc.com> wrote:
>
> This fixes of the vect testcases which uses the gimple FE for LLP64 targets.
> The testcases use directly `unsigned long` for the addition to pointers
> when they should be using `__SIZETYPE__`. This changes to use that instead.
OK
> gcc/testsuite/ChangeLog:
>
> PR testsuite/113548
> * gcc.dg/vect/slp-reduc-10a.c: Use `__SIZETYPE__` instead of `unsigned long`.
> * gcc.dg/vect/slp-reduc-10b.c: Likewise.
> * gcc.dg/vect/slp-reduc-10c.c: Likewise.
> * gcc.dg/vect/slp-reduc-10d.c: Likewise.
> * gcc.dg/vect/slp-reduc-10e.c: Likewise.
> * gcc.dg/vect/vect-cond-arith-2.c: Likewise.
> * gcc.dg/vect/vect-ifcvt-19.c: Likewise.
>
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
> gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c | 20 +++++++++----------
> gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c | 20 +++++++++----------
> gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c | 6 +++---
> gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c | 6 +++---
> gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c | 6 +++---
> gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c | 8 ++++----
> gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c | 8 ++++----
> 7 files changed, 37 insertions(+), 37 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c
> index d3c2c2d7f54..66d3a6c4765 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-10a.c
> @@ -8,8 +8,8 @@ foo (int * x, int n)
> int i;
> int sum;
> int _1;
> - long unsigned int _2;
> - long unsigned int _3;
> + __SIZETYPE__ _2;
> + __SIZETYPE__ _3;
> int * _4;
> int _5;
> __SIZETYPE__ _7;
> @@ -38,23 +38,23 @@ foo (int * x, int n)
> sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
> i_32 = __PHI (__BB5: 0, __BB6: i_28);
> _1 = i_32 * 4;
> - _2 = (long unsigned int) _1;
> - _3 = _2 * 4ul;
> + _2 = (__SIZETYPE__) _1;
> + _3 = _2 * _Literal(__SIZETYPE__)4;
> _4 = x_23(D) + _3;
> _5 = __MEM <int> (_4);
> sum_24 = _5 + sum_30;
> - _7 = _2 + 1ul;
> - _8 = _7 * 4ul;
> + _7 = _2 + _Literal(__SIZETYPE__)1;
> + _8 = _7 * _Literal(__SIZETYPE__)4;
> _9 = x_23(D) + _8;
> _10 = __MEM <int> (_9);
> sum_25 = _10 + sum_24;
> - _11 = _2 + 2ul;
> - _12 = _11 * 4ul;
> + _11 = _2 + _Literal(__SIZETYPE__)2;
> + _12 = _11 * _Literal(__SIZETYPE__)4;
> _13 = x_23(D) + _12;
> _14 = __MEM <int> (_13);
> sum_26 = _14 + sum_25;
> - _15 = _2 + 3ul;
> - _16 = _15 * 4ul;
> + _15 = _2 + _Literal(__SIZETYPE__)3;
> + _16 = _15 * _Literal(__SIZETYPE__)4;
> _17 = x_23(D) + _16;
> _18 = __MEM <int> (_17);
> sum_27 = _18 + sum_26;
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c
> index 6a0d55def30..2e6d15e1c9d 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-10b.c
> @@ -8,8 +8,8 @@ foo (int * x, int n)
> int i;
> int sum;
> int _1;
> - long unsigned int _2;
> - long unsigned int _3;
> + __SIZETYPE__ _2;
> + __SIZETYPE__ _3;
> int * _4;
> int _5;
> __SIZETYPE__ _7;
> @@ -38,23 +38,23 @@ foo (int * x, int n)
> sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
> i_32 = __PHI (__BB5: 0, __BB6: i_28);
> _1 = i_32 * 4;
> - _2 = (long unsigned int) _1;
> - _3 = _2 * 4ul;
> + _2 = (__SIZETYPE__) _1;
> + _3 = _2 * _Literal(__SIZETYPE__)4;
> _4 = x_23(D) + _3;
> _5 = __MEM <int> (_4);
> sum_24 = _5 + sum_30;
> - _7 = _2 + 1ul;
> - _8 = _7 * 4ul;
> + _7 = _2 + _Literal(__SIZETYPE__)1;
> + _8 = _7 * _Literal(__SIZETYPE__)4;
> _9 = x_23(D) + _8;
> _100 = __MEM <int> (_9);
> sum_25 = sum_24 + _100;
> - _11 = _2 + 2ul;
> - _12 = _11 * 4ul;
> + _11 = _2 + _Literal(__SIZETYPE__)2;
> + _12 = _11 * _Literal(__SIZETYPE__)4;
> _13 = x_23(D) + _12;
> _14 = __MEM <int> (_13);
> sum_26 = _14 + sum_25;
> - _15 = _2 + 3ul;
> - _16 = _15 * 4ul;
> + _15 = _2 + _Literal(__SIZETYPE__)3;
> + _16 = _15 * _Literal(__SIZETYPE__)4;
> _17 = x_23(D) + _16;
> _18 = __MEM <int> (_17);
> sum_27 = _18 + sum_26;
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c
> index 20df2626764..25a21adb729 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-10c.c
> @@ -8,8 +8,8 @@ foo (int * x, int n)
> int i;
> int sum;
> int _1;
> - long unsigned int _2;
> - long unsigned int _3;
> + __SIZETYPE__ _2;
> + __SIZETYPE__ _3;
> int * _4;
> int _5;
> __SIZETYPE__ _7;
> @@ -38,7 +38,7 @@ foo (int * x, int n)
> sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
> i_32 = __PHI (__BB5: 0, __BB6: i_28);
> _1 = i_32 * 4;
> - _2 = (long unsigned int) _1;
> + _2 = (__SIZETYPE__) _1;
> _3 = _2 * 4ul;
> _4 = x_23(D) + _3;
> _5 = __MEM <int> (_4);
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c
> index 8a512d5c14d..e96f9c42dcc 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-10d.c
> @@ -8,8 +8,8 @@ foo (int * x, int n)
> int i;
> int sum;
> int _1;
> - long unsigned int _2;
> - long unsigned int _3;
> + __SIZETYPE__ _2;
> + __SIZETYPE__ _3;
> int * _4;
> int _5;
> __SIZETYPE__ _7;
> @@ -38,7 +38,7 @@ foo (int * x, int n)
> sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
> i_32 = __PHI (__BB5: 0, __BB6: i_28);
> _1 = i_32 * 4;
> - _2 = (long unsigned int) _1;
> + _2 = (__SIZETYPE__) _1;
> _3 = _2 * 4ul;
> _4 = x_23(D) + _3;
> _5 = __MEM <int> (_4);
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c
> index 268ec9db77d..3a2c583d671 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-10e.c
> @@ -8,8 +8,8 @@ foo (int * x, int n)
> int i;
> int sum;
> int _1;
> - long unsigned int _2;
> - long unsigned int _3;
> + __SIZETYPE__ _2;
> + __SIZETYPE__ _3;
> int * _4;
> int _100;
> __SIZETYPE__ _7;
> @@ -38,7 +38,7 @@ foo (int * x, int n)
> sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
> i_32 = __PHI (__BB5: 0, __BB6: i_28);
> _1 = i_32 * 4;
> - _2 = (long unsigned int) _1;
> + _2 = (__SIZETYPE__) _1;
> _3 = _2 * 4ul;
> _4 = x_23(D) + _3;
> _100 = __MEM <int> (_4);
> diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c
> index 7b3d73acb88..a4fb043004c 100644
> --- a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c
> @@ -6,8 +6,8 @@ double __GIMPLE (ssa, startwith("loop"))
> neg_xi (double *x)
> {
> int i;
> - long unsigned int index;
> - long unsigned int offset;
> + __SIZETYPE__ index;
> + __SIZETYPE__ offset;
> double * xi_ptr;
> double xi;
> double neg_xi;
> @@ -21,8 +21,8 @@ neg_xi (double *x)
> res_1 = __PHI (__BB5: 0.0, __BB3: res_2);
> i_4 = __PHI (__BB5: 0, __BB3: i_5);
> ivtmp_6 = __PHI (__BB5: 100U, __BB3: ivtmp_7);
> - index = (long unsigned int) i_4;
> - offset = index * 8UL;
> + index = (__SIZE_TYPE__) i_4;
> + offset = index * _Literal(__SIZE_TYPE__) 8;
> xi_ptr = x_8(D) + offset;
> xi = *xi_ptr;
> neg_xi = -xi;
> diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c
> index e34bfa907a7..b10147298d3 100644
> --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-19.c
> @@ -7,8 +7,8 @@ foo (int * f, int d, int e)
> int t;
> int a;
> int i;
> - long unsigned int _1;
> - long unsigned int _2;
> + __SIZETYPE__ _1;
> + __SIZETYPE__ _2;
> int * _3;
> int _4;
>
> @@ -17,8 +17,8 @@ foo (int * f, int d, int e)
>
> __BB(3,loop_header(1),guessed_local(1063004408)):
> i_18 = __PHI (__BB8: i_15, __BB2: 0);
> - _1 = (long unsigned int) i_18;
> - _2 = _1 * 4ul;
> + _1 = (__SIZETYPE__) i_18;
> + _2 = _1 * _Literal(__SIZETYPE__) 4;
> _3 = f_9(D) + _2;
> a_10 = __MEM <int> (_3);
> if (a_10 < 0)
> --
> 2.39.3
>
@@ -8,8 +8,8 @@ foo (int * x, int n)
int i;
int sum;
int _1;
- long unsigned int _2;
- long unsigned int _3;
+ __SIZETYPE__ _2;
+ __SIZETYPE__ _3;
int * _4;
int _5;
__SIZETYPE__ _7;
@@ -38,23 +38,23 @@ foo (int * x, int n)
sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
i_32 = __PHI (__BB5: 0, __BB6: i_28);
_1 = i_32 * 4;
- _2 = (long unsigned int) _1;
- _3 = _2 * 4ul;
+ _2 = (__SIZETYPE__) _1;
+ _3 = _2 * _Literal(__SIZETYPE__)4;
_4 = x_23(D) + _3;
_5 = __MEM <int> (_4);
sum_24 = _5 + sum_30;
- _7 = _2 + 1ul;
- _8 = _7 * 4ul;
+ _7 = _2 + _Literal(__SIZETYPE__)1;
+ _8 = _7 * _Literal(__SIZETYPE__)4;
_9 = x_23(D) + _8;
_10 = __MEM <int> (_9);
sum_25 = _10 + sum_24;
- _11 = _2 + 2ul;
- _12 = _11 * 4ul;
+ _11 = _2 + _Literal(__SIZETYPE__)2;
+ _12 = _11 * _Literal(__SIZETYPE__)4;
_13 = x_23(D) + _12;
_14 = __MEM <int> (_13);
sum_26 = _14 + sum_25;
- _15 = _2 + 3ul;
- _16 = _15 * 4ul;
+ _15 = _2 + _Literal(__SIZETYPE__)3;
+ _16 = _15 * _Literal(__SIZETYPE__)4;
_17 = x_23(D) + _16;
_18 = __MEM <int> (_17);
sum_27 = _18 + sum_26;
@@ -8,8 +8,8 @@ foo (int * x, int n)
int i;
int sum;
int _1;
- long unsigned int _2;
- long unsigned int _3;
+ __SIZETYPE__ _2;
+ __SIZETYPE__ _3;
int * _4;
int _5;
__SIZETYPE__ _7;
@@ -38,23 +38,23 @@ foo (int * x, int n)
sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
i_32 = __PHI (__BB5: 0, __BB6: i_28);
_1 = i_32 * 4;
- _2 = (long unsigned int) _1;
- _3 = _2 * 4ul;
+ _2 = (__SIZETYPE__) _1;
+ _3 = _2 * _Literal(__SIZETYPE__)4;
_4 = x_23(D) + _3;
_5 = __MEM <int> (_4);
sum_24 = _5 + sum_30;
- _7 = _2 + 1ul;
- _8 = _7 * 4ul;
+ _7 = _2 + _Literal(__SIZETYPE__)1;
+ _8 = _7 * _Literal(__SIZETYPE__)4;
_9 = x_23(D) + _8;
_100 = __MEM <int> (_9);
sum_25 = sum_24 + _100;
- _11 = _2 + 2ul;
- _12 = _11 * 4ul;
+ _11 = _2 + _Literal(__SIZETYPE__)2;
+ _12 = _11 * _Literal(__SIZETYPE__)4;
_13 = x_23(D) + _12;
_14 = __MEM <int> (_13);
sum_26 = _14 + sum_25;
- _15 = _2 + 3ul;
- _16 = _15 * 4ul;
+ _15 = _2 + _Literal(__SIZETYPE__)3;
+ _16 = _15 * _Literal(__SIZETYPE__)4;
_17 = x_23(D) + _16;
_18 = __MEM <int> (_17);
sum_27 = _18 + sum_26;
@@ -8,8 +8,8 @@ foo (int * x, int n)
int i;
int sum;
int _1;
- long unsigned int _2;
- long unsigned int _3;
+ __SIZETYPE__ _2;
+ __SIZETYPE__ _3;
int * _4;
int _5;
__SIZETYPE__ _7;
@@ -38,7 +38,7 @@ foo (int * x, int n)
sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
i_32 = __PHI (__BB5: 0, __BB6: i_28);
_1 = i_32 * 4;
- _2 = (long unsigned int) _1;
+ _2 = (__SIZETYPE__) _1;
_3 = _2 * 4ul;
_4 = x_23(D) + _3;
_5 = __MEM <int> (_4);
@@ -8,8 +8,8 @@ foo (int * x, int n)
int i;
int sum;
int _1;
- long unsigned int _2;
- long unsigned int _3;
+ __SIZETYPE__ _2;
+ __SIZETYPE__ _3;
int * _4;
int _5;
__SIZETYPE__ _7;
@@ -38,7 +38,7 @@ foo (int * x, int n)
sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
i_32 = __PHI (__BB5: 0, __BB6: i_28);
_1 = i_32 * 4;
- _2 = (long unsigned int) _1;
+ _2 = (__SIZETYPE__) _1;
_3 = _2 * 4ul;
_4 = x_23(D) + _3;
_5 = __MEM <int> (_4);
@@ -8,8 +8,8 @@ foo (int * x, int n)
int i;
int sum;
int _1;
- long unsigned int _2;
- long unsigned int _3;
+ __SIZETYPE__ _2;
+ __SIZETYPE__ _3;
int * _4;
int _100;
__SIZETYPE__ _7;
@@ -38,7 +38,7 @@ foo (int * x, int n)
sum_30 = __PHI (__BB5: 0, __BB6: sum_27);
i_32 = __PHI (__BB5: 0, __BB6: i_28);
_1 = i_32 * 4;
- _2 = (long unsigned int) _1;
+ _2 = (__SIZETYPE__) _1;
_3 = _2 * 4ul;
_4 = x_23(D) + _3;
_100 = __MEM <int> (_4);
@@ -6,8 +6,8 @@ double __GIMPLE (ssa, startwith("loop"))
neg_xi (double *x)
{
int i;
- long unsigned int index;
- long unsigned int offset;
+ __SIZETYPE__ index;
+ __SIZETYPE__ offset;
double * xi_ptr;
double xi;
double neg_xi;
@@ -21,8 +21,8 @@ neg_xi (double *x)
res_1 = __PHI (__BB5: 0.0, __BB3: res_2);
i_4 = __PHI (__BB5: 0, __BB3: i_5);
ivtmp_6 = __PHI (__BB5: 100U, __BB3: ivtmp_7);
- index = (long unsigned int) i_4;
- offset = index * 8UL;
+ index = (__SIZE_TYPE__) i_4;
+ offset = index * _Literal(__SIZE_TYPE__) 8;
xi_ptr = x_8(D) + offset;
xi = *xi_ptr;
neg_xi = -xi;
@@ -7,8 +7,8 @@ foo (int * f, int d, int e)
int t;
int a;
int i;
- long unsigned int _1;
- long unsigned int _2;
+ __SIZETYPE__ _1;
+ __SIZETYPE__ _2;
int * _3;
int _4;
@@ -17,8 +17,8 @@ foo (int * f, int d, int e)
__BB(3,loop_header(1),guessed_local(1063004408)):
i_18 = __PHI (__BB8: i_15, __BB2: 0);
- _1 = (long unsigned int) i_18;
- _2 = _1 * 4ul;
+ _1 = (__SIZETYPE__) i_18;
+ _2 = _1 * _Literal(__SIZETYPE__) 4;
_3 = f_9(D) + _2;
a_10 = __MEM <int> (_3);
if (a_10 < 0)