diff options
author | Martin Sebor <msebor@redhat.com> | 2018-08-25 19:12:36 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-08-25 13:12:36 -0600 |
commit | 75e96bc80cf32a302c27bdbbec1ec7119a690857 (patch) | |
tree | 5a6e123e085eed215bd3edb996c21d13da4f07d2 /gcc/builtins.c | |
parent | 3d6fc627f6cb78ecf280622c05eed59e9150a5c7 (diff) | |
download | gcc-75e96bc80cf32a302c27bdbbec1ec7119a690857.zip gcc-75e96bc80cf32a302c27bdbbec1ec7119a690857.tar.gz gcc-75e96bc80cf32a302c27bdbbec1ec7119a690857.tar.bz2 |
re PR tree-optimization/87059 (internal compiler error: in set_value_range, at tree-vrp.c:289)
PR tree-optimization/87059
* builtins.c (expand_builtin_strncmp): Convert MIN_EXPR operand
to the same type as the other.
* fold-const.c (fold_binary_loc): Assert expectation.
From-SVN: r263855
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index b1a79f3..6a992bd 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4759,7 +4759,10 @@ expand_builtin_strncmp (tree exp, ATTRIBUTE_UNUSED rtx target, /* If we are not using the given length, we must incorporate it here. The actual new length parameter will be MIN(len,arg3) in this case. */ if (len != len3) - len = fold_build2_loc (loc, MIN_EXPR, TREE_TYPE (len), len, len3); + { + len = fold_convert_loc (loc, sizetype, len); + len = fold_build2_loc (loc, MIN_EXPR, TREE_TYPE (len), len, len3); + } rtx arg1_rtx = get_memory_rtx (arg1, len); rtx arg2_rtx = get_memory_rtx (arg2, len); rtx arg3_rtx = expand_normal (len); |