Old, but minor bug with bad C++ code

dbjh@gmx.net dbjh@gmx.net
Tue Apr 11 05:07:00 GMT 2000


L.S.,

This statement
  char *c=new char[3]={"ab"};
causes gcc to generate the internal compiler error message.
I don't know if you can use this, but here is what I observed:
- there must be a number between the brackets
- any number generates the same error, not just 3
- string must be >= 2 characters
- the other base types generate the same error, not just char

I tested gcc 2.81, 2.95.2 and egcs-2.91.66 and they all had the bug.

Here is the other information you asked for in
http://www.gnu.org/software/gcc/bugs.html . (The .ii file is in the attachment.)

Kind regards,
Daniel Horchner

Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix
-D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux
-Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386
-D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro
-D__pentiumpro__ gcc_bug.cc /tmp/ccGxDDOs.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include

/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccGxDDOs.ii
-quiet -dumpbase gcc_bug.cc -version -o /tmp/ccyA2W8K.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by
GNU C version 2.95.2 19991024 (release).
gcc_bug.cc: In function `int main()':
gcc_bug.cc:4: Internal compiler error in `emit_move_insn', at expr.c:2593
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for
instructions.

-- 
Sent through GMX FreeMail - http://www.gmx.net
# 1 "gcc_bug.cc"
int main()
{
 
  char *c=new char[3]={"ab"};
 






  return 0;
}


More information about the Gcc-bugs mailing list