public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65685] New: Reducing alignment with alignas should be rejected
@ 2015-04-07 11:29 redi at gcc dot gnu.org
  2015-04-07 17:25 ` [Bug c++/65685] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-07 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65685
           Summary: Reducing alignment with alignas should be rejected
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
            Blocks: 58601

GCC doesn't give any diagnostic for the example in 7.6.2 [dcl.align] p5:

The combined effect of all alignment-specifiers in a declaration shall not
specify an alignment that is less strict than the alignment that would be
required for the entity being declared if all alignment-specifiers
appertaining to that entity were omitted. [ Example:
  struct alignas(8) S {};
  struct alignas(1) U {
    S s;
  };   // Error: U specifies an alignment that is less strict than
       // if the alignas(1) were omitted.
— end example ]
>From gcc-bugs-return-482857-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 07 11:34:20 2015
Return-Path: <gcc-bugs-return-482857-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17629 invoked by alias); 7 Apr 2015 11:34:19 -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 17598 invoked by uid 48); 7 Apr 2015 11:34:15 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65676] ICE: in extract_insn, at recog.c:2343 (unrecognizable insn) with -mavx512f -funsigned-char and __builtin_ia32_pmovsxwq512_mask()
Date: Tue, 07 Apr 2015 11:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-65676-4-q3UHV1DkVu@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65676-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65676-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00409.txt.bz2
Content-length: 1027

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Following patch:

--cut here--
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 221888)
+++ config/i386/i386.c  (working copy)
@@ -37509,6 +37509,10 @@ ix86_expand_args_builtin (const struct builtin_des
          if (memory_operand (op, mode))
            num_memory++;

+         /* Fixup modeless constants to fit required mode.  */
+         if (GET_MODE (op) == VOIDmode)
+           op = convert_to_mode (mode, op, 1);
+
          if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
            {
              if (optimize || !match || num_memory > 1)
--cut here--

fixes the testcase failure. This fixup is needed everywhere we have builtin
with QImode operands.
>From gcc-bugs-return-482858-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 07 11:44:55 2015
Return-Path: <gcc-bugs-return-482858-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30440 invoked by alias); 7 Apr 2015 11:44:55 -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 30349 invoked by uid 48); 7 Apr 2015 11:44:51 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/29256] [4.8/4.9/5 regression] loop performance regression
Date: Tue, 07 Apr 2015 11:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.2.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.5
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-29256-4-6RNDQIXvC5@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-29256-4@http.gcc.gnu.org/bugzilla/>
References: <bug-29256-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: 2015-04/txt/msg00410.txt.bz2
Content-length: 610

https://gcc.gnu.org/bugzilla/show_bug.cgi?id)256

--- Comment #48 from Richard Biener <rguenth at gcc dot gnu.org> ---
On ppc64 we generate

.L2:
        lfd 6,8(10)
        lfd 7,16(10)
        lfd 8,24(10)
        lfd 9,32(10)
        lfd 10,40(10)
        lfd 11,48(10)
        lfd 12,56(10)
        lfdu 0,64(10)
        stfd 6,8(9)
        stfd 7,16(9)
        stfd 8,24(9)
        stfd 9,32(9)
        stfd 10,40(9)
        stfd 11,48(9)
        stfd 12,56(9)
        stfdu 0,64(9)
        bdnz .L2

which looks quite optimal to me.  8 copies, indexed loads/stores with an
update variant on the last.


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

* [Bug c++/65685] Reducing alignment with alignas should be rejected
  2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
@ 2015-04-07 17:25 ` mpolacek at gcc dot gnu.org
  2020-07-02  8:45 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-04-07 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-07
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/65685] Reducing alignment with alignas should be rejected
  2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
  2015-04-07 17:25 ` [Bug c++/65685] " mpolacek at gcc dot gnu.org
@ 2020-07-02  8:45 ` redi at gcc dot gnu.org
  2020-07-02  8:47 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2020-07-02  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sinbal2l at gmail dot com

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 94594 has been marked as a duplicate of this bug. ***

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

* [Bug c++/65685] Reducing alignment with alignas should be rejected
  2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
  2015-04-07 17:25 ` [Bug c++/65685] " mpolacek at gcc dot gnu.org
  2020-07-02  8:45 ` redi at gcc dot gnu.org
@ 2020-07-02  8:47 ` redi at gcc dot gnu.org
  2020-07-02 13:01 ` redi at gcc dot gnu.org
  2024-04-06  8:15 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2020-07-02  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 94569 has been marked as a duplicate of this bug. ***

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

* [Bug c++/65685] Reducing alignment with alignas should be rejected
  2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-07-02  8:47 ` redi at gcc dot gnu.org
@ 2020-07-02 13:01 ` redi at gcc dot gnu.org
  2024-04-06  8:15 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2020-07-02 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There are two facets to this. GCC allows alignas with a weaker alignment on a
type, and ignores it. GCC also allows alignas with a weaker alignment on an
object declaration, and reduces the alignment. In both cases it would be
conforming to issue a warning, even if the current behaviour is retained.

struct alignas(8) S {};
struct alignas(2) U {
  S s;
}; // { dg-error "alignment" }

// This assertion passes, meaning the invalid alignas(2) was silently ignored.
static_assert( alignof(U) == alignof(S), "" );

alignas(1) S s;  // { dg-error "align" }
alignas(1) U u;  // { dg-error "align" }

#ifdef __GNUC__
// These assertions pass, so GCC honours the invalid alignas(1) requests.
static_assert( alignof(s) == 1, "GCC reduced alignment of s" ); // WRONG!
static_assert( alignof(u) == 1, "GCC reduced alignment of u" ); // WRONG!
#endif

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

* [Bug c++/65685] Reducing alignment with alignas should be rejected
  2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-07-02 13:01 ` redi at gcc dot gnu.org
@ 2024-04-06  8:15 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-06  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 69571 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2024-04-06  8:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 11:29 [Bug c++/65685] New: Reducing alignment with alignas should be rejected redi at gcc dot gnu.org
2015-04-07 17:25 ` [Bug c++/65685] " mpolacek at gcc dot gnu.org
2020-07-02  8:45 ` redi at gcc dot gnu.org
2020-07-02  8:47 ` redi at gcc dot gnu.org
2020-07-02 13:01 ` redi at gcc dot gnu.org
2024-04-06  8:15 ` pinskia 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).