This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Jump to const_int
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: RFC: Jump to const_int
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Sat, 13 Jan 2001 16:10:41 +1100
- Cc: gcc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- References: <no.id> <200101130340.WAA21616@hiauly1.hia.nrc.ca>
On 12-Jan-2001, John David Anglin <dave@hiauly1.hia.nrc.ca> wrote:
> > I found the following testcase fails (991213-3.c) with the above abort:
> >
> > int jump () { goto * (int (*) ()) 0xbabebec0; }
>
> One further thought. The test looks bogus to me because the address
> clearly can't be in the current function. Thus, the behavior of such
> a jump is totally unpredictable.
>
> Gcc allows as an extension goto's to any void * expression. Thus, the
> above is accepted but it will clearly cause problems when edges are
> to be calculated.
The *runtime* behaviour of such a jump is unpredictable.
It should be a runtime error, and a compile-time warning might be nice,
but it should not be a compile-time error and nor should the compiler
get an internal compiler error.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.