public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Limit alignment on error_mark_node variable
@ 2015-07-08 15:32 H.J. Lu
  2015-07-09  8:16 ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: H.J. Lu @ 2015-07-08 15:32 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-10 12:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08 15:32 [PATCH] Limit alignment on error_mark_node variable H.J. Lu
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

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).