aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@redhat.com>2004-09-29 19:47:32 +0000
committerEric Christopher <echristo@redhat.com>2004-09-29 19:47:32 +0000
commitc1d1250fddc7ae2fb14581f3bc008cffbee2c1c0 (patch)
treed32f998219a04ba25caf6dd4d1906be5618d1477
parentade79c2283417a65845ffb568eb993d7842e9607 (diff)
2004-09-29 Eric Christopher <echristo@redhat.com>
* fold-const.c (tree_swap_operands_p): Remove duplicated code. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@88299 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog22
-rw-r--r--gcc/fold-const.c61
2 files changed, 39 insertions, 44 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7b1103cc6e3..ef37139c795 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-29 Eric Christopher <echristo@redhat.com>
+
+ * fold-const.c (tree_swap_operands_p): Remove duplicated code.
+
2004-09-29 Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.md (moverside, movemside): With MEM, make sure
@@ -155,7 +159,7 @@
* config/s390/s390.c (s390_adjust_cost): Remove.
(TARGET_SCHED_ADJUST_COST): Do not redefine.
(s390_adjust_priority): Handle TYPE_STM like TYPE_STORE.
- * config/s390/s390.md ("main_pool"): Use "larl" type
+ * config/s390/s390.md ("main_pool"): Use "larl" type
attribute if TARGET_CPU_ZARCH.
2004-09-28 Jakub Jelinek <jakub@redhat.com>
@@ -204,7 +208,7 @@
2004-09-28 Devang Patel <dpatel@apple.com>
* tree-pretty-print.c (dump_generic_node): Print vector types.
-
+
2004-09-28 Nick Clifton <nickc@redhat.com>
* config/sh/sh.h (INIT_CUMULATIVE_ARGS): Replace with an
@@ -561,7 +565,7 @@
* tree-ssa-propagate.c (simulate_stmt): Likewise.
(simulate_block): Likewise.
(ssa_prop_init): Likewise.
- * tree-ssa-threadupdate.c (thread_block): Likewise.
+ * tree-ssa-threadupdate.c (thread_block): Likewise.
(create_block_for_threading): Likewise.
(remove_last_stmt_and_useless_edges): Likewise.
* tree-ssa.c (verify_phi_args): Likewise.
@@ -683,7 +687,7 @@
2004-09-27 Devang Patel <dpatel@apple.com>
* tree-pretty-print.c (dump_generic_node): Print VEC_COND_EXPR.
-
+
2004-09-27 Jan Hubicka <jh@suse.cz>
* i386.c (athlon_cost, k8_cost): Set BRANCH_COST to 5.
@@ -700,7 +704,7 @@
* ggc-page.c (GGC_QUIRE_SIZE): Bump up from 16 to 256 if we're
using mmap.
-
+
2004-09-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP,
@@ -898,7 +902,7 @@
only if compiling with back chain.
("save_stack_nonlocal", "restore_stack_nonlocal"): Save/restore
back chain only if back chain enabled. Use s390_back_chain_rtx.
-
+
2004-09-25 Joseph S. Myers <jsm@polyomino.org.uk>
* doc/trouble.texi: Remove obsolete information. Update
@@ -980,7 +984,7 @@
* tree-if-conv.c (tree_if_convert_cond_expr0: Create temp. variable
only when necesssary.
(combine_blocks): Combine loop header and exit block.
-
+
2004-09-24 Paolo Bonzini <bonzini@gnu.org>
* hooks.c (hook_tree_tree_bool_null): New.
@@ -1087,7 +1091,7 @@
PR c++/13989
PR c++/9844
* tree.c (reconstruct_complex_type): Remove extra "this".
- * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute):
+ * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute):
Add V4SFmode to case statement.
2004-09-23 Joseph S. Myers <jsm@polyomino.org.uk>
@@ -1105,7 +1109,7 @@
dominance data during error message printing.
* tree-mudflap.c (mf_build_check_statement_for): Build basic blocks
and edges more correctly.
-
+
2004-09-23 Dorit Naishlos <dorit@il.ibm.com>
* tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF):
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e39d75ceafc..595d8c1d83e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -209,7 +209,7 @@ force_fit_type (tree t, int overflowable,
int sign_extended_type;
gcc_assert (TREE_CODE (t) == INTEGER_CST);
-
+
low = TREE_INT_CST_LOW (t);
high = TREE_INT_CST_HIGH (t);
@@ -267,7 +267,7 @@ force_fit_type (tree t, int overflowable,
|| low != TREE_INT_CST_LOW (t) || high != TREE_INT_CST_HIGH (t))
{
t = build_int_cst_wide (TREE_TYPE (t), low, high);
-
+
if (overflowed
|| overflowable < 0
|| (overflowable > 0 && sign_extended_type))
@@ -282,7 +282,7 @@ force_fit_type (tree t, int overflowable,
TREE_CONSTANT_OVERFLOW (t) = 1;
}
}
-
+
return t;
}
@@ -1451,7 +1451,7 @@ int_const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
| TREE_OVERFLOW (arg1) | TREE_OVERFLOW (arg2),
TREE_CONSTANT_OVERFLOW (arg1)
| TREE_CONSTANT_OVERFLOW (arg2));
-
+
return t;
}
@@ -1890,7 +1890,7 @@ fold_convert (tree type, tree arg)
gcc_assert (TREE_CODE (orig) == VECTOR_TYPE
&& tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
return fold (build1 (NOP_EXPR, type, arg));
-
+
case REAL_TYPE:
if (TREE_CODE (arg) == INTEGER_CST)
{
@@ -1911,19 +1911,19 @@ fold_convert (tree type, tree arg)
case BOOLEAN_TYPE: case ENUMERAL_TYPE:
case POINTER_TYPE: case REFERENCE_TYPE:
return fold (build1 (FLOAT_EXPR, type, arg));
-
+
case REAL_TYPE:
return fold (build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR,
type, arg));
-
+
case COMPLEX_TYPE:
tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg));
return fold_convert (type, tem);
-
+
default:
gcc_unreachable ();
}
-
+
case COMPLEX_TYPE:
switch (TREE_CODE (orig))
{
@@ -1937,14 +1937,14 @@ fold_convert (tree type, tree arg)
case COMPLEX_TYPE:
{
tree rpart, ipart;
-
+
if (TREE_CODE (arg) == COMPLEX_EXPR)
{
rpart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 0));
ipart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 1));
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
-
+
arg = save_expr (arg);
rpart = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg));
ipart = fold (build1 (IMAGPART_EXPR, TREE_TYPE (orig), arg));
@@ -1952,11 +1952,11 @@ fold_convert (tree type, tree arg)
ipart = fold_convert (TREE_TYPE (type), ipart);
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
-
+
default:
gcc_unreachable ();
}
-
+
case VECTOR_TYPE:
if (integer_zerop (arg))
return build_zero_vector (type);
@@ -3310,7 +3310,7 @@ decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize,
mask = build_int_cst (unsigned_type, -1);
mask = force_fit_type (mask, 0, false, false);
-
+
mask = const_binop (LSHIFT_EXPR, mask, size_int (precision - *pbitsize), 0);
mask = const_binop (RSHIFT_EXPR, mask, size_int (precision - *pbitsize), 0);
@@ -3336,7 +3336,7 @@ all_ones_mask_p (tree mask, int size)
tmask = build_int_cst (lang_hooks.types.signed_type (type), -1);
tmask = force_fit_type (tmask, 0, false, false);
-
+
return
tree_int_cst_equal (mask,
const_binop (RSHIFT_EXPR,
@@ -5902,7 +5902,7 @@ static bool
reorder_operands_p (tree arg0, tree arg1)
{
if (! flag_evaluation_order)
- return true;
+ return true;
if (TREE_CONSTANT (arg0) || TREE_CONSTANT (arg1))
return true;
return ! TREE_SIDE_EFFECTS (arg0)
@@ -5952,15 +5952,6 @@ tree_swap_operands_p (tree arg0, tree arg1, bool reorder)
if (DECL_P (arg0))
return 1;
- if (reorder && flag_evaluation_order
- && (TREE_SIDE_EFFECTS (arg0) || TREE_SIDE_EFFECTS (arg1)))
- return 0;
-
- if (DECL_P (arg1))
- return 0;
- if (DECL_P (arg0))
- return 1;
-
/* It is preferable to swap two SSA_NAME to ensure a canonical form
for commutative and comparison operators. Ensuring a canonical
form allows the optimizers to find additional redundancies without
@@ -10288,7 +10279,7 @@ fold_negate_const (tree arg0, tree type)
TREE_CONSTANT_OVERFLOW (arg0));
break;
}
-
+
case REAL_CST:
t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
break;
@@ -10296,7 +10287,7 @@ fold_negate_const (tree arg0, tree type)
default:
gcc_unreachable ();
}
-
+
return t;
}
@@ -10334,18 +10325,18 @@ fold_abs_const (tree arg0, tree type)
TREE_CONSTANT_OVERFLOW (arg0));
}
break;
-
+
case REAL_CST:
if (REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg0)))
t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
else
t = arg0;
break;
-
+
default:
gcc_unreachable ();
}
-
+
return t;
}
@@ -10358,13 +10349,13 @@ fold_not_const (tree arg0, tree type)
tree t = NULL_TREE;
gcc_assert (TREE_CODE (arg0) == INTEGER_CST);
-
+
t = build_int_cst_wide (type,
~ TREE_INT_CST_LOW (arg0),
~ TREE_INT_CST_HIGH (arg0));
t = force_fit_type (t, 0, TREE_OVERFLOW (arg0),
TREE_CONSTANT_OVERFLOW (arg0));
-
+
return t;
}
@@ -10630,7 +10621,7 @@ round_up (tree value, int divisor)
if (divisor == (divisor & -divisor))
{
tree t;
-
+
t = build_int_cst (TREE_TYPE (value), divisor - 1);
value = size_binop (PLUS_EXPR, value, t);
t = build_int_cst (TREE_TYPE (value), -divisor);
@@ -10674,7 +10665,7 @@ round_down (tree value, int divisor)
if (divisor == (divisor & -divisor))
{
tree t;
-
+
t = build_int_cst (TREE_TYPE (value), -divisor);
value = size_binop (BIT_AND_EXPR, value, t);
}
@@ -10701,7 +10692,7 @@ ptr_difference_const (tree e1, tree e2, HOST_WIDE_INT *diff)
tree toffset1, toffset2, tdiff, type;
enum machine_mode mode1, mode2;
int unsignedp1, unsignedp2, volatilep1, volatilep2;
-
+
core1 = get_inner_reference (e1, &bitsize1, &bitpos1, &toffset1, &mode1,
&unsignedp1, &volatilep1);
core2 = get_inner_reference (e2, &bitsize2, &bitpos2, &toffset2, &mode2,