]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/103190 - fix assert in reassoc stmt placement with asm
authorRichard Biener <rguenther@suse.de>
Thu, 11 Nov 2021 14:12:32 +0000 (15:12 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 11 Nov 2021 15:06:24 +0000 (16:06 +0100)
This makes sure to only assert we don't run into a asm goto when
inserting a stmt in reassoc, matching the condition in
can_reassociate_p.  We can handle EH edges from an asm just like
EH edges from any other stmt.

2021-11-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103190
* tree-ssa-reassoc.c (insert_stmt_after): Only assert on asm goto.

gcc/tree-ssa-reassoc.c

index 6a555e7c553b6f6ee9567d67d93473930a7b18e8..65316223047924965e31d075ce3d851bca79620b 100644 (file)
@@ -1515,7 +1515,8 @@ insert_stmt_after (gimple *stmt, gimple *insert_point)
       gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
       return;
     }
-  else if (gimple_code (insert_point) == GIMPLE_ASM)
+  else if (gimple_code (insert_point) == GIMPLE_ASM
+          && gimple_asm_nlabels (as_a <gasm *> (insert_point)) != 0)
     /* We have no idea where to insert - it depends on where the
        uses will be placed.  */
     gcc_unreachable ();