mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-06 14:50:24 +08:00
re PR middle-end/21840 (ICE while building Linux kernel (seg fault), missing cast)
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu> PR tree-opt/21840 * tree-ssa-pre.c (eliminate): Convert the sprime to the correct type if *rhs_p is not a SSA_NAME. 2005-07-12 Andrew Pinski <pinskia@physics.uc.edu> PR tree-opt/21840 * gcc.c-torture/compile/pr21840.c: New test. From-SVN: r101960
This commit is contained in:
parent
13c2c08bad
commit
fe83f5439a
@ -1,3 +1,9 @@
|
||||
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR tree-opt/21840
|
||||
* tree-ssa-pre.c (eliminate): Convert the sprime to the correct type
|
||||
if *rhs_p is not a SSA_NAME.
|
||||
|
||||
2005-07-12 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
Fix PR tree-optimization/22422
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR tree-opt/21840
|
||||
* gcc.c-torture/compile/pr21840.c: New test.
|
||||
|
||||
2005-07-12 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* gcc.c-torture/compile/pr22379.c: New test.
|
||||
|
11
gcc/testsuite/gcc.c-torture/compile/pr21840.c
Normal file
11
gcc/testsuite/gcc.c-torture/compile/pr21840.c
Normal file
@ -0,0 +1,11 @@
|
||||
void fn_show_state(void);
|
||||
typedef void (*fn_handler_fn)(void);
|
||||
static fn_handler_fn fn_handler[1];
|
||||
|
||||
void k_spec(unsigned char value)
|
||||
{
|
||||
void *func = fn_handler[value];
|
||||
if (func == fn_show_state )
|
||||
return;
|
||||
fn_handler[value]();
|
||||
}
|
@ -2334,8 +2334,17 @@ eliminate (void)
|
||||
fprintf (dump_file, " in ");
|
||||
print_generic_stmt (dump_file, stmt, 0);
|
||||
}
|
||||
|
||||
if (TREE_CODE (sprime) == SSA_NAME)
|
||||
NECESSARY (SSA_NAME_DEF_STMT (sprime)) = 1;
|
||||
/* We need to make sure the new and old types actually match,
|
||||
which may require adding a simple cast, which fold_convert
|
||||
will do for us. */
|
||||
if (TREE_CODE (*rhs_p) != SSA_NAME
|
||||
&& !tree_ssa_useless_type_conversion_1 (TREE_TYPE (*rhs_p),
|
||||
TREE_TYPE (sprime)))
|
||||
sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
|
||||
|
||||
pre_stats.eliminations++;
|
||||
propagate_tree_value (rhs_p, sprime);
|
||||
update_stmt (stmt);
|
||||
|
Loading…
Reference in New Issue
Block a user