summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r--gcc/cp/cp-gimplify.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index abd82b3fe42..744707e792d 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1144,6 +1144,17 @@ cp_fold_function (tree fndecl)
cp_walk_tree (&DECL_SAVED_TREE (fndecl), cp_fold_r, &pset, NULL);
}
+/* Turn SPACESHIP_EXPR EXPR into GENERIC. */
+
+static tree genericize_spaceship (tree expr)
+{
+ iloc_sentinel s (cp_expr_location (expr));
+ tree type = TREE_TYPE (expr);
+ tree op0 = TREE_OPERAND (expr, 0);
+ tree op1 = TREE_OPERAND (expr, 1);
+ return genericize_spaceship (type, op0, op1);
+}
+
/* Perform any pre-gimplification lowering of C++ front end trees to
GENERIC. */
@@ -1574,6 +1585,10 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
genericize_break_stmt (stmt_p);
break;
+ case SPACESHIP_EXPR:
+ *stmt_p = genericize_spaceship (*stmt_p);
+ break;
+
case OMP_FOR:
case OMP_SIMD:
case OMP_DISTRIBUTE: