public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align
@ 2021-11-05 12:52 felix at breitweiser dot de
  2021-11-05 12:58 ` [Bug target/103100] " pinskia at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: felix at breitweiser dot de @ 2021-11-05 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103100
           Summary: unaligned access generated when zero-initializing
                    large locals with SIMD-instructions and -O2
                    -mstrict-align
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix at breitweiser dot de
  Target Milestone: ---

Created attachment 51738
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51738&action=edit
source code that generates the faulty assembly

when zero-intializing large local variables, gcc 11.2 (with -O2 and -O3) uses
SIMD registers to store a pair of 16-byte registers at once into memory. When
doing so, gcc can generate code that does not access memory on a 16-byte
aligned boundary, even though the aarch64 architecture requires memory accesses
to be 16-byte aligned when using the full 16-byte SIMD registers. This happens
with -mstrict-align enabled.

For example:

static void (*use)(unsigned char*); // to suppress optimizations

extern "C" void _start() {
    unsigned char t2[216]={};
    use(t2);
}

when compiled with "gcc -save-temps -O2 -mstrict-align" generates the following
assembly:
_start:
        stp     x29, x30, [sp, #-240]!// assuming sp is aligned to 16-bytes
here 
        mov     x1, #0x0
        movi    v0.4s, #0x0
        add     x2, sp, #0x28 // the value in x2 is 8-byte aligned, but not 
                                 16-byte aligned
        mov     x29, sp
        stp     xzr, xzr, [sp, #24]
        add     x0, sp, #0x18
        stp     q0, q0, [x2] // x2 is not 16-byte aligned, so the store is not
                                aligned
        add     x2, sp, #0x48
        str     xzr, [sp, #232]
        stp     q0, q0, [x2]
        add     x2, sp, #0x68
        stp     q0, q0, [x2]
        add     x2, sp, #0x88
        stp     q0, q0, [x2]
        add     x2, sp, #0xa8
        stp     q0, q0, [x2]
        add     x2, sp, #0xc8
        stp     q0, q0, [x2]
        blr     x1
        ldp     x29, x30, [sp], #240
        ret

I have seen https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71727 and even though
that is marked as fixed, this issue persists in gcc 11.2

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

* [Bug target/103100] unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
@ 2021-11-05 12:58 ` pinskia at gcc dot gnu.org
  2021-11-05 13:17 ` pinskia at gcc dot gnu.org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 101934, fixed for gcc 11.3.0.

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

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

* [Bug target/103100] unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
  2021-11-05 12:58 ` [Bug target/103100] " pinskia at gcc dot gnu.org
@ 2021-11-05 13:17 ` pinskia at gcc dot gnu.org
  2021-11-05 13:21 ` [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} " pinskia at gcc dot gnu.org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-05
         Resolution|DUPLICATE                   |---
             Status|RESOLVED                    |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually it is not a dup.

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
  2021-11-05 12:58 ` [Bug target/103100] " pinskia at gcc dot gnu.org
  2021-11-05 13:17 ` pinskia at gcc dot gnu.org
@ 2021-11-05 13:21 ` pinskia at gcc dot gnu.org
  2021-11-05 13:26 ` pinskia at gcc dot gnu.org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |pinskia at gcc dot gnu.org
   Target Milestone|---                         |11.3

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, another simplier testcase:
void use(unsigned char*);

void g() {
    unsigned char t2[216];
    __builtin_memset(t2, 0, sizeof(t2));
    use(t2);
}

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (2 preceding siblings ...)
  2021-11-05 13:21 ` [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} " pinskia at gcc dot gnu.org
@ 2021-11-05 13:26 ` pinskia at gcc dot gnu.org
  2021-11-05 13:27 ` pinskia at gcc dot gnu.org
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine.
This should fix it (untested):
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 699c105a42a..5d0872be4ef 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -23584,7 +23584,9 @@ aarch64_expand_setmem (rtx *operands)
         over writing.  */
       opt_scalar_int_mode mode_iter;
       FOR_EACH_MODE_IN_CLASS (mode_iter, MODE_INT)
-       if (GET_MODE_BITSIZE (mode_iter.require ()) <= MIN (n, copy_limit))
+       if (GET_MODE_BITSIZE (mode_iter.require ()) <= MIN (n, copy_limit)
+           && (!STRICT_ALIGNMENT
+               || MEM_ALIGN (dst) >= GET_MODE_ALIGNMENT (mode_iter.require
())))
          cur_mode = mode_iter.require ();

       gcc_assert (cur_mode != BLKmode);

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (3 preceding siblings ...)
  2021-11-05 13:26 ` pinskia at gcc dot gnu.org
