public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/54133] New: regrename introduces additional dependencies
@ 2012-07-31  6:59 amker.cheng at gmail dot com
  2012-07-31  8:01 ` [Bug rtl-optimization/54133] " steven at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: amker.cheng at gmail dot com @ 2012-07-31  6:59 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54133
           Summary: regrename introduces additional dependencies
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: amker.cheng@gmail.com


With test program below:
typedef struct
{
    double X, Y;
} Point;

typedef struct
{
    Point p1;
    Point c1;
    Point c2;
    Point p2;
} Curve;


double bar(double t, double p0, double p1, double p2, double p3);
void foo( Curve *curve, int count )
{
    int n;
    int step;
    Point point;
    Curve c0;
    double t;
    for ( n = 0; n < count; ++n )
    {
        c0 = curve[n];

        for ( step = 0; step < (10); ++step )
        {
            t = ((double)(step)) / (double)(10);
            point.X = bar( t, c0.p1.X, c0.c1.X, c0.c2.X, c0.p2.X );
            point.Y = bar( t, c0.p1.Y, c0.c1.Y, c0.c2.Y, c0.p2.Y );
        }
    }
}

Compiled with command line:
arm-none-eabi-gcc -mthumb -mcpu=cortex-m0 -Os -frename-registers -S

The dump before and after regrenaming are like:
1. before regrename:
(insn 157 80 158 4 (set (reg:SI 4 r4 [180])
        (reg:SI 0 r0)) ../office_pointio.E:29 187 {*thumb1_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 0 r0)
        (nil)))

(insn 158 157 147 4 (set (reg:SI 5 r5 [+4 ])
        (reg:SI 1 r1 [+4 ])) ../office_pointio.E:29 187 {*thumb1_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 1 r1 [+4 ])
        (nil)))

(insn 147 158 83 4 (set (reg:DF 2 r2)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 40 [0x28])) [6 %sfp+-56 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 83 147 148 4 (set (mem:DF (reg/f:SI 13 sp) [0 S8 A64])
        (reg:DF 2 r2)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 148 83 84 4 (set (reg:DF 2 r2)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 56 [0x38])) [6 %sfp+-40 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 84 148 149 4 (set (mem:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 8 [0x8])) [0 S8 A64])
        (reg:DF 2 r2)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 149 84 85 4 (set (reg:DF 2 r2)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 72 [0x48])) [6 %sfp+-24 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 85 149 159 4 (set (mem:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 16 [0x10])) [0 S8 A64])
        (reg:DF 2 r2)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 159 85 160 4 (set (reg:SI 0 r0)
        (reg:SI 4 r4 [180])) ../office_pointio.E:30 187 {*thumb1_movsi_insn}
     (nil))

(insn 160 159 87 4 (set (reg:SI 1 r1 [+4 ])
        (reg:SI 5 r5 [+4 ])) ../office_pointio.E:30 187 {*thumb1_movsi_insn}
     (nil))

2. after regrename:
(insn 157 80 158 4 (set (reg:SI 4 r4 [180])
        (reg:SI 0 r0)) ../office_pointio.E:29 187 {*thumb1_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 0 r0)
        (nil)))

(insn 158 157 147 4 (set (reg:SI 5 r5 [+4 ])
        (reg:SI 1 r1 [+4 ])) ../office_pointio.E:29 187 {*thumb1_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 1 r1 [+4 ])
        (nil)))

(insn 147 158 83 4 (set (reg:DF 0 r0)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 40 [0x28])) [6 %sfp+-56 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 83 147 148 4 (set (mem:DF (reg/f:SI 13 sp) [0 S8 A64])
        (reg:DF 0 r0)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 148 83 84 4 (set (reg:DF 2 r2)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 56 [0x38])) [6 %sfp+-40 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 84 148 149 4 (set (mem:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 8 [0x8])) [0 S8 A64])
        (reg:DF 2 r2)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 149 84 85 4 (set (reg:DF 1 r1)
        (mem/c:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 72 [0x48])) [6 %sfp+-24 S8 A64]))
../office_pointio.E:30 205 {*thumb_movdf_insn}
     (nil))

(insn 85 149 159 4 (set (mem:DF (plus:SI (reg/f:SI 13 sp)
                (const_int 16 [0x10])) [0 S8 A64])
        (reg:DF 1 r1)) ../office_pointio.E:30 205 {*thumb_movdf_insn}
     (expr_list:REG_DEAD (reg:DF 2 r2)
        (nil)))

(insn 159 85 160 4 (set (reg:SI 0 r0)
        (reg:SI 4 r4 [180])) ../office_pointio.E:30 187 {*thumb1_movsi_insn}
     (nil))

(insn 160 159 87 4 (set (reg:SI 1 r1 [+4 ])
        (reg:SI 5 r5 [+4 ])) ../office_pointio.E:30 187 {*thumb1_movsi_insn}
     (nil))

renaming of r2 in chain(147/83) and chain(149/85) modified r0/r1, prevents insn
159/160 from deleting by hardreg_cprop/dce.


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

end of thread, other threads:[~2012-09-25  7:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31  6:59 [Bug rtl-optimization/54133] New: regrename introduces additional dependencies amker.cheng at gmail dot com
2012-07-31  8:01 ` [Bug rtl-optimization/54133] " steven at gcc dot gnu.org
2012-08-01  7:50 ` amker.cheng at gmail dot com
2012-08-01 10:14 ` steven at gcc dot gnu.org
2012-08-01 11:58 ` steven at gcc dot gnu.org
2012-08-01 13:49 ` amker.cheng at gmail dot com
2012-08-02  7:22 ` ebotcazou at gcc dot gnu.org
2012-08-02 10:18 ` amker.cheng at gmail dot com
2012-09-25  7:45 ` amker.cheng at gmail dot com

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