Re: [ARM] Rewrite ldrex/strex support for atomic optabs

2011-11-24 Thread Richard Earnshaw
On 23/11/11 23:43, Richard Henderson wrote: > This transformation is quite a bit more dramatic than the other ports > because ARM was not splitting the code sequences post-reload. > Indeed, the failure to split resulted in a distinctly odd coding > style where fake output routines were used to comp

Re: [cxx-mem-model 2/2] arm: Install __sync libfuncs for Linux.

2011-11-24 Thread Richard Earnshaw
On 23/11/11 23:37, Richard Henderson wrote: > Ping 2. > > r~ > > On 11/03/2011 04:24 PM, Richard Henderson wrote: >> Cc: Richard Earnshaw >> --- >> gcc/config/arm/arm.c |4 >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.

Re: [RFA/ARM][Patch]: Fix NEG_POOL_RANGE

2011-11-24 Thread Sameera Deshpande
On Fri, 2011-11-18 at 23:12 +, Ramana Radhakrishnan wrote: > On 17 November 2011 15:16, Sameera Deshpande > wrote: > > Hi! > > > > Please find attached the patch updating NEG_POOL_RANGE from 1008 to > > 1020 -(8 + ). > > This is OK - can you add a comment around the neg_pool_range attribute

[Patch, Fortran] PR 51218 (4.6/4.7 Regr.) Unset implicit_pure when calling impure subroutine

2011-11-24 Thread Tobias Burnus
This patch fixes a 4.6/4.7 wrong-code regression where an call to a subroutine which is neither pure nor implicit_pure didn't mark the calling procedure as impure. Additionally, I changed for functions: if (!pure_function (expr, &name) && name) ... if (!pure_function (expr, &name) && na

Re: [libitm] Port to ARM

2011-11-24 Thread Richard Earnshaw
On 24/11/11 02:23, Richard Henderson wrote: > On 11/23/2011 04:00 PM, Joseph S. Myers wrote: >> On Wed, 23 Nov 2011, Richard Henderson wrote: >> >>> + __asm volatile ("swi %1" >>> + : "+r"(sc_0) >>> + : "i"(SYS_futex), "r"(sc_1), "r"(sc_2), "r"(sc_3) >>> + : "me

Re: [C++ Patch] PR 51290

2011-11-24 Thread Paolo Carlini
On 11/24/2011 03:58 AM, Jason Merrill wrote: On 11/23/2011 08:09 PM, Paolo Carlini wrote: if (null_test) { - tree zero = cp_convert (TREE_TYPE (expr), integer_zero_node); + tree zero = cp_convert (TREE_TYPE (expr), + want_pointer ? nullptr_node : integer_zero_n

Re: [libitm] Port to ARM

2011-11-24 Thread Richard Earnshaw
On 23/11/11 23:47, Richard Henderson wrote: > To get the ball rolling for other targets, and to let port maintainers see > how easy it really is, here's a first cut at a port to ARM. > > Only cross-compiled as yet, and qemu-linux-user isn't good enough to emulate. > I'll do another build on the

[Patch] Fix Bug 51162

2011-11-24 Thread Sameera Deshpande
Hi, Please find attached the patch fixing bugzilla issue http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51162. ARM architecture implements vec_[load|store]_lanes which are implemented as internal function calls. The function gimple_call_fn () returns NULL for internal calls. Hence, this patch guards

Re: [ARM] Rewrite ldrex/strex support for atomic optabs

2011-11-24 Thread Marcus Shawcroft
On 23/11/11 23:43, Richard Henderson wrote: +/* Split a compare and swap pattern. It is IMPLEMENTATION DEFINED whether + another memory store between the load-exclusive and store-exclusive can + reset the monitor from Exclusive to Open state. This means we must wait + until after reload t

Re: [RFA/ARM][Patch]: Fix NEG_POOL_RANGE

2011-11-24 Thread Ramana Radhakrishnan
> Thanks for your comment. > Please find attached the updated patch. > Ok - please apply . Ramana > --

[PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error)

2011-11-24 Thread Ilya Enkovich
Hello, Here is a short patch to fix PR target/51287. Patch avoids get_attr_type call for instructions which cannot be recognized. Bootstrapped and checked on linux-x86_64. 252.eon also works fine with this fix on Atom. Could please someone review it? Thanks, Ilya --- 2011-11-24 Enkovich Ilya

Re: [build] Cleanup rs6000/t-ppccomm configurations (PR other/51022)

2011-11-24 Thread Rainer Orth
Joel, > Works for me. I posted test results for powerpc-rtems4.11 > at http://gcc.gnu.org/ml/gcc-testresults/2011-11/msg02314.html > > From the rtems perspective, you can commit it. thanks for the confirmation. It would be great if one of the powerpc maintainers could review it. Thanks.

[C++ Patch] PR 51227

2011-11-24 Thread Paolo Carlini
Hi, this is an ICE on invalid: toward the end of instantiate_class_template_1 we call lambda_function without checking its return value for NULL_TREE (it can well be so) and we pass it directly to instantiate_decl which doesn't know how to cope with that. But everything is wrong in that case,

Re: [PATCH, take 2] Fix PR tree-optimization/49960 ,Fix self data dependence

2011-11-24 Thread Razya Ladelsky
Jakub Jelinek wrote on 21/11/2011 07:25:10 PM: > From: Jakub Jelinek > To: Razya Ladelsky/Haifa/IBM@IBMIL > Cc: GCC Patches , Richard Guenther > > Date: 21/11/2011 07:25 PM > Subject: Re: [PATCH, take 2] Fix PR tree-optimization/49960 ,Fix > self data dependence > > On Mon, Nov 21, 2011 at 0

Re: [PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error)

2011-11-24 Thread Uros Bizjak
Hello! > Here is a short patch to fix PR target/51287. Patch avoids > get_attr_type call for instructions which cannot be recognized. > > 2011-11-24 Enkovich Ilya > > PR target/51287 > * i386.c (distance_non_agu_define_in_bb): Fix insn attr check. This is OK for mainline and releas

Re: [PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error)

2011-11-24 Thread Ilya Enkovich
2011/11/24 Uros Bizjak : > Hello! > >> Here is a short patch to fix PR target/51287. Patch avoids >> get_attr_type call for instructions which cannot be recognized. >> >> 2011-11-24  Enkovich Ilya   >> >>       PR target/51287 >>       * i386.c (distance_non_agu_define_in_bb): Fix insn attr check.

[PATCH] Fix predcom ICE introduced by var clobber changes (PR tree-optimization/51246)

2011-11-24 Thread Jakub Jelinek
Hi! When stmt is mem = {v} {CLOBBER};, then lhs is neither SSA_NAME, but it doesn't satisfy gimple_assign_copy_p either. With this patch it will set the new_tree also to the clobber, making it clear that the next iteration uses unitialized variable. Bootstrapped/regtested on x86_64-linux and i686

[PATCH] Fix extract_range_from_assert for signed 1-bit precision types (PR tree-optimization/51247)

2011-11-24 Thread Jakub Jelinek
Hi! Since Richard's build_int_cst changes to make it effectively build_int_cst_type when extract_range_from_assert wants to subtract or add 1 to min or max of a signed 1-bit precision type, build_int_cst (..., 1) returns actually -1 constant and that overflows on the fold_build2, leading to ICEs l

[committed] Add testcase for PR rtl-optimization/50290

2011-11-24 Thread Jakub Jelinek
Hi! This PR has been fixed by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180058 This patch just adds the testcase from the PR, so it can be closed. Tested on x86_64-linux and i686-linux, committed to trunk as obvious. 2011-11-24 Jakub Jelinek PR rtl-optimization/50290 *

Backport fix for PR 48190 (excess memory in dwarf2 location tracking)

2011-11-24 Thread Richard Sandiford
Is it OK to backport the fix for PR48190: http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00255.html to 4.5 and 4.6? It fixes a case of excessive memory usage in dwarf2 location tracking, to the extent that the testcase blows VM on most 32-bit hosts. For the record, Richard OKed it here: ht

Re: Backport fix for PR 48190 (excess memory in dwarf2 location tracking)

2011-11-24 Thread Jakub Jelinek
On Thu, Nov 24, 2011 at 03:48:06PM +, Richard Sandiford wrote: > from Jakub's 2010-10-12 commit. OK for both? Yes. Jakub

Re: [Patch, Fortran] PR 51218 (4.6/4.7 Regr.) Unset implicit_pure when calling impure subroutine

2011-11-24 Thread Steve Kargl
On Thu, Nov 24, 2011 at 11:13:53AM +0100, Tobias Burnus wrote: > > Build and regtested on x86-64-linux. > OK for the trunk and 4.6? > OK -- Steve

Re: [PATCH] Fix predcom ICE introduced by var clobber changes (PR tree-optimization/51246)

2011-11-24 Thread Michael Matz
Hi, On Thu, 24 Nov 2011, Jakub Jelinek wrote: > When stmt is mem = {v} {CLOBBER};, then lhs is neither > SSA_NAME, but it doesn't satisfy gimple_assign_copy_p either. > With this patch it will set the new_tree also to the clobber, > making it clear that the next iteration uses unitialized variabl

Re: [C++ Patch] PR 51227

2011-11-24 Thread Jason Merrill
On 11/24/2011 07:22 AM, Paolo Carlini wrote: Ok for mainline, or we want to do something more sophisticated, maybe earlier? OK, but in the case that decl is null, let's gcc_assert (errorcount); that should never happen for well-formed code. Jason

[PATCH] Fix predcom ICE introduced by var clobber changes (PR tree-optimization/51246, take 2)

2011-11-24 Thread Jakub Jelinek
On Thu, Nov 24, 2011 at 05:28:00PM +0100, Michael Matz wrote: > As the default defs are already automatically handled by all our ssa > infrastructure (including warning and propagation machinery) I think it > would be best to generate such one instead of a clobber for the RHS. So like this? 201

Re: [PATCH] Fix predcom ICE introduced by var clobber changes (PR tree-optimization/51246, take 2)

2011-11-24 Thread Michael Matz
Hi, On Thu, 24 Nov 2011, Jakub Jelinek wrote: > On Thu, Nov 24, 2011 at 05:28:00PM +0100, Michael Matz wrote: > > As the default defs are already automatically handled by all our ssa > > infrastructure (including warning and propagation machinery) I think it > > would be best to generate such o

Re: Fix permissions in update_web_docs_svn

2011-11-24 Thread Gerald Pfeifer
On Sun, 13 Nov 2011, Joseph S. Myers wrote: >> Unless there are any objections, I am planning on checking this >> in. (The script is generally run as gccadmin with group gcc.) >> Affirmative notes welcome as well. :-) > Seems fine to me. Thanks, Joseph. I have now applied this to trunk and the g

Re: [libitm] Port to ARM

2011-11-24 Thread Richard Henderson
On 11/24/2011 02:34 AM, Richard Earnshaw wrote: >> + unsigned long s[8]; /* r4-r12 */ > > R4-R12 is 9 registers. But R12 is callee clobbered. So is the code or > the comment incorrect? The comment is clearly a typo. >> +/* ARM generally uses a fixed page size of 4K. */ >> +#define PAGE

Re: [cxx-mem-model 2/2] arm: Install __sync libfuncs for Linux.

2011-11-24 Thread Richard Henderson
On 11/24/2011 02:06 AM, Richard Earnshaw wrote: >>> >> + /* For Linux, we have access to kernel support for atomic operations. >>> >> */ >>> >> + if (arm_abi == ARM_ABI_AAPCS_LINUX) >>> >> +init_sync_libfuncs (8); >>> >> + >>> >>/* There are no special library functions unless we are us

Re: [ARM] Rewrite ldrex/strex support for atomic optabs

2011-11-24 Thread Richard Henderson
On 11/24/2011 01:55 AM, Richard Earnshaw wrote: > That was deliberate. The ARM ARM says that it is unsafe to have any > other load or store instruction between an LDREX and its matching STREX. > If we split these instructions before the final scheduling operation > then there is a chance of that

Re: Memset/memcpy patch

2011-11-24 Thread H.J. Lu
On Wed, Nov 23, 2011 at 3:32 PM, Michael Zolotukhin wrote: > I found and fixed another problem in the latest memcpy/memest changes > - with this fix all the failing tests mentioned in #51134 started > passing. Bootstraps are also ok. > Though I still see fails in 32-bit make check, so probably, it

Re: [PATCH] __atomic error reporting

2011-11-24 Thread Andrew MacLeod
On 11/22/2011 04:20 PM, Joseph S. Myers wrote: * If TYPE_SIZE_UNIT if the pointer target type is zero. This could be the case for empty structures or zero-size arrays (both GNU extensions). Logically there's nothing wrong with atomic operations on such a zero-size object (they should evaluate al

Re: [ARM] Rewrite ldrex/strex support for atomic optabs

2011-11-24 Thread Richard Henderson
On 11/24/2011 02:51 AM, Marcus Shawcroft wrote: > Would the addition of blockages around each load exclusive and store > exclusive be sufficient to guarantee no load or store was scheduled > between the exclusives? The ldrex/strex insns themselves are written as barriers, and yes, that is sufficie

Re: [Patch Darwin] fix thinko in TM crts

2011-11-24 Thread Mike Stump
On Nov 23, 2011, at 2:02 AM, Iain Sandoe wrote: > the solution is to require the library to be present (no problem, since the > crts are only fired up for -fgnu-tm) and to remove the dummy funcs from the > crts, > OK for trunk? Ok.

Re: [PATCH] __atomic error reporting

2011-11-24 Thread Joseph S. Myers
On Thu, 24 Nov 2011, Andrew MacLeod wrote: > On 11/22/2011 04:20 PM, Joseph S. Myers wrote: > > * If TYPE_SIZE_UNIT if the pointer target type is zero. This could be the > > case for empty structures or zero-size arrays (both GNU extensions). > > Logically there's nothing wrong with atomic operat

[PATCH] atomic test and set re-org.

2011-11-24 Thread Andrew MacLeod
This patch adds missing pattern support for atomic_test_and_set and atomic_clear operations. It also restructures the code for atomic_test_and_set, atomic_exchange, and __sync_lock_test_and_set so that it is easier to read and tries things in a rational manner. bootstrapped on x86_64-unkno

[Patch,AVR] ad PR50566: Print double_int

2011-11-24 Thread Georg-Johann Lay
This is a small extension to -mlog * Print double_int with %D or %X * Print supported sub-options with ? * Fix thinko in avr_log_set_avr_log that ignored -mdeb. Ok for trunk? Johann PR target/50566 * config/avr/avr-protos.h (avr_log_t): Add field .builtin. * config/avr/a

[AVR,Committed] Fix typo in instruction length for *rotlhi2.15

2011-11-24 Thread Georg-Johann Lay
Committed as obvious: http://gcc.gnu.org/viewcvs?view=revision&revision=181700 Johann -- Index: ChangeLog === --- ChangeLog (revision 181699) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2011-11-24 Georg-Johann Lay + +

Re: [PATCH] atomic test and set re-org.

2011-11-24 Thread Richard Henderson
On 11/24/2011 12:50 PM, Andrew MacLeod wrote: > * optab.c (maybe_emit_atomic_exchange): New. Try to emit an > atomic_exchange pattern. > (maybe_emit_sync_lock_test_and_set): New. Try to emit an exchange > using __sync_lock_test_and_set. > (maybe_emit_compare_and_swap

Re: [libitm] Port to ARM

2011-11-24 Thread Kaz Kojima
Richard Henderson wrote: > To get the ball rolling for other targets, and to let port maintainers see > how easy it really is, here's a first cut at a port to ARM. I've tried to port libitm to SH based on the ARM patch. The attached patch is tested on sh4-unknown-linux-gnu: ===

[Patch, fortran] PR fortran/51250 bug with sum(,dim,mask)

2011-11-24 Thread Mikael Morin
Hello, this patch fixes a regression introduced by my recent inline sum change(s). This change: http://gcc.gnu.org/viewcvs?view=revision&revision=180895 inserts a loop in gfc_trans_create_temp_array from: if (size == NULL_TREE) for (n = 0; n < ss->loop->dimen; n++) to: if (size == N

[Patch, fortran] coarray cleanup leftover

2011-11-24 Thread Mikael Morin
Hello, This change http://gcc.gnu.org/viewcvs?view=revision&revision=179689 removed references to gfc_loopinfo's codimen field and one conditional checking against gfc_loopinfo::dimen (as we had the convention that dimensions above dimen were codimensions). I have noticed two more of those condi

Re: [libitm] Port to ARM

2011-11-24 Thread Richard Henderson
On 11/24/2011 02:34 AM, Richard Earnshaw wrote: > What about systems with floating-point or vector registers? Ie VFP or > WMMX on XScale? Do the callee saved registers in those register banks > also have to be saved? Yes. I mis-read both the glibc and gcc sources on the matter, assuming that on

Re: [Patch, fortran] PR fortran/51250 bug with sum(,dim,mask)

2011-11-24 Thread Steve Kargl
On Thu, Nov 24, 2011 at 11:51:31PM +0100, Mikael Morin wrote: > this patch fixes a regression introduced by my recent inline sum change(s). > > This change: > http://gcc.gnu.org/viewcvs?view=revision&revision=180895 > inserts a loop in gfc_trans_create_temp_array from: > >if (size == NULL_TRE

Fix libgomp semaphores

2011-11-24 Thread Alan Modra
This fixes PR51249, a failure caused by insufficient care in waking threads on sem_post. It's quite a tricky business to get right, but I believe this rewrite is now correct. I've also converted over lock.c, mutex.h and mutex.c to use the new atomic builtins. This means no target should need tar

Re: [libitm] Port to ARM

2011-11-24 Thread Joseph S. Myers
On Thu, 24 Nov 2011, Richard Henderson wrote: > On 11/24/2011 02:34 AM, Richard Earnshaw wrote: > > What about systems with floating-point or vector registers? Ie VFP or > > WMMX on XScale? Do the callee saved registers in those register banks > > also have to be saved? > > Yes. > > I mis-read

[C++ Patch] PR 51299

2011-11-24 Thread Paolo Carlini
Hi, more spurious -Wzero-as-null.. warnings, this one is about dynamic_casts, which I completely overlooked. In order to fix the original testcase, which involves pointers, it's enough to use nullptr_node in ifnnonnull; in order to fix a version I added for references, we have to use here too

Re: [Patch,AVR] ad PR50566: Print double_int

2011-11-24 Thread Denis Chertykov
2011/11/25 Georg-Johann Lay : > This is a small extension to -mlog > > * Print double_int with %D or %X > * Print supported sub-options with ? > * Fix thinko in avr_log_set_avr_log that ignored -mdeb. > > Ok for trunk? > > Johann > >        PR target/50566 >        * config/avr/avr-protos.h (avr_lo

Re: [Patch, fortran] coarray cleanup leftover

2011-11-24 Thread Tobias Burnus
Mikael Morin wrote: This is not a bug nor a regression, so this should normally wait for the next stage1. It is obvious on the other hand, and safe, as the 'n< loop->dimen' conditions are inside a 'for (n = 0; n< loop->dimen; n++)' loop. Regression tested on x86_64-unknown-linux-gnu (with the

Re: Fix libgomp semaphores

2011-11-24 Thread Jakub Jelinek
On Fri, Nov 25, 2011 at 10:33:28AM +1030, Alan Modra wrote: > This fixes PR51249, a failure caused by insufficient care in waking > threads on sem_post. It's quite a tricky business to get right, but I > believe this rewrite is now correct. I've also converted over lock.c, > mutex.h and mutex.c t