[Ada] With_clauses for child units that act as specs

2011-09-02 Thread Arnaud Charlet
A child unit given by a subprogram body without a declaration is given a declaration when it is compiled, to simplify code generation and tools. If the child unit appears in several with-clauses for the same unit (for example through with_clauses in various subunits) all with_clauses must refer to

[Ada] Do not call Callback function when switch is dealt with automatically

2011-09-02 Thread Arnaud Charlet
This patch modifies the behavior of Getopt in GNAT.Command_Line to not call the Callback function in argument on switches that have been dealt with automatically. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Johannes Kanig * g-comlin.adb (Getopt): Return when switch is

[Ada] Improve xref speed for many tagged types

2011-09-02 Thread Arnaud Charlet
This patch improves compilation speed (in particular, speed of generating cross reference information) when compiling packages with huge numbers of tagged types and interfaces, with complicated inheritance patterns. No test is available -- the problem only occurred for enormous packages. Tested o

[Ada] Optional argument Concatenate for Getopt in GNAT.Command_Line

2011-09-02 Thread Arnaud Charlet
The high-level procedure Getopt did not expose a feature of its lowlevel counterpart, namely the Concatenate option which modifies the behavior of the command line parser. This patch adds this option to the high-level interface. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Johann

[Ada] Improper node sharing in the expansion of T'range.

2011-09-02 Thread Arnaud Charlet
when rewriting X'range (N) into X'First (N) .. X'Last (N), the dimension indicator N must not be shared, if present in the original range. Even though it is a static constant, its source location may be modified when printing expanded code under -gnatDL, and node sharing leads to a double modifica

[Ada] Constraint_Error raised for slice indexed by logical negation with -gnato

2011-09-02 Thread Arnaud Charlet
When overflow checking is enabled, the front end generates range checks on the indexing of a slice with a bound of the form Boolean'Pos (not X) that get mistranslated by gigi when optimization is enabled. The checks should not have been generated in the first place (one is a tautological full range

[Ada] Null access exception for nested build-in-place calls in allocator

2011-09-02 Thread Arnaud Charlet
In the case a class-wide limited (build-in-place) function that returns a call to another build-in-place function with a controlled result, the compiler passes null as the value for the implicit finalization master parameter rather than passing along its own finalization master formal. This fails a

[Ada] Implement No_Implicit_Aliasing restriction

2011-09-02 Thread Arnaud Charlet
This restriction, which is not required to be partition-wide consistent, requires an explicit aliased keyword for an object to which 'Access, 'Unchecked_Access, or 'Address is applied, and forbids entirely the use of the 'Unrestricted_Access attribute for objects. The following test program tests

[Ada] Possibly bit aligned objects in assignments

2011-09-02 Thread Arnaud Charlet
If either the target or the expression in an array or record ssignment may be bit-aligned, the assignment must be expanded into component assignments. The object (or subcomponent) may be given by an unchecked conversion, in which case we must examine its expression to determine potential mis-alignm

[Ada] Avoid reporting redundant message on inherited subprogram

2011-09-02 Thread Arnaud Charlet
This patch avoids reporting a redundant error on primitives inherited from primitives. package Test_Pkg is type I1 is Interface; procedure P (A : I1) is abstract; type I2 is interface; procedure Q (B : I2) is abstract; type DT2 is new I1 and I2 with null record;

Re: Fix PR50260

2011-09-02 Thread Richard Guenther
On Thu, Sep 1, 2011 at 2:41 PM, Michael Matz wrote: > Hi, > > the last change in ipa-split generated a new use of a previously unused > PARM_DECL.  When one does this one has to call add_referenced_var.  Not > doing so can cause segfault when accessing the (not initialized) var > annotation.  So,

Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1

2011-09-02 Thread Eric Botcazou
> Well, the comment for that folding is totally odd - of _course_ > unsigned sizetype things can overflow (we hid that issue merely > by pretending all unsigned sizetype constants (yes, only constants) > are signed. Huh.) It's again the special semantics of sizetypes whereby we pretend that they

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Richard Guenther
On Thu, Sep 1, 2011 at 4:16 PM, Aldy Hernandez wrote: > >> My point is, the middle-end infrastructure makes it possible for this >> case to appear, and it seems to be easy to handle conservatively. >> There isn't a need to wait for users to run into an ICE or an assert we >> put >> there IMHO.  If

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Richard Guenther
On Thu, Sep 1, 2011 at 5:19 PM, Jason Merrill wrote: > On 09/01/2011 11:10 AM, Aldy Hernandez wrote: >>> >>> Basically you can only touch the size of the CLASSTYPE_AS_BASE variant. >>> For many classes this will be the same as the size of the class itself. >> >> All this code is in the middle end,

Re: [PATCH] Make devirtualization use BINFO_VTABLE instead of BINFO_VIRTUALS

2011-09-02 Thread Richard Guenther
On Thu, Sep 1, 2011 at 8:52 PM, Jan Hubicka wrote: >> - Nevertheless, this method of devirtualization cannot automatically >>   de-thunkize this-adjusting thunks and newly direct calls to them >>   cannot be inlined because the inliner does not have this capability >>   now.  This is in fact a reg

Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Eric Botcazou wrote: > > Well, the comment for that folding is totally odd - of _course_ > > unsigned sizetype things can overflow (we hid that issue merely > > by pretending all unsigned sizetype constants (yes, only constants) > > are signed. Huh.) > > It's again the specia

[Ada] Remove IN parameters from Alfa section in ALI

2011-09-02 Thread Arnaud Charlet
References to IN parameters are not considered in Alfa section, as these will be translated as constants in the intermediate language for formal verification. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Yannick Moy * lib-xref-alfa.adb (Is_Alfa_Reference): Ignore IN pa

[Ada] New warning for suspicious contracts

2011-09-02 Thread Arnaud Charlet
A contract, either in GNAT syntax (pragma precondition and postcondition) or Ada 2012 aspect syntax, is suspicious when: for a function, it does not mention the result; for a function or procedure, it only refers to the pre-state. GNAT now detects these cases on the following code: $ gcc -c -gnatc

[Ada] Program_Unit pragmas in generic units are inherited by instances

2011-09-02 Thread Arnaud Charlet
Pragmas on generic units, if they are not library unit pragmas, are inherited by each instantiation of the generic. Pragma Convention was omitted from this processing. The following must execute quietly: gnatmake -q address_test.adb address_test --- with Ada.Text_Io; use Ada.Text_IO; with

[Ada] Perform required checks on discriminants read from streams using 'Input

2011-09-02 Thread Arnaud Charlet
Ada 2012 AI05-0192 is a binding interpretation that makes it clear that when reading a discriminated value using the Input stream attribute, discriminants values read from the stream must match any constraint imposed by the subtype given as the attribute's prefix. These checks are now done by check

[Ada] --version and --help in usage of GNAT tools

2011-09-02 Thread Arnaud Charlet
The usage of GNAT tools has been enhanced to include lines for options --version and --help. The test for this is to invoke a GNAT tool with --help and to check that there are lines for --version and --help in the output. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Vincent Celie

Re: [PATCH] Change vcond to vcond

2011-09-02 Thread Richard Guenther
On Tue, 30 Aug 2011, Richard Guenther wrote: > On Tue, 30 Aug 2011, Richard Guenther wrote: > > > On Tue, 30 Aug 2011, Uros Bizjak wrote: > > > > > On Tue, Aug 30, 2011 at 11:15 AM, Richard Guenther > > > wrote: > > > > > > >> >> > Hmm.  But then I'd have to try emit an insn, right?  Currentl

[Ada] Restrict SAL library names to Ada identifiers

2011-09-02 Thread Arnaud Charlet
The Project Manager is now checking that the names of Stand-Alone libraries have the syntax of Ada identifiers, so that the binder generated files that contains unit and subprogram names derived from the library name will compile. If this check fails, an error is reported and the tool terminates it

New Japanese PO file for 'gcc' (version 4.6.1)

2011-09-02 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 Japanese team of translators. The file is available at: http://translationproject.org/latest/gcc/ja.po (This file, 'gcc-4.6.1.ja.po', has jus

[Ada] Wrong subunit source used in extending project

2011-09-02 Thread Arnaud Charlet
When a subunit source file in a project being extended is replaced with one in the extending project with a different source file name, the subunit source in the project being extended is still used. This patch fixes this. The test is to use a subunit source pkg-execute.adb in a project being exten

[Ada] Class-wide pre/postconditions

2011-09-02 Thread Arnaud Charlet
Class-wide pre- and postconditions of a primitive operation of some type T apply to the overriding operation of any descendant of T. Therefore, any mention of of a formal of type T in the expression for the condition must be interpreted as a being of type T'class. A similar rule applies to access

[Ada] Wrong initialization of limited class-wide interface objects

2011-09-02 Thread Arnaud Charlet
The code generated by the compiler to handle the initialization of limited class-wide interface objects initialized by means of an aggregate erroneously generates a copy of the object (which causes a runtime exception in the application). After this patch the following test compiles and executes we

