public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575
@ 2014-03-06  6:54 manjian2006 at gmail dot com
  2014-03-06  6:56 ` [Bug debug/60438] " manjian2006 at gmail dot com
                   ` (40 more replies)
  0 siblings, 41 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-06  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60438
           Summary: dwarf2cfi :2239 still assert,not the same cause as PR
                    59575
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manjian2006 at gmail dot com

This Bug is cause by csa pass.Which removes REG_ARGS_SIZE unexpectedly.
Let me show the cfg first:

                                            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
After the csa pass ,push edx's REG_ARGS_SIZE has gone.
And that further causes the assertion in dwarf2cfi.c:2339:

      /* We ought to have the same state incoming to a given trace no
     matter how we arrive at the trace.  Anything else means we've
     got some kind of optimization error.  */
      gcc_checking_assert (cfi_row_equal_p (cur_row, ti->beg_row));

gcc is configured as :
--target=i686-linux-android --host=x86_64-linux-gnu --build=x86_64-linux-gnu
--with-gnu-as --with-gnu-ld --enable-languages=c,c++
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--disable-libssp --enable-threads --disable-nls --disable-libmudflap
--disable-libgomp --disable-sjlj-exceptions --disable-tls --disable-libitm
--with-arch=i686 --with-tune=atom --with-fpmath=sse --enable-initfini-array
--disable-nls
--with-sysroot=/home/linzj/android-ndk-r8e/platforms/android-9/arch-x86
--disable-bootstrap --disable-libquadmath --enable-plugins --enable-libgomp
--enable-gold --enable-graphite=yes
--program-transform-name='s&^&i686-linux-android-&' --enable-gold=default
--disable-libcilkrts : (reconfigured) ../building/configure
--target=i686-linux-android --host=x86_64-linux-gnu --build=x86_64-linux-gnu
--with-gnu-as --with-gnu-ld --enable-languages=c,c++
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--disable-libssp --enable-threads --disable-nls --disable-libmudflap
--disable-libgomp --disable-sjlj-exceptions --disable-tls --disable-libitm
--with-arch=i686 --with-tune=atom --with-fpmath=sse --enable-initfini-array
--disable-nls
--with-sysroot=/home/linzj/android-ndk-r8e/platforms/android-9/arch-x86
--disable-bootstrap --disable-libquadmath --enable-plugins --enable-libgomp
--enable-gold --enable-graphite=yes
--program-transform-name='s&^&i686-linux-android-&' --enable-gold=default
--disable-libcilkrts

compile args:
-ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector
-fno-exceptions -fno-rtti -O2 -g -fomit-frame-pointer -fstrict-aliasing
-funswitch-loops -finline-limit=300 -gdwarf-2 -funwind-tables -fno-pic -fPIC
-fno-stack-protector -fvisibility=hidden -gdwarf-2 -funwind-tables -fno-pic
-fPIC -fno-stack-protector -fvisibility=hidden -fvisibility-inlines-hidden
-Wa,--noexecstack   -Os -Wreturn-type -Wuninitialized -c


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
@ 2014-03-06  6:56 ` manjian2006 at gmail dot com
  2014-03-06  6:59 ` manjian2006 at gmail dot com
                   ` (39 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-06  6:56 UTC (permalink / raw)
  To: gcc-bugs

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=32282&action=edit
source that causes bug


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
  2014-03-06  6:56 ` [Bug debug/60438] " manjian2006 at gmail dot com
