summaryrefslogtreecommitdiff
path: root/gcc/tree-complex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-complex.cc')
-rw-r--r--gcc/tree-complex.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-complex.cc b/gcc/tree-complex.cc
index 8f03b236094..42db96a132b 100644
--- a/gcc/tree-complex.cc
+++ b/gcc/tree-complex.cc
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "cfganal.h"
#include "gimple-fold.h"
+#include "diagnostic-core.h"
/* For each complex ssa name, a lattice value. We're interested in finding
@@ -1614,6 +1615,7 @@ expand_complex_asm (gimple_stmt_iterator *gsi)
{
gasm *stmt = as_a <gasm *> (gsi_stmt (*gsi));
unsigned int i;
+ bool diagnosed_p = false;
for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
{
@@ -1622,6 +1624,20 @@ expand_complex_asm (gimple_stmt_iterator *gsi)
if (TREE_CODE (op) == SSA_NAME
&& TREE_CODE (TREE_TYPE (op)) == COMPLEX_TYPE)
{
+ if (gimple_asm_nlabels (stmt) > 0)
+ {
+ if (!diagnosed_p)
+ {
+ sorry_at (gimple_location (stmt),
+ "%<asm goto%> with complex typed outputs");
+ diagnosed_p = true;
+ }
+ /* Make sure to not ICE later, see PR105165. */
+ tree zero = build_zero_cst (TREE_TYPE (TREE_TYPE (op)));
+ set_component_ssa_name (op, false, zero);
+ set_component_ssa_name (op, true, zero);
+ continue;
+ }
tree type = TREE_TYPE (op);
tree inner_type = TREE_TYPE (type);
tree r = build1 (REALPART_EXPR, inner_type, op);