+2019-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/88635
+ * dwarf2out.c (const_ok_for_output_1): Reject MINUS that contains
+ SYMBOL_REF, CODE_LABEL or UNSPEC in subexpressions of second argument.
+ Reject PLUS that contains SYMBOL_REF, CODE_LABEL or UNSPEC in
+ subexpressions of both operands.
+ (mem_loc_descriptor): Handle UNSPEC if target hook acks it and all the
+ subrtxes are CONSTANT_P.
+ * config/i386/i386.c (ix86_const_not_ok_for_debug_p): Revert
+ 2018-11-09 changes.
+
2019-01-04 Jan Hubicka <hubicka@ucw.cz>
* params.def (hot-bb-count-ws-permille): Set to 990.
if (SYMBOL_REF_P (x) && strcmp (XSTR (x, 0), GOT_SYMBOL_NAME) == 0)
return true;
- /* Reject UNSPECs within expressions. We could accept symbol@gotoff
- + literal_constant, but that would hardly come up in practice,
- and it's not worth the trouble of having to reject that as an
- operand to pretty much anything else. */
- if (UNARY_P (x)
- && GET_CODE (XEXP (x, 0)) == UNSPEC)
- return true;
- if (BINARY_P (x)
- && (GET_CODE (XEXP (x, 0)) == UNSPEC
- || GET_CODE (XEXP (x, 1)) == UNSPEC))
- return true;
-
return false;
}
\f
case NOT:
case NEG:
return false;
+ case PLUS:
+ {
+ /* Make sure SYMBOL_REFs/UNSPECs are at most in one of the
+ operands. */
+ subrtx_var_iterator::array_type array;
+ bool first = false;
+ FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 0), ALL)
+ if (SYMBOL_REF_P (*iter)
+ || LABEL_P (*iter)
+ || GET_CODE (*iter) == UNSPEC)
+ {
+ first = true;
+ break;
+ }
+ if (!first)
+ return true;
+ FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 1), ALL)
+ if (SYMBOL_REF_P (*iter)
+ || LABEL_P (*iter)
+ || GET_CODE (*iter) == UNSPEC)
+ return false;
+ return true;
+ }
+ case MINUS:
+ {
+ /* Disallow negation of SYMBOL_REFs or UNSPECs when they
+ appear in the second operand of MINUS. */
+ subrtx_var_iterator::array_type array;
+ FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 1), ALL)
+ if (SYMBOL_REF_P (*iter)
+ || LABEL_P (*iter)
+ || GET_CODE (*iter) == UNSPEC)
+ return false;
+ return true;
+ }
default:
return true;
}
pool. */
case CONST:
case SYMBOL_REF:
+ case UNSPEC:
if (!is_a <scalar_int_mode> (mode, &int_mode)
|| (GET_MODE_SIZE (int_mode) > DWARF2_ADDR_SIZE
#ifdef POINTERS_EXTEND_UNSIGNED
#endif
))
break;
+
+ if (GET_CODE (rtl) == UNSPEC)
+ {
+ /* If delegitimize_address couldn't do anything with the UNSPEC, we
+ can't express it in the debug info. This can happen e.g. with some
+ TLS UNSPECs. Allow UNSPECs formerly from CONST that the backend
+ approves. */
+ 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))
+ {
+ not_ok = true;
+ break;
+ }
+
+ if (not_ok)
+ break;
+
+ rtl = gen_rtx_CONST (GET_MODE (rtl), rtl);
+ goto symref;
+ }
+
if (GET_CODE (rtl) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
{
case VEC_CONCAT:
case VEC_DUPLICATE:
case VEC_SERIES:
- case UNSPEC:
case HIGH:
case FMA:
case STRICT_LOW_PART:
case CLRSB:
case CLOBBER:
case CLOBBER_HIGH:
- /* If delegitimize_address couldn't do anything with the UNSPEC, we
- can't express it in the debug info. This can happen e.g. with some
- TLS UNSPECs. */
break;
case CONST_STRING:
-2019-01-05 Dominique d'Humieres <dominiq@gcc.gnu.org>
+2019-01-05 Jakub Jelinek <jakub@redhat.com>
- PR target/60563
- Missing PR entry in the previous commit.
+ PR debug/88635
+ * gcc.dg/debug/dwarf2/pr88635.c: New test.
2019-01-05 Dominique d'Humieres <dominiq@gcc.gnu.org>
+ PR target/60563
* g++.dg/ext/sync-4.C: Add dg-xfail-run-if for darwin.
2019-01-04 Martin Sebor <msebor@redhat.com>