This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [C++ PATCH] Fix 4206


Hi,

Nathan Sidwell <nathan@codesourcery.com> wrote:
> Jason's mainline patch of
> 2001-06-08  Jason Merrill  <jason_merrill@redhat.com>
> 
>   * stmt.c (current_nesting_level): New fn.
>   * tree.h: Declare it.
>   * c-semantics.c (genrtl_compound_stmt): Use it.
> detected a latent bug in while and for loop scoping. KDE has such
> a case. This patch fixes that.
[snip]

I applied the patch, and tested in on the OpenSP package (part of the
OpenJade SGML processing suite).  I had trouble, which distilled down
to the following:

template<class T> struct A { A() {} };
struct B { ~B(); };
struct C : public B { C(); };

C::C()
{
  for (;;) {
    A<B> a;
    for (;;) ;
  }
}
 
  $ c++ -c -O2 test2.cc
  test2.cc: In constructor `C::C()':
  test2.cc:7: Internal compiler error in expand_end_loop, at stmt.c:2563
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I haven't tested this snippet without the patch, but an older checkout
of GCC without this patch compiled the original file without problems.

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]