gcc-6-20180606 is now available

2018-06-06 Thread gccadmin
Snapshot gcc-6-20180606 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/6-20180606/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 6 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-6-branch 
revision 261250

You'll find:

 gcc-6-20180606.tar.xzComplete GCC

  SHA256=0151845c9eb370c848b23e14df99c42860361eee767ea8fed00a97ab275b8410
  SHA1=20bab107d88909dd9b4dd094f3f90a5373ada871

Diffs from 6-20180530 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-6
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: How to get GCC on par with ICC?

2018-06-06 Thread Zan Lynx
On 06/06/2018 10:22 AM, Dmitry Mikushin wrote:
> The opinion you've mentioned is common in scientific community. However, in
> more detail it often surfaces that the used set of GCC compiler options
> simply does not correspond to that "fast" version of Intel. For instance,
> when you do "-O3" for Intel it actually corresponds to (at least) "-O3
> -ffast-math -march=native" of GCC. Omitting "-ffast-math" obviously
> introduces significant performance gap.
> 

Please note that if your compute cluster uses different models of CPU,
be extremely careful with -march=native.

I've been bitten by it in VMs, several times. Unless you always run on
the same system that did the build, you are running a risk of illegal
instructions.

-- 
Knowledge is Power -- Power Corrupts
Study Hard -- Be Evil


Re: How to get GCC on par with ICC?

