re PR target/92449 (ICE in extract_insn, at recog.c:2311)
authorJakub Jelinek <jakub@redhat.com>
Tue, 12 Nov 2019 08:22:29 +0000 (09:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 12 Nov 2019 08:22:29 +0000 (09:22 +0100)
PR target/92449
* tree-complex.c (expand_complex_multiplication): If !HONOR_NANS,
don't emit UNORDERED_EXPR guarded libcall.  Formatting fixes.

From-SVN: r278081

gcc/ChangeLog
gcc/tree-complex.c

index 39c9f6f4cffada85109ec5148d9968b94a1151ed..b912abcb6135155c90579e9963fff4061652a355 100644 (file)
@@ -1,5 +1,9 @@
 2019-11-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/92449
+       * tree-complex.c (expand_complex_multiplication): If !HONOR_NANS,
+       don't emit UNORDERED_EXPR guarded libcall.  Formatting fixes.
+
        PR tree-optimization/92452
        * tree-vrp.c (vrp_prop::check_array_ref): If TRUNC_DIV_EXPR folds
        into NULL_TREE, set up_bound to NULL_TREE instead of computing
index d4b053d68e1396a98760060c4a9cae448635d1a5..804edd11e53a0b74f90ae74acda6f6e2dbacd8a2 100644 (file)
@@ -1144,6 +1144,16 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree type,
              return;
            }
 
+         if (!HONOR_NANS (inner_type))
+           {
+             /* If we are not worrying about NaNs expand to
+                (ar*br - ai*bi) + i(ar*bi + br*ai) directly.  */
+             expand_complex_multiplication_components (gsi, inner_type,
+                                                       ar, ai, br, bi,
+                                                       &rr, &ri);
+             break;
+           }
+
          /* Else, expand x = a * b into
             x = (ar*br - ai*bi) + i(ar*bi + br*ai);
             if (isunordered (__real__ x, __imag__ x))
@@ -1151,7 +1161,7 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree type,
 
          tree tmpr, tmpi;
          expand_complex_multiplication_components (gsi, inner_type, ar, ai,
-                                                    br, bi, &tmpr, &tmpi);
+                                                   br, bi, &tmpr, &tmpi);
 
          gimple *check
            = gimple_build_cond (UNORDERED_EXPR, tmpr, tmpi,
@@ -1167,13 +1177,12 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree type,
            = insert_cond_bb (gsi_bb (*gsi), gsi_stmt (*gsi), check,
                              profile_probability::very_unlikely ());
 
-
          gimple_stmt_iterator cond_bb_gsi = gsi_last_bb (cond_bb);
          gsi_insert_after (&cond_bb_gsi, gimple_build_nop (), GSI_NEW_STMT);
 
          tree libcall_res
            = expand_complex_libcall (&cond_bb_gsi, type, ar, ai, br,
-                                      bi, MULT_EXPR, false);
+                                     bi, MULT_EXPR, false);
          tree cond_real = gimplify_build1 (&cond_bb_gsi, REALPART_EXPR,
                                            inner_type, libcall_res);
          tree cond_imag = gimplify_build1 (&cond_bb_gsi, IMAGPART_EXPR,
@@ -1190,20 +1199,18 @@ expand_complex_multiplication (gimple_stmt_iterator *gsi, tree type,
          edge orig_to_join = find_edge (orig_bb, join_bb);
 
          gphi *real_phi = create_phi_node (rr, gsi_bb (*gsi));
-         add_phi_arg (real_phi, cond_real, cond_to_join,
-                       UNKNOWN_LOCATION);
+         add_phi_arg (real_phi, cond_real, cond_to_join, UNKNOWN_LOCATION);
          add_phi_arg (real_phi, tmpr, orig_to_join, UNKNOWN_LOCATION);
 
          gphi *imag_phi = create_phi_node (ri, gsi_bb (*gsi));
-         add_phi_arg (imag_phi, cond_imag, cond_to_join,
-                       UNKNOWN_LOCATION);
+         add_phi_arg (imag_phi, cond_imag, cond_to_join, UNKNOWN_LOCATION);
          add_phi_arg (imag_phi, tmpi, orig_to_join, UNKNOWN_LOCATION);
        }
       else
        /* If we are not worrying about NaNs expand to
          (ar*br - ai*bi) + i(ar*bi + br*ai) directly.  */
        expand_complex_multiplication_components (gsi, inner_type, ar, ai,
-                                                     br, bi, &rr, &ri);
+                                                 br, bi, &rr, &ri);
       break;
 
     default: