Re: Fix regression on PR46590 (slow compile with -O0)

2012-01-21 Thread Eric Botcazou
> It was supposed to not change the set of conflicts, no.  But I made a
> thinko, and sometimes too many conflicts are generated.  On the testcases
> I tried that wasn't the case, so thanks for finding one :)

You're welcome.  In fact, I should have installed it in the gnat.dg testsuite 
long ago but it had been created before -fstack-usage was contributed and then 
I forgot.  So it would be nice to install it once the regression is fixed, the 
incantation being modelled on that of gcc.dg/stack-usage-1.c:

-- { dg-do compile }
-- { dg-options "-fstack-usage" }

[...]

-- { dg-final { scan-stack-usage "" } }
-- { dg-final { cleanup-stack-usage } }

The expected stack usage is <= 100 bytes for x86 and x86-64.

> Trivially fixing the thinko (iterating over (work bit-and old_conflict) in
> the first inner loop) would fix the testcase but in general create too few
> conflicts, i.e. generate wrong code.  I need some time to think about this
> again.

OK, thanks in advance.

-- 
Eric Botcazou


Re: C++ testsuite PATCH to overhaul running of tests in C++11 mode

2012-01-21 Thread Richard Sandiford
A mere two months after you posted the patch:

Jason Merrill  writes:
> diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C 
> b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
> index 8802e98..19f1591 100644
> --- a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
> +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
> @@ -13,30 +13,22 @@ public:
>  };
>  
>  template 
> -void g() {}  // { dg-message "void g" }
> +void g() {}
>  template 
> -void h() {}  // { dg-message "void h" }
> +void h() {}
>  
>  
>  int main() {
>g<&A::f>();
>h<&A::i>();
>g<&B::f>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 24 }
>h<&B::j>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
> -  g<(void (A::*)()) &A::f>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 28 }
> -  h<(int A::*) &A::i>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 30 }
> +  g<(void (A::*)()) &A::f>(); // { dg-error "" "" { xfail c++11 } }
> +  h<(int A::*) &A::i>(); // { dg-error "" "" { xfail c++11 } }
>g<(void (A::*)()) &B::f>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 32 }
>h<(int A::*) &B::j>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 34 }
> -  g<(void (A::*)()) 0>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 36 }
> -  h<(int A::*) 0>(); // { dg-error "" } 
> -  // { dg-message "candidate" "candidate note" { target *-*-* } 38 }
> +  g<(void (A::*)()) 0>(); // { dg-error "" "" { target c++98 } }
> +  h<(int A::*) 0>(); // { dg-error "" "" { target c++98 } }
>  
>return 0;
>  }

Does this mean that the { target c++98 } lines are acceptable in C++11,
while the { xfail c++11 } lines are still errors in C++11, but aren't
detected?  (Daft question really, but wanted to check.)

The reason for asking is that the line:

g<(void (A::*)()) &B::f>(); // { dg-error "" } 

also fails for C++11 on targets that define TARGET_PTRMEMFUNC_VBIT_LOCATION
to ptrmemfunc_vbit_in_delta.  Is that expected, and if so, is the patch
below OK?  Or should I try to look at it a bit further first?

(This is the only failing C++ test on mips64-linux-gnu.)

Thanks,
Richard


gcc/testsuite/
* g++.old-deja/g++.pt/ptrmem6.C: xfail a test for ARM and MIPS
in C++11 mode.

Index: gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
===
--- gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C 2012-01-21 10:53:09.0 
+
+++ gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C 2012-01-21 10:57:31.0 
+
@@ -25,7 +25,7 @@ int main() {
   h<&B::j>(); // { dg-error "" } 
   g<(void (A::*)()) &A::f>(); // { dg-error "" "" { xfail c++11 } }
   h<(int A::*) &A::i>(); // { dg-error "" "" { xfail c++11 } }
-  g<(void (A::*)()) &B::f>(); // { dg-error "" } 
+  g<(void (A::*)()) &B::f>(); // { dg-error "" "" { xfail { c++11 && { 
arm*-*-* mips*-*-* } } } }
   h<(int A::*) &B::j>(); // { dg-error "" } 
   g<(void (A::*)()) 0>(); // { dg-error "" "" { target c++98 } }
   h<(int A::*) 0>(); // { dg-error "" "" { target c++98 } }


Re: [v3] proposed fix for libstdc++/49204 causes abi_check failure

2012-01-21 Thread Jonathan Wakely
On 20 January 2012 11:23, Paolo Carlini wrote:
> Hi,
>
>> Here's a different, partial fix for PR 49204, changing the timed waiting
>> functions to return future_status, but not returning
>> future_status::deferred, as that requires the ABI change detailed above.
>> This doesn't change the library ABI, but might still be too big a change for
>> 4.7 at this stage.
>
> I would be in favor of applying the patch.

OK, great, if I don't hear objections by Monday evening (London time)
I'll check it in.

Then I'd like to consider whether to apply the ABI-breaking part only
when the std::__7 versioned namespace and .so.7 lib are used.


Fix PR ada/46192

2012-01-21 Thread Eric Botcazou
This is a regression present since the 4.5.x series at least.  We generate 
wrong code (infinite loop for the testcase) for the renaming of a volatile 
packed array with an address clause.

Tested on i586-suse-linux, applied on the trunk, 4.6 and 4.5 branches.


2012-01-21  Eric Botcazou  

PR ada/46192
* gcc-interface/decl.c (gnat_to_gnu_entity) : In the case of a
renaming, preserve the volatileness through the indirection, if any.


2012-01-21  Eric Botcazou  

* gnat.dg/renaming5.ad[sb]: New test.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===
--- gcc-interface/decl.c	(revision 183348)
+++ gcc-interface/decl.c	(working copy)
@@ -1051,6 +1051,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 		   entity is always accessed indirectly through it.  */
 		else
 		  {
+		/* We need to preserve the volatileness of the renamed
+		   object through the indirection.  */
+		if (TREE_THIS_VOLATILE (gnu_expr)
+			&& !TYPE_VOLATILE (gnu_type))
+		  gnu_type
+			= build_qualified_type (gnu_type,
+		(TYPE_QUALS (gnu_type)
+		 | TYPE_QUAL_VOLATILE));
 		gnu_type = build_reference_type (gnu_type);
 		inner_const_flag = TREE_READONLY (gnu_expr);
 		const_flag = true;
-- PR ada/46192
-- Testcase by Rolf Ebert 

-- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }

with System; use System;

package body Renaming5 is

   type Bits_In_Byte is array (0 .. 7) of Boolean;
   pragma Pack (Bits_In_Byte);

   A : Bits_In_Byte;
   for A'Address use System'To_Address(16#c0#);
   pragma Volatile (A);

   B : Bits_In_Byte renames A;

   procedure Proc is
   begin
  while B (0) = False loop
 null;
  end loop;
   end;

end Renaming5;

-- { dg-final { scan-tree-dump-times "goto" 2 "optimized" } }
-- { dg-final { cleanup-tree-dump "optimized" } }
package Renaming5 is

   procedure Proc;

end Renaming5;


[Patch, Fortran, committed] PR 51913 - fix CLASS comparison

2012-01-21 Thread Tobias Burnus

Dear all,

I applied the attached patch as obvious after building and regtesting it 
on x86-64-linux. (Rev. 183368.)  I will backport it to 4.6. (It's a 
4.6/4.7 regression.)


While this patch is obvious, my initial plan was to compare the class 
container names (actual->ts.u.derived->name == 
formal->ts.u.derived->name). However, that will lead to surprising error 
messages - such as that the type does not match while only an 
"allocatable" is missing. (Check ordering issue; cf. class_dummy_3.f03.)


Tobias
2012-01-21  Tobias Burnus  

	PR fortran/51913
	* interface.c (compare_parameter): Fix CLASS comparison.

2012-01-21  Tobias Burnus  

	PR fortran/51913
	* gfortran.dg/class_47.f90: New.

diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 94f767d..9acd1fb 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1706,7 +1706,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
   return 0;
 }
 
-  /* F2003, 12.5.2.5.  */
+  /* F2008, 12.5.2.5.  */
   if (formal->ts.type == BT_CLASS
   && (CLASS_DATA (formal)->attr.class_pointer
   || CLASS_DATA (formal)->attr.allocatable))
@@ -1718,8 +1718,8 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
 			formal->name, &actual->where);
 	  return 0;
 	}
