From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 5DE43385800D for ; Tue, 19 Oct 2021 10:53:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DE43385800D Received: by mail-ed1-x534.google.com with SMTP id y30so10245566edi.0 for ; Tue, 19 Oct 2021 03:53:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1x+Sz9BqfN1BLybZ5qh/gtTWzoI971mVp2LfQcJwHCE=; b=IwCoWBZ9HLoDkj7kOuQGMXmTUTCcZRj+mRk3XLkh+e9IQQh+ylgPgG5CxLWyT4mk+h mLM5rzvxFt3lS+k+Oe64LtYxW25WZZz47YtJvsTR+sJxhWL8AIQ65C5qdwMZzYQE8oY1 kpUy7BSzRrOaHsDn1etI62RgybKaSG985VEU7gUHj3igJMFR537wgAlwJx8hckIpGFcr 8khX4FV36F94L18i/QX4NmdCSkt5HZ+C47fE5qUYZ+0jDNNQ1T1Bp42Sm0KyKB8dZQoI UFv0L85QCjfmEMGrh8Kwry/FLkbw89VwSYGosa/KijCDHB5IFzmcx47xAkE5wtINwxTJ RUjQ== X-Gm-Message-State: AOAM530MQEQzQ1cZ4kPM59BIhNlKhdGjm/V2gBRgEq89DuGNYPeIBau/ c5SJ+vUxWPXxtSJjj3ixmnKWLuf4evTPL7Pqs5g= X-Google-Smtp-Source: ABdhPJzBOHDyZZNboCWHsj1H4jFjbFMzZ7SaUGusA3MJlNxcMsoGS3GjFJ5yJe/9sQmowlENHCgSftfC+Nx473uV6cQ= X-Received: by 2002:a50:e1c4:: with SMTP id m4mr52334328edl.307.1634640831307; Tue, 19 Oct 2021 03:53:51 -0700 (PDT) MIME-Version: 1.0 References: <202e07b3-e8d5-85e2-c0a5-8a40a61d7175@suse.cz> <0ea9882e-8d7c-f6d4-9262-50e2b3ae5e6c@suse.cz> <163c4fd6-5c81-0a4f-5d5a-c2a06c275fa5@suse.cz> <858d6ffd-11c2-474d-11c4-24e8af4ca291@suse.cz> In-Reply-To: <858d6ffd-11c2-474d-11c4-24e8af4ca291@suse.cz> From: Richard Biener Date: Tue, 19 Oct 2021 12:53:40 +0200 Message-ID: Subject: Re: [PATCH] options: Fix variable tracking option processing. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 10:53:53 -0000 On Tue, Oct 19, 2021 at 11:34 AM Martin Li=C5=A1ka wrote: > > On 10/19/21 11:12, Richard Biener wrote: > > On Fri, Oct 15, 2021 at 5:22 PM Martin Li=C5=A1ka wrot= e: > >> > >> All right, and there's second part that moves the code > >> from toplev.c to opts.c (finish_options) as I've done in the original = version. > >> > >> The patch also handles PR102766 where nvptx.c target sets: > >> debug_nonbind_markers_p =3D 0; > >> > >> So the easiest approach is marking the flag as set in global_options_s= et, > >> I haven't found a better approach :/ Reason is that nvptx_option_overr= ide > >> is called before finish_options. > > > > So currently nvptx_option_override is called before we do this code > > blob (it's called at the beginning of process_options). > > Yes, happens early in process_options. > > > > > Why's the solution not to move this setting to finish_options as well? > > I would like to, but the option detection depends on target hooks and som= e debuginfo > functionality, leading to: > > g++ -no-pie -g -DIN_GCC -fPIC -DCROSS_DIRECTORY_STRUCTURE -fno-exce= ptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwri= te-strings -Wcast-qual -Wno-error=3Dformat-diag -Wmissing-format-attribute = -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-ove= rlength-strings -fno-common -DHAVE_CONFIG_H -static-libstdc++ -static-libg= cc -o Tlto-wrapper \ > lto-wrapper.o collect-utils.o ggc-none.o libcommon-target.a libcommon= .a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/p= ic/libiberty.a ../libdecnumber/libdecnumber.a > /home/marxin/Programming/gcc/gcc/opts.c:1382: error: undefined reference = to 'dwarf2out_default_as_loc_support()' > /home/marxin/Programming/gcc/gcc/opts.c:1384: error: undefined reference = to 'dwarf2out_default_as_locview_support()' > /home/marxin/Programming/gcc/gcc/opts.c:1409: error: undefined reference = to 'targetm' > > Or can we do better? Meh ... :/ Well, move the target override hook call down (try to shuffle things so diagnostics happen after but "inits" happen before). > > (and disabling it along var-tracking when we end with no -g in process_= options) > > > > IMHO the target should have the last say, so the hook should be invoked > > after we are finished overriding stuff and finish_options should be > > _only_ doing diagnostics and disabling stuff we cannot handle. > > Well, that sounds good, but we are quite far from that :/ Yes, I know... > Martin > > > > > Richard. > > > >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > >> > >> Ready to be installed? > >> Thanks, > >> Martin >