This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/1910: incorrect long long return value with -O2 optimization
- To: nobody at gcc dot gnu dot org
- Subject: Re: c/1910: incorrect long long return value with -O2 optimization
- From: Richard Henderson <rth at redhat dot com>
- Date: 9 Feb 2001 08:36:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Richard Henderson <rth at redhat dot com>
The following reply was made to PR c/1910; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: djk@super.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/1910: incorrect long long return value with -O2 optimization
Date: Fri, 9 Feb 2001 00:31:59 -0800
On Thu, Feb 08, 2001 at 01:14:45PM -0000, djk@super.org wrote:
> struct cl val;
> val.one = a;
> val.two = 0;
> return *(long long *)&val;
This code is incorrect. You are running afoul of ISO C
type aliasing rules.
r~