gcc (GCC) 4.5.0 20090702 (experimental) [trunk revision 149195] building gdb head as of today. preprocessed file and coming in next update gcc -c -g -O2 -DDEFAULT_INLINE=PSIM_INLINE_LOCALS -DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN -DWITH_SMP=5 -DWITH_TRACE=1 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZERO -I. -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../include -I../../bfd -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../bfd -I../../gdb -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../gdb -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../gdb/config -DHAVE_COMMON_FPU -I../common -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../common targ-map.c gcc -c -g -O2 -DDEFAULT_INLINE=PSIM_INLINE_LOCALS -DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN -DWITH_SMP=5 -DWITH_TRACE=1 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZERO -I. -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../include -I../../bfd -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../bfd -I../../gdb -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../gdb -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../../gdb/config -DHAVE_COMMON_FPU -I../common -I/home/joel/test-gcc/gdb-cvs/src/sim/ppc/../common /home/joel/test-gcc/gdb-cvs/src/sim/ppc/main.c /home/joel/test-gcc/gdb-cvs/src/sim/ppc/hw_opic.c: In function ‘hw_opic_io_read_buffer’: /home/joel/test-gcc/gdb-cvs/src/sim/ppc/hw_opic.c:1613:1: internal compiler error: in set_value_range, at tree-vrp.c:383
Created attachment 18135 [details] preprocessed test case (hw_opic.c preprocessed version of gdb/sim/ppc/hw_opic.c FAILS: gcc -O2 -c t.c PASSES: gcc -O1 -c t.c
Reducing.
Confirmed. enum { gcr0_8259_bit = 0x20000000, gcr0_reset_bit = 0x80000000 }; void decode_opic_address(int *); void hw_opic_io_read_buffer(int index) { unsigned reg = 0; decode_opic_address(&index); switch (index) { case 0: reg |= gcr0_8259_bit; } sim_io_printf_filtered2 (index, reg); }
switch-conversion triggers this, but it looks like a VRP issue after all. Mine.
(gdb) call debug_tree (limit) <integer_cst 0xb7d5ac40 type <integer_type 0xb7d2aee0> constant 0> (gdb) call vrp_val_is_max (limit) $6 = 1 '\001' (gdb) call vrp_val_is_min (limit) $7 = 1 '\001' err ... (gdb) call debug_tree (0xb7d2aee0) <integer_type 0xb7d2aee0 type <integer_type 0xb7ccd000 unsigned int public unsigned sizetype SI size <integer_cst 0xb7cbe4b4 constant 32> unit size <integer_cst 0xb7cbe2a0 constant 4> align 32 symtab 0 alias set -1 canonical type 0xb7ccd000 precision 32 min <integer_cst 0xb7cbe4d0 0> max <integer_cst 0xb7cbea64 -1>> public SI size <integer_cst 0xb7cbe4b4 32> unit size <integer_cst 0xb7cbe2a0 4> align 32 symtab 0 alias set -1 canonical type 0xb7d2aee0 precision 32 min <integer_cst 0xb7cbe2bc 0> max <integer_cst 0xb7cbe2bc 0>> hmm - single-valued integer subtypes. I have a patch.
Fixed.
Subject: Bug 40640 Author: rguenth Date: Fri Jul 3 22:09:12 2009 New Revision: 149211 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149211 Log: 2009-07-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/40640 * tree-switch-conversion.c (build_arrays): Perform arithmetic in original type. * gcc.c-torture/compile/pr40640.c: New testcase. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr40640.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-switch-conversion.c
Subject: Bug 40640 Author: hjl Date: Sat Jul 4 16:10:28 2009 New Revision: 149231 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149231 Log: 2009-07-04 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2009-07-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/40640 * gcc.c-torture/compile/pr40640.c: New testcase. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40640.c - copied unchanged from r149230, trunk/gcc/testsuite/gcc.c-torture/compile/pr40640.c Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog