Re: [PATCH, SMS] Fix marking of SMSed loops as BB_DISABLE_SCHEDULE

2011-10-27 Thread Revital Eres
Hello, >> Tested and bootstrap on all languages except java (PR50879) on >> ppc64-redhat-linux, enabling SMS on loops with SC 1. >> >> OK for mainline? >> > > OK, seems reasonable. > > Please fix typo (in original comment): > -            scheduling passes doesn't touch it.  */ > +            sche

Re: [PATCH] Distribute inliner's size_time data across entries with similar predicates

2011-10-27 Thread Maxim Kuvyrkov
On 20/10/2011, at 10:32 PM, Jan Hubicka wrote: > Hi, >> Jan, >> >> The following patch started as a one-liner for ipa-inline-analysis.c: >> account_size_time() to merge predicates when we are adding data to entry[0] >> (i.e., when space for 32 size_time entries is exhausted): >> >> @@ -537,6 +

[PATCH] Add support for the VIS3 addxc instruction.

2011-10-27 Thread David Miller
'addxc' is like 'addx', but it uses the 64-bit carry condition as input instead of the 32-bit one. This allows us to do ne/ltu/gtu setcc operations comparing 64-bit integers without temporaries. Unfortunately, VIS3 only has addxc (not subxc) and only the 3-register opcode is provided (no immedia

Re: [PATCH] PR fortran/50573 -- Fix checking of dshift{lr} arguments

2011-10-27 Thread Tobias Burnus
Am 28.10.2011 01:27, schrieb Steve Kargl: The attached patch tightens the checking of the arguments of the dshiftl and dshiftr argument. It also does a kind type conversion when either I or J is a BOZ to the kind type of the non-BOZ I or J. OK for trunk? OK with a changelog entry for the NEAR

Re: [PATCH] Code quality tests for inlining and devirtualization optimizations

2011-10-27 Thread Andi Kleen
Maxim Kuvyrkov writes: > The following patch adds 9 tests code quality tests for inlining and > devirtualization optimizations. These tests were originally developed by > Matt. I had a test case for one C (not C++) dynamic devirtualization issue I ran into in PR45631. It's a bit harder for th

Re: [RFC PATCH] update to libtool-2.4.2 and regenerate

2011-10-27 Thread Markus Trippelsdorf
On 2011.10.28 at 00:41 +, Joseph S. Myers wrote: > On Fri, 28 Oct 2011, Markus Trippelsdorf wrote: > > > By popular demand, I've prepared a patch that updates the in-tree > > libtool to version 2.4.2. It is needed for lto-bootstrap with > > -fno-fat-lto-objects and FreeBSD10.x versions. > > I

Re: [RFC PATCH] update to libtool-2.4.2 and regenerate

2011-10-27 Thread Markus Trippelsdorf
On 2011.10.27 at 17:29 -0700, Andi Kleen wrote: > Markus Trippelsdorf writes: > > > By popular demand, I've prepared a patch that updates the in-tree > > libtool to version 2.4.2. It is needed for lto-bootstrap with > > -fno-fat-lto-objects and FreeBSD10.x versions. > > It's a pretty big update

[PATCH] Fix constraint on 64-bit VIS3 vector moves.

2011-10-27 Thread David Miller
Noticed this while combing through a sparc 64-bit testsuite run. Committed to trunk. gcc/ * config/sparc/sparc.md (64-bit vector moves): Use 'e' not 'f' constraint. --- gcc/ChangeLog |3 +++ gcc/config/sparc/sparc.md |4 ++-- 2 files changed, 5 insertions(+)

[PATCH] Fix illegal register substitutions on big-endian during cprop_reg.

2011-10-27 Thread David Miller
As discussed in the thread starting at: http://gcc.gnu.org/ml/gcc/2011-10/msg00478.html We need to make the tests done in copyprop_hardreg_forward_1() match those performed in copy_value(), and in particular make sure that if we are narrowing the mode on big-endian we do not perform the substitu

[PATCH 4/9] Rewrite all compare-and-swap in terms of expand_atomic_compare_and_swap.

2011-10-27 Thread Richard Henderson
--- gcc/builtins.c | 39 +--- gcc/expr.h |4 - gcc/optabs.c | 267 --- gcc/optabs.h |4 + 4 files changed, 126 insertions(+), 188 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index cb9da83..756070f 100644 ---

[PATCH 8/9] Convert i386 backend to new atomic patterns.

2011-10-27 Thread Richard Henderson
Cc: ja...@redhat.com Cc: ubiz...@gmail.com --- gcc/config/i386/i386.md |5 +- gcc/config/i386/sync.md | 306 +-- 2 files changed, 167 insertions(+), 144 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a11a71b..7ce5

[PATCH 7/9] Update omp for new atomic optabs.

2011-10-27 Thread Richard Henderson
Cc: ja...@redhat.com --- gcc/omp-low.c | 55 +++ gcc/optabs.c | 134 +++-- gcc/optabs.h | 13 ++ 3 files changed, 84 insertions(+), 118 deletions(-) diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 5faa084..972cb6d

[PATCH 9/9] Update ChangeLogs.

2011-10-27 Thread Richard Henderson
--- gcc/ChangeLog.mm | 58 + gcc/c-family/ChangeLog.mm |4 +++ 2 files changed, 62 insertions(+), 0 deletions(-) diff --git a/gcc/ChangeLog.mm b/gcc/ChangeLog.mm index 498cc15..758b510 100644 --- a/gcc/ChangeLog.mm +++ b/gcc/ChangeLog.mm

[PATCH 3/9] Introduce and use can_compare_and_swap_p.

2011-10-27 Thread Richard Henderson
--- gcc/builtins.c |7 +++ gcc/omp-low.c |3 +-- gcc/optabs.c | 27 +++ gcc/optabs.h |3 +++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index 3367b50..cb9da83 100644 --- a/gcc/builtins.c +++ b/gcc/

[PATCH 6/9] Update cppbuiltins for atomic-compare-and-swap.

2011-10-27 Thread Richard Henderson
--- gcc/c-family/c-cppbuiltin.c | 50 ++- 1 files changed, 35 insertions(+), 15 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index bb9893a..bf83c26 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbui

[PATCH 5/9] Add missing atomic optab initializations.

2011-10-27 Thread Richard Henderson
--- gcc/genopinit.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/gcc/genopinit.c b/gcc/genopinit.c index e658b44..1954783 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -259,6 +259,12 @@ static const char * const optabs[] = "set_direct_optab_handler (atom

[PATCH 2/9] Handle expanding insns with 8 operands.

2011-10-27 Thread Richard Henderson
--- gcc/optabs.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/gcc/optabs.c b/gcc/optabs.c index b021042..307101b 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7697,6 +7697,14 @@ maybe_gen_insn (enum insn_code icode, unsigned int nops, case 6: retur

[PATCH 1/9] Fix thinko in gen_mem_thread_fence operand.

2011-10-27 Thread Richard Henderson
--- gcc/builtins.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index f47c3b1..3367b50 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5523,11 +5523,12 @@ expand_builtin_atomic_is_lock_free (tree exp) void expand_builtin_mem_

[cxx-mem-model][PATCH 0/9] Convert i386 to new atomic optabs.

2011-10-27 Thread Richard Henderson
This exposed a wealth of problems in code that has heretofore never been tested. The fourth patch makes certain that all expansions of compare-and-swap go through a single routine. I've tested the whole series with and without the last patch. So that I've tested both the sync_ and atomic_ paths.

Re: [PATCH, rs6000] Preserve link stack for 476 cpus

2011-10-27 Thread Peter Bergner
On Thu, 2011-10-27 at 20:43 -0500, Peter Bergner wrote: > Index: gcc/config/rs6000/476.opt [snip] > +Target Var(rs6000_link_stack) Init(1) Save Oops, this should actually be Init(-1). The hunk above was just my way of testing the modified code more by enabling it by default. Sorry about that. Pe

Re: [PATCH] Account for devirtualization opportunities in inliner

2011-10-27 Thread Maxim Kuvyrkov
On 20/10/2011, at 10:11 PM, Jan Hubicka wrote: > static clause_t > -evaluate_conditions_for_edge (struct cgraph_edge *e, bool inline_p) > +evaluate_conditions_vals_binfos_for_edge (struct cgraph_edge *e, > + bool inline_p, > +

Re: C++ PATCH for constexpr vs. mutable

2011-10-27 Thread Gabriel Dos Reis
Jason Merrill writes: | Recent discussion on the committee reflector pointed out issues with | mutable and constexpr; this patch implements what I think is a | reasonable solution. Yes, I agree. Thank you! -- Gaby

Re: [C++ Patch] PR 30066

2011-10-27 Thread Jason Merrill
I made a few formatting tweaks as follows, and checked in the patch. Thanks! Jason commit 3e01e07381cdb16727fe6011202372ebcdfc Author: Jason Merrill Date: Thu Oct 27 17:44:39 2011 -0400 cleanup diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 1e514af..be9044b 100644 --- a/gcc/cp/d

C++ PATCH for constexpr vs. mutable

2011-10-27 Thread Jason Merrill
Recent discussion on the committee reflector pointed out issues with mutable and constexpr; this patch implements what I think is a reasonable solution. Tested x86_64-pc-linux-gnu, applying to trunk. commit 4b41346ab344632f6c22adb3d947a093cdb770ac Author: Jason Merrill Date: Thu Oct 27 14:56

[cxx-mem-model] -finline-atomics option

2011-10-27 Thread Andrew MacLeod
This patch provides a flag that allows atomics operation in-lining to be turned off. The default is on, which is what we have today. by specifying -fno-inline-atomics, none of the new __atomic routines will be inlined, and will be left as external function calls. The __sync routines are not

Re: [PATCH, devirtualization] Detect the new type in type change detection

2011-10-27 Thread Maxim Kuvyrkov
On 27/10/2011, at 12:22 PM, Martin Jambor wrote: > Hi, > > I've been asked by Maxim Kuvyrkov to revive the following patch which > has not made it to 4.6. Currently, when type based devirtualization > detects a potential type change, it simply gives up on gathering any > information on the objec

[PATCH] Code quality tests for inlining and devirtualization optimizations

2011-10-27 Thread Maxim Kuvyrkov
The following patch adds 9 tests code quality tests for inlining and devirtualization optimizations. These tests were originally developed by Matt. Current mainline can optimize only test 5. Martin's patch in http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02506.html will enable optimization of

Re: [PATCH, rs6000] Preserve link stack for 476 cpus

2011-10-27 Thread Peter Bergner
On Thu, 2011-10-13 at 10:03 -0700, Richard Henderson wrote: > On 10/13/2011 08:49 AM, Peter Bergner wrote: > > + if (TARGET_LINK_STACK) > > + asm_fprintf (file, "\tbl 1f\n\tb 2f\n1:\n\tblr\n2:\n"); > > + else > > + asm_fprintf (file, "\tbcl 20,31,1f\n1:\n"); > > Wouldn't it be

Re: [RFC PATCH] update to libtool-2.4.2 and regenerate

2011-10-27 Thread Joseph S. Myers
On Fri, 28 Oct 2011, Markus Trippelsdorf wrote: > By popular demand, I've prepared a patch that updates the in-tree > libtool to version 2.4.2. It is needed for lto-bootstrap with > -fno-fat-lto-objects and FreeBSD10.x versions. > It's a pretty big update as you can see by the following diffstat.

Re: [RFC PATCH] update to libtool-2.4.2 and regenerate

2011-10-27 Thread Andi Kleen
Markus Trippelsdorf writes: > By popular demand, I've prepared a patch that updates the in-tree > libtool to version 2.4.2. It is needed for lto-bootstrap with > -fno-fat-lto-objects and FreeBSD10.x versions. > It's a pretty big update as you can see by the following diffstat. I > cannot attach

Re: [C++ Patch / RFC] PR 50870

2011-10-27 Thread Paolo Carlini
.. maybe one final piece of information for today. I'm trying to figure out where the very different args argument is coming from. Both in 4.5 and in mainline we have the same final chain of tusbst_copy_build, preceded by tsubst_copy_and_build, tusbst_expr, tsubt, tsubst_template_arg, the ar

Re: [PATCH i386] PR47698 no CMOV for volatile mem

2011-10-27 Thread Richard Henderson
On 10/27/2011 05:17 AM, Sergey Ostanevich wrote: > + /* MOVCC semantics implies that source is always read which is wrong > + for devices I/O that are defined using volatile in C. PR47698 */ > + > + if (MEM_P (operands[2]) && MEM_VOLATILE_P (operands[2])) > +return false; This looks to b

Re: [C++ Patch / RFC] PR 50870

2011-10-27 Thread Paolo Carlini
.. thus now I'm investigating, comparing 4.5 to mainline, where the former gets the TYPE_BINFO of the TREE_OPERAND (member, 0). And the answer is "simple": at the beginning of tsubst_copy_and_build case COMPONENT_REF itself! Where: member = TREE_OPERAND (t, 1); if (BASELINK_P (member))

Re: PowerPC shrink-wrap support 3 of 3

2011-10-27 Thread Alan Modra
On Thu, Oct 27, 2011 at 12:24:46AM +1030, Alan Modra wrote: > more code than duplicating epilogues. From what I've seen, the > duplicate tails are generally very small. I guess I should dump out > some info so we can get a better idea. There were 545 occurrences of shrink-wrap in the gcc/ dir fo

Re: [trans-mem] Fix tm_region association of blocks with the "over" label.

2011-10-27 Thread Richard Henderson
On 10/27/2011 03:47 PM, Torvald Riegel wrote: > Fix tm_region association of blocks with the "over" label. > > * trans-mem.c (struct tm_region): Extended comment. > (tm_region_init): Fix tm_region association of blocks with the "over" > label used for transcation abort. >

[RFC PATCH] update to libtool-2.4.2 and regenerate

2011-10-27 Thread Markus Trippelsdorf
By popular demand, I've prepared a patch that updates the in-tree libtool to version 2.4.2. It is needed for lto-bootstrap with -fno-fat-lto-objects and FreeBSD10.x versions. It's a pretty big update as you can see by the following diffstat. I cannot attach the patch even as a gzip file, because o

[Patch, fortran] [66/66] inline sum and product: Inline sum: The end.

2011-10-27 Thread Mikael Morin
This is the final patch. Context diff also provided as gfc_conv_intrinsic_arith has many blank changes. The changes in gfc_conv_intrinsic_arith involve the new initialization for parent_se and ploop, a few additional conditions for scalar-specific stuff, and a specific handling for scalar masks in

[Patch, fortran] [65/66] inline sum and product: Inline sum: Change se initialization.

2011-10-27 Thread Mikael Morin
In the non-scalar case the gfc_se structs are initialized using the se pointer given as argument to the function. To accomodate this, this patch changes initialization to NULL with initialization to a pointer (initially set to NULL for now). The patch explains it better. OK? 2011-10-19 Mikael Mori

[Patch, fortran] [64/66] inline sum and product: Inline sum: Change loop use.

2011-10-27 Thread Mikael Morin
In the non-scalar case the scalarizer needs to take code out of the outer loop, which means that the inner one (the "sum" loop) has already been handled before entering gfc_conv_intrinsic_arith, which means loop shall be a pointer to that loop instead of the address of the local loop in that case.

[Patch, fortran] [63/66] inline sum and product: Inline sum: Change argument handling.

2011-10-27 Thread Mikael Morin
This uses named argument to make it easier to follow. OK? 2011-10-19 Mikael Morin * trans-intrinsic.c (gfc_conv_intrinsic_arith): Small argument handling cleanup. diff --git a/trans-intrinsic.c b/trans-intrinsic.c index 342d2cb..b701502 100644 --- a/trans-intrinsic.c +++ b/trans

[Patch, fortran] [62/66] inline sum and product: Inline sum: Change conditions.

2011-10-27 Thread Mikael Morin
This makes the convention that all conditions are based on arguments presence and their rank. In the hope that it makes code easier to read. OK? 2011-10-19 Mikael Morin * trans-intrinsic.c (gfc_conv_intrinsic_arith): Update conditions. diff --git a/trans-intrinsic.c b/trans-intrinsic.c

[Patch, fortran] [62..66/66] inline sum and product: Inline sum.

2011-10-27 Thread Mikael Morin
This is the purpose of all the serie of patches: inline sum and product. Patches 62..65, possibly don't deserve a patch of their own, they just make the changes in gfc_conv_intrinsic_arith easier to read. The combined diff (context, ignoring indent changes) also attached here. Patch 62: Change co

[Patch, fortran] [61/66] inline sum and product: Prevent regressions: Disable frontend optimizations.

2011-10-27 Thread Mikael Morin
Not exactly a regression, but frontend optimizations can make things worse by forcing temporary generation. This disables common function elimination and binary operator optimization for inline intrinsics. I hope I didn't miss anything else. OK? 2011-10-19 Mikael Morin * frontend-passes

[Patch, fortran] [60/66] inline sum and product: Update the scalarizer: Fix error markers.

2011-10-27 Thread Mikael Morin
This makes the necessary changes for the error markers to be generated at the right place in the testcase. that is for: foo(& sum(bar,1) & ) if sum(bar,1) requires a temporary, the warning is emitted on the second line instead of the first one, so that one can distinguish between ar

[Patch, fortran] [57..59/66] inline sum and product: Prevent regressions: Fix {min, max}{loc, val}

2011-10-27 Thread Mikael Morin
Patches 58 and 59 fix the {min,max}loc and {min,max}val intrinsics which use multiple loops. See the comments in the patches for details. Patch 57 avoids duplicated offset calculation in the code generated. OK? 2011-10-19 Mikael Morin * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):

[Patch, fortran] [55..56/66] inline sum and product: Prevent regressions: Fix gfc_conv_elemental_dependencies.

2011-10-27 Thread Mikael Morin
gfc_conv_elemental_dependency had some ad-hoc fixes to replace one array by its temporary in the scalarizer. It was using a fake gfc_loopinfo struct so that gfc_trans_create_temp_array doesn't overwrite the real one. It was using fake array references and custom delta calculation, so that scalariz

[Patch, fortran] [54/66] inline sum and product: Prevent regressions: Add dependency checking.

2011-10-27 Thread Mikael Morin
This adds dependency checking for inline functions. OK? 2011-10-19 Mikael Morin * trans.h (gfc_inline_intrinsic_function_p): Move prototype... * gfortran.h (gfc_inline_intrinsic_function_p): ... here. * dependency.c (gfc_check_argument_var_dependency): Check dependencies

[Patch, fortran] [54..61/66] inline sum and product: Prevent regressions.

2011-10-27 Thread Mikael Morin
This is a collection of changes not directly related, but made necessary by the emergence of regressions in the testsuite without them. Combined patch not attached, as the separate patches being largely independant, it is the concatenation of them. Patch 54: Enable dependency checking for inli

[Patch, fortran] [53/66] inline sum and product: Update the scalarizer: Update gfc_trans_preloop_setup.

2011-10-27 Thread Mikael Morin
This updates gfc_trans_preloop_setup to handle multiple loops. The preliminary patches 1..6 have made it quite painless: - the condition "this is the the outermost dimension" is changed from `dim == loop->dimen - 1' to `dim == loop->dimen - 1 && loop->parent == NULL' - to retrieve information

[Patch, fortran] [52/66] inline sum and product: Update the scalarizer: New outermost_loop function.

2011-10-27 Thread Mikael Morin
This uses the just added parent loop pointer to create an outermost_loop function and use it throughout the scalarizer. OK? 2011-10-19 Mikael Morin * trans-array.c (outermost_loop): New function. (gfc_trans_array_constructor, gfc_set_vector_loop_bounds, gfc_add_loop_ss_c

[Patch, fortran] [49..51/66] inline sum and product: Update the scalarizer: New parent loop.

2011-10-27 Thread Mikael Morin
This introduces a convenience pointer parent for the gfc_loopinfo struct (patch 49). Patches 50 and 51 (with context diff) use it to update gfc_trans_array_constructor and constant_array_constructor_loop_size respectively. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_loopinfo): New

[Patch, fortran] [47..48/66] inline sum and product: Update the scalarizer: New gfc_loopinfo::nested_loop field.

2011-10-27 Thread Mikael Morin
This introduces the nested_loop list of nested loops inside a gfc_loopinfo struct (patch 47). Patch 48 adds to the scalarizer functions self-recursive calls on the nested loops. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_loopinfo): New fields nested and next. * trans-arra

[Patch, fortran] [46/66] inline sum and product: Update the scalarizer: Update gfc_trans_create_temp_array.

2011-10-27 Thread Mikael Morin
This updates gfc_trans_create_temp_array with looking at parent (outer) ss. Context diff also provided. OK? 2011-10-19 Mikael Morin * trans-array.c (gfc_trans_create_temp_array): Loop over the parents. diff --git a/trans-array.c b/trans-array.c index d918fa8..1a86ae6 100644 --- a/trans-

[Patch, fortran] [45/66] inline sum and product: Update the scalarizer: Update dimension mapping inversion functions.

2011-10-27 Thread Mikael Morin
gfc_trans_create_temp_arrays has been using loop bounds to set array temporary bounds; this is a sensible thing to do as gfc_conv_loop_setup tries to set loop bounds according to the most information (especially w.r.t. constantness) it can find. For plain arrays like `a(:,:)' or `b(:,1,:)', it's

[Patch, fortran] [34/66] inline sum and product: Update the scalarizer: gfc_ss_info refcounting

2011-10-27 Thread Mikael Morin
As there will be more than one gfc_ss struct pointing to a single gfc_ss_info, it needs to be reference counted. This introduces reference counting. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss_info): New field refcount. * trans-array.c (free_ss_info): Decrement refcount

[Patch, fortran] [44/66] inline sum and product: Update the scalarizer: New gfc_ss::nested_ss field.

2011-10-27 Thread Mikael Morin
To be able, from one outer gfc_ss struct, to descend into the corresponding inner gfc_ss struct in the nested loop, this introduces a nested_ss field. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss): New field nested_ss. * trans-array.c (gfc_mark_ss_chain_used): Mark recur

[Patch, fortran] [40..43/66] inline sum and product: Update the scalarizer: New gfc_ss::parent field.

2011-10-27 Thread Mikael Morin
We are going to loop over the parent array infos. This introduces a new parent field to permit this loop (patch 40). Then it will be used to loop over multiple parent ss: - gfc_set_loop_bounds_from_array_spec (patch 41 with context diff) - gfc_trans_array_constructor (patch 42) - set_vector_loop

[Patch, fortran] [35..39/66] inline sum and product: Update the scalarizer: New gfc_ss::loop field.

2011-10-27 Thread Mikael Morin
To avoid confusion between multiple loops, a new loop field is added to the gfc_ss (patch 35). Then we can remove superfluous loop argument in function interfaces: - set_vector_loop_bounds (patch 36) - gfc_trans_array_constructor (patch 37) - gfc_trans_create_temp_array (patch 39) Patch 38 prepa

