From 40ffd95f56ad178148612c19304a4409d0a7ebac Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 2 Jun 2017 04:06:59 +0000 Subject: invoke.texi: Document the -Wsizeof-pointer-div warning. gcc: 2017-06-02 Bernd Edlinger * doc/invoke.texi: Document the -Wsizeof-pointer-div warning. gcc/c-family: 2017-06-02 Bernd Edlinger * c.opt (Wsizeof-pointer-div): New warning option. gcc/c: 2017-06-02 Bernd Edlinger * c-parser.c (c_parser_binary_expression): Implement the -Wsizeof_pointer_div warning. (c_parser_postfix_expression): Allow SIZEOF_EXPR as expr.original_code from a parenthesized expression. (c_parser_expr_list): Use c_last_sizeof_loc. * c-tree.h (c_last_sizeof_loc): New external. * c-typeck.c (c_last_sizeof_loc): New variable. (c_expr_sizeof_expr, c_expr_sizeof_type): Assign c_last_sizeof_loc. gcc/cp: 2017-06-02 Bernd Edlinger * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div warning. gcc/testsuite: 2017-06-02 Bernd Edlinger * c-c++-common/Wsizeof-pointer-div.c: New test. * gcc.dg/Wsizeof-pointer-memaccess1.c: Add test cases with parens. * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise. * gcc.target/i386/sse-init-v4hi-1.c: Fix test case. * gcc.target/i386/sse-init-v4sf-1.c: Likewise. * gcc.target/i386/sse-set-ps-1.c: Likewise. * gcc.target/i386/sse2-init-v16qi-1.c: Likewise. * gcc.target/i386/sse2-init-v2di-1.c: Likewise. * gcc.target/i386/sse2-init-v4si-1.c: Likewise. * gcc.target/i386/sse2-init-v8hi-1.c: Likewise. * gcc.target/i386/sse2-set-epi32-1.c: Likewise. * gcc.target/i386/sse2-set-epi64x-1.c: Likewise. * gcc.target/i386/sse4_1-init-v16qi-1.c: Likewise. * gcc.target/i386/sse4_1-init-v2di-1.c: Likewise. * gcc.target/i386/sse4_1-init-v4sf-1.c: Likewise. * gcc.target/i386/sse4_1-init-v4si-1.c: Likewise. * gcc.target/i386/sse4_1-set-epi32-1.c: Likewise. * gcc.target/i386/sse4_1-set-epi64x-1.c: Likewise. * gcc.target/i386/sse4_1-set-ps-1.c: Likewise. * libgomp.c/pr39591-2.c: Likewise. * libgomp.c/pr39591-3.c: Likewise. From-SVN: r248811 --- libgomp/testsuite/libgomp.c/pr39591-2.c | 2 +- libgomp/testsuite/libgomp.c/pr39591-3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libgomp/testsuite') diff --git a/libgomp/testsuite/libgomp.c/pr39591-2.c b/libgomp/testsuite/libgomp.c/pr39591-2.c index 3742829..2fe6421 100644 --- a/libgomp/testsuite/libgomp.c/pr39591-2.c +++ b/libgomp/testsuite/libgomp.c/pr39591-2.c @@ -11,7 +11,7 @@ foo (int *array) #pragma omp task { int j; - for (j = 0; j < sizeof array / sizeof array[0]; j++) + for (j = 0; j < 40; j++) if (array[j] != 0x55555555) #pragma omp atomic err++; diff --git a/libgomp/testsuite/libgomp.c/pr39591-3.c b/libgomp/testsuite/libgomp.c/pr39591-3.c index f09a389..81e8ca8 100644 --- a/libgomp/testsuite/libgomp.c/pr39591-3.c +++ b/libgomp/testsuite/libgomp.c/pr39591-3.c @@ -11,7 +11,7 @@ foo (int *array) #pragma omp task { int j; - for (j = 0; j < sizeof array / sizeof array[0]; j++) + for (j = 0; j < 40; j++) if (array[j] != 0x55555555) #pragma omp atomic err++; -- cgit v1.1