From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120234 invoked by alias); 11 Feb 2016 06:51:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 120220 invoked by uid 89); 11 Feb 2016 06:51:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:15.1.409.10, Hx-spam-relays-external:15.1.409.10, H*r:ip*15.1.409.10, HX-HELO:sk:DUB004- X-HELO: DUB004-OMC3S12.hotmail.com Received: from dub004-omc3s12.hotmail.com (HELO DUB004-OMC3S12.hotmail.com) (157.55.2.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Thu, 11 Feb 2016 06:51:05 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com ([157.55.2.8]) by DUB004-OMC3S12.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 10 Feb 2016 22:51:02 -0800 Received: from VI1PR07MB0911.eurprd07.prod.outlook.com (10.161.109.11) by VI1PR07MB0912.eurprd07.prod.outlook.com (10.161.109.12) with Microsoft SMTP Server (TLS) id 15.1.409.10; Thu, 11 Feb 2016 06:51:01 +0000 Received: from VI1PR07MB0911.eurprd07.prod.outlook.com ([10.161.109.11]) by VI1PR07MB0911.eurprd07.prod.outlook.com ([10.161.109.11]) with mapi id 15.01.0409.014; Thu, 11 Feb 2016 06:51:00 +0000 From: Bernd Edlinger To: David Wohlferd , Bernd Schmidt , "gcc-patches@gcc.gnu.org" , Richard Henderson , "jason@redhat.com" CC: "segher@kernel.crashing.org" , "sandra@codesourcery.com" , "Paul_Koning@Dell.com" , Jeff Law , "bernds_cb1@t-online.de" , Andrew Haley Subject: AW: AW: Wonly-top-basic-asm Date: Thu, 11 Feb 2016 06:51:00 -0000 Message-ID: References: <56A54EF9.8060006@LimeGreenSocks.com> <56A61442.3090803@redhat.com> <56A9C134.1030500@LimeGreenSocks.com> <56B80F57.9020606@LimeGreenSocks.com> ,<56BBCC90.9020001@LimeGreenSocks.com> In-Reply-To: <56BBCC90.9020001@LimeGreenSocks.com> authentication-results: kernel.crashing.org; dkim=none (message not signed) header.d=none;kernel.crashing.org; dmarc=none action=none header.from=hotmail.de; x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [SMt+hprf5s6MCgGHTXyDvhxCROKr2C2v] x-microsoft-exchange-diagnostics: 1;VI1PR07MB0912;5:NG+jhNRDy6ylqrQMmTa2Rhcyx/D32rY3EGgPnsPaICEJ+LFNGL2E4Q/lMblR/wwQbtdj9JuP4BEE6l3FZGa/PkdiAUWK9QlMzQKoQ7m0cNVGe6JdTSTMyPOK1mOHrOuJo+2HOUrP6dUvq0lKtmdl+A==;24:zqs7hPXQnSrre7/Vpw7OA9YYYEi8K7XOdkxU0vw7PK30e5GUCXSzubVJ54Vj1y35bN3ECTli0z0+8jsOyFsUEsfdT0coOISPMfl4ib/WBSI= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR07MB0912; x-ms-office365-filtering-correlation-id: 28ff6c97-69e3-49bb-f443-08d332afb3cb x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(432015012)(82015046);SRVR:VI1PR07MB0912;BCL:0;PCL:0;RULEID:;SRVR:VI1PR07MB0912; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM;SFS:(7070004)(6009001)(24454002)(377424004)(54534003)(3660700001)(2950100001)(4326007)(229853001)(3280700002)(74316001)(2900100001)(74482002)(50986999)(5890100001)(76176999)(54356999)(5008740100001)(73972006)(75402003)(77096005)(2501003)(5003600100002)(19580405001)(122556002)(40100003)(102836003)(230783001)(106116001)(189998001)(87936001)(586003)(10400500002)(1220700001)(82202001)(92566002)(5001770100001)(4000100100001)(33656002)(76576001)(19580395003)(86362001)(5002640100001)(7059030);DIR:OUT;SFP:1901;SCL:1;SRVR:VI1PR07MB0912;H:VI1PR07MB0911.eurprd07.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-1-409-10-msonline-outlook-d6129.templateTenant X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2016 06:51:00.5119 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB0912 X-SW-Source: 2016-02/txt/msg00741.txt.bz2 On 11.2.2016, David Wohlferd wrote: > > Since no one expressed any objections, I have renamed the option from > -Wonly-top-basic-asm to -Wbasic-asm-in-function. This more clearly > conveys what the option does (give a warning if you find basic asm in a > function). >=20 why not simply -Wbasic-asm ? > I believe the attached patch addresses all the other outstanding comments. >=20 Indentation wrong here. The whole block must be indented by 2 spaces. > if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN) && !is_goto) >+ { >+ /* Warn on basic asm used inside of functions, >+ EXCEPT when in naked functions. Also allow asm (""). */ Comments should end with dot space space */ >+ if (warn_basic_asm_in_function && TREE_STRING_LENGTH (str) !=3D 1) >+ if (lookup_attribute ("naked", >+ DECL_ATTRIBUTES (current_function_decl)) the DECL_ATTRIBUTES should be at the same column as the "naked". >+ =3D=3D NULL_TREE) >+ warning_at (asm_loc, OPT_Wbasic_asm_in_function, >+ "asm statement in function does not use extended syntax"); >+ > goto done_asm; >+ } >@@ -18199,6 +18201,17 @@ > /* If the extended syntax was not used, mark the ASM_EXPR. */ > if (!extended_p) > { >+ /* Warn on basic asm used inside of functions, >+ EXCEPT when in naked functions. Also allow asm (""). */ Comments should end with dot space space */ >+ if (warn_basic_asm_in_function >+ && TREE_STRING_LENGTH (string) !=3D 1) >+ if (lookup_attribute ("naked", >+ DECL_ATTRIBUTES (current_function_decl)) the DECL_ATTRIBUTES should be at the same column as the "naked". > ChangeLog: > 2016-02-10 David Wohlferd >=20 > * doc/extend.texi: Doc basic asm behavior and new > -Wbasic-asm-in-function option. > * doc/invoke.texi: Doc new -Wbasic-asm-in-function option. > * c-family/c.opt: Define -Wbasic-asm-in-function. > * c/c-parser.c: Implement -Wbasic-asm-in-function for C. > * cp/parser.c: Implement -Wbasic-asm-in-function for c++. C++, isn't it always upper case? > * testsuite/c-c++-common/Wbasic-asm-in-function.c: New tests for > -Wbasic-asm-in-function. > * testsuite/c-c++-common/Wbasic-asm-in-function-2.c: Ditto. >=20 ChangeLog lines begin with TAB. Please split the ChangeLog, there are separate ChangeLogs at gcc/ChangeLog (doc changes go in there) gcc/c/ChangeLog, gcc/cp/ChangeLog, gcc/c-family/ChangLog and gcc/testsuite/ChangeLog, the respective ChangeLog entries use relative file names. Please add the function name where you changed in brackets. For instance: * c-parser.c (cp_parser_asm_definition): Implement -Wbasic-asm-in-funct= ion. Thanks Bernd. > While I have a release on file with FSF, I don't have write access to SVN. >=20 > dw