public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Uros Bizjak <ubizjak@gmail.com>,
	gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com
Subject: Re: PATCH: PR rtl-optimization/54157: [x32] -maddress-mode=long failures
Date: Thu, 09 Aug 2012 14:51:00 -0000	[thread overview]
Message-ID: <CAMe9rOp49eDmkZk001rY+njH1OtbQO=u=bgsTeR33mXFBavopA@mail.gmail.com> (raw)
In-Reply-To: <g4393xifl1.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com>

On Wed, Aug 8, 2012 at 8:11 AM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>> On Wed, Aug 8, 2012 at 6:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>> Probably we need to backport this patch to 4.7, where x32 is
>>> -maddress-mode=long by default.
>>>
>>
>> It doesn't fail on 4.7 branch since checking mode on PLUS CONST
>> is new on trunk.  However, I think it is a correctness issue.  Is this
>> OK to backport to 4.7?
>
> Yeah, I agree we should backport it.
>
> Richard

I am checking this into 4.7 branch.  Tested on Linux/x32, Linux/ia32
and Linux/x86-64.

Thanks.

-- 
H.J.
---
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bc7c36c..44b0d32 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+	Backport from mainline
+	2012-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
+		    H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR rtl-optimization/54157
+	* combine.c (gen_lowpart_for_combine): Don't return identity
+	for CONST or symbolic reference.
+
 2012-08-06  Uros Bizjak  <ubizjak@gmail.com>

 	Backport from mainline
diff --git a/gcc/combine.c b/gcc/combine.c
index 3d81da8a..67bd776 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10802,13 +10802,6 @@ gen_lowpart_for_combine (enum machine_mode
omode, rtx x)
   if (omode == imode)
     return x;

-  /* Return identity if this is a CONST or symbolic reference.  */
-  if (omode == Pmode
-      && (GET_CODE (x) == CONST
-	  || GET_CODE (x) == SYMBOL_REF
-	  || GET_CODE (x) == LABEL_REF))
-    return x;
-
   /* We can only support MODE being wider than a word if X is a
      constant integer or has a mode the same size.  */
   if (GET_MODE_SIZE (omode) > UNITS_PER_WORD
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9fd8113..ef35a62 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+	Backport from mainline
+	2012-08-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR rtl-optimization/54157
+	* gcc.target/i386/pr54157.c: New file.
+
 2012-08-01  Uros Bizjak  <ubizjak@gmail.com>

 	Backport from mainline
diff --git a/gcc/testsuite/gcc.target/i386/pr54157.c
b/gcc/testsuite/gcc.target/i386/pr54157.c
new file mode 100644
index 0000000..59fcd79
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr54157.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -ftree-vectorize" } */
+
+struct s2{
+  int n[24 -1][24 -1][24 -1];
+};
+
+struct test2{
+  struct s2 e;
+};
+
+struct test2 tmp2[4];
+
+void main1 ()
+{
+  int i,j;
+
+  for (i = 0; i < 24 -4; i++)
+      for (j = 0; j < 24 -4; j++)
+          tmp2[2].e.n[1][i][j] = 8;
+}

      reply	other threads:[~2012-08-09 14:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 18:41 H.J. Lu
2012-08-01 18:59 ` Richard Sandiford
2012-08-01 19:14   ` H.J. Lu
2012-08-02 18:21     ` H.J. Lu
2012-08-05  7:47       ` Richard Sandiford
2012-08-07 19:28         ` H.J. Lu
2012-08-08  8:09           ` Richard Sandiford
2012-08-08 13:40             ` H.J. Lu
2012-08-08 13:43               ` Uros Bizjak
2012-08-08 13:50                 ` H.J. Lu
2012-08-08 15:11                   ` Richard Sandiford
2012-08-09 14:51                     ` H.J. Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOp49eDmkZk001rY+njH1OtbQO=u=bgsTeR33mXFBavopA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdsandiford@googlemail.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).