This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: [tree-ssa] Bootstrap failure in libiberty/cplus-dem.c


Op ma 10-03-2003, om 16:37 schreef Steven Bosscher:
> I tried to do a C-only bootstrap of the current tree-ssa branch on
> i586-pc-linux-gnu.  Stage 0 compiler is  GCC 2.95.3 (SuSE 7.2),
> stage 2 and compare do not fail.

Here's a test case I cut out of cplus-dem.c.  I started with cutting
down that file to the bare minimum that triggers the bug, but the result
looked quite easy to compile to me:

---- 8< ----
#include <string.h>

static void
demangle_prefix (void)
{
  const char *scan;
  int i;

  i = strspn (scan, "_");
  if (i > 2)
    {
      scan += (i - 2);
    }
}
---- 8< ----


So I preprocessed this and cut away all the cruft.  It turns out that
strspn function is inlined, and a very small test case is:


---- 8< ----
typedef unsigned int size_t;

extern __inline size_t
__strspn_c1 (__const char *__s, char __accept)
{
  register size_t __result = 0;

  while (__s[__result] == __accept)
    ++__result;
  return __result;
}

static void
demangle_prefix (void)
{
  const char *scan;
  char __a0 = ((__const char *) ("_"))[0];
  int i;

  i = __strspn_c1 (scan, __a0);
}
---- 8< ----
# ./xgcc -B/home/steven/devel/gcc/build-ssa/gcc/ -B/opt/experimental/i586-pc-linux-gnu/bin/ -B/opt/experimental/i586-pc-linux-gnu/lib/ -isystem /opt/experimental/i586-pc-linux-gnu/include -c -O bug.c
bug.c: In function `demangle_prefix':
bug.c:8: internal compiler error: in copy_to_mode_reg, at explow.c:731
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


Line 8 is the "while (__s[__result] == __accept) line.

That's about the best I can do for you, hope it helps.

Greetz
Steven




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