This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][C fam] Fix PR80593, bogus strict-aliasing warnings
- From: Marek Polacek <polacek at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Fri, 19 May 2017 14:25:21 +0200
- Subject: Re: [PATCH][C fam] Fix PR80593, bogus strict-aliasing warnings
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=polacek at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1BC82C04B326
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1BC82C04B326
- References: <alpine.LSU.2.20.1705181257330.20726@zhemvz.fhfr.qr>
On Thu, May 18, 2017 at 01:00:39PM +0200, Richard Biener wrote:
>
> The following reverts an earlier change of mine (2008) to explicitely
> warn about accessing alias-set zero memory with alias-set non-zero.
> That was supposed to catch the case in g++.dg/warn/Wstrict-aliasing-6.C
> which is
>
> int foo ()
> {
> char buf[8];
> return *((int *)buf); /* { dg-warning "strict-aliasing" } */
> }
>
> but at least since the typeless storage work this is considered valid
> and thus this warning is really bogus.
>
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
>
> Ok for trunk and GCC 7 branch?
I think this is fine.
Marek