aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-28 11:26:56 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-28 11:26:56 +0200
commit34f6b14ff33e0c64b3a4a1a2cd871df715d69151 (patch)
tree22b3389c391cfa7244a83048690e2288670dd21a /gcc/tree.c
parentfa477e454287063a583967c79867b44deea8e4ad (diff)
downloadgcc-34f6b14ff33e0c64b3a4a1a2cd871df715d69151.zip
gcc-34f6b14ff33e0c64b3a4a1a2cd871df715d69151.tar.gz
gcc-34f6b14ff33e0c64b3a4a1a2cd871df715d69151.tar.bz2
tree: Fix up TREE_SIDE_EFFECTS on internal calls [PR94809]
On the following testcase, match.pd during GENERIC folding changes the -1U / x < y into __imag__ .MUL_OVERFLOW (x, y), but unfortunately unlike for normal calls nothing sets TREE_SIDE_EFFECTS on the call. There is the process_call_operands function that non-internal call creation calls and it is usable for internal calls too, e.g. TREE_SIDE_EFFECTS is derived from checking whether the call has side-effects (non-ECF_{CONST,PURE}; we have those for internal calls) and from whether any of the arguments has TREE_SIDE_EFFECTS. 2020-04-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/94809 * tree.c (build_call_expr_internal_loc_array): Call process_call_operands. * gcc.c-torture/execute/pr94809.c: New test.
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index da6b8e2..e28b295 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -11523,6 +11523,7 @@ build_call_expr_internal_loc_array (location_t loc, internal_fn ifn,
CALL_EXPR_ARG (t, i) = args[i];
SET_EXPR_LOCATION (t, loc);
CALL_EXPR_IFN (t) = ifn;
+ process_call_operands (t);
return t;
}