summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/integrate.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
committerobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
commitc8f5fc7032940ad6633f932ac40cade82ec4d0cc (patch)
tree29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/integrate.c
parentc9ab9ae440a8066b2c2b85b157b1fdadcf09916a (diff)
downloadFreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.zip
FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.tar.gz
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/gcc/integrate.c')
-rw-r--r--contrib/gcc/integrate.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/contrib/gcc/integrate.c b/contrib/gcc/integrate.c
index 10d98f2..d90e776 100644
--- a/contrib/gcc/integrate.c
+++ b/contrib/gcc/integrate.c
@@ -595,7 +595,8 @@ process_reg_param (map, loc, copy)
}
/* Compare two BLOCKs for qsort. The key we sort on is the
- BLOCK_ABSTRACT_ORIGIN of the blocks. */
+ BLOCK_ABSTRACT_ORIGIN of the blocks. We cannot just subtract the
+ two pointers, because it may overflow sizeof(int). */
static int
compare_blocks (v1, v2)
@@ -604,9 +605,12 @@ compare_blocks (v1, v2)
{
tree b1 = *((const tree *) v1);
tree b2 = *((const tree *) v2);
+ char *p1 = (char *) BLOCK_ABSTRACT_ORIGIN (b1);
+ char *p2 = (char *) BLOCK_ABSTRACT_ORIGIN (b2);
- return ((char *) BLOCK_ABSTRACT_ORIGIN (b1)
- - (char *) BLOCK_ABSTRACT_ORIGIN (b2));
+ if (p1 == p2)
+ return 0;
+ return p1 < p2 ? -1 : 1;
}
/* Compare two BLOCKs for bsearch. The first pointer corresponds to
@@ -619,8 +623,12 @@ find_block (v1, v2)
{
const union tree_node *b1 = (const union tree_node *) v1;
tree b2 = *((const tree *) v2);
+ char *p1 = (char *) b1;
+ char *p2 = (char *) BLOCK_ABSTRACT_ORIGIN (b2);
- return ((const char *) b1 - (char *) BLOCK_ABSTRACT_ORIGIN (b2));
+ if (p1 == p2)
+ return 0;
+ return p1 < p2 ? -1 : 1;
}
/* Integrate the procedure defined by FNDECL. Note that this function
@@ -2120,6 +2128,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
case PC:
case CC0:
case CONST_INT:
+ case CONST_VECTOR:
return orig;
case SYMBOL_REF:
@@ -2479,6 +2488,7 @@ subst_constants (loc, insn, map, memonly)
case PC:
case CONST_INT:
case CONST_DOUBLE:
+ case CONST_VECTOR:
case SYMBOL_REF:
case CONST:
case LABEL_REF:
OpenPOWER on IntegriCloud