From 21c1e205664a2736741777ca34523d53b0edafa0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 15 Aug 2019 11:26:19 +0000 Subject: [PATCH] c-common.c (c_stddef_cpp_builtins): When the GIMPLE FE is enabled, define __SIZETYPE__. 2019-08-15 Richard Biener c-family/ * c-common.c (c_stddef_cpp_builtins): When the GIMPLE FE is enabled, define __SIZETYPE__. * gcc.dg/pr80170.c: Adjust to use __SIZETYPE__. From-SVN: r274528 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-common.c | 4 ++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr80170.c | 6 +----- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 48e59366123..a4a0bff38ef 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2019-08-15 Richard Biener + + * c-common.c (c_stddef_cpp_builtins): When the GIMPLE FE is + enabled, define __SIZETYPE__. + 2019-08-14 Christophe Lyon * c-attribs.c (c_common_attribute_table): Add "noinit" entry. Add diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 610cb905814..2810867235d 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5148,6 +5148,10 @@ c_stddef_cpp_builtins(void) builtin_define_with_value ("__INTPTR_TYPE__", INTPTR_TYPE, 0); if (UINTPTR_TYPE) builtin_define_with_value ("__UINTPTR_TYPE__", UINTPTR_TYPE, 0); + /* GIMPLE FE testcases need access to the GCC internal 'sizetype'. + Expose it as __SIZETYPE__. */ + if (flag_gimple) + builtin_define_with_value ("__SIZETYPE__", SIZETYPE, 0); } static void diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0008ff94b37..d076a771740 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-08-15 Richard Biener + + * gcc.dg/pr80170.c: Adjust to use __SIZETYPE__. + 2019-08-15 Richard Sandiford * gcc.target/aarch64/sve/loop_add_4.c: Expect 10 INCWs and diff --git a/gcc/testsuite/gcc.dg/pr80170.c b/gcc/testsuite/gcc.dg/pr80170.c index def051a59df..e400e141429 100644 --- a/gcc/testsuite/gcc.dg/pr80170.c +++ b/gcc/testsuite/gcc.dg/pr80170.c @@ -24,11 +24,7 @@ NullB (void * misalignedPtr) struct B * b; bb_2: -#if __SIZEOF_LONG__ == 8 - b_2 = misalignedPtr_1(D) + 18446744073709551608ul; -#else - b_2 = misalignedPtr_1(D) + 4294967292ul; -#endif + b_2 = misalignedPtr_1(D) + _Literal (__SIZETYPE__) -__SIZEOF_POINTER__; __MEM (b_2).a.a = _Literal (void *) 0; __MEM (b_2).a.b = _Literal (void *) 0; return; -- 2.30.2