This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/697
- To: nobody at gcc dot gnu dot org
- Subject: Re: optimization/697
- From: rth at gcc dot gnu dot org
- Date: 16 Jan 2001 15:56:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: rth at gcc dot gnu dot org
The following reply was made to PR optimization/697; it has been noted by GNATS.
From: rth@gcc.gnu.org
To: Mike@arl.army.mil, acst@arl.army.mil, gcc-gnats@gcc.gnu.org,
nobody@gcc.gnu.org
Cc:
Subject: Re: optimization/697
Date: 16 Jan 2001 15:50:21 -0000
Synopsis: 2.96 20000731 (Red Hat Linux 7.0) generates bad linked list code on -O2, working code on -O1 or -g
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Jan 16 07:50:21 2001
State-Changed-Why:
The function rt_free_pt_list accesses the same memory as a
struct bu_list and as a struct partition. This violates ISO C
type aliasing rules.
As a gcc extension you may access the same memory as different
types via a union. Note that there is *no* portable way to do
this in ISO C.
Alternately, compile with -fno-strict-aliasing to disable the
type-based aliasing rules entirely.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=697&database=gcc