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]

bootstrap/4768: gencodes core dumps under 64-bit HP-UX because of alloca prototype



>Number:         4768
>Category:       bootstrap
>Synopsis:       gencodes core dumps under 64-bit HP-UX because of alloca prototype
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 01 23:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Deron Meranda
>Release:        gcc 3.0.2
>Organization:
>Environment:
hppa2.0w-hp-hpux11.00
HP-UX 11.0, HP C/ANSI C compiler B.11.01.06, HP 9000 model L2000-44 (64-bit PA-RISC), all HP-UX standard patches up to the August 2001 patch bundle are installed, GNU binutils 2.11.2, GNU make 3.79.1.
>Description:
Attempting to build gcc for platform "hppa2.0w-hp-hpux11.00".  This is NOT a cross compiler.

Fails in first pass of bootstrap when running "gencodes", with a SEGV core dump in the file rtl.c at line 1130, immediately after the first call to alloca().  alloca() is being provided by the included libiberty/alloca.c file, not by the operating system or HP compiler.

Using HP C compiler "/usr/bin/cc -Ae +DA2.0W +DD64".  The extra flags force it into standard 64-bit mode, since this environment supports both 32-bit and 64-bit development.

I determined that this problem is due to the prototype for the alloca() function not being present.  Since this is a 64-bit environment, alloca() is returning an 8-byte pointer.  But without a function prototype, the compiler is coercing the return type into an int, which is only 4-bytes.  This corrupts the pointer.
>How-To-Repeat:
CC="/usr/bin/cc -Ae +DA2.0W +DD64" \
configure --enable-threads=posix --with-gnu-as hppa2.0w-hp-hpux11.00

gmake bootstrap
>Fix:
Insure that there is a prototype for alloca(), such as:

void * alloca (size_t);

The most obvious place is in the "gcc/system.h" header, but this may not be the best way to fix it.
>Release-Note:
>Audit-Trail:
>Unformatted:


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