2018-06-06 Thread Ryan Burn
One case where ICC can generate much faster code sometimes is by using
the nontemporal pragma [https://software.intel.com/en-us/node/524559]
with loops.

AFAIK, there's no such equivalent pragma in gcc
[https://gcc.gnu.org/ml/gcc/2012-01/msg00028.html].

When I tried this simple example
https://github.com/rnburn/square_timing/blob/master/bench.cpp that
measures times for this loop:

void compute(const double* x, index_t N, double* y) {
  #pragma vector nontemporal
  for(index_t i=0; i wrote:
> Dear Paul,
>
> The opinion you've mentioned is common in scientific community. However, in
> more detail it often surfaces that the used set of GCC compiler options
> simply does not correspond to that "fast" version of Intel. For instance,
> when you do "-O3" for Intel it actually corresponds to (at least) "-O3
> -ffast-math -march=native" of GCC. Omitting "-ffast-math" obviously
> introduces significant performance gap.
>
> Kind regards,
> - Dmitry Mikushin | Applied Parallel Computing LLC |
> https://parallel-computing.pro
>
>
> 2018-06-06 18:51 GMT+03:00 Paul Menzel :
>
>> Dear GCC folks,
>>
>>
>> Some scientists in our organization still want to use the Intel compiler,
>> as they say, it produces faster code, which is then executed on clusters.
>> Some resources on the Web [1][2] confirm this. (I am aware, that it’s
>> heavily dependent on the actual program.)
>>
>> My question is, is it realistic, that GCC could catch up and that the
>> scientists will start to use it over Intel’s compiler? Or will Intel
>> developers always have the lead, because they have secret documentation and
>> direct contact with the processor designers?
>>
>> If it is realistic, how can we get there? Would first the program be
>> written, and then the compiler be optimized for that? Or are just more GCC
>> developers needed?
>>
>>
>> Kind regards,
>>
>> Paul
>>
>>
>> [1]: https://colfaxresearch.com/compiler-comparison/
>> [2]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679
>> .1280&rep=rep1&type=pdf
>>
>>


Re: How to get GCC on par with ICC?

2018-06-06 Thread Dmitry Mikushin
Dear Paul,

The opinion you've mentioned is common in scientific community. However, in
more detail it often surfaces that the used set of GCC compiler options
simply does not correspond to that "fast" version of Intel. For instance,
when you do "-O3" for Intel it actually corresponds to (at least) "-O3
-ffast-math -march=native" of GCC. Omitting "-ffast-math" obviously
introduces significant performance gap.

Kind regards,
- Dmitry Mikushin | Applied Parallel Computing LLC |
https://parallel-computing.pro


2018-06-06 18:51 GMT+03:00 Paul Menzel :

> Dear GCC folks,
>
>
> Some scientists in our organization still want to use the Intel compiler,
> as they say, it produces faster code, which is then executed on clusters.
> Some resources on the Web [1][2] confirm this. (I am aware, that it’s
> heavily dependent on the actual program.)
>
> My question is, is it realistic, that GCC could catch up and that the
> scientists will start to use it over Intel’s compiler? Or will Intel
> developers always have the lead, because they have secret documentation and
> direct contact with the processor designers?
>
> If it is realistic, how can we get there? Would first the program be
> written, and then the compiler be optimized for that? Or are just more GCC
> developers needed?
>
>
> Kind regards,
>
> Paul
>
>
> [1]: https://colfaxresearch.com/compiler-comparison/
> [2]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679
> .1280&rep=rep1&type=pdf
>
>


Re: How to get GCC on par with ICC?

2018-06-06 Thread Bin.Cheng
On Wed, Jun 6, 2018 at 3:51 PM, Paul Menzel
 wrote:
> Dear GCC folks,
>
>
> Some scientists in our organization still want to use the Intel compiler, as
> they say, it produces faster code, which is then executed on clusters. Some
> resources on the Web [1][2] confirm this. (I am aware, that it’s heavily
> dependent on the actual program.)
>
> My question is, is it realistic, that GCC could catch up and that the
> scientists will start to use it over Intel’s compiler? Or will Intel
> developers always have the lead, because they have secret documentation and
> direct contact with the processor designers?
>
> If it is realistic, how can we get there? Would first the program be
> written, and then the compiler be optimized for that? Or are just more GCC
> developers needed?
There are developers actually working on performance optimization in
GCC so you are not the only one :).  As an opensource compiler we do
lack resource so more developers is always good for the project.  As
Joel pointed out, typical/reduced workload showing the performance gap
is very important for our developers as well as attracting new
developers.  We can probably open a meta-bug for tracking if you have
many of these example workloads.

Thanks,
bin
>
>
> Kind regards,
>
> Paul
>
>
> [1]: https://colfaxresearch.com/compiler-comparison/
> [2]:
> http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679.1280&rep=rep1&type=pdf
>


Re: How to get GCC on par with ICC?

2018-06-06 Thread Paul Menzel

Dear Joel,


Thank you for your quick reply.


On 06/06/18 17:57, Joel Sherrill wrote:

On Wed, Jun 6, 2018 at 10:51 AM, Paul Menzel wrote:



Some scientists in our organization still want to use the Intel compiler,
as they say, it produces faster code, which is then executed on clusters.
Some resources on the Web [1][2] confirm this. (I am aware, that it’s
heavily dependent on the actual program.)


Do they have specific examples where icc is better for them? Or can point
to specific GCC PRs which impact them?

GCC versions?

Are there specific CPU model variants of concern?

What flags are used to compile? Some times a bit of advice can produce
improvements.

Without specific examples, it is hard to set goals.


I could get such examples, but it will take some time, as it’s from 
other institutes.


The clusters use exclusively Intel processors. (Hopefully, that will 
change.)


I also found the article from the German Linux-Magazin in an English 
version at the ADMIN Magazin [3]. The German article had a more strong 
statement, that they use the Intel compilers due to performance reasons.



My question is, is it realistic, that GCC could catch up and that the
scientists will start to use it over Intel’s compiler? Or will Intel
developers always have the lead, because they have secret documentation and
direct contact with the processor designers?

If it is realistic, how can we get there? Would first the program be
written, and then the compiler be optimized for that? Or are just more GCC
developers needed?


For sure examples are needed so there are test cases to use for reference.

If you want anything improved in any free software project, sponsoring
developers is always a good thing. If you sponsor the right developers. :)


That’s what I hoped for, but didn’t ask here. If you could point me to a 
list of possible contractors, that would be great.


Please keep in mind, that in my organization certain decisions are made 
*very* slowly. I’ll try to get answers quickly, but procuring finances 
might take longer (half a year or much longer).



Kind regards,

Paul



[1]: https://colfaxresearch.com/compiler-comparison/
[2]: 
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679.1280&rep=rep1&type=pdf
[3] 
http://www.admin-magazine.com/HPC/Articles/Selecting-Compilers-for-a-Supercomputer 
   "HPC Compilers"




smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to get GCC on par with ICC?

2018-06-06 Thread Joel Sherrill
On Wed, Jun 6, 2018 at 10:51 AM, Paul Menzel <
pmenzel+gcc.gnu@molgen.mpg.de> wrote:

> Dear GCC folks,
>
>
> Some scientists in our organization still want to use the Intel compiler,
> as they say, it produces faster code, which is then executed on clusters.
> Some resources on the Web [1][2] confirm this. (I am aware, that it’s
> heavily dependent on the actual program.)
>

Do they have specific examples where icc is better for them? Or can point
to specific GCC PRs which impact them?

GCC versions?

Are there specific CPU model variants of concern?

What flags are used to compile? Some times a bit of advice can produce
improvements.

Without specific examples, it is hard to set goals.


> My question is, is it realistic, that GCC could catch up and that the
> scientists will start to use it over Intel’s compiler? Or will Intel
> developers always have the lead, because they have secret documentation and
> direct contact with the processor designers?
>
> If it is realistic, how can we get there? Would first the program be
> written, and then the compiler be optimized for that? Or are just more GCC
> developers needed?
>

For sure examples are needed so there are test cases to use for reference.

If you want anything improved in any free software project, sponsoring
developers
is always a good thing. If you sponsor the right developers. :)

I'm not discouraging you. I just trying to turn this into something
actionable.

--joel sherrill


>
>
> Kind regards,
>
> Paul
>
>
> [1]: https://colfaxresearch.com/compiler-comparison/
> [2]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679
> .1280&rep=rep1&type=pdf
>
>


How to get GCC on par with ICC?

2018-06-06 Thread Paul Menzel

Dear GCC folks,


Some scientists in our organization still want to use the Intel 
compiler, as they say, it produces faster code, which is then executed 
on clusters. Some resources on the Web [1][2] confirm this. (I am aware, 
that it’s heavily dependent on the actual program.)


My question is, is it realistic, that GCC could catch up and that the 
scientists will start to use it over Intel’s compiler? Or will Intel 
developers always have the lead, because they have secret documentation 
and direct contact with the processor designers?


If it is realistic, how can we get there? Would first the program be 
written, and then the compiler be optimized for that? Or are just more 
GCC developers needed?



Kind regards,

Paul


[1]: https://colfaxresearch.com/compiler-comparison/
[2]: 
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.679.1280&rep=rep1&type=pdf




smime.p7s
Description: S/MIME Cryptographic Signature


Re: I want to know the information about the function arguments

2018-06-06 Thread David Malcolm
On Wed, 2018-06-06 at 13:04 +0200, Martin Jambor wrote:
> Hi,
> 
> On Wed, Jun 06 2018, 冠人 王 via gcc wrote:
> > When I modify the gcc source code, sometimes I do not know what
> > parameters does the function call.
> > For example, 
> > bool warn_if_unused_value(const tree exp,location_t locus){   
> > function declaration ...
> > }
> > I want to know what "exp" and "locus" are by using fprintf such as
> > fprintf(stderr,"%s\n%s\n",exp,locus) --> I know it does not work
> > since exp and locus is not strings
> > How should I do to know the content of variable "exp" and "locus" ?
> 
> For trees, look for example at:
> 
> - debug_tree (tree);
> - print_node (FILE *, const char *, tree, int);
> - print_node_brief (FILE *, const char *, const_tree, int);
> 
> For location_t, I *think* you need to expand it yourself first.  Look
> at
> how it is being done for example in tree-dump.c.
> 
> Generally speaking, for any given type, try searching for functions
> with
> "debug" or "dump" in their names that dump any particular type.

For a location_t, you can try adding a call to "inform" e.g.

  inform (locus, "some message");

This will emit a "note" diagnostic at the source location that "locus"
represents.

Alternatively, if you're already debugging the compiler in gdb, you can
call "inform" directly:

  (gdb) call inform (locus, "")

and it will emit a "note" diagnostic describing "locus".

FWIW, I've written some notes on debugging GCC here:
  https://dmalcolm.fedorapeople.org/gcc/newbies-guide/debugging.html


Hope this is helpful; good luck!
Dave


Re: I want to know the information about the function arguments

2018-06-06 Thread Martin Jambor
Hi,

On Wed, Jun 06 2018, 冠人 王 via gcc wrote:
> When I modify the gcc source code, sometimes I do not know what parameters 
> does the function call.
> For example, 
> bool warn_if_unused_value(const tree exp,location_t locus){    function 
> declaration ...
> }
> I want to know what "exp" and "locus" are by using fprintf such as
> fprintf(stderr,"%s\n%s\n",exp,locus) --> I know it does not work since exp 
> and locus is not strings
> How should I do to know the content of variable "exp" and "locus" ?

For trees, look for example at:

- debug_tree (tree);
- print_node (FILE *, const char *, tree, int);
- print_node_brief (FILE *, const char *, const_tree, int);

For location_t, I *think* you need to expand it yourself first.  Look at
how it is being done for example in tree-dump.c.

Generally speaking, for any given type, try searching for functions with
"debug" or "dump" in their names that dump any particular type.

HTH

Martin


RE: What is dump_file in gcc ?

2018-06-06 Thread Peryt, Sebastian
> Subject: What is dump_file in gcc ?
> 
> I have ever seen "fprintf(dump_file,"something writes into dump_file") many
> times.
> I want to know what dump_file is and how can I check its content ?

I'm not 100% sure, but my best guess is that this is related to GCC dumps, e.g. 
related to passes.
You can do -fdump-- where type can be e.g. rtl and pass the pass 
for which 
you want to gather information. I suppose there is more to those dumps, but 
this should get you started.

Sebastian
> 
>


What is dump_file in gcc ?

2018-06-06 Thread 冠人 王 via gcc
I have ever seen "fprintf(dump_file,"something writes into dump_file") many 
times.
I want to know what dump_file is and how can I check its content ?





I want to know the information about the function arguments

2018-06-06 Thread 冠人 王 via gcc
When I modify the gcc source code, sometimes I do not know what parameters does 
the function call.
For example, 
bool warn_if_unused_value(const tree exp,location_t locus){    function 
declaration ...
}
I want to know what "exp" and "locus" are by using fprintf such as
fprintf(stderr,"%s\n%s\n",exp,locus) --> I know it does not work since exp and 
locus is not strings
How should I do to know the content of variable "exp" and "locus" ?