[PATCH] Fix REE from using freed memory (PR bootstrap/52041)

2012-01-31 Thread Jakub Jelinek
Hi! find_removable_extensions/add_removable_extensions was storing pointers into the *insn_list vector in def_map array. Unfortunately when the vector is reallocated, this may result in all the pointers pointing into freed memory. Detected by valgrind, fixed by instead just storing the vector in

[PATCH] Fix uninitialized memory use from ipa-prop.c (PR bootstrap/52041)

2012-01-31 Thread Jakub Jelinek
Hi! Another thing discovered by valgrind on the same testcase. The problem was that ao.volatile_p field, added recently, hasn't been initialized in this spot. I think it is safer to use ao_ref_init, so that the next time some field is added the situation won't repeat. Bootstrapped/regtested on x

[patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Kai Tietz
Hi, this patch adds missing support of the X86_WIN32 calling-convention for thiscall-closures.  As thiscall-convention can be only used in C++ for class-member calls, the assumption that first argument gets passed in register is always valid.  As it is either the "this" pointer, or the structure-a

Re: [PATCH] Fix REE from using freed memory (PR bootstrap/52041)

2012-01-31 Thread Eric Botcazou
> 2012-01-31 Jakub Jelinek > > PR bootstrap/52041 > PR bootstrap/52039 > PR target/51974 > * ree.c (add_removable_extension): Change def_map argument > to unsigned *, store in def_map 1 + offset into *insn_list vector > instead of pointers into the vector. >

Re: [patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Uros Bizjak
Hello! > this patch adds missing support of the X86_WIN32 calling-convention > for thiscall-closures. ?As thiscall-convention can be only used in C++ > for class-member calls, the assumption that first argument gets passed > in register is always valid. ?As it is either the "this" pointer, or > th

Re: [PATCH] Fix PR51528

2012-01-31 Thread Richard Guenther
On Mon, 30 Jan 2012, Richard Guenther wrote: > On Fri, 27 Jan 2012, Richard Guenther wrote: > > > > > This fixes PR51528 by hiding the issue that SRA generates > > copy in/out with a type not suitable for preserving the data > > (any non-mode-precision thing). It fixes it by instead of > > emit

Re: [patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Kai Tietz
Ok, this variant keeps 16-byte alignment for thiscall-closure. ChangeLog 2012-01-31 Kai Tietz * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 also FFI_THISCALL. * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. (FFI_INIT_TRAMPOLINE_THISCALL): New tram

Re: [PATCH] Fix uninitialized memory use from ipa-prop.c (PR bootstrap/52041)

2012-01-31 Thread Richard Guenther
On Tue, 31 Jan 2012, Jakub Jelinek wrote: > Hi! > > Another thing discovered by valgrind on the same testcase. > The problem was that ao.volatile_p field, added recently, hasn't > been initialized in this spot. I think it is safer to use ao_ref_init, > so that the next time some field is added t

Re: [patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Uros Bizjak
On Tue, Jan 31, 2012 at 10:51 AM, Kai Tietz wrote: > Ok, this variant keeps 16-byte alignment for thiscall-closure. It doesn't. You have to account for the fact that caller pushed return address to the stack, so %esp was already decreased by 4 behind your back. To maintain alignment, you have to

Re: [patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Kai Tietz
2012/1/31 Uros Bizjak : > On Tue, Jan 31, 2012 at 10:51 AM, Kai Tietz wrote: >> Ok, this variant keeps 16-byte alignment for thiscall-closure. > > It doesn't. You have to account for the fact that caller pushed return > address to the stack, so %esp was already decreased by 4 behind your > back. T

Re: [patch libffi]: Add thiscall-closure support for fixing regression PR/51500

2012-01-31 Thread Kai Tietz
Revised version of thiscall-trampoline code. ChangeLog 2012-01-31 Kai Tietz * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 also FFI_THISCALL. * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.

[PATCH] Clarify inline flag documentation

2012-01-31 Thread Richard Guenther
Thus, the following tries to clarify the documentation of -fno-inline and -finline-functions. Does that help? Thanks, Richard. 2012-01-31 Richard Guenther * doc/invoke.texi (fno-inline): Clarify documentation. (finline-small-functions): Likewise. (finline-functions):

[Patch, fortran] PR52012 - [4.6/4.7 Regression] Wrong-code with realloc on assignment and RESHAPE w/ ORDER=

2012-01-31 Thread Paul Richard Thomas
2012-01-31 Paul Thomas PR fortran/52012 * trans-expr.c (fcncall_realloc_result): Correct calculation of result offset. 2012-01-31 Paul Thomas PR fortran/52012 * gfortran.dg/realloc_on_assign_10.f90: New test. Committed as revision 183757. >From 7.4

Re: [Patch, Fortran] PR 52024 - Fix ambiguity check for type-bound GENERICs

2012-01-31 Thread Paul Richard Thomas
Hi Tobias, > Build and regtested on x86-64-linux. > OK for the trunk? That looks like a neat way to solve the problem. OK for trunk. Thanks for the patch. Paul

Re: [Patch, Fortran] PR52029/52013 - small OOP fixes (pure _copy, CAF fix)

2012-01-31 Thread Paul Richard Thomas
Dear Tobias, OK for trunk on both. Thanks Paul On Mon, Jan 30, 2012 at 9:54 PM, Tobias Burnus wrote: > First, I am looking for someone to review my patch at > http://gcc.gnu.org/ml/fortran/2012-01/msg00241.html > > This patch contains two patches: > > a) Marking the polymorphic _copy function

Re: [Patch,AVR]: avr.c code clean-up

2012-01-31 Thread Denis Chertykov
2012/1/31 Georg-Johann Lay : > Denis Chertykov wrote: >>> >>>        * config/avr/avr.md: Resolve all AS1 and AS2 macros. >>>        Transform all "* quoted-c-code" to { c-code }. >>>        Remove redundant test for "optimize" in combine patterns. >>>        Move (include "avr-dimode.md") to end o

Re: [Patch, fortran] PR52012 - [4.6/4.7 Regression] Wrong-code with realloc on assignment and RESHAPE w/ ORDER=

2012-01-31 Thread Tobias Burnus
Dear Paul, thanks for fixing the offset calculation. Regarding: > If variable is an allocated allocatable variable, it is deallocated if > expr is an array of different shape or any of the corresponding length > type parameter values of variable and expr differ. If variable is or > becomes an una

libgo patch committed: Don't use PtraceRegs if not defined

2012-01-31 Thread Ian Lance Taylor
The libgo library only defines PtraceRegs on a few systems. However, it was using PtraceRegs on every GNU/Linux system. This patch fix this taking the easy way out, by moving a copy of the two small functions which use PtraceRegs into the processor-specific files which define PtraceRegs. Bootstr

Re: [PATCH][ARM] Improve 64-bit shifts (non-NEON)

2012-01-31 Thread Andrew Stubbs
On 30/01/12 15:25, Richard Earnshaw wrote: What's the impact of this on -Os? At present we fall back to the libcalls, but I can't immediately see how the new code would do that. Gut feeling is that shift by a constant is always worth inlining at -Os, but shift by a register isn't. Ah, I hadn'

New Spanish PO file for 'gcc' (version 4.7-b20120128)

2012-01-31 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Spanish team of translators. The file is available at: http://translationproject.org/latest/gcc/es.po (This file, 'gcc-4.7-b20120128.es.po',

New Spanish PO file for 'cpplib' (version 4.7-b20120128)

2012-01-31 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'cpplib' has been submitted by the Spanish team of translators. The file is available at: http://translationproject.org/latest/cpplib/es.po (This file, 'cpplib-4.7-b20120128

Contents of PO file 'cpplib-4.7-b20120128.es.po'

2012-01-31 Thread Translation Project Robot
cpplib-4.7-b20120128.es.po.gz Description: Binary data The Translation Project robot, in the name of your translation coordinator.

Re: [PATCH, rs6000] Fix PR16458, eliminate redudant compares

2012-01-31 Thread Peter Bergner
On Mon, 2012-01-30 at 10:46 +0100, Richard Guenther wrote: > On Fri, Jan 27, 2012 at 5:56 PM, Peter Bergner wrote: > > This patch fixes PR16458 by using the type expression attached to a reg > > rtx to detect its signedness and generating unsigned compares when > > appropriate. However, we contin

Re: adjust installation docs to discourage installing GMP, MPFR and MPC separately

2012-01-31 Thread Jonathan Wakely
On 30 January 2012 09:52, Richard Guenther wrote: > If we discourage from separately installing these libraries, who will do > the required in-tree-bootstrap testing before a release on the Hosts > we care for? My patch doesn't actually discourage it (although my new wiki page does, as it's meant

[Committed] S/390: Add z196 flag to srak instruction

2012-01-31 Thread Andreas Krebbel
Applied to mainline and 4.6 branch. 2012-01-31 Andreas Krebbel * config/s390/s390.md ("*ashr3_and"): Add missing z196 flag to srak instruction. Index: gcc/config/s390/s390.md === --- gcc/config/s390/s390.md (r

[committed] Fix HAVE_cc0 compilation of combine.c (PR bootstrap/52058)

2012-01-31 Thread Jakub Jelinek
Hi! SUBST_LINK is only used in code guarded with #ifdef HAVE_cc0, so this patch guards that function and macro with the same to avoid warnings. Committed to trunk as obvious. 2012-01-31 Jakub Jelinek PR bootstrap/52058 * combine.c (do_SUBST_LINK, SUBST_LINK): Guard with #ifnde

Re: [Patch, fortran] PR52012 - [4.6/4.7 Regression] Wrong-code with realloc on assignment and RESHAPE w/ ORDER=

2012-01-31 Thread Paul Richard Thomas
Dear Tobias, >  integer, allocatable :: a(:), b(:) >  allocate(b(3)) >  b = [1,2,3] > >  allocate (a(7:9)) >  a = reshape( b, shape=[size(b)]) >  print *, lbound(a), ubound(a) ! Expected: 7 9 >  end I tried briefly to generate such a case... I'll fix it. Cheers Paul

Re: [committed] Fix HAVE_cc0 compilation of combine.c (PR bootstrap/52058)

2012-01-31 Thread Ramana Radhakrishnan
On 31 January 2012 16:10, Jakub Jelinek wrote: > Hi! > > SUBST_LINK is only used in code guarded with #ifdef HAVE_cc0, so this patch > guards that function and macro with the same to avoid warnings. > Committed to trunk as obvious. Thanks for fixing this. I was out for a while this morning and wa

Re: [wwwdocs] Add section on diagnostics conventions

2012-01-31 Thread Joseph S. Myers
On Mon, 30 Jan 2012, Gabriel Dos Reis wrote: > On Mon, Jan 30, 2012 at 9:21 AM, Joseph S. Myers > wrote: > > On Sun, 29 Jan 2012, Diego Novillo wrote: > > > >> +internal_error is used for conditions that should not > >> +be triggered by any user input whether valid or invalid and including > >> +

[trans-mem, PATCH] do not dereference node if null in expand_call_tm (PR middle-end/52047)

2012-01-31 Thread Patrick Marlier
In the PR testcase, a call to __builtin_prefetch is done. When this function call comes into expand_call_tm, there is no cgraph_node associated for this builtin and thus node->local fails. trans-mem.c (expand_call_tm): ... node = cgraph_get_node (fn_decl); if (node->local.tm_m

C++ PATCH for c++/52043 (ICE with pack expansion)

2012-01-31 Thread Jason Merrill
The problem here is with tsubst_pack_expansion trying to decide whether or not to look at local_specializations. Previously we checked cp_unevaluated_context, but that was wrong because some uses in trailing-return-types have the pack expansion outside the decltype. Then we checked at_function

Contents of PO file 'cpplib-4.7-b20120128.uk.po'

2012-01-31 Thread Translation Project Robot
cpplib-4.7-b20120128.uk.po.gz Description: Binary data The Translation Project robot, in the name of your translation coordinator.

New Ukrainian PO file for 'cpplib' (version 4.7-b20120128)

2012-01-31 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'cpplib' has been submitted by the Ukrainian team of translators. The file is available at: http://translationproject.org/latest/cpplib/uk.po (This file, 'cpplib-4.7-b201201

Re: [Patch,AVR]: avr.c code clean-up

2012-01-31 Thread Denis Chertykov
2012/1/31 Georg-Johann Lay : > Denis Chertykov wrote: >>> >>>        * config/avr/avr.md: Resolve all AS1 and AS2 macros. >>>        Transform all "* quoted-c-code" to { c-code }. >>>        Remove redundant test for "optimize" in combine patterns. >>>        Move (include "avr-dimode.md") to end o

Re: [PATCH] Fix g++.dg/cpp0x/constexpr-rom.C failure

2012-01-31 Thread Mike Stump
On Jan 27, 2012, at 11:47 AM, Andreas Schwab wrote: > Ok, the option is only recognized when it is mentioned in the specs, and > neither darwin nor aix configurations have %{G*} in their CC1_SPEC, same > for osf or vms on alpha. Checked in the following as obvious. Thanks.

Re: [wwwdocs] Link from gcc-4.{6,7}/changes.html to porting_to.html

2012-01-31 Thread Gerald Pfeifer
On Fri, 13 Jan 2012, Tobias Burnus wrote: >> I believe Benjamin committed this yesterday, right? Thanks for >> raising the issue, these links are good to have. > Yes - albeit as last item of Caveats which I think makes it harder to > find. But at least there is now a link. Would you like to sugg

Re: [PATCH, go]: Do not panic in test/nilptr.go

2012-01-31 Thread Ian Lance Taylor
Uros Bizjak writes: > There is no need for a panic in test/nilptr.go if array doesn't get > allocated in first 256 meg of memory. The compiler has nothing to do > with this. This is true but this does not seem like the right patch. > Index: test/nilptr.go >

libgo patch committed: Add gettid on GNU/Linux

2012-01-31 Thread Ian Lance Taylor
This patch to libgo adds support for syscall.Gettid on GNU/Linux. The function is different becase it is not in libc, but must be invoked via Syscall. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 351201702211 libgo/go/syscall/libcall_linux.go

[PATCH] Fix for PR52009 - Another missed tail merging opportunity

2012-01-31 Thread Tom de Vries
Richard, this patch fixes PR52009. Consider this test-case: ... int z; void foo (int y) { if (y == 6) z = 5; else z = 5; } ... Currently, compiling with -O2 gives us this representation at pr51879-7.c.094t.pre: ... # BLOCK 3 freq:1991 # PRED: 2 [19.9%] (true,exec) # .MEMD.17

Re: [PATCH] Fix for PR52009 - Another missed tail merging opportunity

2012-01-31 Thread Tom de Vries
On 31/01/12 22:05, Tom de Vries wrote: > Richard, > Sorry, with patch this time. > this patch fixes PR52009. > > Consider this test-case: > ... > int z; > > void > foo (int y) > { > if (y == 6) > z = 5; > else > z = 5; > } > ... > > Currently, compiling with -O2 gives us this repr

[Patch, Fortran] PR52059 - Scalarizing fix - only add array ref to a variable

2012-01-31 Thread Tobias Burnus
Dear all, I have no idea about the scalarizer, but the attached patch fixes the test case and somehow adding an array ref to a scalar looks odd to me ... (Before the regression-causing patch, only the "else" branch existed.) Build and regtested on x86-64-linux. OK for the trunk? Tobias 2012

[Patch, Fortran] PR 52024 - fix .mod issue with type-bound operator check

2012-01-31 Thread Tobias Burnus
Dear all, my just committed patch which checks type-bound operators for ambiguity missed a handling of module files. The attached patch adds one. Unfortunately, it turns out that the check does not handle inheritance well. At least I would expect that the attached test case is valid (and it

Re: [PATCH] disable __size_t macro on GNU/kFreeBSD

2012-01-31 Thread Gerald Pfeifer
On Sun, 29 Jan 2012, Robert Millan wrote: > Please consider this patch to stddef.h. GNU/kFreeBSD has the same > problem with __size_t as FreeBSD does, since it inherits many kernel > headers from FreeBSD. The patch looks obvious to me, and I'll be happy to apply for Robert if approved. Any taker?

Re: [Patch, Fortran] PR 52024 - fix .mod issue with type-bound operator check

2012-01-31 Thread Tobias Burnus
Tobias Burnus wrote: Unfortunately, it turns out that the check does not handle inheritance well. At least I would expect that the attached test case is valid (and it compiles with NAG 5.1), but it is rejected with GCC 4.6 and 4.7. Actually, I withdraw that comment. I now believe that gt_cmp a

Re: [patch, fortran] Fix PR 51958, wrong-code regression with function elimination

2012-01-31 Thread Thomas Koenig
Hi Tobias, here is an updated version of the patch, with a more extensive test case. Also regression-tested. OK for trunk? Thomas 2012-01-31 Thomas König PR fortran/51958 * frontend-passes.c (convert_elseif): New function. (optimize_namespace): Call it.

Re: [patch, fortran] Fix PR 51958, wrong-code regression with function elimination

2012-01-31 Thread Steve Kargl
On Wed, Feb 01, 2012 at 12:07:35AM +0100, Thomas Koenig wrote: > Hi Tobias, > > here is an updated version of the patch, with a more extensive test > case. Also regression-tested. > > OK for trunk? > + /* Insert the new IF after the ELSE. */ + else_stmt->expr1 = NULL; + else_st

Re: [patch, fortran] Fix PR 51958, wrong-code regression with function elimination

2012-01-31 Thread Thomas Koenig
Hi Steve, + else_stmt->expr1 = NULL; + else_stmt->next = c_if1; + else_stmt->block = NULL; + else_stmt->next = c_if1; Is one of the else_stmt->next = c_if1; redundant? Definitely. I'll take it out when I commit the patch. Thomas

Go patch committed: Don't crash on case nil

2012-01-31 Thread Ian Lance Taylor
I discovered that gccgo crashes on a test case like: package p type S struct { f interface{} } func F(p *S) bool { v := p.f switch a := v.(type) { case nil: _ = a return true } return true } The "case nil" in the t

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

2012-01-31 Thread Jonathan Wakely
A bit later than I originally planned, but this is now committed, as attached. 2012-02-01 Jonathan Wakely PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base:

Re: [PATCH] disable __size_t macro on GNU/kFreeBSD

2012-01-31 Thread Mike Stump
On Jan 31, 2012, at 2:29 PM, Gerald Pfeifer wrote: > On Sun, 29 Jan 2012, Robert Millan wrote: >> Please consider this patch to stddef.h. GNU/kFreeBSD has the same >> problem with __size_t as FreeBSD does, since it inherits many kernel >> headers from FreeBSD. > > The patch looks obvious to me, an

Re: [patch, fortran] Fix PR 51958, wrong-code regression with function elimination

2012-01-31 Thread Steve Kargl
On Wed, Feb 01, 2012 at 12:47:28AM +0100, Thomas Koenig wrote: > Hi Steve, > > >+ else_stmt->expr1 = NULL; > >+ else_stmt->next = c_if1; > >+ else_stmt->block = NULL; > >+ else_stmt->next = c_if1; > > > >Is one of the else_stmt->next = c_if1; redundant? > > > > Definitely. I'

Merge from mainline to gccgo branch

2012-01-31 Thread Ian Lance Taylor
I've merged mainline revision 183782 to the gccgo branch. Ian

[pph] Fix streaming of structures inside shared structures (issue5607045)

2012-01-31 Thread Diego Novillo
This patch fixes a problem with streaming of symbols and types that have mutated from one PPH to another. --- parent.h - #include "child.h" struct C1 { int field1; float field2; }; -

[google] Propagate profile information to RTL level during switch expansion

2012-01-31 Thread Easwaran Raman
This patch propagates profile information to RTL level when expanding switch statements using jump table or a binary tree of branches. Ok for google/gcc-4_6 branch? I would like the patch to be considered for trunk when stage 1 opens again. -Easwaran 2012-01-31 Easwaran Raman * expr

Re: [wwwdocs] Add section on diagnostics conventions

2012-01-31 Thread Diego Novillo
On Mon, Jan 30, 2012 at 15:21, Joseph S. Myers wrote: > On Sun, 29 Jan 2012, Diego Novillo wrote: > >> +internal_error is used for conditions that should not >> +be triggered by any user input whether valid or invalid and including >> +invalid asms and LTO binary data (sometimes, as an exception,

Re: [google] Propagate profile information to RTL level during switch expansion

2012-01-31 Thread Xinliang David Li
Ok for google branch with minor changes below. thanks, David >> +static bool non_zero_profile_counts ( VEC(edge,gc) *edges) { static bool non_zero_profile_counts(...) Please also provide function documentation. >> +  edge e; >> +  edge_iterator ei; >> +  FOR_EACH_EDGE(e, ei, edges) >> +    {