This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12800] [tree-ssa] Store dropped after cast to pointer from integer of different size
- From: "dnovillo at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2003 01:07:34 -0000
- Subject: [Bug optimization/12800] [tree-ssa] Store dropped after cast to pointer from integer of different size
- References: <20031028001552.12800.falk@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12800
------- Additional Comments From dnovillo at redhat dot com 2003-10-28 01:07 -------
Subject: Re: [tree-ssa] Store dropped after cast
to pointer from integer of different size
On Mon, 2003-10-27 at 19:56, falk dot hueffner at student dot
uni-tuebingen dot de wrote:
> > > void op_stw_raw_T0_A0(int T2)
> > > {
> > > *(char *) T2 = 0;
> > > }
> > >
> > Why do you expect this to work? T2 is an integer, not a pointer.
>
> Well, the result of this is implementation defined, and gcc used to
> support converting pointers to numbers and back. Do you think this
> should be dropped?
>
Oh, bother. So I guess we should support it. The fix shouldn't be too
hard. This is gimplified to
op_stw_raw_T0_A0 (T2)
{
char * T2.1;
T2.1 = (char *)T2;
*T2.1 = 0;
}
The variable finder ought to mark T2.1 as a pointer to global memory.
I'll assign this PR to me.
Diego.