Re: [GSoC] Addition of ISL AST generation to Graphite

2014-07-06 Thread Roman Gareev
Sorry, I was going to fix this. Thank you very much!

--
   Cheers, Roman Gareev


[Patch, PR 61720] Clear regex BFS match queue after every iteration

2014-07-06 Thread Tim Shen
This bug shouldn't be introduced, if I wrote clearer code last summer.
Sorry :(. The _Executor is a little bit messy. The _M_match_queue is
not cleared because it's treated `globally` between iterations (in
_M_main_dispatch(..., __bfs)).

Add a new file general_testcases.cc; we can gradually move test cases
to this single file to reduce duplicated compilation in testing?


-- 
Regards,
Tim Shen


Re: [Patch, PR 61720] Clear regex BFS match queue after every iteration

2014-07-06 Thread Tim Shen
On Sun, Jul 6, 2014 at 1:56 AM, Tim Shen tims...@google.com wrote:
 This bug shouldn't be introduced, if I wrote clearer code last summer.
 Sorry :(. The _Executor is a little bit messy. The _M_match_queue is
 not cleared because it's treated `globally` between iterations (in
 _M_main_dispatch(..., __bfs)).

 Add a new file general_testcases.cc; we can gradually move test cases
 to this single file to reduce duplicated compilation in testing?

Here's the patch.


-- 
Regards,
Tim Shen
commit 61e59cd44a7b2c3f93febd055cc64dd758783a71
Author: timshen tims...@google.com
Date:   Sun Jul 6 01:40:32 2014 -0700

PR libstdc++/61720
* include/bits/regex_executor.tcc (_Executor::_M_main_dispatch):
Clear match queue for next use.
* testsuite/28_regex/general_testcases.cc: New file for general
testcases.

diff --git a/libstdc++-v3/include/bits/regex_executor.tcc 
b/libstdc++-v3/include/bits/regex_executor.tcc
index 38b8ff2..3c68668 100644
--- a/libstdc++-v3/include/bits/regex_executor.tcc
+++ b/libstdc++-v3/include/bits/regex_executor.tcc
@@ -137,6 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
   if (__match_mode == _Match_mode::_Exact)
__ret = _M_has_sol;
+  _M_states._M_match_queue.clear();
   return __ret;
 }
 
diff --git a/libstdc++-v3/testsuite/28_regex/general_testcases.cc 
b/libstdc++-v3/testsuite/28_regex/general_testcases.cc
new file mode 100644
index 000..e9edb8f
--- /dev/null
+++ b/libstdc++-v3/testsuite/28_regex/general_testcases.cc
@@ -0,0 +1,46 @@
+// { dg-options -std=gnu++11 }
+
+//
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// http://www.gnu.org/licenses/.
+
+#include regex
+#include testsuite_hooks.h
+#include testsuite_regex.h
+
+using namespace __gnu_test;
+using namespace std;
+
+// libstdc++/61720
+static void
+PR61720()
+{
+  string test = R(test\);
+  VERIFY(!regex_search_debug(test, regex(R(([^]|\\)*[^\\];
+  VERIFY(!regex_match_debug(test, regex(R(([^]|\\)*[^\\];
+  VERIFY(!regex_search_debug(test, regex(R(([^]|\\)*[^\\]),
+regex_constants::extended)));
+  VERIFY(!regex_match_debug(test, regex(R(([^]|\\)*[^\\]),
+   regex_constants::extended)));
+}
+
+int
+main()
+{
+  PR61720();
+  return 0;
+}


Re: [Patch, testsuite] PR61453 gfortran.dg/bind_c_array_params_2.f90 for targets where a call insn isn't call

2014-07-06 Thread Dominique Dhumieres
 On hppa, the ,%r2 uniquely identifies the call.  The test passes
 with -flto.

Then is the following patch OK for hppa*-*-*?

+++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90 2014-07-05 
22:20:49.0 +0200
@@ -16,7 +16,7 @@ integer :: aa(4,4)
 call test(aa)
 end
 
-! { dg-final { scan-assembler-times call\[^\n\r\]*myBindC 1 { target { ! { 
hppa*-*-hpux* } } } } }
-! { dg-final { scan-assembler-times call\[^\n\r\]*myBindC,%r2 1 { target { 
hppa*-*-hpux* } } } }
+! { dg-final { scan-assembler-times \[ \t\]_*myBindC 1 { target { ! { 
hppa*-*-hpux* } } } } }
+! { dg-final { scan-assembler-times myBindC,%r2 1 { target { hppa*-*-hpux* } 
} } }
 ! { dg-final { scan-tree-dump-times test \\\(parm\\. 1 original } }
 ! { dg-final { cleanup-tree-dump original } }

Dominique


[PATCH] microblaze: microblaze.md: Use 'SI' instead of 'VOID' for operand 1 of 'call_value_intern'

2014-07-06 Thread Chen Gang

  * microblaze/mocroblaze.md (call_value_intern): Use 'SI' instead of
  'VOID' for operand 1, just like 'call_internal1' has done.

The related warning:

  ../../gcc/gcc/config/microblaze/microblaze.md:2172: warning: operand 1 
missing mode?


Signed-off-by: Chen Gang gang.chen.5...@gmail.com
---
 gcc/config/microblaze/microblaze.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/microblaze/microblaze.md 
b/gcc/config/microblaze/microblaze.md
index 2bd5d72..9580221 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -2171,7 +2171,7 @@
 
 (define_insn call_value_intern
   [(set (match_operand:VOID 0 register_operand =d)
-(call (mem (match_operand:VOID 1 call_insn_operand ri))
+(call (mem (match_operand:SI 1 call_insn_operand ri))
   (match_operand:SI 2  i)))
(clobber (match_operand:SI 3 register_operand =d))]
   
-- 
1.7.11.7


Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-07-06 Thread Gerald Pfeifer
On Thu, 6 Feb 2014, Jakub Jelinek wrote:
 As discussed on IRC, this patch introduces two new attributes,
 so that the C library (and other headers) have a way to
 a) tell the compiler something about functions like aligned_alloc
or memalign
 b) tell the compiler the alignment of pointers returned say by malloc

Hmm, it looks these did not make it into gcc-4.9/changes.html?  Mind
adding something there, Jakub?

Gerald


Re: [patch i386]: Expand sibling-tail-calls via accumulator register

2014-07-06 Thread Iain Sandoe
Hello Kai,

On 28 May 2014, at 09:43, Kai Tietz wrote:

 Index: gcc/config/i386/i386.c
 ===
 --- gcc/config/i386/i386.c(revision 210985)
 +++ gcc/config/i386/i386.c(working copy)
 @@ -38893,7 +38893,16 @@ x86_output_mi_thunk (FILE *file,
  For our purposes here, we can get away with (ab)using a jump pattern,
  because we're going to do no optimization.  */
   if (MEM_P (fnaddr))
 -emit_jump_insn (gen_indirect_jump (fnaddr));
 +{
 +  if (sibcall_insn_operand (fnaddr, word_mode))
 + {
 +   tmp = gen_rtx_CALL (VOIDmode, fnaddr, const0_rtx);
 +  tmp = emit_call_insn (tmp);
 +  SIBLING_CALL_P (tmp) = 1;
 + }
 +  else
 + emit_jump_insn (gen_indirect_jump (fnaddr));
 +}
   else

As discussed in PR61387 and on IRC, this patch 
(http://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=211089), in particular 
the section above, causes massive regressions (~900 test fails) for 
x86_64-darwin*.

I have some questions and observations and would request some progress in 
resolving this.

FWIW, x86_64-darwin *passes* the test-cases you added with the patch series.



The section of code above will only fire  (1) we are PIC (2) we are not PECOFF 
(3) the target returns binds_local_p () false for the function (see lines 
38863-38871).

Observations:

A. AFAICT, the section of code above is _never_ exercised by x86_64-linux for a 
full bootstrap and regression test.
  -- so please could you identify how you tested it?
  -- whatever is done to resolve the current issue, it seems that an 
appropriate test-case is required.

B. You have considerably altered the behaviour of that code block without any 
amendment to the preceding comment.
  -- please update the comment to refect the changed behaviour.

the case is generated by:

  tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, fnaddr), UNSPEC_GOTPCREL);
  tmp = gen_rtx_CONST (Pmode, tmp);
  fnaddr = gen_const_mem (Pmode, tmp);

C. The code above seems pretty generic, grep doesn't reveal any different 
handling of UNSPEC_GOTPCREL for Darwin - what part of the Darwin implementation 
are you suggesting needs amendment?



Certainly, it is easy enough to make a patch to disable this operation on 
Darwin (and thus fix the regressions) -- however, I'd like to be sure that 
there is simply not some lurking issue, that has simply only manifested on 
Darwin so far.

thanks,
Iain



Re: [Patch, PR 61720] Clear regex BFS match queue after every iteration

2014-07-06 Thread Paolo Carlini

Hi,

On 07/06/2014 10:56 AM, Tim Shen wrote:

This bug shouldn't be introduced, if I wrote clearer code last summer.
Sorry :(. The _Executor is a little bit messy. The _M_match_queue is
not cleared because it's treated `globally` between iterations (in
_M_main_dispatch(..., __bfs)).

Add a new file general_testcases.cc; we can gradually move test cases
to this single file to reduce duplicated compilation in testing?
Patch itself looks obvious to me, but I don't understand the 
general_testcases.cc idea, do we have something similar elsewhere in 
library or compiler?!? I would say, let's just add a normal testcase and 
close the bug (mainline and branch I suppose)


Thanks,
Paolo.


Re: update address taken: don't drop clobbers

2014-07-06 Thread Marc Glisse

On Mon, 30 Jun 2014, Jeff Law wrote:


On 06/28/14 16:33, Marc Glisse wrote:

In an earlier version of the patch, I was using
get_or_create_ssa_default_def (cfun, sym);
(I was reusing the same variable). This passed bootstrap+testsuite on
all languages except for ada. Indeed, the compiler wanted to coalesce
several SSA_NAMEs, including those new ones, in out-of-ssa, but
couldn't.
And that's what you need to delve deeper into.  Why did it refuse to 
coalesce?


As long as the lifetimes do not overlap, then coalescing should have worked.


What is the lifetime of an SSA_NAME with a default definition? The way we 
handle it now, we start from the uses and go back to all blocks that can 
reach one of the uses, since there is no defining statement where we could 
stop (intuitively we should stop where the clobber was, if not earlier). 
This huge lifetime makes it very likely for such an SSA_NAME to conflict 
with others. And if an abnormal phi is involved, and thus we must 
coalesce, there is a problem.


The patch attached (it should probably use ssa_undefined_value_p with a 
new extra argument to say whether we care about partially-undefined) makes 
the lifetime of undefined local variables empty and lets the original 
patch work with:

  def = get_or_create_ssa_default_def (cfun, sym);
instead of creating a new variable.

However, I am not convinced reusing the same variable is necessarily the 
best thing. For warnings, we can create a new variable with the same name 
(with .1 added by gcc at the end) and copy the location info (I am not 
doing that yet), so little is lost. A new variable expresses more clearly 
that the value it holds is random crap. If I reuse the same variable, the 
SRA patch doesn't warn because SRA explicitly sets TREE_NO_WARNING (this 
can probably be changed, but that's starting to be a lot of changes). 
Creating a new variable is also more general. When reading *ssa_name after 
*ssa_name={v}{CLOBBER}; or after free(ssa_name); we have no variable to 
reuse so we will need to create a new undefined variable, and if a 
variable is global or a PARM_DECL, its default definition is not an 
undefined value (though it will probably happen in a different pass, so it 
doesn't have to behave the same).


(Side note: we don't seem to have any code to notice that:
a=phiundef,b
b=phiundef,a
means both phis can be replaced with undefined variables.)

Do you have any advice on the right direction?

--
Marc GlisseIndex: gcc/tree-ssa-live.c
===
--- gcc/tree-ssa-live.c (revision 212306)
+++ gcc/tree-ssa-live.c (working copy)
@@ -1086,20 +1086,28 @@ set_var_live_on_entry (tree ssa_name, tr
   if (stmt)
 {
   def_bb = gimple_bb (stmt);
   /* Mark defs in liveout bitmap temporarily.  */
   if (def_bb)
bitmap_set_bit (live-liveout[def_bb-index], p);
 }
   else
 def_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
 
+  /* An undefined local variable does not need to be very alive.  */
+  if (SSA_NAME_IS_DEFAULT_DEF (ssa_name))
+{
+  tree var = SSA_NAME_VAR (ssa_name);
+  if (var  TREE_CODE (var) == VAR_DECL  !is_global_var (var))
+   return;
+}
+
   /* Visit each use of SSA_NAME and if it isn't in the same block as the def,
  add it to the list of live on entry blocks.  */
   FOR_EACH_IMM_USE_FAST (use, imm_iter, ssa_name)
 {
   gimple use_stmt = USE_STMT (use);
   basic_block add_block = NULL;
 
   if (gimple_code (use_stmt) == GIMPLE_PHI)
 {
  /* Uses in PHI's are considered to be live at exit of the SRC block
@@ -1422,20 +1430,27 @@ verify_live_on_entry (tree_live_info_p l
  fprintf (stderr, \n);
}
  else
fprintf (stderr,  and there is no default def.\n);
}
}
}
  else
if (d == var)
  {
+   /* An undefined local variable does not need to be very
+  alive.  */
+   tree real_var = SSA_NAME_VAR (var);
+   if (real_var  TREE_CODE (real_var) == VAR_DECL
+!is_global_var (real_var))
+ continue;
+
/* The only way this var shouldn't be marked live on entry is
   if it occurs in a PHI argument of the block.  */
size_t z;
bool ok = false;
gimple_stmt_iterator gsi;
for (gsi = gsi_start_phis (e-dest);
 !gsi_end_p (gsi)  !ok;
 gsi_next (gsi))
  {
gimple phi = gsi_stmt (gsi);


Re: [Patch, testsuite] PR61453 gfortran.dg/bind_c_array_params_2.f90 for targets where a call insn isn't call

2014-07-06 Thread John David Anglin
I would change hppa*-*-hpux* to hppa*-*-*.  That's what I tested on  
hppa-linux.


I guess if \[ \t\]_*myBindC worked on hppa*-*-linux*, then it would  
probably work
on hpux and the target condition could be removed.  The reason hpux  
needed
special treatment originally is for every function call to an external  
symbol, there

is an .import directive containing the symbol name.

Dave

On 6-Jul-14, at 5:22 AM, Dominique Dhumieres wrote:


On hppa, the ,%r2 uniquely identifies the call.  The test passes
with -flto.


Then is the following patch OK for hppa*-*-*?

+++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-07-05  
22:20:49.0 +0200

@@ -16,7 +16,7 @@ integer :: aa(4,4)
call test(aa)
end

-! { dg-final { scan-assembler-times call\[^\n\r\]*myBindC 1  
{ target { ! { hppa*-*-hpux* } } } } }
-! { dg-final { scan-assembler-times call\[^\n\r\]*myBindC,%r2 1  
{ target { hppa*-*-hpux* } } } }
+! { dg-final { scan-assembler-times \[ \t\]_*myBindC 1 { target  
{ ! { hppa*-*-hpux* } } } } }
+! { dg-final { scan-assembler-times myBindC,%r2 1 { target  
{ hppa*-*-hpux* } } } }
! { dg-final { scan-tree-dump-times test \\\(parm\\. 1  
original } }

! { dg-final { cleanup-tree-dump original } }

Dominique



--
John David Anglin   dave.ang...@bell.net





Re: update address taken: don't drop clobbers

2014-07-06 Thread pinskia


 On Jul 6, 2014, at 7:23 AM, Marc Glisse marc.gli...@inria.fr wrote:
 
 On Mon, 30 Jun 2014, Jeff Law wrote:
 
 On 06/28/14 16:33, Marc Glisse wrote:
 In an earlier version of the patch, I was using
 get_or_create_ssa_default_def (cfun, sym);
 (I was reusing the same variable). This passed bootstrap+testsuite on
 all languages except for ada. Indeed, the compiler wanted to coalesce
 several SSA_NAMEs, including those new ones, in out-of-ssa, but
 couldn't.
 And that's what you need to delve deeper into.  Why did it refuse to 
 coalesce?
 
 As long as the lifetimes do not overlap, then coalescing should have worked.
 
 What is the lifetime of an SSA_NAME with a default definition? The way we 
 handle it now, we start from the uses and go back to all blocks that can 
 reach one of the uses, since there is no defining statement where we could 
 stop (intuitively we should stop where the clobber was, if not earlier). This 
 huge lifetime makes it very likely for such an SSA_NAME to conflict with 
 others. And if an abnormal phi is involved, and thus we must coalesce, there 
 is a problem.
 
 The patch attached (it should probably use ssa_undefined_value_p with a new 
 extra argument to say whether we care about partially-undefined) makes the 
 lifetime of undefined local variables empty and lets the original patch work 
 with:
  def = get_or_create_ssa_default_def (cfun, sym);
 instead of creating a new variable.
 
 However, I am not convinced reusing the same variable is necessarily the best 
 thing. For warnings, we can create a new variable with the same name (with .1 
 added by gcc at the end) and copy the location info (I am not doing that 
 yet), so little is lost. A new variable expresses more clearly that the value 
 it holds is random crap. If I reuse the same variable, the SRA patch doesn't 
 warn because SRA explicitly sets TREE_NO_WARNING (this can probably be 
 changed, but that's starting to be a lot of changes). Creating a new variable 
 is also more general. When reading *ssa_name after *ssa_name={v}{CLOBBER}; or 
 after free(ssa_name); we have no variable to reuse so we will need to create 
 a new undefined variable, and if a variable is global or a PARM_DECL, its 
 default definition is not an undefined value (though it will probably happen 
 in a different pass, so it doesn't have to behave the same).
 
 (Side note: we don't seem to have any code to notice that:
 a=phiundef,b
 b=phiundef,a
 means both phis can be replaced with undefined variables.)
 
 Do you have any advice on the right direction?

The below patch won't work for parameters. 

Thanks,
Andrew

 
 -- 
 Marc Glisse
 Index: gcc/tree-ssa-live.c
 ===
 --- gcc/tree-ssa-live.c(revision 212306)
 +++ gcc/tree-ssa-live.c(working copy)
 @@ -1086,20 +1086,28 @@ set_var_live_on_entry (tree ssa_name, tr
   if (stmt)
 {
   def_bb = gimple_bb (stmt);
   /* Mark defs in liveout bitmap temporarily.  */
   if (def_bb)
bitmap_set_bit (live-liveout[def_bb-index], p);
 }
   else
 def_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
 
 +  /* An undefined local variable does not need to be very alive.  */
 +  if (SSA_NAME_IS_DEFAULT_DEF (ssa_name))
 +{
 +  tree var = SSA_NAME_VAR (ssa_name);
 +  if (var  TREE_CODE (var) == VAR_DECL  !is_global_var (var))
 +return;
 +}
 +
   /* Visit each use of SSA_NAME and if it isn't in the same block as the def,
  add it to the list of live on entry blocks.  */
   FOR_EACH_IMM_USE_FAST (use, imm_iter, ssa_name)
 {
   gimple use_stmt = USE_STMT (use);
   basic_block add_block = NULL;
 
   if (gimple_code (use_stmt) == GIMPLE_PHI)
 {
  /* Uses in PHI's are considered to be live at exit of the SRC block
 @@ -1422,20 +1430,27 @@ verify_live_on_entry (tree_live_info_p l
  fprintf (stderr, \n);
}
  else
fprintf (stderr,  and there is no default def.\n);
}
}
}
  else
if (d == var)
  {
 +/* An undefined local variable does not need to be very
 +   alive.  */
 +tree real_var = SSA_NAME_VAR (var);
 +if (real_var  TREE_CODE (real_var) == VAR_DECL
 + !is_global_var (real_var))
 +  continue;
 +
/* The only way this var shouldn't be marked live on entry is
   if it occurs in a PHI argument of the block.  */
size_t z;
bool ok = false;
gimple_stmt_iterator gsi;
for (gsi = gsi_start_phis (e-dest);
 !gsi_end_p (gsi)  !ok;
 gsi_next (gsi))
  {
gimple phi = gsi_stmt (gsi);


Re: update address taken: don't drop clobbers

2014-07-06 Thread Marc Glisse

On Sun, 6 Jul 2014, pins...@gmail.com wrote:


The below patch won't work for parameters.


Er, that's why I am testing: TREE_CODE (var) == VAR_DECL
(and the patch passed the testsuite with all languages)

Could you be more specific about what won't work?

--
Marc Glisse



Re: [C/C++ PATCH] Implement -Wsizeof-array-argument (PR c/6940)

2014-07-06 Thread Jason Merrill

OK.

Jason


Re: [Patch, PR 61720] Clear regex BFS match queue after every iteration

2014-07-06 Thread Tim Shen
On Sun, Jul 6, 2014 at 7:08 AM, Paolo Carlini paolo.carl...@oracle.com wrote:
 Patch itself looks obvious to me, but I don't understand the
 general_testcases.cc idea, do we have something similar elsewhere in library
 or compiler?!? I would say, let's just add a normal testcase and close the
 bug (mainline and branch I suppose)

I've discussed this with Jon, but that thread unintentionally went out
of the mailing list. Here's the discussion:

On 28/06/14 10:06 -0700, Tim Shen wrote:

 On Sat, Jun 28, 2014 at 2:40 AM, Jonathan Wakely jwak...@redhat.com wrote:

 I think that would be very good for libstdc++, however as the regex
 tests are already the slowest part of the entire testsuite (due to the
 very slow compile times of the regex code) I'd be somewhat reluctant
 to add tons of new tests to every run. Maybe as an optional
 check-regex target though.


 I'd like to merge testcases to several huge files (char, wchar_t,
 dg-do compile, locales, etc.) to (greatly) reduce duplicated regex
 compilation.

 We do not really care the fine-grained test report, do we? We hope
 them all PASS.


Yes. As long as it's possible to tell which part of test fails when
something doesn't pass, that's fine.


-- 
Regards,
Tim Shen


Re: [C++] make TYPE_DECLs public for builtin type and templates

2014-07-06 Thread Jason Merrill

On 07/01/2014 07:40 PM, Jan Hubicka wrote:

I want to avoid the overhead of SCC hashing and canonical type computation for 
these
and here I want the concept of anonymous namespace types to be closed upwards.
That is if I have type that is not considered anonymous it should not be built 
from
non-anonymous types.

So here I need to test anonymity of non-class types...


OK.  If you want to cover all compound types, you have more code to 
write, to cover pointer/reference/offset types and parameter types of 
function/method types.


Jason



Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-06 Thread Jason Merrill

On 07/04/2014 05:13 AM, Dodji Seketeli wrote:

// preprocessed output
# 3 test.cpp 3 4
sys_token
# 3 test.cpp
3
# 3 test.cpp 3 4
sys_token



Yeah.  For Built-in tokens that are expanded like that we only do track
their the location of their expansion, not their spelling location.  So
this behaviour is expected as well.


But surely you can do something to avoid this useless line marker in 
this case?  A built-in token should never require a line change.


Jason



Re: Strenghten assumption about dynamic type changes (placement new)

2014-07-06 Thread Marek Polacek
On Fri, Jul 04, 2014 at 11:39:52PM +0200, Jan Hubicka wrote:
 Bootstrapped/regtested x86_64-linux, will commit it after bit more
 testing.
...
   * g++.dg/ipa/imm-devirt-1.C: Update testcase.
   * g++.dg/ipa/imm-devirt-2.C: Update testcase.

These testcases fail:

ERROR: g++.dg/ipa/imm-devirt-1.C  -std=gnu++98: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced
ERROR: g++.dg/ipa/imm-devirt-1.C  -std=gnu++11: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced
ERROR: g++.dg/ipa/imm-devirt-1.C  -std=gnu++1y: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced
ERROR: g++.dg/ipa/imm-devirt-2.C  -std=gnu++98: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced
ERROR: g++.dg/ipa/imm-devirt-2.C  -std=gnu++11: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced
ERROR: g++.dg/ipa/imm-devirt-2.C  -std=gnu++1y: error executing dg-final: 
couldn't compile regular expression pattern: parentheses () not balanced

I'm fixing that with the following (will commit as obvious).

2014-07-06  Marek Polacek  pola...@redhat.com

* g++.dg/ipa/imm-devirt-1.C: Fix regexp in dg-final.
* g++.dg/ipa/imm-devirt-2.C: Likewise.

diff --git gcc/testsuite/g++.dg/ipa/imm-devirt-1.C 
gcc/testsuite/g++.dg/ipa/imm-devirt-1.C
index 115277f..85f1a8f 100644
--- gcc/testsuite/g++.dg/ipa/imm-devirt-1.C
+++ gcc/testsuite/g++.dg/ipa/imm-devirt-1.C
@@ -62,6 +62,6 @@ int main (int argc, char *argv[])
a direct call.  */
 /* { dg-final { scan-tree-dump Inlining int middleman_1 einline  } } */
 /* { dg-final { scan-tree-dump Inlining int middleman_2 einline  } } */
-/* { dg-final { scan-tree-dump B::foo ( einline  } } */
+/* { dg-final { scan-tree-dump B::foo \\( einline  } } */
 /* { dg-final { scan-tree-dump-times OBJ_TYPE_REF 2 einline  } } */
 /* { dg-final { cleanup-tree-dump einline } } */
diff --git gcc/testsuite/g++.dg/ipa/imm-devirt-2.C 
gcc/testsuite/g++.dg/ipa/imm-devirt-2.C
index 58af089..db85487 100644
--- gcc/testsuite/g++.dg/ipa/imm-devirt-2.C
+++ gcc/testsuite/g++.dg/ipa/imm-devirt-2.C
@@ -92,5 +92,5 @@ int main (int argc, char *argv[])
 }
 
 /* We fold into thunk of C. Eventually we should inline the thunk.  */
-/* { dg-final { scan-tree-dump C::_ZThn24_N1C3fooEi ( einline  } } */
+/* { dg-final { scan-tree-dump C::_ZThn24_N1C3fooEi \\( einline  } } */
 /* { dg-final { cleanup-tree-dump einline } } */

Marek


Re: Strenghten assumption about dynamic type changes (placement new)

2014-07-06 Thread Dominique Dhumieres
 I'm fixing that with the following (will commit as obvious).

Marek,

With your patch g++.dg/ipa/imm-devirt-2.C sitll fails in 32 bit mode
because the mangling is C::_ZThn16_N1C3fooEi. This is fixed by something
such as 

--- ../_clean/gcc/testsuite/g++.dg/ipa/imm-devirt-2.C   2014-07-05 
23:22:52.0 +0200
+++ gcc/testsuite/g++.dg/ipa/imm-devirt-2.C 2014-07-06 18:03:59.0 
+0200
@@ -92,5 +92,5 @@ int main (int argc, char *argv[])
 }
 
 /* We fold into thunk of C. Eventually we should inline the thunk.  */
-/* { dg-final { scan-tree-dump C::_ZThn24_N1C3fooEi ( einline  } } */
+/* { dg-final { scan-tree-dump C::_ZThn\(16|24\)_N1C3fooEi \\( einline  } 
} */
 /* { dg-final { cleanup-tree-dump einline } } */

Dominique


Re: Make declaration of wide_int_storage match its definition

2014-07-06 Thread Trevor Saunders
On Sat, Jul 05, 2014 at 09:29:31PM +0200, Jakub Jelinek wrote:
 On Sat, Jul 05, 2014 at 09:25:50PM +0200, Gerald Pfeifer wrote:
  On Sat, 5 Jul 2014, pins...@gmail.com wrote:
   This patch is fine but c++ allows class and struct be used 
   interchangeable. If there is a compilers which does not it is broken 
   and should be report to them.  Yes that means clang is broken.
  
  Clang does allow for it (it actually is the stage 1 compiler on 
  FreeBSD 10, the platform I used for my tests); it just warns about 
  it.  About 400 times.
 
 That doesn't change anything that the warning is very much broken.
 In C++ struct is simply a class with default public:, class with a default
 private:, when you are just forward declaring it, whether it defaults to
 public: or private: doesn't matter at all, therefore the warning just
 enforces some weirdo clang coding style.

I thought the warning was to help people who care about MSVC and its
utterly broken mangling, but I also agree its a pretty silly warning
that I wouldn't mind turning off.

Trev

 
   Jakub


[GSoC][match-and-simplify] add few test-cases

2014-07-06 Thread Prathamesh Kulkarni
Hi,
This patch adds few test-cases for gimple match-and-simplfiy and
removes match-2.c

[gcc/testsuite/gcc.dg/tree-ssa]
* match-2.c: Remove.
* match-plusminus.c: New test-case.
* match-bitwise.c: Likewise.
* match-realimag.c: Likewise.

Thanks and Regards,
Prathamesh
Index: gcc/testsuite/gcc.dg/tree-ssa/match-2.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/match-2.c	(revision 212038)
+++ gcc/testsuite/gcc.dg/tree-ssa/match-2.c	(working copy)
@@ -1,211 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options -O1 -fdump-tree-forwprop-details }  */
-
-/* x + (-y) - x - y */
-int f1(int x, int y)
-{
-  int t1 = -y;
-  return x + t1; 
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) - y_\\d\+\\(D\\) forwprop1 } } */
-
-/* x - (-y) - y + x */
-int f2(int x, int y)
-{
-  int t1 = -y;
-  return x - t1; 
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= y_\\d\+\\(D\\) \\+ x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x + y) - x - y */
-int f3(int x, int y)
-{
-  int t1 = x + y;
-  return t1 - x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= y_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x - y) - x - -y */
-int f4(int x, int y)
-{
-  int t1 = x - y;
-  return t1 - x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= -y_\\d\+\\(D\\) forwprop1 } } */ 
-
-/* (x + y) - y - x */
-int f5(int x, int y)
-{
-  int t1 = x + y;
-  return t1 - y;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x - y) + y - x */
-int f6(int x, int y)
-{
-  int t1 = x - y;
-  return t1 + y;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x + cst1) + cst2 - x + (cst1 + cst2) */
-int f7(int x)
-{
-  int t1 = x + 3;
-  return t1 + 4;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) \\+ 7 forwprop1 } } */ 
-
-/* (cst1 - x) + cst2 - (cst1 + cst2) - x */
-int f8(int x)
-{
-  int t1 = 3 - x;
-  return t1 + 4;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= 7 - x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x  31)  1 - x  31 */
-int f9(int x)
-{
-  int t1 = x  31;
-  return t1  1;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= t1_\\d\+ forwprop1 } } */
-
-/* -(~x) - x + 1 */
-int f10(int x)
-{
-  int t1, t2;
-  t1 = ~x;
-  t2 = -t1;
-  return t2;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) \\+ 1 forwprop1 } } */
-
-/* x + ~x - -1 */
-int f11(int x)
-{
-  int t1 = ~x;
-  return t1 + x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= -1 forwprop1 } } */
-
-/* ~x + 1 - -x */
-int f12(int x)
-{
-  int t1 = ~x;
-  return t1 + 1;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= -x_\\d\+\\(D\\) forwprop1 } } */
-
-/* __real complex (__real x) = x */
-double f13(double x)
-{
-  _Complex double t1 = x;
-  return __real t1;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* __imag complex (__imag x) = x */
-double f14(double x)
-{
-  _Complex double t1 = x;
-  return __imag t1;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* x  x - x */
-int f15(int x)
-{
-  int t1 = x;
-  return t1  x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* x  ~x - 0 */
-int f16(int x)
-{
-  int t1 = ~x;
-  return t1  x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= 0 forwprop1 } } */
-
-/* x ^ x - 0 */
-int f17(int x)
-{
-  int t1 = x;
-  return t1 ^ x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= 0 forwprop1 } } */
-
-/* ~~x - 0 */
-int f18(int x)
-{
-  int t1 = ~x;
-  return ~t1;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x | y)  x - x */
-int f19(int x, int y)
-{
-  int t1 = x | y;
-  return t1  x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (x  y) | x - x */
-int f20(int x, int y)
-{
-  int t1 = x  y;
-  return t1 | x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\) forwprop1 } } */
-
-/* (~x  y) | x - x  y */
-int f21(int x, int y)
-{
-  int t1 = ~x;
-  int t2 = t1  y;
-  return t2 | x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\)  y_\\d\+\\(D\\) forwprop1 } } */
-
-/* (~x | y)  x - x  y */
-int f22(int x, int y)
-{
-  int t1 = ~x;
-  int t2 = t1 | y;
-  return t2  x;
-}
-/* { dg-final { scan-tree-dump gimple_match_and_simplified to \[^\n\r\]*= x_\\d\+\\(D\\)  y_\\d\+\\(D\\) 

[wwwdocs,RX,390] gcc-4.9/changes.html editorial

2014-07-06 Thread Gerald Pfeifer
Consistently use command-line option with a dash (cf. 
https://gcc.gnu.org/codingconventions.html).

Improve grammar in s390 entry.

Improve markup of RX entry (embedding command-line options in 
code.../code).


Applied.

Gerald

Index: gcc-4.9/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.9/changes.html,v
retrieving revision 1.74
diff -u -r1.74 changes.html
--- gcc-4.9/changes.html30 Jun 2014 16:49:34 -  1.74
+++ gcc-4.9/changes.html6 Jul 2014 19:23:26 -
@@ -485,7 +485,7 @@
and code-march=armv8-a+crypto/code options.
  /li
  li Initial support for ILP32 has now been added to the
-   compiler. This is now available through the command line option
+   compiler. This is now available through the command-line option
code-mabi=ilp32/code. Support for ILP32 is
considered experimental as the ABI specification is still beta.
  /li
@@ -531,8 +531,8 @@
and codemfpu=crypto-neon-fp-armv8/code options.
  /li
  li LRA is now on by default for the ARM target. This can be turned off
-   using the code-mno-lra/code option. This option is purely
-   transitionary command line option and will be removed in a future
+   using the code-mno-lra/code option. This option is a purely
+   transitionary command-line option and will be removed in a future
release. We are interested in any bug reports regarding functional and
performance regressions with LRA.
  /li
@@ -671,10 +671,9 @@
   hotpatching.  A certain amount of bytes is reserved before the
   function entry label plus a NOP is inserted at its very
   beginning to implement a backward jump when applying a patch.
-  The feature can either be enabled via command line
-  option code-mhotpatch/code for a compilation unit or can be
-  enabled per function using the codehotpatch/code
-  attribute./li
+  The feature can either be enabled per compilation unit via the
+  command-line option code-mhotpatch/code or per function using
+  the codehotpatch/code attribute./li
 liThe shrink wrap optimization is now supported on S/390 and
   enabled by default./li
 liA major rework of the routines to determine which registers
@@ -687,7 +686,8 @@
 h3 id=rxRX/h3
   ul
 li The port now allows to specify the RX100, RX200, and RX600 processors
-  with the command line options -mcpu=rx100, -mcpu=rx200 and -mcpu=rx600.
+  with the command-line options code-mcpu=rx100/code,
+  code-mcpu=rx200/code and code-mcpu=rx600/code.
 /li
   /ul
 


Re: [fortran, patch] IEEE intrinsic modules (ping)

2014-07-06 Thread FX
Dear Rainer,

 Unfortunately, while the patch works fine on Solaris/x86, it broke
 Solaris/SPARC bootstrap for trivial reasons: contrary to the ChangeLog,
 configure and config.h.in weren't regenerated, thus FPSETSTICKY
 wasn't defined.

I apologize. Thanks for checking in the fix.


 FAIL: gfortran.dg/ieee/ieee_6.f90   -Os  execution test
 
 The test aborts at l.47, but unfortunately I cannot print mode in gdb 7.7.

That’s weird, especially if that one fails but ieee_rounding_1.f90 works. Let 
me know if I can do anything to help debug this.


 The following patch corrects this, at the same time fixing this warning:
 
 /fpu-target.h:451:3: warning: implicit declaration of function 'assert' 
 [-Wimplicit-function-declaration]
   assert (sizeof(fpu_state_t) = GFC_FPE_STATE_BUFFER_SIZE);

Actually, it makes a lot of sense to change these into static assertions: this 
way, any target-specific issues with FP-state buffer size will show up at 
libgfortran-building-time, rather than be swept under the rug.

Since libgfortran is compiled with GCC, which supports _Static_assert since 
4.6, I propose the attached patch.
Built and tested on x86_64-linux, OK to commit?

FX




static_assert.ChangeLog
Description: Binary data


static_assert.diff
Description: Binary data


[wwwdocs] PATCH for Re: New French mirror

2014-07-06 Thread Gerald Pfeifer
Hi Tim,

On Wed, 2 Jul 2014, Tim Semeijn wrote:
 I have set up a French gcc mirror. It is located in Roubaix, France. 

isn't that where they like to torture bikes (and riders) once a year? ;-)

 It is reachable through http, ftp and rsync:
 
 http://mirror.bbln.nl/gcc
 ftp://mirror.bbln.nl/gcc
 rsync://mirror.bbln.nl/gcc
 
 This mirror is provided by BBLN. Could you add it to the mirrorlist?

Thanks for mirroring and letting us know.  I just added your services
to our mirror list per the patch below.

Gerald

Index: mirrors.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/mirrors.html,v
retrieving revision 1.221
diff -u -r1.221 mirrors.html
--- mirrors.html12 Aug 2013 19:52:08 -  1.221
+++ mirrors.html6 Jul 2014 21:59:27 -
@@ -20,6 +20,11 @@
 liCanada: a 
href=http://gcc.skazkaforyou.com;http://gcc.skazkaforyou.com/a, thanks to 
Sergey Ivanov (mirrors at skazkaforyou.com)/li
 liFrance (no snapshots): a 
href=ftp://ftp.lip6.fr/pub/gcc/;ftp.lip6.fr/a, thanks to ftpmaint at 
lip6.fr/li
 liFrance, Brittany: a 
href=ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/;ftp.irisa.fr/a, thanks 
to ftpmaint at irisa.fr/li
+liFrance, Roubaix:
+  a href=http://mirror.bbln.nl/gcc/;http://mirror.bbln.nl/gcc/a |
+  a href=ftp://mirror.bbln.nl/gcc;ftp://mirror.bbln.nl/gcc/a |
+  a href=rsync://mirror.bbln.nl/gccrsync://mirror.bbln.nl/gcc/a,
+  thanks to Tim Semeijn (n...@bbln.nl) and BBLN./li
 liFrance, Versailles: a href=ftp://ftp.uvsq.fr/pub/gcc/;ftp.uvsq.fr/a, 
thanks to ftpmaint at uvsq.fr/li
 liGermany, Berlin: a 
href=ftp://ftp.fu-berlin.de/unix/languages/gcc/;ftp.fu-berlin.de/a, thanks 
to ftp at fu-berlin.de/li
 liGermany: a href=ftp://ftp.gwdg.de/pub/misc/gcc/;ftp.gwdg.de/a, thanks 
to emoenke at gwdg.de/li


Re: [GOMP4, RFC] OpenMP4 offload support for Intel PHI targets.

2014-07-06 Thread Gerald Pfeifer
Hi Kirill,

On Wed, 2 Jul 2014, Kirill Yukhin wrote:
 I would like to announce creation of a dedicated branch gomp4-offload to 
 speed up review of FE-independent offload-related features.

mind documenting this in https://gcc.gnu.org/svn.html as well?

(If this requires more involved configuration as it seems, in
addition to the regular information on a branch there, perhaps
include a link to this message of yours?)

If you need help, let me know, I'll be happy to.

Gerald


[GRAPHITE] Replacement of isl_int by isl_val

2014-07-06 Thread Mircea Namolaru
Hello, 

In the isl library used by Graphite, isl_val replaced isl_val (that become 
obsolete). 

This patch implements the required changes in Graphite. 

No regressions for c/c++/fortran on x86-64 Linux. 

Mircea 

Index: gcc/graphite-interchange.c 
=== 
--- gcc/graphite-interchange.c (revision 212311) 
+++ gcc/graphite-interchange.c (working copy) 
@@ -29,6 +29,18 @@ 
#include isl/map.h 
#include isl/union_map.h 
#include isl/ilp.h 
+#include isl/val.h 
+/* For C++ linkage of C functions. 
+ Missing from isl/val_gmp.h in isl 0.12 versions. 
+ Appearing in isl/val_gmp.h in isl 0.13. 
+ To be removed when passing to isl 0.13. */ 
+#if defined(__cplusplus) 
+extern C { 
+#endif 
+#include isl/val_gmp.h 
+#if defined(__cplusplus) 
+} 
+#endif 
#include cloog/cloog.h 
#include cloog/isl/domain.h 
#endif 
@@ -79,13 +91,13 @@ 
isl_local_space *ls = isl_local_space_from_space (isl_map_get_space (map)); 
unsigned offset, nsubs; 
int i; 
- isl_int size, subsize; 
+ isl_ctx *ctx; 

+ isl_val *size, *subsize, *size1; 
+ 
res = isl_equality_alloc (ls); 
- isl_int_init (size); 
- isl_int_set_ui (size, 1); 
- isl_int_init (subsize); 
- isl_int_set_ui (subsize, 1); 
+ ctx = isl_local_space_get_ctx (ls); 
+ size = isl_val_int_from_ui (ctx, 1); 

nsubs = isl_set_dim (pdr-extent, isl_dim_set); 
/* -1 for the already included L dimension. */ 
@@ -98,18 +110,17 @@ 
isl_space *dc; 
isl_aff *aff; 

- res = isl_constraint_set_coefficient (res, isl_dim_out, offset + i, size); 
- 
+ size1 = isl_val_copy (size); 
+ res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, 
size); 
dc = isl_set_get_space (pdr-extent); 
aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); 
aff = isl_aff_set_coefficient_si (aff, isl_dim_in, i, 1); 
- isl_set_max (pdr-extent, aff, subsize); 
+ subsize = isl_set_max_val (pdr-extent, aff); 
isl_aff_free (aff); 
- isl_int_mul (size, size, subsize); 
+ size = isl_val_mul (size1, subsize); 
} 

- isl_int_clear (subsize); 
- isl_int_clear (size); 
+ isl_val_free (size); 

return res; 
} 
@@ -126,7 +137,7 @@ 
isl_aff *aff; 
isl_space *dc; 
isl_constraint *lma, *c; 
- isl_int islstride; 
+ isl_val *islstride; 
graphite_dim_t time_depth; 
unsigned offset, nt; 
unsigned i; 
@@ -239,10 +250,9 @@ 
aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); 
aff = isl_aff_set_coefficient_si (aff, isl_dim_in, offset - 1, -1); 
aff = isl_aff_set_coefficient_si (aff, isl_dim_in, offset + offset - 1, 1); 
- isl_int_init (islstride); 
- isl_set_max (set, aff, islstride); 
- isl_int_get_gmp (islstride, stride); 
- isl_int_clear (islstride); 
+ islstride = isl_set_max_val (set, aff); 
+ isl_val_get_num_gmp (islstride, stride); 
+ isl_val_free (islstride); 
isl_aff_free (aff); 
isl_set_free (set); 

Index: gcc/graphite-poly.c 
=== 
--- gcc/graphite-poly.c (revision 212311) 
+++ gcc/graphite-poly.c (working copy) 
@@ -28,6 +28,18 @@ 
#include isl/constraint.h 
#include isl/ilp.h 
#include isl/aff.h 
+#include isl/val.h 
+/* For C++ linkage of C functions. 
+ Missing from isl/val_gmp.h in isl 0.12 versions. 
+ Appearing in isl/val_gmp.h in isl 0.13. 
+ To be removed when passing to isl 0.13. */ 
+#if defined(__cplusplus) 
+extern C { 
+#endif 
+#include isl/val_gmp.h 
+#if defined(__cplusplus) 
+} 
+#endif 
#include cloog/cloog.h 
#include cloog/isl/domain.h 
#endif 
@@ -1029,11 +1041,8 @@ 
isl_set *transdomain; 
isl_space *dc; 
isl_aff *aff; 
- isl_int isllb, islub; 
+ isl_val *isllb, *islub; 

- isl_int_init (isllb); 
- isl_int_init (islub); 
- 
/* Map the iteration domain through the current scatter, and work 
on the resulting set. */ 
transdomain = isl_set_apply (isl_set_copy (pbb-domain), 
@@ -1046,15 +1055,14 @@ 

/* And find the min/max for that function. */ 
/* XXX isl check results? */ 
- isl_set_min (transdomain, aff, isllb); 
- isl_set_max (transdomain, aff, islub); 
+ isllb = isl_set_min_val (transdomain, aff); 
+ islub = isl_set_max_val (transdomain, aff); 

- isl_int_sub (islub, islub, isllb); 
- isl_int_add_ui (islub, islub, 1); 
- isl_int_get_gmp (islub, res); 
+ islub = isl_val_sub (islub, isllb); 
+ islub = isl_val_add_ui (islub, 1); 
+ isl_val_get_num_gmp (islub, res); 

- isl_int_clear (isllb); 
- isl_int_clear (islub); 
+ isl_val_free (islub); 
isl_aff_free (aff); 
isl_set_free (transdomain); 
} 
Index: gcc/graphite-optimize-isl.c 
=== 
--- gcc/graphite-optimize-isl.c (revision 212311) 
+++ gcc/graphite-optimize-isl.c (working copy) 
@@ -273,7 +273,7 @@ 
isl_aff *Aff; 
int PointDimension; /* ip */ 
int TileDimension; /* it */ 
- isl_int VectorWidthMP; 
+ isl_val *VectorWidthMP; 
int i; 

