public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/37408]  New: [4.3/4.4 regression] Invalid insn scheduling
@ 2008-09-07 16:48 schwab at suse dot de
  2008-09-07 16:49 ` [Bug rtl-optimization/37408] " schwab at suse dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: schwab at suse dot de @ 2008-09-07 16:48 UTC (permalink / raw)
  To: gcc-bugs

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,


-- 
           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


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
@ 2008-09-07 16:49 ` schwab at suse dot de
  2008-09-07 20:09 ` [Bug rtl-optimization/37408] New: " Andrew Thomas Pinski
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schwab at suse dot de @ 2008-09-07 16:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from schwab at suse dot de  2008-09-07 16:48 -------
Created an attachment (id=16248)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16248&action=view)
Testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* Re: [Bug rtl-optimization/37408]  New: [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
  2008-09-07 16:49 ` [Bug rtl-optimization/37408] " schwab at suse dot de
@ 2008-09-07 20:09 ` Andrew Thomas Pinski
  2008-09-07 20:11 ` [Bug rtl-optimization/37408] " pinskia at gmail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Andrew Thomas Pinski @ 2008-09-07 20:09 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs



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
>


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
  2008-09-07 16:49 ` [Bug rtl-optimization/37408] " schwab at suse dot de
  2008-09-07 20:09 ` [Bug rtl-optimization/37408] New: " Andrew Thomas Pinski
@ 2008-09-07 20:11 ` pinskia at gmail dot com
  2008-09-07 20:30 ` schwab at suse dot de
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gmail dot com @ 2008-09-07 20:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gmail dot com  2008-09-07 20:10 -------
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
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (2 preceding siblings ...)
  2008-09-07 20:11 ` [Bug rtl-optimization/37408] " pinskia at gmail dot com
@ 2008-09-07 20:30 ` schwab at suse dot de
  2008-09-08 22:28 ` schwab at suse dot de
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schwab at suse dot de @ 2008-09-07 20:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from schwab at suse dot de  2008-09-07 20:29 -------
The corresponding code line:

  register const unsigned char **new_argv
    = (const unsigned char **) __builtin_alloca ((((2) > (nargs - 2) ? (2) :
(nargs - 2))) * sizeof (char *));


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (3 preceding siblings ...)
  2008-09-07 20:30 ` schwab at suse dot de
@ 2008-09-08 22:28 ` schwab at suse dot de
  2008-09-09  8:14 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schwab at suse dot de @ 2008-09-08 22:28 UTC (permalink / raw)
  To: gcc-bugs



-- 

schwab at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (4 preceding siblings ...)
  2008-09-08 22:28 ` schwab at suse dot de
@ 2008-09-09  8:14 ` jakub at gcc dot gnu dot org
  2008-09-09  9:09 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-09  8:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-09-09 08:12 -------
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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (5 preceding siblings ...)
  2008-09-09  8:14 ` jakub at gcc dot gnu dot org
@ 2008-09-09  9:09 ` jakub at gcc dot gnu dot org
  2008-09-09 19:20 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-09  9:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-09-09 09:08 -------
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


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-09 09:08:23
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (6 preceding siblings ...)
  2008-09-09  9:09 ` jakub at gcc dot gnu dot org
@ 2008-09-09 19:20 ` jakub at gcc dot gnu dot org
  2008-09-09 20:27 ` jakub at gcc dot gnu dot org
  2008-09-09 20:29 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-09 19:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-09-09 19:18 -------
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


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (7 preceding siblings ...)
  2008-09-09 19:20 ` jakub at gcc dot gnu dot org
@ 2008-09-09 20:27 ` jakub at gcc dot gnu dot org
  2008-09-09 20:29 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-09 20:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-09-09 20:26 -------
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


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

* [Bug rtl-optimization/37408] [4.3/4.4 regression] Invalid insn scheduling
  2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
                   ` (8 preceding siblings ...)
  2008-09-09 20:27 ` jakub at gcc dot gnu dot org
@ 2008-09-09 20:29 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-09 20:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2008-09-09 20:27 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37408


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

end of thread, other threads:[~2008-09-09 20:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-07 16:48 [Bug rtl-optimization/37408] New: [4.3/4.4 regression] Invalid insn scheduling schwab at suse dot de
2008-09-07 16:49 ` [Bug rtl-optimization/37408] " schwab at suse dot de
2008-09-07 20:09 ` [Bug rtl-optimization/37408] New: " Andrew Thomas Pinski
2008-09-07 20:11 ` [Bug rtl-optimization/37408] " pinskia at gmail dot com
2008-09-07 20:30 ` schwab at suse dot de
2008-09-08 22:28 ` schwab at suse dot de
2008-09-09  8:14 ` jakub at gcc dot gnu dot org
2008-09-09  9:09 ` jakub at gcc dot gnu dot org
2008-09-09 19:20 ` jakub at gcc dot gnu dot org
2008-09-09 20:27 ` jakub at gcc dot gnu dot org
2008-09-09 20:29 ` jakub 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).