[PR] Now That's What I Call Fashion - February 2010

2010-02-15 Thread Vivienne - OK Hello

Hi

Just discovered the biggest surprise of London Fashion Week...
Lead Singer of Rock Band ziggiville storms the Catwalk - it's fun!

http://www.youtube.com/ziggiville

Have a great day
Vivienne

+44 (0) 7905 739026

OK-Hello
http://www.okhello.co.uk



GCC freezing for a Multiply Chain

2010-02-15 Thread Balaji.Iyer
Hello Everyone,
I am creating a benchmark, where I have a following code:

x1 = a * b
x2 = x1 * a;
x3 = x1* x2;
x4 = x2 * x3;
x5 = x3 * x4;
x6 = x5 * x6;
  . . . 
  . . .
   x1000 = x999 * x998;



 When I do this, and compile using -O3/-O2/-O1, the compiler freezes. Am I 
doing anything wrong? 

GCC Version: 4.2.1
Platform: x86_64 (in macOS Snow Leopard).

I also tested this on a i386 (Red Hat 4.3.2-7) machine with gcc 4.3.2 and I had 
the same response.

Please CC me in the response since I m not a subscribed member of this mailing 
list. 

Any help is highly appreciated!

Thanks,


Balaji V. Iyer.


Re: GCC freezing for a Multiply Chain

2010-02-15 Thread Basile STARYNKEVITCH

balaji.i...@gtri.gatech.edu wrote:

Hello Everyone,
I am creating a benchmark, where I have a following code:

x1 = a * b
x2 = x1 * a;
x3 = x1* x2;
x4 = x2 * x3;
x5 = x3 * x4;
x6 = x5 * x6;
  . . . 
  . . .

   x1000 = x999 * x998;



 When I do this, and compile using -O3/-O2/-O1, the compiler freezes. Am I doing anything wrong? 


GCC Version: 4.2.1
Platform: x86_64 (in macOS Snow Leopard).

I also tested this on a i386 (Red Hat 4.3.2-7) machine with gcc 4.3.2 and I had 
the same response.

Please CC me in the response since I m not a subscribed member of this mailing list. 



I have no real idea on this particular issue, but I did empirically observe that on some programs (for me, it was the 
MELT generated C code on my MELT [1] branch eg before rev 154917) the register allocator (or some optimizing passes) 
might have in practice an O(n^2) behavior, and might need a lot of memory


I would suggest:

* trying a very recent gcc (that you probably should build from its released source code), at least gcc 4.4.3 
http://gcc.gnu.org/gcc-4.4/ or perhaps a gcc 4.5 snapshot.


* reducing the number of variables (to e.g. 300 or 500 instead of 1000).

* compiling first with -O1

* compiling with -ftime-report

* observe the cpu time and memory consumption of the compilation, eg by running 
the top utility in a separate terminal.

So try first to reduce the number of variables (perhaps even to 200) and to 
compile with
   gcc-4.4 -O1 -ftime-report -v -c benchbalaji.c

I believe that recent GCC (ie 4.4 at least) had serious progress both on register allocation and on some optimization 
passes, so they probably should work better on your [pathological] case.


Regards.

Note [1]: MELT is a lisp like dialect -translated into C- for coding GCC passes in plugins, and it used to generate huge 
initialization routines. This is no more the case since a few weeks (because there is no more huge routines, only 
several big ones), MELT can be reasonably compiled on a desktop even with optimization like -O2.


--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basilestarynkevitchnet mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Exception handling mechanism

2010-02-15 Thread Xiaolong Tang

Howdy all, 

I am in middle of designing program analysis for C++ code, but with concerns 
about exception handling. I used to disable exception handling but now have to 
take into account exception handling somehow. May someone give me a brief 
introduction on how GCC processes C++ exceptions or recommend some docs about 
exception handling? (Thus I can quickly evaluate the overhead arising from 
taking into account exceptions during program analysis.) 

Thank you very much!

Xiaolong


Re: Exception handling mechanism

2010-02-15 Thread Paolo Carlini
... I would suggest first reading this document, in detail:

  http://www.codesourcery.com/public/cxx-abi/

and then asking very specific questions.

Paolo.


Re: gcc -O1 performs better than gcc -O2

2010-02-15 Thread sam tygier

Joakim Tjernlund wrote:

Noticed while optimizing crc16 that gcc -O performed much better
than gcc -O2 while doing crc16:


I have also seen -O1 beat -O2 when with a large FORTRAN program.
http://www.hep.manchester.ac.uk/u/sam/zgoubi-optimise/

Sam



RE: GCC freezing for a Multiply Chain

2010-02-15 Thread Ian Bolton
Hi Balaji.

If you have access to GCC source and are willing to change it, there is
a
way to turn off IRA (the Integrated Register Allocator) and just use
a "fast allocation" algorithm that otherwise only gets used for -O0.

Should IRA be the issue, this may be a workaround for you in the
short-term:

In GCC version 4.4.1, the last function of ira-color.c is called
ira-color().  Simply make it always call fast_allocation instead
of only if ira_conflict_p is false.

Best regards,
Ian

> -Original Message-
> From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf
Of
> balaji.i...@gtri.gatech.edu
> Sent: 15 February 2010 17:04
> To: gcc@gcc.gnu.org
> Subject: GCC freezing for a Multiply Chain
> 
> Hello Everyone,
>   I am creating a benchmark, where I have a following code:
> 
> x1 = a * b
> x2 = x1 * a;
> x3 = x1* x2;
> x4 = x2 * x3;
> x5 = x3 * x4;
> x6 = x5 * x6;
>   . . .
>   . . .
>x1000 = x999 * x998;
> 
> 
> 
>  When I do this, and compile using -O3/-O2/-O1, the compiler freezes.
> Am I doing anything wrong?
> 
> GCC Version: 4.2.1
> Platform: x86_64 (in macOS Snow Leopard).
> 
> I also tested this on a i386 (Red Hat 4.3.2-7) machine with gcc 4.3.2
> and I had the same response.
> 
> Please CC me in the response since I m not a subscribed member of this
> mailing list.
> 
> Any help is highly appreciated!
> 
> Thanks,
> 
> 
> Balaji V. Iyer.


Re: Exception handling mechanism

2010-02-15 Thread Dave Korn
On 15/02/2010 18:07, Xiaolong Tang wrote:

> May someone give
> me a brief introduction on how GCC processes C++ exceptions or recommend
> some docs about exception handling? 

http://gcc.gnu.org/wiki/Dwarf2EHNewbiesHowto

cheers,
  DaveK