[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-03 Thread deller at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #32 from deller at gmx dot de --- Fixed in Linux kernel by declaring the extern int32 as char: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c42813b71a06a2ff4a155aa87ac609feeab76cf3

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread deller at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #31 from deller at gmx dot de --- Richard suggested that adding a compiler optimization barrier (__asm__ ("" : "+r" (__pptr))) might fix the problem. I tested the attached patch and it works nicely.

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread deller at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #30 from deller at gmx dot de --- Created attachment 51405 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51405=edit Linux kernel patch to add compiler optimization barrier Linux kernel boots sucessfully with this patch on

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #29 from Andrew Pinski --- (In reply to deller from comment #28) > Arnd, > there are various calls to the get_unaligned_X() functions in all kernel > bootloaders, specifically in the kernel decompression routines: get_unaligned_

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread deller at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #28 from deller at gmx dot de --- Arnd, there are various calls to the get_unaligned_X() functions in all kernel bootloaders, specifically in the kernel decompression routines: [deller@ls3530 linux-2.6]$ grep get_unaligned

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread arnd at linaro dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #27 from Arnd Bergmann --- The linux kernel instance from arch/parisc/ looks like a bug we fixed in arch/arm a few years ago, by adding the required alignment directive to the linker script. If changing the linker script is not

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-02 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Bug 102162 depends on bug 88085, which changed state. Bug 88085 Summary: User alignments on var decls not respected if smaller than type alignment https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88085 What|Removed

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Andrew Pinski changed: What|Removed |Added Depends on||88085 --- Comment #25 from Andrew

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #24 from dave.anglin at bell dot net --- On 2021-09-01 8:23 p.m., pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 > > --- Comment #23 from Andrew Pinski --- > (In reply to Andrew Pinski from

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #23 from Andrew Pinski --- (In reply to Andrew Pinski from comment #22) > The problem is in emit-rtl.c in set_mem_attributes_minus_bitpos: > > /* We can set the alignment from the type if we are making an object or if > this

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #22 from Andrew Pinski --- The problem is in emit-rtl.c in set_mem_attributes_minus_bitpos: /* We can set the alignment from the type if we are making an object or if this is an INDIRECT_REF. */ if (objectp || TREE_CODE

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #21 from dave.anglin at bell dot net --- On 2021-09-01 7:21 p.m., pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 > > --- Comment #17 from Andrew Pinski --- > (In reply to dave.anglin from

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #20 from Andrew Pinski --- tem was the var_decl /* If TEM's type is a union of variable size, pass TARGET to the inner computation, since it will need a temporary and TARGET is known to have to do.

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #19 from Andrew Pinski --- Gimple level does look correct: unit-size align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x77315bd0 precision:32 min max context > readonly arg:0

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #17 from Andrew Pinski --- (In reply to dave.anglin from comment #14) > On 2021-09-01 6:35 p.m., dave.anglin at bell dot net wrote: > > We only get correct code at -O0. > Maybe cpymemsi expander is problem. It can't be as that is

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #16 from Andrew Pinski --- I cannot even reproduce the original issue on released gcc 10.3.0 sources. What configure options is being used? I used none except for --target: Configured with: ../configure --target=hppa-linux-gnu I

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #15 from Andrew Pinski --- The trunk works: .LEVEL 1.1 .text .align 4 .globl test .type test, @function test: .PROC .CALLINFO FRAME=0,NO_CALLS .ENTRY addil

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #14 from dave.anglin at bell dot net --- On 2021-09-01 6:35 p.m., dave.anglin at bell dot net wrote: > We only get correct code at -O0. Maybe cpymemsi expander is problem.

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #13 from dave.anglin at bell dot net --- On 2021-09-01 5:52 p.m., pinskia at gcc dot gnu.org wrote: > This is doing the correct thing in splitting up the load into bytes loads. We only get correct code at -O0.  STRICT_ALIGNMENT is

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 --- Comment #12 from Andrew Pinski --- Here is what the first testcase looks like at -O1 -mstrict-align on aarch64-linux-gnu for GCC 10.3.0: test: .LFB1: .cfi_startproc adrpx0, output_len add x1, x0,

[Bug middle-end/102162] Byte-wise access optimized away at -O1 and above

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Andrew Pinski changed: What|Removed |Added Component|tree-optimization |middle-end Keywords|