diff options
author | pfg <pfg@FreeBSD.org> | 2012-06-12 15:04:18 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-06-12 15:04:18 +0000 |
commit | a6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8 (patch) | |
tree | b2fbef554d2610927edad3f5917fcc94f901f6c1 /contrib/gcc/fold-const.c | |
parent | 33675cab555bc824f32778ba0fed56733a19ef6e (diff) | |
download | FreeBSD-src-a6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8.zip FreeBSD-src-a6eb26cf6f3dbbb726fd6e5e9f02f222df40cdf8.tar.gz |
Add experimental support for amdfam10/barcelona from the GCC 4.3 branch.
Initial support for the AMD barcelona chipsets has been available in the
gcc43 branch under GPLv2 but was not included when the Core 2 support
was brought to the system gcc.
AMD and some linux distributions (OpenSUSE) did a backport of the amdfam10
support and made them available. Unfortunately this is still experimental
and while it can improve performance, enabling the CPUTYPE may break some
C++ ports (like clang).
Special care was taken to make sure that the patches predate the GPLv3
switch upstream.
Tested by: Vladimir Kushnir
Reviewed by: mm
Approved by: jhb (mentor)
MFC after: 2 weeks
Diffstat (limited to 'contrib/gcc/fold-const.c')
-rw-r--r-- | contrib/gcc/fold-const.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c index 37d99f8..1aadd30 100644 --- a/contrib/gcc/fold-const.c +++ b/contrib/gcc/fold-const.c @@ -2802,9 +2802,13 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags) case ARRAY_REF: case ARRAY_RANGE_REF: - /* Operands 2 and 3 may be null. */ + /* Operands 2 and 3 may be null. + Compare the array index by value if it is constant first as we + may have different types but same value here. */ return (OP_SAME (0) - && OP_SAME (1) + && (tree_int_cst_equal (TREE_OPERAND (arg0, 1), + TREE_OPERAND (arg1, 1)) + || OP_SAME (1)) && OP_SAME_WITH_NULL (2) && OP_SAME_WITH_NULL (3)); |