@ 2014-03-06  6:59 ` manjian2006 at gmail dot com
  2014-03-06  7:37 ` manjian2006 at gmail dot com
                   ` (38 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-06  6:59 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
  2014-03-06  6:56 ` [Bug debug/60438] " manjian2006 at gmail dot com
  2014-03-06  6:59 ` manjian2006 at gmail dot com
@ 2014-03-06  7:37 ` manjian2006 at gmail dot com
  2014-03-07  8:53 ` manjian2006 at gmail dot com
                   ` (37 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-06  7:37 UTC (permalink / raw)
  To: gcc-bugs

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 [0xfffffffffffffffc])
            (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.


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (2 preceding siblings ...)
  2014-03-06  7:37 ` manjian2006 at gmail dot com
@ 2014-03-07  8:53 ` manjian2006 at gmail dot com
  2014-03-07  8:59 ` manjian2006 at gmail dot com
                   ` (36 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07  8:53 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (3 preceding siblings ...)
  2014-03-07  8:53 ` manjian2006 at gmail dot com
@ 2014-03-07  8:59 ` manjian2006 at gmail dot com
  2014-03-07  9:24 ` manjian2006 at gmail dot com
                   ` (35 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07  8:59 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (4 preceding siblings ...)
  2014-03-07  8:59 ` manjian2006 at gmail dot com
@ 2014-03-07  9:24 ` manjian2006 at gmail dot com
  2014-03-07  9:48 ` manjian2006 at gmail dot com
                   ` (34 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07  9:24 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (5 preceding siblings ...)
  2014-03-07  9:24 ` manjian2006 at gmail dot com
@ 2014-03-07  9:48 ` manjian2006 at gmail dot com
  2014-03-07 10:09 ` manjian2006 at gmail dot com
                   ` (33 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07  9:48 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (6 preceding siblings ...)
  2014-03-07  9:48 ` manjian2006 at gmail dot com
@ 2014-03-07 10:09 ` manjian2006 at gmail dot com
  2014-03-07 14:28 ` manjian2006 at gmail dot com
                   ` (32 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07 10:09 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (7 preceding siblings ...)
  2014-03-07 10:09 ` manjian2006 at gmail dot com
@ 2014-03-07 14:28 ` manjian2006 at gmail dot com
  2014-03-07 18:08 ` manjian2006 at gmail dot com
                   ` (31 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07 14:28 UTC (permalink / raw)
  To: gcc-bugs

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_memory&ix86_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!


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (8 preceding siblings ...)
  2014-03-07 14:28 ` manjian2006 at gmail dot com
@ 2014-03-07 18:08 ` manjian2006 at gmail dot com
  2014-03-07 22:05 ` jakub at gcc dot gnu.org
                   ` (30 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-07 18:08 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug debug/60438] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (9 preceding siblings ...)
  2014-03-07 18:08 ` manjian2006 at gmail dot com
@ 2014-03-07 22:05 ` jakub at gcc dot gnu.org
  2014-03-07 22:07 ` [Bug debug/60438] [4.9 Regression] " jakub at gcc dot gnu.org
                   ` (29 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-07 22:05 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (10 preceding siblings ...)
  2014-03-07 22:05 ` jakub at gcc dot gnu.org
@ 2014-03-07 22:07 ` jakub at gcc dot gnu.org
  2014-03-08  2:59 ` manjian2006 at gmail dot com
                   ` (28 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-07 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0
            Summary|dwarf2cfi :2239 still       |[4.9 Regression] dwarf2cfi
                   |assert,not the same cause   |:2239 still assert,not the
                   |as PR 59575                 |same cause as PR 59575


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (11 preceding siblings ...)
  2014-03-07 22:07 ` [Bug debug/60438] [4.9 Regression] " jakub at gcc dot gnu.org
@ 2014-03-08  2:59 ` manjian2006 at gmail dot com
  2014-03-08  6:33 ` manjian2006 at gmail dot com
                   ` (27 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-08  2:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from linzj <manjian2006 at gmail dot com> ---
I have never known that regression is such a useful resort.

(In reply to Jakub Jelinek from comment #11)
> 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.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (12 preceding siblings ...)
  2014-03-08  2:59 ` manjian2006 at gmail dot com
@ 2014-03-08  6:33 ` manjian2006 at gmail dot com
  2014-03-08  6:42 ` manjian2006 at gmail dot com
                   ` (26 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-08  6:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from linzj <manjian2006 at gmail dot com> ---
Thank Jakub for the short test case and the revision.
Before revision 205498,the prologue is:
(insn/f:TI 77 78 79 2 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -36 [0xffffffffffffffdc])))
            (clobber (reg:CC 17 flags))
            (clobber (mem:BLK (scratch) [0  A8]))
        ]) 1.cpp:11 798 {pro_epilogue_adjust_stack_si_add}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))
Then r205498:
(insn/f:TI 75 76 77 2 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -40 [0xffffffffffffffd8])))
            (clobber (reg:CC 17 flags))
            (clobber (mem:BLK (scratch) [0  A8]))
        ]) 1.cpp:11 798 {pro_epilogue_adjust_stack_si_add}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -40 [0xffffffffffffffd8])))

See the added REG_CFA_ADJUST_CFA?,that make the cur_cfa->reg ==
dw_stack_pointer_regnum.Before r205498,without this expr,cur_cfa->reg ==
dw_frame_pointer_regnum.

And we can see r205498 actually makes the data looks right.Because we have
omitted the frame pointer, so cur_cfa->reg == dw_frame_pointer_regnum makes no
sense.So the real problem is still the jump2 pass.It should never cross jump
between two blocks without the same REG_ARGS_SIZE.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (13 preceding siblings ...)
  2014-03-08  6:33 ` manjian2006 at gmail dot com
@ 2014-03-08  6:42 ` manjian2006 at gmail dot com
  2014-03-08 10:04 ` manjian2006 at gmail dot com
                   ` (25 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-08  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from linzj <manjian2006 at gmail dot com> ---
Somebody may ask why the modification of cur_cfa->reg will finally trigger
assertion failure.Checkout out notice_args_size in dwarf2cfi.c:
  /* If the CFA is computed off the stack pointer, then we must adjust
     the computation of the CFA as well.  */
  if (cur_cfa->reg == dw_stack_pointer_regnum)
    {
      gcc_assert (!cur_cfa->indirect);

      /* Convert a change in args_size (always a positive in the
     direction of stack growth) to a change in stack pointer.  */
#ifndef STACK_GROWS_DOWNWARD
      delta = -delta;
#endif
      cur_cfa->offset += delta;
    }
See? Only when cur_cfa->reg == dw_stack_pointer_regnum,can we do
cur_cfa->offset += delta.The bug won't be triggered,because all the argument
sizes are ignored.
(The mismatch of the argument sizes causes this bug.)
So before r205498,omitting the frame pointer may result in a wrong dwarf2
output.

(In reply to linzj from comment #13)
> Thank Jakub for the short test case and the revision.
> Before revision 205498,the prologue is:
> (insn/f:TI 77 78 79 2 (parallel [
>             (set (reg/f:SI 7 sp)
>                 (plus:SI (reg/f:SI 7 sp)
>                     (const_int -36 [0xffffffffffffffdc])))
>             (clobber (reg:CC 17 flags))
>             (clobber (mem:BLK (scratch) [0  A8]))
>         ]) 1.cpp:11 798 {pro_epilogue_adjust_stack_si_add}
>      (expr_list:REG_UNUSED (reg:CC 17 flags)
>         (nil)))
> Then r205498:
> (insn/f:TI 75 76 77 2 (parallel [
>             (set (reg/f:SI 7 sp)
>                 (plus:SI (reg/f:SI 7 sp)
>                     (const_int -40 [0xffffffffffffffd8])))
>             (clobber (reg:CC 17 flags))
>             (clobber (mem:BLK (scratch) [0  A8]))
>         ]) 1.cpp:11 798 {pro_epilogue_adjust_stack_si_add}
>      (expr_list:REG_UNUSED (reg:CC 17 flags)
>         (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp)
>                 (plus:SI (reg/f:SI 7 sp)
>                     (const_int -40 [0xffffffffffffffd8])))
> 
> See the added REG_CFA_ADJUST_CFA?,that make the cur_cfa->reg ==
> dw_stack_pointer_regnum.Before r205498,without this expr,cur_cfa->reg ==
> dw_frame_pointer_regnum.
> 
> And we can see r205498 actually makes the data looks right.Because we have
> omitted the frame pointer, so cur_cfa->reg == dw_frame_pointer_regnum makes
> no sense.So the real problem is still the jump2 pass.It should never cross
> jump between two blocks without the same REG_ARGS_SIZE.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (14 preceding siblings ...)
  2014-03-08  6:42 ` manjian2006 at gmail dot com
@ 2014-03-08 10:04 ` manjian2006 at gmail dot com
  2014-03-08 10:43 ` manjian2006 at gmail dot com
                   ` (24 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-08 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from linzj <manjian2006 at gmail dot com> ---
      dir = merge_dir (dir, old_insns_match_p (0, i1, i2));
      if (dir == dir_none || (!dir_p && dir != dir_both))
    break;
    {
      print_rtl_single (stdout, i1);
      print_rtl_single (stdout, i2);
      printf ("dir = %d\n",dir);
    }
outputs:
(insn 14 13 53 3 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int 16 [0x10])))
            (clobber (reg:CC 17 flags))
        ]) 1.cpp:14 241 {*addsi_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_ARGS_SIZE (const_int 0 [0])
            (nil))))
