aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-05-08 18:19:09 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-05-08 18:19:09 +0000
commit2793eeab54e1969b2c5d5bebd89519048402e05b (patch)
tree91105210787a491bfe8736eb9fa6b7e58c1e68c4 /gcc/c
parentf827930ae282f8ae4bedf0a38dbc2fa99d2b3d08 (diff)
downloadgcc-2793eeab54e1969b2c5d5bebd89519048402e05b.zip
gcc-2793eeab54e1969b2c5d5bebd89519048402e05b.tar.gz
gcc-2793eeab54e1969b2c5d5bebd89519048402e05b.tar.bz2
re PR c/61053 (_Alignas(long long) reduces alignment of long long)
PR c/61053 c-family/ * c-common.c (min_align_of_type): New function factored out from... (c_sizeof_or_alignof_type): ...here. * c-common.h (min_align_of_type): Declare. c/ * c-decl.c (grokdeclarator): Use min_align_of_type instead of TYPE_ALIGN_UNIT. testsuite/ * gcc.dg/pr61053.c: New test. From-SVN: r210230
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 8925371..1c8c435 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,11 @@
2014-05-08 Marek Polacek <polacek@redhat.com>
+ PR c/61053
+ * c-decl.c (grokdeclarator): Use min_align_of_type instead of
+ TYPE_ALIGN_UNIT.
+
+2014-05-08 Marek Polacek <polacek@redhat.com>
+
PR c/61077
* c-decl.c (start_function): Warn for _Atomic-qualified return type
of main.
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index d8631fc..d52dcc9 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -5931,7 +5931,7 @@ grokdeclarator (const struct c_declarator *declarator,
else if (declspecs->align_log != -1)
{
alignas_align = 1U << declspecs->align_log;
- if (alignas_align < TYPE_ALIGN_UNIT (type))
+ if (alignas_align < min_align_of_type (type))
{
if (name)
error_at (loc, "%<_Alignas%> specifiers cannot reduce "