public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61053] New: _Alignas(long long) reduces alignment of long long
@ 2014-05-04 11:51 pdziepak at quarnos dot org
  2014-05-05  9:14 ` [Bug c/61053] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pdziepak at quarnos dot org @ 2014-05-04 11:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

            Bug ID: 61053
           Summary: _Alignas(long long) reduces alignment of long long
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pdziepak at quarnos dot org

On 32 bit x86 definition like the following one:

_Alignas(long long) long long ll;

causes GCC 4.9 to produce error:

‘_Alignas’ specifiers cannot reduce alignment of ‘ll’

Only types long long and double seem to be affected. The problem is not present
on GCC 4.8.2.
>From gcc-bugs-return-450500-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun May 04 12:07:15 2014
Return-Path: <gcc-bugs-return-450500-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23498 invoked by alias); 4 May 2014 12:07:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23471 invoked by uid 48); 4 May 2014 12:07:12 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
Date: Sun, 04 May 2014 12:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on cf_known_to_work short_desc everconfirmed
Message-ID: <bug-61053-4-az1dtulbF3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61053-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61053-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-05/txt/msg00192.txt.bz2
Content-length: 865

http://gcc.gnu.org/bugzilla/show_bug.cgi?ida053

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-04
      Known to work|                            |4.8.2
            Summary|_Alignas(long long) reduces |[4.9/4.10 Regression]
                   |alignment of long long      |_Alignas(long long) reduces
                   |                            |alignment of long long
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
FWIW, it also compiles OK as C++11 with s/_Alignas/alignas/


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
@ 2014-05-05  9:14 ` rguenth at gcc dot gnu.org
  2014-05-05 16:38 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-05  9:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i?86-*-*
           Priority|P3                          |P2
   Target Milestone|---                         |4.9.1


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
  2014-05-05  9:14 ` [Bug c/61053] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
@ 2014-05-05 16:38 ` mpolacek at gcc dot gnu.org
  2014-05-08 18:19 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-05-05 16:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think I have a patch.


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
  2014-05-05  9:14 ` [Bug c/61053] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
  2014-05-05 16:38 ` mpolacek at gcc dot gnu.org
@ 2014-05-08 18:19 ` mpolacek at gcc dot gnu.org
  2014-05-08 18:23 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-05-08 18:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu May  8 18:19:09 2014
New Revision: 210230

URL: http://gcc.gnu.org/viewcvs?rev=210230&root=gcc&view=rev
Log:
    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.

Added:
    trunk/gcc/testsuite/gcc.dg/pr61053.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
                   ` (2 preceding siblings ...)
  2014-05-08 18:19 ` mpolacek at gcc dot gnu.org
@ 2014-05-08 18:23 ` mpolacek at gcc dot gnu.org
  2014-06-04  7:33 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-05-08 18:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
                   ` (3 preceding siblings ...)
  2014-05-08 18:23 ` mpolacek at gcc dot gnu.org
@ 2014-06-04  7:33 ` mpolacek at gcc dot gnu.org
  2014-06-04  8:23 ` mpolacek at gcc dot gnu.org
  2014-11-15 15:59 ` fxcoudert at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-06-04  7:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'm about to backport the fix even into 4.9 branch, thanks.


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
                   ` (4 preceding siblings ...)
  2014-06-04  7:33 ` mpolacek at gcc dot gnu.org
@ 2014-06-04  8:23 ` mpolacek at gcc dot gnu.org
  2014-11-15 15:59 ` fxcoudert at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-06-04  8:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Jun  4 08:22:22 2014
New Revision: 211214

URL: http://gcc.gnu.org/viewcvs?rev=211214&root=gcc&view=rev
Log:
    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.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr61053.c
Modified:
    branches/gcc-4_9-branch/gcc/c-family/ChangeLog
    branches/gcc-4_9-branch/gcc/c-family/c-common.c
    branches/gcc-4_9-branch/gcc/c-family/c-common.h
    branches/gcc-4_9-branch/gcc/c/ChangeLog
    branches/gcc-4_9-branch/gcc/c/c-decl.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug c/61053] [4.9/4.10 Regression] _Alignas(long long) reduces alignment of long long
  2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
                   ` (5 preceding siblings ...)
  2014-06-04  8:23 ` mpolacek at gcc dot gnu.org
@ 2014-11-15 15:59 ` fxcoudert at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-15 15:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61053

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |fxcoudert at gcc dot gnu.org,
                   |                            |iains at gcc dot gnu.org,
                   |                            |mikestump at comcast dot net
         Resolution|FIXED                       |---

--- Comment #8 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
The testcase introduced in fixing this bug (gcc.dg/pr61053.c) fails on
x86_64-apple-darwin14 with -m32, because of excess errors:

gcc.dg/pr61053.c:70:28: error: '_Alignas' specifiers cannot reduce alignment of
'ldi'
gcc.dg/pr61053.c:71:33: error: '_Alignas' specifiers cannot reduce alignment of
'ldl'
gcc.dg/pr61053.c:72:38: error: '_Alignas' specifiers cannot reduce alignment of
'ldll'
gcc.dg/pr61053.c:73:30: error: '_Alignas' specifiers cannot reduce alignment of
'ldf'
gcc.dg/pr61053.c:74:31: error: '_Alignas' specifiers cannot reduce alignment of
'ldd'

The testcase does not expect those for ia32, but we have them on darwin because
long double has 16 bytes alignment both at -m32 and -m64.
I don't know what's the best way to adapt the dg-error clauses, however.


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

end of thread, other threads:[~2014-11-15 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-04 11:51 [Bug c/61053] New: _Alignas(long long) reduces alignment of long long pdziepak at quarnos dot org
2014-05-05  9:14 ` [Bug c/61053] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
2014-05-05 16:38 ` mpolacek at gcc dot gnu.org
2014-05-08 18:19 ` mpolacek at gcc dot gnu.org
2014-05-08 18:23 ` mpolacek at gcc dot gnu.org
2014-06-04  7:33 ` mpolacek at gcc dot gnu.org
2014-06-04  8:23 ` mpolacek at gcc dot gnu.org
2014-11-15 15:59 ` fxcoudert at gcc dot gnu.org

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