Version info: gcc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.2 Also fails with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Here are the .i contents - brief, so you get contents instead of attachment # 1 "/ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c" # 11 "/ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c" const int PRICE_SIZE = 15; int main () { char validPriceStr[][PRICE_SIZE] = { "111111", "0.123456", "999999", "3 1/2", "4 7/256", "5/8", "1 2/3", "0.00000000001", "12.12 ", "5 3 /8", "6.9999999999" }; # 56 "/ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c" return 1; } Compiler output: /ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c: In function `main': /ioi/users/andrewk/BP74/2.4/lib/brassii/test/test_ustring.c:18: Internal compiler error in size_binop, at fold-const.c:2014 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. Changing PRICE_SIZE to a #define works around this bug.
Related to bug 10089. Confirmed on the mainline (20030907). Reduced a little more: const int PRICE_SIZE = 15; int main () { char validPriceStr[][PRICE_SIZE] = {" " }; return 1; } This is not a regression, just like 10089.
Subject: RE: Internal compiler error in size_binop, at fold-const.c:2014 Wow - quick response! Sorry - when I searched "summary" for "internal compiler error" I got no results, so I thought this was brand-spanking new. My construct, using const int XX_SIZE = 15; is a real-world usage, resulting from a coding standard directive to upgrade #define's to const int's. I'm not sure that a non-const variable should be allowed to declare array sizes. Thanks and keep up the great work! Andy -----Original Message----- From: pinskia at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] Sent: Monday, September 08, 2003 10:10 AM To: Krassowski, Andrew Subject: [Bug c/12207] Internal compiler error in size_binop, at fold-const.c:2014 PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12207 pinskia at gcc dot gnu dot org changed: What |Removed |Added ------------------------------------------------------------------------ ---- BugsThisDependsOn| |10089 Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |ice-on-valid-code Last reconfirmed|0000-00-00 00:00:00 |2003-09-08 14:10:19 date| | ------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-08 14:10 ------- Related to bug 10089. Confirmed on the mainline (20030907). Reduced a little more: const int PRICE_SIZE = 15; int main () { char validPriceStr[][PRICE_SIZE] = {" " }; return 1; } This is not a regression, just like 10089. ------- You are receiving this mail because: ------- You reported the bug, or are watching the reporter.
Actually it is allowed by the C99 standard (this is really a GCC extension from ways back and was incorporated into the standard for ANSI/ISO C99). The best way to search for related bugs is to search for where they die in this case, size_binop and not just "internal error".
Created attachment 4883 [details] .i file without non-constant value in array definition
I'm encountering the same bug but without apparent non-constant in array definition. Perhaps this will help getting a patch. Compiling an ECOS file (i386 target) .i file attached Command line ------------ i386-elf-gcc -c -I/ecos-f/cygwin/home/Denis/ecos_dev/1stredboot_install/include -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0 -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/tests -I. -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src/ -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -save-temps -Wp,-MD,src/hal_misc.tmp -o src/hal_i386_arch_hal_misc.o /opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src/hal_misc.c cc1: Internal compiler error in size_binop, at fold-const.c:2014 gcc version ------------ i386-elf-gcc -c -I/ecos-f/cygwin/home/Denis/ecos_dev/1stredboot_install/include -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0 -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/tests -I. -I/opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src/ -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -save-temps -Wp,-MD,src/hal_misc.tmp -o src/hal_i386_arch_hal_misc.o /opt/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src/hal_misc.c cc1: Internal compiler error in size_binop, at fold-const.c:2014 system ------ Pentium 4, Windows 98, cygwin 3.3.1 [discalimer] first gcc bug report. I read the instructions and I hope I haven't missed anything;-)
Created attachment 5610 [details] Problems when compiling with win98
I get the "same" ICE doing something quite different. I was using gcj (gcc (GCC) 3.3.3 20040125 (prerelease) (Debian)). I get the message compiling a rather trivial method without any arrays (I've shortened the package names): Method public accept(Interpreter ) -> void 0 aload_1 1 aload_0 2 invokevirtual #5 <Method Interpreter.visit_FLOAD (LFLOAD;)V> 5 return GCC output: FLOAD.java: In class `FLOAD': FLOAD.java: In method `accept(Interpreter)': FLOAD.java:0: Internal compiler error in size_binop, at fold-const.c:2017 Please submit a full bug report, with preprocessed source if appropriate. If someone wants the code to reproduce this problem, don't hesitate to contact me.
Andrew's testcase cfrom comment #1 now compiles on tree-ssa. Fixed by Richard's patch http://gcc.gnu.org/ml/gcc-cvs/2004-05/msg00129.html
Suspending as fixed for the tree-ssa.
Fixed for 3.5.0 by the merge of the tree-ssa.
The bug reappeared.
It is now tracked in PR 16409. *** This bug has been marked as a duplicate of 16409 ***