public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Gcc compiler  advantage and disadvantage of gcc
@ 2016-08-18 12:01 i.98shaikhh
  2016-08-18 18:24 ` Anna Szekér
  0 siblings, 1 reply; 10+ messages in thread
From: i.98shaikhh @ 2016-08-18 12:01 UTC (permalink / raw)
  To: gcc-help

Plzz

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-18 12:01 Gcc compiler advantage and disadvantage of gcc i.98shaikhh
@ 2016-08-18 18:24 ` Anna Szekér
  2016-08-18 18:29   ` Dennis Clarke
  0 siblings, 1 reply; 10+ messages in thread
From: Anna Szekér @ 2016-08-18 18:24 UTC (permalink / raw)
  To: i.98shaikhh; +Cc: gcc-help

Witch compiler would you compare it to?

2016-08-18 14:01 GMT+02:00, i.98shaikhh <i.98shaikhh@gmail.com>:
> Plzz

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-18 18:24 ` Anna Szekér
@ 2016-08-18 18:29   ` Dennis Clarke
  2016-08-18 18:37     ` Manuel López-Ibáñez
  0 siblings, 1 reply; 10+ messages in thread
From: Dennis Clarke @ 2016-08-18 18:29 UTC (permalink / raw)
  To: gcc-help

On 08/18/2016 02:24 PM, Anna Szekér wrote:
> Witch compiler would you compare it to?

A reasonable comparison would be the Oracle Studio 12.5 compiler which
creates wonderfully optimal code on both Sparc and x86 architectures.

Dennis

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

* Re: Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-18 18:29   ` Dennis Clarke
@ 2016-08-18 18:37     ` Manuel López-Ibáñez
  2016-08-19  8:25       ` Andrew Haley
  0 siblings, 1 reply; 10+ messages in thread
From: Manuel López-Ibáñez @ 2016-08-18 18:37 UTC (permalink / raw)
  To: Dennis Clarke, GCC-help

On 18/08/16 19:29, Dennis Clarke wrote:
> On 08/18/2016 02:24 PM, Anna Szekér wrote:
>> Witch compiler would you compare it to?
>
> A reasonable comparison would be the Oracle Studio 12.5 compiler which
> creates wonderfully optimal code on both Sparc and x86 architectures.

If somebody writes a nice comparison in the style of 
http://clang.llvm.org/comparison.html

I'll format it for the GCC wiki for others to find.

Cheers,
	Manuel.

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-18 18:37     ` Manuel López-Ibáñez
@ 2016-08-19  8:25       ` Andrew Haley
  2016-08-19 14:19         ` Manuel López-Ibáñez
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Haley @ 2016-08-19  8:25 UTC (permalink / raw)
  To: gcc-help

On 18/08/16 19:37, Manuel López-Ibáñez wrote:
> On 18/08/16 19:29, Dennis Clarke wrote:
>> On 08/18/2016 02:24 PM, Anna Szekér wrote:
>>> Witch compiler would you compare it to?
>>
>> A reasonable comparison would be the Oracle Studio 12.5 compiler which
>> creates wonderfully optimal code on both Sparc and x86 architectures.
> 
> If somebody writes a nice comparison in the style of 
> http://clang.llvm.org/comparison.html

But hopefully slightly less self serving.

Andrew.


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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-19  8:25       ` Andrew Haley
@ 2016-08-19 14:19         ` Manuel López-Ibáñez
  2016-08-19 15:13           ` Tim Prince
                             ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Manuel López-Ibáñez @ 2016-08-19 14:19 UTC (permalink / raw)
  To: Andrew Haley, GCC-help

On 19/08/16 09:25, Andrew Haley wrote:
> On 18/08/16 19:37, Manuel López-Ibáñez wrote:
>> On 18/08/16 19:29, Dennis Clarke wrote:
>>> On 08/18/2016 02:24 PM, Anna Szekér wrote:
>>>> Witch compiler would you compare it to?
>>>
>>> A reasonable comparison would be the Oracle Studio 12.5 compiler which
>>> creates wonderfully optimal code on both Sparc and x86 architectures.
>>
>> If somebody writes a nice comparison in the style of
>> http://clang.llvm.org/comparison.html
>
> But hopefully slightly less self serving.

To be honest, it doesn't seem an unfair characterization to me.

GCC could highlight the ethical and tit-for-tat benefits of the GPL, but I 
guess they do not see those as a benefit.

GCC has also the benefit of being a more mature code base and, as a result,  it 
has been more thoroughly tested in a wider range of codes; yet this is 
difficult to quantify and arguably Clang is more widely used today than GCC, 
just not in Linux, thus this might not be true anymore.

Is there anything else there that you think is misleading or plain wrong?

Cheers,

	Manuel.

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-19 14:19         ` Manuel López-Ibáñez
@ 2016-08-19 15:13           ` Tim Prince
  2016-08-19 17:17           ` Andrew Haley
  2016-08-19 18:09           ` Jeffrey Walton
  2 siblings, 0 replies; 10+ messages in thread
From: Tim Prince @ 2016-08-19 15:13 UTC (permalink / raw)
  To: gcc-help



On 8/19/2016 10:19 AM, Manuel López-Ibáñez wrote:
> On 19/08/16 09:25, Andrew Haley wrote:
>> On 18/08/16 19:37, Manuel López-Ibáñez wrote:
>>> On 18/08/16 19:29, Dennis Clarke wrote:
>>>> On 08/18/2016 02:24 PM, Anna Szekér wrote:
>>>>> Witch compiler would you compare it to?
>>>>
>>>> A reasonable comparison would be the Oracle Studio 12.5 compiler which
>>>> creates wonderfully optimal code on both Sparc and x86 architectures.
>>>
>>> If somebody writes a nice comparison in the style of
>>> http://clang.llvm.org/comparison.html
>>
>> But hopefully slightly less self serving.
>
> To be honest, it doesn't seem an unfair characterization to me.
>
> GCC could highlight the ethical and tit-for-tat benefits of the GPL,
> but I guess they do not see those as a benefit.
>
> GCC has also the benefit of being a more mature code base and, as a
> result,  it has been more thoroughly tested in a wider range of codes;
> yet this is difficult to quantify and arguably Clang is more widely
> used today than GCC, just not in Linux, thus this might not be true
> anymore.
>
> Is there anything else there that you think is misleading or plain wrong?
>
I have the impression that clang supports OpenMP on linux but not
Windows (where gcc drops a few OpenMP features).

-- 
Tim Prince

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-19 14:19         ` Manuel López-Ibáñez
  2016-08-19 15:13           ` Tim Prince
@ 2016-08-19 17:17           ` Andrew Haley
  2016-08-19 18:09           ` Jeffrey Walton
  2 siblings, 0 replies; 10+ messages in thread
From: Andrew Haley @ 2016-08-19 17:17 UTC (permalink / raw)
  To: Manuel López-Ibáñez, GCC-help

On 19/08/16 15:19, Manuel López-Ibáñez wrote:
> On 19/08/16 09:25, Andrew Haley wrote:
>> On 18/08/16 19:37, Manuel López-Ibáñez wrote:
>>> On 18/08/16 19:29, Dennis Clarke wrote:
>>>> On 08/18/2016 02:24 PM, Anna Szekér wrote:
>>>>> Witch compiler would you compare it to?
>>>>
>>>> A reasonable comparison would be the Oracle Studio 12.5 compiler which
>>>> creates wonderfully optimal code on both Sparc and x86 architectures.
>>>
>>> If somebody writes a nice comparison in the style of
>>> http://clang.llvm.org/comparison.html
>>
>> But hopefully slightly less self serving.
> 
> To be honest, it doesn't seem an unfair characterization to me.
> 
> GCC could highlight the ethical and tit-for-tat benefits of the GPL, but I 
> guess they do not see those as a benefit.

It says:

"GCC is licensed under the GPL license. clang uses a BSD license, which
allows it to be embedded in software that is not GPL-licensed."

Note that GCC "is licensed under" the GPL licence" whereas clang
"uses" a BSD licence.  Why not say that GCC uses the GPL licence?

I could just as much write "GCC uses the GPL license.  clang uses a
BSD license, which allows evil bastard proprietary software companies
to take the free and open code of clang and release and sell versions
with licence restrictions but no source code."  and put that in the
"Pro's of GCC vs clang" section.  I urge them to say so and will be
happy to allow them to use that sentence without even requiring any
attribution!

> GCC has also the benefit of being a more mature code base and, as a
> result, it has been more thoroughly tested in a wider range of
> codes; yet this is difficult to quantify and arguably Clang is more
> widely used today than GCC, just not in Linux, thus this might not
> be true anymore.
> 
> Is there anything else there that you think is misleading or plain
> wrong?

It's fair to point out that clang is faster, but "much" faster is an
opinion.  Most of the "Pro's of clang vs GCC" are design decisions
which may well be of interest to the maintainers but don't affect
users who just want a compiler.  Of course the authors of clang think
their design decisions are better and they're prepared to defend them.
But an observer who was trying hard to be neutral would describe them
as differences.

Andrew.

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-19 14:19         ` Manuel López-Ibáñez
  2016-08-19 15:13           ` Tim Prince
  2016-08-19 17:17           ` Andrew Haley
