aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-07-25 21:50:33 +0000
committerAndrew Pinski <apinski@marvell.com>2023-07-25 14:56:23 -0700
commit67357270772b9131f1780267485c9eba0331bd6f (patch)
treeb82d44b2656292d936317b3d6c1dfaed0c85376b /gcc
parent099d40ba776c0722888c3aa40c87c818892e04bb (diff)
downloadgcc-67357270772b9131f1780267485c9eba0331bd6f.zip
gcc-67357270772b9131f1780267485c9eba0331bd6f.tar.gz
gcc-67357270772b9131f1780267485c9eba0331bd6f.tar.bz2
Fix 110803: use of plain char instead of signed char
So the problem here is that plain char can either be signed or unsigned depending on the target (powerpc and aarch64 are unsigned while most other targets are signed). So the testcase gcc.c-torture/execute/pr109986.c was assuming plain char was signed char which is wrong so it is better to just change the `char` to be `signed char`. Note gcc.c-torture/execute/pr109986.c includes gcc.dg/tree-ssa/pr109986.c where the plain char was being used. Committed as obvious after a quick test to make sure gcc.c-torture/execute/pr109986.c now passes and gcc.dg/tree-ssa/pr109986.c still passes. gcc/testsuite/ChangeLog: PR testsuite/110803 * gcc.dg/tree-ssa/pr109986.c: Change plain char to be `signed char`.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr109986.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c b/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c
index 45f099b..0724510 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c
@@ -16,14 +16,14 @@ t2 (int a, int b)
return a ^ (~a | (unsigned int) b);
}
-__attribute__((noipa)) char
-t3 (char a, char b)
+__attribute__((noipa)) signed char
+t3 (signed char a, signed char b)
{
return (b | ~a) ^ a;
}
__attribute__((noipa)) unsigned char
-t4 (char a, char b)
+t4 (signed char a, signed char b)
{
return ((unsigned char) a) ^ (b | ~a);
}
@@ -89,20 +89,20 @@ t12 (int a, unsigned int b)
return t3;
}
-__attribute__((noipa)) char
-t13 (char a, char b)
+__attribute__((noipa)) signed char
+t13 (signed char a, signed char b)
{
- char t1 = ~a;
- char t2 = b | t1;
- char t3 = t2 ^ a;
+ signed char t1 = ~a;
+ signed char t2 = b | t1;
+ signed char t3 = t2 ^ a;
return t3;
}
__attribute__((noipa)) unsigned char
-t14 (unsigned char a, char b)
+t14 (unsigned char a, signed char b)
{
unsigned char t1 = ~a;
- char t2 = b | t1;
+ signed char t2 = b | t1;
unsigned char t3 = a ^ t2;
return t3;
}