-  if (CLASS_DATA (actual)->ts.u.derived
-	  != CLASS_DATA (formal)->ts.u.derived)
+  if (!gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived,
+  CLASS_DATA (formal)->ts.u.derived))
 	{
 	  if (where)
 	gfc_error ("Actual argument to '%s' at %L must have the same "
--- /dev/null	2012-01-21 09:08:15.299688263 +0100
+++ gcc/gcc/testsuite/gfortran.dg/class_47.f90	2012-01-21 14:23:38.0 +0100
@@ -0,0 +1,40 @@
+! { dg-do compile }
+!
+! PR fortran/51913
+!
+! Contributed by Alexander Tismer
+!
+MODULE m_sparseMatrix
+
+  implicit none
+  
+  type :: sparseMatrix_t
+
+  end type sparseMatrix_t
+END MODULE m_sparseMatrix
+
+!===
+module m_subroutine
+!  USE m_sparseMatrix !< when uncommenting this line program works fine
+
+  implicit none
+
+  contains
+  subroutine test(matrix)
+use m_sparseMatrix
+class(sparseMatrix_t), pointer :: matrix
+  end subroutine
+end module
+
+!===
+PROGRAM main
+  use m_subroutine
+  USE m_sparseMatrix
+  implicit none
+
+  CLASS(sparseMatrix_t), pointer :: sparseMatrix
+  
+  call test(sparseMatrix)
+END PROGRAM
+
+! { dg-final { cleanup-modules "m_sparsematrix m_subroutine" } }


Re: C++ testsuite PATCH to overhaul running of tests in C++11 mode

2012-01-21 Thread Jason Merrill

On 01/21/2012 06:02 AM, Richard Sandiford wrote:

Does this mean that the { target c++98 } lines are acceptable in C++11,
while the { xfail c++11 } lines are still errors in C++11, but aren't
detected?


Right.


The reason for asking is that the line:

 g<(void (A::*)())&B::f>(); // { dg-error "" }

also fails for C++11 on targets that define TARGET_PTRMEMFUNC_VBIT_LOCATION
to ptrmemfunc_vbit_in_delta.  Is that expected, and if so, is the patch
below OK?  Or should I try to look at it a bit further first?


I'm not sure why that would be, but the patch is OK.  I wouldn't worry 
about trying to get this line right until we fix the other xfails.


Jason


Re: Keep static VTA locs in cselib tables only

2012-01-21 Thread Richard Sandiford
Alexandre Oliva  writes:
> On Nov 25, 2011, Jakub Jelinek  wrote:
>> The numbers I got with your patch (RTL checking) are below, seems
>> the cumulative numbers other than 100% are all bigger with patched stage2,
>> which means unfortunately debug info quality degradation.
>
> Not really.  I found some actual degradation after finally getting back
> to it.  In some cases, I failed to reset NO_LOC_P, and this caused
> expressions that depended on it to resort to alternate values or end up
> unset.  In other cases, we created different cselib values for debug
> temps and implicit ptrs, and merging them at dataflow confluences no
> longer found a common value because the common value was in cselib's
> static equivalence table.  I've fixed (and added an assertion to catch)
> left-over NO_LOC_Ps, and arranged for values created for debug exprs,
> implicit ptr, entry values and parameter refs to be preserved across
> basic blocks as constants within cselib.
>
> With that, the debug info we get is a strict improvement in terms of
> coverage, even though a bunch of .o files still display a decrease in
> 100% coverage.  In the handful files I examined, the patched compiler
> was emitting a loc list without full coverage, while the original
> compiler was emitting a single loc expr, that implicitly got full
> coverage even though AFAICT it should really cover a narrower range.
> Full coverage was a false positive, and less-than-100% coverage in these
> cases is not a degradation, but rather an improvement.
>
> Now, the reason why we emit additional expressions now is that the new
> algorithm is more prone to emitting different (and better) expressions
> when entering basic block, because we don't try as hard as before to
> keep on with the same location expression.  Instead we recompute all the
> potentially-changed expressions, which will tend to select better
> expressions if available.
>
>> Otherwise the patch looks good to me.
>
> Thanks.  After the updated comparison data below, you can find the patch
> I'm checking in, followed by the small interdiff from the previous
> patch.
>
>
> Happy GNU Year! :-)
>
>
> The results below can be reproduced with r182723.
>
> stage1 sources are patched, stage2 and stage3 aren't, so
> stage2 is built with a patched compiler, stage3 isn't.
>
> $ wc -l obj-{x86_64,i686}-linux-gnu/stage[23]-gcc/cc1plus.ev
>   100784 obj-x86_64-linux-gnu/stage2-gcc/cc1plus.ev
>   102406 obj-x86_64-linux-gnu/stage3-gcc/cc1plus.ev
>33275 obj-i686-linux-gnu/stage2-gcc/cc1plus.ev
>33944 obj-i686-linux-gnu/stage3-gcc/cc1plus.ev
>
> $ wc -l obj-{x86_64,i686}-linux-gnu/stage[23]-gcc/cc1plus.csv
>523647 obj-x86_64-linux-gnu/stage2-gcc/cc1plus.csv
>523536 obj-x86_64-linux-gnu/stage3-gcc/cc1plus.csv
>521276 obj-i686-linux-gnu/stage2-gcc/cc1plus.csv
>521907 obj-i686-linux-gnu/stage3-gcc/cc1plus.csv
>
> $ diff -yW80 obj-x86_64-linux-gnu/stage[23]-gcc/cc1plus.ls
> cov%samples cumul   cov%samples cumul
> 0.0 150949/30%  150949/30%| 0.0 150980/30%  150980/30%
> 0..56234/1% 157183/31%| 0..56254/1% 157234/31%
> 6..10   5630/1% 162813/32%| 6..10   5641/1% 162875/32%
> 11..15  4675/0% 167488/33%| 11..15  4703/0% 167578/33%
> 16..20  5041/1% 172529/34%| 16..20  5044/1% 172622/34%
> 21..25  5435/1% 177964/35%| 21..25  5466/1% 178088/35%
> 26..30  4249/0% 182213/36%| 26..30  4269/0% 182357/36%
> 31..35  4666/0% 186879/37%| 31..35  4674/0% 187031/37%
> 36..40  6939/1% 193818/38%| 36..40  6982/1% 194013/38%
> 41..45  7824/1% 201642/40%| 41..45  7859/1% 201872/40%
> 46..50  8538/1% 210180/42%| 46..50  8536/1% 210408/42%
> 51..55  7585/1% 217765/43%| 51..55  7611/1% 218019/43%
> 56..60  6088/1% 223853/44%| 56..60  6108/1% 224127/44%
> 61..65  5545/1% 229398/45%| 61..65  5574/1% 229701/46%
> 66..70  7151/1% 236549/47%| 66..70  7195/1% 236896/47%
> 71..75  8068/1% 244617/49%| 71..75  8104/1% 245000/49%
> 76..80  18852/3%263469/52%| 76..80  18879/3%263879/52%
> 81..85  11958/2%275427/55%| 81..85  11954/2%275833/55%
> 86..90  15201/3%290628/58%| 86..90  15145/3%290978/58%
> 91..95  16814/3%307442/61%| 91..95  16727/3%307705/61%
> 96..99  17121/3%324563/65%| 96..99  16991/3%324696/65%
> 100 174515/34%  499078/100%   | 100 173994/34%  498690/100%
>
> $ diff -yW80 obj-i686-linux-gnu/stage[23]-gcc/cc1plus.ls
> cov%samples cumul   cov%samples cumul
> 0.0 145453/27%  145453/27%| 0.0 145480/27%  145480/27%
> 0..56594/1% 152047/29%| 0..56603/1% 152083/29%
> 6..10   5664/1% 157711/30%| 6..10   5671/1% 157754/30%
> 11..15  4982/0% 162693/31%| 11..15  4997/0% 162751/31%
> 16..20  6155/

Re: [RFC combine] PR48308 - Fix issue with missing(?) LOG_LINKS

2012-01-21 Thread Eric Botcazou
> We then go and check if i1_feeds_into_i2 and that check relies on the
> LOG_LINKS being up-to-date. We find that i2 can be combined with i3
> *but* we've then gone and made a transformation that results in Y
> being used but miss out emitting the set of Y.
>
> The attached patch appears to fix the problem for the reduced testcase
> and reduced^2 testcase attached to PR48308.
>
> Unfortunately this doesn't fix the testcase from PR50313 which
> prima-facie was a dup of this bug which I'm still investigating. This
> has survived bootstrap on x86_64 and is running tests there ( though
> based on a quick reading of the x86 backend I couldn't find any
> parallels of that form) and is still undergoing a full bootstrap run
> on an ARM board.
>
> Thoughts ?

The un-combining thing around line 2800 is somewhat of a kludge and I wouldn't 
be surprised if there were other fallouts.  But your change is clearly correct 
and looks relatively safe, so OK for trunk and 4.6 branch after full testing.

-- 
Eric Botcazou


[PATCH,committed] PR Fortran/50556

2012-01-21 Thread Steve Kargl
I've committed the following patch after successful
build and regression testing and Tobias' approval 
in private email.

2012-01-21  Tobias Burnus  
Steven G. Kargl  

PR fortran/50556
* symbol.c (check_conflict): namelist-group-name cannot have the SAVE
attribute.

2012-01-21  Steven G. Kargl  

PR fortran/50556
* gfortran.dg/namelist_74.f90: New test.
* gfortran.dg/namelist_59.f90: Remove SAVE attribute.

-- 
Steve
Index: fortran/symbol.c
===
--- fortran/symbol.c	(revision 180650)
+++ fortran/symbol.c	(working copy)
@@ -444,12 +444,15 @@ check_conflict (symbol_attribute *attr, 
 a1 = gfc_code2string (flavors, attr->flavor);
 a2 = save;
 	goto conflict;
-
+	  case FL_NAMELIST:
+	gfc_error ("Namelist group name at %L cannot have the "
+		   "SAVE attribute", where);
+	return FAILURE; 
+	break;
 	  case FL_PROCEDURE:
 	/* Conflicts between SAVE and PROCEDURE will be checked at
 	   resolution stage, see "resolve_fl_procedure".  */
 	  case FL_VARIABLE:
-	  case FL_NAMELIST:
 	  default:
 	break;
 	}
Index: testsuite/gfortran.dg/namelist_59.f90
===
--- testsuite/gfortran.dg/namelist_59.f90	(revision 180650)
+++ testsuite/gfortran.dg/namelist_59.f90	(working copy)
@@ -16,7 +16,6 @@ subroutine process(string)
  integer :: i=1,j=2,k=3
  integer ios
  namelist /cmd/ i,j,k
- save cmd
  lines(1)='&cmd'
  lines(2)=string
  lines(3)='/'
Index: testsuite/gfortran.dg/namelist_74.f90
===
--- testsuite/gfortran.dg/namelist_74.f90	(revision 0)
+++ testsuite/gfortran.dg/namelist_74.f90	(revision 0)
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/50556
+subroutine foo
+   save i
+   namelist /i/ ii! { dg-error "cannot have a SAVE attribute" }
+end subroutine foo
+subroutine bar
+   namelist /i/ ii
+   save i ! { dg-error "cannot have a SAVE attribute" }
+end subroutine bar



Re: PING: Re: [PATCH] small build fix

2012-01-21 Thread Gerald Pfeifer
On Mon, 16 Jan 2012, Jakub Jelinek wrote:
> Ok.

I also updated the copyright year and whitespace for a different
#define and applied the patch below to trunk.

Thanks for the review (and patch)!

Gerald


* config/kfreebsd-gnu.h (GNU_USER_DYNAMIC_LINKERX32): New macro.
(GNU_USER_DYNAMIC_LINKER): Adjust indentation.

Index: config/kfreebsd-gnu.h
===
--- config/kfreebsd-gnu.h   (revision 183370)
+++ config/kfreebsd-gnu.h   (working copy)
@@ -1,5 +1,5 @@
 /* Definitions for kFreeBSD-based GNU systems with ELF format
-   Copyright (C) 2004, 2006, 2007, 2011
+   Copyright (C) 2004, 2006, 2007, 2011, 2012
Free Software Foundation, Inc.
Contributed by Robert Millan.
 
@@ -30,6 +30,7 @@
 }  \
   while (0)
 
-#define GNU_USER_DYNAMIC_LINKERGLIBC_DYNAMIC_LINKER
+#define GNU_USER_DYNAMIC_LINKERGLIBC_DYNAMIC_LINKER
 #define GNU_USER_DYNAMIC_LINKER32  GLIBC_DYNAMIC_LINKER32
 #define GNU_USER_DYNAMIC_LINKER64  GLIBC_DYNAMIC_LINKER64
+#define GNU_USER_DYNAMIC_LINKERX32 GLIBC_DYNAMIC_LINKERX32


Re: PING: Re: [PATCH] small build fix

2012-01-21 Thread Robert Millan
El 21 de gener de 2012 20:36, Gerald Pfeifer  ha escrit:
> On Mon, 16 Jan 2012, Jakub Jelinek wrote:
>> Ok.
>
> I also updated the copyright year and whitespace for a different
> #define and applied the patch below to trunk.
>
> Thanks for the review (and patch)!

Thanks to you!

Best regards

-- 
Robert Millan


[PATCH] Fix PR 50971 and PR 35629: Only one loop detected when there should be two

2012-01-21 Thread Andrew Pinski
The problem with these two bug reports is that the cfgloop does not do
a good job for disambiguating some loops.  This patch rewrites
find_subloop_latch_edge_by_ivs to be better.  It is able to detect
much more loops and gets the ones which are referenced in PR 50971 and
PR 35629.  It does make sure the loops it finds are really loops and
not ones where the continue would cause a loop not to be done.

OK for 4.8 when stage 1 comes?  Bootstrapped and tested on
x86_64-linux-gnu with no regressions.

ChangeLog:
cfgloop.c (skip_to_exit): New function.
(find_subloop_latch_edge_by_ivs): Rewrite to better detect subloop latches by
IVs.  Also look at the cfg for those IVs to check for a better choice.

testsuite/ChangeLog:
* gcc.dg/tree-ssa/loop-25.c: Remove xfails and remove "Found latch
edge"/"Merged latch edges" tests.
* gcc.dg/tree-ssa/loop-38.c: New testcase.
Index: testsuite/gcc.dg/tree-ssa/loop-25.c
===
--- testsuite/gcc.dg/tree-ssa/loop-25.c (revision 183364)
+++ testsuite/gcc.dg/tree-ssa/loop-25.c (working copy)
@@ -120,10 +120,8 @@ void test5 (void)
 
 /* { dg-final { scan-tree-dump-times "Disambiguating loop" 5 
"profile_estimate" } } */
 /* For the following xfail marks, see PR35629.  */
-/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile_estimate" { 
xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile_estimate" 
{ xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile_estimate" { 
xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile_estimate" { 
xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile_estimate" { 
xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile_estimate" } } 
*/
+/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile_estimate" } } 
*/
+/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile_estimate" } } 
*/
 
 /* { dg-final { cleanup-tree-dump "profile_estimate" } } */
Index: testsuite/gcc.dg/tree-ssa/loop-38.c
===
--- testsuite/gcc.dg/tree-ssa/loop-38.c (revision 0)
+++ testsuite/gcc.dg/tree-ssa/loop-38.c (revision 0)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-ch" } */
+
+typedef struct basket
+{
+int *a;
+int cost;
+int abs_cost;
+} BASKET;
+BASKET *perm[50 +300 +1];
+
+
+int f(int a, int *b, int cut)
+{
+  do {
+  while (perm[a]->abs_cost > cut)
+a++;
+  a++;
+  } while (b[a]);
+  return a;
+}
+
+/* { dg-final { scan-tree-dump-times "Disambiguating loop" 1 "ch" } } */
+/* { dg-final { scan-tree-dump-times "3 loops found" 1 "ch" } } */
+
+/* { dg-final { cleanup-tree-dump "ch" } } */
Index: cfgloop.c
===
--- cfgloop.c   (revision 183364)
+++ cfgloop.c   (working copy)
@@ -548,63 +548,200 @@ find_subloop_latch_edge_by_profile (VEC
   return me;
 }
 
+/* Return the basic block where we might be doing an exit from a loop
+   if we go back up the cfg starting at basic block B skipping other loops
+   on the way and join points too.  */
+static basic_block
+skip_to_exit (basic_block b, struct loop *loop, unsigned succ_edge_count)
+{
+  /* Skip to the begining of the loop if possible, we don't need to check
+ succ_edge count for loops. */
+  if (b->loop_father != loop)
+{
+  edge e;
+  edge_iterator ei;
+  edge preheader_e = NULL;
+
+  struct loop *oloop = b->loop_father;
+  /* There are multiple latches, we can't figure out the preheader,
+just return b. */
+  if (oloop->latch == NULL)
+   return NULL;
+  FOR_EACH_EDGE (e, ei, oloop->header->preds)
+if (e->src != oloop->latch && preheader_e == NULL)
+  preheader_e = e;
+   else if (e->src != oloop->latch && preheader_e != NULL)
+ {
+   preheader_e = NULL;
+   break;
+ }
+  /* Only one preheader edge.  */
+  if (preheader_e != NULL)
+return skip_to_exit (preheader_e->src, loop, 1);
+  else
+   return NULL;
+}
+  if (EDGE_COUNT (b->succs) != succ_edge_count)
+return b;
+  /* Skip basic blocks where it is just a passthrough. */
+  if (single_pred_p (b))
+return skip_to_exit (single_pred_edge (b)->src, loop, 1);
+  /* A join point, find the point where the join was from. */
+  /* FIXME should handle the case where we have more than two
+ predicates. */
+  if (EDGE_COUNT (b->preds) == 2)
+{
+  basic_block c, d;
+  if (EDGE_PRED (b, 0)->flags & EDGE_ABNORMAL
+ || EDGE_PRED (b, 1)->flags & EDGE_ABNORMAL)
+   return NULL;
+  c = skip_to_exit (EDGE_PRED (b, 0)->src, loop, 1);
+  if (c == NULL)
+   return NULL;
+  d = skip_to_exit (EDGE_PRED (b, 1)->src, loop, 1);
+  if (c == NULL)
+   return NULL;
+  if (c != d)
+   r

Go patch committed: Change type alias handling

2012-01-21 Thread Ian Lance Taylor
This patch to the Go frontend changes the way that type aliases are
handled.  This approach lets us use the same typename that the program
uses in error messages.  This patch also changes the rune type to be an
alias for int32 rather than for int, matching the similar change in the
gc Go compiler.  Along the same lines, this patch also changes the
default type of an untyped character constant to be rune rather than
int.  This required updating a few of the tests.  Bootstrapped and ran
Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Index: gcc/go/gofrontend/gogo.cc
===
--- gcc/go/gofrontend/gogo.cc	(revision 183359)
+++ gcc/go/gofrontend/gogo.cc	(working copy)
@@ -58,8 +58,9 @@ Gogo::Gogo(Backend* backend, Linemap* li
 	   RUNTIME_TYPE_KIND_INT8));
   this->add_named_type(Type::make_integer_type("int16", false,  16,
 	   RUNTIME_TYPE_KIND_INT16));
-  this->add_named_type(Type::make_integer_type("int32", false,  32,
-	   RUNTIME_TYPE_KIND_INT32));
+  Named_type* int32_type = Type::make_integer_type("int32", false,  32,
+		   RUNTIME_TYPE_KIND_INT32);
+  this->add_named_type(int32_type);
   this->add_named_type(Type::make_integer_type("int64", false,  64,
 	   RUNTIME_TYPE_KIND_INT64));
 
@@ -82,23 +83,22 @@ Gogo::Gogo(Backend* backend, Linemap* li
 		 RUNTIME_TYPE_KIND_INT);
   this->add_named_type(int_type);
 
-  // "byte" is an alias for "uint8".  Construct a Named_object which
-  // points to UINT8_TYPE.  Note that this breaks the normal pairing
-  // in which a Named_object points to a Named_type which points back
-  // to the same Named_object.
-  Named_object* byte_type = this->declare_type("byte", loc);
-  byte_type->set_type_value(uint8_type);
-  uint8_type->integer_type()->set_is_byte();
-
-  // "rune" is an alias for "int".
-  Named_object* rune_type = this->declare_type("rune", loc);
-  rune_type->set_type_value(int_type);
-  int_type->integer_type()->set_is_rune();
-
   this->add_named_type(Type::make_integer_type("uintptr", true,
 	   pointer_size,
 	   RUNTIME_TYPE_KIND_UINTPTR));
 
+  // "byte" is an alias for "uint8".
+  uint8_type->integer_type()->set_is_byte();
+  Named_object* byte_type = Named_object::make_type("byte", NULL, uint8_type,
+		loc);
+  this->add_named_type(byte_type->type_value());
+
+  // "rune" is an alias for "int32".
+  int32_type->integer_type()->set_is_rune();
+  Named_object* rune_type = Named_object::make_type("rune", NULL, int32_type,
+		loc);
+  this->add_named_type(rune_type->type_value());
+
   this->add_named_type(Type::make_named_bool_type());
 
   this->add_named_type(Type::make_named_string_type());
@@ -3830,7 +3830,12 @@ Variable::type_from_range(Expression* ex
 	return t->deref()->array_type()->element_type();
 }
   else if (t->is_string_type())
-return Type::lookup_integer_type("int");
+{
+  if (get_index_type)
+	return Type::lookup_integer_type("int");
+  else
+	return Type::lookup_integer_type("int32");
+}
   else if (t->map_type() != NULL)
 {
   if (get_index_type)
Index: gcc/go/gofrontend/runtime.def
===
--- gcc/go/gofrontend/runtime.def	(revision 183280)
+++ gcc/go/gofrontend/runtime.def	(working copy)
@@ -36,7 +36,7 @@ DEF_GO_RUNTIME(STRINGITER, "runtime.stri
 
 // Range over a string, returning the next index and character.
 DEF_GO_RUNTIME(STRINGITER2, "runtime.stringiter2", P2(STRING, INT),
-	   R2(INT, INT))
+	   R2(INT, RUNE))
 
 // Concatenate two strings.
 DEF_GO_RUNTIME(STRING_PLUS, "__go_string_plus", P2(STRING, STRING), R1(STRING))
Index: gcc/go/gofrontend/types.h
===
--- gcc/go/gofrontend/types.h	(revision 183340)
+++ gcc/go/gofrontend/types.h	(working copy)
@@ -401,6 +401,10 @@ class Type
   static Integer_type*
   make_abstract_integer_type();
 
+  // Make an abstract type for a character constant.
+  static Integer_type*
+  make_abstract_character_type();
+
   // Make a named integer type with a specified size.
   // RUNTIME_TYPE_KIND is the code to use in reflection information,
   // to distinguish int and int32.
@@ -1374,6 +1378,10 @@ class Integer_type : public Type
   static Integer_type*
   create_abstract_integer_type();
 
+  // Create an abstract character type.
+  static Integer_type*
+  create_abstract_character_type();
+
   // Whether this is an abstract integer type.
   bool
   is_abstract() const
@@ -2674,6 +2682,11 @@ class Named_type : public Type
   is_builtin() const
   { return Linemap::is_predeclared_location(this->location_); }
 
+  // Whether this is an alias.  There are currently two aliases: byte
+  // and rune.
+  bool
+  is_alias() const;
+
   // Whether this is a circular type: a pointer or function type that
   // refers to itself, which is not possible in C.
   bool
Index: gcc/go/gofronten

[v3] enable 30_threads tests on AIX

2012-01-21 Thread Jonathan Wakely
PR libstdc++/50982
* testsuite/30_threads/*: Add powerpc-ibm-aix* to target selectors.

This adds powerpc-ibm-aix* to the dg target selectors in 30_threads.
As explained in http://gcc.gnu.org/ml/libstdc++/2012-01/msg00126.html
those tests won't run by default, but can be run using:

make check RUNTESTFLAGS="--target_board=unix/-pthread"

I've tested this on x86_64-linux without problems and David has tested
a partial version of this patch on AIX.  I've committed it to trunk
and we'll monitor the AIX testresults for any new failures and deal
with them if/when they happen.


50982.txt.bz2
Description: BZip2 compressed data


libgo patch committed: Make print builtin match gc

2012-01-21 Thread Ian Lance Taylor
This patch to libgo makes the builtin print function match the gc
compiler's builtin print function exactly.  This changes how float,
complex, and pointer types are printed.  This is mainly for the benefit
of the testsuite, although consistency does not hurt.  Bootstrapped and
ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 990f03452000 libgo/runtime/go-print.c
--- a/libgo/runtime/go-print.c	Sat Jan 21 13:23:31 2012 -0800
+++ b/libgo/runtime/go-print.c	Sat Jan 21 13:53:57 2012 -0800
@@ -4,6 +4,7 @@
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.  */
 
+#include 
 #include 
 #include 
 
@@ -46,20 +47,95 @@
 }
 
 void
-__go_print_double (double val)
+__go_print_double (double v)
 {
-  fprintf (stderr, "%.24g", val);
+  char buf[20];
+  int e, s, i, n;
+  double h;
+
+  if (isnan (v))
+{
+  fputs ("NaN", stderr);
+  return;
+}
+  if (isinf (v))
+{
+  putc (v < 0 ? '-' : '+', stderr);
+  fputs ("Inf", stderr);
+  return;
+}
+
+  /* The number of digits printed.  */
+  n = 7;
+  /* The exponent.  */
+  e = 0;
+  /* The sign.  */
+  s = 0;
+  if (v != 0)
+{
+  if (v < 0)
+	{
+	  v = -v;
+	  s = 1;
+	}
+
+  /* Normalize.  */
+  while (v >= 10)
+	{
+	  ++e;
+	  v /= 10;
+	}
+  while (v < 1)
+	{
+	  --e;
+	  v *= 10;
+	}
+
+  /* Round.  */
+  h = 5;
+  for (i = 0; i < n; ++i)
+	h /= 10;
+
+  v += h;
+  if (v >= 10)
+	{
+	  ++e;
+	  v /= 10;
+	}
+}
+
+  /* The format is +d.+edd.  */
+  buf[0] = s ? '-' : '+';
+  for (i = 0; i < n; ++i)
+{
+  int d;
+
+  d = v;
+  buf[i + 2] = d + '0';
+  v -= d;
+  v *= 10;
+}
+  buf[1] = buf[2];
+  buf[2] = '.';
+
+  buf[n + 2] = 'e';
+  buf[n + 3] = e < 0 ? '-' : '+';
+  if (e < 0)
+e = - e;
+  buf[n + 4] = e / 100 + '0';
+  buf[n + 5] = (e / 10) % 10 + '0';
+  buf[n + 6] = e % 10 + '0';
+  buf[n + 7] = '\0';
+  fputs (buf, stderr);
 }
 
 void
 __go_print_complex (__complex double val)
 {
-  fprintf (stderr, "(%.24g%s%.24gi)",
-	  __builtin_creal (val),
-	  (__builtin_cimag (val) >= 0 || __builtin_isnan (__builtin_cimag(val))
-	   ? "+"
-	   : ""),
-	  __builtin_cimag (val));
+  putc ('(', stderr);
+  __go_print_double (__builtin_creal (val));
+  __go_print_double (__builtin_cimag (val));
+  fputs ("i)", stderr);
 }
 
 void
@@ -71,7 +147,7 @@
 void
 __go_print_pointer (void *val)
 {
-  fprintf (stderr, "%p", val);
+  fprintf (stderr, "0x%lx", (unsigned long) (uintptr_t) val);
 }
 
 void
@@ -89,5 +165,6 @@
 void
 __go_print_slice (struct __go_open_array val)
 {
-  fprintf (stderr, "[%d/%d]%p", val.__count, val.__capacity, val.__values);
+  fprintf (stderr, "[%d/%d]", val.__count, val.__capacity);
+  __go_print_pointer (val.__values);
 }


Go patch committed: Check for value method on dereferenced value

2012-01-21 Thread Ian Lance Taylor
In Go pointers are automatically dereferenced when calling value
methods.  However, the Go frontend was accidentally permitting a double
dereference when calling a method on a pointer value, which the language
does not permit.  This patch fixes the problem.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r f2a8b369a473 go/types.cc
--- a/go/types.cc	Sat Jan 21 13:57:44 2012 -0800
+++ b/go/types.cc	Sat Jan 21 14:18:52 2012 -0800
@@ -8605,6 +8605,7 @@
 
   // If this is a pointer to a pointer, then it is possible that the
   // pointed-to type has methods.
+  bool dereferenced = false;
   if (nt == NULL
   && st == NULL
   && it == NULL
@@ -8617,6 +8618,7 @@
 	return Expression::make_error(location);
   nt = type->points_to()->named_type();
   st = type->points_to()->struct_type();
+  dereferenced = true;
 }
 
   bool receiver_can_be_pointer = (expr->type()->points_to() != NULL
@@ -8656,6 +8658,12 @@
 	  else
 	go_unreachable();
 	  go_assert(m != NULL);
+	  if (dereferenced && m->is_value_method())
+	{
+	  error_at(location,
+		   "calling value method requires explicit dereference");
+	  return Expression::make_error(location);
+	}
 	  if (!m->is_value_method() && expr->type()->points_to() == NULL)
 	expr = Expression::make_unary(OPERATOR_AND, expr, location);
 	  ret = m->bind_method(expr, location);


Go patch committed: Avoid some compiler crashes

2012-01-21 Thread Ian Lance Taylor
This patch to the Go frontend avoids some compiler crashes on erroneous
code.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian


2012-01-21  Ian Lance Taylor  

* go-gcc.cc (Gcc_backend::type_size): Check for error_mark_node.
(Gcc_backend::type_alignment): Likewise.
(Gcc_backend::type_field_alignment): Likewise.
(Gcc_backend::type_field_offset): Likewise.


Index: gcc/go/go-gcc.cc
===
--- gcc/go/go-gcc.cc	(revision 183340)
+++ gcc/go/go-gcc.cc	(working copy)
@@ -778,7 +778,10 @@ Gcc_backend::is_circular_pointer_type(Bt
 size_t
 Gcc_backend::type_size(Btype* btype)
 {
-  tree t = TYPE_SIZE_UNIT(btype->get_tree());
+  tree t = btype->get_tree();
+  if (t == error_mark_node)
+return 1;
+  t = TYPE_SIZE_UNIT(t);
   gcc_assert(TREE_CODE(t) == INTEGER_CST);
   gcc_assert(TREE_INT_CST_HIGH(t) == 0);
   unsigned HOST_WIDE_INT val_wide = TREE_INT_CST_LOW(t);
@@ -792,7 +795,10 @@ Gcc_backend::type_size(Btype* btype)
 size_t
 Gcc_backend::type_alignment(Btype* btype)
 {
-  return TYPE_ALIGN_UNIT(btype->get_tree());
+  tree t = btype->get_tree();
+  if (t == error_mark_node)
+return 1;
+  return TYPE_ALIGN_UNIT(t);
 }
 
 // Return the alignment of a struct field of type BTYPE.
@@ -800,7 +806,10 @@ Gcc_backend::type_alignment(Btype* btype
 size_t
 Gcc_backend::type_field_alignment(Btype* btype)
 {
-  return go_field_alignment(btype->get_tree());
+  tree t = btype->get_tree();
+  if (t == error_mark_node)
+return 1;
+  return go_field_alignment(t);
 }
 
 // Return the offset of a field in a struct.
@@ -809,6 +818,8 @@ size_t
 Gcc_backend::type_field_offset(Btype* btype, size_t index)
 {
   tree struct_tree = btype->get_tree();
+  if (struct_tree == error_mark_node)
+return 0;
   gcc_assert(TREE_CODE(struct_tree) == RECORD_TYPE);
   tree field = TYPE_FIELDS(struct_tree);
   for (; index > 0; --index)
Index: gcc/go/gofrontend/types.cc
===
--- gcc/go/gofrontend/types.cc	(revision 183379)
+++ gcc/go/gofrontend/types.cc	(working copy)
@@ -9163,7 +9163,7 @@ Forward_declaration_type::do_type_descri
 {
   Location ploc = Linemap::predeclared_location();
   if (!this->is_defined())
-return Expression::make_nil(ploc);
+return Expression::make_error(ploc);
   else
 {
   Type* t = this->real_type();


Re: [PATCH] PR51280 LTO/trans-mem ICE with TM builtins

2012-01-21 Thread Patrick Marlier

On 01/20/2012 08:04 AM, Dominique Dhumieres wrote:

The following patch fixes the problem.


The test fails on *-apple-darwin*: pr51916.

TIA

Dominique


Dominique or Iain, may I ask you to test this patch on darwin? I have a 
sporadic access to a darwin machine.


Bootstrapped and tested on x86_64-unknown-linux-gnu.
--
Patrick.

PR lto/51916
* lto-object.c (LTO_SEGMENT_NAME): Define segment name.
(lto_obj_file_open): Use it.
Index: lto-wrapper.c
===
--- lto-wrapper.c	(revision 183345)
+++ lto-wrapper.c	(working copy)
@@ -54,6 +54,11 @@ along with GCC; see the file COPYING3.  If not see
 
 /* End of lto-streamer.h copy.  */
 
+/* Segment name for LTO sections.  This is only used for Mach-O.
+   FIXME: This needs to be kept in sync with darwin.c.  */
+
+#define LTO_SEGMENT_NAME "__GNU_LTO"
+
 int debug;/* true if -save-temps.  */
 int verbose;/* true if -v.  */
 
@@ -479,7 +484,8 @@ run_gcc (unsigned argc, char *argv[])
   fd = open (argv[i], O_RDONLY);
   if (fd == -1)
 	continue;
-  sobj = simple_object_start_read (fd, file_offset, NULL, &errmsg, &err);
+  sobj = simple_object_start_read (fd, file_offset, LTO_SEGMENT_NAME,
+   &errmsg, &err);
   if (!sobj)
 	{
 	  close (fd);


Re: [PATCH] PR51280 LTO/trans-mem ICE with TM builtins

2012-01-21 Thread Patrick Marlier

On 01/20/2012 08:04 AM, Dominique Dhumieres wrote:

The following patch fixes the problem.


The test fails on *-apple-darwin*: pr51916.

TIA

Dominique


Dominique or Iain, may I ask you to test this patch on darwin? I have a 
sporadic access to a darwin machine.


Bootstrapped and tested on x86_64-unknown-linux-gnu.
--
Patrick.

PR lto/51916
* lto-object.c (LTO_SEGMENT_NAME): Define segment name.
(lto_obj_file_open): Use it.
Index: lto-wrapper.c
===
--- lto-wrapper.c	(revision 183345)
+++ lto-wrapper.c	(working copy)
@@ -54,6 +54,11 @@ along with GCC; see the file COPYING3.  If not see
 
 /* End of lto-streamer.h copy.  */
 
+/* Segment name for LTO sections.  This is only used for Mach-O.
+   FIXME: This needs to be kept in sync with darwin.c.  */
+
+#define LTO_SEGMENT_NAME "__GNU_LTO"
+
 int debug;/* true if -save-temps.  */
 int verbose;/* true if -v.  */
 
@@ -479,7 +484,8 @@ run_gcc (unsigned argc, char *argv[])
   fd = open (argv[i], O_RDONLY);
   if (fd == -1)
 	continue;
-  sobj = simple_object_start_read (fd, file_offset, NULL, &errmsg, &err);
+  sobj = simple_object_start_read (fd, file_offset, LTO_SEGMENT_NAME,
+   &errmsg, &err);
   if (!sobj)
 	{
 	  close (fd);


[PATCH][Cilkplus] Builtin Array Notation functions in C++ Compiler

2012-01-21 Thread Iyer, Balaji V
Hello Everyone,
This patch is for the Cilkplus branch in the C++ compiler. This patch will 
implement builtin functions for array notations.

Thanking You,

Yours Sincerely,

Balaji V. Iyer.
diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk
index 8d65ca2..11eca8e 100644
--- a/gcc/ChangeLog.cilk
+++ b/gcc/ChangeLog.cilk
@@ -1,4 +1,11 @@
-2011-01-16  Balaji V. Iyer  
+2012-01-20  Balaji V. Iyer  
+
+   * Makefile.in: Added array-notation-common.c file for compilation.
+   * array-notation-common.c (mark_cold): New function.
+   (array_notation_init_builtins): Likewise.
+   * tree.h: Added a new enum list called "array_notation_reduce_type."
+   
+2012-01-16  Balaji V. Iyer  
 
* cilk.c (cilk_remove_annotated_functions): Added a int cast for
VEC_length in for-loop condition.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 9732ffc..76d2bc0 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1452,6 +1452,7 @@ OBJS = \
xcoffout.o \
 cilk.o \
 cilk-low.o \
+   array-notation-common.o \
$(out_object_file) \
$(EXTRA_OBJS) \
$(host_hook_obj)
@@ -3437,6 +3438,8 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) 
coretypes.h \
 
 
 
+array-notation-common.o: array-notation-common.c $(CONFIG_H) $(SYSTEM_H) \
+$(TREE_H) $(RTL_H) $(OPTABS_H) $(GIMPLE_H) $(RECOG_H) 
 
 cilk.o: cilk.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(OPTABS_H) \
$(GIMPLE_H) $(RECOG_H) cilk.h
diff --git a/gcc/array-notation-common.c b/gcc/array-notation-common.c
new file mode 100644
index 000..059adc4
--- /dev/null
+++ b/gcc/array-notation-common.c
@@ -0,0 +1,101 @@
+/* This file is part of the Intel(R) Cilk(TM) Plus support
+   This file contains the builtin functions for Array
+   notations.
+   Copyright (C) 2012  Free Software Foundation, Inc.
+   Contributed by Balaji V. Iyer ,
+  Intel Corporation
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING3.  If not see
+.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "langhooks.h"
+#include "expr.h"
+#include "optabs.h" /* for sync_lock_release in detach */
+#include "recog.h"
+#include "cilk.h"
+#include "gimple.h"
+#include "tree-iterator.h"
+#include "c-family/c-common.h"
+#include "toplev.h" /* only correct declaration of warning() */
+#include "output.h"
+#include "dwarf2out.h"
+
+static void
+mark_cold (tree fndecl)
+{
+  DECL_ATTRIBUTES (fndecl) = tree_cons (get_identifier ("cold"), NULL_TREE,
+   DECL_ATTRIBUTES (fndecl));
+}
+
+void
+array_notation_init_builtins (void)
+{
+  tree func_type = NULL_TREE;
+  tree new_func = NULL_TREE;
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_add", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_mul", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_all_zeros", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_any_zeros", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_max", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+  
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,
+   NULL_TREE);
+  new_func = build_fn_decl ("__sec_reduce_min", func_type);
+  mark_cold (new_func);
+  new_func = lang_hooks.decls.pushdecl (new_func);
+
+  func_type = build_function_type_list (integer_type_node, ptr_type_node,

Re: [PATCH] RFC: Interix resurrection

2012-01-21 Thread Douglas Rupp

Ping.
Patch retested with 1/18/2012 sources.

On 1/1/2012 1:01 PM, Douglas Rupp wrote:

This is for 32bit, "C" language only.
Tested by cross and then cross-native from x86_64 Linux

--Doug