aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch')
-rw-r--r--recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch94
1 files changed, 94 insertions, 0 deletions
diff --git a/recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch b/recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch
new file mode 100644
index 0000000000..bcf30ffb56
--- /dev/null
+++ b/recipes/gcc/gcc-4.3.3/debian/pr33148.dpatch
@@ -0,0 +1,94 @@
+#! /bin/sh -e
+
+# DP: Fix (neg (lt X 0)) optimization (PR rtl-optimization/33148)
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+From: Jakub Jelinek <jakub@redhat.com>
+Sender: gcc-patches-owner@gcc.gnu.org
+To: gcc-patches@gcc.gnu.org
+Subject: [PATCH] Fix (neg (lt X 0)) optimization (PR rtl-optimization/33148)
+Date: Mon, 27 Aug 2007 07:22:44 -0400
+
+Hi!
+
+PR25600 change introduced an optimization of (neg (lt x 0)) to
+(ashirtrt x C), but it is not checking whether x's mode is suitable
+for it. As it checks that op1 is const0_rtx, I believe MODE_FLOAT
+or VECTOR_MODE_P modes are not a problem, CC modes can certainly appear
+in LT's first operand with second operand const0_rtx.
+So, when we optimize
+(neg:DI (lt:DI (reg:CC ...) (const_int 0)))
+we create something like
+(sign_extend:DI (ashirtrt:CC (reg:CC ...) (const_int 31)))
+which is IMHO invalid RTL, ashirtrt is documented on fixed point modes
+only (guess vector modes aren't listed just by omission) and so is
+sign_extend.
+
+Ok for 4.2/trunk?
+
+2007-08-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/33148
+ * simplify-rtx.c (simplify_unary_operation_1): Only optimize
+ (neg (lt X 0)) if X has scalar int mode.
+
+ * gcc.c-torture/compile/20070827-1.c: New test.
+
+--- gcc/simplify-rtx.c.jj 2007-08-27 10:15:33.000000000 +0200
++++ gcc/simplify-rtx.c 2007-08-27 12:12:51.000000000 +0200
+@@ -583,7 +583,8 @@ simplify_unary_operation_1 (enum rtx_cod
+ /* (neg (lt x 0)) is (ashiftrt X C) if STORE_FLAG_VALUE is 1. */
+ /* (neg (lt x 0)) is (lshiftrt X C) if STORE_FLAG_VALUE is -1. */
+ if (GET_CODE (op) == LT
+- && XEXP (op, 1) == const0_rtx)
++ && XEXP (op, 1) == const0_rtx
++ && SCALAR_INT_MODE_P (GET_MODE (XEXP (op, 0))))
+ {
+ enum machine_mode inner = GET_MODE (XEXP (op, 0));
+ int isize = GET_MODE_BITSIZE (inner);
+--- gcc/testsuite/gcc.c-torture/compile/20070827-1.c.jj 2007-08-27 12:17:20.000000000 +0200
++++ gcc/testsuite/gcc.c-torture/compile/20070827-1.c 2007-08-27 12:15:45.000000000 +0200
+@@ -0,0 +1,20 @@
++/* PR rtl-optimization/33148 */
++
++int
++foo (unsigned int *p, int *q, unsigned int w, unsigned int b)
++{
++ unsigned int i;
++ int mask;
++
++ if (q[0] < q[1])
++ mask = 0xff;
++ else
++ mask = 0;
++
++ for (i = 0; 8 * i < w; i++)
++ {
++ b ^= mask;
++ *p++ = b;
++ }
++ return 0;
++}
+
+ Jakub