re PR tree-optimization/57980 (gcc 4.8.1 -foptimize-sibling-calls -O1 ICE in build_int_cst_wide, at tree.c:1210)

PR tree-optimization/57980

Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>

From-SVN: r201660
This commit is contained in:
Marek Polacek 2013-08-12 08:46:41 +00:00 committed by Marek Polacek
parent 1f97e193cc
commit 4e11510216
4 changed files with 33 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2013-08-12 Marek Polacek <polacek@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/57980
* tree-tailcall.c (process_assignment): Call build_minus_one_cst
when creating -1 constant.
2013-08-10 Jan Hubicka <jh@suse.cz>
Workaround binutils PR14342.

View File

@ -1,3 +1,8 @@
2013-08-12 Marek Polacek <polacek@redhat.com>
PR tree-optimization/57980
* gcc.dg/pr57980.c: New test.
2013-08-12 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56666

View File

@ -0,0 +1,19 @@
/* PR tree-optimization/57980 */
/* { dg-do compile } */
/* { dg-options "-O -foptimize-sibling-calls" } */
typedef int V __attribute__ ((vector_size (sizeof (int))));
extern V f (void);
V
bar (void)
{
return -f ();
}
V
foo (void)
{
V v = { };
return v - f ();
}

View File

@ -326,11 +326,7 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
return true;
case NEGATE_EXPR:
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
*m = build_real (TREE_TYPE (op0), dconstm1);
else
*m = build_int_cst (TREE_TYPE (op0), -1);
*m = build_minus_one_cst (TREE_TYPE (op0));
*ass_var = dest;
return true;
@ -339,11 +335,7 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
*a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var);
else
{
if (FLOAT_TYPE_P (TREE_TYPE (non_ass_var)))
*m = build_real (TREE_TYPE (non_ass_var), dconstm1);
else
*m = build_int_cst (TREE_TYPE (non_ass_var), -1);
*m = build_minus_one_cst (TREE_TYPE (non_ass_var));
*a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var);
}