aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index d6ac4389ee5..8e0265b2b33 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2406,6 +2406,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& TYPE_UNSIGNED (TREE_TYPE (@1)))))
(view_convert @1)))
+/* Simplify a view-converted empty constructor. */
+(simplify
+ (view_convert CONSTRUCTOR@0)
+ (if (TREE_CODE (@0) != SSA_NAME
+ && CONSTRUCTOR_NELTS (@0) == 0)
+ { build_zero_cst (type); }))
+
/* Re-association barriers around constants and other re-association
barriers can be removed. */
(simplify