(insn 38 55 39 4 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int 16 [0x10])))
            (clobber (reg:CC 17 flags))
        ]) 241 {*addsi_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_ARGS_SIZE (const_int 0 [0])
            (nil))))
dir = 1

That's exactly what should not be merged.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (15 preceding siblings ...)
  2014-03-08 10:04 ` manjian2006 at gmail dot com
@ 2014-03-08 10:43 ` manjian2006 at gmail dot com
  2014-03-09  0:03 ` rth at gcc dot gnu.org
                   ` (23 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-08 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from linzj <manjian2006 at gmail dot com> ---
I have dodged this bug by the following patch:
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 77196ee..d7c2b1e 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1106,20 +1106,7 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1,
rtx i2)
   /* ??? Do not allow cross-jumping between different stack levels.  */
   p1 = find_reg_note (i1, REG_ARGS_SIZE, NULL);
   p2 = find_reg_note (i2, REG_ARGS_SIZE, NULL);
-  if (p1 && p2)
-    {
-      p1 = XEXP (p1, 0);
-      p2 = XEXP (p2, 0);
-      if (!rtx_equal_p (p1, p2))
-        return dir_none;
-
-      /* ??? Worse, this adjustment had better be constant lest we
-         have differing incoming stack levels.  */
-      if (!frame_pointer_needed
-          && find_args_size_adjust (i1) == HOST_WIDE_INT_MIN)
-    return dir_none;
-    }
-  else if (p1 || p2)
+  if (p1 || p2)
     return dir_none;

   p1 = PATTERN (i1);


I don't expect this patch used formally though.It's just a dodge.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (16 preceding siblings ...)
  2014-03-08 10:43 ` manjian2006 at gmail dot com
@ 2014-03-09  0:03 ` rth at gcc dot gnu.org
  2014-03-09  2:23 ` manjian2006 at gmail dot com
                   ` (22 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-09  0:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #17 from Richard Henderson <rth at gcc dot gnu.org> ---
The REG_ARGS_SIZE notes are a red-herring.

The bug is that 

(insn:TI 66 61 31 4 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4 A8])
        (reg:SI 0 ax [orig:85 D.1918 ] [85])) z.c:21 66 {*pushsi2}
     (nil))

as noted above created by split2, is not processed by the dwarf2cfi
code at all, and so its stack adjustment is lost entirely.  Thus when
we remove its adjustment later, we wind up with the wrong answer and
that leads directly to the abort.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (17 preceding siblings ...)
  2014-03-09  0:03 ` rth at gcc dot gnu.org
@ 2014-03-09  2:23 ` manjian2006 at gmail dot com
  2014-03-09  4:10 ` rth at gcc dot gnu.org
                   ` (21 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09  2:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #17)
> The REG_ARGS_SIZE notes are a red-herring.
> 
> The bug is that 
> 
> (insn:TI 66 61 31 4 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [0  S4 A8])
>         (reg:SI 0 ax [orig:85 D.1918 ] [85])) z.c:21 66 {*pushsi2}
>      (nil))
> 
> as noted above created by split2, is not processed by the dwarf2cfi
> code at all, and so its stack adjustment is lost entirely.  Thus when
> we remove its adjustment later, we wind up with the wrong answer and
> that leads directly to the abort.

Hi rth,
you are right,I have been distracted.And I have tried to fix this in i386.c 
ix86_force_to_memory& ix86_free_from_memory,but fail.
The split is defined as follow:

(define_split
  [(set (match_operand 0 "register_operand")
    (match_operator 3 "binary_fp_operator"
       [(float (match_operand:SWI24 1 "register_operand"))
        (match_operand 2 "register_operand")]))]
  "reload_completed
   && X87_FLOAT_MODE_P (GET_MODE (operands[0]))
   && X87_ENABLE_FLOAT (GET_MODE (operands[0]), GET_MODE (operands[1]))"
  [(const_int 0)]
{
  operands[4] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]);
  operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[4]);
  emit_insn (gen_rtx_SET (VOIDmode, operands[0],
              gen_rtx_fmt_ee (GET_CODE (operands[3]),
                      GET_MODE (operands[3]),
                      operands[4],
                      operands[2])));
  ix86_free_from_memory (GET_MODE (operands[1]));
  DONE;
})

