aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-06-04 18:03:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-06-04 18:03:24 +0000
commit1b17b99482291691b4179696e65fb42e1831e3ce (patch)
treea583071d96e396621e9cc7205fb6bb67a556c22f /gcc/builtins.c
parent6088d4c498ff5a1399a9b07101e9830683eae96f (diff)
downloadgcc-1b17b99482291691b4179696e65fb42e1831e3ce.zip
gcc-1b17b99482291691b4179696e65fb42e1831e3ce.tar.gz
gcc-1b17b99482291691b4179696e65fb42e1831e3ce.tar.bz2
re PR middle-end/85955 (ICE in fold_convert_loc, at fold-const.c:2408)
2018-06-04 Richard Biener <rguenther@suse.de> PR tree-optimization/85955 * builtins.c (fold_builtin_sincos): Convert pointers to destination to appropriate type before dereferencing. * gcc.dg/pr85955.c: New testcase. From-SVN: r261165
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index c96ac38..d4150d8 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -8266,6 +8266,9 @@ fold_builtin_sincos (location_t loc,
call = builtin_save_expr (call);
}
+ tree ptype = build_pointer_type (type);
+ arg1 = fold_convert (ptype, arg1);
+ arg2 = fold_convert (ptype, arg2);
return build2 (COMPOUND_EXPR, void_type_node,
build2 (MODIFY_EXPR, void_type_node,
build_fold_indirect_ref_loc (loc, arg1),