@ 2016-08-19 18:09           ` Jeffrey Walton
  2016-08-19 18:24             ` Tim Prince
  2 siblings, 1 reply; 10+ messages in thread
From: Jeffrey Walton @ 2016-08-19 18:09 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: Andrew Haley, GCC-help

>> But hopefully slightly less self serving.
>
> To be honest, it doesn't seem an unfair characterization to me.
>
> GCC could highlight the ethical and tit-for-tat benefits of the GPL, but I
> guess they do not see those as a benefit.
>
> GCC has also the benefit of being a more mature code base and, as a result,
> it has been more thoroughly tested in a wider range of codes; yet this is
> difficult to quantify and arguably Clang is more widely used today than GCC,
> just not in Linux, thus this might not be true anymore.

GCC does a much better job of optimizing. I run benchmarks for some
libraries regularly to ensure there are no regressions. GCC is
consistently 2x faster than Clang, and GCC is on-par with ICC.

It seems the slow-down is the treatment of const-expr's. Under the
laws of the physical universe as we know them, some values are fixed
at compile time won't change (regardless of their const-expr status).
GCC optimizes them (common sense), while Clang does not (expected to
somehow change).

That little slow down adds up, and it makes us do things like avoid
std::numeric_limits<T>::max() in favor of a #define instead. More
complex examples include propagating a constant using a template
parameter instead of a function parameter. GCC will realize a constant
does not change under the laws of the physical universe as we know
them; while Clang will treat the constant passed as a parameter as
something that can miraculously change after saving the source file.

Jeff

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

* Re: Gcc compiler advantage and disadvantage of gcc
  2016-08-19 18:09           ` Jeffrey Walton
@ 2016-08-19 18:24             ` Tim Prince
  0 siblings, 0 replies; 10+ messages in thread
From: Tim Prince @ 2016-08-19 18:24 UTC (permalink / raw)
  To: gcc-help



On 8/19/2016 2:09 PM, Jeffrey Walton wrote:
>>> But hopefully slightly less self serving.
>> To be honest, it doesn't seem an unfair characterization to me.
>>
>> GCC could highlight the ethical and tit-for-tat benefits of the GPL, but I
>> guess they do not see those as a benefit.
>>
>> GCC has also the benefit of being a more mature code base and, as a result,
>> it has been more thoroughly tested in a wider range of codes; yet this is
>> difficult to quantify and arguably Clang is more widely used today than GCC,
>> just not in Linux, thus this might not be true anymore.
> GCC does a much better job of optimizing. I run benchmarks for some
> libraries regularly to ensure there are no regressions. GCC is
> consistently 2x faster than Clang, and GCC is on-par with ICC.
>
> It seems the slow-down is the treatment of const-expr's. Under the
> laws of the physical universe as we know them, some values are fixed
> at compile time won't change (regardless of their const-expr status).
> GCC optimizes them (common sense), while Clang does not (expected to
> somehow change).
>
> That little slow down adds up, and it makes us do things like avoid
> std::numeric_limits<T>::max() in favor of a #define instead. More
> complex examples include propagating a constant using a template
> parameter instead of a function parameter. GCC will realize a constant
> does not change under the laws of the physical universe as we know
> them; while Clang will treat the constant passed as a parameter as
> something that can miraculously change after saving the source file.
>
> Jeff
There are many situations where gcc optimizes better, and a few where
clang is better.  Among the latter is min|
max reduction, where clang can "riffle" by batching more than one simd
parallel reduction so as to overcome latency.  The implied point is
valid, that many users can suffer a little more compile time in order to
improve run time.

-- 
Tim Prince

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

end of thread, other threads:[~2016-08-19 18:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18 12:01 Gcc compiler advantage and disadvantage of gcc i.98shaikhh
2016-08-18 18:24 ` Anna Szekér
2016-08-18 18:29   ` Dennis Clarke
2016-08-18 18:37     ` Manuel López-Ibáñez
2016-08-19  8:25       ` Andrew Haley
2016-08-19 14:19         ` Manuel López-Ibáñez
2016-08-19 15:13           ` Tim Prince
2016-08-19 17:17           ` Andrew Haley
2016-08-19 18:09           ` Jeffrey Walton
2016-08-19 18:24             ` Tim Prince

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