[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-25 Thread pinskia at gmail dot com
--- Comment #8 from pinskia at gmail dot com 2010-08-25 12:43 --- Subject: Re: __builtin_expect and -Os generates stupid code On Aug 25, 2010, at 5:23 AM, "socketpair at gmail dot com" wrote: > > > --- Comment #7 from socketpair at gmail dot com 2010-08-25 > 12:23 --- >

Re: [Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-25 Thread Andrew Pinski
On Aug 25, 2010, at 5:23 AM, "socketpair at gmail dot com" > wrote: --- Comment #7 from socketpair at gmail dot com 2010-08-25 12:23 --- Well, I understand that problem is not in __builtin_expect. Should I open new, separate bug about block reordering and generating "jmp to

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-25 Thread socketpair at gmail dot com
--- Comment #7 from socketpair at gmail dot com 2010-08-25 12:23 --- Well, I understand that problem is not in __builtin_expect. Should I open new, separate bug about block reordering and generating "jmp to next line" ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-25 Thread pinskia at gcc dot gnu dot org
--- Comment #6 from pinskia at gcc dot gnu dot org 2010-08-25 11:24 --- Change: __asm__ volatile ("":::"memory"); To: __asm__ volatile ("#clobber mem":::"memory"); And you will see there is an instruction which GCC thinks is there. Again this has nothing to do with __builtin_expect exc

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-23 Thread socketpair at gmail dot com
--- Comment #5 from socketpair at gmail dot com 2010-08-24 03:35 --- > There is nothing the compiler can do really. Why ? I compared assembler listings with likely() swapped with unlikely(). As I suggest, it helps to choose between je and jne in each case, and other circumstances are not

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-23 Thread pinskia at gcc dot gnu dot org
--- Comment #4 from pinskia at gcc dot gnu dot org 2010-08-23 19:12 --- jne .L6 jmp .L7 .L8: #APP # 18 "t.c" 1 #mem # 0 "" 2 #NO_APP .L6: --- CUT --- I added #mem inside the inline-asm which is empty and got the above code. Which means that the inline-

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-19 Thread socketpair at gmail dot com
--- Comment #3 from socketpair at gmail dot com 2010-08-19 14:28 --- Created an attachment (id=21521) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21521&action=view) without buggy jmp -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-19 Thread socketpair at gmail dot com
--- Comment #2 from socketpair at gmail dot com 2010-08-19 14:28 --- Created an attachment (id=21520) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21520&action=view) with stupid jmp -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45340

[Bug tree-optimization/45340] __builtin_expect and -Os generates stupid code

2010-08-19 Thread socketpair at gmail dot com
--- Comment #1 from socketpair at gmail dot com 2010-08-19 14:17 --- Created an attachment (id=21519) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21519&action=view) C souce file 1. gcc-Os --save-temps -fomit-frame-pointer -fno-stack-protector main.c 2. gcc -DCOOL -Os --s