@ 2021-11-05 13:27 ` pinskia at gcc dot gnu.org
  2021-11-05 13:35 ` rguenth at gcc dot gnu.org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=101934

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also it was caused by r11-4973.

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (4 preceding siblings ...)
  2021-11-05 13:27 ` pinskia at gcc dot gnu.org
@ 2021-11-05 13:35 ` rguenth at gcc dot gnu.org
  2021-11-05 13:38 ` pinskia at gcc dot gnu.org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-05 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Target|                            |aarch64

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (5 preceding siblings ...)
  2021-11-05 13:35 ` rguenth at gcc dot gnu.org
@ 2021-11-05 13:38 ` pinskia at gcc dot gnu.org
  2021-11-06  5:26 ` pinskia at gcc dot gnu.org
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-05 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Mine.
> This should fix it (untested):
And yes it works.

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (6 preceding siblings ...)
  2021-11-05 13:38 ` pinskia at gcc dot gnu.org
@ 2021-11-06  5:26 ` pinskia at gcc dot gnu.org
  2021-11-18  8:50 ` pinskia at gcc dot gnu.org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-06  5:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2021-Novembe
                   |                            |r/583554.html
           Keywords|                            |patch

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583554.html

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (7 preceding siblings ...)
  2021-11-06  5:26 ` pinskia at gcc dot gnu.org
@ 2021-11-18  8:50 ` pinskia at gcc dot gnu.org
  2021-11-19  1:55 ` pinskia at gcc dot gnu.org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-18  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 51830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51830&action=edit
New simplier patch which does the right thing too

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (8 preceding siblings ...)
  2021-11-18  8:50 ` pinskia at gcc dot gnu.org
@ 2021-11-19  1:55 ` pinskia at gcc dot gnu.org
  2022-01-26  2:30 ` pinskia at gcc dot gnu.org
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-19  1:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2021-Novembe
                   |                            |r/584927.html
           Keywords|                            |patch

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
New patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584927.html

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (9 preceding siblings ...)
  2021-11-19  1:55 ` pinskia at gcc dot gnu.org
@ 2022-01-26  2:30 ` pinskia at gcc dot gnu.org
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-26  2:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://gcc.gnu.org/piperma |https://gcc.gnu.org/piperma
                   |il/gcc-patches/2021-Novembe |il/gcc-patches/2022-January
                   |r/584927.html               |/589254.html

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Updated patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589254.html

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

* [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (10 preceding siblings ...)
  2022-01-26  2:30 ` pinskia at gcc dot gnu.org
