[Bug c/56356] New: DJGPP compiler crashing

2013-02-16 Thread fabrizio.ge at tiscali dot it


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56356



 Bug #: 56356

   Summary: DJGPP compiler crashing

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: fabrizio...@tiscali.it





I am building gcc as cross-compiler for DJGPP, running on an Ubuntu 12.04

machine. I downloaded the sources of binutils 2.23.1 and gcc 4.7.2. binutils

compiled with no problems. gcc's build proceeded for a while, so that the

compiler was actually built, but, while compiling libstdc++, the cross-compiler

crashed.



This is the command (part of the build process) that caused the crash



/home/fabrizio/dev/djgpp/cross/gcc/./gcc/xgcc -v -shared-libgcc

-B/home/fabrizio/dev/djgpp/cross/gcc/./gcc -nostdinc++

-L/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/src

-L/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/src/.libs

-B/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/bin/

-B/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/lib/ -isystem

/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/include -isystem

/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/sys-include

-I/home/fabrizio/dev/djgpp/cross/gcc-4.7.2/libstdc++-v3/../libgcc

-I/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include/i586-pc-msdosdjgpp

-I/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include

-I/home/fabrizio/dev/djgpp/cross/gcc-4.7.2/libstdc++-v3/libsupc++

-fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi

-fdiagnostics-show-location=once -ffunction-sections -fdata-sections

-frandom-seed=strstream.lo -g -O2

-I/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include/backward

-Wno-deprecated -c ../../../../../gcc-4.7.2/libstdc++-v3/src/c++98/strstream.cc

-o strstream.o



I even tried to use gdb to debug cc1plus.



gdb --args /home/fabrizio/dev/djgpp/cross/gcc/./gcc/cc1plus  -quiet

-nostdinc++ -v -I

/home/fabrizio/dev/djgpp/cross/gcc-4.7.2/libstdc++-v3/../libgcc -I

/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include/i586-pc-msdosdjgpp

-I

/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include

-I /home/fabrizio/dev/djgpp/cross/gcc-4.7.2/libstdc++-v3/libsupc++ -I

/home/fabrizio/dev/djgpp/cross/gcc/i586-pc-msdosdjgpp/libstdc++-v3/include/backward

-iprefix

/home/fabrizio/dev/djgpp/cross/gcc/gcc/../lib/gcc/i586-pc-msdosdjgpp/4.7.2/

-isystem /home/fabrizio/dev/djgpp/cross/gcc/./gcc/include -isystem

/home/fabrizio/dev/djgpp/cross/gcc/./gcc/include-fixed -remap -imacros

/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/bin/../include/sys/version.h

-isystem /home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/include -isystem

/home/fabrizio/dev/djgpp/i586-pc-msdosdjgpp/sys-include

../../../../../gcc-4.7.2/libstdc++-v3/src/c++98/strstream.cc -quiet

-dumpbase strstream.cc -mtune=pentium -march=pentium -auxbase-strip

strstream.o -g -O2 -Wall -Wextra -Wwrite-strings -Wcast-qual

-Wabi -Wno-deprecated -version -fno-implicit-templates

-fdiagnostics-show-location=once -ffunction-sections -fdata-sections

-frandom-seed=strstream.lo -o /tmp/ccqldaCk.s



And this is the result



Program received signal SIGSEGV, Segmentation fault.

eliminate_regs_1 (x=0x0, mem_mode=VOIDmode, insn=0x0, 

may_use_invariant=0 '\000', for_costs=0 '\000')

at ../../gcc-4.7.2/gcc/reload1.c:2549

2549  enum rtx_code code = GET_CODE (x);

(gdb) ba

#0  eliminate_regs_1 (x=0x0, mem_mode=VOIDmode, insn=0x0, 

may_use_invariant=0 '\000', for_costs=0 '\000')

at ../../gcc-4.7.2/gcc/reload1.c:2549

#1  0x007d42da in eliminate_regs (x=optimised out, 

mem_mode=mem_mode@entry=VOIDmode, insn=insn@entry=0x0)

at ../../gcc-4.7.2/gcc/reload1.c:2960

#2  0x007ed561 in sdbout_parms (parms=0x75e8a440)

at ../../gcc-4.7.2/gcc/sdbout.c:1278

#3  sdbout_end_prologue (line=optimised out, file=optimised out)

at ../../gcc-4.7.2/gcc/sdbout.c:1594

#4  sdbout_begin_prologue (line=optimised out, file=optimised out)

at ../../gcc-4.7.2/gcc/sdbout.c:1585

#5  0x006aea43 in final_start_function (first=optimised out, 

file=0x13751d0, optimize_p=optimised out)

at ../../gcc-4.7.2/gcc/final.c:1543

#6  0x009aa10e in x86_output_mi_thunk (file=0x13751d0, 

thunk=optimised out, delta=-8, vcall_offset=0, function=optimised out)

at ../../gcc-4.7.2/gcc/config/i386/i386.c:32312

#7  0x0061e2f2 in assemble_thunk (node=0x75e99000)

at ../../gcc-4.7.2/gcc/cgraphunit.c:1641

#8  assemble_thunks_and_aliases (node=optimised out, node=optimised out)

at ../../gcc-4.7.2/gcc/cgraphunit.c:1802

#9  0x0061e231 in assemble_thunks_and_aliases (node=0x75e80b40, 

---Type return to continue, or q return to quit---

node=0x75e80b40) at 

[Bug target/41557] gcc.exe: Internal error: (null) (program cc1plus)

2012-03-04 Thread fabrizio.ge at tiscali dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41557

Fabrizio Gennari fabrizio.ge at tiscali dot it changed:

   What|Removed |Added

 CC||fabrizio.ge at tiscali dot
   ||it

--- Comment #1 from Fabrizio Gennari fabrizio.ge at tiscali dot it 2012-03-04 
17:24:31 UTC ---
Just tried building gcc-4.6.3 as DJGPP cross-compiler running on Ubuntu, but
encountered a very similar bug to this one, only occurring in cc1 instead of
cc1plus.

The compiler builds fine, but then, when it has to compile libgcc, it
segfaults.

I tried running the compiler with a trivial C program (int main(){return 0;}).
It segfaults.

I tried to debug cc1 with gdb. The lines causing the crash are in c-common.c:
int16_type_node =
  TREE_TYPE (identifier_global_value (c_get_ident (INT16_TYPE)));

The call to identifier_global_value() returns NULL, and the pointer is
dereferenced by the macro TREE_TYPE, causing the crash.

This means that DJGPP cannot be used as a target with recent versions of gcc.
It may be little used nowadays, but, since it is not unsupported, it should
work.