From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A2AA3858406; Tue, 28 Dec 2021 10:05:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A2AA3858406 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/103465] Invalid note with -fno-reorder-blocks-and-partition Date: Tue, 28 Dec 2021 10:05:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2021 10:05:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103465 --- Comment #16 from CVS Commits --- The master branch has been updated by Martin Liska : https://gcc.gnu.org/g:a187edd2b437fc9571d57f771a624963fcce08f8 commit r12-6131-ga187edd2b437fc9571d57f771a624963fcce08f8 Author: Martin Liska Date: Fri Dec 10 09:58:52 2021 +0100 driver: Improve option diagnostics [PR103465] It happens that options are parsed and various diagnostics happen in finish_options. That's a proper place as the function is also called for optimize/target attributes (pragmas). However, it is possible that target overwrites an option from command line and so the diagnostics does not happen. That's fixed in the patch. - options are parsed and finish_options is called: if (opts->x_flag_unwind_tables && !targetm_common.unwind_tables_default && opts->x_flag_reorder_blocks_and_partition && (ui_except =3D=3D UI_SJLJ || ui_except >=3D UI_TARGET)) { if (opts_set->x_flag_reorder_blocks_and_partition) inform (loc, "%<-freorder-blocks-and-partition%> does not support " "unwind info on this architecture"); opts->x_flag_reorder_blocks_and_partition =3D 0; opts->x_flag_reorder_blocks =3D 1; } It's not triggered because of opts->x_flag_unwind_tables is false by default, but the option is overwritten in target: ... if (TARGET_64BIT_P (opts->x_ix86_isa_flags)) { if (opts->x_optimize >=3D 1) SET_OPTION_IF_UNSET (opts, opts_set, flag_omit_frame_pointer, !USE_IX86_FRAME_POINTER); if (opts->x_flag_asynchronous_unwind_tables && TARGET_64BIT_MS_ABI) SET_OPTION_IF_UNSET (opts, opts_set, flag_unwind_tables, 1); ... PR driver/103465 gcc/ChangeLog: * opts.c (finish_options): More part of diagnostics to ... (diagnose_options): ... here. Call the function from both finish_options and process_options. * opts.h (diagnose_options): Declare. * toplev.c (process_options): Call diagnose_options.=