public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* "-fno-unswitch-loops" option have no effect?
@ 2009-08-17  7:19 ami_stuff
       [not found] ` <56d259a00908170344v54442954u3a5d0337de3b98fe@mail.gmail.com>
  2009-08-17 13:33 ` Richard Guenther
  0 siblings, 2 replies; 10+ messages in thread
From: ami_stuff @ 2009-08-17  7:19 UTC (permalink / raw)
  To: gcc

Hi,

I found out that when I use "-fno-unswitch-loops" option, it have no effect - loops are unswitched anyway:

-O3 -fno-unswitch-loops

Because of that to avoid -funswitch-loops optimization I must use something like this:

-O2 -finline-functions -fpredictive-commoning -fgcse-after-reload -ftree-vectorize 

Is that a bug?

Tested with GCC 4.4.1 (m68k).

Regards

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

* Re: "-fno-unswitch-loops" option have no effect?
       [not found] ` <56d259a00908170344v54442954u3a5d0337de3b98fe@mail.gmail.com>
@ 2009-08-17 13:29   ` ami_stuff
  2009-08-17 19:42     ` Bernd Roesch
  0 siblings, 1 reply; 10+ messages in thread
From: ami_stuff @ 2009-08-17 13:29 UTC (permalink / raw)
  To: Martin Guy; +Cc: gcc

Hi,

> Hundreds and hundreds of people read this list, so every low-detail
> "I think there may be a bug" message you send wastes hours of other
> people's time.

Ok, Ok, but if someone will reproduce the same problem on his system I can fill bugreport,
otherwise I will only waste my time, hours of my time, to start detailed bugreport.
Maybe this is only fault of my GCC's build?

> If it *is* a bug, on the bug tracker, it will be picked up by people
> interested in that specific area

It may takes months before someone will look at the bugreport. If it's really a bug IMHO
it's a bit critical bug.

> though you don't seem to do much
> in-depth research, nor do you supply any detail of what you did and
> what you expected.

There is no need for much detail, just compile any bigger sourcecode with -O3 -fno-.. and
after that with -O2 .... When the object files are not identical, something is wrong
and I can start a bug report.

Regards

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17  7:19 "-fno-unswitch-loops" option have no effect? ami_stuff
       [not found] ` <56d259a00908170344v54442954u3a5d0337de3b98fe@mail.gmail.com>
@ 2009-08-17 13:33 ` Richard Guenther
  2009-08-17 13:35   ` ami_stuff
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Guenther @ 2009-08-17 13:33 UTC (permalink / raw)
  To: ami_stuff; +Cc: gcc

On Mon, Aug 17, 2009 at 2:38 AM, ami_stuff<ami_stuff@o2.pl> wrote:
> Hi,
>
> I found out that when I use "-fno-unswitch-loops" option, it have no effect - loops are unswitched anyway:
>
> -O3 -fno-unswitch-loops
>
> Because of that to avoid -funswitch-loops optimization I must use something like this:
>
> -O2 -finline-functions -fpredictive-commoning -fgcse-after-reload -ftree-vectorize
>
> Is that a bug?

Works fine for me.  gcc.dg/tree-ssa/loop-6.c is unswitched with -O3
but not with -O3 -fno-unswitch-loops.

You have to be more specific.  Maybe PRE or if-conversion perform
the "unswichting" for you.

Richard.

> Tested with GCC 4.4.1 (m68k).
>
> Regards
>
>

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 13:33 ` Richard Guenther
@ 2009-08-17 13:35   ` ami_stuff
  2009-08-17 16:01     ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: ami_stuff @ 2009-08-17 13:35 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc

Hi,

> Works fine for me.  gcc.dg/tree-ssa/loop-6.c is unswitched with -O3
> but not with -O3 -fno-unswitch-loops.

This one works for me too.

Could you try to compile "deflate.c" from libz?

Here are my results:

-m68060 -O3 -fno-unswitch-loops                                                            - 12,9kb
-m68060 -O3                                                                                - 12,9kb
-m68060 -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning - 12,4kb

but it's a lot more visible with "libavcodec/dsputil.c" from FFmpeg package:

OPTFLAGS= -mnobitfield -m68060 -std=c99  -Wdeclaration-after-statement -Wdisabled-optimization -fno-math-errno -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-common -fomit-frame-pointer -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wundef -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning:

