https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85627

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixing the nothrow issue reveals:

Index: tree.c
===================================================================
--- tree.c      (revision 259879)
+++ tree.c      (working copy)
@@ -10386,17 +10386,19 @@ build_common_builtin_nodes (void)
          *q = TOLOWER (*p);
        *q = '\0';

+       /* For -ftrapping-math these should throw from a former
+          -fnon-call-exception stmt.  */
        built_in_names[mcode] = concat (prefix, "mul", mode_name_buf, "3",
                                        NULL);
         local_define_builtin (built_in_names[mcode], ftype, mcode,
                              built_in_names[mcode],
-                             ECF_CONST | ECF_NOTHROW | ECF_LEAF);
+                             ECF_CONST | ECF_LEAF);

        built_in_names[dcode] = concat (prefix, "div", mode_name_buf, "3",
                                        NULL);
         local_define_builtin (built_in_names[dcode], ftype, dcode,
                              built_in_names[dcode],
-                             ECF_CONST | ECF_NOTHROW | ECF_LEAF);
+                             ECF_CONST | ECF_LEAF);
       }
   }


t.ii:2:1: error: statement marked for throw in middle of block
 foo (__complex double a, __complex double b)
 ^~~
_6 = __muldc3 (a$real_10, a$imag_11, b$real_12, b$imag_13);
during GIMPLE pass: cplxlower
t.ii:2:1: internal compiler error: verify_gimple failed

this is because the components are extracted after the call:

  <bb 2> [local count: 1073741825]:
  a$real_10 = REALPART_EXPR <a_4(D)>;
  a$imag_11 = IMAGPART_EXPR <a_4(D)>;
  b$real_12 = REALPART_EXPR <b_5(D)>;
  b$imag_13 = IMAGPART_EXPR <b_5(D)>;
  _6 = __muldc3 (a$real_10, a$imag_11, b$real_12, b$imag_13);
  _14 = REALPART_EXPR <_6>;
  _15 = IMAGPART_EXPR <_6>;

  <bb 3> [local count: 1073741825]:
  # res_2 = PHI <_6(2), b_5(D)(4)>
  # res$real_16 = PHI <_14(2), b$real_12(4)>
  # res$imag_17 = PHI <_15(2), b$imag_13(4)>
  return res_2;

thus with EH we need to split the block after the call.

Reply via email to