Summary: | [4.3/4.4 regression] Invalid insn scheduling | ||
---|---|---|---|
Product: | gcc | Reporter: | Andreas Schwab <schwab> |
Component: | rtl-optimization | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.3.1 | ||
Target Milestone: | 4.3.3 | ||
Host: | Target: | powerpc64-*-* | |
Build: | Known to work: | 4.2.1 | |
Known to fail: | 4.3.1 4.4.0 | Last reconfirmed: | 2008-09-09 09:08:23 |
Attachments: | Testcase |
Description
Andreas Schwab
2008-09-07 16:47:31 UTC
Created attachment 16248 [details]
Testcase
Subject: Re: New: [4.3/4.4 regression] Invalid insn scheduling Sent from my iPhone On Sep 7, 2008, at 9:47, "schwab at suse dot de" <gcc-bugzilla@gcc.gnu.org > wrote: > This is broken during sched2 pass. Compiled with -m64 -O2. > > lwz 10,1492(7) # nargs, <--- uninitialized > std 9,1272(7) # specpdl.19, > li 9,16 # iftmp.21, > std 3,1488(7) # nargs, nargs > std 4,1496(7) # args, args > cmpwi 7,10,3 #, tmp307, > Just looking at the assembler suggest an aliasing issue. I had a quick look at the code but I did see anything would give an alaising issue. Though there were some unions. > > -- > Summary: [4.3/4.4 regression] Invalid insn scheduling > Product: gcc > Version: 4.3.1 > Status: UNCONFIRMED > Keywords: wrong-code > Severity: normal > Priority: P3 > Component: rtl-optimization > AssignedTo: unassigned at gcc dot gnu dot org > ReportedBy: schwab at suse dot de > GCC target triplet: powerpc64-*-* > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408 > The corresponding code line: register const unsigned char **new_argv = (const unsigned char **) __builtin_alloca ((((2) > (nargs - 2) ? (2) : (nargs - 2))) * sizeof (char *)); The alias set is the same: (insn:TI 2204 2201 78 pr37408.i:9124 (set (reg:DI 6 6) (zero_extend:DI (mem/c/i:SI (plus:DI (reg:DI 5 5 [6]) (const_int 1492 [0x5d4])) [5 nargs+4 S4 A64]))) 14 {*zero_extendsidi2_internal1} (nil)) (insn:TI 68 82 69 pr37408.i:9114 (set (mem/c/i:DI (plus:DI (reg:DI 5 5) (const_int 1488 [0x5d0])) [5 nargs+0 S4 A64]) (reg:DI 3 3 [ nargs+-4 ])) 337 {*movdi_internal64} (expr_list:REG_DEAD (reg:DI 3 3 [ nargs+-4 ]) (expr_list:REG_EQUIV (mem/c/i:DI (plus:DI (reg/f:DI 67 ap) (const_int 48 [0x30])) [5 nargs+0 S4 A64]) (nil)))) Perhaps MEM_SIZE in second insn (originally first) being only 32-bit and not 64-bit is the bug. Indeed, MEM_SIZE is the cause. --- gcc/function.c.jj 2008-09-08 09:33:51.000000000 +0200 +++ gcc/function.c 2008-09-09 10:59:15.000000000 +0200 @@ -2332,6 +2332,11 @@ assign_parm_find_stack_rtl (tree parm, s stack_parm = gen_rtx_MEM (data->promoted_mode, stack_parm); set_mem_attributes (stack_parm, parm, 1); + /* set_mem_attributes could set MEM_SIZE to the passed mode's size, + while promoted mode's size is needed. */ + if (data->promoted_mode != BLKmode + && data->promoted_mode != DECL_MODE (parm)) + set_mem_size (stack_parm, GEN_INT (GET_MODE_SIZE (data->promoted_mode))); boundary = data->locate.boundary; align = BITS_PER_UNIT; gives: @@ -159,13 +159,13 @@ Fcall_process: ld 9,0(9) # specpdl, ld 11,0(11) # specpdl_ptr, addis 5,31,0x1 #,, - lwz 6,1492(5) # nargs, - std 9,1272(5) # specpdl.19, - li 9,16 # iftmp.21, std 3,1488(5) # nargs, nargs std 4,1496(5) # args, args - cmpwi 7,6,3 #, tmp309, + std 9,1272(5) # specpdl.19, std 11,1280(5) # specpdl_ptr.17, + li 9,16 # iftmp.21, + lwz 6,1492(5) # nargs, + cmpwi 7,6,3 #, tmp309, ble 7,.L3 # addi 9,6,-2 # tmp310, tmp5, extsw 9,9 # tmp311, tmp310 Subject: Bug 37408 Author: jakub Date: Tue Sep 9 19:17:30 2008 New Revision: 140166 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140166 Log: PR rtl-optimization/37408 * function.c (assign_parm_find_stack_rtl): Set correct MEM_SIZE if parm is promoted. Modified: trunk/gcc/ChangeLog trunk/gcc/function.c Subject: Bug 37408 Author: jakub Date: Tue Sep 9 20:24:58 2008 New Revision: 140172 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140172 Log: PR rtl-optimization/37408 * function.c (assign_parm_find_stack_rtl): Set correct MEM_SIZE if parm is promoted. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/function.c Fixed. |