PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/packages/toolchain/lang/gcc/patches/gcc-4.6.2-PR48805_Do_not_instantiate_ADDR_EXPRs.patch

http://github.com/OpenELEC/OpenELEC.tv
Patch | 89 lines | 80 code | 9 blank | 0 comment | 0 complexity | 1cae8ecc833250f3e8e69ca396b5d31f MD5 | raw file
 1From gcc-patches-return-297783-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org Sat Jul 23 14:36:33 2011
 2Return-Path: <gcc-patches-return-297783-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org>
 3Delivered-To: listarch-gcc-patches at gcc dot gnu dot org
 4Received: (qmail 13569 invoked by alias); 23 Jul 2011 14:36:33 -0000
 5Received: (qmail 13561 invoked by uid 22791); 23 Jul 2011 14:36:32 -0000
 6X-SWARE-Spam-Status: No, hits=-2.6 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
 7X-Spam-Check-By: sourceware.org
 8Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175)    by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Jul 2011 14:36:10 +0000
 9Received: by gyd12 with SMTP id 12so1979920gyd.20        for <gcc-patches@gcc.gnu.org>; Sat, 23 Jul 2011 07:36:10 -0700 (PDT)
10Received: by 10.236.76.197 with SMTP id b45mr3893810yhe.147.1311431770250;        Sat, 23 Jul 2011 07:36:10 -0700 (PDT)
11Received: from napoca (adsl-99-184-92-236.dsl.austtx.sbcglobal.net [99.184.92.236])        by mx.google.com with ESMTPS id j9sm565418yhn.81.2011.07.23.07.36.08        (version=TLSv1/SSLv3 cipher=OTHER);        Sat, 23 Jul 2011 07:36:09 -0700 (PDT)
12Received: by napoca (sSMTP sendmail emulation); Sat, 23 Jul 2011 09:36:01 -0500
13From: Sebastian Pop <sebpop at gmail dot com>
14To: gcc-patches at gcc dot gnu dot org
15Cc: rguenther at suse dot de,	Sebastian Pop <sebpop at gmail dot com>
16Subject: [PATCH] Fix PR48805: Do not instantiate ADDR_EXPRs
17Date: Sat, 23 Jul 2011 09:35:56 -0500
18Message-Id: <1311431756-16262-1-git-send-email-sebpop@gmail.com>
19X-IsSubscribed: yes
20Mailing-List: contact gcc-patches-help at gcc dot gnu dot org; run by ezmlm
21Precedence: bulk
22List-Id: <gcc-patches.gcc.gnu.org>
23List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
24List-Post: <mailto:gcc-patches at gcc dot gnu dot org>
25List-Help: <mailto:gcc-patches-help at gcc dot gnu dot org>
26Sender: gcc-patches-owner at gcc dot gnu dot org
27Delivered-To: mailing list gcc-patches at gcc dot gnu dot org
28
29With this patch we avoid instantiating ADDR_EXPR: it makes no sense
30to translate b[i] into b[{0, +, 1}_1].
31
32Bootstrapped and tested on amd64-linux.
33
342011-07-22  Sebastian Pop  <sebastian.pop@amd.com>
35
36	PR middle-end/48805
37	* tree-scalar-evolution.c (instantiate_scev_r): Return
38	chrec_dont_know for ADDR_EXPR.
39
40	* gcc.dg/graphite/id-pr48805.c: New.
41---
42 gcc/ChangeLog                              |    6 ++++++
43 gcc/testsuite/ChangeLog                    |    5 +++++
44 gcc/testsuite/gcc.dg/graphite/id-pr48805.c |   20 ++++++++++++++++++++
45 gcc/tree-scalar-evolution.c                |    1 +
46 4 files changed, 32 insertions(+), 0 deletions(-)
47 create mode 100644 gcc/testsuite/gcc.dg/graphite/id-pr48805.c
48
49diff --git a/gcc/testsuite/gcc.dg/graphite/id-pr48805.c b/gcc/testsuite/gcc.dg/graphite/id-pr48805.c
50new file mode 100644
51index 0000000..f13a828
52--- /dev/null
53+++ b/gcc/testsuite/gcc.dg/graphite/id-pr48805.c
54@@ -0,0 +1,20 @@
55+void *A(const void *a);
56+void C(void);
57+
58+static void B(unsigned short a[])
59+{
60+  long i, j, tmp;
61+
62+  for(i = 0; i < 3; i++) {
63+    for(j = 1; j <= 3; j++)
64+      tmp -= a[i - j];
65+
66+    a[i] = (unsigned short)(tmp >> 1);
67+  }
68+}
69+void C(void)
70+{
71+  unsigned short a[3], b[3];
72+  B(b + 1);
73+  A(a);
74+}
75diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
76index bfa8c93..00fcd3f 100644
77--- a/gcc/tree-scalar-evolution.c
78+++ b/gcc/tree-scalar-evolution.c
79@@ -2645,6 +2645,7 @@ instantiate_scev_r (basic_block instantiate_below,
80 				   TREE_OPERAND (chrec, 0),
81 				   fold_conversions, cache, size_expr);
82 
83+    case ADDR_EXPR:
84     case SCEV_NOT_KNOWN:
85       return chrec_dont_know;
86 
87-- 
881.7.4.1
89