gcc-4.9-20140105 is now available

2014-01-05 Thread gccadmin
Snapshot gcc-4.9-20140105 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.9-20140105/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.9 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/trunk revision 206348

You'll find:

 gcc-4.9-20140105.tar.bz2 Complete GCC

  MD5=9a5b1a6c76affaf92b9096a26dda9b71
  SHA1=cc4a375848dd2522580f0ba65139bababd0f566e

Diffs from 4.9-20131229 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.9
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: Remove spam in GCC mailing list

2014-01-05 Thread Christopher Faylor
On Sat, Dec 28, 2013 at 08:40:07PM +0900, Tae Wong wrote:
>You want to send a mail to python-dev at python dot org.
>
>The spam still exists in gcc-bugs mailing list:
>http://gcc.gnu.org/ml/gcc-bugs/2013-08/msg00689.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-08/msg00759.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-08/msg00776.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-08/msg01181.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-08/msg01586.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg01513.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg01946.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg01947.html
>http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg02011.html
>
>There's no reason that the gcc-bugs mailing list can post bug reports directly.
>
>Please delete spam messages from gcc-bugs.

These messages are, AFAIK, pointless.  I'm not aware of anyone working
as a spam removal service.  I am one of the admins for gcc.gnu.org and I
sure as @#$* am not paid enough to do this.  I do spend a lot of my time
trying to make sure that spam doesn't get through and that's the limit
of what I'm willing to do.

I'd think that a lot of this thread (especially the launchpad part)
is off-topic for this mailing list.

cgf


thread_local broken in gcc 4.8 ?

2014-01-05 Thread Conrad S
According to http://gcc.gnu.org/gcc-4.8/cxx0x_status.html
the keyword "thread_local" is supported in gcc 4.8 when using -std=c++11

However, thread_local seems broken.  Let's say we compile a multi-file
program that uses thread_local:
g++ a.cpp -c -o a.o -std=c++11
g++ b.cpp -c -o b.o -std=c++11
g++ a.o b.o -o prog -std=c++11

We get the following error:
b.o: In function `TLS wrapper function for foo_instance':
b.cpp:(.text._ZTW12foo_instance[_ZTW12foo_instance]+0x5): undefined
reference to `TLS init function for foo_instance'
collect2: error: ld returned 1 exit status

gcc --version
gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)


file foo.hpp:
class foo {
  public:
  inline  foo() {}
  inline ~foo() {}
  inline double bar() { return 123.456; }
  };


file a.cpp:
#include "foo.hpp"
thread_local foo foo_instance;


file b.cpp:
#include "foo.hpp"
extern thread_local foo foo_instance;

int main(int argc, char** argv) {
  double bar = foo_instance.bar();
  return 0;
  }


Finding a relevant place for a custom GCC pass

2014-01-05 Thread Sandeep K Chaudhary
Hi guys,

I want to write a pass which can find the calculations performed on
the right hand side of each statement. In the below example -

VAR1 = 1;
VAR1++;
VAR1 = VAR1 + 5;

I want to be able to capture the equivalent statements i.e.

VAR1 = 1;
VAR1 = 2;
VAR1 = 7;

To achieve this, I dumped various intermediate files using
"-fdump-tree-all'. I looked at all of them manually and found that
either the statements are non-evaluated (during initial stages) or
they are completely optimized, hence losing the intermediate
assignment calculations (during later stages). There is no pass which
generates dumps related to the intermediate assignment calculations.

I am not able to understand where I should aim to place my pass in
order to achieve the above mentioned functionality. Initially, I had
thought of writing IPA pass but I looked at 'copyprop' and 'forwprop'
dumps and saw that everything is optimized to the last statement. I am
not able to understand how a pass should be placed between GIMPLE
stage and later stages so that intermediate calculations such as the
ones mentioned above in the example, can be captured. Please provide
suggestions and help regarding this.

Thanks a lot in advance !

Regards,
Sandeep Chaudhary.


Re: Finding a relevant place for a custom GCC pass

2014-01-05 Thread Marc Glisse

