Commit 45ee7a35 by Martin Sebor

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.
parent 3b515f74
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* gcc.dg/Wbuiltin-declaration-mismatch-15.c: New test. * gcc.dg/Wbuiltin-declaration-mismatch-15.c: New test.
* gcc.dg/pr62090.c: Prune expected warning. * gcc.dg/pr62090.c: Prune expected warning.
* gcc.dg/pr89314.c: Look for warning name rather than text. * 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> 2020-03-13 Uroš Bizjak <ubizjak@gmail.com>
......
...@@ -8,23 +8,23 @@ ...@@ -8,23 +8,23 @@
a PASS. Where the bug trigs (at the time this test-case was added), 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. */ cas_int is also false but the fallback isn't used. */
__attribute__((__noinline__, __noclone__)) __attribute__((__noinline__, __noclone__))
int unsigned
# if __INT_MAX__ == 0x7fff # if __INT_MAX__ == 0x7fff
__sync_fetch_and_add_2 __sync_fetch_and_add_2
# else # else
__sync_fetch_and_add_4 __sync_fetch_and_add_4
# endif # endif
(int *at, int val) (volatile void *at, unsigned val)
{ {
int tmp = *at; unsigned tmp = *(volatile unsigned*)at;
asm (""); asm ("");
*at = tmp + val; *(volatile unsigned*)at = tmp + val;
return tmp; return tmp;
} }
#endif #endif
__attribute__((__noinline__, __noclone__)) __attribute__((__noinline__, __noclone__))
void g (int *at, int val) void g (unsigned *at, unsigned val)
{ {
asm (""); asm ("");
__sync_fetch_and_add (at, val); __sync_fetch_and_add (at, val);
...@@ -35,8 +35,8 @@ int main(void) ...@@ -35,8 +35,8 @@ int main(void)
/* On PTX it is not valid to perform atomic operations on auto /* On PTX it is not valid to perform atomic operations on auto
variables, which end up in .local. Making this static places it variables, which end up in .local. Making this static places it
in .global. */ in .global. */
static int x = 41; static unsigned x = 41;
int a = 1; unsigned a = 1;
g (&x, a); g (&x, a);
if (x != 42) if (x != 42)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment