Support to OpenACC and OpenMP 4.0 in GCC 4.9

2014-04-26 Thread Paolo Leoni
Hi all,
I'm a graduating Physics student from Italy. I'm actually working on
accelerators devices like GPU and Intel MIC, with a focus on OpenACC
api.

I'm very interested to OpenACC support in GCC, I know that there is a
branch that contains a basic implementation for it.

How can I build gcc with this branch?
What is the actual status of openacc implementation?

With a similar interest, I would like to merging support to OpenMP 4.0
"target" directives, I know that actually only host is used as fallback...

Thanks for any help.

Paolo L.


Re: How to access points-to information for function pointers

2014-04-26 Thread Swati Rathi


On Friday 25 April 2014 11:11 PM, Richard Biener wrote:

On April 25, 2014 5:54:09 PM CEST, Swati Rathi  
wrote:

Hello,

I am trying to print points-to information for SSA variables as below.

   for (i = 1; i < num_ssa_names; i++)
 {
   tree ptr = ssa_name (i);
   struct ptr_info_def *pi;

   if (ptr == NULL_TREE
   || SSA_NAME_IN_FREE_LIST (ptr))
 continue;

   pi = SSA_NAME_PTR_INFO (ptr);
   if (pi)
 dump_points_to_info_for (file, ptr);
 }

-
My test program is given below :

int main()
{
   int *p, i, j;
   void (*fp1)();

   if (i)
   {
 p = &i;
 fp1 = fun1;
   }
else
   {
 p = &j;
 fp1 = fun2;
   }

fp1();

   printf ("\n%d %d\n", *p, i);
   return 0;
}
-
I get the output as :-

p_1, points-to vars: { i j }
fp1_2, points-to vars: { }
-

Why is the pointees for function pointer not getting dumped?

It's just not saved.


Can we modify the code to preserve values for function pointer SSA names?
What is the reason that it is not preserved for function pointers?

Another alternative approach would be to replicate the code (of 
pass_ipa_pta) and use the information before deleting it.


Is there any other way to access this information?




How can I access this information?


Regards,
Swati






Re: IPA: Devirtualization versus placement new

2014-04-26 Thread Andrew Haley
On 04/25/2014 07:48 PM, Jakub Jelinek wrote:
> On Fri, Apr 25, 2014 at 08:23:22PM +0200, Jan Hubicka wrote:
>>> On 04/25/2014 03:14 PM, Volker Simonis wrote:
 Could you therefore please re-categorize this as devirt bug.
>>>
>>> It is an IPA bug.  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60965
>>
>> Now when I have interest from ubsan direction, I wanted to ask. Would it 
>> make sense to turn
>> those unreachables into traps with ubsan enabled? (similarly in the loop 
>> stuff)
> 
> With -fsanitize=undefined __builtin_unreachable is folded right away into a
> library call that will emit a message and then die.

In theory, yes.  With this one, though, gcc 4.9-compiled binary just
crashed with a segv.

Andrew.




Re: How to access points-to information for function pointers

2014-04-26 Thread Richard Biener
On April 26, 2014 12:31:34 PM CEST, Swati Rathi  
wrote:
>
>On Friday 25 April 2014 11:11 PM, Richard Biener wrote:
>> On April 25, 2014 5:54:09 PM CEST, Swati Rathi
> wrote:
>>> Hello,
>>>
>>> I am trying to print points-to information for SSA variables as
>below.
>>>
>>>for (i = 1; i < num_ssa_names; i++)
>>>  {
>>>tree ptr = ssa_name (i);
>>>struct ptr_info_def *pi;
>>>
>>>if (ptr == NULL_TREE
>>>|| SSA_NAME_IN_FREE_LIST (ptr))
>>>  continue;
>>>
>>>pi = SSA_NAME_PTR_INFO (ptr);
>>>if (pi)
>>>  dump_points_to_info_for (file, ptr);
>>>  }
>>>
>>> -
>>> My test program is given below :
>>>
>>> int main()
>>> {
>>>int *p, i, j;
>>>void (*fp1)();
>>>
>>>if (i)
>>>{
>>>  p = &i;
>>>  fp1 = fun1;
>>>}
>>> else
>>>{
>>>  p = &j;
>>>  fp1 = fun2;
>>>}
>>>
>>> fp1();
>>>
>>>printf ("\n%d %d\n", *p, i);
>>>return 0;
>>> }
>>> -
>>> I get the output as :-
>>>
>>> p_1, points-to vars: { i j }
>>> fp1_2, points-to vars: { }
>>> -
>>>
>>> Why is the pointees for function pointer not getting dumped?
>> It's just not saved.
>
>Can we modify the code to preserve values for function pointer SSA
>names?

Sure.

>What is the reason that it is not preserved for function pointers?

Nobody uses this information.

>Another alternative approach would be to replicate the code (of 
>pass_ipa_pta) and use the information before deleting it.
>
>Is there any other way to access this information?

You can of course recompute it when needed.

Richard.

>>
>>> How can I access this information?
>>>
>>>
>>> Regards,
>>> Swati
>>




gcc-4.7-20140426 is now available

2014-04-26 Thread gccadmin
Snapshot gcc-4.7-20140426 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.7-20140426/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.7 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch 
revision 209829

You'll find:

 gcc-4.7-20140426.tar.bz2 Complete GCC

  MD5=dd4844e15e216108ef06f75cb59beca1
  SHA1=9fceba64e20f6655f8124fbc89de77662f5e1ab0

Diffs from 4.7-20140419 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.7
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.