[Ada] Improve the function that computes a unique name for Entities

2011-09-02 Thread Arnaud Charlet
The function Unique_Name did not actually compute a unique name for enumeration literals, because the type to which the literal belongs was not taken into account. This patch fixes the issue. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Johannes Kanig * sem_util.adb (U

[Ada] Adjust on limited controlled types

2011-09-02 Thread Arnaud Charlet
a GNAT artifact: Limited_Controlled is declared as an extension of Root_ Controlled, and thus has a useless Adjust operation. This operation should not be inherited by other limited controlled types. An explicit Adjust for them is not overriding. gcc -c -gnat05 lib2.ads must yield lib2.ad

[Ada] VMS: fix incompatibility of sendmsg/recvmsg

2011-09-02 Thread Arnaud Charlet
The msghdr structure has changed between vms 7 and 8. This patch works arounds the incompatibility. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Tristan Gingold * g-socthi-vms.adb (c_sendmsg, c_recvmsg): Use unpacked msg if on vms 7 Index: g-socthi-vms.adb ===

[Ada] Actuals that are function calls returning unconstrained limited types

2011-09-02 Thread Arnaud Charlet
This patch fixes an omission in the code that resolves actuals in a call. Previous to this patch, and actual in a call that is an overloaded function call, one of whose interpretations returns an unconstrained limited type may be resolved incorrectly. The command gnatmake -q -gnat05 main

[Ada] Change value of the variable Name_Of_Heap_Variable

2011-09-02 Thread Arnaud Charlet
This variable is used in Hi-Lite to group effects that cannot be described more precisely. The new version 3 of Why, the backend of Hi-Lite, does not accept variables to start with uppercase letters, so we choose a value which works with both versions. Tested on x86_64-pc-linux-gnu, committed on t

[Ada] Suppress false alarm "postcondition refers only to pre-state"

2011-09-02 Thread Arnaud Charlet
This patch suppresses these false, which can occur when a postcondition contains a quantified expression. The following test should compile quietly. gnatmake -f -gnat2012 -gnatwa t.adb package T is procedure P (S : in out String) with Post => (for all C of S => C = C); end T; package body T

[Ada] Improved messages for use of incomplete type in selected components

2011-09-02 Thread Arnaud Charlet
This patch adds information to illegal uss of incomplete types. If the prefix of a selected component is an incomplete type, and the completion is found later in the same unit, an additional error indicates the position of the full declaration. gcc -c -gnat05 obj.adb must yield: obj.adb:6:

[Ada] Improved message for the restriction use of unconstrained type in SPARK

2011-09-02 Thread Arnaud Charlet
When the SPARK restriction mode was set, check that a declaration of unconstrained type is allowed only for constants of type string. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-02 Marc Sango * sem_ch3.adb (Analyze_Object_Declaration): Change comment and add add

Re: ARM: Emit conditions in push_multi

2011-09-02 Thread Ramana Radhakrishnan
On 1 September 2011 12:50, Bernd Schmidt wrote: > Shrink-wrapping tests on ARM had one additional failure, which I could > track down to a stmfd instruction being emitted where an stmhifd was > intended. The following patch fixes the testcase; full tests running > now. Ok? IIUC this should have b

[v3] Fix libstdc++/50268

2011-09-02 Thread Paolo Carlini
Hi, tested x86_64-linux multilib, will go in 4_6-branch too. See audit trail for details: in short when std::bitset has been updated for constexpr, thus the constructor from unsigned long long marked as such, the call to _M_do_sanitize in the body was inadvertently completely removed without

[PATCH, Atom] Improve AGU stalls avoidance optimization

2011-09-02 Thread Ilya Enkovich
Hello, Here is a patch which adds few more splits for AGU stalls avoidance on Atom. It also fixes cost model and detects AGU stalls more efficiently. Bootstrapped and checked on x86_64-linux. Thanks, Ilya --- gcc/ 2011-09-02 Enkovich Ilya * config/i386/i386-protos.h (ix86_lea_outper

Re: [PATCH 11/12] i386: Always use TARGET_DEEP_BRANCH_PREDICTION.

2011-09-02 Thread Jan Hubicka
> While it could be possible to output_set_got such that we can > individually annotate the instructions, it's simpler to simply > admit that all processors currently being manufactured do want > deep branch prediction. At which point all of the complication > simply goes away. Note that most of

Re: ARM: Emit conditions in push_multi

2011-09-02 Thread Bernd Schmidt
On 09/02/11 12:35, Ramana Radhakrishnan wrote: > On 1 September 2011 12:50, Bernd Schmidt wrote: >> Shrink-wrapping tests on ARM had one additional failure, which I could >> track down to a stmfd instruction being emitted where an stmhifd was >> intended. The following patch fixes the testcase; fu

[PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Richard Guenther
This fixes the Ada bootstrap failure introduced by alloca folding. We now fold alloca (0) to &auto-with-size-zero which confuses us. I didn't exactly investigate but what I think happens is that we expand that &auto-with-size-zero to NULL instead of virtual_stack_dynamic_rtx (see zero-size special

Re: [PATCH] Change vcond to vcond

2011-09-02 Thread Uros Bizjak
On Fri, Sep 2, 2011 at 11:43 AM, Richard Guenther wrote: >> > > >> >> > Hmm.  But then I'd have to try emit an insn, right?  Currently >> > > >> >> > the vectorizer simply looks for an optab handler ... the >> > > >> >> > operands are not readily available (but their mode is known). >> > > >> >>

[PATCH] Enable IPA-CP on functions with variable number of arguments or type attributes

2011-09-02 Thread Martin Jambor
Hi, currently IPA-CP switches itself off on functions with are called with variable number of arguments or on those whose signature cannot be changed because of type attributes. This patch turns it on for both, not changing the parameters of its clones in the latter case. Whether the function's

Re: [PATCH, PR 49886] Prevent fnsplit from changing signature when there are type attributes

2011-09-02 Thread Martin Jambor
Hi, On Wed, Aug 31, 2011 at 09:33:03AM +0200, Richard Guenther wrote: > On Tue, Aug 30, 2011 at 6:50 PM, Martin Jambor wrote: > > Ping.  Re-bootstrapped and re-tested yesterday on x86_64-linux. > > Ok. Does this also apply (maybe in modifed form) to the 4.6 branch? > Below is a modified patch

[PATCH][Ada][C][C++] sizetypes no longer sign-extend

2011-09-02 Thread Richard Guenther
This patch makes us no longer treat unsigned sizetypes as sign-extending which has caused trouble in the past (see the tree-ssa-ccp.c workarounds removed below). Most frontend specific changes below deal with the fact that overflow behavior, as reported from size_binop, changes as unsigned sizety

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Aldy Hernandez
Note that with all this mess I'll re-iterate some of my initial thoughts. 1) why not do this C++ (or C) specific stuff in the frontends, maybe at gimplifying/genericization time? That way you wouldn't need to worry about middle-end features but you could rely solely on what C/C++ permit. It is

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Arnaud Charlet
> This fixes the Ada bootstrap failure introduced by alloca folding. > We now fold alloca (0) to &auto-with-size-zero which confuses us. > I didn't exactly investigate but what I think happens is that we > expand that &auto-with-size-zero to NULL instead of > virtual_stack_dynamic_rtx (see zero-siz

Re: [PATCH Atom][PR middle-end/44382] Tree reassociation improvement

2011-09-02 Thread Uros Bizjak
On Thu, Sep 1, 2011 at 12:27 PM, Ilya Enkovich wrote: >> >> this seems to not allow cycles_best to drop with lower width, but >> that it can't should be an implementation detail of get_required_cycles. >> To make it not so, can you add a comment before the loop, like >> >>  /* get_required_cycles

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Arnaud Charlet wrote: > > This fixes the Ada bootstrap failure introduced by alloca folding. > > We now fold alloca (0) to &auto-with-size-zero which confuses us. > > I didn't exactly investigate but what I think happens is that we > > expand that &auto-with-size-zero to NULL i

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Arnaud Charlet
> > In Ada, it's quite natural to end up with a dynamically sized object of > > size 0. For instance, if you declare an array with a dynamic bound: > > > >Table : Unit_Table (1 .. Last_Unit); > > > > and Last_Unit happens to be 0 at run-time > > But are we expected to read/store from the sto

Re: [PATCH, PR 49886] Prevent fnsplit from changing signature when there are type attributes

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 2:42 PM, Martin Jambor wrote: > Hi, > > On Wed, Aug 31, 2011 at 09:33:03AM +0200, Richard Guenther wrote: >> On Tue, Aug 30, 2011 at 6:50 PM, Martin Jambor wrote: >> > Ping.  Re-bootstrapped and re-tested yesterday on x86_64-linux. >> >> Ok.  Does this also apply (maybe in

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 2:49 PM, Aldy Hernandez wrote: > >> Note that with all this mess I'll re-iterate some of my initial thoughts. >> 1) why not do this C++ (or C) specific stuff in the frontends, maybe >> at gimplifying/genericization time?  That way you wouldn't need to >> worry about middle-e

Re: [PATCH Atom][PR middle-end/44382] Tree reassociation improvement

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 2:52 PM, Uros Bizjak wrote: > On Thu, Sep 1, 2011 at 12:27 PM, Ilya Enkovich wrote: >>> >>> this seems to not allow cycles_best to drop with lower width, but >>> that it can't should be an implementation detail of get_required_cycles. >>> To make it not so, can you add a co

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Robert Dewar
On 9/2/2011 8:52 AM, Arnaud Charlet wrote: Thanks! In Ada, it's quite natural to end up with a dynamically sized object of size 0. For instance, if you declare an array with a dynamic bound: Table : Unit_Table (1 .. Last_Unit); and Last_Unit happens to be 0 at run-time Arno But isn't i

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Arnaud Charlet wrote: > > > In Ada, it's quite natural to end up with a dynamically sized object of > > > size 0. For instance, if you declare an array with a dynamic bound: > > > > > >Table : Unit_Table (1 .. Last_Unit); > > > > > > and Last_Unit happens to be 0 at run-t

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Robert Dewar
On 9/2/2011 8:58 AM, Arnaud Charlet wrote: In Ada, it's quite natural to end up with a dynamically sized object of size 0. For instance, if you declare an array with a dynamic bound: Table : Unit_Table (1 .. Last_Unit); and Last_Unit happens to be 0 at run-time But are we expected to read

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Robert Dewar wrote: > On 9/2/2011 8:58 AM, Arnaud Charlet wrote: > > > > In Ada, it's quite natural to end up with a dynamically sized object of > > > > size 0. For instance, if you declare an array with a dynamic bound: > > > > > > > > Table : Unit_Table (1 .. Last_Unit);

Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1

2011-09-02 Thread Eric Botcazou
> But they _do_ overflow as my debugging showed, caused by that exact > same extract_muldiv_1 function here: > > case PLUS_EXPR: case MINUS_EXPR: > /* See if we can eliminate the operation on both sides. If we can, > we > can return a new PLUS or MINUS. If we can't, the only r

[v3] Improve std::bitset::all

2011-09-02 Thread Paolo Carlini
Hi, tested x86_64-linux multilib, a nice improvement joint work with Marc. Mainline only of course. Thanks, Paolo. / 2011-09-02 Paolo Carlini Marc Glisse * include/std/bitset (_Base_bitset<>::_M_are_all_aux): Remove. (_Base_bitset<>::_

Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Eric Botcazou wrote: > > But they _do_ overflow as my debugging showed, caused by that exact > > same extract_muldiv_1 function here: > > > > case PLUS_EXPR: case MINUS_EXPR: > > /* See if we can eliminate the operation on both sides. If we can, > > we > >

Re: [PATCH] Make devirtualization use BINFO_VTABLE instead of BINFO_VIRTUALS

2011-09-02 Thread Martin Jambor
Hi, On Thu, Sep 01, 2011 at 08:52:30PM +0200, Jan Hubicka wrote: > > - Nevertheless, this method of devirtualization cannot automatically > > de-thunkize this-adjusting thunks and newly direct calls to them > > cannot be inlined because the inliner does not have this capability > > now. Thi

Re: [Patch, C] options generation and language count

2011-09-02 Thread Joseph S. Myers
On Thu, 1 Sep 2011, Gary Funck wrote: > +# MAX_LANG is the maximum number of languages that can be defined. > +# Its value is extracted from the value of CL_PARAMS in opts.h > +# and is passed on the command line as '-v max_lang=...'. > +if (n_langs > max_lang) { > + print "Error: the number of d

Re: [PATCH] Make devirtualization use BINFO_VTABLE instead of BINFO_VIRTUALS

2011-09-02 Thread Jan Hubicka
> Hi, > > On Thu, Sep 01, 2011 at 08:52:30PM +0200, Jan Hubicka wrote: > > > - Nevertheless, this method of devirtualization cannot automatically > > > de-thunkize this-adjusting thunks and newly direct calls to them > > > cannot be inlined because the inliner does not have this capability > >

Re: [PATCH Atom][PR middle-end/44382] Tree reassociation improvement

2011-09-02 Thread Ilya Enkovich
2011/9/2 Richard Guenther : >On Fri, Sep 2, 2011 at 2:52 PM, Uros Bizjak wrote: >> >> I assume that you need to split tune attribute to int and FP part to >> handle reassociation for other targets, since Atom handles both in the >> same way. >> >> Please also describe function return value in the

[PATCH] Print unsigned host-wide-int fitting INTEGER_CSTs regularly

2011-09-02 Thread Richard Guenther
without resorting to hex printing of both high/low values. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2011-09-02 Richard Guenther * pretty-print.h (pp_unsigned_wide_integer): New. * tree-pretty-print.c (dump_generic_node): Print unsigned

[v3] Trivial formatting fixes to

2011-09-02 Thread Paolo Carlini
Hi, noticed over the last day or so, committed to mainline. Paolo. // 2011-09-02 Paolo Carlini * include/std/bitset: Trivial formatting fixes. Index: include/std/bitset === --- include/std/bitset (revis

Re: [PATCH][Ada][C][C++] sizetypes no longer sign-extend

2011-09-02 Thread Joseph S. Myers
On Fri, 2 Sep 2011, Richard Guenther wrote: > * c-decl.c (grokdeclarator): Properly check for sizes that > cover more than half of the address-space. The C front-end changes are OK. -- Joseph S. Myers jos...@codesourcery.com

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Robert Dewar
On 9/2/2011 9:16 AM, Richard Guenther wrote: The bootstrap failure showed NULL pointer dereferences (which probably easily points to the affected part of the RTS). Might be interesting to pursue, but we don't know that the null pointers being dereferenced are in fact the ones returned by alloc

Re: [PATCH Atom][PR middle-end/44382] Tree reassociation improvement

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 3:45 PM, Ilya Enkovich wrote: > 2011/9/2 Richard Guenther : >>On Fri, Sep 2, 2011 at 2:52 PM, Uros Bizjak wrote: >>> >>> I assume that you need to split tune attribute to int and FP part to >>> handle reassociation for other targets, since Atom handles both in the >>> same

Re: [PATCH] Enable IPA-CP on functions with variable number of arguments or type attributes

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 2:27 PM, Martin Jambor wrote: > Hi, > > currently IPA-CP switches itself off on functions with are called with > variable number of arguments or on those whose signature cannot be > changed because of type attributes.  This patch turns it on for both, > not changing the para

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Jason Merrill
On 09/02/2011 04:53 AM, Richard Guenther wrote: On Thu, Sep 1, 2011 at 5:19 PM, Jason Merrill wrote: I think it would make sense to expose this information to the back end somehow. A hook would do the trick: call it type_data_size or type_min_size or some such, which in the C++ front end would

Re: [PATCH Atom][PR middle-end/44382] Tree reassociation improvement

2011-09-02 Thread Ilya Enkovich
2011/9/2 Richard Guenther : > On Fri, Sep 2, 2011 at 3:45 PM, Ilya Enkovich wrote: >> 2011/9/2 Richard Guenther : >>>On Fri, Sep 2, 2011 at 2:52 PM, Uros Bizjak wrote: I assume that you need to split tune attribute to int and FP part to handle reassociation for other targets, since

Re: [PATCH] Enable IPA-CP on functions with variable number of arguments or type attributes

2011-09-02 Thread Jan Hubicka
> On Fri, Sep 2, 2011 at 2:27 PM, Martin Jambor wrote: > > Hi, > > > > currently IPA-CP switches itself off on functions with are called with > > variable number of arguments or on those whose signature cannot be > > changed because of type attributes.  This patch turns it on for both, > > not cha

Re: [PATCH][Ada][C][C++] sizetypes no longer sign-extend

2011-09-02 Thread Richard Guenther
On Fri, 2 Sep 2011, Richard Guenther wrote: > > This patch makes us no longer treat unsigned sizetypes as sign-extending > which has caused trouble in the past (see the tree-ssa-ccp.c workarounds > removed below). > > Most frontend specific changes below deal with the fact that overflow > behavi

Re: [C++0x] contiguous bitfields race implementation

2011-09-02 Thread Richard Guenther
On Fri, Sep 2, 2011 at 4:10 PM, Jason Merrill wrote: > On 09/02/2011 04:53 AM, Richard Guenther wrote: >> >> On Thu, Sep 1, 2011 at 5:19 PM, Jason Merrill  wrote: >>> >>> I think it would make sense to expose this information to the back end >>> somehow.  A hook would do the trick: call it type_da

[ARM] PR target/49030: ICE in get_arm_condition_code

2011-09-02 Thread Richard Sandiford
CC_NCV rightly only allows GE(U) and LT(U). GT(U) and LE(U) have to implemented by reversing the condition. This is handled correctly when the condition is first expanded, but nothing stops later optimisers from producing invalid forms. This patch makes arm_comparison_operator check that the con

Ping: PR 50113/50061: Fix ABI breakage from emit_library_call_value_1 patch

2011-09-02 Thread Richard Sandiford
Ping for this patch to emit_library_call_value_1: http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00735.html which fixes a bootstrap failure on MIPS since: http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02341.html Tested on mips64-linux-gnu, mips-sgi-irix6.5 (by Rainer) and on both big and l

[PATCH] Store jump functions in a VECtor

2011-09-02 Thread Martin Jambor
Hi, when I submitted the new IPA-CP a few months ago Honza requested that I store the jump_functions in a VECtor rather than an array in which they are now. The patch below does exactly that. The last remaining such request is to rename ipa_check_create_node_params to "something else." I guess

Re: Vector shuffling

2011-09-02 Thread Joseph S. Myers
On Fri, 2 Sep 2011, Artem Shinkarov wrote: > + /* Avoid C_MAYBE_CONST_EXPRs inside VEC_SHUFFLE_EXPR. */ > + tmp = c_fully_fold (v0, false, &maybe_const); > + v0 = save_expr (tmp); > + wrap &= maybe_const; I suppose you need this save_expr because of the two-argument case, but shouldn't need

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Michael Matz
Hi, On Fri, 2 Sep 2011, Robert Dewar wrote: > On 9/2/2011 9:16 AM, Richard Guenther wrote: > > Might be interesting to pursue, but we don't know that the null pointers > being dereferenced are in fact the ones returned by alloca. May not be > worth the effort. Given the nature of the work-aro

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Arnaud Charlet
> Given the nature of the work-around which makes Ada work again it's fairly > sure that the Ada frontend does emit accesses to an alloca'ed area of > memory even if its size is zero. I.e. definitely a real bug. Well, it's not clear whether it's the Ada frontend or the middle which is emitting th

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Robert Dewar
On 9/2/2011 11:47 AM, Michael Matz wrote: Hi, On Fri, 2 Sep 2011, Robert Dewar wrote: On 9/2/2011 9:16 AM, Richard Guenther wrote: Might be interesting to pursue, but we don't know that the null pointers being dereferenced are in fact the ones returned by alloca. May not be worth the effort.

Re: [ARM] PR target/49030: ICE in get_arm_condition_code

2011-09-02 Thread Chung-Lin Tang
Hi Richard, this looks very similar to this patch, originally for LP:689887: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00794.html Apart from your additional handling in the dominance modes cases. I remember that last patch was held down because Thumb-2 native bootstrap failed. Did you try that

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Michael Matz
Hi, On Fri, 2 Sep 2011, Arnaud Charlet wrote: > > Given the nature of the work-around which makes Ada work again it's fairly > > sure that the Ada frontend does emit accesses to an alloca'ed area of > > memory even if its size is zero. I.e. definitely a real bug. > > Well, it's not clear whethe

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Eric Botcazou
> This fixes the Ada bootstrap failure introduced by alloca folding. > We now fold alloca (0) to &auto-with-size-zero which confuses us. > I didn't exactly investigate but what I think happens is that we > expand that &auto-with-size-zero to NULL instead of > virtual_stack_dynamic_rtx (see zero-siz

Re: Vector shuffling

2011-09-02 Thread Artem Shinkarov
On Fri, Sep 2, 2011 at 4:41 PM, Joseph S. Myers wrote: > On Fri, 2 Sep 2011, Artem Shinkarov wrote: > >> +  /* Avoid C_MAYBE_CONST_EXPRs inside VEC_SHUFFLE_EXPR.  */ >> +  tmp = c_fully_fold (v0, false, &maybe_const); >> +  v0 = save_expr (tmp); >> +  wrap &= maybe_const; > > I suppose you need th

Re: [PATCH] Store jump functions in a VECtor

2011-09-02 Thread Jan Hubicka
> 2011-09-02 Martin Jambor > > * ipa-prop.h (ipa_jump_func_t): New typedef. > (struct ipa_edge_args): Removed field argument_count, field > jump_functions turned into a vector. > (ipa_set_cs_argument_count): Removed. > (ipa_get_cs_argument_count): Updated to work o

Re: [Patch, C] options generation and language count

2011-09-02 Thread Gary Funck
On 09/02/11 13:42:32, Joseph S. Myers wrote: > [..] you should just generate #if/#error in the output [...] OK, take two, attached. (Confirmed that the #if works for the (<, ==, >) relationships between n_langs and the max. number of languages supported.) - Gary 2011-09-02 Gary Funck

Re: Fix PR50260

2011-09-02 Thread Michael Matz
Hi, On Fri, 2 Sep 2011, Richard Guenther wrote: > > Currently regstrapping on x86_64-linux (without Ada).  Okay for trunk? > > Ok. Time to make get_var_ann private? Yes. Should the regstrap succeed on x86_64-linux I'll commit this variant of the patch (hunks in tree-flow.h, tree-flow-inline.

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Eric Botcazou
> so accessing the With_Flags array (which is not empty) yields a SEGV > because the base pointer is equal to Last_Unit (i.e. 2). In other words, > the GIMPLE code looks legitimate and the bug is very likely in the stack > slot allocation code (maybe triggered by the newly created zero-sized > arr

[RFC, WIP] tree-ssa-strlen optimization pass

2011-09-02 Thread Jakub Jelinek
Hi! The following patch contains a WIP implementation of a new pass, which attempts to track C string lengths and perform various optimizations using that information. Optimizations it currently performs: 1) optimizing away strlen calls, if the string length is known at that point already (eit

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Eric Botcazou
> And this is the real fix. Richard, do you want me to apply (part of it)? In fact I'd even propose to revert the fold_builtin_alloca_for_var part of your patch and apply mine entirely, as eliminating alloca (0) early looks a interesting simplification. What do you think? -- Eric Botcazou

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread H.J. Lu
On Fri, Sep 2, 2011 at 9:40 AM, Eric Botcazou wrote: >> so accessing the With_Flags array (which is not empty) yields a SEGV >> because the base pointer is equal to Last_Unit (i.e. 2).  In other words, >> the GIMPLE code looks legitimate and the bug is very likely in the stack >> slot allocation c

Re: [RFC, WIP] tree-ssa-strlen optimization pass

2011-09-02 Thread Paolo Carlini
Hi, Any comments related to the implementation, or examples of real-world lame C string length code sequences that would be nice to optimize will be greatly appreciated. I'm only wondering how hard would be taking care more consistently of the wchar_t counterparts of all these library functions.

[lra] reverting a patch

2011-09-02 Thread Vladimir Makarov
My previous patch for preference of smaller # of registers involved in reloads broke some tests from spec2000 on i686 because LRA started to use MMX registers. I am working on a fix for this but unfortunately fixing it is not easy and will take some time, so I am reverting my previous patch.

Re: [PATCH] Fix Ada bootstrap failure

2011-09-02 Thread Tom de Vries
On 09/02/2011 07:13 PM, H.J. Lu wrote: > On Fri, Sep 2, 2011 at 9:40 AM, Eric Botcazou wrote: >>> so accessing the With_Flags array (which is not empty) yields a SEGV >>> because the base pointer is equal to Last_Unit (i.e. 2). In other words, >>> the GIMPLE code looks legitimate and the bug is v

Re: Propagate BB predicates in ipa-inline-analysis

2011-09-02 Thread Ulrich Weigand
Jan Hubicka wrote: > (edge_execution_predicate): Rewrite as... > (set_cond_stmt_execution_predicate): ... this function; handle > __builtin_constant_p. This causes ICEs when building recent Linux kernels with the CONFIG_TRACE_BRANCH_PROFLING option. This reduced test case: sta

Fix C6X FP insn scheduling

2011-09-02 Thread Bernd Schmidt
Scheduling floating point insns is broken on C6X; unfortunately in a way that the simulator doesn't detect. We let the sched DFA pick a valid schedule, and later on we try to reconstruct a valid unit assignment. This does not work if an insn has multiple units it can choose, and that insn's reserv

Re: [RFC, WIP] tree-ssa-strlen optimization pass

2011-09-02 Thread Jakub Jelinek
On Fri, Sep 02, 2011 at 07:14:58PM +0200, Paolo Carlini wrote: > >Any comments related to the implementation, or examples of real-world > >lame C string length code sequences that would be nice to optimize > >will be greatly appreciated. > I'm only wondering how hard would be taking care more consi

Re: Fix PR50260

2011-09-02 Thread Michael Matz
Hi, On Fri, 2 Sep 2011, Michael Matz wrote: > Hi, > > On Fri, 2 Sep 2011, Richard Guenther wrote: > > > > Currently regstrapping on x86_64-linux (without Ada).  Okay for trunk? > > > > Ok. Time to make get_var_ann private? > > Yes. Should the regstrap succeed on x86_64-linux I'll commit thi

  1   2   >