re PR c/69973 (ICE on excessive attribute vector_size)
authorBernd Schmidt <bernds@redhat.com>
Sat, 5 Mar 2016 05:36:42 +0000 (22:36 -0700)
committerJeff Law <law@gcc.gnu.org>
Sat, 5 Mar 2016 05:36:42 +0000 (22:36 -0700)
PR c/69973
* targhooks.c (default_vector_alignment): Limit to MAX_OFILE_ALIGNMENT.

PR c/69973
* gcc.dg/pr69973.c: New test.

From-SVN: r234002

gcc/ChangeLog
gcc/targhooks.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr69973.c [new file with mode: 0644]

index d5fd0d3..7d2034b 100644 (file)
@@ -1,5 +1,8 @@
 2016-03-04  Bernd Schmidt  <bschmidt@redhat.com>
 
+       PR c/69973
+       * targhooks.c (default_vector_alignment): Limit to MAX_OFILE_ALIGNMENT.
+
        PR rtl-optimization/69941
        * postreload.c (reload_combine_recognize_pattern): Ensure all uses of
        the reg share its mode.
index 74af91a..a342277 100644 (file)
@@ -1031,7 +1031,10 @@ tree default_mangle_decl_assembler_name (tree decl ATTRIBUTE_UNUSED,
 HOST_WIDE_INT
 default_vector_alignment (const_tree type)
 {
-  return tree_to_shwi (TYPE_SIZE (type));
+  HOST_WIDE_INT align = tree_to_shwi (TYPE_SIZE (type));
+  if (align > MAX_OFILE_ALIGNMENT)
+    align = MAX_OFILE_ALIGNMENT;
+  return align;
 }
 
 bool
index d412efd..683585c 100644 (file)
@@ -1,5 +1,8 @@
 2016-03-04  Bernd Schmidt  <bschmidt@redhat.com>
 
+       PR c/69973
+       * gcc.dg/pr69973.c: New test.
+
        PR rtl-optimization/69941
        * gcc.dg/torture/pr69941.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr69973.c b/gcc/testsuite/gcc.dg/pr69973.c
new file mode 100644 (file)
index 0000000..648bc56
--- /dev/null
@@ -0,0 +1,2 @@
+/* { dg-do compile } */
+typedef int v4si __attribute__ ((vector_size (1 << 29)));