re PR target/41693 (RTL Check Failure in expand_debug_expr, at cfgexpand.c:2371)
authorJakub Jelinek <jakub@redhat.com>
Tue, 13 Oct 2009 13:56:07 +0000 (15:56 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 13 Oct 2009 13:56:07 +0000 (15:56 +0200)
PR target/41693
* rtl.h (DEBUG_EXPR_TREE_DECL): Define.
* sched-vis.c (print_value): Use it.
* cselib.c (cselib_hash_rtx): Likewise.
* print-rtl.c (print_rtx): Likewise.
* cfgexpand.c (expand_debug_rtx): Likewise.
* var-tracking.c (vt_expand_loc_callback): Likewise.

From-SVN: r152707

gcc/ChangeLog
gcc/cfgexpand.c
gcc/cselib.c
gcc/print-rtl.c
gcc/rtl.h
gcc/sched-vis.c
gcc/var-tracking.c

index d63029eec054b3a7c8208f74330de1f604a83567..555668344e48c461720da00e17f133471042bef7 100644 (file)
@@ -1,3 +1,13 @@
+2009-10-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/41693
+       * rtl.h (DEBUG_EXPR_TREE_DECL): Define.
+       * sched-vis.c (print_value): Use it.
+       * cselib.c (cselib_hash_rtx): Likewise.
+       * print-rtl.c (print_rtx): Likewise.
+       * cfgexpand.c (expand_debug_rtx): Likewise.
+       * var-tracking.c (vt_expand_loc_callback): Likewise.
+
 2009-10-13  Richard Guenther  <rguenther@suse.de>
 
        PR lto/41565
index 31832e71c87f1de634c5dbfef45a10a7b20083cd..6882954fab813b4ee17b5670ebfcb4d16d20dbdd 100644 (file)
@@ -2368,7 +2368,7 @@ expand_debug_expr (tree exp)
        return op0;
 
       op0 = gen_rtx_DEBUG_EXPR (mode);
-      XTREE (op0, 0) = exp;
+      DEBUG_EXPR_TREE_DECL (op0) = exp;
       SET_DECL_RTL (exp, op0);
 
       return op0;
index c26742ddf1a08dc4a18b2cba80a2c2eb2f68f844..2bf466258f37a5a9140d6a25da802c83ab717902 100644 (file)
@@ -705,7 +705,8 @@ cselib_hash_rtx (rtx x, int create)
       return e->value;
 
     case DEBUG_EXPR:
-      hash += ((unsigned) DEBUG_EXPR << 7) + DEBUG_TEMP_UID (XTREE (x, 0));
+      hash += ((unsigned) DEBUG_EXPR << 7)
+             + DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x));
       return hash ? hash : (unsigned int) DEBUG_EXPR;
 
     case CONST_INT:
index 5ba5e634a66a59e915f9ec714ffde4208e19bb6b..29d3ab91832f9addd6363651f1ee001bbebc8c8b 100644 (file)
@@ -321,7 +321,8 @@ print_rtx (const_rtx in_rtx)
        else if (i == 0 && GET_CODE (in_rtx) == DEBUG_EXPR)
          {
 #ifndef GENERATOR_FILE
-           fprintf (outfile, " D#%i", DEBUG_TEMP_UID (XTREE (in_rtx, 0)));
+           fprintf (outfile, " D#%i",
+                    DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (in_rtx)));
 #endif
          }
        break;
index a7be009b619e7a3ccc382c2d481d3609129e143f..d5dbd1eb5f1ff332a30c33c6a499685a0a4c6a5f 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -930,6 +930,9 @@ extern const char * const reg_note_name[];
 #define NOTE_DURING_CALL_P(RTX)                                \
   (RTL_FLAG_CHECK1("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call)
 
+/* DEBUG_EXPR_DECL corresponding to a DEBUG_EXPR RTX.  */
+#define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR)
+
 /* Possible initialization status of a variable.   When requested
    by the user, this information is tracked and recorded in the DWARF
    debug information, along with the variable's location.  */
index d95235ee3ec87d7ab4f79576c0040c30ae7adcba..906e9c31f2ae06a524dde042c67dc7eb36d244b5 100644 (file)
@@ -522,7 +522,7 @@ print_value (char *buf, const_rtx x, int verbose)
       cur = safe_concat (buf, cur, "]");
       break;
     case DEBUG_EXPR:
-      sprintf (t, "D#%i", DEBUG_TEMP_UID (XTREE (x, 0)));
+      sprintf (t, "D#%i", DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x)));
       cur = safe_concat (buf, cur, t);
       break;
     default:
index 840128cf7c817249f053d7397b1a6a97ab735294..acc4d13d7171759928d57aac9f9b7e8a10d4c30d 100644 (file)
@@ -6304,7 +6304,7 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data)
       return result;
 
     case DEBUG_EXPR:
-      dv = dv_from_decl (XTREE (x, 0));
+      dv = dv_from_decl (DEBUG_EXPR_TREE_DECL (x));
       xret = NULL;
       break;