[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #4 from linzj manjian2006 at gmail dot com ---
Further debug show this push op is gen by sched2 pass


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #5 from linzj manjian2006 at gmail dot com ---
No confirm yet!
(In reply to linzj from comment #4)
 Further debug show this push op is gen by sched2 pass


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #6 from linzj manjian2006 at gmail dot com ---
The push edx is gen by originally fop_sf_2_i387.

(insn 180 281 288 17 (set (reg:SF 9 st(1) [orig:153 D.227396 ] [153])
(mult:SF (float:SF (reg:SI 1 dx [160]))
(reg:SF 9 st(1) [orig:153 D.227396 ] [153])))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 671
{*fop_sf_2_i387}
 (nil))

in the split2 pass.


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #7 from linzj manjian2006 at gmail dot com ---
confirm that in csa pass:

(insn 288 281 289 17 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4 A8])
(reg:SI 1 dx [160]))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 64
{*pushsi2}
 (expr_list:REG_DEAD (reg:SI 1 dx [160])
(nil)))
(insn 289 288 290 17 (set (reg:SF 9 st(1) [orig:153 D.227396 ] [153])
(mult:SF (float:SF (mem:SI (reg/f:SI 7 sp) [0  S4 A8]))
(reg:SF 9 st(1) [orig:153 D.227396 ] [153])))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 671
{*fop_sf_2_i387}
 (nil))
(insn 290 289 273 17 (set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int 4 [0x4])))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 235
{*leasi}
 (nil))
...

(insn 200 264 259 17 (parallel [
(set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int 12 [0xc])))
(clobber (reg:CC 17 flags))
])
/home/linzj/src/u3/shell-git/core/WebCore/platform/graphics/IntSize.h:65 241
{*addsi_1}
 (expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_ARGS_SIZE (const_int 0 [0])
(nil
(jump_insn 259 200 260 17 (set (pc)
(label_ref 102)) 570 {jump}
 (nil)
 - 102)

is combined as

(insn 288 281 289 17 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4 A8])
(reg:SI 1 dx [160]))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 64
{*pushsi2}
 (expr_list:REG_DEAD (reg:SI 1 dx [160])
(nil)))
(insn 289 288 273 17 (set (reg:SF 9 st(1) [orig:153 D.227396 ] [153])
(mult:SF (float:SF (mem:SI (reg/f:SI 7 sp) [0  S4 A8]))
(reg:SF 9 st(1) [orig:153 D.227396 ] [153])))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 671
{*fop_sf_2_i387}
 (nil))
...

