From 62cc2fb4d3d1cd7afd07ed5e0676d7d81b02c1fd Mon Sep 17 00:00:00 2001 From: ktkachov Date: Wed, 23 Mar 2016 10:16:31 +0000 Subject: [PATCH] [ARM] PR driver/70132: Avoid double fclose in driver-arm.c PR driver/70132 * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic to not call fclose twice on file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234419 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/driver-arm.c | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9a1eb039d88..f78ff93a9a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-03-23 Kyrylo Tkachov + + PR driver/70132 + * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic + to not call fclose twice on file. + 2016-03-23 Jakub Jelinek PR tree-optimization/70354 diff --git a/gcc/config/arm/driver-arm.c b/gcc/config/arm/driver-arm.c index 466743b9d47..95dc9d53b6c 100644 --- a/gcc/config/arm/driver-arm.c +++ b/gcc/config/arm/driver-arm.c @@ -128,12 +128,11 @@ host_detect_local_cpu (int argc, const char **argv) } } - fclose (f); - - if (val == NULL) - goto not_found; - - return concat ("-m", argv[0], "=", val, NULL); + if (val) + { + fclose (f); + return concat ("-m", argv[0], "=", val, NULL); + } not_found: { -- 2.11.4.GIT