public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> @ 2020-05-21 6:15 ` luoxhu at gcc dot gnu.org 2023-12-08 11:01 ` guojiufu at gcc dot gnu.org ` (3 subsequent siblings) 4 siblings, 0 replies; 9+ messages in thread From: luoxhu at gcc dot gnu.org @ 2020-05-21 6:15 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 luoxhu at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luoxhu at gcc dot gnu.org --- Comment #12 from luoxhu at gcc dot gnu.org --- Fixed at least from GCC 4.9.4? $ /opt/at8.0/bin/gcc -O3 -c -S pr30271.c -mstrict-align $ cat pr30271.s .file "pr30271.c" .abiversion 2 .section ".toc","aw" .section ".text" .align 2 .p2align 4,,15 .globl f .type f, @function f: extsh 9,3 srawi 3,3,16 add 3,9,3 extsw 3,3 blr .long 0 .byte 0,0,0,0,0,0,0,0 .size f,.-f .ident "GCC: (GNU) 4.9.4 20150824 (Advance-Toolchain-at8.0) [ibm/gcc-4_9-branch, revision: 227153 merged from gcc-4_9-branch, revision 227151]" .section .note.GNU-stack,"",@progbits ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> 2020-05-21 6:15 ` [Bug target/30271] -mstrict-align can an store extra for struct agrument passing luoxhu at gcc dot gnu.org @ 2023-12-08 11:01 ` guojiufu at gcc dot gnu.org 2023-12-19 5:18 ` cvs-commit at gcc dot gnu.org ` (2 subsequent siblings) 4 siblings, 0 replies; 9+ messages in thread From: guojiufu at gcc dot gnu.org @ 2023-12-08 11:01 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 Jiu Fu Guo <guojiufu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guojiufu at gcc dot gnu.org --- Comment #13 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #10) > (In reply to comment #9) > > Andrew, > > > > What is your point here? > > My point here is that currently we do: > gi->frame_related = > (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx); > > But if we change it to be: > gi->frame_related = > (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx) > || (base == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]); > > It would delete the store (at least in a 4.3 based compiler). > arg_pointer_rtx is the incoming argument space so if it is a fixed register > it will be also frame related and we can safely delete the stores to this > space. https://gcc.gnu.org/pipermail/gcc-patches/2023-December/639550.html is using this idea too. And the 'std' in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271#c2 disappeared. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> 2020-05-21 6:15 ` [Bug target/30271] -mstrict-align can an store extra for struct agrument passing luoxhu at gcc dot gnu.org 2023-12-08 11:01 ` guojiufu at gcc dot gnu.org @ 2023-12-19 5:18 ` cvs-commit at gcc dot gnu.org 2024-01-04 1:06 ` [Bug target/30271] -mstrict-align can add an store extra for struct argument passing guojiufu at gcc dot gnu.org 2024-01-20 17:13 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 9+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2023-12-19 5:18 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 --- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jiu Fu Guo <guojiufu@gcc.gnu.org>: https://gcc.gnu.org/g:4759383245ac97a5c83c0272f0a831f2a26ea5c1 commit r14-6674-g4759383245ac97a5c83c0272f0a831f2a26ea5c1 Author: Jiufu Guo <guojiufu@linux.ibm.com> Date: Tue Dec 19 13:03:06 2023 +0800 treat argp-based mem as frame related in dse The issue mentioned in PR112525 would be able to be handled by updating dse.cc to treat arg_pointer_rtx similarly with frame_pointer_rtx. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271#c10 also mentioned this idea. And arpg area may be used to pass argument to callee. So, it would be needed to check if call insns are using that mem. PR rtl-optimization/112525 PR target/30271 gcc/ChangeLog: * dse.cc (get_group_info): Add arg_pointer_rtx as frame_related. (check_mem_read_rtx): Add parameter to indicate if it is checking mem for call insn. (scan_insn): Add mem checking on call usage. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr112525.c: New test. * gcc.target/powerpc/pr30271.c: New test. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can add an store extra for struct argument passing [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2023-12-19 5:18 ` cvs-commit at gcc dot gnu.org @ 2024-01-04 1:06 ` guojiufu at gcc dot gnu.org 2024-01-20 17:13 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 9+ messages in thread From: guojiufu at gcc dot gnu.org @ 2024-01-04 1:06 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 Jiu Fu Guo <guojiufu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #15 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> --- Fix was committed. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can add an store extra for struct argument passing [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> ` (3 preceding siblings ...) 2024-01-04 1:06 ` [Bug target/30271] -mstrict-align can add an store extra for struct argument passing guojiufu at gcc dot gnu.org @ 2024-01-20 17:13 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 9+ messages in thread From: pinskia at gcc dot gnu.org @ 2024-01-20 17:13 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |14.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing @ 2006-12-21 2:49 pinskia at gcc dot gnu dot org 2008-12-11 4:44 ` [Bug target/30271] -mstrict-align can an store extra " pinskia at gcc dot gnu dot org ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-12-21 2:49 UTC (permalink / raw) To: gcc-bugs Testcase: struct a { short t, t1;}; int f(struct a b) { return b.t; } Without -mstrict-align, we get: .L.f: srawi 3,3,16 extsw 3,3 blr But with we get: .L.f: stw 3,48(1) nop nop nop lha 3,48(1) extsw 3,3 blr -- Summary: -mstrict-align can cause bad code generation for struct agrument passing Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org GCC target triplet: powerpc64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing 2006-12-21 2:49 [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing pinskia at gcc dot gnu dot org @ 2008-12-11 4:44 ` pinskia at gcc dot gnu dot org 2008-12-15 15:34 ` zadeck at naturalbridge dot com ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-12-11 4:44 UTC (permalink / raw) To: gcc-bugs ------- Comment #8 from pinskia at gcc dot gnu dot org 2008-12-11 04:42 ------- So the problem with the stores here is that the base is arg_pointer_rtx which is still a frame pointer related offset. I think the same can be said is true of stack_pointer_rtx too. We only set frame_related for frame_pointer_rtx and hard_frame_pointer_rtx but arg_pointer_rtx will become a frame pointer later one too. The only issue is that there might not be correct dependencies with respect of arg_pointer_rtx. Kenny, Do you agree? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing 2006-12-21 2:49 [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing pinskia at gcc dot gnu dot org 2008-12-11 4:44 ` [Bug target/30271] -mstrict-align can an store extra " pinskia at gcc dot gnu dot org @ 2008-12-15 15:34 ` zadeck at naturalbridge dot com 2008-12-16 2:09 ` pinskia at gcc dot gnu dot org 2008-12-29 23:53 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 9+ messages in thread From: zadeck at naturalbridge dot com @ 2008-12-15 15:34 UTC (permalink / raw) To: gcc-bugs ------- Comment #9 from zadeck at naturalbridge dot com 2008-12-15 15:32 ------- Andrew, What is your point here? 1) Is it your claim that anything that is arg_pointer_rtx related would automatically qualify as being safe enough to remove dead stores to? or 2) Is it your claim that if we could generalize the game proposed in comment #7 to cover the arg_pointer_rtx's also? Kenny -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing 2006-12-21 2:49 [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing pinskia at gcc dot gnu dot org 2008-12-11 4:44 ` [Bug target/30271] -mstrict-align can an store extra " pinskia at gcc dot gnu dot org 2008-12-15 15:34 ` zadeck at naturalbridge dot com @ 2008-12-16 2:09 ` pinskia at gcc dot gnu dot org 2008-12-29 23:53 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 9+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-12-16 2:09 UTC (permalink / raw) To: gcc-bugs ------- Comment #10 from pinskia at gcc dot gnu dot org 2008-12-16 02:08 ------- (In reply to comment #9) > Andrew, > > What is your point here? My point here is that currently we do: gi->frame_related = (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx); But if we change it to be: gi->frame_related = (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx) || (base == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]); It would delete the store (at least in a 4.3 based compiler). arg_pointer_rtx is the incoming argument space so if it is a fixed register it will be also frame related and we can safely delete the stores to this space. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/30271] -mstrict-align can an store extra for struct agrument passing 2006-12-21 2:49 [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing pinskia at gcc dot gnu dot org ` (2 preceding siblings ...) 2008-12-16 2:09 ` pinskia at gcc dot gnu dot org @ 2008-12-29 23:53 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 9+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-12-29 23:53 UTC (permalink / raw) To: gcc-bugs ------- Comment #11 from pinskia at gcc dot gnu dot org 2008-12-29 23:51 ------- (In reply to comment #10) Hmm, this patch bootstraps just fine on the 4.3 branch but causes miscompares on the trunk (the 4.3 branch had checking on also when I bootstrapped it on i386-darwin8.11). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30271 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-01-20 17:13 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-30271-4@http.gcc.gnu.org/bugzilla/> 2020-05-21 6:15 ` [Bug target/30271] -mstrict-align can an store extra for struct agrument passing luoxhu at gcc dot gnu.org 2023-12-08 11:01 ` guojiufu at gcc dot gnu.org 2023-12-19 5:18 ` cvs-commit at gcc dot gnu.org 2024-01-04 1:06 ` [Bug target/30271] -mstrict-align can add an store extra for struct argument passing guojiufu at gcc dot gnu.org 2024-01-20 17:13 ` pinskia at gcc dot gnu.org 2006-12-21 2:49 [Bug target/30271] New: -mstrict-align can cause bad code generation for struct agrument passing pinskia at gcc dot gnu dot org 2008-12-11 4:44 ` [Bug target/30271] -mstrict-align can an store extra " pinskia at gcc dot gnu dot org 2008-12-15 15:34 ` zadeck at naturalbridge dot com 2008-12-16 2:09 ` pinskia at gcc dot gnu dot org 2008-12-29 23:53 ` pinskia at gcc dot gnu dot 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).