invoke.texi: Document the -Wsizeof-pointer-div warning.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 2 Jun 2017 04:06:59 +0000 (04:06 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Fri, 2 Jun 2017 04:06:59 +0000 (04:06 +0000)
commit40ffd95f56ad178148612c19304a4409d0a7ebac
tree29d5e4f52493dd00dab2bb7847d93038918e9f81
parent616dbacbac0a0d88551a2acafd0d84cf20f91d17
invoke.texi: Document the -Wsizeof-pointer-div warning.

gcc:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * doc/invoke.texi: Document the -Wsizeof-pointer-div warning.

gcc/c-family:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c.opt (Wsizeof-pointer-div): New warning option.

gcc/c:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * 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  <bernd.edlinger@hotmail.de>

        * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
        warning.

gcc/testsuite:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * 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
33 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wsizeof-pointer-div.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c
gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c
gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c
gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c
gcc/testsuite/gcc.target/i386/sse-set-ps-1.c
gcc/testsuite/gcc.target/i386/sse2-init-v16qi-1.c
gcc/testsuite/gcc.target/i386/sse2-init-v2di-1.c
gcc/testsuite/gcc.target/i386/sse2-init-v4si-1.c
gcc/testsuite/gcc.target/i386/sse2-init-v8hi-1.c
gcc/testsuite/gcc.target/i386/sse2-set-epi32-1.c
gcc/testsuite/gcc.target/i386/sse2-set-epi64x-1.c
gcc/testsuite/gcc.target/i386/sse4_1-init-v16qi-1.c
gcc/testsuite/gcc.target/i386/sse4_1-init-v2di-1.c
gcc/testsuite/gcc.target/i386/sse4_1-init-v4sf-1.c
gcc/testsuite/gcc.target/i386/sse4_1-init-v4si-1.c
gcc/testsuite/gcc.target/i386/sse4_1-set-epi32-1.c
gcc/testsuite/gcc.target/i386/sse4_1-set-epi64x-1.c
gcc/testsuite/gcc.target/i386/sse4_1-set-ps-1.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c/pr39591-2.c
libgomp/testsuite/libgomp.c/pr39591-3.c