libgo patch committed: Always use $(AM_LDFLAGS)

2011-04-06 Thread Ian Lance Taylor
This patch to the libgo Makefile ensures that we always use
$(AM_LDFLAGS) when linking libgo.la.  This is required so that we pass
-fsplit-stack to the link command, which tells the gcc driver to wrap
pthread_create.  Without this, most Go tests failed when not using
gold.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

diff -r 7faca938d612 libgo/Makefile.am
--- a/libgo/Makefile.am	Tue Apr 05 14:09:53 2011 -0700
+++ b/libgo/Makefile.am	Tue Apr 05 22:52:32 2011 -0700
@@ -1511,7 +1511,7 @@
 
 libgo_la_SOURCES = $(runtime_files)
 
-libgo_la_LDFLAGS = $(PTHREAD_CFLAGS)
+libgo_la_LDFLAGS = $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
 
 libgo_la_LIBADD = \
 	$(libgo_go_objs) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)


Remove obsolete ??? comment in profile.c

2011-04-06 Thread Eric Botcazou
This is

  location_t curr_location = single_succ_edge (bb)-goto_locus;
  /* ??? The FILE/LINE API is inconsistent for these cases.  */
  output_location (LOCATION_FILE (curr_location),
   LOCATION_LINE (curr_location), offset, bb);

which dates back to the pre-location-map days.  Moreover, the double call to 
expand_location hidden behind the LOCATION_FILE and LOCATION_LINE macros can 
be eliminated like a few lines above.

Tested on x86_64-suse-linux, applied on the mainline as obvious.


2011-04-06  Eric Botcazou  ebotca...@adacore.com

* profile.c (branch_prob): Move declaration of local variable.  Remove
obsolete ??? comment.  Expand the location explicitly instead of using
the LOCATION_FILE and LOCATION_LINE macros.


-- 
Eric Botcazou
Index: profile.c
===
--- profile.c	(revision 172018)
+++ profile.c	(working copy)
@@ -1123,16 +1123,13 @@ branch_prob (void)
   /* Line numbers.  */
   if (coverage_begin_output ())
 {
-  gcov_position_t offset;
-
   /* Initialize the output.  */
   output_location (NULL, 0, NULL, NULL);
 
   FOR_EACH_BB (bb)
 	{
 	  gimple_stmt_iterator gsi;
-
-	  offset = 0;
+	  gcov_position_t offset = 0;
 
 	  if (bb == ENTRY_BLOCK_PTR-next_bb)
 	{
@@ -1150,15 +1147,14 @@ branch_prob (void)
  offset, bb);
 	}
 
-	  /* Notice GOTO expressions we eliminated while constructing the
-	 CFG.  */
+	  /* Notice GOTO expressions eliminated while constructing the CFG.  */
 	  if (single_succ_p (bb)
 	   single_succ_edge (bb)-goto_locus != UNKNOWN_LOCATION)
 	{
-	  location_t curr_location = single_succ_edge (bb)-goto_locus;
-	  /* ??? The FILE/LINE API is inconsistent for these cases.  */
-	  output_location (LOCATION_FILE (curr_location),
-			   LOCATION_LINE (curr_location), offset, bb);
+	  expanded_location curr_location
+		= expand_location (single_succ_edge (bb)-goto_locus);
+	  output_location (curr_location.file, curr_location.line,
+			   offset, bb);
 	}
 
 	  if (offset)


Re: [patch, ARM] Make 128 bits the default vector size for NEON

2011-04-06 Thread Ira Rosen
On 5 April 2011 15:30, Ramana Radhakrishnan
ramana.radhakrish...@linaro.org wrote:
 On 31/03/11 12:39, Ira Rosen wrote:

 Hi,

 This patch changes NEON's default vector size from 64 to 128 bits.

 The patch doesn't touch mvectorize-with-neon-quad, but removes the
 uses of TARGET_NEON_VECTORIZE_QUAD.
 Following Julian's suggestion I added a param preferred-vector-size
 for testing and debugging purposes.

 IIUC, this patch makes mvectorize-with-neon-quad effectively a no-op which
 is ok with me.

 If this is now the default, what is the behaviour of
 -mno-vectorize-with-neon-quad now ? Should that set the value of the
 parameter to 64 or should we be rejecting the negative of that option ?

 If not, we should then consider adding a RejectNegative to that option.

Added a RejectNegative, changed illegal to invalid and prepared a
wwwdocs patch.
The testing finished successfully, except for the test in PR
target/48454 that fails with -mvectorize-with-neon-quad without the
patch as well.

OK to apply?

Thanks,
Ira

ChangeLog:

 * doc/invoke.texi (preferred-vector-size): Document.
 * params.h (PREFERRED_VECTOR_SIZE): Define.
 * config/arm/arm.c (arm_preferred_simd_mode): Use param
 PREFERRED_VECTOR_SIZE instead of
 TARGET_NEON_VECTORIZE_QUAD. Make 128 bits the default.
 (arm_autovectorize_vector_sizes): Likewise.
 * config/arm/arm.opt (NEON_VECTORIZE_QUAD): Add
 RejectNegative.
 * params.def (PARAM_PREFERRED_VECTOR_SIZE): Define.

testsuite/ChangeLog:

 * lib/target-supports.exp (check_effective_target_vect_multiple_sizes):
 New procedure.
 (add_options_for_quad_vectors): Replace with ...
 (add_options_for_double_vectors): ... this.
 * gfortran.dg/vect/pr19049.f90: Expect more printings on targets that
 support multiple vector sizes since the vectorizer attempts to
 vectorize with both vector sizes.
 * gcc.dg/vect/slp-reduc-6.c, gcc.dg/vect/no-vfa-vect-79.c,
 gcc.dg/vect/no-vfa-vect-102a.c, gcc.dg/vect/vect-outer-1a.c,
 gcc.dg/vect/vect-outer-1b.c, gcc.dg/vect/vect-outer-2b.c,
 gcc.dg/vect/vect-outer-3a.c, gcc.dg/vect/no-vfa-vect-37.c,
 gcc.dg/vect/vect-outer-3b.c, gcc.dg/vect/no-vfa-vect-101.c,
 gcc.dg/vect/no-vfa-vect-102.c, gcc.dg/vect/vect-reduc-dot-s8b.c,
 gcc.dg/vect/vect-outer-1.c, gcc.dg/vect/vect-104.c: Likewise.
 * gcc.dg/vect/vect-16.c: Rename to...
 * gcc.dg/vect/no-fast-math-vect-16.c: ... this to ensure that it runs
 without -ffast-math.
 * gcc.dg/vect/vect-42.c: Run with 64 bit vectors if applicable.
 * gcc.dg/vect/vect-multitypes-6.c, gcc.dg/vect/vect-52.c,
 gcc.dg/vect/vect-54.c, gcc.dg/vect/vect-46.c, gcc.dg/vect/vect-48.c,
 gcc.dg/vect/vect-96.c, gcc.dg/vect/vect-multitypes-3.c,
 gcc.dg/vect/vect-40.c: Likewise.
 * gcc.dg/vect/vect-outer-5.c: Remove quad-vectors option as
 redundant.
 * gcc.dg/vect/vect-109.c, gcc.dg/vect/vect-peel-1.c,
 gcc.dg/vect/vect-peel-2.c, gcc.dg/vect/slp-25.c,
 gcc.dg/vect/vect-multitypes-1.c, gcc.dg/vect/slp-3.c,
 gcc.dg/vect/no-vfa-pr29145.c, gcc.dg/vect/vect-multitypes-4.c:
 Likewise.
 * gcc.dg/vect/vect.exp: Run no-fast-math-vect*.c tests with
 -fno-fast-math.





 cheers
 Ramana


 --
 Ramana Radhakrishnan

Index: doc/invoke.texi
===
--- doc/invoke.texi (revision 171723)
+++ doc/invoke.texi (working copy)
@@ -8874,6 +8874,10 @@ The maximum number of conditional stores paires th
 if either vectorization (@option{-ftree-vectorize}) or if-conversion
 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
 
+@item preferred-vector-size
+Preferred vector size in bits for targets that support multiple vector sizes.
+Invalid values are ignored.  The default is 128.
+
 @end table
 @end table
 
Index: params.h
===
--- params.h(revision 171723)
+++ params.h(working copy)
@@ -204,6 +204,8 @@ extern void init_param_values (int *params);
   PARAM_VALUE (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO)
 #define MIN_NONDEBUG_INSN_UID \
   PARAM_VALUE (PARAM_MIN_NONDEBUG_INSN_UID)
+#define PREFERRED_VECTOR_SIZE \
+  PARAM_VALUE (PARAM_PREFERRED_VECTOR_SIZE)
 #define MAX_STORES_TO_SINK \
   PARAM_VALUE (PARAM_MAX_STORES_TO_SINK)
 #endif /* ! GCC_PARAMS_H */
Index: testsuite/lib/target-supports.exp
===
--- testsuite/lib/target-supports.exp   (revision 171723)
+++ testsuite/lib/target-supports.exp   (working copy)
@@ -3203,6 +3203,24 @@ proc check_effective_target_vect_strided_wide { }
 return $et_vect_strided_wide_saved
 }
 
+# Return 1 if the target supports multiple vector sizes
+
+proc check_effective_target_vect_multiple_sizes { } {
+global et_vect_multiple_sizes
+
+if [info exists et_vect_multiple_sizes_saved] {
+verbose check_effective_target_vect_multiple_sizes: using cached 
result 2
+} 

[patch] Preserve return statements at -O0

2011-04-06 Thread Eric Botcazou
Hi,

this patchlet ensures that return statements are preserved at -O0 so that you 
can put a breakpoint on them in the debugger.

Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline?


2011-04-06  Eric Botcazou  ebotca...@adacore.com

* gimple-low.c (lower_gimple_return): When not optimizing, force
labels associated with user returns to be preserved.


2011-04-06  Eric Botcazou  ebotca...@adacore.com

* gnat.dg/return3.adb: New test.


-- 
Eric Botcazou
Index: gimple-low.c
===
--- gimple-low.c	(revision 172018)
+++ gimple-low.c	(working copy)
@@ -758,6 +758,9 @@ lower_gimple_return (gimple_stmt_iterato
 
   /* Generate a goto statement and remove the return statement.  */
  found:
+  /* When not optimizing, make sure user returns are preserved.  */
+  if (!optimize  gimple_has_location (stmt))
+DECL_ARTIFICIAL (tmp_rs.label) = 0;
   t = gimple_build_goto (tmp_rs.label);
   gimple_set_location (t, gimple_location (stmt));
   gimple_set_block (t, gimple_block (stmt));
-- { dg-do compile { target *-*-linux* } }
-- { dg-options -gdwarf-2 -dA }

procedure Return3 is
begin
  return;
end;

-- { dg-final { scan-assembler loc 1 6 } }


Re: [PATCH] fix PR bootstrap/48471

2011-04-06 Thread Tristan Gingold

On Apr 6, 2011, at 3:06 AM, Nathan Froyd wrote:

 My changes that moved bits of final.c to dbxout.c caused compilation
 failures on targets that *didn't* enable DBX_DEBUGGING_INFO, since some
 now-static symbols could be unused.  To fix this, the patch below moves
 all the new static variables and two macros that use some of said
 variables below an #ifdef DBX_DEBUGGING_INFO.  Steve Ellcey verified
 that the patch fixes the problems on ia64-hp-hpux11.23 (thanks Steve!)
 and I verified that the changes still bootstrap on
 x86_64-unknown-linux-gnu.
 
 Committed as obvious.  Sorry about all the build breakage today, not one
 of my better cleanup days...

Nathan,

bootstrap still fails for xcoff targets (eg aix).  I can fix the failure with 
this patch.

Ok for trunk ?

Tristan.

2011-04-06  Tristan Gingold  ging...@adacore.com

* dbxout.c: (debug_nesting, symbol_queue, symbol_queue_index)
(symbol_queue_size, DBXOUT_DECR_NESTING)
(DBXOUT_DECR_NESTING_AND_RETURN): Also define
if XCOFF_DEBUGGING_INFO.

--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -903,7 +903,7 @@ dbxout_finish_complex_stabs (tree sym, stab_code_type code,
   obstack_free (stabstr_ob, str);
 }
 
-#if defined (DBX_DEBUGGING_INFO)
+#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
 
 /* When -gused is used, emit debug info for only used symbols. But in
addition to the standard intercepted debug_hooks there are some
@@ -926,6 +926,10 @@ static int symbol_queue_size = 0;
 #define DBXOUT_DECR_NESTING_AND_RETURN(x) \
   do {--debug_nesting; return (x);} while (0)
 
+#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
+
+#if defined (DBX_DEBUGGING_INFO)
+
 static void
 dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
 {



Re: typo in gcc manual

2011-04-06 Thread Jonathan Wakely
On 6 April 2011 04:15, ali hagigat wrote:
 3.15 Specifying subprocesses and the switches to pass to them
 *[spec_name]:
 If this results in an empty string then the spec will be deleted. (Or,
 if the spec did not exist, then nothing will happened.)
 ---
 happened should be replaced with happen or with be happned I think.


Thanks, fixed by this patch, committed to trunk as obvious


2011-04-06  Jonathan Wakely  jwakely@gmail.com

* doc/invoke.texi (Spec Files): Fix typo.
Index: doc/invoke.texi
===
--- doc/invoke.texi (revision 172019)
+++ doc/invoke.texi (working copy)
@@ -9391,7 +9391,7 @@ This tells the compiler to create, overr
 string.  All lines after this directive up to the next directive or
 blank line are considered to be the text for the spec string.  If this
 results in an empty string then the spec will be deleted.  (Or, if the
-spec did not exist, then nothing will happened.)  Otherwise, if the spec
+spec did not exist, then nothing will happen.)  Otherwise, if the spec
 does not currently exist a new spec will be created.  If the spec does
 exist then its contents will be overridden by the text of this
 directive, unless the first character of that text is the @samp{+}


[PATCH][1/2] Merge call stmt cost handling from pretty-IPA

2011-04-06 Thread Richard Guenther

This merges the call stmt cost handling from pretty IPA together
with dependent cleanups.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2011-04-05  Richard Guenther  rguent...@suse.de
 
PR tree-optimization/47663
* cgraph.h (struct cgraph_edge): Add call_stmt_size and
call_stmt_time fields.
(cgraph_edge_inlinable_p): Declare.
(cgraph_edge_recursive_p): New inline function.
* cgraph.c (cgraph_create_edge_1): Initialize call_stmt_size.
(cgraph_clone_edge): Copy it.
* ipa-inline.c (cgraph_estimate_edge_time): New function.
Account for call stmt time.
(cgraph_estimate_time_after_inlining): Take edge argument.
(cgraph_estimate_edge_growth): Account call stmt size.
(cgraph_estimate_size_after_inlining): Take edge argument.
(cgraph_mark_inline_edge): Adjust.
(cgraph_check_inline_limits): Likewise.
(cgraph_recursive_inlining_p): Remove.
(cgraph_edge_badness): Use cgraph_edge_recursive_p.
(cgraph_decide_recursive_inlining): Take edge argument and
adjust.
(cgraph_decide_inlining_of_small_functions): Do not avoid
diags for recursive inlining here.
(cgraph_flatten): Adjust.
(cgraph_decide_inlining_incrementally): Likewise.
(estimate_function_body_sizes): Remove call cost handling.
(compute_inline_parameters): Initialize caller edge call costs.
(cgraph_estimate_edge_growth): New function.
(cgraph_estimate_growth): Use it.
(cgraph_edge_badness): Likewise.
(cgraph_check_inline_limits): Take an edge argument.
(cgraph_decide_inlining_of_small_functions): Adjust.
(cgraph_decide_inlining): Likewise.
* tree-inline.c (estimate_num_insns): Only account for call
return value if it is used.
(expand_call_inline): Avoid diagnostics on recursive inline
functions here.
* lto-cgraph.c (lto_output_edge): Output edge call costs.
(input_edge): Input edge call costs.

* gcc.dg/tree-ssa/inline-8.c: New testcase.

Index: gcc/cgraph.c
===
*** gcc/cgraph.c.orig   2011-03-28 16:41:11.0 +0200
--- gcc/cgraph.c2011-04-05 15:57:38.0 +0200
*** cgraph_create_edge_1 (struct cgraph_node
*** 1032,1037 
--- 1032,1039 
edge-loop_nest = nest;
  
edge-call_stmt = call_stmt;
+   edge-call_stmt_size = 0;
+   edge-call_stmt_time = 0;
push_cfun (DECL_STRUCT_FUNCTION (caller-decl));
edge-can_throw_external
  = call_stmt ? stmt_can_throw_external (call_stmt) : false;
*** cgraph_clone_edge (struct cgraph_edge *e
*** 2141,2146 
--- 2143,2150 
}
  }
  
+   new_edge-call_stmt_size = e-call_stmt_size;
+   new_edge-call_stmt_time = e-call_stmt_time;
new_edge-inline_failed = e-inline_failed;
new_edge-indirect_inlining_edge = e-indirect_inlining_edge;
new_edge-lto_stmt_uid = stmt_uid;
Index: gcc/cgraph.h
===
*** gcc/cgraph.h.orig   2011-03-28 16:41:11.0 +0200
--- gcc/cgraph.h2011-04-05 15:57:38.0 +0200
*** struct GTY((chain_next (%h.next_caller
*** 431,436 
--- 431,439 
int frequency;
/* Unique id of the edge.  */
int uid;
+   /* Estimated size and time of the call statement.  */
+   int call_stmt_size;
+   int call_stmt_time;
/* Depth of loop nest, 1 means no loop nest.  */
unsigned short int loop_nest;
/* Whether this edge was made direct by indirect inlining.  */
*** varpool_next_static_initializer (struct
*** 771,776 
--- 774,780 
  /* In ipa-inline.c  */
  void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool);
  void compute_inline_parameters (struct cgraph_node *);
+ cgraph_inline_failed_t cgraph_edge_inlinable_p (struct cgraph_edge *);
  
  
  /* Create a new static variable of type TYPE.  */
*** varpool_all_refs_explicit_p (struct varp
*** 958,963 
--- 962,978 
  /* Constant pool accessor function.  */
  htab_t constant_pool_htab (void);
  
+ /* Return true when the edge E represents a direct recursion.  */
+ static inline bool
+ cgraph_edge_recursive_p (struct cgraph_edge *e)
+ {
+   if (e-caller-global.inlined_to)
+ return e-caller-global.inlined_to-decl == e-callee-decl;
+   else
+ return e-caller-decl == e-callee-decl;
+ }
+ 
+ 
  /* FIXME: inappropriate dependency of cgraph on IPA.  */
  #include ipa-ref-inline.h
  
Index: gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
===
*** /dev/null   1970-01-01 00:00:00.0 +
--- gcc/testsuite/gcc.dg/tree-ssa/inline-8.c2011-04-05 15:57:38.0 
+0200
***
*** 0 
--- 1,31 
+ /* { dg-do compile } */
+ /* { dg-options -O 

Re: [testsuite] Fix gcc.dg/torture/pr47917.c on IRIX 6.5

2011-04-06 Thread Rainer Orth
Eric Botcazou ebotca...@adacore.com writes:

 The new gcc.dg/torture/pr47917.c test currently fails the execution test
 on IRIX 6.5.  To get a C99-conformant snprintf, one needs to include
 stdio.h with _XOPEN_SOURCE defined as 500.  The following patch does
 this.

 Likewise on Solaris 8 (It's deprecated, I know, but I have access to a quite 
 fast SPARC/Solaris 8 machine).

Thanks for doing this: I meant to get to this, but am currently looking
into the same failure on Tru64 UNIX where a proper (and more general)
fix is more involved.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH][2/2] Simplify call stmt handling in stmt costs

2011-04-06 Thread Richard Guenther

With the call stmt cost merge from pretty-IPA we can now simplify
their handling in estimate_num_insns.  Instead of fancy ways to
look at types simply account for the actual arguments and returns.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2011-04-06  Richard Guenther  rguent...@suse.de

* tree-inline.c (estimate_num_insns): For calls simply account
for all passed arguments and a used return value.

Index: trunk/gcc/tree-inline.c
===
*** trunk.orig/gcc/tree-inline.c2011-04-05 15:57:38.0 +0200
--- trunk/gcc/tree-inline.c 2011-04-05 17:14:43.0 +0200
*** estimate_num_insns (gimple stmt, eni_wei
*** 3470,3481 
  case GIMPLE_CALL:
{
tree decl = gimple_call_fndecl (stmt);
-   tree addr = gimple_call_fn (stmt);
-   tree funtype = TREE_TYPE (addr);
-   bool stdarg = false;
- 
-   if (POINTER_TYPE_P (funtype))
- funtype = TREE_TYPE (funtype);
  
/* Do not special case builtins where we see the body.
   This just confuse inliner.  */
--- 3470,3475 
*** estimate_num_insns (gimple stmt, eni_wei
*** 3511,3559 
  }
  
cost = weights-call_cost;
!   if (decl)
! funtype = TREE_TYPE (decl);
! 
!   if (!VOID_TYPE_P (TREE_TYPE (funtype))
!gimple_call_lhs (stmt))
! cost += estimate_move_cost (TREE_TYPE (funtype));
! 
!   if (funtype)
! stdarg = stdarg_p (funtype);
! 
!   /* Our cost must be kept in sync with
!  cgraph_estimate_size_after_inlining that does use function
!  declaration to figure out the arguments.
! 
!  For functions taking variable list of arguments we must
!  look into call statement intself.  This is safe because
!  we will get only higher costs and in most cases we will
!  not inline these anyway.  */
!   if (decl  DECL_ARGUMENTS (decl)  !stdarg)
! {
!   tree arg;
!   for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg))
! if (!VOID_TYPE_P (TREE_TYPE (arg)))
!   cost += estimate_move_cost (TREE_TYPE (arg));
! }
!   else if (funtype  prototype_p (funtype)  !stdarg)
! {
!   tree t;
!   for (t = TYPE_ARG_TYPES (funtype); t  t != void_list_node;
!t = TREE_CHAIN (t))
! if (!VOID_TYPE_P (TREE_VALUE (t)))
!   cost += estimate_move_cost (TREE_VALUE (t));
! }
!   else
  {
!   for (i = 0; i  gimple_call_num_args (stmt); i++)
! {
!   tree arg = gimple_call_arg (stmt, i);
!   if (!VOID_TYPE_P (TREE_TYPE (arg)))
! cost += estimate_move_cost (TREE_TYPE (arg));
! }
  }
- 
break;
}
  
