This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 3.3 error when inlining
- From: Michael S. Zick <mszick at goquest dot com>
- To: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>,gcc at gcc dot gnu dot org
- Date: Thu, 12 Jun 2003 16:33:52 -0500
- Subject: Re: 3.3 error when inlining
- References: <200306121516.RAA13775@faui11.informatik.uni-erlangen.de>
On Thursday 12 June 2003 10:16 am, Ulrich Weigand wrote:
> Hello,
>
> when compiling the reduced testcase below with -O3 on gcc 3.3, I'm getting
> the following error message:
>
> scopebug.i: In function `outer':
> scopebug.i:13: error: jump to `label' invalidly jumps into binding contour
>
> With -O2, the testcase compiles fine. CVS head compiles it without error
> either with -O2 or -O3.
>
> From my reading of the standard, the testcase should be correct C,
> so I guess the 3.3 inliner may get confused about scopes ...
>
Note that the "label" is "if (0)" out - it shouldn't exist - regardless of -O?
Compiling with gcc-2.95 the optimization made is "inner" is a leaf function;
With optimization, "outer" jumps to "inner" (there is no "label")
Without optimization, "outer" calls to "inner" (there is no "label")
So the confusion must be about "dead code removal - take the label
with you when you go" - or prehaps the scope of dead code.
Mike
>
> static void
> inner (int len)
> {
> {
> char buf[len];
>
> if (0)
> {
> label:
> return;
> }
>
> goto label;
> }
> }
>
> void
> outer (int len)
> {
> inner (len);
> }