@ 2022-04-21  7:50 ` rguenth at gcc dot gnu.org
  2022-06-09 10:28 ` [Bug target/103100] [11/12/13 " pinskia at gcc dot gnu.org
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-21  7:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.3                        |11.4

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (11 preceding siblings ...)
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
@ 2022-06-09 10:28 ` pinskia at gcc dot gnu.org
  2023-01-19 13:28 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-09 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keven.kloeckner at siemens dot com

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

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (12 preceding siblings ...)
  2022-06-09 10:28 ` [Bug target/103100] [11/12/13 " pinskia at gcc dot gnu.org
@ 2023-01-19 13:28 ` rguenth at gcc dot gnu.org
  2023-01-20 13:59 ` rearnsha at gcc dot gnu.org
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-19 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #10)
> Updated patch submitted:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589254.html

I think you need to ping your patches more aggressively ...

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (13 preceding siblings ...)
  2023-01-19 13:28 ` rguenth at gcc dot gnu.org
@ 2023-01-20 13:59 ` rearnsha at gcc dot gnu.org
  2023-01-23  7:29 ` felix at breitweiser dot de
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2023-01-20 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #13)
> (In reply to Andrew Pinski from comment #10)
> > Updated patch submitted:
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589254.html
> 
> I think you need to ping your patches more aggressively ...

Richard Sandiford reviewed it here:|
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/589581.html
So the problem is that the review wasn't followed up by the submitter.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (14 preceding siblings ...)
  2023-01-20 13:59 ` rearnsha at gcc dot gnu.org
@ 2023-01-23  7:29 ` felix at breitweiser dot de
  2023-01-23  7:37 ` sam at gentoo dot org
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: felix at breitweiser dot de @ 2023-01-23  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from felix at breitweiser dot de ---
(In reply to Richard Earnshaw from comment #14)
> (In reply to Richard Biener from comment #13)
> > (In reply to Andrew Pinski from comment #10)
> > > Updated patch submitted:
> > > https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589254.html
> > 
> > I think you need to ping your patches more aggressively ...
> 
> Richard Sandiford reviewed it here:|
> https://gcc.gnu.org/pipermail/gcc-patches/2022-February/589581.html
> So the problem is that the review wasn't followed up by the submitter.

I did not know that I have any further obligation on this past submitting the
bug, I never submitted a bug before. Anyway, the since the patch works (at
least for my use case), do I have to mark this as resolved, fixed?

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (15 preceding siblings ...)
  2023-01-23  7:29 ` felix at breitweiser dot de
@ 2023-01-23  7:37 ` sam at gentoo dot org
  2023-01-31 17:49 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: sam at gentoo dot org @ 2023-01-23  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Sam James <sam at gentoo dot org> ---
(In reply to felix from comment #15)

He means apinski who submitted a patch, not you.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (16 preceding siblings ...)
  2023-01-23  7:37 ` sam at gentoo dot org
@ 2023-01-31 17:49 ` pinskia at gcc dot gnu.org
  2023-01-31 17:51 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-31 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Another testcase which is now affecting us at Marvell in our early firmware:
```
void f(const char*);

void g(void)
{
  char t[32] = "0l2345678";
  f(t);
}

```
So I am planning on getting back on this patch starting today.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (17 preceding siblings ...)
  2023-01-31 17:49 ` pinskia at gcc dot gnu.org
@ 2023-01-31 17:51 ` pinskia at gcc dot gnu.org
  2023-01-31 18:24 ` rearnsha at gcc dot gnu.org
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-31 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #17)
> Another testcase which is now affecting us at Marvell in our early firmware:
> ```
> void f(const char*);
> 
> void g(void)
> {
>   char t[32] = "0l2345678";
>   f(t);
> }
> 
> ```
> So I am planning on getting back on this patch starting today.

I should say that testcase happens at `-Os -mstrict-align`, at `-O2
-mstrict-align` it works.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (18 preceding siblings ...)
  2023-01-31 17:51 ` pinskia at gcc dot gnu.org
@ 2023-01-31 18:24 ` rearnsha at gcc dot gnu.org
  2023-02-10  3:54 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2023-01-31 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #18)
> I should say that testcase happens at `-Os -mstrict-align`, at `-O2
> -mstrict-align` it works.

Because for -Os we don't forcibly align arrays - see 
AARCH64_EXPAND_ALIGNMENT and the macros that use it.

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (19 preceding siblings ...)
  2023-01-31 18:24 ` rearnsha at gcc dot gnu.org
@ 2023-02-10  3:54 ` pinskia at gcc dot gnu.org
  2023-03-24 12:09 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-10  3:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://gcc.gnu.org/piperma |https://gcc.gnu.org/piperma
                   |il/gcc-patches/2022-January |il/gcc-patches/2023-Februar
                   |/589254.html                |y/611684.html

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Submitted a version new patch:
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611684.html

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (20 preceding siblings ...)
  2023-02-10  3:54 ` pinskia at gcc dot gnu.org
@ 2023-03-24 12:09 ` pinskia at gcc dot gnu.org
  2023-04-05 19:25 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-24 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

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

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

* [Bug target/103100] [11/12/13 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (21 preceding siblings ...)
  2023-03-24 12:09 ` pinskia at gcc dot gnu.org
@ 2023-04-05 19:25 ` pinskia at gcc dot gnu.org
  2023-05-29 10:06 ` [Bug target/103100] [11/12/13/14 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-05 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://gcc.gnu.org/piperma |
                   |il/gcc-patches/2023-Februar |
                   |y/611684.html               |
           Assignee|pinskia at gcc dot gnu.org         |unassigned at gcc dot gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #22 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am no longer working on this.

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

* [Bug target/103100] [11/12/13/14 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (22 preceding siblings ...)
  2023-04-05 19:25 ` pinskia at gcc dot gnu.org
@ 2023-05-29 10:06 ` jakub at gcc dot gnu.org
  2023-09-20 13:53 ` wilco at gcc dot gnu.org
  2023-11-30 13:49 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

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

* [Bug target/103100] [11/12/13/14 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (23 preceding siblings ...)
  2023-05-29 10:06 ` [Bug target/103100] [11/12/13/14 " jakub at gcc dot gnu.org
@ 2023-09-20 13:53 ` wilco at gcc dot gnu.org
  2023-11-30 13:49 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: wilco at gcc dot gnu.org @ 2023-09-20 13:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from Wilco <wilco at gcc dot gnu.org> ---
Patch to avoid emitting unaligned LDP/STP with -mstrict-align:
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631022.html

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

* [Bug target/103100] [11/12/13/14 Regression] unaligned access generated with memset or {} and -O2 -mstrict-align
  2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
                   ` (24 preceding siblings ...)
  2023-09-20 13:53 ` wilco at gcc dot gnu.org
@ 2023-11-30 13:49 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-30 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Wilco Dijkstra <wilco@gcc.gnu.org>:

https://gcc.gnu.org/g:318f5232cfb3e0c9694889565e1f5424d0354463

commit r14-6012-g318f5232cfb3e0c9694889565e1f5424d0354463
Author: Wilco Dijkstra <wilco.dijkstra@arm.com>
Date:   Wed Oct 25 16:28:04 2023 +0100

    AArch64: Fix strict-align cpymem/setmem [PR103100]

    The cpymemdi/setmemdi implementation doesn't fully support strict
alignment.
    Block the expansion if the alignment is less than 16 with STRICT_ALIGNMENT.
    Clean up the condition when to use MOPS.

    gcc/ChangeLog/
            PR target/103100
            * config/aarch64/aarch64.md (cpymemdi): Remove pattern condition.
            (setmemdi): Likewise.
            * config/aarch64/aarch64.cc (aarch64_expand_cpymem): Support
            strict-align.  Cleanup condition for using MOPS.
            (aarch64_expand_setmem): Likewise.

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

end of thread, other threads:[~2023-11-30 13:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 12:52 [Bug target/103100] New: unaligned access generated when zero-initializing large locals with SIMD-instructions and -O2 -mstrict-align felix at breitweiser dot de
2021-11-05 12:58 ` [Bug target/103100] " pinskia at gcc dot gnu.org
2021-11-05 13:17 ` pinskia at gcc dot gnu.org
2021-11-05 13:21 ` [Bug target/103100] [11/12 Regression] unaligned access generated with memset or {} " pinskia at gcc dot gnu.org
2021-11-05 13:26 ` pinskia at gcc dot gnu.org
2021-11-05 13:27 ` pinskia at gcc dot gnu.org
2021-11-05 13:35 ` rguenth at gcc dot gnu.org
2021-11-05 13:38 ` pinskia at gcc dot gnu.org
2021-11-06  5:26 ` pinskia at gcc dot gnu.org
2021-11-18  8:50 ` pinskia at gcc dot gnu.org
2021-11-19  1:55 ` pinskia at gcc dot gnu.org
2022-01-26  2:30 ` pinskia at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-06-09 10:28 ` [Bug target/103100] [11/12/13 " pinskia at gcc dot gnu.org
2023-01-19 13:28 ` rguenth at gcc dot gnu.org
2023-01-20 13:59 ` rearnsha at gcc dot gnu.org
2023-01-23  7:29 ` felix at breitweiser dot de
2023-01-23  7:37 ` sam at gentoo dot org
2023-01-31 17:49 ` pinskia at gcc dot gnu.org
2023-01-31 17:51 ` pinskia at gcc dot gnu.org
2023-01-31 18:24 ` rearnsha at gcc dot gnu.org
2023-02-10  3:54 ` pinskia at gcc dot gnu.org
2023-03-24 12:09 ` pinskia at gcc dot gnu.org
2023-04-05 19:25 ` pinskia at gcc dot gnu.org
2023-05-29 10:06 ` [Bug target/103100] [11/12/13/14 " jakub at gcc dot gnu.org
2023-09-20 13:53 ` wilco at gcc dot gnu.org
2023-11-30 13:49 ` cvs-commit 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).