[Bug c/83117] [8 Regression] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 26 07:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The warning is nothing new, GCC has been warning for that for years. What my
patch did is just better optimization, so the compiler can see the UB.
Try:
extern long do_test_aligned ();
static long (*const do_test_v1) (long a, ...) = (void *) do_test_aligned;
extern void check_results (long);
int test (long a)
{
long ret;
ret = do_test_v1 (a);
ret += (long (*) (long a, ...)) do_test_aligned;
check_results (ret);
}
We've warned about the latter, but not the former, since we weren't able to
fold a const var to its initializer.
So, either the tests shouldn't use const on these, something like:
- out << "static __attribute__ ((ms_abi)) long (*const do_test_"
+ out << "static __attribute__ ((ms_abi)) long (*do_test_"
or they should use const volatile, or -w, or should use proper prototypes.
Daniel needs to decide what to do, it isn't obviously clear what the intent is.
More information about the Gcc-bugs
mailing list