This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM] -m{cpu,tune,arch}=native
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: Andrew Stubbs <andrew_stubbs at mentor dot com>
- Cc: Richard Earnshaw <rearnsha at arm dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "patches at linaro dot org" <patches at linaro dot org>
- Date: Wed, 19 Oct 2011 11:01:06 +0100
- Subject: Re: [PATCH][ARM] -m{cpu,tune,arch}=native
- References: <4E57B995.2010605@codesourcery.com> <Pine.LNX.4.64.1108261615580.15741@digraph.polyomino.org.uk> <4E58E76C.7010204@codesourcery.com> <4E66219E.4070706@codesourcery.com> <4E69FEC8.9070104@arm.com> <4E787025.1040402@codesourcery.com> <4E9C2CA0.4040203@arm.com> <4E9D8BCE.9080108@codesourcery.com> <4E9D8E84.80400@arm.com> <4E9D9065.7020005@mentor.com>
On 18/10/11 15:42, Andrew Stubbs wrote:
Which still jumps to not_found without closing f.
Hmmm, I know I fixed that, I know I did!
But I appear to have lost the change somewhere when I updated my checkout?
I'll fix it now.
Fixed and committed as attached.
Apologies for the cock-up. :(
Andrew
2011-10-18 Andrew Stubbs <ams@codesourcery.com>
* config/arm/driver-arm.c (host_detect_local_cpu): Close the file
before exiting.
---
src/gcc-mainline/gcc/config/arm/driver-arm.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/gcc-mainline/gcc/config/arm/driver-arm.c b/src/gcc-mainline/gcc/config/arm/driver-arm.c
index 43b6e58..9a6762b 100644
--- a/src/gcc-mainline/gcc/config/arm/driver-arm.c
+++ b/src/gcc-mainline/gcc/config/arm/driver-arm.c
@@ -75,7 +75,7 @@ host_detect_local_cpu (int argc, const char **argv)
{
const char *val = NULL;
char buf[128];
- FILE *f;
+ FILE *f = NULL;
bool arch;
const struct vendor_cpu *cpu_table = NULL;
@@ -134,6 +134,10 @@ not_found:
unsigned int i;
unsigned int opt;
const char *search[] = {NULL, "arch"};
+
+ if (f)
+ fclose (f);
+
search[0] = argv[0];
for (opt = 0; opt < ARRAY_SIZE (search); opt++)
for (i = 0; i < ARRAY_SIZE (configure_default_options); i++)