[gcc(refs/users/marxin/heads/marxin-gcc-benchmark-branch)] PR c/94040 - ICE on a call to an invalid redeclaration of strftime
Martin Liska
marxin@gcc.gnu.org
Mon Mar 30 10:48:29 GMT 2020
https://gcc.gnu.org/g:45ee7a35f347e59f003d65bce0d43d5123d827cf
commit 45ee7a35f347e59f003d65bce0d43d5123d827cf
Author: Martin Sebor <msebor@redhat.com>
Date: Fri Mar 13 12:29:33 2020 -0600
PR c/94040 - ICE on a call to an invalid redeclaration of strftime
gcc/testsuite/ChangeLog:
* gcc.dg/torture/pr54261-1.c: Correct built-in declartion.
Diff:
---
gcc/testsuite/ChangeLog | 1 +
gcc/testsuite/gcc.dg/torture/pr54261-1.c | 14 +++++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a379b4039d7..e3d1fc3b50f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -7,6 +7,7 @@
* gcc.dg/Wbuiltin-declaration-mismatch-15.c: New test.
* gcc.dg/pr62090.c: Prune expected warning.
* gcc.dg/pr89314.c: Look for warning name rather than text.
+ * gcc.dg/torture/pr54261-1.c: Correct built-in declartion.
2020-03-13 Uroš Bizjak <ubizjak@gmail.com>
diff --git a/gcc/testsuite/gcc.dg/torture/pr54261-1.c b/gcc/testsuite/gcc.dg/torture/pr54261-1.c
index 071b3232d46..7286124e9d6 100644
--- a/gcc/testsuite/gcc.dg/torture/pr54261-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr54261-1.c
@@ -8,23 +8,23 @@
a PASS. Where the bug trigs (at the time this test-case was added),
cas_int is also false but the fallback isn't used. */
__attribute__((__noinline__, __noclone__))
-int
+unsigned
# if __INT_MAX__ == 0x7fff
__sync_fetch_and_add_2
# else
__sync_fetch_and_add_4
# endif
- (int *at, int val)
+ (volatile void *at, unsigned val)
{
- int tmp = *at;
+ unsigned tmp = *(volatile unsigned*)at;
asm ("");
- *at = tmp + val;
+ *(volatile unsigned*)at = tmp + val;
return tmp;
}
#endif
__attribute__((__noinline__, __noclone__))
-void g (int *at, int val)
+void g (unsigned *at, unsigned val)
{
asm ("");
__sync_fetch_and_add (at, val);
@@ -35,8 +35,8 @@ int main(void)
/* On PTX it is not valid to perform atomic operations on auto
variables, which end up in .local. Making this static places it
in .global. */
- static int x = 41;
- int a = 1;
+ static unsigned x = 41;
+ unsigned a = 1;
g (&x, a);
if (x != 42)
More information about the Gcc-cvs
mailing list