/* assert (0 = DimToVectorize  DimToVectorize  ScheduleDimensions);*/ 
@@ -304,10 +304,9 @@ 
Aff = isl_aff_zero_on_domain (LocalSpaceRange); 
Aff = isl_aff_set_constant_si (Aff, VectorWidth); 
Aff = 

Re: [Patch, Fortran] Update gfortran.texi's 2003/2008 status

2014-07-06 Thread Gerald Pfeifer
On Sat, 8 Mar 2014, Tobias Burnus wrote:
 An update the gfortran.texi's F2003/F2008 status.

I just made the following change on top.


Also, I noticed that you used British English for honour.  There are
now five uses of honor in gcc/fortran/* and five uses of honour.  In
gcc/doc, and in general, we use American English, and per

  https://gcc.gnu.org/codingconventions.html

we should use that.

I did not change this yet, to see whether there is any strong
opposition making things consistent.

Gerald

2014-07-07  Gerald Pfeifer  ger...@pfeifer.com

* gfortran.texi (Fortran 2003 status): Fix grammar.

Index: gfortran.texi
===
--- gfortran.texi   (revision 212307)
+++ gfortran.texi   (working copy)
@@ -926,7 +926,7 @@
 
 @item Minor I/O features: Rounding during formatted output, using of
 a decimal comma instead of a decimal point, setting whether a plus sign
-should appear for positive numbers. On system where @code{strtod} honours
+should appear for positive numbers. On systems where @code{strtod} honours
 the rounding mode, the rounding mode is also supported for input.
 
 @item


[patch,gomp-4_0-branch] openacc parallel reduction part 1

2014-07-06 Thread Cesar Philippidis
This patch is the first step to enabling parallel reductions in openacc.
The approach I'm using here is a bit different the to the existing
method in openmp. For clarity, consider the following example:

for (i = 0, i  n; i++)
  sum += 1;

Currently, gcc breaks up the for loop into m partitions, one per thread.
Each thread has it's own local sum, say sum_0. So the transformed loop
becomes:

sum_0 = 0;

for (i = lower; i  upper; i++)
  sum_0 += 1;

where, lower and upper are the loop boundaries for the current thread.

After the intermediate sums are finished, the openmp reduction uses an
atomic add to add sum_0 to sum. However, that's not very efficient on
massively parallel accelerators. Among other reasons, this sum is
sequential and there a lot of lock contention writing to the final sum
variable.

For accelerators using openacc, the new reduction stores the
intermediate values in an array. Once the loop nest has completed, a
parallel sum (or other operation) can be used to speedup that portion of
the reduction.

As mentioned earlier, this patch isn't complete yet. For starters, parts
of it depends on our internal ptx backend. I've temporarily remapped the
ptx dependencies to their openmp equivalent, but without a proper
openacc runtime this infrastructure won't do much. It also does not
preform the final reduction in parallel just yet; currently it only sets
up an array, and sequentially reduces the final result on the host.
Another limitation of our current implementation is that it does not
support private reduction variables, because we haven't got around to
implementing the private clause yet. Finally, parts of the test cases
are commented out because support for those reduction operators isn't
complete.

Thomas, is this patch OK for gomp-4_0-branch?

Thanks,
Cesar
2014-07-06  Cesar Philippidis  ce...@codesourcery.com
	Thomas Schwinge  tho...@codesourcery.com

	gcc/
	* omp-low.c (omp_get_id): New function.
	(lookup_reduction): New function.
	(maybe_lookup_reduction): New function.
	(build_outer_var_ref): Remove openacc assert.
	(new_omp_context): Preserve ctx-reduction_map.
	(scan_sharing_clauses): Handle OMP_CLAUSE_REDUCTION.
	(scan_oacc_offload): Initialize ctx-reduction_map.
	(lower_reduction_clauses): Handle OpenACC reductions.
	(omp_gimple_assign_with_ops): New function.
	(initialize_reduction_data): New function.
	(finalize_reduction_data): New function.
	(process_reduction_data): New function.
	(lower_oacc_offload): Handle reductions.
	* gcc/omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): New.

	gcc/c/
	* c-parser.c (c_parser_oacc_all_clauses): Handle
	PRAGMA_OMP_CLAUSE_REDUCTION.
	(OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK): Add
	PRAGMA_OMP_CLAUSE_REDUCTION.

	gcc/fortran/
	* types.def (BT_FN_INT_INT): New.

	gcc/testsuite/
	* gcc/testsuite/c-c++-common/goacc/reduction-1.c: New test.
	* gcc/testsuite/c-c++-common/goacc/reduction-2.c: New test.
	* gcc/testsuite/c-c++-common/goacc/reduction-3.c: New test.
	* gcc/testsuite/c-c++-common/goacc/reduction-4.c: New test.


diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 03852b4..97cb866 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -11332,6 +11332,10 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
 	  clauses = c_parser_oacc_data_clause (parser, c_kind, clauses);
 	  c_name = present_or_create;
 	  break;
+	case PRAGMA_OMP_CLAUSE_REDUCTION:
+	  clauses = c_parser_omp_clause_reduction (parser, clauses);
+	  c_name = reduction;
+	  break;
 	case PRAGMA_OMP_CLAUSE_SELF:
 	  clauses = c_parser_oacc_data_clause (parser, c_kind, clauses);
 	  c_name = self;
@@ -11706,7 +11710,8 @@ c_parser_oacc_kernels (location_t loc, c_parser *parser, char *p_name)
 */
 
 #define OACC_LOOP_CLAUSE_MASK		\
