$ gcc -c -v verify_gimple_failure.adb Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../../SOURCES/gcc/configure --prefix=/opt/gccsnap --enable-debug --enable-languages=c,ada,c++ Thread model: posix gcc version 4.4.0 20080403 (experimental) (GCC) COLLECT_GCC_OPTIONS='-c' '-v' '-mtune=generic' /opt/gccsnap/libexec/gcc/i686-pc-linux-gnu/4.4.0/gnat1 -quiet -dumpbase verify_gimple_failure.adb -mtune=generic verify_gimple_failure.adb -o /tmp/ccFTWmc5.s verify_gimple_failure.adb: In function ‘Verify_Gimple_Failure’: verify_gimple_failure.adb:2: error: type mismatch in comparison expression <unnamed type> bit_size_type universal_integer if (D.213 == 0) { goto <D.200>; } else { } verify_gimple_failure.adb:2: error: type mismatch in comparison expression <unnamed type> bit_size_type universal_integer if (D.224 <= 0) { goto <D.201>; } else { goto <D.200>; } verify_gimple_failure.adb:2: error: type mismatch in comparison expression <unnamed type> bit_size_type universal_integer if (D.235 > 2147483647) { goto <D.201>; } else { goto <D.202>; } +===========================GNAT BUG DETECTED==============================+ | 4.4.0 20080403 (experimental) (i686-pc-linux-gnu) verify_gimple failed | | Error detected around verify_gimple_failure.adb:2 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. verify_gimple_failure.adb compilation abandoned -- file: verify_gimple_failure.adb procedure Verify_Gimple_Failure (Arg : in String) is Size : constant Natural := Arg'Size; begin null; end Verify_Gimple_Failure;
Works with x86_64, fails with -m32. Bug in optimize_minmax_comparison, I have a patch.
Fixed.
Subject: Bug 35823 Author: rguenth Date: Fri Apr 4 11:29:11 2008 New Revision: 133893 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133893 Log: 2008-04-04 Richard Guenther <rguenther@suse.de> PR middle-end/35823 * fold-const.c (optimize_minmax_comparison): Use the correct type for the constant in the simplified comparison. * gnat.dg/pr35823.adb: New testcase. Added: trunk/gcc/testsuite/gnat.dg/pr35823.adb Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog