This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -Wshadow=local warnings in rtl.h
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 3 Oct 2019 15:31:58 +0000
- Subject: Re: [PATCH] Fix -Wshadow=local warnings in rtl.h
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1ThlKSL4c4msNmKCknRlsHsGpmqAc3Lvp0+vqrWHabg=; b=b395a088ddm9WpsAXNi8c4uL+pQaj9CS7Zlb/7i3IBqF8j1om7fsPA6UzOOJ52MpOXgKUAZEB0QZkAa7ncNt6hFIbQW/hF8unz5N+muSuuft2KpmWor+Ije2lMtWVN4NxE+CBE0Ja1e3njF287uzhlEuRd5RXek5fGtVCnPLdDfjSiwgUnNdIzwQ5gnIGoxusIWGV2f8gaySgdY8vrSuc/obNJxE4kdopXPxLBnYlDPoCMEzxWtIyIC/cOOhJbfqD8Qnr9DSDcbANIxuWoRH/74TsSCxwumnm0KRbfeuBRHHE3PkYOqU5KGZC8Q7TPdZmvKPdijHLh7Tenl+XzhwvA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VUxCKzkKcIMHHkcJLbRDHmgvC/7CKWOS2OYELRSHr2DZxO4p7hYfwUF+ZLBKfvUT9XNtzivOVclAbhmeDWnf4rwRjOZJILUiSWHZ8nl3bj4JVA6fHx9jeZ5VOdGMqelzLscUVg2n6O1wxiqdbPXj/k3TsiBDu3QvLq0duoWzy4VAl3N/rJvbjPZO7kT8ziVe9Iwsz5ewtpOnYoZzcOBCkt6uBei8LkXjXPg0J5+ZtsTJu6qEuwCaUv1G1cvduKeEmu7P+JyGS+BHMLnZLci2bXGsSLHGWmxCvdEcr/b3wPOJkbRI8WsyMhkwVrRp8K3xrCGP0j/qu1WPfuVIQ/nrAg==
- References: <VI1PR03MB452892F64E88E21B5BC0B380E49F0@VI1PR03MB4528.eurprd03.prod.outlook.com> <20191003152555.GQ15914@tucnak>
On 10/3/19 5:25 PM, Jakub Jelinek wrote:
> On Thu, Oct 03, 2019 at 03:17:47PM +0000, Bernd Edlinger wrote:
>> Hi,
>>
>> this fixes -Wshadow=local warnings in the RTL_FLAG_CHECKx macros,
>> which happen when this macro is used recursively in a macro
>> argument. The __typeof (RTX) const _rtx in the inner macro
>> expansions shadows the outer macro expansions.
>>
>> So reworked the macro to not use statement expressions but
>> use templates instead. Since the 7-argument overload is not
>> used anywhere removed RTL_FLAG_CHECK7 for now.
>
> What effect does this have on the cc1/cc1plus .text sizes?
> Does this affect debuggability of --enable-checking=yes,rtl compilers?
> I mean, often when we replace some macros with inlines step in GDB
> becomes a bigger nightmare, having to go through tons of inline frames.
> gdbinit.in has a lengthy list of inlines to skip in rtl.h, shouldn't this be
> added to that list? Not 100% sure how well it will work on rtl checking
> vs. non-rtl checking builds.
>
> Jakub
>
I checked that the resulting code does not look completely stupid, but
I will try to find answers to your questions above by tomorrow.
Thanks
Bernd.