From: Bernd Schmidt Date: Sat, 5 Mar 2016 05:36:42 +0000 (-0700) Subject: re PR c/69973 (ICE on excessive attribute vector_size) X-Git-Tag: basepoints/gcc-7~566 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6b552fd01d723df6a9b71e3b11bff5c8965ea0e;p=thirdparty%2Fgcc.git re PR c/69973 (ICE on excessive attribute vector_size) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5fd0d390b3a..7d2034bbca2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2016-03-04 Bernd Schmidt + 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. diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 74af91a6b1dd..a34227705d2b 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d412efdd0572..683585c8b321 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-03-04 Bernd Schmidt + 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 index 000000000000..648bc5679e9a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69973.c @@ -0,0 +1,2 @@ +/* { dg-do compile } */ +typedef int v4si __attribute__ ((vector_size (1 << 29)));