diff options
| author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-02 12:04:22 +0000 |
|---|---|---|
| committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-02 12:04:22 +0000 |
| commit | 31bf99ef38ca957b98936c73a265ef99532091d2 (patch) | |
| tree | 28215a4a9220adc682a7d9f82588dce4b996c5dd | |
| parent | 3f9ee09bb6be862877da4abe16f8dc234cd932e1 (diff) | |
| download | ppe42-gcc-31bf99ef38ca957b98936c73a265ef99532091d2.tar.gz ppe42-gcc-31bf99ef38ca957b98936c73a265ef99532091d2.zip | |
PR rtl-optimization/20365
* simplify-rtx.c (simplify_plus_minus_op_data): Change type of neg
to short. New member ix.
(simplify_plus_minus_op_data_cmp): Break ties using ix member.
(simplify_plus_minus): Initialize ix members before calling qsort.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103771 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/simplify-rtx.c | 18 |
2 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44b66fbc14b..f240c5d0738 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2005-09-02 J"orn Rennecke <joern.rennecke@st.com> + + PR rtl-optimization/20365 + * simplify-rtx.c (simplify_plus_minus_op_data): Change type of neg + to short. New member ix. + (simplify_plus_minus_op_data_cmp): Break ties using ix member. + (simplify_plus_minus): Initialize ix members before calling qsort. + 2005-09-02 Zdenek Dvorak <dvorakz@suse.cz> PR tree-optimization/23626 diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 8a2faae30a6..13e90e99bfd 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -2574,7 +2574,8 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode, struct simplify_plus_minus_op_data { rtx op; - int neg; + short neg; + short ix; }; static int @@ -2582,9 +2583,13 @@ simplify_plus_minus_op_data_cmp (const void *p1, const void *p2) { const struct simplify_plus_minus_op_data *d1 = p1; const struct simplify_plus_minus_op_data *d2 = p2; + int result; - return (commutative_operand_precedence (d2->op) - - commutative_operand_precedence (d1->op)); + result = (commutative_operand_precedence (d2->op) + - commutative_operand_precedence (d1->op)); + if (result) + return result; + return d1->ix - d2->ix; } static rtx @@ -2759,7 +2764,12 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0, /* Pack all the operands to the lower-numbered entries. */ for (i = 0, j = 0; j < n_ops; j++) if (ops[j].op) - ops[i++] = ops[j]; + { + ops[i] = ops[j]; + /* Stabilize sort. */ + ops[i].ix = i; + i++; + } n_ops = i; /* Sort the operations based on swap_commutative_operands_p. */ |

