diff options
author | Richard Guenther <rguenther@suse.de> | 2008-04-04 11:29:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-04-04 11:29:11 +0000 |
commit | c071e8bcc22f8b9cd854584d3dfccab9b2c23de7 (patch) | |
tree | 4fbb2b3775885b4830323a936bb8dc52c1e14912 /gcc/fold-const.c | |
parent | c53a18d377f7f6ceeccd08ee4083e8c2e2932b92 (diff) | |
download | gcc-c071e8bcc22f8b9cd854584d3dfccab9b2c23de7.zip gcc-c071e8bcc22f8b9cd854584d3dfccab9b2c23de7.tar.gz gcc-c071e8bcc22f8b9cd854584d3dfccab9b2c23de7.tar.bz2 |
re PR middle-end/35823 (verify_gimple fails on taking 'Size of a String subprogram parameter)
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.
From-SVN: r133893
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 14470c5..ef95ae3 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5547,7 +5547,7 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) { tree arg0 = op0; enum tree_code op_code; - tree comp_const = op1; + tree comp_const; tree minmax_const; int consts_equal, consts_lt; tree inner; @@ -5556,6 +5556,7 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) op_code = TREE_CODE (arg0); minmax_const = TREE_OPERAND (arg0, 1); + comp_const = fold_convert (TREE_TYPE (arg0), op1); consts_equal = tree_int_cst_equal (minmax_const, comp_const); consts_lt = tree_int_cst_lt (minmax_const, comp_const); inner = TREE_OPERAND (arg0, 0); |