306kb

OPTFLAGS= -mnobitfield -m68060 -std=c99  -Wdeclaration-after-statement -Wdisabled-optimization -fno-math-errno -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-common -fomit-frame-pointer -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-unswitch-loops:

1,18mb

OPTFLAGS= -mnobitfield -m68060 -std=c99  -Wdeclaration-after-statement -Wdisabled-optimization -fno-math-errno -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-common -fomit-frame-pointer -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wundef -O3

1,18mb

Regards

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 13:35   ` ami_stuff
@ 2009-08-17 16:01     ` Paolo Bonzini
  2009-08-17 16:07       ` ami_stuff
  0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2009-08-17 16:01 UTC (permalink / raw)
  To: ami_stuff; +Cc: Richard Guenther, gcc

On 08/17/2009 02:32 PM, ami_stuff wrote:
> Hi,
>
>> Works fine for me.  gcc.dg/tree-ssa/loop-6.c is unswitched with -O3
>> but not with -O3 -fno-unswitch-loops.
>
> This one works for me too.
>
> Could you try to compile "deflate.c" from libz?
>
> Here are my results:
>
> -m68060 -O3 -fno-unswitch-loops                                                            - 12,9kb
> -m68060 -O3                                                                                - 12,9kb
> -m68060 -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning - 12,4kb

And why do you think that loop unswitching has anything to do with the 
size growth?

BTW, -O3 is not guaranteed to give better performance than -O2.

Paolo

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 16:01     ` Paolo Bonzini
@ 2009-08-17 16:07       ` ami_stuff
  2009-08-17 16:14         ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: ami_stuff @ 2009-08-17 16:07 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc

Hi,

> >
> > Here are my results:
> >
> > -m68060 -O3 -fno-unswitch-loops                                                            - 12,9kb
> > -m68060 -O3                                                                                - 12,9kb
> > -m68060 -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning - 12,4kb
> 
> And why do you think that loop unswitching has anything to do with the 
> size growth?

Shouldn't I get the same file sizes with:

-m68060 -O3 -fno-unswitch-loops   

and

-m68060 -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning

?

I don't know, but I think the same optimalizations should be used in these cases, so file size should be the same.
I'm wrong?

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 16:07       ` ami_stuff
@ 2009-08-17 16:14         ` Paolo Bonzini
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Bonzini @ 2009-08-17 16:14 UTC (permalink / raw)
  To: ami_stuff; +Cc: gcc

On 08/17/2009 03:33 PM, ami_stuff wrote:
> -m68060 -O3 -fno-unswitch-loops
>
> and
>
> -m68060 -O2 -finline-functions -fgcse-after-reload -ftree-vectorize -fpredictive-commoning

Some heuristics are tuned differently for -O2 and -O3.  The only way to 
know is to look at the dumps.

Paolo

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 13:29   ` ami_stuff
@ 2009-08-17 19:42     ` Bernd Roesch
  2009-08-17 19:54       ` ami_stuff
  2009-08-17 22:16       ` Alexander Strange
  0 siblings, 2 replies; 10+ messages in thread
From: Bernd Roesch @ 2009-08-17 19:42 UTC (permalink / raw)
  To: ami_stuff, Martin Guy; +Cc: gcc

Hello ami_stuff

On 17.08.09, you wrote:

> Hi,
> 
>> Hundreds and hundreds of people read this list, so every low-detail
>> "I think there may be a bug" message you send wastes hours of other
>> people's time.
> 
> Ok, Ok, but if someone will reproduce the same problem on his system I can
> fill bugreport, otherwise I will only waste my time, hours of my time, to
> start detailed bugreport. Maybe this is only fault of my GCC's build?

gcc > 4 AOS 68k builds are build from offical gcc sourcetree and there are
no changes 


> 
>> If it *is* a bug, on the bug tracker, it will be picked up by people
>> interested in that specific area
> 
> It may takes months before someone will look at the bugreport. If it's
> really a bug IMHO it's a bit critical bug.
> 
>> though you don't seem to do much
>> in-depth research, nor do you supply any detail of what you did and
>> what you expected.
> 
> There is no need for much detail, just compile any bigger sourcecode with
> -O3 -fno-.. and after that with -O2 .... When the object files are not
> identical, something is wrong and I can start a bug report.

how much is size diffrent ?

You use
-finline-functions -fpredictive-commoning -fgcse-after-reload
-ftree-vectorize 

right ?

I see in Gcc source that there is more set on -O3.
 flag_ipa_cp_clone = opt3;
  if (flag_ipa_cp_clone)
    flag_ipa_cp = 1; 

.but i
think you can easy test, compile the ffmpeg, if it give no internal
compiler error with -fno........ then it work.

here is from source opt.c what is set on opt3

opt3 = (optimize >= 3); 
flag_predictive_commoning = opt3;
  flag_inline_functions = opt3;
  flag_unswitch_loops = opt3;
  flag_gcse_after_reload = opt3;
  flag_tree_vectorize = opt3;
  flag_ipa_cp_clone = opt3;
  if (flag_ipa_cp_clone)
    flag_ipa_cp = 1; 



> 
> Regards
> 
Regards

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 19:42     ` Bernd Roesch
@ 2009-08-17 19:54       ` ami_stuff
  2009-08-17 22:16       ` Alexander Strange
  1 sibling, 0 replies; 10+ messages in thread