in i386.md:13640


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (18 preceding siblings ...)
  2014-03-09  2:23 ` manjian2006 at gmail dot com
@ 2014-03-09  4:10 ` rth at gcc dot gnu.org
  2014-03-09  5:37 ` manjian2006 at gmail dot com
                   ` (20 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-09  4:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Richard Henderson <rth at gcc dot gnu.org> ---
Created attachment 32311
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32311&action=edit
proposed patch

Running full tests on this overnight, but it fixes the ICE.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (19 preceding siblings ...)
  2014-03-09  4:10 ` rth at gcc dot gnu.org
@ 2014-03-09  5:37 ` manjian2006 at gmail dot com
  2014-03-09 10:23 ` manjian2006 at gmail dot com
                   ` (19 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09  5:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #19)
> Created attachment 32311 [details]
> proposed patch
> 
> Running full tests on this overnight, but it fixes the ICE.

Oh, It never comes to me that both setting the insn frame related & adding a
argument note.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (20 preceding siblings ...)
  2014-03-09  5:37 ` manjian2006 at gmail dot com
@ 2014-03-09 10:23 ` manjian2006 at gmail dot com
  2014-03-09 10:25 ` manjian2006 at gmail dot com
                   ` (18 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09 10:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #19)
> Created attachment 32311 [details]
> proposed patch
> 
> Running full tests on this overnight, but it fixes the ICE.

It just pass the tests & fixes the ICE.But it also generates worse code.cfa
pass does not combine the last pop insn with sp restoring insn!


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (21 preceding siblings ...)
  2014-03-09 10:23 ` manjian2006 at gmail dot com
@ 2014-03-09 10:25 ` manjian2006 at gmail dot com
  2014-03-09 10:29 ` manjian2006 at gmail dot com
                   ` (17 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #19)
> Created attachment 32311 [details]
> proposed patch
> 
> Running full tests on this overnight, but it fixes the ICE.

If you just want to pass the tests,you may use mine patch.It just make jump2
not so aggressive when meeting two insn both have that note.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (22 preceding siblings ...)
  2014-03-09 10:25 ` manjian2006 at gmail dot com
@ 2014-03-09 10:29 ` manjian2006 at gmail dot com
  2014-03-09 15:02 ` manjian2006 at gmail dot com
                   ` (16 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #19)
> Created attachment 32311 [details]
> proposed patch
> 
> Running full tests on this overnight, but it fixes the ICE.

I try to remove the following hunk from you patch,it compiles Jakub's testcase
right.Not run the full tests yet.
diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
index 69fd5ea..5abec30 100644
--- a/gcc/combine-stack-adj.c
+++ b/gcc/combine-stack-adj.c
@@ -454,6 +454,14 @@ combine_stack_adjustments_for_block (basic_block bb)
            {
              HOST_WIDE_INT this_adjust = INTVAL (XEXP (src, 1));

+              /* It's quite tricky to adjust the notes associated
+                with frame related insns.  */
+             if (RTX_FRAME_RELATED_P (insn))
+               {
+                 last2_sp_set = last_sp_set = NULL;
+                 continue;
+               }
+
              /* If we've not seen an adjustment previously, record
                 it now and continue.  */
              if (! last_sp_set)


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (23 preceding siblings ...)
  2014-03-09 10:29 ` manjian2006 at gmail dot com
@ 2014-03-09 15:02 ` manjian2006 at gmail dot com
  2014-03-10 10:18 ` jakub at gcc dot gnu.org
                   ` (15 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-09 15:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from linzj <manjian2006 at gmail dot com> ---
        === gcc Summary ===

# of expected passes        102183
# of expected failures        251
# of unsupported tests        1322

This is the result after removing the methioned hunk.Seems okay for me.
make check-c


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (24 preceding siblings ...)
  2014-03-09 15:02 ` manjian2006 at gmail dot com
@ 2014-03-10 10:18 ` jakub at gcc dot gnu.org
  2014-03-10 11:04 ` manjian2006 at gmail dot com
                   ` (14 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-10 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to linzj from comment #23)
> (In reply to Richard Henderson from comment #19)
> > Created attachment 32311 [details]
> > proposed patch
> > 
> > Running full tests on this overnight, but it fixes the ICE.
> 
> I try to remove the following hunk from you patch,it compiles Jakub's
> testcase right.Not run the full tests yet.
> diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
> index 69fd5ea..5abec30 100644
> --- a/gcc/combine-stack-adj.c
> +++ b/gcc/combine-stack-adj.c
> @@ -454,6 +454,14 @@ combine_stack_adjustments_for_block (basic_block bb)
>             {
>               HOST_WIDE_INT this_adjust = INTVAL (XEXP (src, 1));
>  
> +              /* It's quite tricky to adjust the notes associated
> +                with frame related insns.  */
> +             if (RTX_FRAME_RELATED_P (insn))
> +               {
> +                 last2_sp_set = last_sp_set = NULL;
> +                 continue;
> +               }
> +
>               /* If we've not seen an adjustment previously, record
>                  it now and continue.  */
>               if (! last_sp_set)

Perhaps we can handle some most common cases of frame related insns (e.g. if
both have REG_CFA_ADJUST_CFA notes, etc.), perhaps it would be worth it to run
a bootstrap which would log when the above hunk prevented some merging and
append both insns to some /tmp/ file across whole bootstrap, then we could see
what is common enough to care about.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (25 preceding siblings ...)
  2014-03-10 10:18 ` jakub at gcc dot gnu.org
@ 2014-03-10 11:04 ` manjian2006 at gmail dot com
  2014-03-10 11:32 ` jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-10 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #26 from linzj <manjian2006 at gmail dot com> ---
(In reply to Jakub Jelinek from comment #25)
> Perhaps we can handle some most common cases of frame related insns (e.g. if
> both have REG_CFA_ADJUST_CFA notes, etc.), perhaps it would be worth it to
> run a bootstrap which would log when the above hunk prevented some merging
> and append both insns to some /tmp/ file across whole bootstrap, then we
> could see what is common enough to care about.

Hi,Jakub,I remove the hunk, because I want some merging happen,not prevent it
from.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (26 preceding siblings ...)
  2014-03-10 11:04 ` manjian2006 at gmail dot com
@ 2014-03-10 11:32 ` jakub at gcc dot gnu.org
  2014-03-10 13:03 ` manjian2006 at gmail dot com
                   ` (12 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-10 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #25)
> Perhaps we can handle some most common cases of frame related insns (e.g. if
> both have REG_CFA_ADJUST_CFA notes, etc.), perhaps it would be worth it to
> run a bootstrap which would log when the above hunk prevented some merging
> and append both insns to some /tmp/ file across whole bootstrap, then we
> could see what is common enough to care about.

Wonder if we just shouldn't pass the other insn (the one we'd like to delete)
to
try_apply_stack_adjustment and if either of them is frame related insn, check
harder to see if we can handle it or give up if we can't handle it.
At least merging of a frame related stack adjustment and following non-frame
related one (or vice versa?) is I think very common.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (27 preceding siblings ...)
  2014-03-10 11:32 ` jakub at gcc dot gnu.org
@ 2014-03-10 13:03 ` manjian2006 at gmail dot com
  2014-03-10 19:23 ` rth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-10 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #28 from linzj <manjian2006 at gmail dot com> ---
(In reply to Jakub Jelinek from comment #27)
> Wonder if we just shouldn't pass the other insn (the one we'd like to
> delete) to
> try_apply_stack_adjustment and if either of them is frame related insn,
> check harder to see if we can handle it or give up if we can't handle it.
> At least merging of a frame related stack adjustment and following non-frame
> related one (or vice versa?) is I think very common.

I think the final solution will both a fulfillment of dwarf2cfi & csa & jump2.
That is csa is able to combine the stack operations,jump2 is able to find the
common insn in ends of blocks,and dwarf2cfi is able to get the correct input
data.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (28 preceding siblings ...)
  2014-03-10 13:03 ` manjian2006 at gmail dot com
@ 2014-03-10 19:23 ` rth at gcc dot gnu.org
  2014-03-10 19:26 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-10 19:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #29 from Richard Henderson <rth at gcc dot gnu.org> ---
linj, that hunk is required.  It's easy to produce a difference ICE
without it.  I believe that even this pr's test case with -fno-crossjumping
is enough to trigger the different ICE.

Jakub, it's way more difficult to merge these notes than one might think.
Primarily because CSA hasn't done full CFA analysis.  It might be possible
to merge two REG_CFA_ADJUST_CFA relatively easily.  But I'm not really sure
how common that is.  Certainly it didn't happen in this test case at all.

I think at this point, any such optimization will have to wait for stage1.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (29 preceding siblings ...)
  2014-03-10 19:23 ` rth at gcc dot gnu.org
@ 2014-03-10 19:26 ` jakub at gcc dot gnu.org
  2014-03-10 20:51 ` rth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-10 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #30 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Henderson from comment #29)
> linj, that hunk is required.  It's easy to produce a difference ICE
> without it.  I believe that even this pr's test case with -fno-crossjumping
> is enough to trigger the different ICE.
> 
> Jakub, it's way more difficult to merge these notes than one might think.
> Primarily because CSA hasn't done full CFA analysis.  It might be possible
> to merge two REG_CFA_ADJUST_CFA relatively easily.  But I'm not really sure
> how common that is.  Certainly it didn't happen in this test case at all.
> 
> I think at this point, any such optimization will have to wait for stage1.

I'll try to gather some statistics on the combine-stack-adj.c hunk alone
tomorrow.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (30 preceding siblings ...)
  2014-03-10 19:26 ` jakub at gcc dot gnu.org
@ 2014-03-10 20:51 ` rth at gcc dot gnu.org
  2014-03-11 15:12 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-10 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #31 from Richard Henderson <rth at gcc dot gnu.org> ---
FWIW, I finished bootstrap and test with -m32 -Os -fomit-frame-pointer.

Jakub, let me know the results of your frequency testing.  I'll delay
committing the patch until I return home on Wednesday.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (31 preceding siblings ...)
  2014-03-10 20:51 ` rth at gcc dot gnu.org
@ 2014-03-11 15:12 ` jakub at gcc dot gnu.org
  2014-03-12 17:25 ` rth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-11 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #32 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ok, I've done an --enable-checking=yes,rtl bootstrap on x86_64-linux and
i686-linux, and collected statistics without your patch, but with:
--- gcc/combine-stack-adj.c.jj    2014-02-06 17:37:02.173062234 +0100
+++ gcc/combine-stack-adj.c    2014-03-11 12:43:26.472118796 +0100
@@ -82,7 +82,7 @@ static rtx single_set_for_csa (rtx);
 static void free_csa_reflist (struct csa_reflist *);
 static struct csa_reflist *record_one_stack_ref (rtx, rtx *,
                          struct csa_reflist *);
-static int try_apply_stack_adjustment (rtx, struct csa_reflist *,
+static int try_apply_stack_adjustment (rtx, rtx, struct csa_reflist *,
                        HOST_WIDE_INT, HOST_WIDE_INT);
 static void combine_stack_adjustments_for_block (basic_block);
 static int record_stack_refs (rtx *, void *);
@@ -194,7 +194,7 @@ record_one_stack_ref (rtx insn, rtx *ref
    on success.  */

 static int
-try_apply_stack_adjustment (rtx insn, struct csa_reflist *reflist,
+try_apply_stack_adjustment (rtx insn, rtx other, struct csa_reflist *reflist,
                 HOST_WIDE_INT new_adjust, HOST_WIDE_INT delta)
 {
   struct csa_reflist *ml;
@@ -230,6 +230,16 @@ try_apply_stack_adjustment (rtx insn, st
       for (ml = reflist; ml ; ml = ml->next)
     ml->sp_offset -= delta;

+if (RTX_FRAME_RELATED_P (insn) || RTX_FRAME_RELATED_P (other))
+{
+FILE *f = fopen ("/tmp/csa", "a");
+fprintf (f, "@@-@@ %s %d ", main_input_filename ? main_input_filename : "-",
(int) BITS_PER_WORD);
+print_inline_rtx (f, insn, 0);
+fprintf (f, "\n*** ");
+print_inline_rtx (f, other, 0);
+fprintf (f, "\n");
+fclose (f);
+}
       return 1;
     }
   else
@@ -487,7 +497,7 @@ combine_stack_adjustments_for_block (bas
           /* Combine an allocation into the first instruction.  */
           if (STACK_GROWS_DOWNWARD ? this_adjust <= 0 : this_adjust >= 0)
         {
-          if (try_apply_stack_adjustment (last_sp_set, reflist,
+          if (try_apply_stack_adjustment (last_sp_set, insn, reflist,
                           last_sp_adjust + this_adjust,
                           this_adjust))
             {
@@ -504,7 +514,7 @@ combine_stack_adjustments_for_block (bas
           else if (STACK_GROWS_DOWNWARD
                ? last_sp_adjust >= 0 : last_sp_adjust <= 0)
         {
-          if (try_apply_stack_adjustment (insn, reflist,
+          if (try_apply_stack_adjustment (insn, last_sp_set, reflist,
                           last_sp_adjust + this_adjust,
                           -last_sp_adjust))
             {
@@ -526,6 +536,16 @@ combine_stack_adjustments_for_block (bas
         {
           if (last_sp_adjust == 0)
             {
+if (RTX_FRAME_RELATED_P (insn) || RTX_FRAME_RELATED_P (last_sp_set))
+{
+FILE *f = fopen ("/tmp/csa", "a");
+fprintf (f, "@@-@@2 %s %d ", main_input_filename ? main_input_filename : "-",
(int) BITS_PER_WORD);
+print_inline_rtx (f, insn, 0);
+fprintf (f, "\n*** ");
+print_inline_rtx (f, last_sp_set, 0);
+fprintf (f, "\n");
+fclose (f);
+}
               maybe_move_args_size_note (insn, last_sp_set, true);
               delete_insn (last_sp_set);
             }
@@ -564,7 +584,7 @@ combine_stack_adjustments_for_block (bas
           && XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx
           && !reg_mentioned_p (stack_pointer_rtx, src)
           && memory_address_p (GET_MODE (dest), stack_pointer_rtx)
-          && try_apply_stack_adjustment (insn, reflist, 0,
+          && try_apply_stack_adjustment (insn, last_sp_set, reflist, 0,
                          -last_sp_adjust))
         {
           if (last2_sp_set)
@@ -598,6 +618,16 @@ combine_stack_adjustments_for_block (bas
     {
       if (last_sp_set && last_sp_adjust == 0)
         {
+if (RTX_FRAME_RELATED_P (insn) || RTX_FRAME_RELATED_P (last_sp_set))
+{
+FILE *f = fopen ("/tmp/csa", "a");
+fprintf (f, "@@-@@3 %s %d ", main_input_filename ? main_input_filename : "-",
(int) BITS_PER_WORD);
+print_inline_rtx (f, insn, 0);
+fprintf (f, "\n*** ");
+print_inline_rtx (f, last_sp_set, 0);
+fprintf (f, "\n");
+fclose (f);
+}
           force_move_args_size_note (bb, last2_sp_set, last_sp_set);
           delete_insn (last_sp_set);
         }
@@ -611,6 +641,14 @@ combine_stack_adjustments_for_block (bas

   if (last_sp_set && last_sp_adjust == 0)
     {
+if (RTX_FRAME_RELATED_P (last_sp_set))
+{
+FILE *f = fopen ("/tmp/csa", "a");
+fprintf (f, "@@-@@4 %s %d ", main_input_filename ? main_input_filename : "-",
(int) BITS_PER_WORD);
+print_inline_rtx (f, last_sp_set, 0);
+fprintf (f, "\n");
+fclose (f);
+}
       force_move_args_size_note (bb, last2_sp_set, last_sp_set);
       delete_insn (last_sp_set);
     }

The resulting file is too large to attach (316MB), but some statistics from it:
$ grep REG_CFA csa | sort | uniq -c | sort -n
    491             (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:DI 7 sp)
   1290             (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp)
   8071         (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:DI 7 sp)
 270194         (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp)
$ grep '^@@-@@[2-4]' csa
@@-@@3 cb1010c.adb 64 (insn 102 21 23 2 (set (reg:DI 4 si [112])
$ grep '^@@-@@ [^(]* 32 ' csa | wc -l
325080
$ grep '^@@-@@ [^(]* 64 ' csa | wc -l
8636

So, while perhaps for -m64 it isn't extremely important, for -m32 it affects
most of the code, the numbers are actual failures to combine some instructions
together caused by the combine-stack-adj.c hunk.

Now, looking at the issue, I believe it would be the first time when we'd use
RTX_FRAME_RELATED_P insns outside of prologues/epilogues, from what I
understand we inhibit various optimizations for it.  For any other stack
adjustments within function body we use REG_ARGS_SIZE notes, and e.g. the most
common typical CSA merging of frame related REG_CFA_ADJUST_CFA with some
following stack adjustments (I think usually that is stack adjustment so that
further argument pushes result in properly aligned stack for call) is done by
keeping the original REG_CFA_ADJUST_CFA amount note and then adding
REG_ARGS_SIZE note on the same insn for the remaining adjustment.

Thus, I'd say we don't want REG_CFA_* notes nor RTX_FRAME_RELATED_P on the
ix86_force_to_memory/ix86_free_from_memory generated stack adjustments, much
better would be to add REG_ARGS_SIZE notes to those.

Now, the problem with that is that REG_ARGS_SIZE is absolute amount, and in the
splitters we actually don't know what is the current REG_ARGS_SIZE depth at
that point.  So, either we'd need to force REG_ARGS_SIZE note even on the insns
that might be split with ix86_{force_to,free_from}_memory, or perhaps we could
introduce REG_ARGS_SIZE_DELTA note that would represent just relative
adjustment of the current REG_ARGS_SIZE amount. 
ix86_{force_to,free_from}_memory could then emit those notes, guess
haifa-sched.c would need to treat those notes the same as REG_ARGS_SIZE,
combine-stack-adj.c either would need to handle both the note kinds, or compute
similarly to dwarf2 pass the absolute args_size depth and transform the
relative notes into absolute ones first.
For the former, REG_ARGS_SIZE note followed by REG_ARGS_SIZE_DELTA note on the
second insn being merged together would result in the first REG_ARG_SIZE with
size incremented by the delta, REG_ARGS_SIZE_DELTA followed by REG_ARGS_SIZE
would result in the second note being kept unmodified, etc.

Thoughts?


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (32 preceding siblings ...)
  2014-03-11 15:12 ` jakub at gcc dot gnu.org
@ 2014-03-12 17:25 ` rth at gcc dot gnu.org
  2014-03-12 17:29 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-12 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #33 from Richard Henderson <rth at gcc dot gnu.org> ---
It sounds like inhibiting this stack combining would affect more
32-bit code than I'd like.

I don't like the idea of REG_ARGS_SIZE_DELTA.  The reason I went
with absolute values in the first place for REG_ARGS_SIZE is that
there were too many places where "deltas" matched up, but absolute
values did not.  And so we'd wind up cross-jumping illegally.

I wonder if the best fix is to change the patterns not to rely on
ix86_force_to_memory and ix86_free_from_memory, but instead have a
memory operand to clobber right from the start.  No fighting with
dwarf2 or unwind info after the fact at all.

I'll whip that up today and see what it looks like.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (33 preceding siblings ...)
  2014-03-12 17:25 ` rth at gcc dot gnu.org
@ 2014-03-12 17:29 ` jakub at gcc dot gnu.org
  2014-03-13  9:00 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-12 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #34 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Henderson from comment #33)
> It sounds like inhibiting this stack combining would affect more
> 32-bit code than I'd like.
> 
> I don't like the idea of REG_ARGS_SIZE_DELTA.  The reason I went
> with absolute values in the first place for REG_ARGS_SIZE is that
> there were too many places where "deltas" matched up, but absolute
> values did not.  And so we'd wind up cross-jumping illegally.
> 
> I wonder if the best fix is to change the patterns not to rely on
> ix86_force_to_memory and ix86_free_from_memory, but instead have a
> memory operand to clobber right from the start.  No fighting with
> dwarf2 or unwind info after the fact at all.
> 
> I'll whip that up today and see what it looks like.

Perhaps.  In this particular case I think it the r in a m,?r constraints, just
removing the ?r option probably would have done the job.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (34 preceding siblings ...)
  2014-03-12 17:29 ` jakub at gcc dot gnu.org
@ 2014-03-13  9:00 ` jakub at gcc dot gnu.org
  2014-03-13 20:25 ` rth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-13  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (35 preceding siblings ...)
  2014-03-13  9:00 ` jakub at gcc dot gnu.org
@ 2014-03-13 20:25 ` rth at gcc dot gnu.org
  2014-03-13 20:56 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: rth at gcc dot gnu.org @ 2014-03-13 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #35 from Richard Henderson <rth at gcc dot gnu.org> ---
Author: rth
Date: Thu Mar 13 20:24:56 2014
New Revision: 208556

URL: http://gcc.gnu.org/viewcvs?rev=208556&root=gcc&view=rev
Log:
PR debug/60438

        * config/i386/i386.c (ix86_split_fp_branch): Remove pushed argument.
        (ix86_force_to_memory, ix86_free_from_memory): Remove.
        * config/i386/i386-protos.h: Likewise.
        * config/i386/i386.md (floathi<X87MODEF>2): Use assign_386_stack_local
        in the expander instead of a splitter.
        (float<SWI48x><X87MODEF>2): Use assign_386_stack_local if there is
        any possibility of requiring a memory.
        (*floatsi<MODEF>2_vector_mixed): Remove, and the splitters.
        (*floatsi<MODEF>2_vector_sse): Remove, and the splitters.
        (fp branch splitters): Update for ix86_split_fp_branch.
        (*jcc<X87MODEF>_<SWI24>_i387): Remove r/f alternative.
        (*jcc<X87MODEF>_<SWI24>_r_i387): Likewise.
        (splitter for jcc<X87MODEF>_<SWI24>_i387 r/f): Remove.
        (*fop_<MODEF>_2_i387): Remove f/r alternative.
        (*fop_<MODEF>_3_i387): Likewise.
        (*fop_xf_2_i387, *fop_xf_3_i387): Likewise.
        (splitters for the fop_* register patterns): Remove.
        (fscalexf4_i387): Rename from *fscalexf4_i387.
        (ldexpxf3): Use gen_floatsixf2 and gen_fscalexf4_i387.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr60438-1.C
    trunk/gcc/testsuite/g++.dg/torture/pr60438-2.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-protos.h
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.md
    trunk/gcc/testsuite/ChangeLog


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (36 preceding siblings ...)
  2014-03-13 20:25 ` rth at gcc dot gnu.org
@ 2014-03-13 20:56 ` jakub at gcc dot gnu.org
  2014-03-18 13:08 ` bernd.edlinger at hotmail dot de
                   ` (2 subsequent siblings)
  40 siblings, 0 replies; 42+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-13 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thanks for the fix.


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (37 preceding siblings ...)
  2014-03-13 20:56 ` jakub at gcc dot gnu.org
@ 2014-03-18 13:08 ` bernd.edlinger at hotmail dot de
  2014-03-18 13:16 ` dominiq at lps dot ens.fr
  2014-03-18 15:10 ` manjian2006 at gmail dot com
  40 siblings, 0 replies; 42+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2014-03-18 13:08 UTC (permalink / raw)
  To: gcc-bugs

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

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #37 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Richard Henderson from comment #35)
> Author: rth
> Date: Thu Mar 13 20:24:56 2014
> New Revision: 208556
> 

Hi, this seems to have created a new regression:

FAIL: gcc.target/i386/excess-precision-3.c execution test


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (38 preceding siblings ...)
  2014-03-18 13:08 ` bernd.edlinger at hotmail dot de
@ 2014-03-18 13:16 ` dominiq at lps dot ens.fr
  2014-03-18 15:10 ` manjian2006 at gmail dot com
  40 siblings, 0 replies; 42+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-18 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #38 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Hi, this seems to have created a new regression:
>
> FAIL: gcc.target/i386/excess-precision-3.c execution test

pr60562


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

* [Bug debug/60438] [4.9 Regression] dwarf2cfi :2239 still assert,not the same cause as PR 59575
  2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
                   ` (39 preceding siblings ...)
  2014-03-18 13:16 ` dominiq at lps dot ens.fr
@ 2014-03-18 15:10 ` manjian2006 at gmail dot com
  40 siblings, 0 replies; 42+ messages in thread
From: manjian2006 at gmail dot com @ 2014-03-18 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #39 from linzj <manjian2006 at gmail dot com> ---
(In reply to Richard Henderson from comment #35)
thanks for the fix.


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

end of thread, other threads:[~2014-03-18 15:10 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06  6:54 [Bug debug/60438] New: dwarf2cfi :2239 still assert,not the same cause as PR 59575 manjian2006 at gmail dot com
2014-03-06  6:56 ` [Bug debug/60438] " manjian2006 at gmail dot com
2014-03-06  6:59 ` manjian2006 at gmail dot com
2014-03-06  7:37 ` manjian2006 at gmail dot com
2014-03-07  8:53 ` manjian2006 at gmail dot com
2014-03-07  8:59 ` manjian2006 at gmail dot com
2014-03-07  9:24 ` manjian2006 at gmail dot com
2014-03-07  9:48 ` manjian2006 at gmail dot com
2014-03-07 10:09 ` manjian2006 at gmail dot com
2014-03-07 14:28 ` manjian2006 at gmail dot com
2014-03-07 18:08 ` manjian2006 at gmail dot com
2014-03-07 22:05 ` jakub at gcc dot gnu.org
2014-03-07 22:07 ` [Bug debug/60438] [4.9 Regression] " jakub at gcc dot gnu.org
2014-03-08  2:59 ` manjian2006 at gmail dot com
2014-03-08  6:33 ` manjian2006 at gmail dot com
2014-03-08  6:42 ` manjian2006 at gmail dot com
2014-03-08 10:04 ` manjian2006 at gmail dot com
2014-03-08 10:43 ` manjian2006 at gmail dot com
2014-03-09  0:03 ` rth at gcc dot gnu.org
2014-03-09  2:23 ` manjian2006 at gmail dot com
2014-03-09  4:10 ` rth at gcc dot gnu.org
2014-03-09  5:37 ` manjian2006 at gmail dot com
2014-03-09 10:23 ` manjian2006 at gmail dot com
2014-03-09 10:25 ` manjian2006 at gmail dot com
2014-03-09 10:29 ` manjian2006 at gmail dot com
2014-03-09 15:02 ` manjian2006 at gmail dot com
2014-03-10 10:18 ` jakub at gcc dot gnu.org
2014-03-10 11:04 ` manjian2006 at gmail dot com
2014-03-10 11:32 ` jakub at gcc dot gnu.org
2014-03-10 13:03 ` manjian2006 at gmail dot com
2014-03-10 19:23 ` rth at gcc dot gnu.org
2014-03-10 19:26 ` jakub at gcc dot gnu.org
2014-03-10 20:51 ` rth at gcc dot gnu.org
2014-03-11 15:12 ` jakub at gcc dot gnu.org
2014-03-12 17:25 ` rth at gcc dot gnu.org
2014-03-12 17:29 ` jakub at gcc dot gnu.org
2014-03-13  9:00 ` jakub at gcc dot gnu.org
2014-03-13 20:25 ` rth at gcc dot gnu.org
2014-03-13 20:56 ` jakub at gcc dot gnu.org
2014-03-18 13:08 ` bernd.edlinger at hotmail dot de
2014-03-18 13:16 ` dominiq at lps dot ens.fr
2014-03-18 15:10 ` manjian2006 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).