Bug 41114
Summary: | Internal compiler error in fixup_var_refs_1, at function.c:1874 | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Need Real Name <xiurong.zhu> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2002-12-15 14:51:47 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Need Real Name
2001-05-17 16:36:08 UTC
You need to include self-contained testcase (this is not one) and write what exact command line you used (KCC is some Japanesse package, did you mean kgcc? What do you mean by using gcc as backend?). I've added #include <complex> void checkVal(float,float); at the start of the file and it compiled just fine with various optimization options, with gcc, g++, egcs++, kgcc. Hi: KCC is our own C++ compiler (see www.kai.com) on most Unix systems. We use gcc as backend compiler on all linux rh systems. Our KCC's frontend optimizes c and c++ code, it then generates and passes intermediate c code to gcc for final compilation. The following is reduced code we passed to KCC: #include <complex.h> void check_complex_float (void) { // // check operator for complex<float> // complex<float> x((float)0.0, (float)1.0); // // Operation 1: Complex Number Multiplication of the type // ComplexNumber *= ComplexNumber // x *= x; // // Operation 2: Complex Number Division of the type // ComplexNumber /= ComplexNumber // x /= x; } int main () { return 1; } where we defined templated complex class in our own library. The above code will stop compiling when we turn on inlining specification to certain degree (KCC's own optimization option). So, what I did next is to let our KCC frontend to run above file with the bad inlining option, which generated the file that is supposed to be passed to gcc. The following is the modified version the file in readable c code: struct my_complex { float re; float im; }; extern void check_complex_float(void); extern int main(void); static __inline__ struct my_complex *divide(struct my_complex *const, const struct my_complex *); void check_complex_float(void) { float f1; struct my_complex com1; float f2; float f3; (com1.re) = (1.F); (com1.im) = (0.F); f2 = (((com1.re)) * ((com1.re))); f3 = (f2 - (((com1.im)) * ((com1.im)))); f1 = (((com1.im)) * ((com1.re))); (com1.im) = (f1 + (((com1.re)) * ((com1.im)))); (com1.re) = f3; divide((&com1), ((const struct my_complex *)(&com1))); return; } int main(void) { check_complex_float(); return 1; } static __inline__ struct my_complex *divide( struct my_complex *const this, const struct my_complex *com) { float f1; double d1; double d2; float f2; float f_re; float f_im; float f_d; struct my_complex com1; float f_c; double d_y; f_d = ((this->im)); f_c = ((this->re)); f1 = ((com->im)); f2 = ((com->re)); d_y = ((double)f1); d2 = ((double)f2); d1 = ((1.) / ((d2 * d2) + (d_y * d_y))); f_re = ((float)(((((double)f_c) * d2) + (((double)f_d) * d_y)) * d1)); f_im = ((float)(((((double)f_d) * d2) - (((double)f_c) * d_y)) * d1)); (com1.re) = f_re; (com1.im) = f_im; (this->re) = ((com1.re)); (this->im) = ((com1.im)); return this; } Compiling it with gcc having the option of -O -ansi -c -v ( or just -ansi -c -v) will result in the following error message from gcc: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (RedHat Linux 7.1 2.96-81) /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c -std=c89 -v -D__GNUC__=2 - D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -D__unix__ -D__linux __ -D__unix -D__linux -Asystem(posix) -D__OPTIMIZE__ -Acpu(i386) -Amachine (i386) -D__i386 -D__i386__ -D__tune_i386__ gcc_error_1.c /tmp/cczsj0gQ.i GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-81) (cpplib) (i386 Linux/ELF) ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include /usr/include End of search list. /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1 /tmp/cczsj0gQ.i -quiet -dumpbase gcc_error_1.c -ansi -O -ansi -version -o /tmp/ccuxjlYv.s GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-81) (i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-81). gcc_error_1.c: In function `check_complex_float': gcc_error_1.c:20: Internal compiler error in fixup_var_refs_1, at function.c:1874 Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Please let me know as soon as possible your comments. Thanks |