From: ami_stuff @ 2009-08-17 19:54 UTC (permalink / raw)
  To: Bernd Roesch; +Cc: gcc

Hi,

> gcc > 4 AOS 68k builds are build from offical gcc sourcetree and there are
> no changes 

Yes, I know, but some problems may happens anyway like it happened before
(problems with defines).
I think if there is a problem the best is to compare GCCs from different sources.

> how much is size diffrent ?

306kb vs 1,18mb - "dsputil.c"

> .but i
> think you can easy test, compile the ffmpeg, if it give no internal
> compiler error with -fno........ then it work.

I get the same ICE with "-O3" and "-O3 -fno-unswitch-loops" - "mpegvideo.c" file.

Regards

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

* Re: "-fno-unswitch-loops" option have no effect?
  2009-08-17 19:42     ` Bernd Roesch
  2009-08-17 19:54       ` ami_stuff
@ 2009-08-17 22:16       ` Alexander Strange
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Strange @ 2009-08-17 22:16 UTC (permalink / raw)
  To: gcc


On Aug 17, 2009, at 10:50 AM, Bernd Roesch wrote:

>> [..]
>> There is no need for much detail, just compile any bigger  
>> sourcecode with
>> -O3 -fno-.. and after that with -O2 .... When the object files are  
>> not
>> identical, something is wrong and I can start a bug report.
>
> how much is size diffrent ?
>
> You use
> -finline-functions -fpredictive-commoning -fgcse-after-reload
> -ftree-vectorize
>
> right ?
>
> I see in Gcc source that there is more set on -O3.
> flag_ipa_cp_clone = opt3;
> if (flag_ipa_cp_clone)
>   flag_ipa_cp = 1;
>
> .but i
> think you can easy test, compile the ffmpeg, if it give no internal
> compiler error with -fno........ then it work.
>
> here is from source opt.c what is set on opt3
>
> opt3 = (optimize >= 3);
> flag_predictive_commoning = opt3;
> flag_inline_functions = opt3;
> flag_unswitch_loops = opt3;
> flag_gcse_after_reload = opt3;
> flag_tree_vectorize = opt3;
> flag_ipa_cp_clone = opt3;
> if (flag_ipa_cp_clone)
>   flag_ipa_cp = 1;

That doesn't cover all of it; for instance, complete loop unrolling  
increases code size more on -O3.

That means you run into http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40992 
  with ffmpeg's asm enabled, but turning it down (--param max- 
completely-peel-times=2) actually seems slightly faster even with  
plain C on i386.

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

end of thread, other threads:[~2009-08-17 20:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17  7:19 "-fno-unswitch-loops" option have no effect? ami_stuff
     [not found] ` <56d259a00908170344v54442954u3a5d0337de3b98fe@mail.gmail.com>
2009-08-17 13:29   ` ami_stuff
2009-08-17 19:42     ` Bernd Roesch
2009-08-17 19:54       ` ami_stuff
2009-08-17 22:16       ` Alexander Strange
2009-08-17 13:33 ` Richard Guenther
2009-08-17 13:35   ` ami_stuff
2009-08-17 16:01     ` Paolo Bonzini
2009-08-17 16:07       ` ami_stuff
2009-08-17 16:14         ` Paolo Bonzini

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