This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: fix PR other/35070, regression using -fverbose-asm
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 5 Feb 2008 00:19:35 -0500 (EST)
- Subject: [PATCH]: fix PR other/35070, regression using -fverbose-asm
This patch addresses PR other/35070 (a regression) which is a failure when
using -fverbose-asm. It occurs when the version info in the gmp or mpfr
include files don't match that the shared library. In that situation GCC
outputs a warning in the version info.
The relevant fprintf statements weren't minding the `indent' parameter so
info inserted into the .s file wasn't appropriately made into a comment.
Fixed with the patch below. Tested on x86_64-unknown-linux-gnu, no
regressions.
The conditions under which the mismatch arises don't occur inside the
testsuite. The conditions are as follows:
1. The user already has a shared gmp and/or mpfr installed in a
standard system dir.
2. They install a different shared version in a non-standard dir.
3. They build GCC using the version from #2.
4. After bootstrap is completed, because of PR 21547 where GCC does
not link cc1 with -rpath, the header comes from #2 but the .so
file comes from #1 and a version mismatch occurs.
The above circumstances don't occur in the testsuite since it is run with
LD_LIBRARY_PATH set and both header and includes come from the same place.
So creating a testcase that triggers the bug isn't possible, AFAICT.
However I verified by hand that the patch below uses the indent parameter
and comments out the warning inside a .s file if the fprintf's are
executed.
Okay for mainline?
Thanks,
--Kaveh
2008-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35070
* toplev.c (print_version): Honor `indent' for GMP/MPFR warnings.
diff -rup orig/egcc-SVN20080204/gcc/toplev.c egcc-SVN20080204/gcc/toplev.c
--- orig/egcc-SVN20080204/gcc/toplev.c 2007-12-31 19:15:16.000000000 +0100
+++ egcc-SVN20080204/gcc/toplev.c 2008-02-05 00:16:04.000000000 +0100
@@ -1185,7 +1185,7 @@ print_version (FILE *file, const char *i
static const char fmt2[] =
N_("GMP version %s, MPFR version %s.\n");
static const char fmt3[] =
- N_("warning: %s header version %s differs from library version %s.\n");
+ N_("%s%swarning: %s header version %s differs from library version %s.\n");
static const char fmt4[] =
N_("%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n");
#ifndef __VERSION__
@@ -1215,10 +1215,12 @@ print_version (FILE *file, const char *i
if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version))
fprintf (file,
file == stderr ? _(fmt3) : fmt3,
+ indent, *indent != 0 ? " " : "",
"GMP", GCC_GMP_STRINGIFY_VERSION, gmp_version);
if (strcmp (MPFR_VERSION_STRING, mpfr_get_version ()))
fprintf (file,
file == stderr ? _(fmt3) : fmt3,
+ indent, *indent != 0 ? " " : "",
"MPFR", MPFR_VERSION_STRING, mpfr_get_version ());
fprintf (file,
file == stderr ? _(fmt4) : fmt4,