Bug 35823 - verify_gimple fails on taking 'Size of a String subprogram parameter
Summary: verify_gimple fails on taking 'Size of a String subprogram parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-04 06:46 UTC by Oliver Kellogg
Modified: 2008-04-04 11:29 UTC (History)
1 user (show)

See Also:
Host:
Target: i?86-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-04-04 09:31:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kellogg 2008-04-04 06:46:45 UTC
$ 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;
Comment 1 Richard Biener 2008-04-04 09:31:23 UTC
Works with x86_64, fails with -m32.  Bug in optimize_minmax_comparison, I have
a patch.
Comment 2 Richard Biener 2008-04-04 11:29:41 UTC
Fixed.
Comment 3 Richard Biener 2008-04-04 11:29:59 UTC
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