This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14329] [tree-ssa] badly formatted warnings for SRA replacements used uninitialized
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Nov 2006 06:41:08 -0000
- Subject: [Bug c++/14329] [tree-ssa] badly formatted warnings for SRA replacements used uninitialized
- References: <bug-14329-2744@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from pinskia at gcc dot gnu dot org 2006-11-27 06:41 -------
Here is the patch which passes the C++ testsuite, I have to do a full
bootstrap/testsuite run still but I am happy with it currrently which is why I
am pasting it here:
Index: error.c
===================================================================
--- error.c (revision 119217)
+++ error.c (working copy)
@@ -2337,7 +2337,22 @@ cp_printer (pretty_printer *pp, text_inf
{
case 'A': result = args_to_string (next_tree, verbose); break;
case 'C': result = code_to_string (next_tcode); break;
- case 'D': result = decl_to_string (next_tree, verbose); break;
+ case 'D':
+ {
+ tree temp = next_tree;
+ if (DECL_P (temp)
+ && DECL_DEBUG_EXPR_IS_FROM (temp) && DECL_DEBUG_EXPR (temp))
+ {
+ temp = DECL_DEBUG_EXPR (temp);
+ if (!DECL_P (temp))
+ {
+ result = expr_to_string (temp);
+ break;
+ }
+ }
+ result = decl_to_string (temp, verbose);
+ }
+ break;
case 'E': result = expr_to_string (next_tree); break;
case 'F': result = fndecl_to_string (next_tree, verbose); break;
case 'L': result = language_to_string (next_lang); break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14329