From patchwork Fri Mar 14 17:38:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 330401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0140E2C00A7 for ; Sat, 15 Mar 2014 04:38:45 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=tFuIOH9oGe+g0VXRv6q9sfTOQUxu4vM6Uz5cICfRNloetVysjT 04ZPr6V4aG1BVmqLCgnNrE5J7Iix6fYBP8UL5WLj66pEsGXTuZJBUYvn5XvwwmGV TzPIbWcYIKoStt0oI+v569hipV1YDmzRpGyEpsxMaMeNTlQBfAgi2fut4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=MJDjiQ4CSuYAYOKn381G90Fjqo0=; b=ErYPvZzPldePbewoGv6z Ux1ftN73AkIebXTw0sdfNG3y2chY1ZEoeNPfUmh33Gqsh0dtY0vjmL/3y9ep0xAv 50WY6f5fTROVPnvA+akDUTEETKv6IYmi+dTf/+ToSIzkL6eL8OBcNXT8x2DsLbd5 rl4H/HIzJmrcUVbnJJdXmN0= Received: (qmail 25305 invoked by alias); 14 Mar 2014 17:38:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25292 invoked by uid 89); 14 Mar 2014 17:38:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Mar 2014 17:38:35 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2EHcVmT010180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Mar 2014 13:38:32 -0400 Received: from redhat.com (ovpn-116-109.ams2.redhat.com [10.36.116.109]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2EHcRn9011364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 14 Mar 2014 13:38:30 -0400 Date: Fri, 14 Mar 2014 18:38:27 +0100 From: Marek Polacek To: GCC Patches Cc: Jakub Jelinek , "Joseph S. Myers" Subject: [PATCH] Don't set dir prefix twice (PR middle-end/60484) Message-ID: <20140314173827.GC6523@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) This patch makes sure that we set the directory prefix of dump_base_name only once, otherwise we'd end up with invalid path, resulting in error: could not open dump file ... This happened because finish_options is called for every optimize attribute and once more for command line options and every time it added the directory prefix. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-03-14 Jakub Jelinek Marek Polacek PR middle-end/60484 * common.opt (dump_base_name_prefixed): New Variable. * opts.c (finish_options): Don't prepend directory to x_dump_base_name if x_dump_base_name_prefixed is already set, set it at the end. Marek diff --git gcc/common.opt gcc/common.opt index 661516d..d8918d1 100644 --- gcc/common.opt +++ gcc/common.opt @@ -211,6 +211,10 @@ bool flag_opts_finished Variable unsigned int flag_sanitize +; Flag whether a prefix has been added to dump_base_name +Variable +bool dump_base_name_prefixed = false + ### Driver diff --git gcc/opts.c gcc/opts.c index 5dd442f..41c1a73 100644 --- gcc/opts.c +++ gcc/opts.c @@ -645,7 +645,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, { enum unwind_info_type ui_except; - if (opts->x_dump_base_name && ! IS_ABSOLUTE_PATH (opts->x_dump_base_name)) + if (opts->x_dump_base_name + && ! IS_ABSOLUTE_PATH (opts->x_dump_base_name) + && ! opts->x_dump_base_name_prefixed) { /* First try to make OPTS->X_DUMP_BASE_NAME relative to the OPTS->X_DUMP_DIR_NAME directory. Then try to make @@ -675,6 +677,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_dump_base_name = new_dump_base_name; } } + opts->x_dump_base_name_prefixed = true; } /* Handle related options for unit-at-a-time, toplevel-reorder, and