This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c/1910: incorrect long long return value with -O2 optimization


The following reply was made to PR c/1910; it has been noted by GNATS.

From: dan kopetzky <djk@super.org>
To: Richard Henderson <rth@redhat.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/1910: incorrect long long return value with -O2 optimization
Date: Fri, 09 Feb 2001 08:13:19 -0500

 Richard Henderson wrote:
 
 > 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~
 
 Thanks for your prompt reply. I'll convert the offending code to use
 unions.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]