[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #20 from Jakub Jelinek jakub at gcc dot gnu.org 2011-12-08 13:36:46 UTC --- Author: jakub Date: Thu Dec 8 13:36:40 2011 New Revision: 182112 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=182112 Log: Backport from mainline 2011-12-05 Jakub Jelinek ja...@redhat.com Eric Botcazou ebotca...@adacore.com PR middle-end/51323 PR middle-end/50074 * calls.c (internal_arg_pointer_exp_state): New variable. (internal_arg_pointer_based_exp_1, internal_arg_pointer_exp_scan): New functions. (internal_arg_pointer_based_exp): New function. (mem_overlaps_already_clobbered_arg_p): Use it. (expand_call): Free internal_arg_pointer_exp_state.cache vector and clear internal_arg_pointer_exp_state.scan_start. 2011-11-26 Joern Rennecke joern.renne...@embecosm.com PR middle-end/50074 * calls.c (mem_overlaps_already_clobbered_arg_p): Return false if no outgoing arguments have been stored so far. 2011-12-05 Jakub Jelinek ja...@redhat.com Eric Botcazou ebotca...@adacore.com PR middle-end/51323 PR middle-end/50074 * gcc.c-torture/execute/pr51323.c: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/execute/pr51323.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/calls.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #18 from Jakub Jelinek jakub at gcc dot gnu.org 2011-12-05 08:15:38 UTC --- Author: jakub Date: Mon Dec 5 08:15:23 2011 New Revision: 182000 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=182000 Log: PR middle-end/51323 PR middle-end/50074 * calls.c (internal_arg_pointer_exp_state): New variable. (internal_arg_pointer_based_exp_1, internal_arg_pointer_exp_scan): New functions. (internal_arg_pointer_based_exp): New function. (mem_overlaps_already_clobbered_arg_p): Use it. (expand_call): Free internal_arg_pointer_exp_state.cache vector and clear internal_arg_pointer_exp_state.scan_start. * gcc.c-torture/execute/pr51323.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr51323.c Modified: trunk/gcc/ChangeLog trunk/gcc/calls.c trunk/gcc/testsuite/ChangeLog
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #19 from Jakub Jelinek jakub at gcc dot gnu.org 2011-12-05 08:37:51 UTC --- Fixed.
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #17 from Jakub Jelinek jakub at gcc dot gnu.org 2011-11-29 08:48:47 UTC --- Author: jakub Date: Tue Nov 29 08:48:41 2011 New Revision: 181800 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=181800 Log: PR middle-end/50074 * expr.c (expand_expr_addr_expr_1): Don't call force_operand for EXPAND_SUM modifier. Modified: trunk/gcc/ChangeLog trunk/gcc/expr.c
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org |gnu.org |
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #16 from Jakub Jelinek jakub at gcc dot gnu.org 2011-11-28 15:15:32 UTC --- See http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02413.html
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #15 from Jorn Wolfgang Rennecke amylaar at gcc dot gnu.org 2011-11-26 09:21:51 UTC --- Author: amylaar Date: Sat Nov 26 09:21:47 2011 New Revision: 181738 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=181738 Log: PR middle-end/50074 * calls.c (mem_overlaps_already_clobbered_arg_p): Return false if no outgoing arguments have been stored so far. Modified: trunk/gcc/ChangeLog trunk/gcc/calls.c
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #14 from Jakub Jelinek jakub at gcc dot gnu.org 2011-11-25 13:08:51 UTC --- (In reply to comment #11) Created attachment 25858 [details] Patch to make mem_overlaps_already_clobbered_arg_p return false if no arguments were stored on stack This patch fixes the sibcall-6.c failure on Epiphany. This patch is certainly correct, please submit it to gcc-patches. That said, this isn't enough. For i?86, it should be probably enough to revert Kyrill's patch and do something like: --- gcc/expr.c.jj2011-11-21 16:22:02.0 +0100 +++ gcc/expr.c2011-11-25 12:46:40.070831662 +0100 @@ -7452,7 +7452,8 @@ expand_expr_addr_expr_1 (tree exp, rtx t } if (modifier != EXPAND_INITIALIZER - modifier != EXPAND_CONST_ADDRESS) + modifier != EXPAND_CONST_ADDRESS + modifier != EXPAND_SUM) result = force_operand (result, target); return result; } (untested so far, but if it works, is IMHO desirable in any case). Unfortunately we have ia64 which only allows registers in memory addresses and thus we'd miscompile e.g. struct S { long s[4]; }; __attribute__((noinline, noclone)) void bar (long r0, long r1, long r2, long r3, long r4, long r5, long r6, long r7, long r8, long r9, long r10, long r11) { asm volatile (); } void foo (long r0, long r1, long r2, long r3, long r4, long r5, long r6, long r7, long x, struct S y) { bar (r0, r1, r2, r3, r4, r5, r6, r7, y.s[0], y.s[1], y.s[2], y.s[3]); } BTW, Kyrill's patch didn't deal with arbitrary pseudo plus constant or pseudo plus pseudo. Rejecting all pseudos is way too conservative though, tree-tailcall.c doesn't allow tailcalls if caller has address taken on any of the operands, thus the only case when pseudos point into the arguments area is when the pseudo is initialized in the current get_insns () list to something based on internal argument pointer. I'd say we could just look up (and cache) which pseudos in the current get_insns () list are crtl-args.internal_arg_pointer based and their corresponding offsets from it (if constant, or something that says they are variable).
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #13 from Andreas Krebbel krebbel at gcc dot gnu.org 2011-11-21 13:31:16 UTC --- This fixes the testcase on s390x. Tested with r181554. Thanks!
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #12 from Dominique d'Humieres dominiq at lps dot ens.fr 2011-11-20 12:52:05 UTC --- This patch fixes the sibcall-6.c failure on Epiphany. On x86_64-apple-darwin10 too. Thanks.
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Jorn Wolfgang Rennecke amylaar at gcc dot gnu.org changed: What|Removed |Added CC||amylaar at gcc dot gnu.org --- Comment #10 from Jorn Wolfgang Rennecke amylaar at gcc dot gnu.org 2011-11-19 11:44:00 UTC --- (In reply to comment #9) I see the same on s390x. gcc.dg/sibcall-6.c starts failing with r176042. I also see this on Epiphany.
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 --- Comment #11 from Jorn Wolfgang Rennecke amylaar at gcc dot gnu.org 2011-11-19 12:03:28 UTC --- Created attachment 25858 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=25858 Patch to make mem_overlaps_already_clobbered_arg_p return false if no arguments were stored on stack This patch fixes the sibcall-6.c failure on Epiphany.
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Priority|P3 |P1
[Bug middle-end/50074] [4.7 Regression] gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50074 Andreas Krebbel krebbel at gcc dot gnu.org changed: What|Removed |Added CC||krebbel at gcc dot gnu.org --- Comment #9 from Andreas Krebbel krebbel at gcc dot gnu.org 2011-10-11 13:16:16 UTC --- I see the same on s390x. gcc.dg/sibcall-6.c starts failing with r176042.