Commit 9925bce0 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/39845 (ICE: in make_decl_rtl, at varasm.c:1304)

2009-04-22  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39845
	* tree-switch-conversion.c (build_arrays): Add new referenced vars.
	(gen_inbound_check): Likewise.

	* gcc.c-torture/compile/pr39845.c: New testcase.

From-SVN: r146569
parent ce30eccb
2009-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39845
* tree-switch-conversion.c (build_arrays): Add new referenced vars.
(gen_inbound_check): Likewise.
2009-04-22 Nathan Sidwell <nathan@codesourcery.com>
* gthr-vxworks.h (struct __gthread_once_t): Add alignment and
......
2009-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39845
* gcc.c-torture/compile/pr39845.c: New testcase.
2009-04-22 Janus Weil <janus@gcc.gnu.org>
PR fortran/39735
......
typedef union tree_node *tree;
enum tree_code { EXCESS_PRECISION_EXPR };
enum built_in_function { BUILT_IN_ACOS, BUILT_IN_FPCLASSIFY, BUILT_IN_ISFINITE };
struct tree_base {
__extension__ enum tree_code code : 16;
unsigned side_effects_flag : 1;
};
struct tree_exp {
tree operands[1];
};
struct tree_function_decl {
__extension__ enum built_in_function function_code : 11;
unsigned static_ctor_flag : 1;
};
union tree_node {
struct tree_base base;
struct tree_function_decl function_decl;
struct tree_exp exp;
};
static tree
convert_arguments (tree fundecl)
{
tree val = (void *)0;
unsigned int parmnum;
unsigned char type_generic_remove_excess_precision = 0;
switch (((fundecl)->function_decl.function_code))
{
case BUILT_IN_ISFINITE:
case BUILT_IN_FPCLASSIFY:
type_generic_remove_excess_precision = 1;
}
for (parmnum = 0;; ++parmnum)
if (((enum tree_code) (val)->base.code) == EXCESS_PRECISION_EXPR
&& !type_generic_remove_excess_precision)
val = ((val)->exp.operands[0]);
return val;
}
tree
build_function_call_vec (tree function)
{
return convert_arguments (function);
}
......@@ -547,7 +547,7 @@ static void
build_arrays (gimple swtch)
{
tree arr_index_type;
tree tidx, sub;
tree tidx, sub, tmp;
gimple stmt;
gimple_stmt_iterator gsi;
int i;
......@@ -555,7 +555,9 @@ build_arrays (gimple swtch)
gsi = gsi_for_stmt (swtch);
arr_index_type = build_index_type (info.range_size);
tidx = make_ssa_name (create_tmp_var (arr_index_type, "csti"), NULL);
tmp = create_tmp_var (arr_index_type, "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));
......@@ -694,6 +696,7 @@ gen_inbound_check (gimple swtch)
/* (end of) block 0 */
gsi = gsi_for_stmt (info.arr_ref_first);
tmp_u_var = create_tmp_var (utype, "csui");
add_referenced_var (tmp_u_var);
tmp_u_1 = make_ssa_name (tmp_u_var, NULL);
cast = fold_convert (utype, info.index_expr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment