From: Jozef Lawrynowicz Date: Thu, 8 Nov 2018 16:35:21 +0000 (+0000) Subject: attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent integer overflow when... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0cb40577fb3a4cbdadd96c5454d1cfdfb64b518;p=gcc.git attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent integer overflow when... 2018-11-08 Jozef Lawrynowicz * gcc.dg/attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent integer overflow when sizeof(short) == sizeof(int). * gcc.dg/attr-alloc_size-11.c: Likewise. * gcc.dg/attr-alloc_size-3.c: Likewise. * gcc.dg/attr-alloc_size-5.c: Likewise. * gcc.dg/builtin-stringop-chk-7.c: Likewise. From-SVN: r265928 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6caf9bab6dd..57f23679c41 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2018-11-08 Jozef Lawrynowicz + + * gcc.dg/attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent + integer overflow when sizeof(short) == sizeof(int). + * gcc.dg/attr-alloc_size-11.c: Likewise. + * gcc.dg/attr-alloc_size-3.c: Likewise. + * gcc.dg/attr-alloc_size-5.c: Likewise. + * gcc.dg/builtin-stringop-chk-7.c: Likewise. + 2018-11-08 Jozef Lawrynowicz * c-c++-common/patchable_function_entry-decl.c: Add regex to search for diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c index 40807171ff0..071c6aa1e3b 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c @@ -13,7 +13,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c index 301a06fd464..7f2fc49b740 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c @@ -11,7 +11,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c index 96ff077ef20..7e8c22fc66d 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c @@ -14,7 +14,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-5.c b/gcc/testsuite/gcc.dg/attr-alloc_size-5.c index f9884ed72f7..26ee43f87de 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-5.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-5.c @@ -12,7 +12,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c index 173e4ff7e2a..d3908a2cd09 100644 --- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c +++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c @@ -9,7 +9,7 @@ #define UCHAR_MAX (SCHAR_MAX * 2 + 1) #define SHRT_MAX __SHRT_MAX__ -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define UINT_MAX (INT_MAX * 2U + 1)