-	(OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_NONE)
+	( (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_COLLAPSE)		\
+	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_REDUCTION))
 
 static tree
 c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name)
@@ -11746,6 +11751,7 @@ c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name)
 	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYIN)	\
 	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYOUT)	\
 	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_PRESENT_OR_CREATE)	\
+	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_REDUCTION)		\
 	| (OMP_CLAUSE_MASK_1  PRAGMA_OMP_CLAUSE_VECTOR_LENGTH) )
 
 static tree
diff --git a/gcc/fortran/types.def b/gcc/fortran/types.def
index 59ac4c3..f733d9d 100644
--- a/gcc/fortran/types.def
+++ b/gcc/fortran/types.def
@@ -86,6 +86,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
 DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
 DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT)
+DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
 
 DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
 
diff --git a/gcc/omp-builtins.def b/gcc/omp-builtins.def
index 08b825c..419ec3a 100644

[Ping ^ 4] [PATCH] Fix PR 61225

2014-07-06 Thread Zhenqiang Chen
Ping?

Thanks!
-Zhenqiang

On 17 June 2014 12:53, Zhenqiang Chen zhenqiang.c...@linaro.org wrote:
 Ping?

 Thanks!
 -Zhenqiang

 On 9 June 2014 17:08, Zhenqiang Chen zhenqiang.c...@linaro.org wrote:
 Ping ^2?

 Thanks!
 -Zhenqiang

 On 28 May 2014 15:02, Zhenqiang Chen zhenqiang.c...@linaro.org wrote:
 Ping?

 Thanks!
 -Zhenqiang

 On 22 May 2014 17:52, Zhenqiang Chen zhenqiang.c...@linaro.org wrote:
 On 21 May 2014 20:43, Steven Bosscher stevenb@gmail.com wrote:
 On Wed, May 21, 2014 at 11:58 AM, Zhenqiang Chen wrote:
 Hi,

 The patch fixes the gcc.target/i386/pr49095.c FAIL in PR61225. The
 test case tends to check a peephole2 optimization, which optimizes the
 following sequence

 2: bx:SI=ax:SI
 25: ax:SI=[bx:SI]
 7: {ax:SI=ax:SI-0x1;clobber flags:CC;}
 8: [bx:SI]=ax:SI
 9: flags:CCZ=cmp(ax:SI,0)
 to