On Sun, 5 Jan 2014, Sandeep K Chaudhary wrote:


Hi guys,

I want to write a pass which can find the calculations performed on
the right hand side of each statement. In the below example -

   VAR1 = 1;
   VAR1++;
   VAR1 = VAR1 + 5;

I want to be able to capture the equivalent statements i.e.

VAR1 = 1;
VAR1 = 2;
VAR1 = 7;

To achieve this, I dumped various intermediate files using
"-fdump-tree-all'. I looked at all of them manually and found that
either the statements are non-evaluated (during initial stages) or
they are completely optimized, hence losing the intermediate
assignment calculations (during later stages). There is no pass which
generates dumps related to the intermediate assignment calculations.

I am not able to understand where I should aim to place my pass in
order to achieve the above mentioned functionality. Initially, I had
thought of writing IPA pass but I looked at 'copyprop' and 'forwprop'
dumps and saw that everything is optimized to the last statement. I am
not able to understand how a pass should be placed between GIMPLE
stage and later stages so that intermediate calculations such as the
ones mentioned above in the example, can be captured. Please provide
suggestions and help regarding this.


Short answer: you can't.

You can either have your passe before ccp, and duplicate the functionality 
of ccp, or you can hack the ccp pass to insert your code in it, but I 
doubt there is a suitable plugin hook for that, so you may have to edit 
gcc's source code directly.


If you compile with -g and look at debug statements, the information is 
not completely lost after the pass that optimizes this to just VAR1 = 7, 
but it still wouldn't be convenient to use that for your purpose.


--
Marc Glisse


Re: Finding a relevant place for a custom GCC pass

2014-01-05 Thread Sandeep K Chaudhary
Thanks for the reply Marc !

If I place my pass before ccp then I guess I have to implement the
means to perform calculations on my own so that it can duplicate the
functionality of ccp, right? I will also look at the source code to
see if I can modify the source code directly. Is pass_ccp in
tree-ssa-ccp.c the correct one to look at? Please let me know.

Yes, I have tried the second option you suggested. It's not convenient
for my purpose.

Thanks and regards,
Sandeep.

On Sun, Jan 5, 2014 at 10:24 PM, Marc Glisse  wrote:
> On Sun, 5 Jan 2014, Sandeep K Chaudhary wrote:
>
>> Hi guys,
>>
>> I want to write a pass which can find the calculations performed on
>> the right hand side of each statement. In the below example -
>>
>>VAR1 = 1;
>>VAR1++;
>>VAR1 = VAR1 + 5;
>>
>> I want to be able to capture the equivalent statements i.e.
>>
>> VAR1 = 1;
>> VAR1 = 2;
>> VAR1 = 7;
>>
>> To achieve this, I dumped various intermediate files using
>> "-fdump-tree-all'. I looked at all of them manually and found that
>> either the statements are non-evaluated (during initial stages) or
>> they are completely optimized, hence losing the intermediate
>> assignment calculations (during later stages). There is no pass which
>> generates dumps related to the intermediate assignment calculations.
>>
>> I am not able to understand where I should aim to place my pass in
>> order to achieve the above mentioned functionality. Initially, I had
>> thought of writing IPA pass but I looked at 'copyprop' and 'forwprop'
>> dumps and saw that everything is optimized to the last statement. I am
>> not able to understand how a pass should be placed between GIMPLE
>> stage and later stages so that intermediate calculations such as the
>> ones mentioned above in the example, can be captured. Please provide
>> suggestions and help regarding this.
>
>
> Short answer: you can't.
>
> You can either have your passe before ccp, and duplicate the functionality
> of ccp, or you can hack the ccp pass to insert your code in it, but I doubt
> there is a suitable plugin hook for that, so you may have to edit gcc's
> source code directly.
>
> If you compile with -g and look at debug statements, the information is not
> completely lost after the pass that optimizes this to just VAR1 = 7, but it
> still wouldn't be convenient to use that for your purpose.
>
> --
> Marc Glisse



-- 
Thanks and regards,
Sandeep K Chaudhary.