aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-07-03 22:09:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-07-03 22:09:12 +0000
commitfae1034ef48b598981195dc0192e882b9ce98894 (patch)
treee3367b873291ba1ab60b45a98762a593c7bf410a /gcc
parentba8978d0f01676d2cc72bb1bac2d3bc54d8cf2e0 (diff)
downloadgcc-fae1034ef48b598981195dc0192e882b9ce98894.zip
gcc-fae1034ef48b598981195dc0192e882b9ce98894.tar.gz
gcc-fae1034ef48b598981195dc0192e882b9ce98894.tar.bz2
re PR tree-optimization/40640 (ICE in set_value_range, at tree-vrp.c:383)
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. From-SVN: r149211
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr40640.c15
-rw-r--r--gcc/tree-switch-conversion.c4
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 31307ae..2834ac6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-03 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/40640
+ * tree-switch-conversion.c (build_arrays): Perform arithmetic
+ in original type.
+
2009-07-03 Jan Hubicka <jh@suse.cz>
* ipa-inline.c (cgraph_decide_inlining_incrementally): When optimizing
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b739808..d7d4d7e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2009-07-03 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/40640
+ * gcc.c-torture/compile/pr40640.c: New testcase.
+
+2009-07-03 Richard Guenther <rguenther@suse.de>
+
PR middle-end/34163
* gfortran.dg/pr34163.f90: New testcase.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40640.c b/gcc/testsuite/gcc.c-torture/compile/pr40640.c
new file mode 100644
index 0000000..7dae7ca
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr40640.c
@@ -0,0 +1,15 @@
+void decode_opic_address(int *);
+void sim_io_printf_filtered2 (int, unsigned);
+void
+hw_opic_io_read_buffer(int index)
+{
+ unsigned reg = 0;
+ decode_opic_address(&index);
+ switch (index)
+ {
+ case 0:
+ reg = 1;
+ }
+ sim_io_printf_filtered2 (index, reg);
+}
+
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 292c49c..2e6808b 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -556,13 +556,13 @@ build_arrays (gimple swtch)
gsi = gsi_for_stmt (swtch);
arr_index_type = build_index_type (info.range_size);
- tmp = create_tmp_var (arr_index_type, "csti");
+ tmp = create_tmp_var (TREE_TYPE (info.index_expr), "csti");
add_referenced_var (tmp);
tidx = make_ssa_name (tmp, NULL);
sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
fold_convert (TREE_TYPE (info.index_expr),
info.range_min));
- sub = force_gimple_operand_gsi (&gsi, fold_convert (arr_index_type, sub),
+ sub = force_gimple_operand_gsi (&gsi, sub,
false, NULL, true, GSI_SAME_STMT);
stmt = gimple_build_assign (tidx, sub);
SSA_NAME_DEF_STMT (tidx) = stmt;