--- 3505,3517 
  }
  
cost = weights-call_cost;
!   if (gimple_call_lhs (stmt))
! cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt)));
!   for (i = 0; i  gimple_call_num_args (stmt); i++)
  {
!   tree arg = gimple_call_arg (stmt, i);
!   cost += estimate_move_cost (TREE_TYPE (arg));
  }
break;
}
  


Re: [patch] Preserve return statements at -O0

2011-04-06 Thread Richard Guenther
On Wed, Apr 6, 2011 at 8:57 AM, Eric Botcazou ebotca...@adacore.com wrote:
 Hi,

 this patchlet ensures that return statements are preserved at -O0 so that you
 can put a breakpoint on them in the debugger.

 Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline?

Ok.

Thanks,
Richard.


 2011-04-06  Eric Botcazou  ebotca...@adacore.com

        * gimple-low.c (lower_gimple_return): When not optimizing, force
        labels associated with user returns to be preserved.


 2011-04-06  Eric Botcazou  ebotca...@adacore.com

        * gnat.dg/return3.adb: New test.


 --
 Eric Botcazou



Re: Separate C-family hooks better from general hooks

2011-04-06 Thread Diego Novillo
On Wed, Apr 6, 2011 at 03:27, Joseph S. Myers jos...@codesourcery.com wrote:

 2011-04-05  Joseph Myers  jos...@codesourcery.com

        * doc/tm.texi.in: Document C target hooks as separate from general
        target hooks.
        * doc/tm.texi: Regenerate.
        * genhooks.c (struct hook_desc): Add docname field.
        (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC).  Initialize
        docname field.
        (hook_array): Include c-target.def.
        (emit_documentation): Use docname field in output.
        (emit_init_macros): Take docname argument.  Only emit definitions
        for hooks matching docname.
        (main): Expect additional arguments in all cases.  Pass argument
        to emit_init_macros.
        * target.def: Move initial macro definitions and comments to
        target-hooks-macros.h.
        (gcc_targetcm): Move to c-family/c-target.def.
        * target.h (targetcm): Move declaration to c-family/c-target.h.
        * targhooks.c (default_handle_c_option): Move to
        c-family/c-opts.c.
        * targhooks.h (default_handle_c_option): Move declaration to
        c-family/c-common.h.
        * target-hooks-macros.h: New file.
        * config.gcc (target_has_targetcm): Define and use to add to
        c_target_objs and cxx_target_objs.
        * config/default-c.c: New file.
        * config/darwin-c.c: Include c-target.h and c-target-def.h instead
        of target.h and target-def.h.
        (TARGET_HANDLE_C_OPTION, targetcm): Define later in file.
        (darwin_objc_construct_string, darwin_cfstring_ref_p,
        darwin_check_cfstring_format_arg): Make static.
        (TARGET_OBJC_CONSTRUCT_STRING_OBJECT,
        TARGET_STRING_OBJECT_REF_TYPE_P,
        TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here.
        * config/darwin-protos.h (darwin_objc_construct_string,
        darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't
        declare.
        * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT,
        TARGET_STRING_OBJECT_REF_TYPE_P,
        TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM):
        Remove.
        * config/t-darwin (darwin-c.o): Update dependencies.
        * system.h (TARGET_HAS_TARGETCM): Poison.
        * Makefile.in (TARGET_H): Update.
        (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define.
        (c-family/c-format.o, c-family/c-opts.o): Update dependencies.
        (default-c.o): New target.
        (s-target-hooks-def-h): Pass Target Hook string to genhooks.
        (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New
        targets.
        (s-tm-texi): Pass -d option to genhooks.  Also test timestamp on
        c-target.def.
        (build/genhooks.o): Update dependencies.

 c-family:
 2011-04-05  Joseph Myers  jos...@codesourcery.com

        * c-target-def.h: New file.
        * c-target.def: New file.
        * c-target.h: New file.
        * c-common.c (targetcm): Don't define here.
        * c-common.h (default_handle_c_option): Declare.
        * c-format.c: Include c-target.h instead of target.h.
        * c-opts.c: Include c-target.h instead of target.h.  Explicitly
        include tm.h.
        (default_handle_c_option): Move from targhooks.c.

 objc:
 2011-04-05  Joseph Myers  jos...@codesourcery.com

        * objc-act.c: Include c-target.h instead of target.h.
        * Make-lang.in (objc/objc-act.o): Update dependencies.

OK.


Diego.


[Patch ARM] Committed fix for PR43920 testcase

2011-04-06 Thread Ramana Radhakrishnan

Hi,

I've committed the following patch under the obvious rule for the 
testcase for PR43920. There seemed to have been an accidental 
duplication of the function in the patch committed.


Tested in a cross compiler to arm-linux-gnueabi with just that test to 
armv7-a and made sure that it passes.


cheers
Ramana


2011-04-06  Ramana Radhakrishnan  ramana.radhakrish...@linaro.org

* gcc.target/arm/pr43920-1.c: Fix accidental duplication.
Index: gcc/testsuite/gcc.target/arm/pr43920-1.c
===
--- gcc/testsuite/gcc.target/arm/pr43920-1.c(revision 172030)
+++ gcc/testsuite/gcc.target/arm/pr43920-1.c(working copy)
@@ -19,24 +19,3 @@
 /* { dg-final { scan-assembler-times \torr 0 } } */
 /* { dg-final { scan-assembler-times \tit\t 0 } } */
 /* { dg-final { scan-assembler \tbeq } } */
-/* { dg-do compile } */
-/* { dg-options -mthumb -Os }  */
-/* { dg-require-effective-target arm_thumb2_ok } */
-
-int
-f (int start, int end, int *start_)
-{
-  if (start == -1 || end == -1)
-return -1;
-
-  if (end - start)
-return -1;
-
-  *start_ = start;
-
-  return 0;
-}
-
-/* { dg-final { scan-assembler-times \torr 0 } } */
-/* { dg-final { scan-assembler-times \tit\t 0 } } */
-/* { dg-final { scan-assembler \tbeq } } */


Re: [PATCH][ARM] Tweak arm_class_likely_spilled_p, MODE_BASE_REG_CLASS for Thumb-2

2011-04-06 Thread Andrew Stubbs

On 30/03/11 16:13, Richard Earnshaw wrote:

2011-02-14  Andrew Stubbsa...@codesourcery.com
 Julian Brownjul...@codesourcery.com
 Mark Shinwellshinw...@codesourcery.com

 gcc/
 * config/arm/arm.h (arm_class_likely_spilled_p): Check against
 LO_REGS only for Thumb-1.
 (MODE_BASE_REG_CLASS): Restrict base registers to those which can
 be used in short instructions when optimising for size on Thumb-2.

OK.


Committed.

Andrew


[PATCH] Merge early inliner cleanup from pretty-ipa

2011-04-06 Thread Richard Guenther

This merges the last patch from pretty-ipa, the early inliner cleanup.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2011-02-22  Richard Guenther  rguent...@suse.de
 
* ipa-inline.c (enum inlining_mode): Remove.
(cgraph_flatten): Use some other token.
(cgraph_edge_early_inlinable_p): New function, split out from ...
(cgraph_perform_always_inlining): New function, split out from ...
(cgraph_decide_inlining_incrementally): ... here.
(cgraph_mark_inline_edge): Adjust.
(cgraph_early_inlining): Re-structure.
(pass_early_inline): Require SSA form.

Index: gcc/ipa-inline.c
===
--- gcc/ipa-inline.c(revision 170407)
+++ gcc/ipa-inline.c(revision 170408)
@@ -126,28 +126,6 @@ along with GCC; see the file COPYING3.
 
 #define MAX_TIME 10
 
-/* Mode incremental inliner operate on:
-
-   In ALWAYS_INLINE only functions marked
-   always_inline are inlined.  This mode is used after detecting cycle during
-   flattening.
-
-   In SIZE mode, only functions that reduce function body size after inlining
-   are inlined, this is used during early inlining.
-
-   in ALL mode, everything is inlined.  This is used during flattening.  */
-enum inlining_mode {
-  INLINE_NONE = 0,
-  INLINE_ALWAYS_INLINE,
-  INLINE_SIZE_NORECURSIVE,
-  INLINE_SIZE,
-  INLINE_ALL
-};
-
-static bool
-cgraph_decide_inlining_incrementally (struct cgraph_node *, enum 
inlining_mode);
-static void cgraph_flatten (struct cgraph_node *node);
-
 
 /* Statistics we collect about inlining algorithm.  */
 static int ncalls_inlined;
@@ -1314,7 +1292,7 @@ cgraph_flatten (struct cgraph_node *node
   /* We shouldn't be called recursively when we are being processed.  */
   gcc_assert (node-aux == NULL);
 
-  node-aux = (void *)(size_t) INLINE_ALL;
+  node-aux = (void *) node;
 
   for (e = node-callees; e; e = e-next_callee)
 {
@@ -1388,7 +1366,7 @@ cgraph_flatten (struct cgraph_node *node
   orig_callee = e-callee;
   cgraph_mark_inline_edge (e, true, NULL);
   if (e-callee != orig_callee)
-   orig_callee-aux = (void *)(size_t) INLINE_ALL;
+   orig_callee-aux = (void *) node;
   cgraph_flatten (e-callee);
   if (e-callee != orig_callee)
orig_callee-aux = NULL;
@@ -1566,162 +1544,159 @@ leaf_node_p (struct cgraph_node *n)
   return true;
 }
 
+/* Return true if the edge E is inlinable during early inlining.  */
+
+static bool
+cgraph_edge_early_inlinable_p (struct cgraph_edge *e, FILE *file)
+{
+  if (!e-callee-local.inlinable)
+{
+  if (file)
+   fprintf (file, Not inlining: Function not inlinable.\n);
+  return false;
+}
+  if (!e-callee-analyzed)
+{
+  if (file)
+   fprintf (file, Not inlining: Function body not available.\n);
+  return false;
+}
+  if (!tree_can_inline_p (e)
+  || e-call_stmt_cannot_inline_p)
+{
+  if (file)
+   fprintf (file, Not inlining: %s.\n,
+cgraph_inline_failed_string (e-inline_failed));
+  return false;
+}
+  if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e-caller-decl))
+  || !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e-callee-decl)))
+{
+  if (file)
+   fprintf (file, Not inlining: not in SSA form.\n);
+  return false;
+}
+  return true;
+}
+
+/* Inline always-inline function calls in NODE.  */
+
+static bool
+cgraph_perform_always_inlining (struct cgraph_node *node)
+{
+  struct cgraph_edge *e;
+  bool inlined = false;
+
+  for (e = node-callees; e; e = e-next_callee)
+{
+  if (!e-callee-local.disregard_inline_limits)
+   continue;
+
+  if (dump_file)
+   fprintf (dump_file,
+Considering always-inline candidate %s.\n,
+cgraph_node_name (e-callee));
+
+  if (cgraph_edge_recursive_p (e))
+   {
+ if (dump_file)
+   fprintf (dump_file, Not inlining: recursive call.\n);
+ e-inline_failed = CIF_RECURSIVE_INLINING;
+ continue;
+   }
+
+  if (!cgraph_edge_early_inlinable_p (e, dump_file))
+   continue;
+
+  if (dump_file)
+   fprintf (dump_file,  Inlining %s into %s.\n,
+cgraph_node_name (e-callee),
+cgraph_node_name (e-caller));
+  cgraph_mark_inline_edge (e, true, NULL);
+  inlined = true;
+}
+
+  return inlined;
+}
+
 /* Decide on the inlining.  We do so in the topological order to avoid
expenses on updating data structures.  */
 
 static bool
