testsuite: Fix fallout of turning warnings into errors on 32-bit Arm

Message ID 20240113005515.1029712-1-thiago.bauermann@linaro.org
State Unresolved
Headers
Series testsuite: Fix fallout of turning warnings into errors on 32-bit Arm |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Thiago Jung Bauermann Jan. 13, 2024, 12:55 a.m. UTC
  Since commits 2c3db94d9fd ("c: Turn int-conversion warnings into
permerrors") and 55e94561e97e ("c: Turn -Wimplicit-function-declaration
into a permerror") these tests fail with errors such as:

  FAIL: gcc.target/arm/pr59858.c (test for excess errors)
  FAIL: gcc.target/arm/pr65647.c (test for excess errors)
  FAIL: gcc.target/arm/pr65710.c (test for excess errors)
  FAIL: gcc.target/arm/pr97969.c (test for excess errors)

Here's one example of the excess errors:

  FAIL: gcc.target/arm/pr65647.c (test for excess errors)
  Excess errors:
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:17: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:51: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:62: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:7:48: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:8:9: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:24:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:25:5: error: initialization of 'int' from 'struct S1 *' makes integer from pointer without a cast [-Wint-conversion]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:41:3: error: implicit declaration of function 'fn3'; did you mean 'fn2'? [-Wimplicit-function-declaration]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:46:3: error: implicit declaration of function 'fn5'; did you mean 'fn4'? [-Wimplicit-function-declaration]
  /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:57:16: error: implicit declaration of function 'fn6'; did you mean 'fn4'? [-Wimplicit-function-declaration]

PR rtl-optimization/59858 and PR target/65710 test the fix of an ICE.
PR target/65647 and PR target/97969 test for a compilation infinite loop.

Therefore, add -fpermissive so that the tests behave as they did previously.
Tested on armv8l-linux-gnueabihf.

gcc/testsuite/ChangeLog:
	* gcc.target/arm/pr59858.c: Add -fpermissive.
	* gcc/testsuite/gcc.target/arm/pr65647.c: Likewise.
	* gcc/testsuite/gcc.target/arm/pr65710.c: Likewise.
	* gcc/testsuite/gcc.target/arm/pr97969.c: Likewise.
---
 gcc/testsuite/gcc.target/arm/pr59858.c | 2 +-
 gcc/testsuite/gcc.target/arm/pr65647.c | 2 +-
 gcc/testsuite/gcc.target/arm/pr65710.c | 2 +-
 gcc/testsuite/gcc.target/arm/pr97969.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Andre Vieira (lists) March 1, 2024, 2:23 p.m. UTC | #1
Hi Thiago,

Thanks for this, LGTM but I can't approve this, CC'ing Richard.

Do have a nitpick, in the gcc/testsuite/ChangeLog: remove 
'gcc/testsuite' from bullet points 2-4.

Kind regards,
Andre

On 13/01/2024 00:55, Thiago Jung Bauermann wrote:
> Since commits 2c3db94d9fd ("c: Turn int-conversion warnings into
> permerrors") and 55e94561e97e ("c: Turn -Wimplicit-function-declaration
> into a permerror") these tests fail with errors such as:
> 
>    FAIL: gcc.target/arm/pr59858.c (test for excess errors)
>    FAIL: gcc.target/arm/pr65647.c (test for excess errors)
>    FAIL: gcc.target/arm/pr65710.c (test for excess errors)
>    FAIL: gcc.target/arm/pr97969.c (test for excess errors)
> 
> Here's one example of the excess errors:
> 
>    FAIL: gcc.target/arm/pr65647.c (test for excess errors)
>    Excess errors:
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:17: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:51: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:62: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:7:48: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:8:9: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:24:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:25:5: error: initialization of 'int' from 'struct S1 *' makes integer from pointer without a cast [-Wint-conversion]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:41:3: error: implicit declaration of function 'fn3'; did you mean 'fn2'? [-Wimplicit-function-declaration]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:46:3: error: implicit declaration of function 'fn5'; did you mean 'fn4'? [-Wimplicit-function-declaration]
>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:57:16: error: implicit declaration of function 'fn6'; did you mean 'fn4'? [-Wimplicit-function-declaration]
> 
> PR rtl-optimization/59858 and PR target/65710 test the fix of an ICE.
> PR target/65647 and PR target/97969 test for a compilation infinite loop.
> 
> Therefore, add -fpermissive so that the tests behave as they did previously.
> Tested on armv8l-linux-gnueabihf.
> 
> gcc/testsuite/ChangeLog:
> 	* gcc.target/arm/pr59858.c: Add -fpermissive.
> 	* gcc/testsuite/gcc.target/arm/pr65647.c: Likewise.
> 	* gcc/testsuite/gcc.target/arm/pr65710.c: Likewise.
> 	* gcc/testsuite/gcc.target/arm/pr97969.c: Likewise.
> ---
>   gcc/testsuite/gcc.target/arm/pr59858.c | 2 +-
>   gcc/testsuite/gcc.target/arm/pr65647.c | 2 +-
>   gcc/testsuite/gcc.target/arm/pr65710.c | 2 +-
>   gcc/testsuite/gcc.target/arm/pr97969.c | 2 +-
>   4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c
> index 3360b48e8586..9336edfce277 100644
> --- a/gcc/testsuite/gcc.target/arm/pr59858.c
> +++ b/gcc/testsuite/gcc.target/arm/pr59858.c
> @@ -1,5 +1,5 @@
>   /* { dg-do compile } */
> -/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */
> +/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w -fpermissive" } */
>   /* { dg-require-effective-target fpic } */
>   /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */
>   /* { dg-require-effective-target arm_arch_v5te_thumb_ok } */
> diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/gcc.target/arm/pr65647.c
> index 26b4e399f6be..3cbf6b804ec0 100644
> --- a/gcc/testsuite/gcc.target/arm/pr65647.c
> +++ b/gcc/testsuite/gcc.target/arm/pr65647.c
> @@ -1,7 +1,7 @@
>   /* { dg-do compile } */
>   /* { dg-require-effective-target arm_arch_v6m_ok } */
>   /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
> -/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft" } */
> +/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft -fpermissive" } */
>   
>   a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
>     y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
> diff --git a/gcc/testsuite/gcc.target/arm/pr65710.c b/gcc/testsuite/gcc.target/arm/pr65710.c
> index 103ce1d45f77..4cbf7817af7e 100644
> --- a/gcc/testsuite/gcc.target/arm/pr65710.c
> +++ b/gcc/testsuite/gcc.target/arm/pr65710.c
> @@ -1,6 +1,6 @@
>   /* { dg-do compile } */
>   /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
> -/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w" } */
> +/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w -fpermissive" } */
>   /* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
>   
>   struct ST {
> diff --git a/gcc/testsuite/gcc.target/arm/pr97969.c b/gcc/testsuite/gcc.target/arm/pr97969.c
> index b8c3a23676a2..5507a1024865 100644
> --- a/gcc/testsuite/gcc.target/arm/pr97969.c
> +++ b/gcc/testsuite/gcc.target/arm/pr97969.c
> @@ -1,6 +1,6 @@
>   /* { dg-do compile } */
>   /* { dg-require-effective-target arm_arch_v6m_ok } */
> -/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os" } */
> +/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os -fpermissive" } */
>   /* { dg-add-options arm_arch_v6m } */
>   
>   typedef a[23];
  
Richard Earnshaw (lists) March 1, 2024, 2:28 p.m. UTC | #2
On 01/03/2024 14:23, Andre Vieira (lists) wrote:
> Hi Thiago,
> 
> Thanks for this, LGTM but I can't approve this, CC'ing Richard.
> 
> Do have a nitpick, in the gcc/testsuite/ChangeLog: remove 'gcc/testsuite' from bullet points 2-4.
> 

Yes, this is OK with the change Andre mentioned (your push will fail if you don't fix that).

R.

PS, if you've set up GCC git customizations (see contrib/gcc-git-customization.sh), you can verify things like this with 'git gcc-verify HEAD^..HEAD'


> Kind regards,
> Andre
> 
> On 13/01/2024 00:55, Thiago Jung Bauermann wrote:
>> Since commits 2c3db94d9fd ("c: Turn int-conversion warnings into
>> permerrors") and 55e94561e97e ("c: Turn -Wimplicit-function-declaration
>> into a permerror") these tests fail with errors such as:
>>
>>    FAIL: gcc.target/arm/pr59858.c (test for excess errors)
>>    FAIL: gcc.target/arm/pr65647.c (test for excess errors)
>>    FAIL: gcc.target/arm/pr65710.c (test for excess errors)
>>    FAIL: gcc.target/arm/pr97969.c (test for excess errors)
>>
>> Here's one example of the excess errors:
>>
>>    FAIL: gcc.target/arm/pr65647.c (test for excess errors)
>>    Excess errors:
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:17: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:51: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:62: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:7:48: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:8:9: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:24:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:25:5: error: initialization of 'int' from 'struct S1 *' makes integer from pointer without a cast [-Wint-conversion]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:41:3: error: implicit declaration of function 'fn3'; did you mean 'fn2'? [-Wimplicit-function-declaration]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:46:3: error: implicit declaration of function 'fn5'; did you mean 'fn4'? [-Wimplicit-function-declaration]
>>    /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:57:16: error: implicit declaration of function 'fn6'; did you mean 'fn4'? [-Wimplicit-function-declaration]
>>
>> PR rtl-optimization/59858 and PR target/65710 test the fix of an ICE.
>> PR target/65647 and PR target/97969 test for a compilation infinite loop.
>>
>> Therefore, add -fpermissive so that the tests behave as they did previously.
>> Tested on armv8l-linux-gnueabihf.
>>
>> gcc/testsuite/ChangeLog:
>>     * gcc.target/arm/pr59858.c: Add -fpermissive.
>>     * gcc/testsuite/gcc.target/arm/pr65647.c: Likewise.
>>     * gcc/testsuite/gcc.target/arm/pr65710.c: Likewise.
>>     * gcc/testsuite/gcc.target/arm/pr97969.c: Likewise.
>> ---
>>   gcc/testsuite/gcc.target/arm/pr59858.c | 2 +-
>>   gcc/testsuite/gcc.target/arm/pr65647.c | 2 +-
>>   gcc/testsuite/gcc.target/arm/pr65710.c | 2 +-
>>   gcc/testsuite/gcc.target/arm/pr97969.c | 2 +-
>>   4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c
>> index 3360b48e8586..9336edfce277 100644
>> --- a/gcc/testsuite/gcc.target/arm/pr59858.c
>> +++ b/gcc/testsuite/gcc.target/arm/pr59858.c
>> @@ -1,5 +1,5 @@
>>   /* { dg-do compile } */
>> -/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */
>> +/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w -fpermissive" } */
>>   /* { dg-require-effective-target fpic } */
>>   /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */
>>   /* { dg-require-effective-target arm_arch_v5te_thumb_ok } */
>> diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/gcc.target/arm/pr65647.c
>> index 26b4e399f6be..3cbf6b804ec0 100644
>> --- a/gcc/testsuite/gcc.target/arm/pr65647.c
>> +++ b/gcc/testsuite/gcc.target/arm/pr65647.c
>> @@ -1,7 +1,7 @@
>>   /* { dg-do compile } */
>>   /* { dg-require-effective-target arm_arch_v6m_ok } */
>>   /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
>> -/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft" } */
>> +/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft -fpermissive" } */
>>     a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
>>     y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
>> diff --git a/gcc/testsuite/gcc.target/arm/pr65710.c b/gcc/testsuite/gcc.target/arm/pr65710.c
>> index 103ce1d45f77..4cbf7817af7e 100644
>> --- a/gcc/testsuite/gcc.target/arm/pr65710.c
>> +++ b/gcc/testsuite/gcc.target/arm/pr65710.c
>> @@ -1,6 +1,6 @@
>>   /* { dg-do compile } */
>>   /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
>> -/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w" } */
>> +/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w -fpermissive" } */
>>   /* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
>>     struct ST {
>> diff --git a/gcc/testsuite/gcc.target/arm/pr97969.c b/gcc/testsuite/gcc.target/arm/pr97969.c
>> index b8c3a23676a2..5507a1024865 100644
>> --- a/gcc/testsuite/gcc.target/arm/pr97969.c
>> +++ b/gcc/testsuite/gcc.target/arm/pr97969.c
>> @@ -1,6 +1,6 @@
>>   /* { dg-do compile } */
>>   /* { dg-require-effective-target arm_arch_v6m_ok } */
>> -/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os" } */
>> +/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os -fpermissive" } */
>>   /* { dg-add-options arm_arch_v6m } */
>>     typedef a[23];
  

Patch

diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c
index 3360b48e8586..9336edfce277 100644
--- a/gcc/testsuite/gcc.target/arm/pr59858.c
+++ b/gcc/testsuite/gcc.target/arm/pr59858.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */
+/* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w -fpermissive" } */
 /* { dg-require-effective-target fpic } */
 /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */
 /* { dg-require-effective-target arm_arch_v5te_thumb_ok } */
diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/gcc.target/arm/pr65647.c
index 26b4e399f6be..3cbf6b804ec0 100644
--- a/gcc/testsuite/gcc.target/arm/pr65647.c
+++ b/gcc/testsuite/gcc.target/arm/pr65647.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v6m_ok } */
 /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
-/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft" } */
+/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft -fpermissive" } */
 
 a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
   y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
diff --git a/gcc/testsuite/gcc.target/arm/pr65710.c b/gcc/testsuite/gcc.target/arm/pr65710.c
index 103ce1d45f77..4cbf7817af7e 100644
--- a/gcc/testsuite/gcc.target/arm/pr65710.c
+++ b/gcc/testsuite/gcc.target/arm/pr65710.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
-/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w" } */
+/* { dg-options "-mthumb -O2 -mfloat-abi=soft -w -fpermissive" } */
 /* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
 
 struct ST {
diff --git a/gcc/testsuite/gcc.target/arm/pr97969.c b/gcc/testsuite/gcc.target/arm/pr97969.c
index b8c3a23676a2..5507a1024865 100644
--- a/gcc/testsuite/gcc.target/arm/pr97969.c
+++ b/gcc/testsuite/gcc.target/arm/pr97969.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v6m_ok } */
-/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os" } */
+/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os -fpermissive" } */
 /* { dg-add-options arm_arch_v6m } */
 
 typedef a[23];