2: bx:SI=ax:SI
41: {flags:CCZ=cmp([bx:SI]-0x1,0);[bx:SI]=[bx:SI]-0x1;}

 The enhanced shrink-wrapping, which calls copyprop_hardreg_forward
 changes the INSN 25 to

 25: ax:SI=[ax:SI]

 Then peephole2 can not optimize it since two memory_operands look like
 different.

 To fix it, the patch adds another peephole2 rule to read one more
 insn. From the register copy, it knows the address is the same.

 That is one complex peephole2 to deal with a transformation like this.
 It seems to be like it's a too specific solution for a bigger problem.

 Could you please try one of the following solutions instead:

 1. Track register values for peephole2 and try different alternatives
 based on known register equivalences? E.g. in your example, perhaps
 there is already a REG_EQUAL/REG_EQUIV note available on insn 25 after
 copyprop_hardreg_forward, to annotate that [ax:SI] is equivalent to
 [bx:SI] at that point (or if that information is not available, it is
 not very difficult to make it available). Then you could try applying
 peephole2 on the original pattern but also on patterns modified with
 the known equivalences (i.e. try peephole2 on multiple equivalent
 patterns for the same insn). This may expose other peephole2
 opportunities, not just the specific one your patch addresses.

 Patch is updated according to the comment. There is no REG_EQUAL. So I
 add it when replace_oldest_value_reg.

 ChangeLog:
 2014-05-22  Zhenqiang Chen  zhenqiang.c...@linaro.org

 Part of PR rtl-optimization/61225
 * config/i386/i386-protos.h (ix86_peephole2_rtx_equal_p): New 
 proto.
 * config/i386/i386.c (ix86_peephole2_rtx_equal_p): New function.
 * regcprop.c (replace_oldest_value_reg): Add REG_EQUAL note when
 propagating to SET.

 diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
 index 39462bd..0c4a2b9 100644
 --- a/gcc/config/i386/i386-protos.h
 +++ b/gcc/config/i386/i386-protos.h
 @@ -42,6 +42,7 @@ extern enum calling_abi ix86_function_type_abi 
 (const_tree);

  extern void ix86_reset_previous_fndecl (void);

 +extern bool ix86_peephole2_rtx_equal_p (rtx, rtx, rtx, rtx);
  #ifdef RTX_CODE
  extern int standard_80387_constant_p (rtx);
  extern const char *standard_80387_constant_opcode (rtx);
 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
 index 6ffb788..583ebe8 100644
 --- a/gcc/config/i386/i386.c
 +++ b/gcc/config/i386/i386.c
 @@ -46856,6 +46856,29 @@ ix86_atomic_assign_expand_fenv (tree *hold,
 tree *clear, tree *update)
 atomic_feraiseexcept_call);
  }

 +/* OP0 is the SET_DEST of INSN and OP1 is the SET_SRC of INSN.
 +   Check whether OP1 and OP6 is equal.  */
 +
 +bool
 +ix86_peephole2_rtx_equal_p (rtx insn, rtx op0, rtx op1, rtx op6)
 +{
 +  rtx note;
 +
 +  if (!reg_overlap_mentioned_p (op0, op1)  rtx_equal_p (op1, op6))
 +return true;
 +
 +  gcc_assert (single_set (insn)
 +  op0 == SET_DEST (single_set (insn))
 +  op1 == SET_SRC (single_set (insn)));
 +
 +  note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
 +  if (note
 +   !reg_overlap_mentioned_p (op0, XEXP (note, 0))
 +   rtx_equal_p (XEXP (note, 0), op6))
 +return true;
 +
 +  return false;
 +}
  /* Initialize the GCC target structure.  */
  #undef TARGET_RETURN_IN_MEMORY
  #define TARGET_RETURN_IN_MEMORY ix86_return_in_memory
 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
 index 44e80ec..b57fc86 100644
 --- a/gcc/config/i386/i386.md
 +++ b/gcc/config/i386/i386.md
 @@ -16996,11 +16996,12 @@
  [(match_dup 0)
   (match_operand:SWI 2 nonmemory_operand)]))
   (clobber (reg:CC FLAGS_REG))])
 -   (set (match_dup 1) (match_dup 0))
 +   (set (match_operand:SWI 6 memory_operand) (match_dup 0))
 (set (reg FLAGS_REG) (compare (match_dup 0) (const_int 0)))]
(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
  peep2_reg_dead_p (4, operands[0])
 -!reg_overlap_mentioned_p (operands[0], operands[1])
 +ix86_peephole2_rtx_equal_p (peep2_next_insn (0), operands[0],
 + operands[1],