diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-07 10:38:25 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-07 10:38:25 +0000 |
commit | 54c0af3a2327f757dd3a84075a0bde3d4d0a192f (patch) | |
tree | eae6b6af50dba96cc149e50451dd37e4de0e45fc /gcc/tree-sra.c | |
parent | 9c2eafdb502b2e6de358e9a36514e76518cb9aa3 (diff) | |
download | gcc-54c0af3a2327f757dd3a84075a0bde3d4d0a192f.tar.gz |
2010-01-07 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/42157
* tree-sra.c (compare_access_positions): Stabilize sort if both
accesses have integer types, return zero immediately if they are the
same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index f0e874f2053..ebb40c4aa1a 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1110,8 +1110,10 @@ compare_access_positions (const void *a, const void *b) if (f1->size == f2->size) { + if (f1->type == f2->type) + return 0; /* Put any non-aggregate type before any aggregate type. */ - if (!is_gimple_reg_type (f1->type) + else if (!is_gimple_reg_type (f1->type) && is_gimple_reg_type (f2->type)) return 1; else if (is_gimple_reg_type (f1->type) @@ -1131,7 +1133,7 @@ compare_access_positions (const void *a, const void *b) /* Put the integral type with the bigger precision first. */ else if (INTEGRAL_TYPE_P (f1->type) && INTEGRAL_TYPE_P (f2->type)) - return TYPE_PRECISION (f1->type) > TYPE_PRECISION (f2->type) ? -1 : 1; + return TYPE_PRECISION (f2->type) - TYPE_PRECISION (f1->type); /* Put any integral type with non-full precision last. */ else if (INTEGRAL_TYPE_P (f1->type) && (TREE_INT_CST_LOW (TYPE_SIZE (f1->type)) |