aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-10-25 10:42:59 +0200
committerJakub Jelinek <jakub@redhat.com>2022-10-25 10:45:04 +0200
commit44e18da4d9c5faf189fe876986927be12ae4e4c4 (patch)
treec786cca9cde8271c2ee439a9c2f93312802e6480 /gcc/gimplify.cc
parent593632051f48a20bdc685d00d168f064d808bd7b (diff)
downloadgcc-44e18da4d9c5faf189fe876986927be12ae4e4c4.zip
gcc-44e18da4d9c5faf189fe876986927be12ae4e4c4.tar.gz
gcc-44e18da4d9c5faf189fe876986927be12ae4e4c4.tar.bz2
gimplify: Call gimple_boolify on IFN_ASSUME argument [PR107368]
The following testcase ICEs in C, because assume attribute condition has int type rather than bool and the gimplification into GIMPLE_ASSUME assigns it into a bool variable. Fixed by calling gimple_boolify. 2022-10-25 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/107368 * gimplify.cc (gimplify_call_expr): For complex IFN_ASSUME conditions call gimple_boolify on the condition. * gcc.dg/attr-assume-5.c: New test.
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r--gcc/gimplify.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 44cc9e6..d236ef9 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3584,7 +3584,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
a separate function easily. */
tree guard = create_tmp_var (boolean_type_node);
*expr_p = build2 (MODIFY_EXPR, void_type_node, guard,
- CALL_EXPR_ARG (*expr_p, 0));
+ gimple_boolify (CALL_EXPR_ARG (*expr_p, 0)));
*expr_p = build3 (BIND_EXPR, void_type_node, NULL, *expr_p, NULL);
push_gimplify_context ();
gimple_seq body = NULL;