public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65672] New: type attribute "aligned" can decrease alignment
@ 2015-04-04 19:17 glisse at gcc dot gnu.org
  2024-04-15  5:34 ` [Bug c/65672] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2015-04-04 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65672
           Summary: type attribute "aligned" can decrease alignment
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html states that 
"The aligned attribute can only increase the alignment"

However, on x86_64:

typedef float vec __attribute__((vector_size(16)));
typedef float vecu __attribute__((vector_size(16),aligned(8)));

alignof(vec) says 16 and alignof(vecu) says 8. And indeed,

vec f(vecu*p){
  return *p;
}

compiles to movups (while regular loads use movaps), so this behavior is
useful. Assuming it is meant to work and not just an accident, it would be nice
to document this (otherwise it is a wrong code bug).


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

* [Bug c/65672] type attribute "aligned" can decrease alignment
  2015-04-04 19:17 [Bug c/65672] New: type attribute "aligned" can decrease alignment glisse at gcc dot gnu.org
@ 2024-04-15  5:34 ` pinskia at gcc dot gnu.org
  2024-04-15  5:40 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15  5:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---


*** This bug has been marked as a duplicate of bug 89950 ***

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

* [Bug c/65672] type attribute "aligned" can decrease alignment
  2015-04-04 19:17 [Bug c/65672] New: type attribute "aligned" can decrease alignment glisse at gcc dot gnu.org
  2024-04-15  5:34 ` [Bug c/65672] " pinskia at gcc dot gnu.org
@ 2024-04-15  5:40 ` pinskia at gcc dot gnu.org
  2024-04-15  5:40 ` pinskia at gcc dot gnu.org
  2024-04-15  5:44 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15  5:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |---
             Status|RESOLVED                    |NEW

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
actually let's reopen this one and close the other one as a dup of this one.

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

* [Bug c/65672] type attribute "aligned" can decrease alignment
  2015-04-04 19:17 [Bug c/65672] New: type attribute "aligned" can decrease alignment glisse at gcc dot gnu.org
  2024-04-15  5:34 ` [Bug c/65672] " pinskia at gcc dot gnu.org
  2024-04-15  5:40 ` pinskia at gcc dot gnu.org
@ 2024-04-15  5:40 ` pinskia at gcc dot gnu.org
  2024-04-15  5:44 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15  5:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

* [Bug c/65672] type attribute "aligned" can decrease alignment
  2015-04-04 19:17 [Bug c/65672] New: type attribute "aligned" can decrease alignment glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-04-15  5:40 ` pinskia at gcc dot gnu.org
@ 2024-04-15  5:44 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15  5:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I see Martin has argued both ways :).

Anyways I the issue is in reconstruct_complex_type (either
cp_reconstruct_complex_type in gcc/cp/decl2.cc or reconstruct_complex_type in
gcc/tree.cc).

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-04 19:17 [Bug c/65672] New: type attribute "aligned" can decrease alignment glisse at gcc dot gnu.org
2024-04-15  5:34 ` [Bug c/65672] " pinskia at gcc dot gnu.org
2024-04-15  5:40 ` pinskia at gcc dot gnu.org
2024-04-15  5:40 ` pinskia at gcc dot gnu.org
2024-04-15  5:44 ` 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).