testsuite: Fix up gcc.target/s390/pr96127.c test for modern C [PR96127]

Message ID ZWzKks5+qQ/i4t2A@tucnak
State Unresolved
Headers
Series testsuite: Fix up gcc.target/s390/pr96127.c test for modern C [PR96127] |

Checks

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

Commit Message

Jakub Jelinek Dec. 3, 2023, 6:36 p.m. UTC
  Hi!

I've noticed this test regressed on s390x-linux with the addition of the
switch to modern C patchset.  Haven't tried to reproduce the ICE, but as it
was a backend ICE and FE after warning used to add such casts before (now
errors), I think this ought to keep the testcase testing what was intended
before.

Ok for trunk?

2023-12-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/96127
	* gcc.target/s390/pr96127.c (c1): Add casts to long int *.


	Jakub
  

Comments

Andreas Krebbel Dec. 7, 2023, 7:52 a.m. UTC | #1
On 12/3/23 19:36, Jakub Jelinek wrote:
> Hi!
> 
> I've noticed this test regressed on s390x-linux with the addition of the
> switch to modern C patchset.  Haven't tried to reproduce the ICE, but as it
> was a backend ICE and FE after warning used to add such casts before (now
> errors), I think this ought to keep the testcase testing what was intended
> before.
> 
> Ok for trunk?

Ok, thanks!

Andreas
  

Patch

--- gcc/testsuite/gcc.target/s390/pr96127.c.jj	2020-07-28 15:39:10.058755540 +0200
+++ gcc/testsuite/gcc.target/s390/pr96127.c	2023-12-03 19:19:52.140110428 +0100
@@ -7,7 +7,7 @@  void
 c1 (int oz, int dk, int ub)
 {
   int *hd = 0;
-  long int *th = &dk;
+  long int *th = (long int *) &dk;
 
   while (ub < 1)
     {
@@ -17,7 +17,7 @@  c1 (int oz, int dk, int ub)
 
   while (oz < 2)
     {
-      long int *lq = &oz;
+      long int *lq = (long int *) &oz;
 
       (*hd < (*lq = *th)) < oz;