Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: c compilati...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 22 of 38 Topic 26135 of 26972
Post > Topic >>

Re: c compilation - gcc vs visual c

by kumarchi@[EMAIL PROTECTED] May 10, 2008 at 09:49 AM

On May 10, 11:41 am, jacob navia <ja...@[EMAIL PROTECTED]
> wrote:
> Chris H wrote:
> > In message <g02blv$63...@[EMAIL PROTECTED]
>, jacob navia <ja...@[EMAIL PROTECTED]
>
writes
>
> >> It is not surprising that gcc is slower than Microsoft since the
> >> people behind each project have vastly different objectives and
> >> budgets to implement them.
>
> >> Gcc is running in many platforms and architectures.
> >> Microsoft is running in one platform exclusively.
>
> > So  Gcc is not likely to be good on any platform as the people who
> > develop for other platforms will specialise in that and beat GCC?
>
> This is very likely indeed. A specialized compiler for a given platform
> has less problems and can take advantage of many particular
> optimizations that a more general purpose compiler can't use.
>
>
>
> >> Gcc implements standards like C99
> > CRAP
>
> > GCC implements GNU-c and adds extensions for SOME parts of C99
>
> Apparently you can't just say
>
> "I disagree". No. You have to yell
>
> CRAP!!!
>
> Obviously you are right with "Some parts of C99" but those "some parts"
> are almost 99% of the job...
>
> >> (module small problems), Microsoft
> >> implements only Microsoft  environments (.net, etc). Microsoft is
> >> still at C89 level.
>
> > Microsoft along with every other compiler INCLUDING GCC is at C95 
with
> > SOME parts of C99 implemented.
>
> I disagree. Microsoft has done no effort at all to implemnt C99. The
only
> parts they did was // comments and accepting "long long". I am not aware
> of any other parts of C99 that they implement.
>
> > GCC is no more C99 than any other compiler.
>
> It is more advanced in its implementation of C99 than lcc-win.
>
> --
> jacob navia
> jacob at jacob point remcomp point fr
> logiciels/informatiquehttp://www.cs.virginia.edu/~lcc-win32

guys:
i have zeroed in and created a simple test program. This progrma just
has floating point addition and integer addition. it does 20 loops x
1million times. in relase version of visual c it takes 0 time. gcc O3
takes 6 secs in my machine.

this cannot be rocket science; there seems to some fundamental
deficiency in gcc. i will treat this as a bug. This should have
serious implications for linux platforms

here is the code; test it for yourself

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

static double loop (long times)
{
  long i=0;
  double a=0;

  for (i=1; i<times; i++)
    {
      double x1 = i-1;
      double x2 = i;
      double y = 0;
      long n=0;

      y = x1+x2;
      n = i+ i -1;

      y=x1*x2*y;

      a=y;
    }

  return a;

}

int main (int argc, char **argv)
{
  unsigned long times = 0;
  long i=0;
  time_t t=0;
  time_t t1=0;
  double dt=0;
  long lcnt=20;
  double a=0;

  times = (long) (1e9);

  /*
  if(argc > 1)
    {
      times = atoi (argv[1]);

      times *= 1e6;
    }

  if(argc > 2)
    lcnt = atoi (argv[2]);

  if(lcnt < 20)
    lcnt = 20;
  */
  time (&t);

  for (i=0; i<20; i++)
    {
      a = loop (times);
      /* you need this for visual c show any elapsed time
      printf ("\n %lg \n", a);
      */
    }





  time (&t1);

  dt = difftime (t1, t);

  printf ("\n times=%ld loops=%ld dtime = %lg \n", times, lcnt, dt);



  exit (0);
}
 




 38 Posts in Topic:
c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 12:20:19 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-09 22:20:09 
Re: c compilation - gcc vs visual c
Ulrich Eckhardt <dooms  2008-05-09 22:32:07 
Re: c compilation - gcc vs visual c
"Chris Thomasson&quo  2008-05-30 16:59:33 
Re: c compilation - gcc vs visual c
micans@[EMAIL PROTECTED]   2008-05-09 13:38:04 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 14:03:14 
Re: c compilation - gcc vs visual c
Ian Collins <ian-news@  2008-05-10 09:22:41 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-09 23:50:30 
Re: c compilation - gcc vs visual c
Niz <notarealemailaddr  2008-05-09 23:08:26 
Re: c compilation - gcc vs visual c
"cr88192" <c  2008-05-10 15:28:50 
Re: c compilation - gcc vs visual c
"Sean G. McLaughlin&  2008-05-10 17:30:35 
Re: c compilation - gcc vs visual c
moi <root@[EMAIL PROTE  2008-05-09 23:21:36 
Re: c compilation - gcc vs visual c
Antoninus Twink <nospa  2008-05-10 00:13:19 
Re: c compilation - gcc vs visual c
"cr88192" <c  2008-05-10 08:41:39 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 17:59:22 
Re: c compilation - gcc vs visual c
Willem <willem@[EMAIL   2008-05-10 06:20:09 
Re: c compilation - gcc vs visual c
William Ahern <william  2008-05-10 16:23:36 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 18:16:26 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 13:32:58 
Re: c compilation - gcc vs visual c
roberson@[EMAIL PROTECTED  2008-05-10 12:49:26 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-10 17:41:23 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 09:49:58 
Re: c compilation - gcc vs visual c
"Sean G. McLaughlin&  2008-05-10 17:29:06 
Re: c compilation - gcc vs visual c
moi <root@[EMAIL PROTE  2008-05-10 19:18:18 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 18:58:15 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 19:00:47 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 12:13:38 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 12:29:47 
Re: c compilation - gcc vs visual c
Rui Maciel <rui.maciel  2008-05-10 20:20:13 
Re: c compilation - gcc vs visual c
Barry Schwarz <schwarz  2008-05-16 19:12:48 
Re: c compilation - gcc vs visual c
Peter Nilsson <airia@[  2008-05-16 20:17:14 
[OT] Re: c compilation - gcc vs visual c
Tim Prince <tprince@[E  2008-05-16 23:30:55 
Re: c compilation - gcc vs visual c
Walter Banks <walter@[  2008-05-17 05:29:18 
Re: c compilation - gcc vs visual c
CBFalconer <cbfalconer  2008-05-17 06:59:53 
Re: c compilation - gcc vs visual c
Ben Bacarisse <ben.use  2008-05-18 14:00:22 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-30 09:09:43 
Re: c compilation - gcc vs visual c
Antoninus Twink <nospa  2008-05-30 19:34:08 
Re: c compilation - gcc vs visual c
"robertwessel2@[EMAI  2008-05-30 17:12:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 21:45:59 CDT 2008.