[PATCH] Fix C++/14329, badly formatted warnings for SRA replacements used uninitialized

Andrew Pinski pinskia@gmail.com
Tue Nov 28 14:01:00 GMT 2006

  RTH's C++ patch in
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01988.html was almost
correct.  There were two problems with it.  First the use of the
variable name "t" was causing regressions as the variable shadowing
another variable named "t" which was used to set the locus later on.
Second, we needed to change the order of DECL_DEBUG_EXPR and
DECL_DEBUG_EXPR_IS_FROM and then add a check for DECL_P.  With those
minor changes, we get the correct result and no regressions.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.
Should this apply to the 4.2 branch also, it is not a regression but
getting a correct formatted warning in 4.2 would nice and it is one of
the most reported bugs lately.

Andrew Pinski


200x-mm-dd  Richard Henderson  <rth@redhat.com>
            Andrew Pinski  <pinskia@gmail.com>

	* error.c (cp_printer) <'D'>: Handle DECL_DEBUG_EXPR.

	* g++.dg/warn/unit-1.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixpr14329.diff.txt
Type: text/x-patch
Size: 1392 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061128/0589ed12/attachment.bin>

More information about the Gcc-patches mailing list