(insn 200 264 259 17 (parallel [
(set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int 16 [0x10])))
(clobber (reg:CC 17 flags))
])
/home/linzj/src/u3/shell-git/core/WebCore/platform/graphics/IntSize.h:65 241
{*addsi_1}
 (expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_ARGS_SIZE (const_int 0 [0])
(nil
(jump_insn 259 200 260 17 (set (pc)
(label_ref 102)) 570 {jump}
 (nil)
 - 102)


12 + 4 - 4 - 12 is changed to 12 + 4 - 16
but REG_ARGS_SIZE is forgotten here.


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #8 from linzj manjian2006 at gmail dot com ---
Okay let me sum it up:
at first the code looks like this
call xxx: .cfa 92
float ops
add sp 12 .cfa 80

And then split2 splits the float ops,then it looks like this
call xxx: .cfa 92
push edx
float ops2
add sp 4
...
add sp 12 .cfa 80

Note that the split code has a sp ops but no cfa notes.
And then cfa feels that's ugly,it changes the code to
call xxx : .cfa 92
push edx
float ops2
...
add sp 16 .cfa 80

And then jump2 finds another branch also has an add sp 16 .cfa 80,so the
combination has occurred:
call xxx :.cfa 92
push edx
float ops2
...
label jump_from_other_branch ( (hasRelativeWidth || hasRelativeHeight) == true
)
add sp 16 .cfa 80


then dwarf2cfi.c will first find the add sp 16 .cfa 80 row has cfa 92 coming
first,and then cfa 96.


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #9 from linzj manjian2006 at gmail dot com ---
I have tried to modify i386.c to make
ix86_force_to_memoryix86_free_from_memory to generate frame related insn.That
causes another problem.Seems the only way to go is have a look at jump2.

The another problem:
ARGS_SIZE 12   .cfa_offset 12
push xxx   .cfa_offset 16
...
ARGS_SIZE 0.cfa_offset 4

see?There is an orphan 4!


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #10 from linzj manjian2006 at gmail dot com ---
Adding a -fno-crossjumping compile flag stops the assertion.


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-07 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-03-07
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #11 from Jakub Jelinek jakub at gcc dot gnu.org ---
Reduced testcase for -Os -m32 -fomit-frame-pointer:

struct A { int a; };
struct B { A foo (); };
struct C { B *foo (); };
int foo (struct C *, float);
void bar (struct C *);
void baz (struct A *);
int a, b, c;

int
foo (struct C *y, float x)
{
  struct A d;
  if (c)
bar (y);
  else
{
  C g;
  g.foo ()-foo ();
  a = b;
  d.a = (int) (b * x);
}
  baz (d);
}

Started with r205498.


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-05 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #1 from linzj manjian2006 at gmail dot com ---
Created attachment 32282
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32282action=edit
source that causes bug


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-05 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #2 from linzj manjian2006 at gmail dot com ---
reedit the cfg.
   if (hasRelativeWidth || hasRelativeHeight)
 true   false
 /  \
/\ 
   /  \
 ......
call availableWidth()   call size() this function returns a 
structure,which matches call_pop  
.cfa_offset 96  .cfa_offset 92
 \   push edx (should has a REG_ARGS_SIZE 16 here,
  \  but csa eliminates it)
   \(inlined functions are expanded here)
\   /
 \ /
  \   /
 add 16,%esp


[Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575

2014-03-05 Thread manjian2006 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #3 from linzj manjian2006 at gmail dot com ---
pass 221r.varstack,the pass just before 222r.csa

call_pop insn :
(call_insn:TI 143 141 393 18 (parallel [
(call (mem:QI (mem/f:SI (plus:SI (reg/f:SI 1 dx [orig:126
D.230300_12-_vptr.ImageD.43529 ] [126])
(const_int 44 [0x2c])) [2 MEM[(intD.4
(*__vtbl_ptr_typeD.2114) () *)D.230301_13 + 44B]+0 S4 A32]) [0
*OBJ_TYPE_REF(D.230303_15;D.230300_12-11) S1 A8])
(const_int 8 [0x8]))
(set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int 4 [0x4])))
])
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:96 482
{*call_pop}
 (expr_list:REG_DEAD (reg/f:SI 1 dx [orig:126
D.230300_12-_vptr.ImageD.43529 ] [126])
(expr_list:REG_ARGS_SIZE (const_int -4 [0xfffc])
(nil)))
(expr_list:REG_BR_PRED (use (mem/f:SI (reg/f:SI 7 sp) [0 S4 A32]))
(expr_list:REG_BR_PRED (use (mem/f:SI (plus:SI (reg/f:SI 7 sp)
(const_int 4 [0x4])) [0 S4 A32]))
(nil


REG_ARGS_SIZE -4
...


(insn:TI 300 299 261 18 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0 S4 A8])
(reg:SI 0 ax))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:96 39
{*pushsi2}
 (expr_list:REG_DEAD (reg:SI 0 ax)
(expr_list:REG_ARGS_SIZE (const_int 0 [0])
(nil

REG_ARGS_SIZE 0

The note is correct.

222r.csa :

...
call_pop insn
(call_insn 157 156 265 17 (parallel [
(call (mem:QI (mem/f:SI (plus:SI (reg/f:SI 1 dx [orig:147
_16-_vptr.ImageD.43337 ] [147])
(const_int 44 [0x2c])) [3 MEM[(intD.4
(*__vtbl_ptr_typeD.1815) () *)_17 + 44B]+0 S4 A32]) [0 *OBJ_TYPE_REF(_18;(const
struct ImageD.37456)_16-11) S1 A8])
(const_int 16 [0x10]))
(set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int 4 [0x4])))
])
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:96 579
{*call_pop}
 (expr_list:REG_DEAD (reg/f:SI 1 dx [orig:147 _16-_vptr.ImageD.43337 ]
[147])
(expr_list:REG_ARGS_SIZE (const_int 12 [0xc])
(nil)))


REG_ARGS_SIZE 12.

push insn:
(insn 288 281 289 17 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4 A8])
(reg:SI 1 dx [160]))
/home/linzj/src/u3/shell-git/core/WebCore/rendering/RenderImage.cpp:98 64
{*pushsi2}
 (expr_list:REG_DEAD (reg:SI 1 dx [160])
(nil)))

no note about REG_ARGS_SIZE.