-cgraph_decide_inlining_incrementally (struct cgraph_node *node,
- enum inlining_mode mode)
+cgraph_decide_inlining_incrementally (struct cgraph_node *node)
 {
   struct cgraph_edge *e;
   bool inlined = false;
   cgraph_inline_failed_t failed_reason;
 
-#ifdef ENABLE_CHECKING
-  verify_cgraph_node (node);
-#endif
+  /* Never inline regular functions into always-inline functions
+ 

Remove old toplevel subdirectory support

2011-04-06 Thread Joseph S. Myers
This patch removes toplevel support for various subdirectories not
present in the gcc or src repositories, as agreed in the thread
including http://gcc.gnu.org/ml/gcc/2011-03/msg00501.html.  Some
other directories may in fact also be no longer useful to support
building at toplevel, or may be built for host but only useful for
build; this patch just does the removals that should be
straightforward and noncontroversial.  OK to commit?

diffstat for the changes with regenerations included (Makefile.in
becomes about half a megabyte smaller):

 Makefile.def |   79 
 Makefile.in  |17587 ---
 configure|   10 
 configure.ac |   10 
 4 files changed, 9 insertions(+), 17677 deletions(-)

2011-04-06  Joseph Myers  jos...@codesourcery.com

* configure.ac (build_tools): Remove build-byacc.
(host_libs): Remove mmalloc.
(host_tools): Remove byacc make patch prms send-pr ash bash bzip2
autoconf automake libtool diff rcs fileutils shellutils time
textutils wdiff find uudecode hello tar gzip indent recode release
sed perl gawk findutils gettext zip.
(libgcj): Remove target-qthreads.
(target_tools): Remove target-examples target-gperf.
(YACC): Don't handle building byacc.
* configure: Regenerate.
* Makefile.def (ash, autoconf, automake, bash, byacc, bzip2, diff,
dosutils, examples, fileutils, find, findutils, gawk, gettext,
gnuserv, gperf, gzip, hello, indent, libtool, make, mmalloc,
patch, perl, prms, qthreads, rcs, recode, release, sed, send-pr,
shellutils, tar, textutils, time, uudecode, wdiff, zip): Don't
handle building components.
* Makefile.in: Regenerate.

Index: configure.ac
===
--- configure.ac(revision 172035)
+++ configure.ac(working copy)
@@ -128,11 +128,11 @@
 build_libs=build-libiberty
 
 # these tools are built for the build environment
-build_tools=build-texinfo build-byacc build-flex build-bison build-m4 
build-fixincludes
+build_tools=build-texinfo build-flex build-bison build-m4 build-fixincludes
 
 # these libraries are used by various programs built for the host environment
 #
-host_libs=intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib 
libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv
+host_libs=intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp 
libdecnumber gmp mpfr mpc ppl cloog libelf libiconv
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -140,12 +140,11 @@
 # binutils, gas and ld appear in that order because it makes sense to run
 # make check in that particular order.
 # If --enable-gold is used, gold may replace ld.
-host_tools=texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid 
sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 
autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff 
find uudecode hello tar gzip indent recode release sed utils guile perl gawk 
findutils gettext zip fastjar gnattools
+host_tools=texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim 
gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj=target-libffi \
target-zlib \
-   target-qthreads \
target-libjava
 
 # these libraries are built for the target environment, and are built after
@@ -173,7 +172,7 @@
 # note: any program that *uses* libraries that are in the target_libraries
 # list belongs in this list.
 #
-target_tools=target-examples target-gperf target-rda
+target_tools=target-rda
 
 

 
@@ -2956,7 +2955,6 @@
 AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
 case  $build_configdirs  in
   * bison *) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
-  * byacc *) YACC='$$r/$(BUILD_SUBDIR)/byacc/byacc' ;;
 esac
 
 AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
Index: Makefile.def
===
--- Makefile.def(revision 172035)
+++ Makefile.def(working copy)
@@ -4,7 +4,7 @@
 // Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
 // This file was originally written by Nathanael Nerode.
 //
-//   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+//   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 //   Free Software Foundation
 //
 // This file is free software; you can redistribute it and/or modify
@@ -27,39 +27,25 @@
 
 build_modules= { module= libiberty; };
 build_modules= { module= bison; };
-build_modules= { module= byacc; };
 build_modules= { module= flex; };
 build_modules= { module= m4; };
 build_modules= { 

Re: Remove old toplevel subdirectory support

2011-04-06 Thread Paolo Bonzini

On 04/06/2011 02:07 PM, Joseph S. Myers wrote:

This patch removes toplevel support for various subdirectories not
present in the gcc or src repositories, as agreed in the thread
includinghttp://gcc.gnu.org/ml/gcc/2011-03/msg00501.html.  Some
other directories may in fact also be no longer useful to support
building at toplevel, or may be built for host but only useful for
build; this patch just does the removals that should be
straightforward and noncontroversial.  OK to commit?

diffstat for the changes with regenerations included (Makefile.in
becomes about half a megabyte smaller):

  Makefile.def |   79
  Makefile.in  |17587 
---
  configure|   10
  configure.ac |   10
  4 files changed, 9 insertions(+), 17677 deletions(-)

2011-04-06  Joseph Myersjos...@codesourcery.com

* configure.ac (build_tools): Remove build-byacc.
(host_libs): Remove mmalloc.
(host_tools): Remove byacc make patch prms send-pr ash bash bzip2
autoconf automake libtool diff rcs fileutils shellutils time
textutils wdiff find uudecode hello tar gzip indent recode release
sed perl gawk findutils gettext zip.
(libgcj): Remove target-qthreads.
(target_tools): Remove target-examples target-gperf.
(YACC): Don't handle building byacc.
* configure: Regenerate.
* Makefile.def (ash, autoconf, automake, bash, byacc, bzip2, diff,
dosutils, examples, fileutils, find, findutils, gawk, gettext,
gnuserv, gperf, gzip, hello, indent, libtool, make, mmalloc,
patch, perl, prms, qthreads, rcs, recode, release, sed, send-pr,
shellutils, tar, textutils, time, uudecode, wdiff, zip): Don't
handle building components.
* Makefile.in: Regenerate.

Index: configure.ac
===
--- configure.ac(revision 172035)
+++ configure.ac(working copy)
@@ -128,11 +128,11 @@
  build_libs=build-libiberty

  # these tools are built for the build environment
-build_tools=build-texinfo build-byacc build-flex build-bison build-m4 
build-fixincludes
+build_tools=build-texinfo build-flex build-bison build-m4 build-fixincludes

  # these libraries are used by various programs built for the host environment
  #
-host_libs=intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib 
libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv
+host_libs=intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp 
libdecnumber gmp mpfr mpc ppl cloog libelf libiconv

  # these tools are built for the host environment
  # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -140,12 +140,11 @@
  # binutils, gas and ld appear in that order because it makes sense to run
  # make check in that particular order.
  # If --enable-gold is used, gold may replace ld.
-host_tools=texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim 
gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake 
libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip 
indent recode release sed utils guile perl gawk findutils gettext zip fastjar 
gnattools
+host_tools=texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb 
gprof etc expect dejagnu m4 utils guile fastjar gnattools

  # libgcj represents the runtime libraries only used by gcj.
  libgcj=target-libffi \
target-zlib \
-   target-qthreads \
target-libjava

  # these libraries are built for the target environment, and are built after
@@ -173,7 +172,7 @@
  # note: any program that *uses* libraries that are in the target_libraries
  # list belongs in this list.
  #
-target_tools=target-examples target-gperf target-rda
+target_tools=target-rda

  


@@ -2956,7 +2955,6 @@
  AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
  case  $build_configdirs  in
* bison *) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
-  * byacc *) YACC='$$r/$(BUILD_SUBDIR)/byacc/byacc' ;;
  esac

  AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
Index: Makefile.def
===
--- Makefile.def(revision 172035)
+++ Makefile.def(working copy)
@@ -4,7 +4,7 @@
  // Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
  // This file was originally written by Nathanael Nerode.
  //
-//   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+//   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
  //   Free Software Foundation
  //
  // This file is free software; you can redistribute it and/or modify
@@ -27,39 +27,25 @@

  build_modules= { module= libiberty; };
  build_modules= { module= bison; };
-build_modules= { module= byacc; };
  build_modules= { 

RE: [Ping #2][Patch, testsuite]: Don't xfail sibcalls on AVR

2011-04-06 Thread Weddington, Eric


 -Original Message-
 From: Georg-Johann Lay [mailto:a...@gjlay.de]
 Sent: Wednesday, April 06, 2011 4:55 AM
 To: Weddington, Eric
 Cc: gcc-patches@gcc.gnu.org; Anatoly Sokolov; Denis Chertykov
 Subject: Re: [Ping #2][Patch, testsuite]: Don't xfail sibcalls on AVR
 
  Target avr now supports tail calls, so don't xfail on that.
 
  testsuite/
 
  2011-03-29  Georg-Johann Lay  a...@gjlay.de
 
* gcc.dg/sibcall-3.c: Don't xfail on AVR.
* gcc.dg/sibcall-4.c: Don't xfail on AVR.
 
 
  Please commit, Johann. Thanks.
 
  Eric
 
 I don't have write privilege, and I don't think I want write access at
 the moment.

Oh! I didn't know. I thought you did.

Ok, let's see what I can do, then.


PowerPC64 non-delegitimized unspecs

2011-04-06 Thread Alan Modra
I've noticed a number of tests fail on mainline with complaints about
non-delegitimized UNSPECs.  The reason why rs6000_delegitimze_address
isn't working is that our insn matching doesn't allow a stack slot in
place of the REG.  I could have expanded the condition to include
stack slots, but it seems silly to complicate the code like that.
Bootstrapped and regression tested powerpc64-linux.  OK for mainline
and 4.6?

* config/rs6000/rs6000.c (rs6000_delegitimize_address): Relax
UNSPEC_TOCREL matching.

Index: gcc/config/rs6000/rs6000.c
===
--- gcc/config/rs6000/rs6000.c  (revision 171989)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -6367,18 +6367,7 @@ rs6000_delegitimize_address (rtx orig_x)
 {
   y = XEXP (XEXP (x, 1), 0);
   if (GET_CODE (y) == UNSPEC
-   XINT (y, 1) == UNSPEC_TOCREL
-  ((GET_CODE (XEXP (x, 0)) == REG
-   (REGNO (XEXP (x, 0)) == TOC_REGISTER
-  || TARGET_MINIMAL_TOC
-  || TARGET_CMODEL != CMODEL_SMALL))
- || (TARGET_CMODEL != CMODEL_SMALL
-  GET_CODE (XEXP (x, 0)) == PLUS
-  GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
-  REGNO (XEXP (XEXP (x, 0), 0)) == TOC_REGISTER
-  GET_CODE (XEXP (XEXP (x, 0), 1)) == HIGH
-  rtx_equal_p (XEXP (x, 1),
- XEXP (XEXP (XEXP (x, 0), 1), 0)
+   XINT (y, 1) == UNSPEC_TOCREL)
{
  y = XVECEXP (y, 0, 0);
  if (!MEM_P (orig_x))

-- 
Alan Modra
Australia Development Lab, IBM


Re: [patch libjava]: Do some fixes for windows native targets

2011-04-06 Thread Kai Tietz
2011/4/5 Tom Tromey tro...@redhat.com:
 Kai == Kai Tietz ktiet...@googlemail.com writes:

 Kai this patch fixes some issues in libjava for windows targets.  It
 Kai addresses for now only 32-bit target, but for JNICALL definition I
 Kai introduced already logic for 64-bit windows target too as preparation.

 Most of this seems ok to me.

 Kai    * java/lang/reflect/Field.h (_Jv_JNI_ToReflectedField):
 Kai    Likewise.
 Kai    * java/lang/reflect/Constructor.h (_Jv_JNI_ToReflectedMethod):
 Kai    Likewise.

 These headers are generated.  You have to edit headers.txt and then
 rebuild them.

 Tom


Hi Tom,

I added to headers.txt the changes and regenerate headers.  Btw it is
a bit tricky to enable for libjava the maintainer-mode and then have a
successful configure for it ...

ChangeLog

2011-04-06  Kai Tietz

* configure.ac (libgcj_ld_export_all): Set for windows
native targets to export-all-symbols.
(LIBGCJ_LD_EXPORT_ALL): Export libgcj_ld_export_all.
* Makefile.am (libgcj_la_LDFLAGS): Add LIBGCJ_LD_EXPORT_ALL.
* sysdep/i386/backtrace.h (MAIN_FUNC): Define for windows
native targets to DllMain.
* gcj/javaprims.h (JNICALL): Define it dependent
for different windows targets.
* include/jni_md.h: Likewise.
* headers.txt (_Jv_JNI_ToReflectedField): Mark
JNICALLS for friends.
(_Jv_JNI_ToReflectedMethod): Likewise.
* java/lang/Class.h: Regenerated.
* java/lang/reflect/Field.h: Regenerated.
* java/lang/reflect/Constructor.h: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
* gcj/Makefile.in: Regenerated.

Ok for apply?

Regards,
Kai
Index: gcc-head/libjava/Makefile.am
===
--- gcc-head.orig/libjava/Makefile.am
+++ gcc-head/libjava/Makefile.am
@@ -492,7 +492,7 @@ xlib_nat_files = $(xlib_nat_source_files
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) 
$(THREADLIBS) \
$(LIBLTDL) $(SYS_ZLIBS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-   $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+   $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBGCJ_LD_EXPORT_ALL)
 libgcj_la_LIBADD = \
classpath/native/fdlibm/libfdlibm.la \
java/lang/Object.lo \
Index: gcc-head/libjava/configure.ac
===
--- gcc-head.orig/libjava/configure.ac
+++ gcc-head/libjava/configure.ac
@@ -214,6 +214,16 @@ if test -z $libgcj_ld_symbolic; then
   libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
 fi
 
+# for windows native targets enforce export of all symbols for shared libgcj.
+libgcj_ld_export_all=
+case $host in
+  *mingw*)
+   libgcj_ld_export_all=-Wl,--export-all-symbols
+   ;;
+  *)
+;;
+esac
+
 LIBGCJ_CFLAGS=${libgcj_cflags}
 LIBGCJ_CXXFLAGS=${libgcj_cxxflags}
 LIBGCJ_JAVAFLAGS=${libgcj_javaflags}
@@ -221,6 +231,7 @@ LIBGCJ_SUBLIB_LTFLAGS=${libgcj_sublib_l
 LIBGCJ_SUBLIB_CORE_EXTRA_DEPS=${libgcj_sublib_core_extra_deps}
 LIBGCJ_LD_SYMBOLIC=${libgcj_ld_symbolic}
 LIBGCJ_LD_SYMBOLIC_FUNCTIONS=${libgcj_ld_symbolic_functions}
+LIBGCJ_LD_EXPORT_ALL=${libgcj_ld_export_all}
 AC_SUBST(LIBGCJ_CFLAGS)
 AC_SUBST(LIBGCJ_CXXFLAGS)
 AC_SUBST(LIBGCJ_JAVAFLAGS)
@@ -228,6 +239,7 @@ AC_SUBST(LIBGCJ_SUBLIB_LTFLAGS)
 AC_SUBST(LIBGCJ_SUBLIB_CORE_EXTRA_DEPS)
 AC_SUBST(LIBGCJ_LD_SYMBOLIC)
 AC_SUBST(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+AC_SUBST(LIBGCJ_LD_EXPORT_ALL)
 
 # Only use libltdl for non-newlib builds.
 if test x${with_newlib} = x || test x${with_newlib} = xno; then
@@ -930,6 +942,9 @@ arm*linux*eabi)
 *-*-cygwin)
 extra_ldflags_libjava=-liconv
 ;;
+*-*-mingw*)
+extra_ldflags_libjava=-lws2_32
+;;
 esac
 
 LIBMATHSPEC=
Index: gcc-head/libjava/gcj/javaprims.h
===
--- gcc-head.orig/libjava/gcj/javaprims.h
+++ gcc-head/libjava/gcj/javaprims.h
@@ -26,6 +26,15 @@ details.  */
 #undef FALSE
 #define FALSE FALSE
 
+// JNI calling convention also defined in jni.h  */
+#ifndef JNICALL
+ #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32))  !defined 
(_WIN64)
+  #define JNICALL __stdcall
+ #else
+  #define JNICALL
+ #endif
+#endif
+
 // To force selection of correct types that will mangle consistently
 // across platforms.
 extern Java
Index: gcc-head/libjava/headers.txt
===
--- gcc-head.orig/libjava/headers.txt
+++ gcc-head/libjava/headers.txt
@@ -41,26 +41,26 @@ friend jstring (::_Jv_AllocString) (jsiz
 
 class java/lang/reflect/Constructor
 prepend jmethodID _Jv_FromReflectedConstructor 
(java::lang::reflect::Constructor *);
-prepend jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, 
jboolean);
+prepend jobject JNICALL 

Re: [Ping #2][Patch, testsuite]: Don't xfail sibcalls on AVR

2011-04-06 Thread Georg-Johann Lay
Weddington, Eric schrieb:
 
 -Original Message-
 From: Georg-Johann Lay [mailto:a...@gjlay.de]
 To: Weddington, Eric

 Please commit, Johann. Thanks.

 I don't have write privilege, and I don't think I want write access at
 the moment.
 
 Oh! I didn't know. I thought you did.

I signed a fsf copyright assignment. AFAIK there is no automatism that
grants write access when copyright assignment is approved. I would
have to be maintainer or something like that.

Johann



Re: [Patch,AVR]: Fix PR45263

2011-04-06 Thread Georg-Johann Lay
Georg-Johann Lay schrieb:
 Weddington, Eric schrieb:
 -Original Message-
 From: Georg-Johann Lay [mailto:a...@gjlay.de]
 Sent: Friday, April 01, 2011 4:01 PM
 To: Georg-Johann Lay
 Cc: gcc-patches@gcc.gnu.org; Denis Chertykov; Anatoly Sokolov; Weddington,
 Eric
 Subject: Re: [Patch,AVR]: Fix PR45263

 This is a better fix that does not need push/pop and does not increase
 numer of instructions.

 r16 takes the role of r20, and the value formerly in r16,
 i.e. hh8(__dtors_end resp. __ctors_start) is recreated as needed.

 Hi Johann,

 Have you tested this patch against the test case in bug #45263?

Tested patch v2 from 2010-04-02 now for atmega2560 on avrtest
simulator. In main, var1 and var2 are initialized as expected and
anObject.getVal() is 30.

Without patch the program hangs.

 Using avr-gdb-7.2 to debug with stubs runs on errors and doesn't show
 me any code... no assembly with A syntax error in expression, near
 `0x29c' in assembly window.
 Trying to compile with avr-gcc and dwarf crashes avr-gcc.
 
 __do_copy_data fails to initialize var1 and var2 (are 0x0).

Seems atmega2560 is not supported in avr-gdb-7.2 simulator? Same elf
fails to initialize .data. Do you know for which targets avr-gdb is
supposed to work?

Johann



Re: [patch, ARM] Make 128 bits the default vector size for NEON

2011-04-06 Thread Hans-Peter Nilsson
 Date: Thu, 31 Mar 2011 13:39:05 +0200
 From: Ira Rosen ira.ro...@linaro.org

 This patch changes NEON's default vector size from 64 to 128 bits.

I'm wondering, are there NEON-specific measurements to support
this change?

A colleague of mine implemented support for 64- and 128-bit NEON
for RAPP http://savannah.nongnu.org/projects/rapp/, but found
that the 128-bit version was slower.

brgds, H-P


[Patch][AVR]: Initial builtins support

2011-04-06 Thread Georg-Johann Lay
This patch adds builtin support for some RTL builtins to avr backend.
One builtin implements loop for delay of specific number of ticks
(under the assumption IRQs are off), others simply map to machine
instructions like SEI, CLI, NOP, SLEEP, WDR, FMUL, FMAULS, FMULSU.

In addition, builtin macros are introduced so that use can easily
query if or if not a specific builtin is available. This might be
useful as builtin support evolves, because #ifdef is easier then to
twiddle out which version brings what builtin.

2011-04-06  Georg-Johann Lay  a...@gjlay.de

* config/avr/avr.c: (insn-codes.h, optabs.h, langhooks.h):
New Includes
(avr_init_builtins, avr_expand_builtin,
avr_expand_delay_cycles, avr_expand_unop_builtin,
avr_expand_binop_builtin ): New functions.
(avr_builtin_id): New enum
(struct avr_builtin_description): New struct
(bdesc_1arg, bdesc_2arg): New arrays describing some RTL builtins.
(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
* config/avr/avr.md (UNSPEC_FMUL, UNSPEC_FMULS, UNSPEC_FMULSU,
UNSPECV_ENABLE_IRQS, UNSPECV_NOP, UNSPECV_SLEEP, UNSPECV_WDR,
UNSPECV_DELAY_CYCLES): new enumeration values
(UNSPEC_SEI, UNSPEC_CLI): Remove enumeration values
(enable_interrupt): Use UNSPECV_ENABLE_IRQS
(disable_interrupt): Use UNSPECV_ENABLE_IRQS
(*rotlqi3_4): rename insn to rotlqi3_4
(delay_cycles_1, delay_cycles_2, delay_cycles_3,
delay_cycles_4, nopv, sleep, wdr, fmul, fmuls,
fmulsu): New insns
* config/avr/avr-c.c: fix line endings
(avr_cpu_cpp_builtins): New builtin defines: __BUILTIN_AVR_NOP,
__BUILTIN_AVR_SEI, __BUILTIN_AVR_CLI, __BUILTIN_AVR_WDR,
__BUILTIN_AVR_SLEEP, __BUILTIN_AVR_SWAP,
__BUILTIN_AVR_DELAY_CYCLES, __BUILTIN_AVR_FMUL,
__BUILTIN_AVR_FMULS, __BUILTIN_AVR_FMULSU.
Index: config/avr/avr.c
===
--- config/avr/avr.c	(Revision 172036)
+++ config/avr/avr.c	(Arbeitskopie)
@@ -29,6 +29,7 @@
 #include insn-config.h
 #include conditions.h
 #include insn-attr.h
+#include insn-codes.h
 #include flags.h
 #include reload.h
 #include tree.h
@@ -38,7 +39,9 @@
 #include obstack.h
 #include function.h
 #include recog.h
+#include optabs.h
 #include ggc.h
+#include langhooks.h
 #include tm_p.h
 #include target.h
 #include target-def.h
@@ -91,6 +94,8 @@ static bool avr_rtx_costs (rtx, int, int
 static int avr_address_cost (rtx, bool);
 static bool avr_return_in_memory (const_tree, const_tree);
 static struct machine_function * avr_init_machine_status (void);
+static void avr_init_builtins (void);
+static rtx avr_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
 static rtx avr_builtin_setjmp_frame_value (void);
 static bool avr_hard_regno_scratch_ok (unsigned int);
 static unsigned int avr_case_values_threshold (void);
@@ -253,6 +258,13 @@ static const struct default_options avr_
 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
 #define TARGET_FUNCTION_OK_FOR_SIBCALL avr_function_ok_for_sibcall
 
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS avr_init_builtins
+
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN avr_expand_builtin
+
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 static void
@@ -6426,4 +6438,331 @@ unsigned int avr_case_values_threshold (
   return (!AVR_HAVE_JMP_CALL || TARGET_CALL_PROLOGUES) ? 8 : 17;
 }
 
+/* Helper for __builtin_avr_delay_cycles */
+
+static void
+avr_expand_delay_cycles (rtx operands0)
+{
+  unsigned HOST_WIDE_INT cycles = UINTVAL (operands0);
+  unsigned HOST_WIDE_INT cycles_used;
+  unsigned HOST_WIDE_INT loop_count;
+  
+  if (IN_RANGE (cycles, 83886082, 0x))
+{
+  loop_count = ((cycles - 9) / 6) + 1;
+  cycles_used = ((loop_count - 1) * 6) + 9;
+  emit_insn (gen_delay_cycles_4 (gen_int_mode (loop_count, SImode)));
+  cycles -= cycles_used;
+}
+  
+  if (IN_RANGE (cycles, 262145, 83886081))
+{
+  loop_count = ((cycles - 7) / 5) + 1;
+  if (loop_count  0xFF)
+loop_count = 0xFF;
+  cycles_used = ((loop_count - 1) * 5) + 7;
+  emit_insn (gen_delay_cycles_3 (gen_int_mode (loop_count, SImode)));
+  cycles -= cycles_used;
+}
+  
+  if (IN_RANGE (cycles, 768, 262144))
+{
+  loop_count = ((cycles - 5) / 4) + 1;
+  if (loop_count  0x)
+loop_count = 0x;
+  cycles_used = ((loop_count - 1) * 4) + 5;
+  emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode)));
+  cycles -= cycles_used;
+}
+  
+  if (IN_RANGE (cycles, 6, 767))
+{
+  loop_count = cycles / 3;
+  if (loop_count  255) 
+loop_count = 255;
+  cycles_used = loop_count * 3;
+  emit_insn (gen_delay_cycles_1 (gen_int_mode (loop_count, QImode)));
+  cycles -= cycles_used;
+  }
+  
+  while (cycles = 2)
+{
+  emit_insn (gen_nopv (GEN_INT(2)));
+  cycles -= 

Re: [patch libjava]: Do some fixes for windows native targets

2011-04-06 Thread Kai Tietz
2011/4/6 Kai Tietz ktiet...@googlemail.com:
 2011/4/5 Tom Tromey tro...@redhat.com:
 Kai == Kai Tietz ktiet...@googlemail.com writes:

 Kai this patch fixes some issues in libjava for windows targets.  It
 Kai addresses for now only 32-bit target, but for JNICALL definition I
 Kai introduced already logic for 64-bit windows target too as preparation.

 Most of this seems ok to me.

 Kai    * java/lang/reflect/Field.h (_Jv_JNI_ToReflectedField):
 Kai    Likewise.
 Kai    * java/lang/reflect/Constructor.h (_Jv_JNI_ToReflectedMethod):
 Kai    Likewise.

 These headers are generated.  You have to edit headers.txt and then
 rebuild them.

 Tom


 Hi Tom,

 I added to headers.txt the changes and regenerate headers.  Btw it is
 a bit tricky to enable for libjava the maintainer-mode and then have a
 successful configure for it ...

 ChangeLog

 2011-04-06  Kai Tietz

        * configure.ac (libgcj_ld_export_all): Set for windows
        native targets to export-all-symbols.
        (LIBGCJ_LD_EXPORT_ALL): Export libgcj_ld_export_all.
        * Makefile.am (libgcj_la_LDFLAGS): Add LIBGCJ_LD_EXPORT_ALL.
        * sysdep/i386/backtrace.h (MAIN_FUNC): Define for windows
        native targets to DllMain.
        * gcj/javaprims.h (JNICALL): Define it dependent
        for different windows targets.
        * include/jni_md.h: Likewise.
        * headers.txt (_Jv_JNI_ToReflectedField): Mark
        JNICALLS for friends.
        (_Jv_JNI_ToReflectedMethod): Likewise.
        * java/lang/Class.h: Regenerated.
        * java/lang/reflect/Field.h: Regenerated.
        * java/lang/reflect/Constructor.h: Regenerated.
        * configure: Regenerated.
        * Makefile.in: Regenerated.
        * include/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
        * gcj/Makefile.in: Regenerated.

 Ok for apply?

 Regards,
 Kai


Sorry, found a typo. Updated patch attached.

Kai
Index: gcc-head/libjava/Makefile.am
===
--- gcc-head.orig/libjava/Makefile.am
+++ gcc-head/libjava/Makefile.am
@@ -492,7 +492,7 @@ xlib_nat_files = $(xlib_nat_source_files
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) 
$(THREADLIBS) \
$(LIBLTDL) $(SYS_ZLIBS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-   $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+   $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBGCJ_LD_EXPORT_ALL)
 libgcj_la_LIBADD = \
classpath/native/fdlibm/libfdlibm.la \
java/lang/Object.lo \
Index: gcc-head/libjava/configure.ac
===
--- gcc-head.orig/libjava/configure.ac
+++ gcc-head/libjava/configure.ac
@@ -214,6 +214,16 @@ if test -z $libgcj_ld_symbolic; then
   libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
 fi
 
+# for windows native targets enforce export of all symbols for shared libgcj.
+libgcj_ld_export_all=
+case $host in
+  *mingw*)
+   libgcj_ld_export_all=-Wl,--export-all-symbols
+   ;;
+  *)
+;;
+esac
+
 LIBGCJ_CFLAGS=${libgcj_cflags}
 LIBGCJ_CXXFLAGS=${libgcj_cxxflags}
 LIBGCJ_JAVAFLAGS=${libgcj_javaflags}
@@ -221,6 +231,7 @@ LIBGCJ_SUBLIB_LTFLAGS=${libgcj_sublib_l
 LIBGCJ_SUBLIB_CORE_EXTRA_DEPS=${libgcj_sublib_core_extra_deps}
 LIBGCJ_LD_SYMBOLIC=${libgcj_ld_symbolic}
 LIBGCJ_LD_SYMBOLIC_FUNCTIONS=${libgcj_ld_symbolic_functions}
+LIBGCJ_LD_EXPORT_ALL=${libgcj_ld_export_all}
 AC_SUBST(LIBGCJ_CFLAGS)
 AC_SUBST(LIBGCJ_CXXFLAGS)
 AC_SUBST(LIBGCJ_JAVAFLAGS)
@@ -228,6 +239,7 @@ AC_SUBST(LIBGCJ_SUBLIB_LTFLAGS)
 AC_SUBST(LIBGCJ_SUBLIB_CORE_EXTRA_DEPS)
 AC_SUBST(LIBGCJ_LD_SYMBOLIC)
 AC_SUBST(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+AC_SUBST(LIBGCJ_LD_EXPORT_ALL)
 
 # Only use libltdl for non-newlib builds.
 if test x${with_newlib} = x || test x${with_newlib} = xno; then
@@ -930,6 +942,9 @@ arm*linux*eabi)
 *-*-cygwin)
 extra_ldflags_libjava=-liconv
 ;;
+*-*-mingw*)
+extra_ldflags_libjava=-lws2_32
+;;
 esac
 
 LIBMATHSPEC=
Index: gcc-head/libjava/gcj/javaprims.h
===
--- gcc-head.orig/libjava/gcj/javaprims.h
+++ gcc-head/libjava/gcj/javaprims.h
@@ -26,6 +26,15 @@ details.  */
 #undef FALSE
 #define FALSE FALSE
 
+// JNI calling convention also defined in jni.h  */
+#ifndef JNICALL
+ #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32))  !defined 
(_WIN64)
+  #define JNICALL __stdcall
+ #else
+  #define JNICALL
+ #endif
+#endif
+
 // To force selection of correct types that will mangle consistently
 // across platforms.
 extern Java
Index: gcc-head/libjava/headers.txt
===
--- gcc-head.orig/libjava/headers.txt
+++ gcc-head/libjava/headers.txt
@@ -41,26 +41,26 @@ friend jstring (::_Jv_AllocString) (jsiz
 
 class java/lang/reflect/Constructor
 prepend jmethodID _Jv_FromReflectedConstructor 
(java::lang::reflect::Constructor *);
-prepend jobject 

Re: PowerPC64 non-delegitimized unspecs

2011-04-06 Thread Alan Modra
On Wed, Apr 06, 2011 at 02:45:49PM +0200, Jakub Jelinek wrote:
 On Wed, Apr 06, 2011 at 10:06:11PM +0930, Alan Modra wrote:
  I've noticed a number of tests fail on mainline with complaints about
  non-delegitimized UNSPECs.  The reason why rs6000_delegitimze_address
  isn't working is that our insn matching doesn't allow a stack slot in
  place of the REG.  I could have expanded the condition to include
  stack slots, but it seems silly to complicate the code like that.
  Bootstrapped and regression tested powerpc64-linux.  OK for mainline
  and 4.6?
 
 Won't that lead to invalid debug info?
 I mean, can't it happen that the reg in question is some register
 initialized from TOC_REGISTER plus some offset?

I don't think we do that on powerpc64.  Your question made me go back
to look at the failing tests, and I see that with current mainline the
tests no longer fail!  I guess for now I'd better retract the patch.

-- 
Alan Modra
Australia Development Lab, IBM


[testsuite] Account for absolute path to ranlib on Darwin (PR testsuite/48480)

2011-04-06 Thread Rainer Orth
As reported in the PR, we can get ranlib messages with an absolute path
to ranlib when running the boehm-gc testsuite on x86_64-apple-darwin10.
This differs from what Iain had reported for powerpc-apple-darwin9.  The
following patch accounts for that, tested by myself in tclsh and by
Dominique on the target.

Installed on mainline.

Rainer


2011-04-06  Rainer Orth  r...@cebitec.uni-bielefeld.de

PR testsuite/48480
* testsuite/lib/boehm-gc.exp (boehm-gc-dg-prune): Allow for path
to ranlib.

Index: boehm-gc/testsuite/lib/boehm-gc.exp
===
--- boehm-gc/testsuite/lib/boehm-gc.exp (revision 172049)
+++ boehm-gc/testsuite/lib/boehm-gc.exp (working copy)
@@ -233,7 +233,7 @@
 set text [prune_gcc_output $text]
 
 # Ignore harmless Darwin ranlib warnings.
-regsub -all (^|\n)(ranlib: file: \[^\n\]* has no symbols\n?)+ $text 
\\1 text
+regsub -all (^|\n)(\[^\n\]*ranlib: file: \[^\n\]* has no symbols\n?)+ 
$text \\1 text
 
 return $text
 }

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [cxx-mem-model] bitfield tests

2011-04-06 Thread Michael Matz
Hi,

On Mon, 4 Apr 2011, Aldy Hernandez wrote:

 
   (5) Do we agree that all such cpus use a byte-granular modification mask?
 
  Now, as of (0) I might agree to disregard the original Alpha, but as the
  embedded world moves to SMP I'm not sure we can disregard
  non-cache coherent NUMA setups or even CPUs without a byte store.
 
 As per 5, it doesn't matter if the CPU lacks a byte store, since the 
 cache has a byte-granular modification mask.

If it doesn't have byte stores there's no need for byte-granular 
modification masks :)


Ciao,
Michael.


Go patch committed: Use backend interface for if statements

2011-04-06 Thread Ian Lance Taylor
This patch to the Go frontend uses the backend interface for if
statements.

I also renamed some of the temporary conversion functions to use shorter
names.

Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian


2011-04-06  Ian Lance Taylor  i...@google.com

* go-gcc.cc (Gcc_backend::if_statement): New function.
(tree_to_stat): New function.
(expr_to_tree): Renamed from expression_to_tree.
(stat_to_tree): Renamed from statement_to_tree.


Index: gcc/go/go-gcc.cc
===
--- gcc/go/go-gcc.cc	(revision 172051)
+++ gcc/go/go-gcc.cc	(working copy)
@@ -176,6 +176,10 @@ class Gcc_backend : public Backend
   return_statement(Bfunction*, const std::vectorBexpression*,
 		   source_location);
 
+  Bstatement*
+  if_statement(Bexpression* condition, Bstatement* then_block,
+	   Bstatement* else_block, source_location);
+
   // Labels.
 
   Blabel*
@@ -293,6 +297,25 @@ Gcc_backend::return_statement(Bfunction*
   return this-make_statement(ret);
 }
 
+// If.
+
+Bstatement*
+Gcc_backend::if_statement(Bexpression* condition, Bstatement* then_block,
+			  Bstatement* else_block, source_location location)
+{
+  tree cond_tree = condition-get_tree();
+  tree then_tree = then_block-get_tree();
+  tree else_tree = else_block == NULL ? NULL_TREE : else_block-get_tree();
+  if (cond_tree == error_mark_node
+  || then_tree == error_mark_node
+  || else_tree == error_mark_node)
+return this-make_statement(error_mark_node);
+  tree ret = build3(COND_EXPR, void_type_node, cond_tree, then_tree,
+		else_tree);
+  SET_EXPR_LOCATION(ret, location);
+  return this-make_statement(ret);
+}
+
 // Make a label.
 
 Blabel*
@@ -366,6 +389,12 @@ tree_to_expr(tree t)
   return new Bexpression(t);
 }
 
+Bstatement*
+tree_to_stat(tree t)
+{
+  return new Bstatement(t);
+}
+
 Bfunction*
 tree_to_function(tree t)
 {
@@ -373,13 +402,13 @@ tree_to_function(tree t)
 }
 
 tree
-expression_to_tree(Bexpression* be)
+expr_to_tree(Bexpression* be)
 {
   return be-get_tree();
 }
 
 tree
-statement_to_tree(Bstatement* bs)
+stat_to_tree(Bstatement* bs)
 {
   return bs-get_tree();
 }
Index: gcc/go/gofrontend/expressions.cc
===
--- gcc/go/gofrontend/expressions.cc	(revision 171968)
+++ gcc/go/gofrontend/expressions.cc	(working copy)
@@ -12598,8 +12598,7 @@ class Label_addr_expression : public Exp
   tree
   do_get_tree(Translate_context* context)
   {
-return expression_to_tree(this-label_-get_addr(context,
-		 this-location()));
+return expr_to_tree(this-label_-get_addr(context, this-location()));
   }
 
  private:
Index: gcc/go/gofrontend/statements.cc
===
--- gcc/go/gofrontend/statements.cc	(revision 172051)
+++ gcc/go/gofrontend/statements.cc	(working copy)
@@ -565,7 +565,7 @@ Assignment_statement::do_get_tree(Transl
   ret = context-backend()-assignment_statement(tree_to_expr(lhs_tree),
 		 tree_to_expr(rhs_tree),
 		 this-location());
-  return statement_to_tree(ret);
+  return stat_to_tree(ret);
 }
 
 // Make an assignment statement.
@@ -1596,7 +1596,7 @@ Expression_statement::do_get_tree(Transl
   tree expr_tree = this-expr_-get_tree(context);
   Bexpression* bexpr = tree_to_expr(expr_tree);
   Bstatement* ret = context-backend()-expression_statement(bexpr);
-  return statement_to_tree(ret);
+  return stat_to_tree(ret);
 }
 
 // Make an expression statement from an Expression.
@@ -2593,7 +2593,7 @@ Return_statement::do_get_tree(Translate_
   Bstatement* ret;
   ret = context-backend()-return_statement(tree_to_function(fndecl),
 	 retvals, this-location());
-  return statement_to_tree(ret);
+  return stat_to_tree(ret);
 }
 
 // Make a return statement.
@@ -2631,8 +2631,7 @@ class Bc_statement : public Statement
   tree
   do_get_tree(Translate_context* context)
   {
-return statement_to_tree(this-label_-get_goto(context,
-		this-location()));
+return stat_to_tree(this-label_-get_goto(context, this-location()));
   }
 
  private:
@@ -2710,7 +2709,7 @@ Goto_statement::do_get_tree(Translate_co
   Blabel* blabel = this-label_-get_backend_label(context);
   Bstatement* statement = context-backend()-goto_statement(blabel,
 			 this-location());
-  return statement_to_tree(statement);
+  return stat_to_tree(statement);
 }
 
 // Make a goto statement.
@@ -2743,8 +2742,7 @@ class Goto_unnamed_statement : public St
   tree
   do_get_tree(Translate_context* context)
   {
-return statement_to_tree(this-label_-get_goto(context,
-		this-location()));
+return stat_to_tree(this-label_-get_goto(context, this-location()));
   }
 
  private:
@@ -2778,7 +2776,7 @@ Label_statement::do_get_tree(Translate_c
   Blabel* blabel = this-label_-get_backend_label(context);
   Bstatement* statement;
   statement = 

Re: RFA: MN10300: Handle MDR register in movqi/movhi pattern.

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/06/11 03:38, Nick Clifton wrote:
 Hi Jeff, Hi Alex, Hi Richard,
 
   The MN10300 gcc port currently does not build on the mainline because
   of:
   
   In file included from gcc/unwind-dw2-fde.c:35:0:
   gcc/unwind-pe.h: In function 'read_encoded_value_with_base':
   gcc/unwind-pe.h:271:1: error: insn does not satisfy its constraints:
 
   (insn 417 381 382 7 (set (reg/v:QI 50 mdr [orig:145 encoding ] [145])
(reg:QI 0 d0)) 0 {*movqi_internal}
   (nil))
 
   Ie the movqi insn does not handle the MDR register.  (A similar issue
   affects the movhi insn, although that is not triggered until later on
   in the toolchain build).  I would like to propose the attached small
   patch to fix this problem.
 
   Tested without regressions on an mn10300-elf toolchain.
 
   OK to apply ?
 
 Cheers
   Nick
 
 gcc/ChangeLog
 2011-04-05  Nick Clifton  ni...@redhat.com
 
   * config/mn10300/mn10300.md (movqi_internal): Add alternatives
   to handle MDR - data register transfers.
 (movhi_internal): Likewise.
OK.
Jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnI1QAAoJEBRtltQi2kC7N9kH/386lr+MoA3I35RUjk6o4jV8
FpGxLei7T4AQTgdJ7RixmL5TiCQBsYtp3kEjauwZEpOUQKzFXfiEQT2vtsm/lqgr
Db+6dyUF0XidoEAe/nkv81jYeEtsf/Y/6ujxQ2mmQyGDEzD/GbwOovPEVtKBDrsp
47HIF0xhqvzHu7TaH6UomEqyKl0qwagC00O2TsrMTfA8ctpmAw0lF6NQbxYofRwb
f9hXl1arfvRP7B3XNSOZRpr3R9IwDOIXRYeYzr3qAShPQ+K/nooC2E387azhYnKE
eQm4VMbI8aAh48WtRRtA6T1ATLrU7nswxXhLoRW8g9zItkiAatL/N4iBNE96iTk=
=QOQp
-END PGP SIGNATURE-


Re: [PATCH 1/n, i386]: Merge SSE and AVX patterns using enable attribute.

2011-04-06 Thread Uros Bizjak
On Wed, Apr 6, 2011 at 1:12 PM, Kirill Yukhin kirill.yuk...@gmail.com wrote:

 Nice patch. But I have two question:
 - What will be with future extensions? E.g. what if `avxXX` will appear, do
 you think that common parts with previous extentions should be shrinked in
 that way?

The patch in fact mixes two somehow orthogonal approaches:

- uses enable attribute to merge the same SSE and AVX patterns that
differ only in the number of operands.

- introduces conditional vector float modes.

So, if there is AVXv2 that adds another mode, this mode can be added
to VF mode iterator as a mode that depends on TARGET_AVX2.  More
likely, there will be new three-operand instructions and these will be
added with TARGET_AVX2 insn constraint. If there are no corresponding
two-operand instructions, then enabled attribute won't come into
play.

 - Are you replaced with that fancy method all the insn? E.g. adds with
 saturation are not touched by the patch (and I believe can be shrinked as
 well):

I did say that This patch changes i386.md, Parallel floating point
arithmetic and
Parallel floating point comparisons sections of sse.md. in the
original patch submission, didn't I ? ;)

I'm sure that in addition to saturated adds, there are plenty of other
opportunities for enabled attribute. These will be attacked in
further patches - btw - you are more than welcome to look for them in
the .md files; candidate patterns are prefixed with avx_ .

Uros.


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/04/11 15:07, Eric Botcazou wrote:
 commit_edge_insertions contains this kludge:
 
   /* In the old rtl CFG API, it was OK to insert control flow on an
  edge, apparently?  In cfglayout mode, this will *not* work, and
  the caller is responsible for making sure that control flow is
  valid at all times.  */
   if (current_ir_type () == IR_RTL_CFGLAYOUT)
 return;
 
   blocks = sbitmap_alloc (last_basic_block);
   sbitmap_zero (blocks);
   FOR_EACH_BB (bb)
 if (bb-aux)
   {
   SET_BIT (blocks, bb-index);
   /* Check for forgotten bb-aux values before commit_edge_insertions
  call.  */
   gcc_assert (bb-aux == bb-aux);
   bb-aux = NULL;
   }
   find_many_sub_basic_blocks (blocks);
   sbitmap_free (blocks);
 
 
 At least on x86/x86-64, there is apparently only one case where control flow 
 insns are inserted on edges: when the prologue is inserted on the entry edge.
 Once this is accounted for, the above kludge can be removed, provided that 
 the 
 force_nonfallthru RTL routine is enhanced to preserve the loop nest structure.
 The result is the attached patch, bootstrapped/regtested on x86 and x86-64.
 
 I'll be testing it on IA-64 and SPARC over the next few days if there is an 
 agreement that this is a progress.
What about when we have a PHI, which we eliminate by inserting insns on
edges and those insns actually form a loop?  You can see an example of
this in PR48389.

I'm not terribly familiar with any of this cfg code these days, so there
may be a reason why this isn't going to be a problem that I'm not aware
of.  I just happened to be looking at 48389 and remembered your RFC.

jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnJpYAAoJEBRtltQi2kC7QawH/3pVtwugDPR8H6Ai8CyyZSWX
jm+sMFFQulccWt6KRA6OzGcYYiU+NCXCJCtqHTl5XWqStxzipOHKhKkJFX7qEfaL
eRcxdfV4a9YU6LrIZxzBN3AirW6G1kc6OVjvJLxbkMLtrlGOGbdviyUczdiPD+mS
oa+ece+ALigr9vEVQ5ezd6ggnD5mMprrciV+sJdZOk8dExV8RNqvAz2dnBEtkeV2
khwXVe/PL+aBDokLr8gGcCYfJosYF+1zg1MUgugB2k8JrLibZDQjbfJKiowM03bp
GXPDhJRyEIE8voy4dqBEvAt5pzbptkktaNIMC95m5oXyiFDf/thEAkJqKuKjYZg=
=aajv
-END PGP SIGNATURE-


Rename LINUX_TARGET_OS_CPP_BUILTINS and LINUX_DYNAMIC_LINKER*

2011-04-06 Thread Joseph S. Myers
This patch, relative to a tree with
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00276.html (pending
review) applied, further cleans up the handling of GNU-userspace
targets by renaming LINUX_TARGET_OS_CPP_BUILTINS (a macro also defined
in headers such as kfreebsd-gnu.h) to GNU_USER_TARGET_OS_CPP_BUILTINS
and LINUX_DYNAMIC_LINKER* to GNU_USER_DYNAMIC_LINKER* (so removing a
layer of indirection in the latter case).  The idea is that
arch/gnu-user*.h headers will reference these macros (as may
config/gnu-user.h; for example, most of the GNU-userspace LINK_SPEC
ought to be shared, referencing a separate spec for the dynamic
linker), while the headers for particular operating systems with GNU
userspace will define them appropriately for the particular OS.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  OK to
commit (both this and the previous patch)?

2011-04-06  Joseph Myers  jos...@codesourcery.com

* config/alpha/linux-elf.h (LINUX_DYNAMIC_LINKER): Rename to
GNU_USER_DYNAMIC_LINKER.
* config/arm/linux-eabi.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/arm/linux-elf.h (LINUX_TARGET_LINK_SPEC): Change
LINUX_DYNAMIC_LINKER to GNU_USER_DYNAMIC_LINKER.
(TARGET_OS_CPP_BUILTINS): Change LINUX_TARGET_OS_CPP_BUILTINS to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/bfin/linux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/bfin/uclinux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/cris/linux.h (CRIS_LINK_SUBTARGET_SPEC): Change
LINUX_DYNAMIC_LINKER to GNU_USER_DYNAMIC_LINKER.
(TARGET_OS_CPP_BUILTINS): Change LINUX_TARGET_OS_CPP_BUILTINS to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/frv/linux.h (LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
* config/gnu.h (LINUX_TARGET_OS_CPP_BUILTINS): Rename to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/i386/gnu-user.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/i386/gnu-user64.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/i386/linux.h (GNU_USER_DYNAMIC_LINKER): Remove.
* config/i386/linux64.h (GNU_USER_DYNAMIC_LINKER32,
GNU_USER_DYNAMIC_LINKER64): Remove.
* config/ia64/linux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
(LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
* config/kfreebsd-gnu.h (LINUX_TARGET_OS_CPP_BUILTINS): Rename to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/knetbsd-gnu.h (LINUX_TARGET_OS_CPP_BUILTINS): Rename to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/kopensolaris-gnu.h (LINUX_TARGET_OS_CPP_BUILTINS): Rename
to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Rename to
GNU_USER_TARGET_OS_CPP_BUILTINS.
(LINUX_DYNAMIC_LINKER): Rename to GNU_USER_DYNAMIC_LINKER.
(LINUX_DYNAMIC_LINKER32): Rename to GNU_USER_DYNAMIC_LINKER32.
(LINUX_DYNAMIC_LINKER64): Rename to GNU_USER_DYNAMIC_LINKER64.
* config/lm32/uclinux-elf.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/m32r/linux.h (LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
(TARGET_OS_CPP_BUILTINS): Change LINUX_TARGET_OS_CPP_BUILTINS to
GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/m68k/linux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
(LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
* config/m68k/uclinux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
* config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
(LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
* config/mips/linux64.h (LINUX_DYNAMIC_LINKERN32): Rename to
GNU_USER_DYNAMIC_LINKERN32.
(LINK_SPEC): Change LINUX_DYNAMIC_LINKERN32 to
GNU_USER_DYNAMIC_LINKERN32.  Change LINUX_DYNAMIC_LINKER64 to
GNU_USER_DYNAMIC_LINKER64.  Change LINUX_DYNAMIC_LINKER32 to
GNU_USER_DYNAMIC_LINKER32.
* config/mn10300/linux.h (TARGET_OS_CPP_BUILTINS): Change
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS.
(LINK_SPEC): Change LINUX_DYNAMIC_LINKER to
GNU_USER_DYNAMIC_LINKER.
* config/moxie/uclinux.h 

Re: PATCH: PR middle-end/48440: [4.7 Regression] FAIL: gcc.c-torture/compile/labels-3.c

2011-04-06 Thread H.J. Lu
On Tue, Apr 5, 2011 at 3:29 AM, Richard Guenther
richard.guent...@gmail.com wrote:
 On Tue, Apr 5, 2011 at 8:44 AM, Paolo Bonzini bonz...@gnu.org wrote:
 Index: cgraphbuild.c
 ===
 --- cgraphbuild.c.orig  2011-04-03 11:28:45.0 +0200
 +++ cgraphbuild.c       2011-04-03 11:31:21.0 +0200
 @@ -53,6 +53,12 @@ record_reference (tree *tp, int *walk_su
   tree decl;
   struct record_reference_ctx *ctx = (struct record_reference_ctx *)data;

 +  t = canonicalize_constructor_val (t);
 +  if (!t)
 +    t = *tp;
 +  else if (t != *tp)
 +    *tp = t;
 +
   switch (TREE_CODE (t))
     {
     case VAR_DECL:

 This change caused:

 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48440


 This avoids  canonicalizing constructor values for address conversion
 if Pmode != ptr_mode.  OK for trunk?

 Certainly the right place to fix it is in canonicalize_constructor_val 
 itself.

 There should never be any Pmode pointer types in the gimple IL.  The
 proper place to fix it if any is in useless_type_conversion_p.


We have

5600  newx = simplify_subreg (outermode, op, innermode, byte);
(gdb) f 1
#1  0x00708494 in expand_expr_real_2 (ops=0x7fffb0c0, target=0x0,
tmode=VOIDmode, modifier=EXPAND_INITIALIZER)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:7366
7366op0 = simplify_gen_subreg (mode, op0, inner_mode,
(gdb) call debug_tree (treeop0)
 addr_expr 0x70a78d50
type pointer_type 0x70b83f18
type void_type 0x70b83e70 void VOID
align 8 symtab 0 alias set -1 canonical type 0x70b83e70
pointer_to_this pointer_type 0x70b83f18
sizes-gimplified public unsigned SI
size integer_cst 0x70b706e0 constant 32
unit size integer_cst 0x70b703e8 constant 4
align 32 symtab 0 alias set -1 canonical type 0x70b83f18
pointer_to_this pointer_type 0x70b985e8
constant
arg 0 label_decl 0x70b7b400 l2 type void_type 0x70b83e70 void
side-effects VOID file x.i line 8 col 2
align 1 context function_decl 0x70a68f00 foo initial
error_mark 0x70b789f0
(code_label/s 22 0 0 4 4 (l2) [2 uses])

chain var_decl 0x70a790a0 p type pointer_type 0x70b83f18
used unsigned SI file x.i line 4 col 9 size integer_cst
0x70b706e0 32 unit size integer_cst 0x70b703e8 4
align 32 context function_decl 0x70a68f00 foo
(mem/f/c/i:SI (plus:DI (reg/f:DI 20 frame)
(const_int -4 [0xfffc])) [0 p+0 S4 A32])
x.i:3:44
(gdb) call debug_rtx (op0)
(label_ref/v:DI 22)
(gdb)

Since ptr_mode != Pmode, the type of op0 != type of treeop0.
Should we use GET_MODE (op0) instead of TYPE_MODE (inner_type)
here? Does this patch make any senses?


-- 
H.J.
---
diff --git a/gcc/expr.c b/gcc/expr.c
index d521f64..439f245 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7360,7 +7360,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_m
ode tmode,
   else if (CONSTANT_P (op0))
{
  tree inner_type = TREE_TYPE (treeop0);
- enum machine_mode inner_mode = TYPE_MODE (inner_type);
+ enum machine_mode inner_mode = GET_MODE (op0);

  if (modifier == EXPAND_INITIALIZER)
op0 = simplify_gen_subreg (mode, op0, inner_mode,


Re: [PATCH, ARM] Switch to EABI version 5 for RTEMS

2011-04-06 Thread Sebastian Huber
On 06/04/11 18:24, Ralf Corsepius wrote:
 On 04/06/2011 05:20 PM, Sebastian Huber wrote:

 there were several requests for ARM Cortex-M support on RTEMS
 recently.  The
 first step towards this is a suitable ARM tool chain.  I want to use
 this event
 to clean up the multilibs and switch to the EABI version 5.  The
 benefit of
 EABI version 5 is that this brings RTEMS more in line with the
 primary GCC
 platform arm-linux-gnueabi.

 These patches are not OK with me, because these are widely
 incompatible to what has been used in RTEMS up today

Can you please list these incompatibilities.  The RTEMS test suite shows
no problems with this tool chain.  The GCC test suite looks also good.

 and because these patches diverge with what we've discussed in RTEMS
 before.

This is exactly the patch that is in the corresponding RTEMS PR 1765
(https://www.rtems.org/bugzilla/show_bug.cgi?id=1765).  I only did what
you suggested: send this patch to the GCC list for review.


 I'd propose you to implement an arm-*rtemseabi target which would
 allow a gradualy transition to eabi.

I don't share this opinion.  If a RTEMS ARM user complains about the
EABI tool chain, we can fix the problem or provide a legacy tool chain.

-- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30,
D-82178 Puchheim, Germany Phone : +49 89 18 90 80 79-6 Fax : +49 89 18
90 80 79-9 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key
available on request. Diese Nachricht ist keine geschäftliche Mitteilung
im Sinne des EHUG.




[PATCH 2/n, i386]: Merge SSE and AVX patterns using enable attribute.

2011-04-06 Thread Uros Bizjak
Hello!

This patch continues merging of SSE and AVX patterns in Parallel
floating point logical operations, Parallel single-precision
floating point conversion operations and Parallel double-precision
floating point conversion operations sections of sse.md.

Additionally, it introduces handling of
TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL in andnot logic patterns.

2011-04-06  Uros Bizjak  ubiz...@gmail.com

* config/i386/sse.md (AVXMODEDCVTDQ2PS): Remove.
(AVXMODEDCVTPS2DQ): Ditto.
(VEC_FLOAT_MODE): Ditto.
(sse_andnotmode3): Merge with avx_andnotmode3.  Use VF mode
iterator.  Handle TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL target flag.
(any_logic:codemode3): Use VF mode iterator.
(*any_logic:codemode3): Merge with *avx_any_logic:codemode3.
Use VF mode iterator.
(copysignmode3): Use VF mode iterator.
(*andnotMODEF:mode3): Merge with *avx_andnotMODEF:mode3.  Handle
TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL target flag.
(*any_logic:codeMODEF:mode3): Merge with
*avx_any_logic:codeMODEF:mode3.
(sse_cvtsi2ss): Merge with *avx_cvtsi2ss.
(sse_cvtsi2ssq): Merge with *avx_cvtsi2ssq.
(avx_cvtdq2ps256): Split from avx_cvtdq2psavxmodesuffix.
(avx_cvtdq2psavxmodesuffix): Remove.
(sse2_cvtdq2ps): Use %v modifier.
(avx_cvtps2dq256): Split from avx_cvtps2dqavxmodesuffix.
(avx_cvtps2dqavxmodesuffix): Remove.
(sse2_cvtps2dq): Use %v modifier.
(avx_cvttps2dq256): Split from avx_cvttps2dqavxmodesuffix.
(avx_cvttps2dqavxmodesuffix): Remove.
(sse2_cvttps2dq): Use %v modifier.
(sse2_cvtsi2sd): Merge with *avx_cvtsi2sd.
(sse2_cvtsi2sdq): Merge with *avx_cvtsi2sdq.
(sse2_cvtsd2siq): Fix insn template.
(sse2_cvtsd2siq_2): Ditto.
(sse2_cvttsd2siq): Ditto.
(sse2_cvtsd2ss): Merge with *avx_cvtsd2ss.
(sse2_cvtss2sd): Merge with *avx_cvtss2sd.

Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32} on
AVX target, committed.

Uros.
Index: sse.md
===
--- sse.md  (revision 172049)
+++ sse.md  (working copy)
@@ -84,8 +84,6 @@
 (define_mode_iterator AVXMODEF4P [V4SF V4DF])
 (define_mode_iterator AVXMODEFDP [V2DF V4DF])
 (define_mode_iterator AVXMODEFSP [V4SF V8SF])
-(define_mode_iterator AVXMODEDCVTDQ2PS [V4SF V8SF])
-(define_mode_iterator AVXMODEDCVTPS2DQ [V4SI V8SI])
 
 (define_mode_iterator FMAMODE [SF DF V4SF V2DF V8SF V4DF])
 
@@ -112,11 +110,6 @@
(V4SF TARGET_SSE)
(V4DF TARGET_AVX) (V8SF TARGET_AVX)])
 
-;; Modes handled by vector float patterns.
-(define_mode_iterator VEC_FLOAT_MODE
-  [(V2DF TARGET_SSE2) (V4SF TARGET_SSE)
-   (V4DF TARGET_AVX) (V8SF TARGET_AVX)])
-
 ;; Modes handled by vector extract patterns.
 (define_mode_iterator VEC_EXTRACT_MODE
   [(V2DI TARGET_SSE) (V4SI TARGET_SSE)
@@ -1384,88 +1377,89 @@
 ;;
 ;
 
-(define_insn avx_andnotmode3
-  [(set (match_operand:AVXMODEF2P 0 register_operand =x)
-   (and:AVXMODEF2P
- (not:AVXMODEF2P
-   (match_operand:AVXMODEF2P 1 register_operand x))
- (match_operand:AVXMODEF2P 2 nonimmediate_operand xm)))]
-  AVX_VEC_FLOAT_MODE_P (MODEmode)
-  vandnssemodesuffix\t{%2, %1, %0|%0, %1, %2}
-  [(set_attr type sselog)
-   (set_attr prefix vex)
-   (set_attr mode avxvecmode)])
-
 (define_insn sse_andnotmode3
-  [(set (match_operand:SSEMODEF2P 0 register_operand =x)
-   (and:SSEMODEF2P
- (not:SSEMODEF2P
-   (match_operand:SSEMODEF2P 1 register_operand 0))
- (match_operand:SSEMODEF2P 2 nonimmediate_operand xm)))]
-  SSE_VEC_FLOAT_MODE_P (MODEmode)
-  andnssemodesuffix\t{%2, %0|%0, %2}
-  [(set_attr type sselog)
-   (set_attr mode MODE)])
+  [(set (match_operand:VF 0 register_operand =x,x)
+   (and:VF
+ (not:VF
+   (match_operand:VF 1 register_operand 0,x))
+ (match_operand:VF 2 nonimmediate_operand xm,xm)))]
+  
+{
+  static char buf[32];
+  const char *insn;
+  const char *suffix
+= TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL ? ps : ssemodesuffix;
 
-(define_expand codemode3
-  [(set (match_operand:AVX256MODEF2P 0 register_operand )
-   (any_logic:AVX256MODEF2P
- (match_operand:AVX256MODEF2P 1 nonimmediate_operand )
- (match_operand:AVX256MODEF2P 2 nonimmediate_operand )))]
-  AVX256_VEC_FLOAT_MODE_P (MODEmode)
-  ix86_fixup_binary_operands_no_copy (CODE, MODEmode, operands);)
+  switch (which_alternative)
+{
+case 0:
+  insn = andn%s\t{%%2, %%0|%%0, %%2};
+  break;
+case 1:
+  insn = vandn%s\t{%%2, %%1, %%0|%%0, %%1, %%2};
+  break;
+default:
+  gcc_unreachable ();
+}
 
-(define_insn *avx_codemode3
-  [(set (match_operand:AVXMODEF2P 0 register_operand =x)
-   (any_logic:AVXMODEF2P
- (match_operand:AVXMODEF2P 1 nonimmediate_operand %x)
- 

Re: [PATCH, PR43920, 6/9] Cross-jumping - Use reg-notes.

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/01/11 08:54, Tom de Vries wrote:
 On 03/31/2011 11:16 PM, Tom de Vries wrote:
 On 03/31/2011 08:52 PM, Jeff Law wrote:

 On 03/31/11 12:42, Tom de Vries wrote:
 Uses regnotes to analyze whether we can replace insn a by insn b, even
 if we cannot replace insn b by insn a. Uses this info in crossjumping.

 Shouldn't this be using single_set rather than digging through PATTERN,
 then verifying both are SETs, etc.?

 Otherwise don't you miss most of the benefit on architectures where most
 insns clobber the flags register in a PARALLEL with the SET?

 I see what you mean about missing these insns currently.

 I guess I will have to check that the non-SET part of the PARALLEL is
 identical between the 2 insns.

 I'll update the patch to handle this case.
 
 changes compared to previous posting:
 - add ChangeLog.
 - use single_set
 - add equal_different_set_p and use it in can_replace_by
 
 Retested on x86_64.


   PR target/43920
   * cfgcleanup.c (equal_different_set_p, can_replace_by, merge_dir): New
   function.
   (old_insns_match_p): Change return type.  Replace return false/true with
   return dir_none/dir_both.  Use can_replace_by.
   (flow_find_cross_jump): Add dir_p parameter.  Init replacement direction
   from dir_p.  Register replacement direction in dir, last_dir and
   afterlast_dir.  Handle new return type of old_insns_match_p using
   merge_dir.  Return replacement direction in dir_p.
   (flow_find_head_matching_sequence, outgoing_edges_match): Handle new
   return type of old_insns_match_p.
   (try_crossjump_to_edge): Add argument to call to flow_find_cross_jump.
   * ifcvt.c ( cond_exec_process_if_block): Add argument to call to
   flow_find_cross_jump.
   * basic-block.h (enum replace_direction): New type.
   (flow_find_cross_jump): Add parameter to declaration.
OK

Jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnKW/AAoJEBRtltQi2kC7TC8IAJdB1hgkPmmC787EUBBycPCF
/ROYeWMZ62WyVqOD+eTVFXvv6v4s0XjPHQgS+zANBQPdvA3L8V2ugFYy66SWmQZj
1NSplCrBMRhS9Fu9M8uEWjvuVEUhqxOYLnPKXqeW/gD8UEHt2+gMLAGGFI4pxQRS
L+caqVMGvNvVZqMNAUTU7FLQfT1Zo50sBvbvm9w/GfjSVNC/dmkHRqf4Ta0oIDW/
Zm5oyX4FWzun8NbW+scaQlsxAiEA5xoxzXyGlLnj9UGCTiEeaYIsgg+SyYO8CeO0
o3FpsRfe+jMSK170cd7+mufPktjmCuAdiWQa2M7W6R04AOvdOV7DxNglHMHXljg=
=NrNE
-END PGP SIGNATURE-


Re: Fix powerpc rs6000_stack_info ICE

2011-04-06 Thread David Edelsohn
On Wed, Apr 6, 2011 at 8:18 AM, Alan Modra amo...@gmail.com wrote:
 The ENABLE_CHECKING tests I added at the end of rs6000_stack_info
 are now asserting on gcc.c-torture/execute/20041011-1.c and other
 testcases.  The cause is the late running DSE pass removing a set of
 LR, which means lr_save_p changes.  Why that happens ultimately goes
 back to a register allocation decision to use LR after running out of
 gprs, which isn't that bright in this case since there is just one set
 and one use of LR and you need a gpr free to move values to and from
 LR.  Anyway, the fact remains that the stack info can change
 legitimately and harmlessly after we've emitted the function prologue
 and epilogue.  So this patch simply removes the ENABLE_CHECKING code.
 Bootstrapped and regtested powerpc64-linux.  OK for mainline?

        * config/rs6000/rs6000.c (rs6000_stack_info): Don't compare against
        previous stack info.

Okay.

Thanks, David


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/06/11 12:01, Steven Bosscher wrote:
 On Wed, Apr 6, 2011 at 6:52 PM, Jeff Law l...@redhat.com wrote:
 What about when we have a PHI, which we eliminate by inserting insns on
 edges and those insns actually form a loop?  You can see an example of
 this in PR48389.
 
 AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only affects 
 RTL.
But the elimination of the PHI results in creating RTL that is inserted
on a CFG edge.

jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnK3cAAoJEBRtltQi2kC7WnkH/j3hIBoW9htzfDJSXHYtpyGG
PVYIjWQnml/+PlHH06faECfnZtNlqR/Tcin4mbtnoJnlpvP3xTN2ioL3ehgWerq8
015DhflYYkhrsPTY4DkkirY4jv4hTvjgq1no2X3BMKAVD8EkYoGlOPLhK/XqnBCs
gtRJhYbo5lJ16vh9qrVhAdMNCF/wvw13JHhXdSHcVC++7qFoiysFko/7hpggqES1
edonxv0o6m52/EitbGMXUcyJvPyX4DT54Pp+KjBU9VCIuv6SldUTBzJLoi+Vcrpo
skpfCMgG7uTd6aEb31SDL5/sduzIP1Nbn21GZXQme0kLLK+sIXhGdi6FlYuAcNM=
=mMZB
-END PGP SIGNATURE-


Re: [patch] Preserve return statements at -O0

2011-04-06 Thread Steven Bosscher
On Wed, Apr 6, 2011 at 8:57 AM, Eric Botcazou ebotca...@adacore.com wrote:
 this patchlet ensures that return statements are preserved at -O0 so that you
 can put a breakpoint on them in the debugger.

Isn't one of the effects of this patch to generate debug info for the
artificial label decl?

When I first saw your patch, I thought FORCED_LABEL(), perhaps I'm
not sure that it's any better than your solution... Have you tried
that?

Ciao!
Steven


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Steven Bosscher
On Wed, Apr 6, 2011 at 6:52 PM, Jeff Law l...@redhat.com wrote:
 What about when we have a PHI, which we eliminate by inserting insns on
 edges and those insns actually form a loop?  You can see an example of
 this in PR48389.

AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only affects RTL.

Ciao!
Steven


[PATCH] Cleanup, use add_to_hard_reg_set instead of SET_HARD_REG_BIT loops.

2011-04-06 Thread Anatoly Sokolov
Hi.

  This patch converts loops of SET_HARD_REG_BIT in to add_to_hard_reg_set 
functions call.

  The patch has been bootstrapped on and regression tested on
x86_64-unknown-linux-gnu for c.

  OK to install?

* expr.c (expand_expr_real_1): Use add_to_hard_reg_set function
instead of loop.
* sel-sched.c (mark_unavailable_hard_regs): Likewise.
* function.c (record_hard_reg_sets): Likewise.
* ira.c (compute_regs_asm_clobbered): Likewise.
* sched-deps.c (sched_analyze_1): Likewise.
* reload1.c (mark_reload_reg_in_use, choose_reload_regs): Likewise.


Index: gcc/sel-sched.c
===
--- gcc/sel-sched.c (revision 172049)
+++ gcc/sel-sched.c (working copy)
@@ -1263,17 +1263,12 @@
  FIXME: it is enough to do this once per all original defs.  */
   if (frame_pointer_needed)
 {
-  int i;
+  add_to_hard_reg_set (reg_rename_p-unavailable_hard_regs,
+  Pmode, FRAME_POINTER_REGNUM);
 
-  for (i = hard_regno_nregs[FRAME_POINTER_REGNUM][Pmode]; i--;)
-   SET_HARD_REG_BIT (reg_rename_p-unavailable_hard_regs,
-  FRAME_POINTER_REGNUM + i);
-
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
-  for (i = hard_regno_nregs[HARD_FRAME_POINTER_REGNUM][Pmode]; i--;)
-   SET_HARD_REG_BIT (reg_rename_p-unavailable_hard_regs,
-  HARD_FRAME_POINTER_REGNUM + i);
-#endif
+  if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
+add_to_hard_reg_set (reg_rename_p-unavailable_hard_regs, 
+Pmode, HARD_FRAME_POINTER_IS_FRAME_POINTER);
 }
 
 #ifdef STACK_REGS
Index: gcc/expr.c
===
--- gcc/expr.c  (revision 172049)
+++ gcc/expr.c  (working copy)
@@ -8451,18 +8451,10 @@
   gcc_assert (decl_rtl);
   decl_rtl = copy_rtx (decl_rtl);
   /* Record writes to register variables.  */
-  if (modifier == EXPAND_WRITE  REG_P (decl_rtl)
-  REGNO (decl_rtl)  FIRST_PSEUDO_REGISTER)
-   {
-   int i = REGNO (decl_rtl);
-   int nregs = hard_regno_nregs[i][GET_MODE (decl_rtl)];
-   while (nregs)
- {
-   SET_HARD_REG_BIT (crtl-asm_clobbers, i);
-   i++;
-   nregs--;
- }
-   }
+  if (modifier == EXPAND_WRITE
+  REG_P (decl_rtl)  HARD_REGISTER_P (decl_rtl))
+add_to_hard_reg_set (crtl-asm_clobbers,
+GET_MODE (decl_rtl), REGNO (decl_rtl));
 
   /* Ensure variable marked as used even if it doesn't go through
 a parser.  If it hasn't be used yet, write out an external
Index: gcc/function.c
===
--- gcc/function.c  (revision 172049)
+++ gcc/function.c  (working copy)
@@ -2912,12 +2912,8 @@
 record_hard_reg_sets (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
 {
   HARD_REG_SET *pset = (HARD_REG_SET *)data;
-  if (REG_P (x)  REGNO (x)  FIRST_PSEUDO_REGISTER)
-{
-  int nregs = hard_regno_nregs[REGNO (x)][GET_MODE (x)];
-  while (nregs--  0)
-   SET_HARD_REG_BIT (*pset, REGNO (x) + nregs);
-}
+  if (REG_P (x)  HARD_REGISTER_P (x))
+add_to_hard_reg_set (pset, GET_MODE (x), REGNO (x));
 }
 
 /* A subroutine of assign_parms.  Allocate a pseudo to hold the current
Index: gcc/ira.c
===
--- gcc/ira.c   (revision 172049)
+++ gcc/ira.c   (working copy)
@@ -1724,16 +1724,10 @@
  {
df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
-   if (dregno  FIRST_PSEUDO_REGISTER)
- {
-   unsigned int i;
-   enum machine_mode mode = GET_MODE (DF_REF_REAL_REG (def));
-   unsigned int end = dregno
- + hard_regno_nregs[dregno][mode] - 1;
-
-   for (i = dregno; i = end; ++i)
- SET_HARD_REG_BIT(crtl-asm_clobbers, i);
- }
+   if (HARD_REGISTER_NUM_P (dregno))
+ add_to_hard_reg_set (crtl-asm_clobbers,
+  GET_MODE (DF_REF_REAL_REG (def)),
+  dregno);
  }
}
 }
Index: gcc/sched-deps.c
===
--- gcc/sched-deps.c(revision 172049)
+++ gcc/sched-deps.c(working copy)
@@ -2259,16 +2259,12 @@
   /* Treat all writes to a stack register as modifying the TOS.  */
   if (regno = FIRST_STACK_REG  regno = LAST_STACK_REG)
{
- int nregs;
-
  /* Avoid analyzing the same register twice.  */
  if (regno != FIRST_STACK_REG)
sched_analyze_reg (deps, FIRST_STACK_REG, mode, code, insn);
 
- nregs = 

Re: [patch] Preserve return statements at -O0

2011-04-06 Thread Eric Botcazou
 Isn't one of the effects of this patch to generate debug info for the
 artificial label decl?

No, DECL_IGNORED_P is preserved on the label decl.

 When I first saw your patch, I thought FORCED_LABEL(), perhaps I'm
 not sure that it's any better than your solution... Have you tried
 that?

No, that isn't necessary at -O0 IMO, user labels are explicitly preserved.

-- 
Eric Botcazou


[Patch, Fortran, committed] Some coarray fixes (PR 18918 and 48477)

2011-04-06 Thread Tobias Burnus

I have committed the following three rather obvious patches (separately):

1. libgfortran/caf/mpi.c: I am now finally convinced that one indeed 
need to make use of MPI_Initialized's return value when calling 
MPI_Finalize. Thanks to all who pointed it out several times.


2. gcc/fortran/trans-intrinsic.c: Before the patch, the argument-free 
version of this_image() was broken for -fcoarray=lib. This breakage 
proves that one badly needs -fcoarray=lib test cases.


3. gcc/testsuite/gfortran.dg/coarray_13.f90: Reported as PR 48477. It 
make sense to avoid accessing array element 140 of an array which only 
has 3 elements ...


Committed as Revs. 172059, 172060 and 172061.

Tobias
Index: libgfortran/ChangeLog
===
--- libgfortran/ChangeLog	(Revision 172058)
+++ libgfortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,10 @@
+2011-04-06  Tobias Burnus  bur...@net-b.de
+
+	PR fortran/18918
+	* caf/mpi.c (_gfortran_caf_init, _gfortran_caf_finalize):
+	Add global variable caf_mpi_initialized and use it for when
+	finalizing.
+
 2011-04-04  Tobias Burnus  bur...@net-b.de
 
 	* unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
Index: libgfortran/caf/mpi.c
===
--- libgfortran/caf/mpi.c	(Revision 172058)
+++ libgfortran/caf/mpi.c	(Arbeitskopie)
@@ -36,6 +36,7 @@ see the files COPYING3 and COPYING.RUNTIME respect
 static void error_stop (int error) __attribute__ ((noreturn));
 
 /* Global variables.  */
+static int caf_mpi_initialized;
 static int caf_this_image;
 static int caf_num_images;
 static MPI_Win caf_world_window;
@@ -50,12 +51,10 @@ static MPI_Win caf_world_window;
 void
 _gfortran_caf_init (int *argc, char ***argv, int *this_image, int *num_images)
 {
-  int flag;
-
-  /* The following is only the case if one does not have a Fortran
- main program. */
-  MPI_Initialized (flag);
-  if (!flag)
+  /* caf_mpi_initialized is only true if the main program is not written in
+ Fortran.  */
+  MPI_Initialized (caf_mpi_initialized);
+  if (!caf_mpi_initialized)
 MPI_Init (argc, argv);
 
   MPI_Comm_rank (MPI_COMM_WORLD, caf_this_image);
@@ -69,15 +68,15 @@ _gfortran_caf_init (int *argc, char ***argv, int *
 }
 
 
-/* Finalize coarray program. Note: This is only called before the
-   program ends; thus the MPI_Initialized status of _gfortran_caf_init
-   does not play a role.  */
+/* Finalize coarray program.   */
 
 void
 _gfortran_caf_finalize (void)
 {
   MPI_Win_free (caf_world_window);
-  MPI_Finalize ();
+
+  if (!caf_mpi_initialized)
+MPI_Finalize ();
 }
 
 
Index: gcc/fortran/ChangeLog
===
--- gcc/fortran/ChangeLog	(Revision 172058)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,9 @@
+2011-04-06  Tobias Burnus  bur...@net-b.de
+
+	PR fortran/18918
+	* trans-intrinsic.c (gfc_conv_intrinsic_function): Fix
+	call for this_image.
+
 2011-04-05  Nathan Froyd  froy...@codesourcery.com
 
 	* trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Use
Index: gcc/fortran/trans-intrinsic.c
===
--- gcc/fortran/trans-intrinsic.c	(Revision 172058)
+++ gcc/fortran/trans-intrinsic.c	(Arbeitskopie)
@@ -6260,7 +6260,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr
   break;
 
 case GFC_ISYM_THIS_IMAGE:
-  if (expr-value.function.actual)
+  if (expr-value.function.actual-expr)
 	conv_intrinsic_cobound (se, expr);
   else
 	trans_this_image (se, expr);
Index: gcc/testsuite/ChangeLog
===
--- gcc/testsuite/ChangeLog	(Revision 172058)
+++ gcc/testsuite/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,9 @@
+2011-04-06  Tobias Burnus  bur...@net-b.de
+
+	PR fortran/18918
+	PR fortran/48477
+	* gfortran.dg/coarray_13.f90: Avoid out-of-bounds access.
+
 2011-04-06  Steve Ellcey  s...@cup.hp.com
 
 	* gcc.dg/mtune.c: Prune note from output.
@@ -33,7 +39,7 @@
 
 2011-04-04  Yufeng Zhang  yufeng.zh...@arm.com
 
-* g++.dg/abi/arm_cxa_vec1.C (__ARM_EABI__): Fix typo.
+	* g++.dg/abi/arm_cxa_vec1.C (__ARM_EABI__): Fix typo.
 	(cctor): Actually return the value.
 	(main): Cast return values.
 
Index: gcc/testsuite/gfortran.dg/coarray_13.f90
===
--- gcc/testsuite/gfortran.dg/coarray_13.f90	(Revision 172058)
+++ gcc/testsuite/gfortran.dg/coarray_13.f90	(Arbeitskopie)
@@ -105,10 +105,10 @@ contains
 integer :: n
 integer :: A(-1:3,0:4,-2:5,-4:7)[n+2:n+5,n-1:*]
 
-A(1,1,1,1) = 42
-if (A(1,1,1,1) /= 42) call abort()
-A(1,1,1,1)[4,n] = -42
-if (A(1,1,1,1)[4,n] /= -42) call abort()
+A(-1,0,-2,-4) = 42
+if (A(-1,0,-2,-4) /= 42) call abort()
+A(1,0,-2,-4) = 99
+if (A(1,0,-2,-4) /= 99) call abort()
 
 if (this_image(A,dim=1) /= n+2) call abort()
 if (lcobound  (A,dim=1) /= n+2) call abort()


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Steven Bosscher
On Wed, Apr 6, 2011 at 8:15 PM, Jeff Law l...@redhat.com wrote:

 AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only affects 
 RTL.
 But the elimination of the PHI results in creating RTL that is inserted
 on a CFG edge.

Yes, but gimple_expand_cfg() calls find_many_sub_basic_blocks(), and
that should be enough, no??

/me goes back to trying to understand this code :-)

Ciao!
Steven


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Steven Bosscher
On Wed, Apr 6, 2011 at 8:37 PM, Steven Bosscher stevenb@gmail.com wrote:
 On Wed, Apr 6, 2011 at 8:15 PM, Jeff Law l...@redhat.com wrote:

 AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only affects 
 RTL.
 But the elimination of the PHI results in creating RTL that is inserted
 on a CFG edge.

 Yes, but gimple_expand_cfg() calls find_many_sub_basic_blocks(), and
 that should be enough, no??

 /me goes back to trying to understand this code :-)

Could you please add an explanation to the PR about how that PHI
results in a loop on an edge? My fantasy is not big enough to
visualize any case where that can happen!

Ciao!
Steven


Re: [Patch][AVR]: Initial builtins support

2011-04-06 Thread Georg-Johann Lay

Added Anatoly and Eric to changelog entry

Johann


2011-04-06  Anatoly Sokolov ae...@post.ru
Eric Weddington eric.wedding...@atmel.com
Georg-Johann Lay  a...@gjlay.de

* config/avr/avr.c: (insn-codes.h, optabs.h, langhooks.h):
New Includes
(avr_init_builtins, avr_expand_builtin,
avr_expand_delay_cycles, avr_expand_unop_builtin,
avr_expand_binop_builtin ): New static functions.
(avr_builtin_id): New enum
(struct avr_builtin_description): New struct
(bdesc_1arg, bdesc_2arg): New arrays describing some RTL builtins.
(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
* config/avr/avr.md (UNSPEC_FMUL, UNSPEC_FMULS, UNSPEC_FMULSU,
UNSPECV_ENABLE_IRQS, UNSPECV_NOP, UNSPECV_SLEEP, UNSPECV_WDR,
UNSPECV_DELAY_CYCLES): new enumeration values
(UNSPEC_SEI, UNSPEC_CLI): Remove enumeration values
(enable_interrupt): Use UNSPECV_ENABLE_IRQS
(disable_interrupt): Use UNSPECV_ENABLE_IRQS
(*rotlqi3_4): rename to named insn rotlqi3_4
(delay_cycles_1, delay_cycles_2, delay_cycles_3,
delay_cycles_4, nopv, sleep, wdr, fmul, fmuls,
fmulsu): New insns
* config/avr/avr-c.c: fix line endings
(avr_cpu_cpp_builtins): New builtin defines: __BUILTIN_AVR_NOP,
__BUILTIN_AVR_SEI, __BUILTIN_AVR_CLI, __BUILTIN_AVR_WDR,
__BUILTIN_AVR_SLEEP, __BUILTIN_AVR_SWAP,
__BUILTIN_AVR_DELAY_CYCLES, __BUILTIN_AVR_FMUL,
__BUILTIN_AVR_FMULS, __BUILTIN_AVR_FMULSU.


Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/06/11 12:37, Steven Bosscher wrote:
 On Wed, Apr 6, 2011 at 8:15 PM, Jeff Law l...@redhat.com wrote:
 
 AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only affects 
 RTL.
 But the elimination of the PHI results in creating RTL that is inserted
 on a CFG edge.
 
 Yes, but gimple_expand_cfg() calls find_many_sub_basic_blocks(), and
 that should be enough, no??
Maybe -- as I originally mentioned, I really don't know this code at all.

Ironically, the PR I referenced aborts in find_many_sub_basic_blocks
code because the control flow insn insn inserted on the edge doesn't
gets its JUMP_LABEL initialized.

jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnLenAAoJEBRtltQi2kC7B/AIAJAT7Ur5ipNsv5oP9JDlXShM
cEQ9ucPHOl+R6wH21bL4Zv2heUT/kwuk0HUSwafkWvPivZCT10Ak1DJRi89mMBc9
CmBwPnuBYMnUaJTXBTfeXIaUsCBiUhghf2t5b5a3/lF38T488Z9Rtff3E0/FemC6
XxgKWVFLOuwCGWfO4tHr3I9U0lHp4pHkjRlfkDurygS5aq91WYsBAL7M6ZhyNxme
rSBFiEkiCmPvH0JEgbUkRidQrRdAiKETZ8ajKIE7N7w8APl1MpaYJ5BbAHXUwyLO
CyKRmUlMBHE4gCKNNnKWB6D5UhYFRFb1S6jgnI956MPuqkt4r/aDo1TD3cdLM0A=
=zocz
-END PGP SIGNATURE-


[PATCH] Remove ASM_OUTPUT_BSS macro.

2011-04-06 Thread Anatoly Sokolov
Hi.

 No one back end does not use ASM_OUTPUT_BSS macro now, this patch remove it. 
The GCC have more flexible ASM_OUTPUT_ALIGNED_BSS macro.

  The patch has been bootstrapped on and regression tested on
x86_64-unknown-linux-gnu for c.

  OK to install?

* doc/tm.texi.in (ASM_OUTPUT_BSS): Remove documentation.
(BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): Update documentation.
* doc/tm.texi: Regenerate.
* system.h (ASM_OUTPUT_BSS): Poison.
* varasm.c (asm_output_bss): Remove function.
(emit_bss, init_varasm_once): Don't use ASM_OUTPUT_BSS macro.

* config/frv/frv.h (BSS_SECTION_ASM_OP): Remove comment.
* config/frv/fr30.h (BSS_SECTION_ASM_OP): Likewise.
* config/i386/djgpp.h (BSS_SECTION_ASM_OP): Likewise.
* config/i386/i386elf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
Likewise.
* config/sh/sh.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
Likewise.
* config/m68k/m68kelf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
Likewise.
* config/m68k/netbsd-elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.


Index: gcc/doc/tm.texi
===
--- gcc/doc/tm.texi (revision 172058)
+++ gcc/doc/tm.texi (working copy)
@@ -6821,8 +6821,8 @@
 @defmac BSS_SECTION_ASM_OP
 If defined, a C expression whose value is a string, including spacing,
 containing the assembler operation to identify the following data as
-uninitialized global data.  If not defined, and neither
-@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
+uninitialized global data.  If not defined, and 
+@code{ASM_OUTPUT_ALIGNED_BSS} not defined,
 uninitialized global data will be output in the data section if
 @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
 used.
@@ -7598,20 +7598,19 @@
 the variable's decl in order to chose what to output.
 @end defmac
 
-@defmac ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, 
@var{rounded})
+@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
@var{size}, @var{alignment})
 A C statement (sans semicolon) to output to the stdio stream
 @var{stream} the assembler definition of uninitialized global @var{decl} named
-@var{name} whose size is @var{size} bytes.  The variable @var{rounded}
-is the size rounded up to whatever alignment the caller wants.
+@var{name} whose size is @var{size} bytes.  The variable @var{alignment}
+is the alignment specified as the number of bits.
 
-Try to use function @code{asm_output_bss} defined in @file{varasm.c} when
-defining this macro.  If unable, use the expression
+Try to use function @code{asm_output_aligned_bss} defined in file
+@file{varasm.c} when defining this macro.  If unable, use the expression
 @code{assemble_name (@var{stream}, @var{name})} to output the name itself;
 before and after that, output the additional assembler syntax for defining
 the name, and a newline.
 
-There are two ways of handling global BSS@.  One is to define either
-this macro or its aligned counterpart, @code{ASM_OUTPUT_ALIGNED_BSS}.
+There are two ways of handling global BSS@.  One is to define this macro.
 The other is to have @code{TARGET_ASM_SELECT_SECTION} return a
 switchable BSS section (@pxref{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}).
 You do not need to do both.
@@ -7623,17 +7622,6 @@
 common in order to save space in the object file.
 @end defmac
 
-@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
@var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
-separate, explicit argument.  If you define this macro, it is used in
-place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
-handling the required alignment of the variable.  The alignment is specified
-as the number of bits.
-
-Try to use function @code{asm_output_aligned_bss} defined in file
-@file{varasm.c} when defining this macro.
-@end defmac
-
 @defmac ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
 A C statement (sans semicolon) to output to the stdio stream
 @var{stream} the assembler definition of a local-common-label named
Index: gcc/doc/tm.texi.in
===
--- gcc/doc/tm.texi.in  (revision 172058)
+++ gcc/doc/tm.texi.in  (working copy)
@@ -6799,8 +6799,8 @@
 @defmac BSS_SECTION_ASM_OP
 If defined, a C expression whose value is a string, including spacing,
 containing the assembler operation to identify the following data as
-uninitialized global data.  If not defined, and neither
-@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
+uninitialized global data.  If not defined, and 
+@code{ASM_OUTPUT_ALIGNED_BSS} not defined,
 uninitialized global data will be output in the data section if
 @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
 used.
@@ -7564,20 +7564,19 

Re: [RFC] Remove kludge in commit_edge_insertions

2011-04-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/06/11 12:39, Steven Bosscher wrote:
 On Wed, Apr 6, 2011 at 8:37 PM, Steven Bosscher stevenb@gmail.com wrote:
 On Wed, Apr 6, 2011 at 8:15 PM, Jeff Law l...@redhat.com wrote:

 AFAIU the patch doesn't change behavior for the GIMPLE CFG. It only 
 affects RTL.
 But the elimination of the PHI results in creating RTL that is inserted
 on a CFG edge.

 Yes, but gimple_expand_cfg() calls find_many_sub_basic_blocks(), and
 that should be enough, no??

 /me goes back to trying to understand this code :-)
 
 Could you please add an explanation to the PR about how that PHI
 results in a loop on an edge? My fantasy is not big enough to
 visualize any case where that can happen!
Presumably it's the vector initialization.  THere's a fair amount of
backend goop that comes into play.  Peek at expand_set_or_movmem_via_loop.

jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNnL/yAAoJEBRtltQi2kC7LfoH/jWh+8b77bjuLQnVyBrB8Naj
UWOPmPQHzs6DT1THXz8ef+pS3Bvuhbm+RxnHWhUTJQ9qBYwCf2oXzZDgytadfGo7
PKEtRpJTe4z7dwTGvp6UUX16TEI29OLHeNyyiDdEQ2ryCHJaSYB1MC8PEANilaHW
uYAvTOkLbk6ORjx06pleVGy0IJW1UwLeQoJ2ggZvvmPZz8NghAWuvdfVkoX409wo
vjOJ/EnDI603zKazh8yLI0c1K+jZNjnqqlxM8kC3GSt1lJt0LSO5vKW47H0E4zf0
rXhfj5WTiNJ0b0QjGGreIbKjUT8HLPjTJe3gurqgS25R2NtWCv9zxkYFu7sCGPo=
=2tG9
-END PGP SIGNATURE-


[MIPS] Remove REG_OK_FOR_BASE_P and REG_OK_FOR_INDEX_P macros

2011-04-06 Thread Anatoly Sokolov
Hello.

  This patch remove unused REG_OK_FOR_BASE_P and REG_OK_FOR_INDEX_P macros 
from the MIPS back end.

  Bootstrapped and regression tested on mips64el-unknown-linux-gnu.

  OK to install?

* config/mips/mips.h (REG_MODE_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P):
Remove macros.


Index: gcc/config/mips/mips.h
===
--- gcc/config/mips/mips.h  (revision 171626)
+++ gcc/config/mips/mips.h  (working copy)
@@ -2305,28 +2305,6 @@
 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
 #define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) \
   mips_regno_mode_ok_for_base_p (REGNO, MODE, 1)
-
-/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
-   and check its validity for a certain class.
-   We have two alternate definitions for each of them.
-   The usual definition accepts all pseudo regs; the other rejects them all.
-   The symbol REG_OK_STRICT causes the latter definition to be used.
-
-   Most source files want to accept pseudo regs in the hope that
-   they will get allocated to the class that the insn wants them to be in.
-   Some source files that are used after register allocation
-   need to be strict.  */
-
-#ifndef REG_OK_STRICT
-#define REG_MODE_OK_FOR_BASE_P(X, MODE) \
-  mips_regno_mode_ok_for_base_p (REGNO (X), MODE, 0)
-#else
-#define REG_MODE_OK_FOR_BASE_P(X, MODE) \
-  mips_regno_mode_ok_for_base_p (REGNO (X), MODE, 1)
-#endif
-
-#define REG_OK_FOR_INDEX_P(X) 0
-
 
 /* Maximum number of registers that can appear in a valid memory address.  */
 
Anatoly.



Convert legacy m68k options to .opt aliases

2011-04-06 Thread Joseph S. Myers
Similar to http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00265.html,
this patch converts legacy m68k options for non-ColdFire CPUs into
aliases for the corresponding -mcpu= options.  (Note that -mcpu32 is
an alias for -mcpu=68332 rather than -mcpu=cpu32, to match the old
code in m68k_handle_option.)  This significantly simplifies the
multilibs code in t-mlibs, since it no longer needs to handle those
old-style options (and all cases where two -mcpu= options get the same
multilib are already handled by the generic logic there rather than
needing to be listed specially).  The requirement for binutils 2.17 or
later (to support these options to the assembler) is documented.

Tested building cc1 and xgcc for cross to m68k-elf.  Will commit to
trunk in the absence of target maintainer objections.

2011-04-06  Joseph Myers  jos...@codesourcery.com

* config/m68k/m68k.c (m68k_handle_option): Don't handle
OPT_m68000, OPT_mc68000, OPT_m68010, OPT_m68020, OPT_mc68020,
OPT_m68030, OPT_m68040, OPT_m68060, OPT_m68302, OPT_m68332 and
OPT_mcpu32.
* config/m68k/m68k.h (OPTION_DEFAULT_SPECS, ASM_CPU_SPEC): Don't
handle -mc68000, -m68000, -m68302, -m68010, -mc68020, -m68020,
-m68030, -m68040, -m68060, -mcpu32 and -m68332.
* config/m68k/m68k.opt (m68000, m68010, m68020, m68030, m68040,
m68060, m68302, m68332, mc68000, mc68020, mcpu32): Use Alias.
* config/m68k/t-mlibs (CANONICALIZE_OPTIONS): Remove.
(MULTILIB_OPTIONS): Don't use $(CANONICALIZE_OPTIONS).
(MULTILIB_MATCHES): Map -march= options to corresponding -mcpu=
options.  Don't map other m68k options manually.  Don't handle
old-style options as canonical.
(MULTILIB_EXCEPTIONS): Don't use $(CANONICALIZE_OPTIONS).
* doc/install.texi (m68k-*-*): Document binutils version
requirement.

Index: gcc/doc/install.texi
===
--- gcc/doc/install.texi(revision 172035)
+++ gcc/doc/install.texi(working copy)
@@ -3773,6 +3773,8 @@ be a @option{-mcpu} argument or one of t
 @samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030},
 @samp{m68040}, @samp{m68060}, @samp{m68020-40} and @samp{m68020-60}.
 
+GCC requires at least binutils version 2.17 on these targets.
+
 @html
 hr /
 @end html
Index: gcc/config/m68k/t-mlibs
===
--- gcc/config/m68k/t-mlibs (revision 172035)
+++ gcc/config/m68k/t-mlibs (working copy)
@@ -45,15 +45,9 @@ ifeq ($(filter m$(M68K_MLIB_DEFAULT),$(M
 $(error Error default cpu '$(target_cpu_default)' is not in multilib set 
'$(M68K_MLIB_CPUS)')
 endif
 
-# Sed arguments that convert mcpu=* arguments into canonical forms.
-# We want to use the legacy m68* options instead of the new -mcpu=68*
-# options when compiling multilibs because the former are recognised
-# by older binutils.
-CANONICALIZE_OPTIONS = -e 's|mcpu=68|m68|g' -e 's|mcpu=cpu32|mcpu32|g'
-
 MULTILIB_DIRNAMES := $(filter-out m$(M68K_MLIB_DEFAULT),$(M68K_MLIB_CPUS))
 MULTILIB_OPTIONS := $(shell echo $(MULTILIB_DIRNAMES:m%=mcpu=%) \
- | sed -e 's| |/|g' $(CANONICALIZE_OPTIONS))
+ | sed -e 's| |/|g' )
 
 # Add subtarget specific options  dirs.
 MULTILIB_DIRNAMES += $(M68K_MLIB_DIRNAMES)
@@ -62,14 +56,13 @@ MULTILIB_OPTIONS += $(M68K_MLIB_OPTIONS)
 MULTILIB_MATCHES :=
 
 ifneq ($(M68K_ARCH),cf)
-# Map the new-style options to the legacy m68k ones.
-MULTILIB_MATCHES += m68000=mcpu?68000 m68000=march?68000 m68000=mc68000 \
-   m68000=m68302 \
-   m68020=mcpu?68020 m68020=march?68020 m68020=mc68020 \
-   m68030=mcpu?68030 m68030=march?68030 \
-   m68040=mcpu?68040 m68040=march?68040 \
-   m68060=mcpu?68060 m68060=march?68060 \
-   mcpu32=mcpu?cpu32 mcpu32=march?cpu32 mcpu32=m68332
+# Map -march=* options to the representative -mcpu=* option.
+MULTILIB_MATCHES += mcpu?68000=march?68000 \
+   mcpu?68020=march?68020 \
+   mcpu?68030=march?68030 \
+   mcpu?68040=march?68040 \
+   mcpu?68060=march?68060 \
+   mcpu?cpu32=march?cpu32
 endif
 
 ifneq ($(M68K_ARCH),m68k)
@@ -82,9 +75,7 @@ endif
 MULTILIB_MATCHES += \
   $(call M68K_AWK, \
 (CPU_NAME != MLIB) $(M68K_MLIB_CPU), \
-(match(MLIB, ^68) || MLIB == cpu32 \
- ? mMLIB=mcpu?CPU_NAME \
- : mcpu?MLIB=mcpu?CPU_NAME))
+(mcpu?MLIB=mcpu?CPU_NAME))
 
 MULTILIB_EXCEPTIONS :=
 
@@ -102,9 +93,5 @@ endif
 MULTILIB_EXCEPTIONS := \
$(patsubst mcpu=$(M68K_MLIB_DEFAULT)/%,%,$(MULTILIB_EXCEPTIONS))
 
-# Convert all options to canonical form.
-MULTILIB_EXCEPTIONS := $(shell echo $(MULTILIB_EXCEPTIONS) | \
-sed $(CANONICALIZE_OPTIONS))
-
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
Index: 

Re: Cloog ISL - and linking of libisl

2011-04-06 Thread Jack Howarth
On Tue, Feb 15, 2011 at 08:07:43PM +0100, Tobias Burnus wrote:
 Dear Sebastian and Tobias, hello all,

 I think GCC should automatically link libisl (-lisl) if one configures  
 GCC to use cloog-isl. That's the first patch at  
 http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01272.html , which remains  
 unreviewed. (The second part about -lpwl looks a bit odd.)

 The issue came also up today at #gfortran - and the proposed solutions  
 was the same.

 I think automatically linking libisl makes sense and is also in line  
 with PPL, which is linked via the toplevel configure.ac (cf. second -  
 bogus - part of the linked patch or simply the file itself).

 The patch I am talking about is:

 Index: config/cloog.m4
 ===
 --- config/cloog.m4   (revision 166641)
 +++ config/cloog.m4   (working copy)
 @@ -143,7 +143,7 @@
;;
  ISL)
clooginc=${clooginc} ${_cloogorginc}
 -  clooglibs=${clooglibs} -lcloog-isl
 +  clooglibs=${clooglibs} -lcloog-isl -lisl
cloog_org=yes
;;
  PPL)



 Tobias

Tobias,
   Are we certain that it is essential to explicitly link in -lisl?
This change has caused an unnecessary rebuild of FSF gcc when upgrading
cloog.org from 0.16.1 to 0.16.2 due to the soversion bump on libisl.
Do we know of any direct calls from graphite into libisl? If all accesses
are done through the API in libcloog-isl, which hasn't been version bumped,
the extra linkage on -lisl would appear to be unnecessary.
  Jack


Re: [wwdocs] add libstdc++ docs for 4.6.0

2011-04-06 Thread Benjamin Kosnik

 I ended up fiddling a bit with permissions and such, but everything
 should be in place now and I also committed the web patch on your
 behalf.

Thanks! This pleases me a great deal.
 
 Testing the links, there is one thing does does not work, and where
 I was not sure how to address it:  The first link to the manual,
 http://gcc.gnu.org/onlinedocs/gcc-4.6.0/libstdc++/manual/ does not
 work.  

Should be:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/libstdc++/manual/spine.html

-benjamin


[PATCH 3/7] cgraph_node - cgraph_get_node with asserts

2011-04-06 Thread Martin Jambor
Hi,

the patch below changes a number of calls to cgraph_node to calls to
cgraph_get_node.  These calls should never return NULL but because the
callers do not immediately dereference the pointer they get, a NULL
value would result in a segmentation fault at some later point,
obscuring the real cause.  Therefore I have added checking asserts to
guard this does not happen.

Bootstrapped and tested separately on x86_64-linux without any
problems, tests on other platforms (together with the other patches)
in progress.

OK for trunk?

Thanks,

Martin


2011-04-06  Martin Jambor  mjam...@suse.cz

* tree-inline.c (tree_function_versioning): Call cgraph_get_node
instead of cgraph_node and assert it does not return NULL.
* lto-streamer-in.c (lto_read_body): Likewise.
* omp-low.c (new_omp_context): Likewise.
(create_task_copyfn): Likewise.
* tree-emutls.c (lower_emutls_function_body): Likewise.
* matrix-reorg.c (transform_allocation_sites): Likewise.



Index: src/gcc/tree-inline.c
===
--- src.orig/gcc/tree-inline.c
+++ src/gcc/tree-inline.c
@@ -5001,8 +5001,10 @@ tree_function_versioning (tree old_decl,
   TREE_CODE (new_decl) == FUNCTION_DECL);
   DECL_POSSIBLY_INLINED (old_decl) = 1;
 
-  old_version_node = cgraph_node (old_decl);
-  new_version_node = cgraph_node (new_decl);
+  old_version_node = cgraph_get_node (old_decl);
+  gcc_checking_assert (old_version_node);
+  new_version_node = cgraph_get_node (new_decl);
+  gcc_checking_assert (new_version_node);
 
   /* Output the inlining info for this abstract function, since it has been
  inlined.  If we don't do this now, we can lose the information about the
Index: src/gcc/lto-streamer-in.c
===
--- src.orig/gcc/lto-streamer-in.c
+++ src/gcc/lto-streamer-in.c
@@ -1446,8 +1446,9 @@ lto_read_body (struct lto_file_decl_data
 {
   struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
   struct lto_in_decl_state *decl_state;
-  struct cgraph_node *node = cgraph_node (fn_decl);
+  struct cgraph_node *node = cgraph_get_node (fn_decl);
 
+  gcc_checking_assert (node);
   push_cfun (fn);
   init_tree_ssa (fn);
 
Index: src/gcc/omp-low.c
===
--- src.orig/gcc/omp-low.c
+++ src/gcc/omp-low.c
@@ -1209,7 +1209,8 @@ new_omp_context (gimple stmt, omp_contex
 {
   ctx-cb.src_fn = current_function_decl;
   ctx-cb.dst_fn = current_function_decl;
-  ctx-cb.src_node = cgraph_node (current_function_decl);
+  ctx-cb.src_node = cgraph_get_node (current_function_decl);
+  gcc_checking_assert (ctx-cb.src_node);
   ctx-cb.dst_node = ctx-cb.src_node;
   ctx-cb.src_cfun = cfun;
   ctx-cb.copy_decl = omp_copy_decl;
@@ -6263,7 +6264,8 @@ create_task_copyfn (gimple task_stmt, om
   memset (tcctx, '\0', sizeof (tcctx));
   tcctx.cb.src_fn = ctx-cb.src_fn;
   tcctx.cb.dst_fn = child_fn;
-  tcctx.cb.src_node = cgraph_node (tcctx.cb.src_fn);
+  tcctx.cb.src_node = cgraph_get_node (tcctx.cb.src_fn);
+  gcc_checking_assert (tcctx.cb.src_node);
   tcctx.cb.dst_node = tcctx.cb.src_node;
   tcctx.cb.src_cfun = ctx-cb.src_cfun;
   tcctx.cb.copy_decl = task_copyfn_copy_decl;
Index: src/gcc/tree-emutls.c
===
--- src.orig/gcc/tree-emutls.c
+++ src/gcc/tree-emutls.c
@@ -619,7 +619,8 @@ lower_emutls_function_body (struct cgrap
 
   d.cfun_node = node;
   d.builtin_decl = built_in_decls[BUILT_IN_EMUTLS_GET_ADDRESS];
-  d.builtin_node = cgraph_node (d.builtin_decl);
+  d.builtin_node = cgraph_get_node (d.builtin_decl);
+  gcc_checking_assert (d.builtin_node);
 
   FOR_EACH_BB (d.bb)
 {
Index: src/gcc/matrix-reorg.c
===
--- src.orig/gcc/matrix-reorg.c
+++ src/gcc/matrix-reorg.c
@@ -2169,7 +2169,8 @@ transform_allocation_sites (void **slot,
   update_ssa (TODO_update_ssa);
   /* Replace the malloc size argument in the malloc of level 0 to be
  the size of all the dimensions.  */
-  c_node = cgraph_node (mi-allocation_function_decl);
+  c_node = cgraph_get_node (mi-allocation_function_decl);
+  gcc_checking_assert (c_node);
   old_size_0 = gimple_call_arg (call_stmt_0, 0);
   tmp = force_gimple_operand_gsi (gsi, mi-dimension_size[0], true,
  NULL, true, GSI_SAME_STMT);
@@ -2218,7 +2219,8 @@ transform_allocation_sites (void **slot,
   if (!mi-free_stmts[i].stmt)
continue;
 
-  c_node = cgraph_node (mi-free_stmts[i].func);
+  c_node = cgraph_get_node (mi-free_stmts[i].func);
+  gcc_checking_assert (c_node);
   gcc_assert (is_gimple_call (mi-free_stmts[i].stmt));
   e = cgraph_edge (c_node, mi-free_stmts[i].stmt);
   gcc_assert (e);



[PATCH 2/7] cgraph_node - cgraph_get_node conversions accepting NULL results

2011-04-06 Thread Martin Jambor
Hi,

this patch converts a number of calls to cgraph_node to calls to
cgraph_get_node and provides means to deal with returned NULL value.
These are essentially the places where lazy node creation was
happening for no good reason.

Bootstrapped and tested separately on x86_64-linux without any
problems, tests on other platforms (together with the other patches)
in progress.

OK for trunk?

Thanks,

Martin


2011-04-06  Martin Jambor  mjam...@suse.cz

gcc/
* cgraph.c (cgraph_local_info): Call cgraph_get_node instead
of cgraph_node, handle NULL return value.
(cgraph_global_info): Likewise.
(cgraph_rtl_info): Likewise.
* tree-inline.c (estimate_num_insns): Likewise.
* gimplify.c (unshare_body): Likewise.
(unvisit_body): Likewise.
(gimplify_body): Likewise.
* predict.c (optimize_function_for_size_p): Likewise.
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise.
(call_may_clobber_ref_p_1): Likewise.
* varasm.c (function_section_1): Likewise.
(assemble_start_function): Likewise.

gcc/java/
* decl.c (java_mark_decl_local): Call cgraph_get_node instead of
cgraph_node and handle returned NULL.



Index: src/gcc/cgraph.c
===
--- src.orig/gcc/cgraph.c
+++ src/gcc/cgraph.c
@@ -1766,7 +1766,9 @@ cgraph_local_info (tree decl)
   struct cgraph_node *node;
 
   gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
-  node = cgraph_node (decl);
+  node = cgraph_get_node (decl);
+  if (!node)
+return NULL;
   return node-local;
 }
 
@@ -1778,7 +1780,9 @@ cgraph_global_info (tree decl)
   struct cgraph_node *node;
 
   gcc_assert (TREE_CODE (decl) == FUNCTION_DECL  cgraph_global_info_ready);
-  node = cgraph_node (decl);
+  node = cgraph_get_node (decl);
+  if (!node)
+return NULL;
   return node-global;
 }
 
@@ -1790,9 +1794,10 @@ cgraph_rtl_info (tree decl)
   struct cgraph_node *node;
 
   gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
-  node = cgraph_node (decl);
-  if (decl != current_function_decl
-   !TREE_ASM_WRITTEN (node-decl))
+  node = cgraph_get_node (decl);
+  if (!node
+  || (decl != current_function_decl
+  !TREE_ASM_WRITTEN (node-decl)))
 return NULL;
   return node-rtl;
 }
Index: src/gcc/tree-inline.c
===
--- src.orig/gcc/tree-inline.c
+++ src/gcc/tree-inline.c
@@ -3470,10 +3470,11 @@ estimate_num_insns (gimple stmt, eni_wei
 case GIMPLE_CALL:
   {
tree decl = gimple_call_fndecl (stmt);
+   struct cgraph_node *node;
 
/* Do not special case builtins where we see the body.
   This just confuse inliner.  */
-   if (!decl || cgraph_node (decl)-analyzed)
+   if (!decl || !(node = cgraph_get_node (decl)) || node-analyzed)
  ;
/* For buitins that are likely expanded to nothing or
   inlined do not account operand costs.  */
Index: src/gcc/gimplify.c
===
--- src.orig/gcc/gimplify.c
+++ src/gcc/gimplify.c
@@ -959,11 +959,11 @@ copy_if_shared (tree *tp)
 static void
 unshare_body (tree *body_p, tree fndecl)
 {
-  struct cgraph_node *cgn = cgraph_node (fndecl);
+  struct cgraph_node *cgn = cgraph_get_node (fndecl);
 
   copy_if_shared (body_p);
 
-  if (body_p == DECL_SAVED_TREE (fndecl))
+  if (cgn  body_p == DECL_SAVED_TREE (fndecl))
 for (cgn = cgn-nested; cgn; cgn = cgn-next_nested)
   unshare_body (DECL_SAVED_TREE (cgn-decl), cgn-decl);
 }
@@ -1000,11 +1000,11 @@ unmark_visited (tree *tp)
 static void
 unvisit_body (tree *body_p, tree fndecl)
 {
-  struct cgraph_node *cgn = cgraph_node (fndecl);
+  struct cgraph_node *cgn = cgraph_get_node (fndecl);
 
   unmark_visited (body_p);
 
-  if (body_p == DECL_SAVED_TREE (fndecl))
+  if (cgn  body_p == DECL_SAVED_TREE (fndecl))
 for (cgn = cgn-nested; cgn; cgn = cgn-next_nested)
   unvisit_body (DECL_SAVED_TREE (cgn-decl), cgn-decl);
 }
@@ -7695,6 +7695,7 @@ gimplify_body (tree *body_p, tree fndecl
   gimple_seq parm_stmts, seq;
   gimple outer_bind;
   struct gimplify_ctx gctx;
+  struct cgraph_node *cgn;
 
   timevar_push (TV_TREE_GIMPLIFY);
 
@@ -7712,7 +7713,8 @@ gimplify_body (tree *body_p, tree fndecl
   unshare_body (body_p, fndecl);
   unvisit_body (body_p, fndecl);
 
-  if (cgraph_node (fndecl)-origin)
+  cgn = cgraph_get_node (fndecl);
+  if (cgn  cgn-origin)
 nonlocal_vlas = pointer_set_create ();
 
   /* Make sure input_location isn't set to something weird.  */
Index: src/gcc/predict.c
===
--- src.orig/gcc/predict.c
+++ src/gcc/predict.c
@@ -214,10 +214,11 @@ probably_never_executed_bb_p (const_basi
 bool
 optimize_function_for_size_p (struct function *fun)
 {
+  struct cgraph_node *node;
   return (optimize_size
  || (fun  fun-decl
-  (cgraph_node 

[PATCH 1/7] Simple cgraph_node - cgraph_get_node conversions

2011-04-06 Thread Martin Jambor
Hi,

this patch changes most of current calls to cgraph_node to calls to
cgraph_get_node.  The function should never return NULL in he contexts
of the callers below and either the probability is so low that it does
not warrant an assert (like cgraph_get_node (current_function_decl) or
the result is immediately dereferenced and so would segfault anyway.

Bootstrapped and tested separately on x86_64-linux without any
problems, tests on other platforms (together with the other patches)
in progress.

OK for trunk?

Thanks,

Martin


2011-04-06  Martin Jambor  mjam...@suse.cz

* except.c (set_nothrow_function_flags): Call cgraph_get_node instead
of cgraph_node.
* final.c (rest_of_clean_state): Likewise.
* gimple-iterator.c (update_call_edge_frequencies): Likewise.
* passes.c (pass_init_dump_file): Likewise.
(execute_all_ipa_transforms): Likewise.
(function_called_by_processed_nodes_p): Likewise.
* predict.c (maybe_hot_frequency_p): Likewise.
(probably_never_executed_bb_p): Likewise.
(compute_function_frequency): Likewise.
* tree-nested.c (check_for_nested_with_variably_modified): Likewise.
(unnest_nesting_tree_1): Likewise.
(lower_nested_functions): Likewise.
* tree-optimize.c (execute_fixup_cfg): Likewise.
(tree_rest_of_compilation): Likewise.
* tree-profile.c (gimple_gen_ic_func_profiler): Likewise.
* tree-sra.c (ipa_early_sra): Likewise.
* tree-ssa-loop-ivopts.c (computation_cost): Likewise.
* config/i386/i386.c (ix86_compute_frame_layout): Likewise.
* ipa.c (record_cdtor_fn): Likewise.
* ipa-inline.c (cgraph_early_inlining): Likewise.
(compute_inline_parameters_for_current): Likewise.
* ipa-prop.c (ipa_make_edge_direct_to_target): Likewise.
* ipa-pure-const.c (local_pure_const): Likewise.
* ipa-split.c (split_function): Likewise.
(execute_split_functions): Likewise.
* cgraphbuild.c (build_cgraph_edges): Likewise.
(rebuild_cgraph_edges): Likewise.
(cgraph_rebuild_references): Likewise.  
(remove_cgraph_callee_edges): Likewise.
* cgraphunit.c (cgraph_mark_if_needed): Likewise.
(verify_cgraph_node): Likewise.
(cgraph_analyze_functions): Likewise.
(cgraph_preserve_function_body_p): Likewise.
(save_inline_function_body): Likewise.
(save_inline_function_body): Likewise.
* tree-inline.c (copy_bb): Likewise.
(optimize_inline_calls): Likewise.



Index: src/gcc/except.c
===
--- src.orig/gcc/except.c
+++ src/gcc/except.c
@@ -1879,11 +1879,11 @@ set_nothrow_function_flags (void)
  }
   }
   if (crtl-nothrow
-   (cgraph_function_body_availability (cgraph_node
+   (cgraph_function_body_availability (cgraph_get_node
 (current_function_decl))
   = AVAIL_AVAILABLE))
 {
-  struct cgraph_node *node = cgraph_node (current_function_decl);
+  struct cgraph_node *node = cgraph_get_node (current_function_decl);
   struct cgraph_edge *e;
   for (e = node-callers; e; e = e-next_caller)
 e-can_throw_external = false;
Index: src/gcc/final.c
===
--- src.orig/gcc/final.c
+++ src/gcc/final.c
@@ -4283,7 +4283,7 @@ rest_of_clean_state (void)
   else
{
  const char *aname;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
 
  aname = (IDENTIFIER_POINTER
   (DECL_ASSEMBLER_NAME (current_function_decl)));
Index: src/gcc/gimple-iterator.c
===
--- src.orig/gcc/gimple-iterator.c
+++ src/gcc/gimple-iterator.c
@@ -84,7 +84,7 @@ update_call_edge_frequencies (gimple_seq
   to avoid calling them if we never see any calls.  */
if (cfun_node == NULL)
  {
-   cfun_node = cgraph_node (current_function_decl);
+   cfun_node = cgraph_get_node (current_function_decl);
bb_freq = (compute_call_stmt_bb_frequency
   (current_function_decl, bb));
  }
Index: src/gcc/passes.c
===
--- src.orig/gcc/passes.c
+++ src/gcc/passes.c
@@ -1343,7 +1343,7 @@ pass_init_dump_file (struct opt_pass *pa
   if (dump_file  current_function_decl)
{
  const char *dname, *aname;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
  dname = lang_hooks.decl_printable_name (current_function_decl, 2);
  aname = (IDENTIFIER_POINTER
   (DECL_ASSEMBLER_NAME 

[patch] Import iota and is_sorted from std to __gnu_cxx in C++0x mode. (issue4384043)

2011-04-06 Thread Jeffrey Yasskin
In C++0x mode, import iota and is_sorted from namespace std into
namespace __gnu_cxx to avoid ambiguous call errors.  copy_n would be a
good candidate for this too, except it was standardized with a
different return type.

I think this is a candidate to backport to libstdc++-4.6.1.

Tested:
  `make -k check-c++` on x86_64-unknown-linux-gnu.  (still running)

libstdc++-v3/ChangeLog:

2011-04-06  Jeffrey Yasskin  jyass...@google.com

* include/ext/algorithm (is_sorted): In C++0x mode import from
namespace std.
* include/ext/numeric (iota): In C++0x mode import from
namespace std.
* testsuite/ext/is_sorted/cxx0x.cc: New.
* testsuite/ext/iota/cxx0x.cc: New.

diff --git a/libstdc++-v3/include/ext/algorithm 
b/libstdc++-v3/include/ext/algorithm
index 368b591..417a03a 100644
--- a/libstdc++-v3/include/ext/algorithm
+++ b/libstdc++-v3/include/ext/algorithm
@@ -471,6 +471,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 }
 #endif
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  using std::is_sorted;
+#else
   // is_sorted, a predicated testing whether a range is sorted in
   // nondescending order.  This is an extension, not part of the C++
   // standard.
@@ -526,6 +529,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  return false;
   return true;
 }
+#endif  // __GXX_EXPERIMENTAL_CXX0X__
 
   /**
*  @brief Find the median of three values.
diff --git a/libstdc++-v3/include/ext/numeric b/libstdc++-v3/include/ext/numeric
index d4a367f..b389177 100644
--- a/libstdc++-v3/include/ext/numeric
+++ b/libstdc++-v3/include/ext/numeric
@@ -123,6 +123,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 power(_Tp __x, _Integer __n)
 { return __power(__x, __n); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  using std::iota;
+#else
   /**
*  This is an SGI extension.
*  @ingroup SGIextensions
@@ -141,9 +144,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   while (__first != __last)
*__first++ = __value++;
 }
+#endif  // __GXX_EXPERIMENTAL_CXX0X__
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
 #endif
-
diff --git a/libstdc++-v3/testsuite/ext/iota/cxx0x.cc 
b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
new file mode 100644
index 000..84917ad
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/iota/cxx0x.cc
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options -std=gnu++0x }
+
+// Copyright (C) 2011 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 ext/numeric
+#include vector
+
+void foo()
+{
+  std::vectorint v;
+  iota(v.begin(), v.end(), 0);
+}
diff --git a/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc 
b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
new file mode 100644
index 000..518716c
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/is_sorted/cxx0x.cc
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options -std=gnu++0x }
+
+// Copyright (C) 2011 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 ext/algorithm
+#include vector
+
+void foo()
+{
+  std::vectorint v;
+  is_sorted(v.begin(), v.end());
+}

--
This patch is available for review at http://codereview.appspot.com/4384043


Re: [patch] Import iota and is_sorted from std to __gnu_cxx in C++0x mode. (issue4384043)

2011-04-06 Thread Paolo Carlini
Hi,

 I think this is a candidate to backport to libstdc++-4.6.1.

Ok mainline and 4_6-branch if testing passes.

Thanks,
Paolo


Re: PATCH [trunk] gengtype should generate ggc_alloc macros in plugin mode.

2011-04-06 Thread Laurynas Biveinis
Hello Basile -

The patch is correct in general. But a few nitpicks:

 2011-04-04  Basile Starynkevitch  bas...@starynkevitch.net
* gengtype.c (write_typed_alloc_def): Gets extra outf_p argument
and use it.

...: New argument f.  Use it instead of header_file.

(write_typed_struct_alloc_def, write_typed_typedef_alloc_def)
(write_typed_alloc_defns): Likewise.
(main): Calls write_typed_alloc_defns with output_header.

 Index: gcc/gengtype.c
 ===
 --- gcc/gengtype.c(revision 171950)
 +++ gcc/gengtype.c(working copy)
 @@ -4197,52 +4197,56 @@ enum alloc_zone
 the allocator will be zone-specific.  */

  static void
 -write_typed_alloc_def (bool variable_size, const char *type_specifier,
 +write_typed_alloc_def (outf_p f,
 +bool variable_size, const char *type_specifier,

Here and for the rest of changed functions:
1) please describe f in the function header comment;
2) please align the second line of argument list.

 +  if (!f)
 +return;

If f is NULL, it must be a bug, please use gcc_assert (f) instead.
Likewise in write_typed_alloc_defns.

 +  oprintf (f, #define ggc_alloc_%s%s, allocator_type, type_name);
 +  oprintf (f, (%s%s%s%s%s) ,
  (variable_size ? SIZE : ),

Here and in similar places please also align the argument list.

Thanks,
--
Laurynas