re PR tree-optimization/33453 (ICE in build2_stat, at tree.c:3110 with -ftree-parallelize-loops=4 -ftree-vectorize)
PR tree-optimization/33453 * tree-data-ref.c (split_constant_offset): Use POINTER_PLUS_EXPR for pointer addition. * tree-parloops.c (canonicalize_loop_ivs): Likewise. (separate_decls_in_loop_name): Copy DECL_GIMPLE_REG_P from var to var_copy. * gcc.c-torture/compile/20071203-1.c: New test. From-SVN: r130588
This commit is contained in:
parent
d56a25e130
commit
36ad7922cb
5 changed files with 41 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-12-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/33453
|
||||
* tree-data-ref.c (split_constant_offset): Use POINTER_PLUS_EXPR
|
||||
for pointer addition.
|
||||
* tree-parloops.c (canonicalize_loop_ivs): Likewise.
|
||||
(separate_decls_in_loop_name): Copy DECL_GIMPLE_REG_P from var to
|
||||
var_copy.
|
||||
|
||||
2007-12-03 Bernd Schmidt <bernd.schmidt@analog.com>
|
||||
|
||||
* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __FDPIC__ as
|
||||
|
@ -5,8 +14,7 @@
|
|||
|
||||
2007-12-03 Razya Ladelsky <razya@il.ibm.com>
|
||||
|
||||
* doc/invoke.texi (fipa-cp, fipa-matrix-reorg): Add documentation.
|
||||
|
||||
* doc/invoke.texi (fipa-cp, fipa-matrix-reorg): Add documentation.
|
||||
|
||||
2007-12-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2007-12-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/33453
|
||||
* gcc.c-torture/compile/20071203-1.c: New test.
|
||||
|
||||
2007-12-03 Robert Dewar <dewar@adacore.com>
|
||||
Samuel Tardieu <sam@rfc1149.net>
|
||||
|
||||
|
|
12
gcc/testsuite/gcc.c-torture/compile/20071203-1.c
Normal file
12
gcc/testsuite/gcc.c-torture/compile/20071203-1.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
|
||||
|
||||
struct User { char username[10]; };
|
||||
|
||||
void
|
||||
auth_set_username (struct User *user)
|
||||
{
|
||||
char *d;
|
||||
char ch;
|
||||
d = user->username + (user->username[0] == '~');
|
||||
while ((ch = *d++) != '\0') /* do nothing */ ;
|
||||
}
|
|
@ -555,9 +555,12 @@ split_constant_offset (tree exp, tree *var, tree *off)
|
|||
{
|
||||
split_constant_offset (poffset, &poffset, &off1);
|
||||
off0 = size_binop (PLUS_EXPR, off0, off1);
|
||||
base = fold_build2 (PLUS_EXPR, TREE_TYPE (base),
|
||||
base,
|
||||
fold_convert (TREE_TYPE (base), poffset));
|
||||
if (POINTER_TYPE_P (TREE_TYPE (base)))
|
||||
base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
|
||||
base, fold_convert (sizetype, poffset));
|
||||
else
|
||||
base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base,
|
||||
fold_convert (TREE_TYPE (base), poffset));
|
||||
}
|
||||
|
||||
var0 = fold_convert (type, base);
|
||||
|
|
|
@ -687,6 +687,7 @@ separate_decls_in_loop_name (tree name,
|
|||
if (!*dslot)
|
||||
{
|
||||
var_copy = create_tmp_var (TREE_TYPE (var), get_name (var));
|
||||
DECL_GIMPLE_REG_P (var_copy) = DECL_GIMPLE_REG_P (var);
|
||||
add_referenced_var (var_copy);
|
||||
nielt = XNEW (struct int_tree_map);
|
||||
nielt->uid = uid;
|
||||
|
@ -1266,7 +1267,7 @@ static void
|
|||
canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
|
||||
{
|
||||
unsigned precision = TYPE_PRECISION (TREE_TYPE (nit));
|
||||
tree phi, prev, res, type, var_before, val, atype, t, next;
|
||||
tree phi, prev, res, type, var_before, val, atype, mtype, t, next;
|
||||
block_stmt_iterator bsi;
|
||||
bool ok;
|
||||
affine_iv iv;
|
||||
|
@ -1313,11 +1314,12 @@ canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
|
|||
remove_phi_node (phi, prev, false);
|
||||
|
||||
atype = TREE_TYPE (res);
|
||||
val = fold_build2 (PLUS_EXPR, atype,
|
||||
unshare_expr (iv.base),
|
||||
fold_build2 (MULT_EXPR, atype,
|
||||
unshare_expr (iv.step),
|
||||
fold_convert (atype, var_before)));
|
||||
mtype = POINTER_TYPE_P (atype) ? sizetype : atype;
|
||||
val = fold_build2 (MULT_EXPR, mtype, unshare_expr (iv.step),
|
||||
fold_convert (mtype, var_before));
|
||||
val = fold_build2 (POINTER_TYPE_P (atype)
|
||||
? POINTER_PLUS_EXPR : PLUS_EXPR,
|
||||
atype, unshare_expr (iv.base), val);
|
||||
val = force_gimple_operand_bsi (&bsi, val, false, NULL_TREE, true,
|
||||
BSI_SAME_STMT);
|
||||
t = build_gimple_modify_stmt (res, val);
|
||||
|
|
Loading…
Add table
Reference in a new issue