re PR debug/43516 ("-fcompare-debug failure" at -O2)
authorJakub Jelinek <jakub@redhat.com>
Fri, 26 Mar 2010 16:18:51 +0000 (17:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 26 Mar 2010 16:18:51 +0000 (17:18 +0100)
PR debug/43516
* flags.h (final_insns_dump_p): New extern.
* final.c (final_insns_dump_p): New variable.
(rest_of_clean_state): Set it before -fdump-final-insns=
dumping, clear afterwards.
* print-rtl.c (print_rtx): If final_insns_dump_p don't dump
MEM_ALIAS_SET on MEMs.

From-SVN: r157753

gcc/ChangeLog
gcc/final.c
gcc/flags.h
gcc/print-rtl.c

index 0b2de21..0e8d0b9 100644 (file)
@@ -1,3 +1,13 @@
+2010-03-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/43516
+       * flags.h (final_insns_dump_p): New extern.
+       * final.c (final_insns_dump_p): New variable.
+       (rest_of_clean_state): Set it before -fdump-final-insns=
+       dumping, clear afterwards.
+       * print-rtl.c (print_rtx): If final_insns_dump_p don't dump
+       MEM_ALIAS_SET on MEMs.
+
 2010-03-26  David S. Miller  <davem@davemloft.net>
 
        * configure.ac: Fix sparc GOTDATA_OP bug check.
index 0d19562..e2b7461 100644 (file)
@@ -1,6 +1,6 @@
 /* Convert RTL to assembler code and output it, for GNU compiler.
    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -207,6 +207,9 @@ static int dialect_number;
 /* Nonnull if the insn currently being emitted was a COND_EXEC pattern.  */
 rtx current_insn_predicate;
 
+/* True if printing into -fdump-final-insns= dump.  */   
+bool final_insns_dump_p;
+
 #ifdef HAVE_ATTR_length
 static int asm_insn_count (rtx);
 #endif
@@ -4384,6 +4387,7 @@ rest_of_clean_state (void)
          flag_dump_noaddr = flag_dump_unnumbered = 1;
          if (flag_compare_debug_opt || flag_compare_debug)
            dump_flags |= TDF_NOUID;
+         final_insns_dump_p = true;
 
          for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
            if (LABEL_P (insn))
@@ -4417,6 +4421,7 @@ rest_of_clean_state (void)
     {
       flag_dump_noaddr = save_noaddr;
       flag_dump_unnumbered = save_unnumbered;
+      final_insns_dump_p = false;
 
       if (fclose (final_output))
        {
index d1634bd..bc51b2b 100644 (file)
@@ -182,6 +182,10 @@ extern int flag_gen_aux_info;
 
 extern int flag_dump_unnumbered;
 
+/* True if printing into -fdump-final-insns= dump.  */
+
+extern bool final_insns_dump_p;
+
 /* Nonzero means change certain warnings into errors.
    Usually these are warnings about failure to conform to some standard.  */
 
index 52709da..b02143a 100644 (file)
@@ -1,6 +1,6 @@
 /* Print RTL for GCC.
    Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999, 2000, 2002, 2003,
-   2004, 2005, 2007, 2008, 2009
+   2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -548,8 +548,11 @@ print_rtx (const_rtx in_rtx)
     {
 #ifndef GENERATOR_FILE
     case MEM:
-      fprintf (outfile, " [" HOST_WIDE_INT_PRINT_DEC,
-              (HOST_WIDE_INT) MEM_ALIAS_SET (in_rtx));
+      if (__builtin_expect (final_insns_dump_p, false))
+       fprintf (outfile, " [");
+      else
+       fprintf (outfile, " [" HOST_WIDE_INT_PRINT_DEC,
+                (HOST_WIDE_INT) MEM_ALIAS_SET (in_rtx));
 
       if (MEM_EXPR (in_rtx))
        print_mem_expr (outfile, MEM_EXPR (in_rtx));