This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31727] Functions with non-local gotos are considered not to have side effects
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Apr 2007 23:36:13 -0000
- Subject: [Bug tree-optimization/31727] Functions with non-local gotos are considered not to have side effects
- References: <bug-31727-5077@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-04-28 00:36 -------
This code is undefined
Take a look at the manual:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Labels-as-Values.html
You may not use this mechanism to jump to code in a different function. If you
do that, totally unpredictable things will happen. The best way to avoid this
is to store the label address only in automatic variables and never pass it as
an argument.
There is nothing special about this code, except it is undefined :).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31727