re PR debug/88723 (PR debug/88635 patch breaks testsuite_shared.cc compilation)
authorJakub Jelinek <jakub@redhat.com>
Mon, 7 Jan 2019 09:51:46 +0000 (10:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 7 Jan 2019 09:51:46 +0000 (10:51 +0100)
PR debug/88723
* dwarf2out.c (const_ok_for_output_1): Remove redundant call to
const_not_ok_for_debug_p target hook.
(mem_loc_descriptor) <case UNSPEC>: Only call const_ok_for_output_1
on UNSPEC and subexpressions thereof if all subexpressions of the
UNSPEC are CONSTANT_P.

From-SVN: r267638

gcc/ChangeLog
gcc/dwarf2out.c

index 44e9eb3a29105be7154c2f0d8e3f56873139f958..a17c6c7b020e6c50d68149f310f2d02c1fdb3a6d 100644 (file)
@@ -1,5 +1,12 @@
 2019-01-07  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/88723
+       * dwarf2out.c (const_ok_for_output_1): Remove redundant call to
+       const_not_ok_for_debug_p target hook.
+       (mem_loc_descriptor) <case UNSPEC>: Only call const_ok_for_output_1
+       on UNSPEC and subexpressions thereof if all subexpressions of the
+       UNSPEC are CONSTANT_P.
+
        PR tree-optimization/88676
        * tree-ssa-phiopt.c (two_value_replacement): New function.
        (tree_ssa_phiopt_worker): Call it.
index 0d643dd713d2bbd7eb4a197d59c36d526a291b08..8b4f7bc95bf297156c0813880ae1cd07b59f9791 100644 (file)
@@ -14445,13 +14445,6 @@ const_ok_for_output_1 (rtx rtl)
   if (CONST_POLY_INT_P (rtl))
     return false;
 
-  if (targetm.const_not_ok_for_debug_p (rtl))
-    {
-      expansion_failed (NULL_TREE, rtl,
-                       "Expression rejected for debug by the backend.\n");
-      return false;
-    }
-
   /* FIXME: Refer to PR60655. It is possible for simplification
      of rtl expressions in var tracking to produce such expressions.
      We should really identify / validate expressions
@@ -15660,8 +15653,17 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
          bool not_ok = false;
          subrtx_var_iterator::array_type array;
          FOR_EACH_SUBRTX_VAR (iter, array, rtl, ALL)
-           if ((*iter != rtl && !CONSTANT_P (*iter))
-               || !const_ok_for_output_1 (*iter))
+           if (*iter != rtl && !CONSTANT_P (*iter))
+             {
+               not_ok = true;
+               break;
+             }
+
+         if (not_ok)
+           break;
+
+         FOR_EACH_SUBRTX_VAR (iter, array, rtl, ALL)
+           if (!const_ok_for_output_1 (*iter))
              {
                not_ok = true;
                break;