public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hongjiu.lu@intel.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Limit alignment on error_mark_node variable
Date: Wed, 08 Jul 2015 15:32:00 -0000	[thread overview]
Message-ID: <20150708153211.GA14935@intel.com> (raw)

There is no need to try different alignment on variable of
error_mark_node.

OK for trunk if there is no regression?

Thanks.

H.J.
--
gcc/

	PR target/66810
	* varasm.c (align_variable): Don't try different alignment on
	variable of error_mark_node.

gcc/testsuite/

	PR target/66810
	* gcc.target/i386/pr66810.c: New test.
---
 gcc/testsuite/gcc.target/i386/pr66810.c | 10 ++++++++++
 gcc/varasm.c                            |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr66810.c

diff --git a/gcc/testsuite/gcc.target/i386/pr66810.c b/gcc/testsuite/gcc.target/i386/pr66810.c
new file mode 100644
index 0000000..4778b37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr66810.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-mno-sse -mno-mmx -miamcu" } */
+
+int vv;
+
+void
+i (void)
+{
+  static int a[vv]; /* { dg-error "storage size" } */
+}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index b69b3a3..be33cb4 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1016,7 +1016,8 @@ align_variable (tree decl, bool dont_output_data)
       align = MAX_OFILE_ALIGNMENT;
     }
 
-  if (! DECL_USER_ALIGN (decl))
+  /* Don't try different alignment for error_mark_node.  */
+  if (! DECL_USER_ALIGN (decl) && TREE_TYPE (decl) != error_mark_node)
     {
 #ifdef DATA_ABI_ALIGNMENT
       unsigned int data_abi_align
-- 
2.4.3

             reply	other threads:[~2015-07-08 15:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 15:32 H.J. Lu [this message]
2015-07-09  8:16 ` Richard Biener
2015-07-09  9:52   ` H.J. Lu
2015-07-09  9:54     ` Richard Biener
2015-07-09 11:08       ` H.J. Lu
2015-07-09 13:57         ` Richard Biener
2015-07-09 14:06           ` H.J. Lu
2015-07-09 14:10             ` Richard Biener
2015-07-10 12:19           ` H.J. Lu
2015-07-10 12:38             ` Richard Biener

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=20150708153211.GA14935@intel.com \
    --to=hongjiu.lu@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@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).