Fix PR c/55570.

From-SVN: r194083
This commit is contained in:
Marek Polacek 2012-12-03 13:02:04 +00:00 committed by Marek Polacek
parent ea3c6c07bd
commit a859517f1e
4 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2012-12-03 Marek Polacek <polacek@redhat.com>
PR c/55570
* c-common.c (check_user_alignment): Swap order of tests,
check TREE_CODE first.
2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/52654

View File

@ -7261,8 +7261,8 @@ check_user_alignment (const_tree align, bool allow_zero)
{
int i;
if (!INTEGRAL_TYPE_P (TREE_TYPE (align))
|| TREE_CODE (align) != INTEGER_CST)
if (TREE_CODE (align) != INTEGER_CST
|| !INTEGRAL_TYPE_P (TREE_TYPE (align)))
{
error ("requested alignment is not an integer constant");
return -1;

View File

@ -1,3 +1,8 @@
2012-12-03 Marek Polacek <polacek@redhat.com>
PR c/55570
* gcc.dg/pr55570.c: New test.
2012-12-03 Jakub Jelinek <jakub@redhat.com>
* lib/asan-dg.exp (asan_get_gtest_test_list,

View File

@ -0,0 +1,4 @@
/* PR c/55570 */
/* { dg-do compile } */
char array[16] __attribute__((aligned (SOME_NOT_DEFINED_MACRO))); /* { dg-error "requested alignment is not an integer constant" } */