]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expres...
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Apr 2017 18:08:29 +0000 (20:08 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Apr 2017 18:08:29 +0000 (20:08 +0200)
commitb96a3e11572287992923065def1d64e8a2240f9b
tree23bd724a0c4faed70f670281fe97486db4f278f8
parent988ed78513a850a6c7eb2b99af93d68668d4a0c7
re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr)

PR sanitizer/80403
PR sanitizer/80404
PR sanitizer/80405
* fold-const.c (fold_ternary_loc): Use op1 instead of arg1 as argument
to fold_build2_loc.  Convert TREE_OPERAND (tem, 0) to type.  Use
op0 instead of fold_convert_loc (loc, type, arg0).

* g++.dg/ubsan/pr80403.C: New test.
* g++.dg/ubsan/pr80404.C: New test.
* g++.dg/ubsan/pr80405.C: New test.

From-SVN: r246881
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/pr80403.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr80404.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr80405.C [new file with mode: 0644]