[Patch, fortran] [33/66] inline sum and product: Update the scalarizer.

2011-10-27 Thread Mikael Morin
gfc_trans_create_temp_array has code like this: for (n = 0; n < loop->dimen; n++) { if (size == NULL) { /* blah */ continue; } /* bleh */ } We are going to update this to handle more than one loop. However the two branches will get different trea

[Patch, fortran] [31..53/66] inline sum and product: Update the scalarizer.

2011-10-27 Thread Mikael Morin
This part of the serie takes care of updating the scalarizer code once its core structures have changed. There are basically two kinds of changes: - for functions working on loops mostly one needs to take care of more than one loop. This is done by attaching a list of nested loops to every g

[Patch, fortran] [32/66] inline sum and product: Update the scalarizer: clear specloop in gfc_trans_create_temp_arrays.

2011-10-27 Thread Mikael Morin
The code clearing specloop in gfc_conv_loop_setup would need some explanation. This patch moves it to gfc_trans_create_temp_array (where the reason for it are more clear) with a proper comment. OK? 2011-10-19 Mikael Morin * trans-array.c (gfc_conv_loop_setup, gfc_trans_create_temp_array

[Patch, fortran] [31/66] inline sum and product: Update the scalarizer: Split gfc_conv_loop_setup.

2011-10-27 Thread Mikael Morin
Loop-centered functions will be called recursively to handle nested loops. This is the case of gfc_conv_loop_setup. However, gfc_conv_loop_setup has a tempoary handling part in the middle which doesn't need to be called recursively. This patch moves the beginning and ending of gfc_conv_loop_setup i

[Patch, fortran] [24/66] inline sum and product: Update core structs: Move expr.

2011-10-27 Thread Mikael Morin
This moves expr field from gfc_ss to gfc_ss_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field expr from the former struct to the latter. * trans-array.c (gfc_get_array_ss, gfc_get_scalar_ss, gfc_trans_constant_arr

[Patch, fortran] [30/66] inline sum and product: Update core structs: Move where flag.

2011-10-27 Thread Mikael Morin
This moves where field from gfc_ss to gfc_ss_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::where into gfc_ss_info. * trans-array.c (gfc_add_loop_ss_code): Update reference chains. * trans-stmt.c (gfc_t

[Patch, fortran] [28/66] inline sum and product: Update core structs: Move info struct.

2011-10-27 Thread Mikael Morin
This moves data::info field from gfc_ss to gfc_ss_info. The name is changed to array, as it is for all the non-scalar and non-temp cases, thus all the array cases. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::data::info into gfc_s

[Patch, fortran] [29/66] inline sum and product: Update core structs: Move useflags flag.

2011-10-27 Thread Mikael Morin
This moves useflags field from gfc_ss to gfc_ss_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::useflags into gfc_ss_info. * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup, gfc_trans_scalarizing_

[Patch, fortran] [27/66] inline sum and product: Update core structs: Move temp struct.

2011-10-27 Thread Mikael Morin
This moves data::temp field from gfc_ss to gfc_ss_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct gfc_ss::data::temp into gfc_ss_info::data. * trans-array.c (gfc_get_temp_ss, gfc_conv_loop_setup): Update reference

[Patch, fortran] [26/66] inline sum and product: Update core structs: Move scalar struct.

2011-10-27 Thread Mikael Morin
This moves data::scalar field from gfc_ss to gfc_ss_info. The expr subfield is renamed to value, as it is not the expression really, it is a reference to a variable containing the pre-calculated value. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move membe

[Patch, fortran] [25/66] inline sum and product: Update core structs: Move string_length.

2011-10-27 Thread Mikael Morin
This moves string_length field from gfc_ss to gfc_ss_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field string_length from the former struct to the latter. * trans-array.c (gfc_get_temp_ss, gfc_trans_array_constructor, gfc

[Patch, fortran] [23/66] inline sum and product: Update core structs: Move type.

2011-10-27 Thread Mikael Morin
This moves type field from gfc_ss to a new gfc_ss_info struct. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss_info): New struct. (gfc_get_ss_info): New macro. (struct gfc_ss): Move type field to struct gfc_ss_info. Add an info field of type gfc_ss_info.

[Patch, fortran] [22/66] inline sum and product: Update core structs: Move shape.

2011-10-27 Thread Mikael Morin
This moves shape field from gfc_ss to gfc_array_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_array_info): Move shape field from the former struct to the latter. * trans-array.c (gfc_conv_ss_startstride, gfc_conv_loop_setup): Update field

[Patch, fortran] [21/66] inline sum and product: Update core structs: Move dim and dimen.

2011-10-27 Thread Mikael Morin
This moves dim and dimen fields from gfc_array_info to gfc_ss. The gfc_ss::data::temp::dimen field is also removed as it is now redundant. The only non-trivial change is the removal of the dim array initialization in gfc_conv_loop_setup (when the temp_ss's type is changed from GFC_SS_TEMP to GFC_SS

[Patch, fortran] [20/66] inline sum and product: Update core structs: Rename gfc_ss_info.

2011-10-27 Thread Mikael Morin
This renames gfc_ss_info to gfc_array_info. OK? 2011-10-19 Mikael Morin * trans.h (struct gfc_ss_info, struct gfc_array_info): Rename the former to the latter. * trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage, get_array_ref_dim, gfc_trans_creat

[Patch, fortran] [19/66] inline sum and product: Interfaces changes: dim_ok

2011-10-27 Thread Mikael Morin
Same as previous patch, dim_ok uses dimensions and needs a gfc_ss struct as argument. The name is changed to the more descriptive transposed_dims and the logic is inverted (dim_ok <=> !transposed_dims). OK? 2011-10-19 Mikael Morin * trans-array.c (dim_ok, transposed_dims): Rename the fo

[Patch, fortran] [18/66] inline sum and product: Interfaces changes: get_array_ref_dim

2011-10-27 Thread Mikael Morin
Same as previous patch, get_array_ref_dim uses dimensions and thus needs a gfc_ss struct as argument. OK? 2011-10-19 Mikael Morin * trans-array.c (get_array_ref_dim): Change argument type and name. Obtain previous argument from the new argument in the body. (gfc_trans_cr

[Patch, fortran] [17/66] inline sum and product: Interfaces changes: gfc_set_vector_loop_bounds

2011-10-27 Thread Mikael Morin
Same as previous patch, gfc_set_vector_loop_bounds uses dimensions, and thus needs a gfc_ss struct as argument. gfc_ prefix removed along the way. OK? 2011-10-19 Mikael Morin * trans-array.c (gfc_set_vector_loop_bounds, set_vector_loop_bounds): Rename the former to the latter.

[Patch, fortran] [16/66] inline sum and product: Interfaces changes: gfc_trans_create_temp_array

2011-10-27 Thread Mikael Morin
gfc_trans_create_temp_array uses dimensions heavily, and dimensions are to be moved from gfc_ss_info to gfc_ss. To have them still available in gfc_trans_create_temp_array, the gfc_ss_info argument should be a gfc_ss. OK? 2011-10-19 Mikael Morin * trans-array.h (gfc_trans_create_temp_ar

[Patch, fortran] [15/66] inline sum and product: Interfaces changes: obtain name more simply

2011-10-27 Thread Mikael Morin
This is a follow-up to the previous patch. It symplifies name obtention so that later we can change structs with less pain. :-) OK? 2011-10-19 Mikael Morin * trans-array.c (gfc_trans_array_bound_check): Use ss argument to get name. diff --git a/trans-array.c b/trans-array.c inde

[Patch, fortran] [14/66] inline sum and product: Interfaces changes: gfc_trans_array_bound_check, gfc_conv_array_index_offset

2011-10-27 Thread Mikael Morin
The next patch is going to need array expression (available through gf_ss) instead of just the array descriptor in gfc_trans_array_bound_check. This makes the gfc_ss struct available as argument. This requires an update of gfc_conv_array_index_offset too. Both functions are static, they lose their

[Patch, fortran] [13/66] inline sum and product: Interfaces changes: gfc_trans_array_constructor

2011-10-27 Thread Mikael Morin
loop.temp_dim is set by gfc_trans_create_temp_array; there should be no reason why that value wouldn't suit gfc_trans_constant_array_constructor, which has then no reason to set the value directly. This patch remove that code. Then, the loop argument is useless and can be removed too. The function

[Patch, fortran] [13..19/66] inline sum and product: Interfaces changes

2011-10-27 Thread Mikael Morin
This is another preliminary change, to update function interfaces requiring it, so that afterwards structures can be changed internally without impacting function interfaces. The main reason for these changes is that gfc_ss_info's dim and dimen fields are to be moved to struct gfc_ss. Thus function

[Patch, fortran] [12/66] inline sum and product: Preliminary cleanups: Stop loop before end marker.

2011-10-27 Thread Mikael Morin
We should not be writing to gfc_ss_terminator. It is working without this patch because gfc_ss_terminator's next pointer is NULL, so the loop stops just after it, and because we are writing zero to gfc_ss_terminator, but it is already all zeros anyway. OK? 2011-10-19 Mikael Morin * tran

[Patch, fortran] [11/66] inline sum and product: Preliminary cleanups: Skip temporary case.

2011-10-27 Thread Mikael Morin
We can't use temporaries to guess loop dimensions, as temporaries' bounds are calculated from loop dimensions. In the union: union { struct { ... } scalar; struct { ... } temp; struct gfc_ss_info info } data; We

[Patch, fortran] [07/66] inline sum and product: Preliminary cleanups: Useless coarray code removal.

2011-10-27 Thread Mikael Morin
This is a followup to my recent coarray/scalarizer changes, especially that one cleaning-up gfc_walk_variable_expr/gfc_walk_array_ref: http://gcc.gnu.org/ml/fortran/2011-09/msg00072.html Scalar coarrays are not handled as AR_ELEMENT in the scalarizer. Thus, no need to handle coarrays here. OK? 2011

[Patch, fortran] [10/66] inline sum and product: Preliminary cleanups: Use array's instead of loop's dimensions.

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_conv_ss_startstride): Access array bounds along array dimensions instead of loop dimensions. diff --git a/trans-array.c b/trans-array.c index 8359af2..f4d8a85 100644 --- a/trans-array.c +++ b/trans-array.c @@ -3347,9 +3347,11 @@ done:

[Patch, fortran] [09/66] inline sum and product: Preliminary cleanups: Assertify condition.

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Assertify one condition. diff --git a/trans-array.c b/trans-array.c index 5500ec4..8359af2 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2885,8 +2885,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int f

[Patch, fortran] [08/66] inline sum and product: Preliminary cleanups: Remove redundant condition.

2011-10-27 Thread Mikael Morin
As the first line of context shows, if the first condition is false, the second is false too. Thus, the first condition is useless. OK? 2011-10-19 Mikael Morin * trans-array.c (get_array_ref_dim): Remove redundant condition. diff --git a/trans-array.c b/trans-array.c index 83fa7b6..5500

[Patch, fortran] [03/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Factor loop index initialization. diff --git a/trans-array.c b/trans-array.c index 91359e9..e3134f5 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2863,16 +2863,15 @@ gfc_trans_preloop_setup (gfc_loopinfo * l

[Patch, fortran] [07..12/66] inline sum and product: Preliminary cleanups

2011-10-27 Thread Mikael Morin
This is a collection of independant and mostly trivial cleanups. I don't attach the combined patch as it is the concatenation of the separate patches. Patch 07: Useless coarray code removal. Patch 08: Remove redundant condition. Patch 09: Assertify condition. Patch 10: Use array dimensions instead

[Patch, fortran] [06/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Move common code... (add_array_offset): ...into that new function. diff --git a/trans-array.c b/trans-array.c index 476978e..f615e4e 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2830,6 +2830,34 @@ gfc_conv_

[Patch, fortran] [05/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
This is for consistency. As dim == dimen-1 means "we are in the outermost loop", we should check against the loop dimension, not the array dimension. An assertion is added to check that it is in fact the same. OK? 2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Use lo

[Patch, fortran] [04/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion. Special case outermost loop. diff --git a/trans-array.c b/trans-array.c index e3134f5..f5e30ae 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2867,7 +2867,10 @@ gfc_trans_preloop_s

[Patch, fortran] [02/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Move code earlier. diff --git a/trans-array.c b/trans-array.c index 4b21476..91359e9 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2876,6 +2876,17 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,

[Patch, fortran] [01..06/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
This is a 6 steps program to update gfc_trans_preloop_setup. gfc_trans_preloop_setup appeared completely rewritten. These step by step patches show that it is not the case. Combined patch attached here. OK? diff --git a/trans-array.c b/trans-array.c index 3472804e4c6344e68d15af2feee627429ca61018..f

[Patch, fortran] [01/66] inline sum and product: Prepare gfc_trans_preloop_setup

2011-10-27 Thread Mikael Morin
2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Move array reference initialisation earlier. Factor subsequent array references. diff --git a/trans-array.c b/trans-array.c index 3472804..4b21476 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2842,6 +2842,7

[PATCH] PR fortran/50573 -- Fix checking of dshift{lr} arguments

2011-10-27 Thread Steve Kargl
The attached patch tightens the checking of the arguments of the dshiftl and dshiftr argument. It also does a kind type conversion when either I or J is a BOZ to the kind type of the non-BOZ I or J. OK for trunk? 2011-10-27 Steven G. Kargl PR fortran/50573 * check.c (gfc_ch

Re: [C++ Patch / RFC] PR 50870

2011-10-27 Thread Paolo Carlini
Hi again, On 10/27/2011 08:57 AM, Paolo Carlini wrote: Ok, thanks, I'll work more on this later today. Then, if we fix that we don't error out at all, right? Because this is a reject valid, AFAIK. In that case, lookup_qualified_name shouldn't be returning error_mark_node. A little more informa

Re: [PATCH] Add capability to run several iterations of early optimizations

2011-10-27 Thread Maxim Kuvyrkov
Richard, Just as Matt posted his findings about the effect of iterating early optimizations, I've got the new patch ready. This patch is essentially a complete rewrite and addresses the comments you made. On 18/10/2011, at 9:56 PM, Richard Guenther wrote: >>> >>> If we'd want to iterate earl

[trans-mem] Fix tm_region association of blocks with the "over" label.

2011-10-27 Thread Torvald Riegel
This patch fixes the detection of transactions regions for transactions that have __transaction_cancel statements. The block that has the "over" label to which an aborted transaction jumps does not belong to this transaction, but to the enclosing region. The included testcase would fail with prior

Re: [PATCH] PR49720, infinite recursion in RTX simplification

2011-10-27 Thread Eric Botcazou
> 2011-10-27 Chung-Lin Tang > > PR rtl-optimization/49720 > * simplify-rtx.c (simplify_relational_operation_1): Detect > infinite recursion condition in "(eq/ne (plus x cst1) cst2) > simplifies to (eq/ne x (cst2 - cst1))" case. > > testsuite/ > * g++.dg/tortur

  1   2   >