[COMMITTED] Update rs6000.c's pass_analyze_swaps to use rtx_insn [was Re: [PATCH 029/236] rtl_data.x_parm_birth_insn is an insn]
On Wed, 2014-08-13 at 11:13 -0600, Jeff Law wrote: > On 08/13/14 11:08, David Malcolm wrote: > > On Wed, 2014-08-13 at 07:44 -0600, Jeff Law wrote: > >> On 08/06/14 11:20, David Malcolm wrote: > >>> gcc/ > >>> * function.h (struct rtl_data): Strengthen field > >>> "x_parm_birth_insn" from rtx to rtx_insn *. > >>> * function.c (struct assign_parm_data_all): Strengthen fields > >>> "first_conversion_insn" and "last_conversion_insn" from rtx to > >>> rtx_insn *. > >> OK. I think at this point any patch which merely changes the type of > >> some variable or in a signature from rtx to rtx_insn (or any of the > >> concrete passes) is considered trivial enough to go forward without > > ^^ > > Presumably you meant "subclasses" here, right? > yes. > > > > >> explicit review. > >> > >> That applies to patches in this series, additions you may need to make > >> due to changes in the tree since you last rebased and further > >> strengthening you or anyone else may want to tackle. [...snip...] Based on the above pre-approval, I went ahead and committed the following patch to trunk as r214489 (bootstrapped on powerpc64-unknown-linux-gnu: Fedora 20, gcc110, in fact) Commit r214254 (aka 1b66c2db6a7d0a64fa2c33f083483d16fd864172) added a new pass_analyze_swaps to rs6000 (aka ppc). The following trivial patch updates it to use rtx_insn, needed before the params to df_insn_rescan and df_insn_delete can be tightened up from rtx to rtx_insn * in patch #191 (fwiw, trunk is currently at #171, i.e. early in phase 4). gcc/ * config/rs6000/rs6000.c (class swap_web_entry): Strengthen field "insn" from rtx to rtx_insn *. (permute_load): Likewise for param "insn". (permute_store): Likewise. (handle_special_swappables): Likewise for local "insn". (replace_swap_with_copy): Likewise for locals "insn" and "new_insn". (rs6000_analyze_swaps): Likewise for local "insn". Index: gcc/ChangeLog === --- gcc/ChangeLog (revision 214488) +++ gcc/ChangeLog (revision 214489) @@ -1,3 +1,14 @@ +2014-08-26 David Malcolm + + * config/rs6000/rs6000.c (class swap_web_entry): Strengthen field + "insn" from rtx to rtx_insn *. + (permute_load): Likewise for param "insn". + (permute_store): Likewise. + (handle_special_swappables): Likewise for local "insn". + (replace_swap_with_copy): Likewise for locals "insn" and + "new_insn". + (rs6000_analyze_swaps): Likewise for local "insn". + 2014-08-25 David Malcolm * regrename.h (struct du_chain): Strengthen field "insn" from rtx Index: gcc/config/rs6000/rs6000.c === --- gcc/config/rs6000/rs6000.c (revision 214488) +++ gcc/config/rs6000/rs6000.c (revision 214489) @@ -33496,7 +33496,7 @@ { public: /* Pointer to the insn. */ - rtx insn; + rtx_insn *insn; /* Set if insn contains a mention of a vector register. All other fields are undefined if this field is unset. */ unsigned int is_relevant : 1; @@ -34040,7 +34040,7 @@ /* Convert the non-permuting load INSN to a permuting one. */ static void -permute_load (rtx insn) +permute_load (rtx_insn *insn) { rtx body = PATTERN (insn); rtx mem_op = SET_SRC (body); @@ -34066,7 +34066,7 @@ /* Convert the non-permuting store INSN to a permuting one. */ static void -permute_store (rtx insn) +permute_store (rtx_insn *insn) { rtx body = PATTERN (insn); rtx src_reg = SET_SRC (body); @@ -34094,7 +34094,7 @@ static void handle_special_swappables (swap_web_entry *insn_entry, unsigned i) { - rtx insn = insn_entry[i].insn; + rtx_insn *insn = insn_entry[i].insn; rtx body = PATTERN (insn); switch (insn_entry[i].special_handling) @@ -34133,11 +34133,11 @@ static void replace_swap_with_copy (swap_web_entry *insn_entry, unsigned i) { - rtx insn = insn_entry[i].insn; + rtx_insn *insn = insn_entry[i].insn; rtx body = PATTERN (insn); rtx src_reg = XEXP (SET_SRC (body), 0); rtx copy = gen_rtx_SET (VOIDmode, SET_DEST (body), src_reg); - rtx new_insn = emit_insn_before (copy, insn); + rtx_insn *new_insn = emit_insn_before (copy, insn); set_block_for_insn (new_insn, BLOCK_FOR_INSN (insn)); df_insn_rescan (new_insn); @@ -34209,7 +34209,7 @@ { swap_web_entry *insn_entry; basic_block bb; - rtx insn; + rtx_insn *insn; /* Dataflow analysis for use-def chains. */ df_set_flags (DF_RD_PRUNE_DEAD_DEFS);
Re: Enable EBX for x86 in 32bits PIC code
2014-08-25 19:08 GMT+04:00 Vladimir Makarov : > On 2014-08-22 8:21 AM, Ilya Enkovich wrote: >> >> Hi, >> >> On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in >> 32bit PIC mode. It was decided that the best approach would be to not fix >> ebx register, use speudo register for GOT base address and let allocator do >> the rest. This should be similar to how clang and icc work with GOT base >> address. I've been working for some time on such patch and now want to >> share my results. >> >> The idea of the patch was very simple and included few things; >> 1. Set PIC_OFFSET_TABLE_REGNUM to INVALID_REGNUM to specify that we do >> not have any hard reg fixed for PIC. >> 2. Initialize pic_offset_table_rtx with a new pseudo register in the >> begining of a function expand. >> 3. Change ABI so that there is a possible implicit PIC argument for >> calls; pic_offset_table_rtx is used as an arg value if such implicit arg >> exist. >> >> Such approach worked well on small tests but trying to run some benchmarks >> we faced a problem with reload of address constants. The problem is that >> when we try to rematerialize address constant or some constant memory >> reference, we have to use pic_offset_table_rtx. It means we insert new >> usages of a speudo register and alocator cannot handle it correctly. Same >> problem also applies for float and vector constants. >> >> Rematerialization is not the only case causing new pic_offset_table_rtx >> usage. Another case is a split of some instructions using constant but not >> having proper constraints. E.g. pushtf pattern allows push of constant but >> it has to be replaced with push of memory in reload pass causing additional >> usage of pic_offset_table_rtx. >> >> There are two ways to fix it. The first one is to support modifications >> of pseudo register live range during reload and correctly allocate hard regs >> for its new usages (currently we have some hard reg allocated for new usage >> of pseudo reg but it may contain value of some other pseudo reg; thus we >> reveal the problem at runtime only). >> > > I believe there is already code to deal with this situation. It is code for > risky transformations (please check flag lra_risky_transformation_p). If > this flag is set, next lra assign subpass is running and checking > correctness of assignments (e.g. checking situation when two different > pseudos have intersected live ranges and the same assigned hard reg. If > such dangerous situation is found, it is fixed). I tried to remove my restrictions from setup_reg_equiv and initialize lra_risky_transformation_p with 'true' in lra_constraints instead. I got only 50% pass rate for SPEC2000 on Ofast with LTO. Will search for fail reason. Ilya > > >> The second way is to avoid all cases when new usages of >> pic_offset_table_rtx appear in reload. That is a way I chose because it >> appeared simplier to me and would allow me to get some performance data >> faster. Also having rematerialization of address anf float constants in PIC >> mode would mean we have higher register pressure, thus having them on stack >> should be even more efficient. To achieve it I had to cut off reg equivs to >> all exprs using symbol references and all constants living in the memory. I >> also had to avoid instructions requiring split in reload causing load of >> constant from memory (*push[txd]f). >> >> Resulting compiler successfully passes make check, compiles EEMBC and >> SPEC2000 benchmarks. There is no confidence I covered all cases and there >> still may be some templates causing split in reload with new >> pic_offset_table_rtx usages. I think support of reload with pseudo PIC >> would be better and more general solution. But I don't know how difficult >> is to implement it though. Any ideas on resolving this reload issue? >> > > Please see what I mentioned above. May be it can fix the degradation. > Rematerialization is important for performance and switching it of > completely is not wise. > > > >> I collected some performance numbers for EEMBC and SPEC2000 benchmarks. >> Here are patch results for -Ofast optlevel with LTO collectd on Avoton >> server: >> AUTOmark +1,9% >> TELECOMmark +4,0% >> DENmark +10,0% >> SPEC2000 -0,5% >> >> There are few degradations on EEMBC benchmarks but on SPEC2000 situation >> is different and we see more performance losses. Some of them are caused by >> disabled rematerialization of address constants. In some cases relaxed ebx >> causes more spills/fills in plaecs where GOT is frequently used. There are >> also some minor fixes required in the patch to allow more efficient function >> prolog (avoid unnecessary GOT register initialization and allow its >> initialization without ebx usage). Suppose some performance problems may be >> resolved but a good fix for reload should go first. >> >> > > Ilya, the optimization you are trying to implement is important in many > cases and should be in some way inc
Re: [PATCH][match-and-simplify] Auto-guess conversion types
On Thu, 21 Aug 2014, Marc Glisse wrote: > On Thu, 21 Aug 2014, Richard Biener wrote: > > > 2014-08-21 Richard Biener > > > > * match.pd ((T1)(~(T2) X) -> ~(T1) X): Paste all comment > > from fold-const.c, fix simplification result. > > > > Index: gcc/match.pd > > === > > --- gcc/match.pd(revision 214268) > > +++ gcc/match.pd(working copy) > > @@ -109,7 +109,9 @@ along with GCC; see the file COPYING3. > > > > /* From fold_unary. */ > > > > -/* (T1)(~(T2) X) -> ~(T1) X */ > > +/* Convert (T1)(~(T2)X) into ~(T1)X if T1 and T2 are integral types > > + of the same precision, and X is an integer type not narrower than > > + types T1 or T2, i.e. the cast (T2)X isn't an extension. */ > > (simplify > > (convert (bit_not@0 (convert @1))) > > (if (INTEGRAL_TYPE_P (type) > > @@ -117,7 +119,7 @@ along with GCC; see the file COPYING3. > > && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)) > > && INTEGRAL_TYPE_P (TREE_TYPE (@1)) > > && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@1))) > > - (bit_not (convert (bit_not @0) > > + (bit_not (convert @0 > > Er, I think you mean: > (bit_not (convert @1)) Oops, fixed ;) > Your pattern (bit_not (convert (bit_not @0))) was valid, @0 is the bit_not, so > it simplifies, but that was a pretty unreadable way to write it, and I was > scared that you had done it on purpose to help the machinery guess the type. > Glad to see that the simple version is ok. Of course. Thanks, Richard. 2014-08-26 Richard Biener * match.pd ((T1)(~(T2) X) -> ~(T1) X): Fix simplification again. Index: gcc/match.pd === --- gcc/match.pd(revision 214490) +++ gcc/match.pd(working copy) @@ -119,7 +119,7 @@ along with GCC; see the file COPYING3. && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)) && INTEGRAL_TYPE_P (TREE_TYPE (@1)) && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (@1))) - (bit_not (convert @0 + (bit_not (convert @1 #include "match-plusminus.pd"
Re: [PATCH] Fix condition in is_aligning_offset (PR c/61271)
On Thu, Aug 21, 2014 at 5:52 PM, Marek Polacek wrote: > This is one of the issues that -Wlogical-not-parentheses detected. > Interestingly, this code has been added in 2002 (!). I believe the > logical not there should be just removed; the comment above it says > /* We must now have a BIT_AND_EXPR with a constant that is one less than > power of 2 and which is larger than BIGGEST_ALIGNMENT. */ > so if the constant is not one less than power of 2 (exact_log2 returns -1), > we should bail out. > > Bootstrapped/regtested on x86_64-linux, ok for trunk? Ok. > Should I backport this to 4.9/4.8 after a while? Yes please. Thanks, Richard. > 2014-08-21 Marek Polacek > > PR c/61271 > * expr.c (is_aligning_offset): Remove logical not. > > diff --git gcc/expr.c gcc/expr.c > index 920d47b..05d81dc 100644 > --- gcc/expr.c > +++ gcc/expr.c > @@ -10721,7 +10721,7 @@ is_aligning_offset (const_tree offset, const_tree exp) >|| !tree_fits_uhwi_p (TREE_OPERAND (offset, 1)) >|| compare_tree_int (TREE_OPERAND (offset, 1), >BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0 > - || !exact_log2 (tree_to_uhwi (TREE_OPERAND (offset, 1)) + 1) < 0) > + || exact_log2 (tree_to_uhwi (TREE_OPERAND (offset, 1)) + 1) < 0) > return 0; > >/* Look at the first operand of BIT_AND_EXPR and strip any conversion. > > Marek
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Hi, On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote: With revision 214400 we have the C++14 value of __cplusplus set to the correct value of 201402L (from 201300L). It occurs to me: instead of having to remember every time those numbers, couldn't we predefine, for example: __cplusplus_98 __cplusplus_11 __cplusplus_14 with the correct values of course?!? Thanks, Paolo.
Re: [patch, fortran] use vec<> in frontend-passes.c
Hi Thomas, hi all, first, thanks Trevor for the first round of review! Thomas Koenig wrote: > Trevor Saunders wrote: > > >doloop_warn (ns); > > > - XDELETEVEC (doloop_list); > > > + doloop_list.truncate (0); > > > > .release () would be more typical. > > Changed (also below). I still see: > - expr_count = 0; > + expr_array.truncate (0); Is there is a reason for not using release() here? Otherwise, it looks good to me - and cleaner than the home-grown stack. Tobias
Re: [Patch 1/2] Don't put out a call to memcpy for volatile struct operations
On Fri, Aug 22, 2014 at 1:47 AM, Mike Stump wrote: > On Aug 21, 2014, at 4:22 AM, Richard Biener > wrote: >> I still say we need to solve the issue at language level - that is, >> try to figure out what the language standard says about >> >> volatile struct X x, y; > >> x = y; > > The definition of x = y doesn’t change wrt volatile above. See below for the > semantic of x = y; What this does is it makes the members of x and y > volatile: > >[#7] EXAMPLE 2 In: | > >struct s { int i; const int ci; }; >struct s s; >const struct s cs; >volatile struct s vs; > >the various members have the types: | > >s.i int >s.ciconst int >cs.iconst int >cs.ci const int >vs.ivolatile int >vs.ci volatile const int > >> or about >> >> struct X { volatile int x; } x, y; >> >> x = y; > > So, what the C99 standard[1] says is that memcpy copies n characters from one > to the other, leaving unspecified the order of the copy. C++98 reuses by > reference those semantics. Of course, there are quite a few memcpy > implementations that don’t do that. > > For x = y, in C++98, it is defined like so: > > 8 The implicitly-defined copy constructor for class X performs a member- > wise copy of its subobjects. The order of copying is the same as the > order of initialization of bases and members in a user-defined con- > structor (see _class.base.init_). Each subobject is copied in the > manner appropriate to its type Thats quite specific ;) > which means a volatile int member translates to volatile SI read/write as > appropriate, or put another way, one can’t use memcpy for it. Now, that > isn’t to say that we can’t change the language standard or improve it with > different semantics. > > For C99: > >[#2] In simple assignment (=), the value of the right >operand is converted to the type of the assignment >expression and replaces the value stored in the object >designated by the left operand. > > which I’d claim isn’t exactly clear and precise. Clearly what they were > thinking was: Indeed. >36)Thus, for example, structure assignment may be > implemented element-at-a-time or via memcpy. > > left not exactly well defined is the case of volatile. Reasonable people > would say that volatile semantics are likely the same as C++98 (also, C++ was > mostly just noting what we thought the C standard said in the first place). > > I don’t keep up on DRs that might explicitly cover details, so I’d defer > those those if any. > >> I expect that most structs have volatile for a bogus reason >> anyway and we slow down and enlarge code for no good reason. > > Yes, I suspect if we put in code to handle volatile members better, that no > code will care. Why, cause no one has asked for those semantics, no code > depends upon those semantics. Though, in time, some code might care. > >> So - why bother fixing this? ISTR reading in the C standard >> that structure assignments are expected to compile to memcpy. > > Your ISTR is quoted for you above. That wording isn’t a prescription of > semantics. It is an observation that there are some situations where the > implementation may use memcpy. > > In C99, sig_atomic_t defines when something is lock free, leaving unspecific > what else may be. In later C++ standards (for example C++14), > [atomics.lockfree] defines additional types that are atomic. > > > 1 - I use n843 for C99, which is slightly different from the standard, but in > this case I suspect it is the same. So after reading the std quotations I still think that if we want to fix anything here then we want to fix it in the frontends (only the C++ FE knows init order in the details required - though I suppose the description was for non-POD types where the FE may already do this). _If_ we want to do this in the middle-end then I suggest to do the decomposition during gimplification as the rest of the middle-end doesn't treat the second example as a volatile aggregate copy at all. Fixing this with the proposed patch doesn't really fix it and it will perform the worst of all implementations (a byte-by-byte copy certainly will break that hardware access the patch was meant to fix, also thinking of a struct with volatile bitfields and -fstrict-volatile-bitfields). I'd still lean towards doing this in frontends (or c-family/ code). Richard.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Paolo Carlini writes: > Hi, > > On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote: >> With revision 214400 we have the C++14 value of __cplusplus set to the >> correct value of 201402L (from 201300L). > It occurs to me: instead of having to remember every time those numbers, > couldn't we predefine, for example: > > __cplusplus_98 > __cplusplus_11 > __cplusplus_14 > > with the correct values of course?!? But won't this lead to portability trouble in the future when people see those macros and start using them in their own code, breaking compilation with older or non-g++ compilers? Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: [PATCH] Fix LOOP_REQUIRES_VERSIONING_* macros (PR c/61271)
On Mon, Aug 25, 2014 at 3:02 PM, Marek Polacek wrote: > Another issue found by -Wlogical-not-parentheses. > tree-vect-data-refs.c contains > if (!LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo)) > but since the definition of LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT > is lacking parens, this expands to !X > 0 and we warn. > Similarly for LOOP_REQUIRES_VERSIONING_FOR_ALIAS. > > Bootstrapped/regtested on x86_64-linux, ok for trunk? Ok for trunk (and affected branches). Thanks, Richard. > 2014-08-25 Marek Polacek > > PR c/61271 > * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT, > LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens. > > diff --git gcc/tree-vectorizer.h gcc/tree-vectorizer.h > index a38443e..95209bc 100644 > --- gcc/tree-vectorizer.h > +++ gcc/tree-vectorizer.h > @@ -414,9 +414,9 @@ typedef struct _loop_vec_info { > #define LOOP_VINFO_SCALAR_LOOP(L) (L)->scalar_loop > > #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \ > - (L)->may_misalign_stmts.length () > 0 > + ((L)->may_misalign_stmts.length () > 0) > #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \ > - (L)->may_alias_ddrs.length () > 0 > + ((L)->may_alias_ddrs.length () > 0) > > #define LOOP_VINFO_NITERS_KNOWN_P(L) \ >(tree_fits_shwi_p ((L)->num_iters) && tree_to_shwi ((L)->num_iters) > 0) > > Marek
Re: [PATCH GCC]Fix broken Canadian when checking isl library support
On Mon, Aug 25, 2014 at 11:07 PM, Sebastian Pop wrote: > Sebastian Pop wrote: >> Richard Biener wrote: >> > I think it would be better to identify a set of features we rely on that >> > are not present in earlier versions and make the test a link >> > test unconditionally. >> > >> > Tobias, are there include files / types / functions we require >> > that are not available in earlier versions? >> >> The version 0.12 of ISL has an include file isl/val.h that is not present in >> previous versions of ISL. >> >> There also was a patch from Mircea a few weeks ago that was missing the >> configure bits to check that the isl version contained isl/val.h. >> I will update both patches and submit for review. > > I see that Mircea's patch has been committed: > > commit c5ec3cc336c7d42d9ad2995395d430b99a9a34cc > Author: mircea > Date: Mon Aug 11 15:05:48 2014 + > > Replacement of isl_int by isl_val > > git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213816 > 138bc75d-0d04-0410-961f-82ee72b054a4 > > Attached a patch to check for isl/val.h instead of ISL's release number. > > Bootstrapping on x86-64. Ok to commit? Ok. I suppose the "checking for version 0.12 of ISL" is now slightly misleading - maybe change it to "checking for compatible ISL"? Thanks, Richard. > Thanks, > Sebastian
RE: [PATCH][ARM] Fix -fcall-saved-rX for X > 7 When compiling for size for thumb targets
Ping? > -Original Message- > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme > Sent: Wednesday, August 20, 2014 9:28 AM > To: gcc-patches@gcc.gnu.org > Subject: [PATCH][ARM] Fix -fcall-saved-rX for X > 7 > > This patch makes -fcall-saved-rX for X > 7 on Thumb target when optimizing > for size. It works by adding a new field x_user_set_call_save_regs in struct > target_hard_regs to track whether an entry in fields x_fixed_regs, > x_call_used_regs and x_call_really_used_regs was user set or is in its default > value. Then it can decide whether to set a given high register as caller saved > or not when optimizing for size based on this information. > > ChangeLog are as follows: > > *** gcc/ChangeLog *** > > 2014-08-15 Thomas Preud'homme > > * config/arm/arm.c (arm_conditional_register_usage): Only set high > registers as caller saved when optimizing for size *and* the user did > not asked otherwise through -fcall-saved-* switch. > * hard-reg-set.h (x_user_set_call_save_regs): New. > (user_set_call_save_regs): Define. > * reginfo.c (init_reg_sets): Initialize user_set_call_save_regs. > (fix_register): Indicate in user_set_call_save_regs that the value set > in call_save_regs and fixed_regs is user set. > > > *** gcc/testsuite/ChangeLog *** > > 2014-08-15 Thomas Preud'homme > > * gcc.target/arm/fcall-save-rhigh.c: New. > > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index 2f8d327..8324fa3 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -30084,7 +30084,8 @@ arm_conditional_register_usage (void) > stacking them. */ >for (regno = FIRST_HI_REGNUM; > regno <= LAST_HI_REGNUM; ++regno) > - fixed_regs[regno] = call_used_regs[regno] = 1; > + if (!user_set_call_save_regs[regno]) > + fixed_regs[regno] = call_used_regs[regno] = 1; > } > >/* The link register can be clobbered by any branch insn, > diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h > index b8ab3df..b523637 100644 > --- a/gcc/hard-reg-set.h > +++ b/gcc/hard-reg-set.h > @@ -614,6 +614,11 @@ struct target_hard_regs { > >char x_call_really_used_regs[FIRST_PSEUDO_REGISTER]; > > + /* Indexed by hard register number, contains 1 for registers > + whose saving at function call was decided by the user > + with -fcall-saved-*, -fcall-used-* or -ffixed-*. */ > + char x_user_set_call_save_regs[FIRST_PSEUDO_REGISTER]; > + >/* The same info as a HARD_REG_SET. */ >HARD_REG_SET x_call_used_reg_set; > > @@ -685,6 +690,8 @@ extern struct target_hard_regs > *this_target_hard_regs; >(this_target_hard_regs->x_call_used_regs) > #define call_really_used_regs \ >(this_target_hard_regs->x_call_really_used_regs) > +#define user_set_call_save_regs \ > + (this_target_hard_regs->x_user_set_call_save_regs) > #define call_used_reg_set \ >(this_target_hard_regs->x_call_used_reg_set) > #define call_fixed_reg_set \ > diff --git a/gcc/reginfo.c b/gcc/reginfo.c > index 7668be0..0b35f7f 100644 > --- a/gcc/reginfo.c > +++ b/gcc/reginfo.c > @@ -183,6 +183,7 @@ init_reg_sets (void) >memcpy (call_really_used_regs, initial_call_really_used_regs, > sizeof call_really_used_regs); > #endif > + memset (user_set_call_save_regs, 0, sizeof user_set_call_save_regs); > #ifdef REG_ALLOC_ORDER >memcpy (reg_alloc_order, initial_reg_alloc_order, sizeof reg_alloc_order); > #endif > @@ -742,6 +743,7 @@ fix_register (const char *name, int fixed, int call_used) > if (fixed == 0) > call_really_used_regs[i] = call_used; > #endif > + user_set_call_save_regs[i] = 1; > } > } > } > diff --git a/gcc/testsuite/gcc.target/arm/fcall-save-rhigh.c > b/gcc/testsuite/gcc.target/arm/fcall-save-rhigh.c > new file mode 100644 > index 000..a321a2b > --- /dev/null > +++ b/gcc/testsuite/gcc.target/arm/fcall-save-rhigh.c > @@ -0,0 +1,10 @@ > +/* { dg-do compile } */ > +/* { dg-final { scan-assembler "mov\\s+r.\\s*,\\s*r8" } } */ > +/* { dg-require-effective-target arm_thumb1_ok } */ > +/* { dg-options "-Os -mthumb -mcpu=cortex-m0 -fcall-saved-r8" } */ > + > +void > +save_regs (void) > +{ > + asm volatile ("" ::: "r7", "r8"); > +} > > Ok for trunk? > > Best regards, > > Thomas > >
[PING][PATCH] Fix for PR 61875
On 08/18/2014 07:37 PM, Marat Zakirov wrote: Hi there! I have a fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61875. This situation occurs when somebody decides to build GCC with -fexeptions and -frtti which are forbidden for libsanitizer. They get strange error (see bug above) which I know how to fix but think that I should not. Instead of it attached patch forces configure to fail when meet -fexceptions or -frtti option in CXXFLAGS. --Marat libsanitizer/ChangeLog: 2014-08-18 Marat Zakirov * configure.ac: Check -fexceptions and -frtti. * configure: Regenerate. diff --git a/libsanitizer/configure b/libsanitizer/configure index 5e4840f..19261c6 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -648,18 +648,15 @@ am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX toolexeclibdir toolexecdir MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE multi_basedir +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -710,13 +707,16 @@ build EGREP GREP CPP +ac_ct_CC +CFLAGS +CC OBJEXT EXEEXT -ac_ct_CC +ac_ct_CXX CPPFLAGS LDFLAGS -CFLAGS -CC +CXXFLAGS +CXX target_alias host_alias build_alias @@ -772,15 +772,15 @@ enable_libtool_lock ac_precious_vars='build_alias host_alias target_alias -CC -CFLAGS +CXX +CXXFLAGS LDFLAGS LIBS CPPFLAGS -CPP -CXX -CXXFLAGS CCC +CC +CFLAGS +CPP CCAS CCASFLAGS CXXCPP' @@ -1424,16 +1424,16 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags + CXX C++ compiler command + CXXFLAGSC++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBSlibraries to pass to the linker, e.g. -l CPPFLAGSC/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags CPP C preprocessor - CXX C++ compiler command - CXXFLAGSC++ compiler flags CCASassembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) CXXCPP C++ preprocessor @@ -1518,6 +1518,44 @@ fi ## Autoconf initialization. ## ## ## +# ac_fn_cxx_try_compile LINENO +# +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +grep -v '^ *+' conftest.err >conftest.er1 +cat conftest.er1 >&5 +mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_cxx_try_compile + # ac_fn_c_try_compile LINENO # -- # Try to compile conftest.$ac_ext, and return whether this succeeded. @@ -1759,44 +1797,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_cxx_try_compile LINENO -# -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then -grep -v '^ *+' conftest.err >conftest.er1 -cat conftest.er1 >&5 -mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && {
Re: PATCH: PR bootstrap/62260: Build inside source tree doesn't work with lto-plugin
On Mon, Aug 25, 2014 at 11:54 PM, H.J. Lu wrote: > Inside lto-plugin, when $host_subdir is '.', which means GCC is configured > inside source tree, gcc_build_dir is ../../$host_subdir/gcc, not > ../$(host_subdir)/gcc. Tested with both in-tree and out-tree build on > Linux/x86-64. OK for trunk? Ok. I wonder if it is finally time to hard-error on build-in-source-tree ... Thanks, Richard. > Thanks. > > > H.J. > --- > 2014-08-25 H.J. Lu > > PR bootstrap/62260 > * Makefile.am (gcc_build_dir): Set to @gcc_build_dir@. > * configure.ac (gcc_build_dir): Set according to $host_subdir. > * Makefile.in: Regenerated. > * configure: Likewise. > > diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am > index f3fb89b..93ea649 100644 > --- a/lto-plugin/Makefile.am > +++ b/lto-plugin/Makefile.am > @@ -15,7 +15,7 @@ override CFLAGS := $(filter-out > -fsanitize=address,$(CFLAGS)) > override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS)) > > libexecsub_LTLIBRARIES = liblto_plugin.la > -gcc_build_dir = ../$(host_subdir)/gcc > +gcc_build_dir = @gcc_build_dir@ > in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), > $(gcc_build_dir)/$(lib)) > > liblto_plugin_la_SOURCES = lto-plugin.c > diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac > index 6a5ae8a..c3ae93e 100644 > --- a/lto-plugin/configure.ac > +++ b/lto-plugin/configure.ac > @@ -27,6 +27,13 @@ if test "x$have_static_libgcc" = xyes; then > fi > AC_SUBST(ac_lto_plugin_ldflags) > > +if test x"$host_subdir" = x.; then > + gcc_build_dir=../gcc > +else > + gcc_build_dir=../../$host_subdir/gcc > +fi > +AC_SUBST(gcc_build_dir) > + > AM_PROG_LIBTOOL > ACX_LT_HOST_FLAGS > AC_SUBST(target_noncanonical)
Re: [PING][PATCH] Fix for PR 61875
On 08/18/2014 07:37 PM, Marat Zakirov wrote: Hi there! I have a fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61875. This situation occurs when somebody decides to build GCC with -fexeptions and -frtti which are forbidden for libsanitizer. They get strange error (see bug above) which I know how to fix but think that I should not. Instead of it attached patch forces configure to fail when meet -fexceptions or -frtti option in CXXFLAGS. --Marat Added the OP.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
On 26/08/14 10:28 +0200, Paolo Carlini wrote: Hi, On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote: With revision 214400 we have the C++14 value of __cplusplus set to the correct value of 201402L (from 201300L). It occurs to me: instead of having to remember every time those numbers, couldn't we predefine, for example: __cplusplus_98 __cplusplus_11 __cplusplus_14 with the correct values of course?!? That seems like a good idea, but I'm not convinced there's any benefit in Ed's changes to do: -#if __cplusplus > 201103L +#if __cplusplus >= 201402L It seems like unnecessary churn to me, but if someone was changing every test to use a symbolic constant instead of an integer literal then I suppose it does no harm to change "> C++11" to ">= C++14" at the same time.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Hi, On 08/26/2014 10:42 AM, Rainer Orth wrote: Paolo Carlini writes: Hi, On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote: With revision 214400 we have the C++14 value of __cplusplus set to the correct value of 201402L (from 201300L). It occurs to me: instead of having to remember every time those numbers, couldn't we predefine, for example: __cplusplus_98 __cplusplus_11 __cplusplus_14 with the correct values of course?!? But won't this lead to portability trouble in the future when people see those macros and start using them in their own code, breaking compilation with older or non-g++ compilers? Well, this can happen for any GNU predefined macro... What can I say, I tried to help ;) As a last resort we can maybe define the macros in bits/c++config... Paolo.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Hi, On 08/26/2014 10:52 AM, Jonathan Wakely wrote: That seems like a good idea, but I'm not convinced there's any benefit in Ed's changes to do: -#if __cplusplus > 201103L +#if __cplusplus >= 201402L It seems like unnecessary churn to me, about this, I had the same thought ;) Paolo.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Hi Paolo, > On 08/26/2014 10:42 AM, Rainer Orth wrote: >> Paolo Carlini writes: >> >>> Hi, >>> >>> On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote: With revision 214400 we have the C++14 value of __cplusplus set to the correct value of 201402L (from 201300L). >>> It occurs to me: instead of having to remember every time those numbers, >>> couldn't we predefine, for example: >>> >>> __cplusplus_98 >>> __cplusplus_11 >>> __cplusplus_14 >>> >>> with the correct values of course?!? >> But won't this lead to portability trouble in the future when people see >> those macros and start using them in their own code, breaking >> compilation with older or non-g++ compilers? > Well, this can happen for any GNU predefined macro... What can I say, I true, but in this case they will be prominent throughout libstdc++ headers. > tried to help ;) As a last resort we can maybe define the macros in Greatly appreciated: they are certainly way more mnemonic than the naked numbers ;-) > bits/c++config... Which won't help users seeing them in the headers. Maybe the issue could be avoided by chosing names that make it clear that they are g++/libstdc++ specific, not generic? Thanks. Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: Enable EBX for x86 in 32bits PIC code
2014-08-26 11:49 GMT+04:00 Ilya Enkovich : > 2014-08-25 19:08 GMT+04:00 Vladimir Makarov : >> On 2014-08-22 8:21 AM, Ilya Enkovich wrote: >>> >>> Hi, >>> >>> On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in >>> 32bit PIC mode. It was decided that the best approach would be to not fix >>> ebx register, use speudo register for GOT base address and let allocator do >>> the rest. This should be similar to how clang and icc work with GOT base >>> address. I've been working for some time on such patch and now want to >>> share my results. >>> >>> The idea of the patch was very simple and included few things; >>> 1. Set PIC_OFFSET_TABLE_REGNUM to INVALID_REGNUM to specify that we do >>> not have any hard reg fixed for PIC. >>> 2. Initialize pic_offset_table_rtx with a new pseudo register in the >>> begining of a function expand. >>> 3. Change ABI so that there is a possible implicit PIC argument for >>> calls; pic_offset_table_rtx is used as an arg value if such implicit arg >>> exist. >>> >>> Such approach worked well on small tests but trying to run some benchmarks >>> we faced a problem with reload of address constants. The problem is that >>> when we try to rematerialize address constant or some constant memory >>> reference, we have to use pic_offset_table_rtx. It means we insert new >>> usages of a speudo register and alocator cannot handle it correctly. Same >>> problem also applies for float and vector constants. >>> >>> Rematerialization is not the only case causing new pic_offset_table_rtx >>> usage. Another case is a split of some instructions using constant but not >>> having proper constraints. E.g. pushtf pattern allows push of constant but >>> it has to be replaced with push of memory in reload pass causing additional >>> usage of pic_offset_table_rtx. >>> >>> There are two ways to fix it. The first one is to support modifications >>> of pseudo register live range during reload and correctly allocate hard regs >>> for its new usages (currently we have some hard reg allocated for new usage >>> of pseudo reg but it may contain value of some other pseudo reg; thus we >>> reveal the problem at runtime only). >>> >> >> I believe there is already code to deal with this situation. It is code for >> risky transformations (please check flag lra_risky_transformation_p). If >> this flag is set, next lra assign subpass is running and checking >> correctness of assignments (e.g. checking situation when two different >> pseudos have intersected live ranges and the same assigned hard reg. If >> such dangerous situation is found, it is fixed). > > I tried to remove my restrictions from setup_reg_equiv and initialize > lra_risky_transformation_p with 'true' in lra_constraints instead. I > got only 50% pass rate for SPEC2000 on Ofast with LTO. Will search > for fail reason. I've looked into one of fails. There is still a problem with allocation in reload. Here is a piece of code which uses float constant: (insn 1199 1198 1200 96 (set (reg:SI 3 bx) (reg:SI 1301 [528])) /usr/include/bits/stdlib-float.h:28 90 {*movsi_internal} (nil)) (call_insn 1200 1199 1201 96 (set (reg:DF 8 st) (call (mem:QI (symbol_ref:SI ("strtod") [flags 0x41] ) [0 strtod S1 A8]) (const_int 8 [0x8]))) /usr/include/bits/stdlib-float.h:28 661 {*call_value} (expr_list:REG_DEAD (reg:SI 3 bx) (expr_list:REG_CALL_DECL (symbol_ref:SI ("strtod") [flags 0x41] ) (expr_list:REG_EH_REGION (const_int 0 [0]) (nil (expr_list (use (reg:SI 3 bx)) (expr_list:SI (use (reg:SI 3 bx)) (expr_list:SI (use (mem/f:SI (reg/f:SI 7 sp) [0 S4 A32])) (expr_list:SI (use (mem/f:SI (plus:SI (reg/f:SI 7 sp) (const_int 4 [0x4])) [0 S4 A32])) (nil)) (insn 1201 1200 1202 96 (set (reg:DF 321 [ D.7817 ]) (reg:DF 8 st)) /usr/include/bits/stdlib-float.h:28 128 {*movdf_internal} (expr_list:REG_DEAD (reg:DF 8 st) (nil))) (insn 1202 1201 1203 96 (set (reg:SF 322 [ D.7804 ]) (float_truncate:SF (reg:DF 321 [ D.7817 ]))) read_arch.c:700 157 {*truncdfsf_fast_sse} (expr_list:REG_DEAD (reg:DF 321 [ D.7817 ]) (nil))) (insn 1203 1202 1204 96 (set (mem:SF (reg/f:SI 198 [ D.7812 ]) [4 _130->frequency+0 S4 A32]) (reg:SF 322 [ D.7804 ])) read_arch.c:700 129 {*movsf_internal} (nil)) (insn 1204 1203 1205 96 (set (reg:SF 1209) (mem/u/c:SF (plus:SI (reg:SI 1301 [528]) (const:SI (unspec:SI [ (symbol_ref/u:SI ("*.LC12") [flags 0x2]) ] UNSPEC_GOTOFF))) [4 S4 A32])) read_arch.c:701 129 {*movsf_internal} (expr_list:REG_EQUAL (const_double:SF 0.0 [0x0.0p+0]) (nil))) (note 1205 1204 1206 96 NOTE_INSN_DELETED) (note 1206 1205 1207 96 NOTE_INSN_DELETED) (insn 1207 1206 1208 96 (set (reg:CCFP 17 flags) (compare:CCFP (reg:SF 1209)
Re: [PATCH GCC]Fix broken Canadian when checking isl library support
On Tue, Aug 26, 2014 at 4:46 PM, Richard Biener wrote: > On Mon, Aug 25, 2014 at 11:07 PM, Sebastian Pop wrote: >> Sebastian Pop wrote: >>> Richard Biener wrote: >>> > I think it would be better to identify a set of features we rely on that >>> > are not present in earlier versions and make the test a link >>> > test unconditionally. >>> > >>> > Tobias, are there include files / types / functions we require >>> > that are not available in earlier versions? >>> >>> The version 0.12 of ISL has an include file isl/val.h that is not present in >>> previous versions of ISL. >>> >>> There also was a patch from Mircea a few weeks ago that was missing the >>> configure bits to check that the isl version contained isl/val.h. >>> I will update both patches and submit for review. >> >> I see that Mircea's patch has been committed: >> >> commit c5ec3cc336c7d42d9ad2995395d430b99a9a34cc >> Author: mircea >> Date: Mon Aug 11 15:05:48 2014 + >> >> Replacement of isl_int by isl_val >> >> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213816 >> 138bc75d-0d04-0410-961f-82ee72b054a4 >> >> Attached a patch to check for isl/val.h instead of ISL's release number. >> >> Bootstrapping on x86-64. Ok to commit? > > Ok. I suppose the "checking for version 0.12 of ISL" is now slightly > misleading - maybe change it to "checking for compatible ISL"? Is the interface between isl/gcc stable enough? If it's not, the work "compatible" is definitely confusing for users who don't know isl like me. If it is stable, it won't be a problem. Thanks, bin > > Thanks, > Richard. > >> Thanks, >> Sebastian
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
Hi, On 08/26/2014 10:56 AM, Rainer Orth wrote: bits/c++config... Which won't help users seeing them in the headers. Maybe the issue could be avoided by chosing names that make it clear that they are g++/libstdc++ specific, not generic? Sure, whatever works, the names were tentative, for the cpp idea. Paolo.
Re: [PATCH, Fortran] PR fortran/60414 fix ICE was: PR 60414: Patch proposal
Hi, On Sun, 17 Aug 2014 15:06:02 +0200 Mikael Morin wrote: > Le 17/08/2014 14:26, Dominique Dhumieres a écrit : > > As Mikael said in https://gcc.gnu.org/ml/fortran/2014-08/msg00047.html > > > >> the testcase should check that the code generated is actually working, > >> not just that the ICE disappeared. ... > > > Well, this is for another patch where deferred character variable are > made acceptable as argument to unlimited polymorphic dummies. > Here the ICE comes (if I remember correctly) from the wrong generic > procedure being picked, so there is not really some new feature enabled > with the patch. This is correct so far. > > > thus I think the test should be run, i.e., '! { dg-do compile }' should > > be replaced with '! { dg-do run }' (I have checked that the test succeeds). > > > I don't have a strong opinion for it, but I'm OK with that change. > In fact the initial test was a run one, and it has been changed to > compile. Andre: why? I was asked to move to compile only, because a run test takes a lot of time. I was told that the run test compiles the code multiple times with different optimization. This issue was deemed to be solely on the compile stage and was not influenced by optimization. Therefore I agreed to switch to dg-do compile. That the test is fine for running, too, is merely for my training of how to do that. My opinion is, that dg-do compile is sufficient to prove, that PR60414 is resolved, because that is the sole purpose of the patch. I understand Dominique wanting to have the dg-do run, because the effectiveness of the patch is only shown on running the test. Is there a compromise of running a test, but only for one optimization stage? Then may be we can do that. - Andre -- Andre Vehreschild * Email: vehre ad gmx dot de
[PATCH][match-and-simplify] Introduce (with { .. } op), combine conversions
The following patch introduces a new syntax to initialize temporaries used in c-exprs (such as if conditionals). So a simplify pattern is now 'simplify' [ ] with = | | = '(' 'if' '(' ')' ')' = '(' 'with' '{' '}' ')' which allows nearly literal translation of tree-ssa-forwprop.c:combine_conversions like in the patch below. Code generation is shared with ifs which makes the patch simple but that also requires -Wno-unused-variable as we are tieing all ifexprs to the final simplify instead of placing them appropriately nested inside the decision tree (an optimization for later which requires quite some changes to the way we collect simplifiers). Bootstrap and regtest is still ongoing on x86_64-unknown-linux-gnu. Richard. 2014-08-26 Richard Biener * Makefile.in (gimple-match.o-warn): Add -Wno-unused-variable. (generic-match.o-warn): Likewise. * genmatch.c (struct if_or_with): New. (struct simplify): Change ifexpr vector to a vector of if_or_with. (dt_simplify::gen): Adjust. (parse_simplify): Parse (with {} op). * match.pd ((T1)(~(T2)X) into ~(T1)X): Move to... * match-conversions.pd: ...this new file. Implement basic conversion simplification. Index: gcc/Makefile.in === *** gcc/Makefile.in.orig2014-08-26 12:08:22.997747892 +0200 --- gcc/Makefile.in 2014-08-26 12:09:30.712743230 +0200 *** gengtype-lex.o-warn = -Wno-error *** 200,205 --- 200,207 libgcov-util.o-warn = -Wno-error libgcov-driver-tool.o-warn = -Wno-error libgcov-merge-tool.o-warn = -Wno-error + gimple-match.o-warn = -Wno-unused-variable + generic-match.o-warn = -Wno-unused-variable # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either Index: gcc/genmatch.c === *** gcc/genmatch.c.orig 2014-08-26 12:08:22.999747891 +0200 --- gcc/genmatch.c 2014-08-26 12:30:42.732655652 +0200 *** e_operation::e_operation (const char *id *** 380,389 operators->find_slot_with_hash (op, op->hashval, INSERT); } struct simplify { simplify (const char *name_, operand *match_, source_location match_location_, ! struct operand *result_, source_location result_location_, vec ifexpr_vec_ = vNULL) : name (name_), match (match_), match_location (match_location_), result (result_), result_location (result_location_), ifexpr_vec (ifexpr_vec_) {} --- 380,397 operators->find_slot_with_hash (op, op->hashval, INSERT); } + struct if_or_with { + if_or_with (operand *cexpr_, source_location location_, bool is_with_) + : location (location_), cexpr (cexpr_), is_with (is_with_) {} + source_location location; + operand *cexpr; + bool is_with; + }; + struct simplify { simplify (const char *name_, operand *match_, source_location match_location_, ! struct operand *result_, source_location result_location_, vec ifexpr_vec_ = vNULL) : name (name_), match (match_), match_location (match_location_), result (result_), result_location (result_location_), ifexpr_vec (ifexpr_vec_) {} *** struct simplify { *** 393,399 source_location match_location; struct operand *result; source_location result_location; ! vec ifexpr_vec; }; struct dt_node --- 401,407 source_location match_location; struct operand *result; source_location result_location; ! vec ifexpr_vec; }; struct dt_node *** dt_simplify::gen (FILE *f, bool gimple) *** 1705,1727 fprintf (f, "captures[%u] = %s;\n", i, indexes[i]->get_name (opname)); } if (s->ifexpr_vec != vNULL) { ! fprintf (f, "if ("); ! if (s->ifexpr_vec.length () == 1) ! s->ifexpr_vec[0]->gen_transform (f, NULL, true, 1, "type"); ! else ! // we add in LIFO order, so traverse backwards ! for (unsigned i = s->ifexpr_vec.length (); i; --i) ! { ! fprintf (f, "("); ! s->ifexpr_vec[i - 1]->gen_transform (f, NULL, true, 1, "type"); ! fprintf (f, ")"); ! if (i > 1) ! fprintf (f, "\n&& "); ! } ! fprintf (f, ")\n"); fprintf (f, "{\n"); } if (gimple) --- 1713,1762 fprintf (f, "captures[%u] = %s;\n", i, indexes[i]->get_name (opname)); } + unsigned n_braces = 0; if (s->ifexpr_vec != vNULL) { ! // we add in LIFO order, so traverse backwards ! for (int i = s->ifexpr_vec.length () - 1; i >= 0; --i) ! { ! if_or_with &w = s->ifexpr_vec[i]; ! output_line_directive (f, w.location); ! if (w.is_with) ! { ! fprintf (f
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
On 08/26/2014 04:59 AM, Paolo Carlini wrote: Hi, On 08/26/2014 10:56 AM, Rainer Orth wrote: bits/c++config... Which won't help users seeing them in the headers. Maybe the issue could be avoided by chosing names that make it clear that they are g++/libstdc++ specific, not generic? Sure, whatever works, the names were tentative, for the cpp idea. Paolo. I should have mentioned this thought. Maybe we could do something more scary like __GLIBCXX_CPLUSPLUS_98 __GLIBCXX_CPLUSPLUS_11 __GLIBCXX_CPLUSPLUS_14 so people won't use them. The __cplusplus_11 etc. look almost "standard" ;-) Ed
Re: Make string_view operations involving CharT* *not* noexcept and consistent beween string_view and string_view.tcc.
On 15/04/14 20:06 +0100, Jonathan Wakely wrote: On 29/03/14 14:54 -0400, Ed Smith-Rowland wrote: All, In string_view I botched the noexcept specification of operations like find and friends with CharT* arguments. I'm a little surprised the inconsistency between string_view and string_view.tcc didn't error. In fact, in one repo thats a little behind trunk it does. I'll continue to look after that issue separately. I'm fixing this differently, by strengthening the exception specs as Marc suggested. I haven't addressed Marc's other comments, but we should do. Tested x86_64-linux, committed to trunk. I've also committed this on the 4.9 branch, to fix PR62264 commit 5ac00aa4544a4c10c3eeadb8ca2a3ce57d9e62ce Author: Jonathan Wakely Date: Tue Apr 15 19:45:29 2014 +0100 * include/experimental/string_view: Fix inconsistent exception specs. diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view index bebeb6b..6b6588b 100644 --- a/libstdc++-v3/include/experimental/string_view +++ b/libstdc++-v3/include/experimental/string_view @@ -329,7 +329,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION find(_CharT __c, size_type __pos=0) const noexcept; size_type - find(const _CharT* __str, size_type __pos, size_type __n) const; + find(const _CharT* __str, size_type __pos, size_type __n) const noexcept; size_type find(const _CharT* __str, size_type __pos=0) const noexcept @@ -343,7 +343,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION rfind(_CharT __c, size_type __pos = npos) const noexcept; size_type - rfind(const _CharT* __str, size_type __pos, size_type __n) const; + rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept; size_type rfind(const _CharT* __str, size_type __pos = npos) const noexcept
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
On 26/08/14 07:11 -0400, Ed Smith-Rowland wrote: On 08/26/2014 04:59 AM, Paolo Carlini wrote: Hi, On 08/26/2014 10:56 AM, Rainer Orth wrote: bits/c++config... Which won't help users seeing them in the headers. Maybe the issue could be avoided by chosing names that make it clear that they are g++/libstdc++ specific, not generic? Sure, whatever works, the names were tentative, for the cpp idea. Paolo. I should have mentioned this thought. Maybe we could do something more scary like __GLIBCXX_CPLUSPLUS_98 __GLIBCXX_CPLUSPLUS_11 __GLIBCXX_CPLUSPLUS_14 If they're macros defined by the library they should start with _GLIBCXX (i.e. a single underscore). so people won't use them. The __cplusplus_11 etc. look almost "standard" ;-) Agreed.
Re: [PATCH, AArch64] Fix typo
On 15/08/14 17:24, Evandro Menezes wrote: > I tripped at a typo that goes undetected because the macro NAMED_PARAM > doesn't apply in the absence of designated initializers. > > Since struct scale_addr_mode_cost has the cost for DI, but not for QI, the > instances of struct cpu_addrcost_table are not initialized as intended due > to the different order of the structure members. > > The fix is OK, but the ChangeLog entry is not. 1) This change should be recorded in gcc/ChangeLog 2) The leading gcc/ part of the filename is then not needed 3) The text is inadequate. You need to mention the names of the objects that have been changed (generic_addrcost_table, etc in this instance) and what changed. 4) ChangeLog entries should not be included in diff format - the diff will never apply in practice and it just makes more work for the reviewers to fix things up. Put the ChangeLog data in the main body of the mail. I've fixed all that up this time and committed it as follows: gcc/ 2014-08-26 Evandro Menezes * config/arm/aarch64/aarch64.c (generic_addrcost_table): Delete qi cost; add di cost. (cortexa57_addrcost_table): Likewise. R.
[patch] Update C++11 library implementation status for 4.8 branch
Committed to the 4.8 branch. commit d926658a428654221ecbf42f431afa43abe4ac00 Author: Jonathan Wakely Date: Tue Aug 26 13:15:58 2014 +0100 * doc/xml/manual/status_cxx2011.xml: Correct status table. * doc/html/manual/*: Regenerate. diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html index 337cf81..0f51eee 100644 --- a/libstdc++-v3/doc/html/manual/abi.html +++ b/libstdc++-v3/doc/html/manual/abi.html @@ -96,7 +96,7 @@ compatible. definitions, where the version definition is the maximum for a particular release. Labels are cumulative. If a particular release is not listed, it has the same version labels as the preceding - release.This corresponds to the mapfile: gcc/libgcc-std.verGCC 3.0.0: GCC_3.0GCC 3.3.0: GCC_3.3GCC 3.3.1: GCC_3.3.1GCC 3.3.2: GCC_3.3.2GCC 3.3.4: GCC_3.3.4GCC 3.4.0: GCC_3.4GCC 3.4.2: GCC_3.4.2GCC 3.4.4: GCC_3.4.4GCC 4.0.0: GCC_4.0.0GCC 4.1.0: GCC_4.1.0GCC 4.2.0: GCC_4.2.0GCC 4.3.0: GCC_4.3.0GCC 4.4.0: GCC_4.4.0GCC 4.5.0: GCC_4.5.0GCC 4.6.0: GCC_4.6.0GCC 4.7.0: GCC_4.7.0 + release.This corresponds to the mapfile: gcc/libgcc-std.verGCC 3.0.0: GCC_3.0GCC 3.3.0: GCC_3.3GCC 3.3.1: GCC_3.3.1GCC 3.3.2: GCC_3.3.2GCC 3.3.4: GCC_3.3.4GCC 3.4.0: GCC_3.4GCC 3.4.2: GCC_3.4.2GCC 3.4.4: GCC_3.4.4GCC 4.0.0: GCC_4.0.0GCC 4.1.0: GCC_4.1.0GCC 4.2.0: GCC_4.2.0GCC 4.3.0: GCC_4.3.0GCC 4.4.0: GCC_4.4.0GCC 4.5.0: GCC_4.5.0GCC 4.6.0: GCC_4.6.0GCC 4.7.0: GCC_4.7.0GCC 4.8.0: GCC_4.8.0 Release versioning on the libstdc++.so binary, implemented in the same way as the libgcc_s.so binary above. Listed is the filename: DT_SONAME can be deduced from @@ -111,7 +111,7 @@ compatible. has the same filename and DT_SONAME as the preceding release. It is versioned as follows: -GCC 3.0.0: libstdc++.so.3.0.0GCC 3.0.1: libstdc++.so.3.0.1GCC 3.0.2: libstdc++.so.3.0.2GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)GCC 3.0.4: libstdc++.so.3.0.4GCC 3.1.0: libstdc++.so.4.0.0 (Incompatible with previous)GCC 3.1.1: libstdc++.so.4.0.1GCC 3.2.0: libstdc++.so.5.0.0 (Incompatible with previous)GCC 3.2.1: libstdc++.so.5.0.1GCC 3.2.2: libstdc++.so.5.0.2GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)GCC 3.3.0: libstdc++.so.5.0.4GCC 3.3.1: libstdc++.so.5.0.5GCC 3.4.0: libstdc++.so.6.0.0 (Incompatible with previous)GCC 3.4.1: libstdc++.so.6.0.1GCC 3.4.2: libstdc++.so.6.0.2GCC 3.4.3: libstdc++.so.6.0.3GCC 4.0.0: libstdc++.so.6.0.4GCC 4.0.1: libstdc++.so.6.0.5GCC 4.0.2: libstdc++.so.6.0.6GCC 4.0.3: libstdc++.so.6.0.7GCC 4.1.0: libstdc++.so.6.0.7GCC 4.1.1: libstdc++.so.6.0.8GCC 4.2.0: libstdc++.so.6.0.9GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)GCC 4.2.2: libstdc++.so.6.0.9GCC 4.3.0: libstdc++.so.6.0.10GCC 4.4.0: libstdc++.so.6.0.11GCC 4.4.1: libstdc++.so.6.0.12GCC 4.4.2: libstdc++.so.6.0.13GCC 4.5.0: libstdc++.so.6.0.14GCC 4.6.0: libstdc++.so.6.0.15GCC 4.6.1: libstdc++.so.6.0.16GCC 4.7.0: libstdc++.so.6.0.17GCC 4.8.0: libstdc++.so.6.0.18 +GCC 3.0.0: libstdc++.so.3.0.0GCC 3.0.1: libstdc++.so.3.0.1GCC 3.0.2: libstdc++.so.3.0.2GCC 3.0.3: libstdc++.so.3.0.2 (See Note 1)GCC 3.0.4: libstdc++.so.3.0.4GCC 3.1.0: libstdc++.so.4.0.0 (Incompatible with previous)GCC 3.1.1: libstdc++.so.4.0.1GCC 3.2.0: libstdc++.so.5.0.0 (Incompatible with previous)GCC 3.2.1: libstdc++.so.5.0.1GCC 3.2.2: libstdc++.so.5.0.2GCC 3.2.3: libstdc++.so.5.0.3 (See Note 2)GCC 3.3.0: libstdc++.so.5.0.4GCC 3.3.1: libstdc++.so.5.0.5GCC 3.4.0: libstdc++.so.6.0.0 (Incompatible with previous)GCC 3.4.1: libstdc++.so.6.0.1GCC 3.4.2: libstdc++.so.6.0.2GCC 3.4.3: libstdc++.so.6.0.3GCC 4.0.0: libstdc++.so.6.0.4GCC 4.0.1: libstdc++.so.6.0.5GCC 4.0.2: libstdc++.so.6.0.6GCC 4.0.3: libstdc++.so.6.0.7GCC 4.1.0: libstdc++.so.6.0.7GCC 4.1.1: libstdc++.so.6.0.8GCC 4.2.0: libstdc++.so.6.0.9GCC 4.2.1: libstdc++.so.6.0.9 (See Note 3)GCC 4.2.2: libstdc++.so.6.0.9GCC 4.3.0: libstdc++.so.6.0.10GCC 4.4.0: libstdc++.so.6.0.11GCC 4.4.1: libstdc++.so.6.0.12GCC 4.4.2: libstdc++.so.6.0.13GCC 4.5.0: libstdc++.so.6.0.14GCC 4.6.0: libstdc++.so.6.0.15GCC 4.6.1: libstdc++.so.6.0.16GCC 4.7.0: libstdc++.so.6.0.17GCC 4.8.0: libstdc++.so.6.0.18GCC 4.8.3: libstdc++.so.6.0.19 Note 1: Error should be libstdc++.so.3.0.3. Note 2: Not strictly required. @@ -129,7 +129,7 @@ compatible. GLIBCPP_3.2 for symbols that were introduced in the GCC 3.2.0 release.) If a particular release is not listed, it has the same version labels as the preceding release. - GCC 3.0.0: (Error, not versioned)GCC 3.0.1: (Error, not versioned)GCC 3.0.2: (Error, not versioned)GCC 3.0.3: (Error, not versioned)GCC 3.0.4: (Error, not versioned)GCC 3.1.0: GLIBCPP_3.1, CXXABI_1GCC 3.1.1: GLIBCPP_3.1, CXXABI_1GCC 3.2.0: GLIBCPP_3.2, CXXABI_1.2GCC 3.2.1: GLIBCPP_3.2.1, CXXABI_1.2GCC 3.2.2: GLIBCPP_3.2.2, CXXABI_1.2GCC 3.2.3: GLIBCPP_3.2.2, CXXABI_1.2GCC 3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1GCC 3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1GCC 3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1GCC 3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1GCC 3.4.0: GLIBCXX_3.4, CXXABI_1.3GCC 3.4.1: GLIBCXX_3.4
Re: [PATCH][ARM] Optimize copysign/copysignf for soft-float using BFI
On 29/07/14 15:49, Jiong Wang wrote: > this patch optimize copysign/copysignf for -mfloat-abi=soft on arm when BFI > instruction is available. > > before this patch, we do copysign (a, b) by three steps: >* fetch the sign bit of b to A >* fetch all non-sign bits of a to B >* or A and B > > while these three steps could be finished by one single BFI instruction. > > for example, for the following simple testcase: > > 1.c: > > float > fcopysign (float a, float b) > { >return __builtin_copysignf (a, b); > } > > before this patch > = > fcopysign: > and r1, r1, #-2147483648 > bic r0, r0, #-2147483648 > orr r0, r0, r1 > bx lr > > after this patch > === > fcopysign: > bfi r1, r0, #0, #31 > mov r0, r1 > bx lr > > at least one instruction could be saved. > > test done > === > no regression on the full toolchain test on arm-none-eabi. > > > ok to install? Hmm, I think this is wrong for DF mode. The principle the patch works on is by tying the output to the value containing the sign bit, and then copying the rest of the other value into that value. However, for DF mode it only copies 31 of the 63 bits needed; the least significant 32 bits of the mantissa are not copied over. R. > > thanks. > > 2014-07-29 Jiong Wang > 2014-07-29 Renlin Li > > gcc/ >* config/arm/iterators.md (SFDF): New mode iterator. >(fp_high): New mode attribute. >* config/arm/unspecs.md (UNSPEC_BFM): New UNSPEC. >* config/arm/arm.md (copysign3): New define_insn for copysign. > > gcc/testsuite/ >* gcc.target/arm/copysign.c: New case for copysign/copysignf soft-float > opt. > > > opt-copysign.patch > > > commit 3b29b02cb4b525302179dde9e32528354040a2cb > Author: Jiong Wang > Date: Tue Jul 15 17:09:21 2014 +0100 > > [ARM] Optimize copysign/copysignf. > > diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md > index 6ae240e..4244043 100644 > --- a/gcc/config/arm/arm.md > +++ b/gcc/config/arm/arm.md > @@ -11106,6 +11106,19 @@ >[(set_attr "predicable" "yes")] > ) > > +(define_insn "copysign3" > + [(set (match_operand:SFDF 0 "register_operand" "=r") > + (unspec:SFDF [(match_operand:SFDF 1 "register_operand" "r") > + (match_operand:SFDF 2 "register_operand" "0")] > + UNSPEC_BFM))] > + "TARGET_SOFT_FLOAT && arm_arch_thumb2" > + "bfi\t%0, %1, #0, #31" > + [(set_attr "length" "4") > + (set_attr "predicable" "yes") > + (set_attr "predicable_short_it" "no") > + (set_attr "type" "bfm")] > +) > + > ;; Vector bits common to IWMMXT and Neon > (include "vec-common.md") > ;; Load the Intel Wireless Multimedia Extension patterns > diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md > index 6fe6eef..d9de55a 100644 > --- a/gcc/config/arm/iterators.md > +++ b/gcc/config/arm/iterators.md > @@ -42,6 +42,9 @@ > ;; A list of the 32bit and 64bit integer modes > (define_mode_iterator SIDI [SI DI]) > > +;; A list of the 32bit and 64bit float modes > +(define_mode_iterator SFDF [SF DF]) > + > ;; A list of modes which the VFP unit can handle > (define_mode_iterator SDF [(SF "TARGET_VFP") (DF "TARGET_VFP_DOUBLE")]) > > @@ -497,6 +500,8 @@ > (DI "") (V2DI "_q") > (DF "") (V2DF "_q")]) > > +(define_mode_attr fp_high [(SF "") (DF "R")]) > + > > ;; > ;; Code attributes > > ;; > diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md > index 147cb80..94dc578 100644 > --- a/gcc/config/arm/unspecs.md > +++ b/gcc/config/arm/unspecs.md > @@ -62,6 +62,7 @@ > ; a given symbolic address. >UNSPEC_THUMB1_CASESI ; A Thumb1 compressed dispatch-table call. >UNSPEC_RBIT ; rbit operation. > + UNSPEC_BFM; bfm operation. >UNSPEC_SYMBOL_OFFSET ; The offset of the start of the symbol from > ; another symbolic address. >UNSPEC_MEMORY_BARRIER ; Represent a memory barrier. > diff --git a/gcc/testsuite/gcc.target/arm/copysign.c > b/gcc/testsuite/gcc.target/arm/copysign.c > new file mode 100644 > index 000..7ec2068 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/arm/copysign.c > @@ -0,0 +1,18 @@ > +/* { dg-do compile } */ > +/* { dg-skip-if "skip override" { *-*-* } { "-mfloat-abi=softfp" > "-mfloat-abi=hard" } { "" } } */ > +/* { dg-options "-O2 -march=armv7-a -mfloat-abi=soft" } */ > + > +float > +fcopysign (float a, float b) > +{ > + return __builtin_copysignf (a, b); > +} > + > +double > +dcopysign (double a, double b) > +{ > + return __builtin_copysign (a, b); > +} > + > +/* { dg-final { scan-assembler-times "bfi" 2 } } */ > +/* { dg-final { scan-assembler-not "orr" } } */ >
Re: [RTL, i386] Use subreg instead of UNSPEC_CAST
Ping? On Sat, 26 Jul 2014, Marc Glisse wrote: Hello, any comment on this patch? https://gcc.gnu.org/ml/gcc-patches/2014-06/msg00769.html On Tue, 10 Jun 2014, Marc Glisse wrote: On Tue, 19 Mar 2013, Richard Henderson wrote: I'm not fond of this, primarily because I believe the pattern should not exist at all. One year later, new try. Tweaking the pattern, I ended up with a copy of the mov pattern (the subreg is generated automatically when the modes don't match), so I just removed it. I know the comment in emit-rtl.c says splitters are a better way forward than subregs, but I haven't managed with splitters while the subreg patch is very simple :-) I added a -O0 testcase because when I was experimenting I had many versions that worked for -O2 but ICEd at -O0 (and vice versa), but it might be redundant with some other tests. Bootstrap+testsuite on x86_64-linux-gnu. 2014-06-10 Marc Glisse PR target/50829 gcc/ * config/i386/sse.md (enum unspec): Remove UNSPEC_CAST. (avx__): Remove. * config/i386/i386.c (builtin_description) [__builtin_ia32_si256_si, __builtin_ia32_ps256_ps, __builtin_ia32_pd256_pd]: Replace the removed insn with mov. * emit-rtl.c (validate_subreg): Allow vector-vector subregs. gcc/testsuite/ * gcc.target/i386/pr50829-1.c: New file. * gcc.target/i386/pr50829-2.c: New file. -- Marc Glisse
Re: [PATCH 3/4] aarch64: Tidy prologue local variables
On 22/08/14 23:05, Richard Henderson wrote: Don't continually re-read data from cfun->machine. * config/aarch64/aarch64.c (aarch64_expand_prologue): Load cfun->machine->frame.hard_fp_offset into a local variable. --- gcc/config/aarch64/aarch64.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index dcca446..c890773 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -2194,18 +2194,18 @@ aarch64_expand_prologue (void) */ HOST_WIDE_INT frame_size, offset; HOST_WIDE_INT fp_offset;/* Offset from hard FP to SP. */ + HOST_WIDE_INT hard_fp_offset; rtx insn; aarch64_layout_frame (); - if (flag_stack_usage_info) -current_function_static_stack_size = cfun->machine->frame.frame_size; - frame_size = cfun->machine->frame.frame_size; - offset = cfun->machine->frame.frame_size; + hard_fp_offset = cfun->machine->frame.hard_fp_offset; + offset = frame_size; + fp_offset = frame_size - hard_fp_offset; there is a field "hardfp_offset" in aarch64_frame, and I think that field is not used and not initialized correctly. how about hoisting the calculation to aarch64_layout_frame to avoid duplicated calcuation here and there, something like: cfun->machine->frame.hardfp_offset = (cfun->machine->frame.frame_size- cfun->machine->frame.hard_fp_offset); then use it directly in expand_epilogue: fp_offset = cfun->machine->frame.hardfp_offset; -- Jiong - fp_offset = cfun->machine->frame.frame_size - - cfun->machine->frame.hard_fp_offset; + if (flag_stack_usage_info) +current_function_static_stack_size = frame_size; /* Store pairs and load pairs have a range only -512 to 504. */ if (offset >= 512) @@ -2216,7 +2216,7 @@ aarch64_expand_prologue (void) register area. This will allow the pre-index write-back store pair instructions to be used for setting up the stack frame efficiently. */ - offset = cfun->machine->frame.hard_fp_offset; + offset = hard_fp_offset; if (offset >= 512) offset = cfun->machine->frame.saved_regs_size;
Re: [PATCH 1/2, x86] Add palignr support for AVX2.
That is covered by a separate part of the patch: (make check and bootstrap passed: 2 new passes for core-avx2) is it ok? diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index d6155cf..68ee65a 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -81,6 +81,7 @@ ;; For AVX2 support UNSPEC_VPERMVAR UNSPEC_VPERMTI + UNSPEC_VPALIGNRDI UNSPEC_GATHER UNSPEC_VSIBADDR @@ -14167,6 +14168,19 @@ (set_attr "prefix" "vex") (set_attr "mode" "OI")]) +(define_insn "avx2_palignrv4di" + [(set (match_operand:V4DI 0 "register_operand" "=x") + (unspec:V4DI + [(match_operand:V4DI 1 "register_operand" "x") + (match_operand:V4DI 2 "nonimmediate_operand" "xm") + (match_operand:SI 3 "const_0_to_255_operand" "n")] + UNSPEC_VPALIGNRDI))] + "TARGET_AVX2" + "vpalignr\t{%3, %2, %1, %0|%0, %1, %2, %3}" + [(set_attr "type" "sselog") + (set_attr "prefix" "vex") + (set_attr "mode" "OI")]) + (define_insn "avx2_vec_dupv4df" [(set (match_operand:V4DF 0 "register_operand" "=x") (vec_duplicate:V4DF @@ -14658,6 +14672,49 @@ (set_attr "length_immediate" "1") (set_attr "prefix" "orig,vex")]) +(define_insn_and_split "avx2_rotate_perm" + [(set (match_operand:V_256 0 "register_operand" "=&x") + (vec_select:V_256 + (match_operand:V_256 1 "register_operand" "x") + (match_parallel 2 "palignr_operand" + [(match_operand 3 "const_int_operand" "n")])))] + "TARGET_AVX2" + "#" + "&& reload_completed" + [(const_int 0)] +{ + enum machine_mode imode = GET_MODE_INNER (mode); + int shift = INTVAL (operands[3]) * GET_MODE_SIZE (imode); + rtx op0 = gen_rtx_REG (V4DImode, REGNO (operands[0])); + rtx op1 = gen_rtx_REG (V4DImode, REGNO (operands[1])); + + if (shift == 0) +emit_move_insn (operands[0], operands[1]); + else +{ + emit_insn (gen_avx2_permv2ti (op0, + op1, + op1, + GEN_INT (33))); + if (shift < 16) + emit_insn (gen_avx2_palignrv4di (op0, +op0, +op1, +GEN_INT (shift))); + else if (shift > 16) + emit_insn (gen_avx2_palignrv4di (op0, +op1, +op0, +GEN_INT (shift - 16))); +} + DONE; +} + [(set_attr "type" "sseishft") + (set_attr "prefix_extra" "1") + (set_attr "length_immediate" "1") + (set_attr "prefix" "vex")]) + + (define_expand "avx_vinsertf128" [(match_operand:V_256 0 "register_operand") (match_operand:V_256 1 "register_operand") The test case covering this is "gcc.target/i386/pr52252-atom.c". It will pass for "-march=core-avx2" when the patch committed. On Thu, Aug 14, 2014 at 6:55 PM, H.J. Lu wrote: > On Thu, Aug 14, 2014 at 1:08 AM, Evgeny Stupachenko > wrote: >> Ping. >> >> On Thu, Jul 10, 2014 at 7:29 PM, Evgeny Stupachenko >> wrote: >>> On Mon, Jul 7, 2014 at 6:40 PM, Richard Henderson wrote: On 07/03/2014 02:53 AM, Evgeny Stupachenko wrote: > -expand_vec_perm_palignr (struct expand_vec_perm_d *d) > +expand_vec_perm_palignr (struct expand_vec_perm_d *d, int insn_num) insn_num might as well be "bool avx2", since it's only ever set to two values. >>> >>> Agree. However: >>> after the alignment, one operand permutation could be just move and >>> take 2 instructions for AVX2 as well >>> for AVX2 there could be other cases when the scheme takes 4 or 5 >>> instructions >>> we can leave it for potential avx512 extension >>> > - /* Even with AVX, palignr only operates on 128-bit vectors. */ > - if (!TARGET_SSSE3 || GET_MODE_SIZE (d->vmode) != 16) > + /* SSSE3 is required to apply PALIGNR on 16 bytes operands. */ > + if (GET_MODE_SIZE (d->vmode) == 16) > +{ > + if (!TARGET_SSSE3) > + return false; > +} > + /* AVX2 is required to apply PALIGNR on 32 bytes operands. */ > + else if (GET_MODE_SIZE (d->vmode) == 32) > +{ > + if (!TARGET_AVX2) > + return false; > +} > + /* Other sizes are not supported. */ > + else > return false; And you'd better check it up here because... >>> >>> Correct. The following should resolve the issue: >>> /* For AVX2 we need more than 2 instructions when the alignment >>> by itself does not produce the desired permutation. */ >>> if (TARGET_AVX2 && insn_num <= 2) >>> return false; >>> > + /* For SSSE3 we need 1 instruction for palignr plus 1 for one > + operand permutaoin. */ > + if (insn_num == 2) > +{ > + ok = expand_vec_perm_1 (&dcopy); > + gcc_assert (ok); > +} > + /* For AVX2 we need 2 instructions for the shift: vpalignr and > +
[PATCH][match-and-simplify] Sort IVOPTs iv_uses after dominator
The following is needed to allow building libada if the conversion simplifications go in. Currently IVOPTs replaces IV uses in arbitrary order which can result in intermediate code that still refers to IVs that are going to be removed. As it folds replacement statements via force_gimple_operand (which eventually folds all generated statements) the match-and-simplify process can still reach those IVs via SSA name definitions (that are eventually replaced later). The IVOPTs machinery removing unused IVs certainly doesn't expect that to happen. One option is to remove that "DCE", another is to make sure we don't reach un-replaced USEs when processing other uses which is what the patch below tries by sorting the iv_use vector after dominators (and stmt uids). Bootstrap and regtest in progress on x86_64-unknown-linux-gnu. I hope we don't run into too many other similar cases... Thanks, Richard. 2014-08-26 Richard Biener * tree-ssa-loop-ivopts.c (ivuse_cmp): New function. (rewrite_uses): Sort the vector of iv_uses after dominator order. Index: gcc/tree-ssa-loop-ivopts.c === --- gcc/tree-ssa-loop-ivopts.c (revision 214500) +++ gcc/tree-ssa-loop-ivopts.c (working copy) @@ -6526,6 +6526,30 @@ rewrite_use (struct ivopts_data *data, s update_stmt (use->stmt); } +/* Compare routine for sorting the vector of iv_uses after dominance. */ + +static int +ivuse_cmp (const void *a, const void *b) +{ + const struct iv_use *usea = *((const struct iv_use * const *)a); + const struct iv_use *useb = *((const struct iv_use * const *)b); + basic_block bba = gimple_bb (usea->stmt); + basic_block bbb = gimple_bb (useb->stmt); + if (bba == bbb) +{ + if (usea->stmt == useb->stmt) + return 0; + if (gimple_uid (usea->stmt) > gimple_uid (useb->stmt)) + return 1; + else + return -1; +} + else if (dominated_by_p (CDI_DOMINATORS, bba, bbb)) +return 1; + else +return -1; +} + /* Rewrite the uses using the selected induction variables. */ static void @@ -6535,6 +6559,9 @@ rewrite_uses (struct ivopts_data *data) struct iv_cand *cand; struct iv_use *use; + /* Sort uses so that dominating uses are processed first. */ + data->iv_uses.qsort (ivuse_cmp); + for (i = 0; i < n_iv_uses (data); i++) { use = iv_use (data, i);
Re: [PATCH]gfortran.dg/bessel_7.f90: Bump allowed precision to avoid failure on s390.
Dominik Vogt wrote: > The attached patch fixes a bessel_7 fortran test failure that appeared during > SLES 12 distro tests for s390x - by bumping the error tolerance. > > The same patch should apply to gcc-4.9 and gcc-4.8. OK. Thanks for the patch. > Please do not commit this patch; one of my colleagues with > the proper clearances needs to do that. I think it is trivial enough that a copyright assignment is not needed; in any case, Ullrich Weigand has volunteered to do the commit. Tobias
Re: [PATCH 1/4] aarch64: Improve epilogue unwind info
thanks, verified no regression on aarch64-none-elf bare-metal check-gcc/check-gdb. -- Jiong On 22/08/14 23:05, Richard Henderson wrote: Delay cfi restore opcodes until the stack frame is deallocated. This reduces the number of cfi advance opcodes required. We perform a similar optimization in the x86_64 epilogue. * config/aarch64/aarch64.c (aarch64_popwb_single_reg): Remove. (aarch64_popwb_pair_reg): Remove. (aarch64_restore_callee_saves): Add CFI_OPS argument; fill it with the restore ops performed by the insns generated. (aarch64_expand_epilogue): Attach CFI_OPS to the stack deallocation insn. Perform the calls_eh_return addition later; do not attempt to preserve the CFA in that case. Don't use aarch64_set_frame_expr. --- gcc/config/aarch64/aarch64.c | 177 +-- 1 file changed, 52 insertions(+), 125 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index c3c871e..9a11e05 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1964,23 +1964,6 @@ aarch64_pushwb_single_reg (enum machine_mode mode, unsigned regno, RTX_FRAME_RELATED_P (insn) = 1; } -static void -aarch64_popwb_single_reg (enum machine_mode mode, unsigned regno, - HOST_WIDE_INT adjustment) -{ - rtx base_rtx = stack_pointer_rtx; - rtx insn, reg, mem; - - reg = gen_rtx_REG (mode, regno); - mem = gen_rtx_POST_MODIFY (Pmode, base_rtx, -plus_constant (Pmode, base_rtx, adjustment)); - mem = gen_rtx_MEM (mode, mem); - - insn = emit_move_insn (reg, mem); - add_reg_note (insn, REG_CFA_RESTORE, reg); - RTX_FRAME_RELATED_P (insn) = 1; -} - static rtx aarch64_gen_storewb_pair (enum machine_mode mode, rtx base, rtx reg, rtx reg2, HOST_WIDE_INT adjustment) @@ -2011,7 +1994,6 @@ aarch64_pushwb_pair_reg (enum machine_mode mode, unsigned regno1, insn = emit_insn (aarch64_gen_storewb_pair (mode, stack_pointer_rtx, reg1, reg2, adjustment)); RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 2)) = 1; - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 1)) = 1; RTX_FRAME_RELATED_P (insn) = 1; } @@ -2033,29 +2015,6 @@ aarch64_gen_loadwb_pair (enum machine_mode mode, rtx base, rtx reg, rtx reg2, } } -static void -aarch64_popwb_pair_reg (enum machine_mode mode, unsigned regno1, - unsigned regno2, HOST_WIDE_INT adjustment, rtx cfa) -{ - rtx insn; - rtx reg1 = gen_rtx_REG (mode, regno1); - rtx reg2 = gen_rtx_REG (mode, regno2); - - insn = emit_insn (aarch64_gen_loadwb_pair (mode, stack_pointer_rtx, reg1, -reg2, adjustment)); - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 2)) = 1; - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 1)) = 1; - RTX_FRAME_RELATED_P (insn) = 1; - - if (cfa) -add_reg_note (insn, REG_CFA_ADJUST_CFA, - (gen_rtx_SET (Pmode, stack_pointer_rtx, - plus_constant (Pmode, cfa, adjustment; - - add_reg_note (insn, REG_CFA_RESTORE, reg1); - add_reg_note (insn, REG_CFA_RESTORE, reg2); -} - static rtx aarch64_gen_store_pair (enum machine_mode mode, rtx mem1, rtx reg1, rtx mem2, rtx reg2) @@ -2151,9 +2110,8 @@ aarch64_save_callee_saves (enum machine_mode mode, HOST_WIDE_INT start_offset, static void aarch64_restore_callee_saves (enum machine_mode mode, HOST_WIDE_INT start_offset, unsigned start, - unsigned limit, bool skip_wb) + unsigned limit, bool skip_wb, rtx *cfi_ops) { - rtx insn; rtx base_rtx = stack_pointer_rtx; rtx (*gen_mem_ref) (enum machine_mode, rtx) = (frame_pointer_needed ? gen_frame_mem : gen_rtx_MEM); @@ -2187,25 +2145,14 @@ aarch64_restore_callee_saves (enum machine_mode mode, offset = start_offset + cfun->machine->frame.reg_offset[regno2]; mem2 = gen_mem_ref (mode, plus_constant (Pmode, base_rtx, offset)); - insn = emit_insn (aarch64_gen_load_pair (mode, reg, mem, reg2, - mem2)); - add_reg_note (insn, REG_CFA_RESTORE, reg); - add_reg_note (insn, REG_CFA_RESTORE, reg2); + emit_insn (aarch64_gen_load_pair (mode, reg, mem, reg2, mem2)); - /* The first part of a frame-related parallel insn is -always assumed to be relevant to the frame -calculations; subsequent parts, are only -frame-related if explicitly marked. */ - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 1)) = 1; + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg2, *cfi_ops); regno = regno2; } else - { - insn = emit_move_insn
[PATCH][match-and-simplify] Fix some C++ testsuite FAILs
The following fixes C++ testsuite FAILs. First in fold_binary we should delay the dispatch to generic_simplify until after const OP const folding which generic_simplify isn't supposed to do. (I note that neither fold_unary nor fold_ternary has such clear const operand path...) Second, the C++ FE folds too early and some testcases expect to detect sizeof (&a) + 0 in some way (didn't look). Wrapping the result in a NON_LVALUE_EXPR works around the issue (though certainly sizeof (&a) shouldn't be considered an lvalue by maybe_lvalue_p). Full testing pending on x86_64-unknown-linux-gnu. Richard. 2014-08-26 Richard Biener * fold-const.c (fold_binary_loc): Move dispatch to generic_simplfy after folding of operations on two constants. * match-constant-folding.pd (x + 0 -> x): Wrap result in a NON_LVALUE_EXPR to account for the C++ frontend folding too early, avoding some spurious testsuite FAILs. Index: gcc/fold-const.c === --- gcc/fold-const.c(revision 214490) +++ gcc/fold-const.c(working copy) @@ -10068,11 +10067,6 @@ fold_binary_loc (location_t loc, && op0 != NULL_TREE && op1 != NULL_TREE); - extern tree generic_simplify (enum tree_code, tree, tree, tree); - tem = generic_simplify (code, type, op0, op1); - if (tem) -return tem; - arg0 = op0; arg1 = op1; @@ -10130,6 +10124,11 @@ fold_binary_loc (location_t loc, } } + extern tree generic_simplify (enum tree_code, tree, tree, tree); + tem = generic_simplify (code, type, op0, op1); + if (tem) +return tem; + /* If this is a commutative operation, and ARG0 is a constant, move it to ARG1 to reduce the number of tests below. */ if (commutative_tree_code (code) Index: gcc/match-constant-folding.pd === --- gcc/match-constant-folding.pd (revision 214490) +++ gcc/match-constant-folding.pd (working copy) @@ -20,7 +20,17 @@ along with GCC; see the file COPYING3. (for op in plus pointer_plus minus bit_ior bit_xor (simplify (op @0 integer_zerop) -@0)) +#if GENERIC +/* ??? fold_binary adds non_lvalue here and "fixes" the C++ + run of Wsizeof-pointer-memaccess1.c, preserving enough of + sizeof (&a) + 0 because sizeof (&a) is maybe_lvalue_p () + for no good reason. The C frontend is fine as it doesn't + fold too early. */ +(non_lvalue @0) +#else +@0 +#endif + )) (simplify (minus @0 @0)
Re: [PATCH libstdc++ v3] - Add xmethods for std::vector and std::unique_ptr
Friendly ping. On Wed, Aug 13, 2014 at 7:50 AM, Jonathan Wakely wrote: > On 13 August 2014 14:55, Siva Chandra wrote: >> Ping. Any update on this? > > No, I haven't committed it yet, but I will get round to it. > >> On Wed, Aug 6, 2014 at 6:37 AM, Siva Chandra wrote: >>> On Wed, Aug 6, 2014 at 2:47 AM, Jonathan Wakely >>> wrote: Some GNU/Linux distros already build GDB using Python3, so they will be unable to use these xmethods. However, I think it can be committed now and fixed later. >>> >>> For the libstdc++ side, it is a very small fix (using 'print' with >>> function call syntax in one place.) I have attached a new patch which >>> has this fix. >>> OK for trunk. Do you need me to do the commit for you? >>> >>> Yes, you will need to commit it for me.
[PATCH] Fix PR62239
The following fixes PR62239 and moves strcat_chk folding to GIMPLE. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2014-08-26 Richard Biener PR middle-end/62239 * builtins.c (fold_builtin_strcat_chk): Move to gimple-fold.c. (fold_builtin_3): Do not fold strcat_chk here. * gimple-fold.c (gimple_fold_builtin_strcat_chk): Move here from builtins.c. (gimple_fold_builtin): Fold strcat_chk here. Index: gcc/gimple-fold.c === --- gcc/gimple-fold.c (revision 214500) +++ gcc/gimple-fold.c (working copy) @@ -1587,6 +1587,41 @@ gimple_fold_builtin_strcat (gimple_stmt_ return true; } +/* Fold a call to the __strcat_chk builtin FNDECL. DEST, SRC, and SIZE + are the arguments to the call. */ + +static bool +gimple_fold_builtin_strcat_chk (gimple_stmt_iterator *gsi) +{ + gimple stmt = gsi_stmt (*gsi); + tree dest = gimple_call_arg (stmt, 0); + tree src = gimple_call_arg (stmt, 1); + tree size = gimple_call_arg (stmt, 2); + tree fn; + const char *p; + + + p = c_getstr (src); + /* If the SRC parameter is "", return DEST. */ + if (p && *p == '\0') +{ + replace_call_with_value (gsi, dest); + return true; +} + + if (! tree_fits_uhwi_p (size) || ! integer_all_onesp (size)) +return false; + + /* If __builtin_strcat_chk is used, assume strcat is available. */ + fn = builtin_decl_explicit (BUILT_IN_STRCAT); + if (!fn) +return false; + + gimple repl = gimple_build_call (fn, 2, dest, src); + replace_call_with_call_and_fold (gsi, repl); + return true; +} + /* Fold a call to the fputs builtin. ARG0 and ARG1 are the arguments to the call. IGNORE is true if the value returned by the builtin will be ignored. UNLOCKED is true is true if this @@ -2569,6 +2604,8 @@ gimple_fold_builtin (gimple_stmt_iterato case BUILT_IN_SPRINTF_CHK: case BUILT_IN_VSPRINTF_CHK: return gimple_fold_builtin_sprintf_chk (gsi, DECL_FUNCTION_CODE (callee)); +case BUILT_IN_STRCAT_CHK: + return gimple_fold_builtin_strcat_chk (gsi); default:; } Index: gcc/builtins.c === --- gcc/builtins.c (revision 214500) +++ gcc/builtins.c (working copy) @@ -198,7 +198,6 @@ static void maybe_emit_chk_warning (tree static void maybe_emit_sprintf_chk_warning (tree, enum built_in_function); static void maybe_emit_free_warning (tree); static tree fold_builtin_object_size (tree, tree); -static tree fold_builtin_strcat_chk (location_t, tree, tree, tree, tree); static tree fold_builtin_strncat_chk (location_t, tree, tree, tree, tree, tree); static tree fold_builtin_printf (location_t, tree, tree, tree, bool, enum built_in_function); static tree fold_builtin_fprintf (location_t, tree, tree, tree, tree, bool, @@ -10321,9 +10320,6 @@ fold_builtin_3 (location_t loc, tree fnd case BUILT_IN_MEMCMP: return fold_builtin_memcmp (loc, arg0, arg1, arg2);; -case BUILT_IN_STRCAT_CHK: - return fold_builtin_strcat_chk (loc, fndecl, arg0, arg1, arg2); - case BUILT_IN_PRINTF_CHK: case BUILT_IN_VPRINTF_CHK: if (!validate_arg (arg0, INTEGER_TYPE) @@ -11588,37 +11584,6 @@ fold_builtin_object_size (tree ptr, tree return NULL_TREE; } -/* Fold a call to the __strcat_chk builtin FNDECL. DEST, SRC, and SIZE - are the arguments to the call. */ - -static tree -fold_builtin_strcat_chk (location_t loc, tree fndecl, tree dest, -tree src, tree size) -{ - tree fn; - const char *p; - - if (!validate_arg (dest, POINTER_TYPE) - || !validate_arg (src, POINTER_TYPE) - || !validate_arg (size, INTEGER_TYPE)) -return NULL_TREE; - - p = c_getstr (src); - /* If the SRC parameter is "", return DEST. */ - if (p && *p == '\0') -return omit_one_operand_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest, src); - - if (! tree_fits_uhwi_p (size) || ! integer_all_onesp (size)) -return NULL_TREE; - - /* If __builtin_strcat_chk is used, assume strcat is available. */ - fn = builtin_decl_explicit (BUILT_IN_STRCAT); - if (!fn) -return NULL_TREE; - - return build_call_expr_loc (loc, fn, 2, dest, src); -} - /* Fold a call to the __strncat_chk builtin with arguments DEST, SRC, LEN, and SIZE. */
[PATCH] Fix -Wlogical-not-parentheses warning in sel-sched-ir.c (PR c/61271)
Another wrongdoing detected by -Wlogical-not-parentheses. From my reading of the code it seems that simple "!=" was meant here. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-08-26 Marek Polacek PR c/61271 * sel-sched-ir.c (make_regions_from_the_rest): Fix condition. diff --git gcc/sel-sched-ir.c gcc/sel-sched-ir.c index c36658f..dd777fa 100644 --- gcc/sel-sched-ir.c +++ gcc/sel-sched-ir.c @@ -6185,7 +6185,7 @@ make_regions_from_the_rest (void) FOR_EACH_BB_FN (bb, cfun) { - if (bb->loop_father && !bb->loop_father->num == 0 + if (bb->loop_father && bb->loop_father->num != 0 && !(bb->flags & BB_IRREDUCIBLE_LOOP)) loop_hdr[bb->index] = bb->loop_father->num; } Marek
Re: [PATCH] Fix -Wlogical-not-parentheses warning in sel-sched-ir.c (PR c/61271)
On 26.08.2014 18:03, Marek Polacek wrote: Another wrongdoing detected by -Wlogical-not-parentheses. From my reading of the code it seems that simple "!=" was meant here. Bootstrapped/regtested on x86_64-linux, ok for trunk? OK. Heck, we traced this code back to the May 2007 commit :) Andrey 2014-08-26 Marek Polacek PR c/61271 * sel-sched-ir.c (make_regions_from_the_rest): Fix condition. diff --git gcc/sel-sched-ir.c gcc/sel-sched-ir.c index c36658f..dd777fa 100644 --- gcc/sel-sched-ir.c +++ gcc/sel-sched-ir.c @@ -6185,7 +6185,7 @@ make_regions_from_the_rest (void) FOR_EACH_BB_FN (bb, cfun) { - if (bb->loop_father && !bb->loop_father->num == 0 + if (bb->loop_father && bb->loop_father->num != 0 && !(bb->flags & BB_IRREDUCIBLE_LOOP)) loop_hdr[bb->index] = bb->loop_father->num; } Marek
Re: [PATCH] Fix -Wlogical-not-parentheses warning in sel-sched-ir.c (PR c/61271)
On Tue, Aug 26, 2014 at 4:16 PM, Andrey Belevantsev wrote: > On 26.08.2014 18:03, Marek Polacek wrote: >> >> Another wrongdoing detected by -Wlogical-not-parentheses. From >> my reading of the code it seems that simple "!=" was meant here. >> >> Bootstrapped/regtested on x86_64-linux, ok for trunk? > > > OK. Heck, we traced this code back to the May 2007 commit :) > > Andrey > > >> >> 2014-08-26 Marek Polacek >> >> PR c/61271 >> * sel-sched-ir.c (make_regions_from_the_rest): Fix condition. >> >> diff --git gcc/sel-sched-ir.c gcc/sel-sched-ir.c >> index c36658f..dd777fa 100644 >> --- gcc/sel-sched-ir.c >> +++ gcc/sel-sched-ir.c >> @@ -6185,7 +6185,7 @@ make_regions_from_the_rest (void) >> >> FOR_EACH_BB_FN (bb, cfun) >> { >> - if (bb->loop_father && !bb->loop_father->num == 0 >> + if (bb->loop_father && bb->loop_father->num != 0 OTOH it checked the correct thing ;) Richard. >> && !(bb->flags & BB_IRREDUCIBLE_LOOP)) >> loop_hdr[bb->index] = bb->loop_father->num; >> } >> >> Marek >> >
Re: [patch] Overload std::getline for rvalue streams
On 12/08/14 16:20 +0100, Jonathan Wakely wrote: We're missing these overloads required by C++11. Tested x86_64-linux, committed to trunk. I think this should go on the branches too, any objections? Committed to the 4.9 branch.
Re: [PATCH 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
On Aug 25, 2014, at 11:04 PM, James Clarke wrote: > So I should just take that particular check out then? Oh, yeah, I guess the is the way to fix it.
Re: Enable EBX for x86 in 32bits PIC code
On 08/26/2014 04:57 AM, Ilya Enkovich wrote: > 2014-08-26 11:49 GMT+04:00 Ilya Enkovich : >> 2014-08-25 19:08 GMT+04:00 Vladimir Makarov : >>> On 2014-08-22 8:21 AM, Ilya Enkovich wrote: Hi, On Cauldron 2014 we had a couple of talks about relaxation of ebx usage in 32bit PIC mode. It was decided that the best approach would be to not fix ebx register, use speudo register for GOT base address and let allocator do the rest. This should be similar to how clang and icc work with GOT base address. I've been working for some time on such patch and now want to share my results. The idea of the patch was very simple and included few things; 1. Set PIC_OFFSET_TABLE_REGNUM to INVALID_REGNUM to specify that we do not have any hard reg fixed for PIC. 2. Initialize pic_offset_table_rtx with a new pseudo register in the begining of a function expand. 3. Change ABI so that there is a possible implicit PIC argument for calls; pic_offset_table_rtx is used as an arg value if such implicit arg exist. Such approach worked well on small tests but trying to run some benchmarks we faced a problem with reload of address constants. The problem is that when we try to rematerialize address constant or some constant memory reference, we have to use pic_offset_table_rtx. It means we insert new usages of a speudo register and alocator cannot handle it correctly. Same problem also applies for float and vector constants. Rematerialization is not the only case causing new pic_offset_table_rtx usage. Another case is a split of some instructions using constant but not having proper constraints. E.g. pushtf pattern allows push of constant but it has to be replaced with push of memory in reload pass causing additional usage of pic_offset_table_rtx. There are two ways to fix it. The first one is to support modifications of pseudo register live range during reload and correctly allocate hard regs for its new usages (currently we have some hard reg allocated for new usage of pseudo reg but it may contain value of some other pseudo reg; thus we reveal the problem at runtime only). >>> I believe there is already code to deal with this situation. It is code for >>> risky transformations (please check flag lra_risky_transformation_p). If >>> this flag is set, next lra assign subpass is running and checking >>> correctness of assignments (e.g. checking situation when two different >>> pseudos have intersected live ranges and the same assigned hard reg. If >>> such dangerous situation is found, it is fixed). >> I tried to remove my restrictions from setup_reg_equiv and initialize >> lra_risky_transformation_p with 'true' in lra_constraints instead. I >> got only 50% pass rate for SPEC2000 on Ofast with LTO. Will search >> for fail reason. > I've looked into one of fails. There is still a problem with > allocation in reload. Here is a piece of code which uses float > constant: > > (insn 1199 1198 1200 96 (set (reg:SI 3 bx) > (reg:SI 1301 [528])) /usr/include/bits/stdlib-float.h:28 90 > {*movsi_internal} > (nil)) > (call_insn 1200 1199 1201 96 (set (reg:DF 8 st) > (call (mem:QI (symbol_ref:SI ("strtod") [flags 0x41] > ) [0 strtod S1 A8]) > (const_int 8 [0x8]))) /usr/include/bits/stdlib-float.h:28 > 661 {*call_value} > (expr_list:REG_DEAD (reg:SI 3 bx) > (expr_list:REG_CALL_DECL (symbol_ref:SI ("strtod") [flags > 0x41] ) > (expr_list:REG_EH_REGION (const_int 0 [0]) > (nil > (expr_list (use (reg:SI 3 bx)) > (expr_list:SI (use (reg:SI 3 bx)) > (expr_list:SI (use (mem/f:SI (reg/f:SI 7 sp) [0 S4 A32])) > (expr_list:SI (use (mem/f:SI (plus:SI (reg/f:SI 7 sp) > (const_int 4 [0x4])) [0 S4 A32])) > (nil)) > (insn 1201 1200 1202 96 (set (reg:DF 321 [ D.7817 ]) > (reg:DF 8 st)) /usr/include/bits/stdlib-float.h:28 128 > {*movdf_internal} > (expr_list:REG_DEAD (reg:DF 8 st) > (nil))) > (insn 1202 1201 1203 96 (set (reg:SF 322 [ D.7804 ]) > (float_truncate:SF (reg:DF 321 [ D.7817 ]))) read_arch.c:700 > 157 {*truncdfsf_fast_sse} > (expr_list:REG_DEAD (reg:DF 321 [ D.7817 ]) > (nil))) > (insn 1203 1202 1204 96 (set (mem:SF (reg/f:SI 198 [ D.7812 ]) [4 > _130->frequency+0 S4 A32]) > (reg:SF 322 [ D.7804 ])) read_arch.c:700 129 {*movsf_internal} > (nil)) > (insn 1204 1203 1205 96 (set (reg:SF 1209) > (mem/u/c:SF (plus:SI (reg:SI 1301 [528]) > (const:SI (unspec:SI [ > (symbol_ref/u:SI ("*.LC12") [flags 0x2]) > ] UNSPEC_GOTOFF))) [4 S4 A32])) > read_arch.c:701 129 {*movsf_internal} > (expr_list:REG_EQUAL (const_double:SF 0.0 [0x0.0p+0]) > (nil))
Re: PATCH: PR bootstrap/62260: Build inside source tree doesn't work with lto-plugin
On 08/26/14 02:48, Richard Biener wrote: On Mon, Aug 25, 2014 at 11:54 PM, H.J. Lu wrote: Inside lto-plugin, when $host_subdir is '.', which means GCC is configured inside source tree, gcc_build_dir is ../../$host_subdir/gcc, not ../$(host_subdir)/gcc. Tested with both in-tree and out-tree build on Linux/x86-64. OK for trunk? Ok. I wonder if it is finally time to hard-error on build-in-source-tree ... Yes ;-) jeff
[PATCH 0/3] Updated patches to eliminate need for rtx_expr_list::insn (was Re: [PATCH 221/236] Add insn method to rtx_expr_list)
On Mon, 2014-08-25 at 08:22 -0600, Jeff Law wrote: On 08/19/14 14:41, Richard Henderson wrote: > > On 08/06/2014 10:23 AM, David Malcolm wrote: > >> gcc/ > >> * rtl.h (rtx_expr_list::insn): New method. > >> --- > >> gcc/rtl.h | 9 + > >> 1 file changed, 9 insertions(+) > >> > >> diff --git a/gcc/rtl.h b/gcc/rtl.h > >> index d028be1..d5811c2 100644 > >> --- a/gcc/rtl.h > >> +++ b/gcc/rtl.h > >> @@ -414,6 +414,10 @@ public: > >> > >> /* Get at the underlying rtx. */ > >> rtx element () const; > >> + > >> + /* Get at the rtx, casting to rtx_insn *. */ > >> + rtx_insn *insn () const; > >> + > >> }; > >> > >> template <> > >> @@ -1287,6 +1291,11 @@ inline rtx rtx_expr_list::element () const > >> return XEXP (this, 0); > >> } > >> > >> +inline rtx_insn *rtx_expr_list::insn () const > >> +{ > >> + return as_a (XEXP (this, 0)); > >> +} > >> + > > > > Even with the current code base we aren't *supposed* to be putting insns > > into > > an EXPR_LIST -- that's what INSN_LIST is for. Note the horribleness with > > which > > anything doing this will have in the rtl dumps. > > > > Can we please fix these uses instead of adding this accessor? > I'd be OK with that as a follow-up. > > jeff It turned out there were two places in the tree where I was using the unloved rtx_expr_list::insn method: * nonlocal_goto_handler_labels * forced_labels. These are both currently EXPR_LIST, and both of them are set up by the patch series leading up to #221 to be rtx_expr_list. However, given that they contain CODE_LABELs and are handled as insns, presumably they should be INSN_LIST, rather than EXPR_LIST. So I had a go at cleaning this up. The first two patches take the place of patch #221, by converting them from EXPR_LIST to INSN_LIST, updating the relevant vars from rtx_expr_list * to rtx_insn_list *. The third patch is a rewrite of patch #222, using the new types. I've successfully bootstrapped each progressively on top of trunk+the relevant patches of the patch series (trunk is currently at #171, so thats #172-#220). OK for trunk? David Malcolm (3): Convert nonlocal_goto_handler_labels from an EXPR_LIST to an INSN_LIST Convert forced_labels from an EXPR_LIST to an INSN_LIST Use rtx_insn in more places in dwarf2cfi.c gcc/builtins.c | 2 +- gcc/cfgbuild.c | 8 gcc/cfgrtl.c| 6 +++--- gcc/dwarf2cfi.c | 33 + gcc/except.c| 2 +- gcc/function.h | 6 +++--- gcc/jump.c | 6 +++--- gcc/reload1.c | 12 ++-- gcc/rtl.h | 1 + gcc/rtlanal.c | 29 + gcc/stmt.c | 10 +- 11 files changed, 73 insertions(+), 42 deletions(-) -- 1.8.5.3
[PATCH 1/3] Convert nonlocal_goto_handler_labels from an EXPR_LIST to an INSN_LIST
gcc/ * function.h (struct rtl_data): Convert field "x_nonlocal_goto_handler_labels" from rtx_expr_list * to rtx_insn_list *. * rtl.h (remove_node_from_insn_list): New prototype. * builtins.c (expand_builtin): When prepending to nonlocal_goto_handler_labels, use gen_rtx_INSN_LIST rather than gen_rtx_EXPR_LIST. * cfgbuild.c (make_edges): Convert local "x" from rtx_expr_list * to rtx_insn_list *, and use its "insn" method rather than "element" method. * cfgrtl.c (delete_insn): Use new function remove_node_from_insn_list rather than remove_node_from_expr_list. (cfg_layout_initialize): Convert local "x" from rtx_expr_list * to rtx_insn_list *, and use its "insn" method rather than "element" method. * dwarf2cfi.c (create_trace_edges): Likewise for local "lab". * reload1.c (set_initial_label_offsets): Likewise for local "x". * rtlanal.c (remove_node_from_insn_list): New function, adapted from remove_node_from_expr_list. * stmt.c (expand_label): When prepending to nonlocal_goto_handler_labels, use gen_rtx_INSN_LIST rather than gen_rtx_EXPR_LIST. --- gcc/builtins.c | 2 +- gcc/cfgbuild.c | 4 ++-- gcc/cfgrtl.c| 6 +++--- gcc/dwarf2cfi.c | 4 ++-- gcc/function.h | 4 ++-- gcc/reload1.c | 6 +++--- gcc/rtl.h | 1 + gcc/rtlanal.c | 29 + gcc/stmt.c | 2 +- 9 files changed, 44 insertions(+), 14 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index e5a9b4d..5b1068e 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -6186,7 +6186,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, /* This is copied from the handling of non-local gotos. */ expand_builtin_setjmp_setup (buf_addr, label_r); nonlocal_goto_handler_labels - = gen_rtx_EXPR_LIST (VOIDmode, label_r, + = gen_rtx_INSN_LIST (VOIDmode, label_r, nonlocal_goto_handler_labels); /* ??? Do not let expand_label treat us as such since we would not want to be both on the list of non-local labels and on diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index 082f070..d7fa97a 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -337,10 +337,10 @@ make_edges (basic_block min, basic_block max, int update_p) taken, then only calls to those functions or to other nested functions that use them could possibly do nonlocal gotos. */ - for (rtx_expr_list *x = nonlocal_goto_handler_labels; + for (rtx_insn_list *x = nonlocal_goto_handler_labels; x; x = x->next ()) - make_label_edge (edge_cache, bb, x->element (), + make_label_edge (edge_cache, bb, x->insn (), EDGE_ABNORMAL | EDGE_ABNORMAL_CALL); } diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 9707c1f..d9b41e0 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -159,7 +159,7 @@ delete_insn (rtx uncast_insn) } } - remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels); + remove_node_from_insn_list (insn, &nonlocal_goto_handler_labels); } if (really_delete) @@ -4216,7 +4216,7 @@ cfg_layout_duplicate_bb (basic_block bb) void cfg_layout_initialize (unsigned int flags) { - rtx_expr_list *x; + rtx_insn_list *x; basic_block bb; /* Once bb partitioning is complete, cfg layout mode should not be @@ -4237,7 +4237,7 @@ cfg_layout_initialize (unsigned int flags) /* Make sure that the targets of non local gotos are marked. */ for (x = nonlocal_goto_handler_labels; x; x = x->next ()) { - bb = BLOCK_FOR_INSN (x->element ()); + bb = BLOCK_FOR_INSN (x->insn ()); bb->flags |= BB_NON_LOCAL_GOTO_TARGET; } diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 2452824..7c495e4 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2338,10 +2338,10 @@ create_trace_edges (rtx insn) /* Process non-local goto edges. */ if (can_nonlocal_goto (insn)) - for (rtx_expr_list *lab = nonlocal_goto_handler_labels; + for (rtx_insn_list *lab = nonlocal_goto_handler_labels; lab; lab = lab->next ()) - maybe_record_trace_start_abnormal (lab->element (), insn); + maybe_record_trace_start_abnormal (lab->insn (), insn); } else if (rtx_sequence *seq = dyn_cast (PATTERN (insn))) { diff --git a/gcc/function.h b/gcc/function.h index c2e0366..3921d21 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -264,9 +264,9 @@ struct GTY(()) rtl_data { Used for detecting stack clobbers. */ tree stack_protect_guard; - /* List (chain of EXPR_LIST) of labels heading the current handlers for + /*
[PATCH 2/3] Convert forced_labels from an EXPR_LIST to an INSN_LIST
gcc/ * function.h (struct expr_status): Convert field "x_forced_labels" from rtx_expr_list * to rtx_insn_list *. * cfgbuild.c (make_edges): Convert local "x" from an rtx_expr_list * to an rtx_insn_list *, replacing use of "element" method with "insn" method. * dwarf2cfi.c (create_trace_edges): Likewise for local "lab". * except.c (sjlj_emit_dispatch_table): Replace use of gen_rtx_EXPR_LIST with gen_rtx_INSN_LIST when prepending to forced_labels. * jump.c (rebuild_jump_labels_1): Convert local "insn" from an rtx_expr_list * to an rtx_insn_list *, replacing use of "element" method with "insn" method. * reload1.c (set_initial_label_offsets): Likewise for local "x". * stmt.c (label_rtx): Strengthen local "ref" from rtx to rtx_insn *, adding a checked cast. Replace use of gen_rtx_EXPR_LIST with gen_rtx_INSN_LIST when prepending it to forced_labels. (expand_label): Likewise for local "label_r". --- gcc/cfgbuild.c | 4 ++-- gcc/dwarf2cfi.c | 4 ++-- gcc/except.c| 2 +- gcc/function.h | 2 +- gcc/jump.c | 6 +++--- gcc/reload1.c | 6 +++--- gcc/stmt.c | 8 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index d7fa97a..475739d 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -284,8 +284,8 @@ make_edges (basic_block min, basic_block max, int update_p) everything on the forced_labels list. */ else if (computed_jump_p (insn)) { - for (rtx_expr_list *x = forced_labels; x; x = x->next ()) - make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL); + for (rtx_insn_list *x = forced_labels; x; x = x->next ()) + make_label_edge (edge_cache, bb, x->insn (), EDGE_ABNORMAL); } /* Returns create an exit out. */ diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 7c495e4..8b00b1e 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2309,8 +2309,8 @@ create_trace_edges (rtx insn) } else if (computed_jump_p (insn)) { - for (rtx_expr_list *lab = forced_labels; lab; lab = lab->next ()) - maybe_record_trace_start (lab->element (), insn); + for (rtx_insn_list *lab = forced_labels; lab; lab = lab->next ()) + maybe_record_trace_start (lab->insn (), insn); } else if (returnjump_p (insn)) ; diff --git a/gcc/except.c b/gcc/except.c index 05da989..99a66a0 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1310,7 +1310,7 @@ sjlj_emit_dispatch_table (rtx_code_label *dispatch_label, int num_dispatch) CFG edges more exactly, we can use the forced_labels list instead. */ LABEL_PRESERVE_P (dispatch_label) = 1; forced_labels -= gen_rtx_EXPR_LIST (VOIDmode, dispatch_label, forced_labels); += gen_rtx_INSN_LIST (VOIDmode, dispatch_label, forced_labels); #endif /* Load up exc_ptr and filter values from the function context. */ diff --git a/gcc/function.h b/gcc/function.h index 3921d21..071f5dd 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -135,7 +135,7 @@ struct GTY(()) expr_status { rtx x_apply_args_value; /* List of labels that must never be deleted. */ - rtx_expr_list *x_forced_labels; + rtx_insn_list *x_forced_labels; }; typedef struct call_site_record_d *call_site_record; diff --git a/gcc/jump.c b/gcc/jump.c index b8d3d52..3529ed6 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -74,7 +74,7 @@ static int returnjump_p_1 (rtx *, void *); static void rebuild_jump_labels_1 (rtx_insn *f, bool count_forced) { - rtx_expr_list *insn; + rtx_insn_list *insn; timevar_push (TV_REBUILD_JUMP); init_label_info (f); @@ -86,8 +86,8 @@ rebuild_jump_labels_1 (rtx_insn *f, bool count_forced) if (count_forced) for (insn = forced_labels; insn; insn = insn->next ()) - if (LABEL_P (insn->element ())) - LABEL_NUSES (insn->element ())++; + if (LABEL_P (insn->insn ())) + LABEL_NUSES (insn->insn ())++; timevar_pop (TV_REBUILD_JUMP); } diff --git a/gcc/reload1.c b/gcc/reload1.c index 419940e..77ec6ac 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3911,9 +3911,9 @@ set_initial_label_offsets (void) { memset (offsets_known_at, 0, num_labels); - for (rtx_expr_list *x = forced_labels; x; x = x->next ()) -if (x->element ()) - set_label_offsets (x->element (), NULL, 1); + for (rtx_insn_list *x = forced_labels; x; x = x->next ()) +if (x->insn ()) + set_label_offsets (x->insn (), NULL, 1); for (rtx_insn_list *x = nonlocal_goto_handler_labels; x; x = x->next ()) if (x->insn ()) diff --git a/gcc/stmt.c b/gcc/stmt.c index 1cbd63d..70dad0c 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -141,12 +141,12 @@ label_rtx (tree label) rtx force_label_rtx (tree label) { - rtx ref = label_rtx (label); + rtx_insn *ref = as_a (label_rtx (label
[PATCH 3/3] Use rtx_insn in more places in dwarf2cfi.c
gcc/ * dwarf2cfi.c (dw_trace_info): Strengthen field "head" from rtx to rtx_insn *. (get_trace_info): Likewise for param "insn". (save_point_p): Likewise. (maybe_record_trace_start): Likewise for both params. (maybe_record_trace_start_abnormal): Likewise. (create_trace_edges): Likewise for sole param and for three of the locals named "lab". (scan_trace): Strengthen local "prev", "insn", "control" from rtx to rtx_insn *, and update a call to pat->element to pat->insn. --- gcc/dwarf2cfi.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 8b00b1e..e3fb078 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -100,7 +100,7 @@ typedef struct GTY(()) reg_saved_in_data_struct { typedef struct { /* The insn that begins the trace. */ - rtx head; + rtx_insn *head; /* The row state at the beginning and end of the trace. */ dw_cfi_row *beg_row, *end_row; @@ -303,7 +303,7 @@ expand_builtin_init_dwarf_reg_sizes (tree address) static dw_trace_info * -get_trace_info (rtx insn) +get_trace_info (rtx_insn *insn) { dw_trace_info dummy; dummy.head = insn; @@ -311,7 +311,7 @@ get_trace_info (rtx insn) } static bool -save_point_p (rtx insn) +save_point_p (rtx_insn *insn) { /* Labels, except those that are really jump tables. */ if (LABEL_P (insn)) @@ -2197,7 +2197,7 @@ add_cfis_to_fde (void) trace from CUR_TRACE and CUR_ROW. */ static void -maybe_record_trace_start (rtx start, rtx origin) +maybe_record_trace_start (rtx_insn *start, rtx_insn *origin) { dw_trace_info *ti; HOST_WIDE_INT args_size; @@ -2248,7 +2248,7 @@ maybe_record_trace_start (rtx start, rtx origin) and non-local goto edges. */ static void -maybe_record_trace_start_abnormal (rtx start, rtx origin) +maybe_record_trace_start_abnormal (rtx_insn *start, rtx_insn *origin) { HOST_WIDE_INT save_args_size, delta; dw_cfa_location save_cfa; @@ -2284,7 +2284,7 @@ maybe_record_trace_start_abnormal (rtx start, rtx origin) /* ??? Sadly, this is in large part a duplicate of make_edges. */ static void -create_trace_edges (rtx insn) +create_trace_edges (rtx_insn *insn) { rtx tmp; int i, n; @@ -2303,7 +2303,7 @@ create_trace_edges (rtx insn) n = GET_NUM_ELEM (vec); for (i = 0; i < n; ++i) { - rtx lab = XEXP (RTVEC_ELT (vec, i), 0); + rtx_insn *lab = as_a (XEXP (RTVEC_ELT (vec, i), 0)); maybe_record_trace_start (lab, insn); } } @@ -2319,13 +2319,14 @@ create_trace_edges (rtx insn) n = ASM_OPERANDS_LABEL_LENGTH (tmp); for (i = 0; i < n; ++i) { - rtx lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0); + rtx_insn *lab = + as_a (XEXP (ASM_OPERANDS_LABEL (tmp, i), 0)); maybe_record_trace_start (lab, insn); } } else { - rtx lab = JUMP_LABEL (insn); + rtx_insn *lab = JUMP_LABEL_AS_INSN (insn); gcc_assert (lab != NULL); maybe_record_trace_start (lab, insn); } @@ -2376,7 +2377,7 @@ scan_insn_after (rtx insn) static void scan_trace (dw_trace_info *trace) { - rtx prev, insn = trace->head; + rtx_insn *prev, *insn = trace->head; dw_cfa_location this_cfa; if (dump_file) @@ -2397,7 +2398,7 @@ scan_trace (dw_trace_info *trace) insn; prev = insn, insn = NEXT_INSN (insn)) { - rtx control; + rtx_insn *control; /* Do everything that happens "before" the insn. */ add_cfi_insn = prev; @@ -2427,7 +2428,7 @@ scan_trace (dw_trace_info *trace) rtx elt; int i, n = pat->len (); - control = pat->element (0); + control = pat->insn (0); if (can_throw_internal (control)) notice_eh_throw (control); dwarf2out_flush_queued_reg_saves (); -- 1.8.5.3
[PATCH v2 0/2] Fix OS X Yosemite-related issues
These patches combine to address PR target/61407, meaning that GCC is able to bootstrap on OS X 10.10 Yosemite. James Clarke (2): Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ Fixed dirent sanitizer for 32-bit OS X builds gcc/config/darwin-c.c | 25 -- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 +++ .../sanitizer_platform_limits_posix.cc | 3 ++- .../sanitizer_platform_limits_posix.h | 9 8 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c -- 2.1.0
[PATCH v2 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
Previously, this macro had taken the form 10X0, where X is the minor version number, e.g. 1090 for OS X 10.9 Mavericks. However, as of OS X 10.10 Yosemite, it should take the form 10XX00, i.e. 101000 for 10.10. Added a test for the new format and fixed the formatting for the existing ones. gcc/ChangeLog: * config/darwin-c.c (version_as_macro): Added extra 0 for OS X 10.10 and above * config/darwin-driver.c (darwin_find_version_from_kernel): Removed kernel version check to avoid incrementing it after every major OS X release gcc/testsuite/ChangeLog: * gcc.db/darwin-minversion-1.c: Fixed formatting * gcc.db/darwin-minversion-2.c: Fixed formatting * gcc.db/darwin-minversion-3.c: Fixed formatting * gcc.dg/darwin-minversion-4.c: Added test for OS X 10.10 --- gcc/config/darwin-c.c | 25 +++-- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 892ba35..7fe4b1f 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -571,21 +571,34 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp) } /* Return the value of darwin_macosx_version_min suitable for the - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, - so '10.4.2' becomes 1040. The lowest digit is always zero. + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2' + becomes 1040 and '10.10.0' becomes 101000. The lowest digit is + always zero, as is the second lowest for '10.10.x' and above. Print a warning if the version number can't be understood. */ static const char * version_as_macro (void) { - static char result[] = "1000"; + static char result[7] = "1000"; + int minorDigitIdx; if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) goto fail; if (! ISDIGIT (darwin_macosx_version_min[3])) goto fail; - result[2] = darwin_macosx_version_min[3]; - if (darwin_macosx_version_min[4] != '\0' - && darwin_macosx_version_min[4] != '.') + + minorDigitIdx = 3; + result[2] = darwin_macosx_version_min[minorDigitIdx++]; + if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx])) + { +/* Starting with OS X 10.10, the macro ends '00' rather than '0', + i.e. 10.10.x becomes 101000 rather than 10100. */ +result[3] = darwin_macosx_version_min[minorDigitIdx++]; +result[4] = '0'; +result[5] = '0'; +result[6] = '\0'; + } + if (darwin_macosx_version_min[minorDigitIdx] != '\0' + && darwin_macosx_version_min[minorDigitIdx] != '.') goto fail; return result; diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index 8b6ae93..eb478e8 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -57,8 +57,6 @@ darwin_find_version_from_kernel (char *new_flag) version_p = osversion + 1; if (ISDIGIT (*version_p)) major_vers = major_vers * 10 + (*version_p++ - '0'); - if (major_vers > 4 + 9) -goto parse_failed; if (*version_p++ != '.') goto parse_failed; version_pend = strchr(version_p, '.'); diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-1.c b/gcc/testsuite/gcc.dg/darwin-minversion-1.c index d8a3243..6221d61 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-1.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-1.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-2.c b/gcc/testsuite/gcc.dg/darwin-minversion-2.c index fd4975a..8e18d52 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-2.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-2.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-3.c b/gcc/testsuite/gcc.dg/darwin-minversion-3.c index d0c5934..4fcb969 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-3.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-3.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.4.10" } */ /* { dg-do compile { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1040 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-4.c b/gcc/testsuite/gcc.dg/darwin-minversion-4.c new file mode 100644 index 000..1cb42eb --- /dev/null +++ b/gcc/test
[PATCH v2 2/2] Fixed dirent sanitizer for 32-bit OS X builds
The __DARWIN_64_BIT_INO_T macro is used to indicate whether dirent.d_ino is 64-bit or not, and so should be sized appropriately. Additionally, dirent.d_seekoff should only be defined/checked when __DARWIN_64_BIT_INO_T is defined. libsanitizer/ChangeLog: * sanitizer_common/sanitizer_platform_limits_posix.cc: Only check dirent.d_seekoff on OS X when performing a 64-bit build. * sanitizer_common/sanitizer_platform_limits_posix.h: Only define dirent.d_seekoff on OS X when performing a 64-bit build, and make dirent.d_ino the correct size (32-bit) when performing a 32-bit build. --- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | 3 ++- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h | 9 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index a93d38d..0d1870b 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -940,7 +940,8 @@ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent)); CHECK_SIZE_AND_OFFSET(dirent, d_ino); -#if SANITIZER_MAC +#if SANITIZER_MAC && __DARWIN_64_BIT_INO_T +// The 'd_seekoff' field is only present on OS X for 64-bit builds CHECK_SIZE_AND_OFFSET(dirent, d_seekoff); #elif SANITIZER_FREEBSD // There is no 'd_off' field on FreeBSD. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index dece2d3..73a4c3f 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -392,12 +392,21 @@ namespace __sanitizer { #endif #if SANITIZER_MAC +# if __DARWIN_64_BIT_INO_T struct __sanitizer_dirent { unsigned long long d_ino; unsigned long long d_seekoff; unsigned short d_reclen; // more fields that we don't care about }; +# else + struct __sanitizer_dirent { +unsigned int d_ino; +// No d_seekoff for 32-bit +unsigned short d_reclen; +// more fields that we don't care about + }; +# endif #elif SANITIZER_FREEBSD struct __sanitizer_dirent { unsigned int d_fileno; -- 2.1.0
Re: [PATCH 1/2, x86] Add palignr support for AVX2.
On 08/26/2014 05:59 AM, Evgeny Stupachenko wrote: > +(define_insn_and_split "avx2_rotate_perm" > + [(set (match_operand:V_256 0 "register_operand" "=&x") > + (vec_select:V_256 > + (match_operand:V_256 1 "register_operand" "x") > + (match_parallel 2 "palignr_operand" > + [(match_operand 3 "const_int_operand" "n")])))] > + "TARGET_AVX2" > + "#" > + "&& reload_completed" > + [(const_int 0)] Why are you waiting until after reload to expand this? It's only the vec_select parallel that determines which direction the palignr should be done. This seems like something you could do during permutation expansion. r~
Re: [PATCH 0/3] Updated patches to eliminate need for rtx_expr_list::insn (was Re: [PATCH 221/236] Add insn method to rtx_expr_list)
On 08/26/2014 09:00 AM, David Malcolm wrote: > OK for trunk? > > David Malcolm (3): > Convert nonlocal_goto_handler_labels from an EXPR_LIST to an INSN_LIST > Convert forced_labels from an EXPR_LIST to an INSN_LIST > Use rtx_insn in more places in dwarf2cfi.c Ok to all. Thanks. r~
Re: [Patch 1/2] Don't put out a call to memcpy for volatile struct operations
On Aug 26, 2014, at 1:35 AM, Richard Biener wrote: > >> 8 The implicitly-defined copy constructor for class X performs a member- >> wise copy of its subobjects. The order of copying is the same as the >> order of initialization of bases and members in a user-defined con- >> structor (see _class.base.init_). Each subobject is copied in the >> manner appropriate to its type > > Thats quite specific ;) I think you are making fun of it, but actually, it is very specific. There are a ton of other words that back it up. For example, you might have to print Hello World for each member copied. The front end would generate calls to printf and those would be the semantics. This last case is what happens in the general case of user defined copy constructors. However, the case we care about is a narrow case when various front end specific bits are checked in the front end and we decide we can use memcpy to implement the copy or not. The bits used to make that decision are front-end bits: /* Nonzero for class type means that copy initialization of this type can use a bitwise copy. */ #define TYPE_HAS_TRIVIAL_COPY_CTOR(NODE) ... So, whenever this is true, we can use a bitwise copy (aka memcpy). This is communicated to the middle end by the primitives generated. If you want the middle end to generate the code, then this bit has to be communicated to the middle end. The problem of course, if you want the middle end to generate the printf, then more of the C++ type/oobject system would have to be communicated. > So after reading the std quotations I still think that if we want to > fix anything > here then we want to fix it in the frontends (only the C++ FE knows > init order in the details required - though I suppose the description was for > non-POD types where the FE may already do this). Yes. Or put other way, once you want to fix it in the middle end, you discover pulling on large amounts of code from the front end… This is reasonable if one wants to share with other front ends that have similar rules and semantics, but then you want cooperating front-end people to figure out what to push down and how and why. For example, we had to push exception handling down, if for no other reason, the optimizer had to be aware of it. I’ll give you a concrete case where pushing down would be beneficial. For example, there is a field in a structure that after lto optimization runs, we discover the semantics for the copy and decide then that the copy is trivial enough to do with a bitwise copy. That can be pushed up (into TYPE_HAS_TRIVIAL_COPY_CTOR), and then all decisions based upon it (TYPE_HAS_TRIVIAL_COPY_CTOR ) can be redone and further optimized. Why do this? This type of optimization removes the abstraction penalty of code and allows people to write with more abstractions and yet not pay the price for those at runtime. Not an unreasonable goal. I mention this, just so someone might be able to see why one might want to do this. I’m not arguing for it.
Re: [PATCH v2 0/2] Fix OS X Yosemite-related issues
On Aug 26, 2014, at 9:02 AM, James Clarke wrote: > These patches combine to address PR target/61407, meaning that GCC is > able to bootstrap on OS X 10.10 Yosemite. > James Clarke (2): > Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ For the first patch, Ok. So, after baking for a week, I think the first patch should go into all release branches that are open. I think the back port will be trivial and the benefit seems worthwhile. I don’t have enough state of the libsanitizer part to know what state the current and older release branches are in. Once approved for trunk, I’d approve for back port, if applicable.
Re: [PATCH 225/236] Work towards NEXT_INSN/PREV_INSN requiring insns as their params
On Mon, 2014-08-25 at 08:25 -0600, Jeff Law wrote: > On 08/19/14 15:35, David Malcolm wrote: > > On Tue, 2014-08-19 at 13:57 -0700, Richard Henderson wrote: > >> On 08/06/2014 10:23 AM, David Malcolm wrote: > >>> diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c > >>> index 59d633d..5e42a97 100644 > >>> --- a/gcc/cfgrtl.c > >>> +++ b/gcc/cfgrtl.c > >>> @@ -1604,6 +1604,7 @@ force_nonfallthru_and_redirect (edge e, basic_block > >>> target, rtx jump_label) > >>> > >>> if (EDGE_COUNT (e->src->succs) >= 2 || abnormal_edge_flags || > >>> asm_goto_edge) > >>> { > >>> + rtx_insn *note; > >>> gcov_type count = e->count; > >>> int probability = e->probability; > >>> /* Create the new structures. */ > >> > >> A new variable with no uses? > > > > This one is quite ugly: the pre-existing code has two locals named > > "note", both of type rtx, with one shadowing the other. This patch > > introduces a third, within the scope where the name "note" is used for > > insns. In the other scopes the two other "note" variables are used for > > find_reg_note. In each case, the name "note" is written to before use. > > > > So in my defense, the existing code already had shadowing of locals... > > but I guess that's not much of a defense, and it would be better to > > introduce a different name, and rename the uses in the appropriate > > scope. > If it's reasonable to do this now, then please do so. Else make it a > follow-up item. I guess we should have had a list of follow-up items :-) > > jeff Attached is a revised version of #225, with the following changes: * fix for the above: avoid introducing a new shadow name "note" within force_nonfallthru_and_redirect by introducing a new local rtx_insn * "new_head" and renaming "note" to it in the appropriate places. * changed an as_a<> to a safe_as_a<> within function.c:thread_prologue_and_epilogue_insns to fix a segfault seen during an earlier bootstrap Successfully bootstrapped on x86_64 (Fedora 20), on top of the rest of the patches leading up to it (including the revised ones for #220-#221 that rth recently approved). OK for trunk? Dave commit 57a0975899db68a31c3a8f4a554ace60e3e8fabf Author: David Malcolm Date: Wed Jul 30 20:15:49 2014 -0400 Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_ins
[PATCH v3 0/2] Fix OS X Yosemite-related issues
These patches combine to address PR target/61407, meaning that GCC is able to bootstrap on OS X Yosemite. Changes from v2: [PATCH v3 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__: * Unchanged [PATCH v3 2/2] Fixed dirent sanitizer for 32-bit OS X builds: * Switch to using the public _DARWIN_FEATURE_64_BIT_INODE macro rather than the internal __DARWIN_64_BIT_INO_T macro James Clarke (2): Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ Fixed dirent sanitizer for 32-bit OS X builds gcc/config/darwin-c.c | 25 -- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 +++ .../sanitizer_platform_limits_posix.cc | 3 ++- .../sanitizer_platform_limits_posix.h | 9 8 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c -- 2.1.0
[PATCH v3 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
Previously, this macro had taken the form 10X0, where X is the minor version number, e.g. 1090 for OS X 10.9 Mavericks. However, as of OS X 10.10 Yosemite, it should take the form 10XX00, i.e. 101000 for 10.10. Added a test for the new format and fixed the formatting for the existing ones. gcc/ChangeLog: * config/darwin-c.c (version_as_macro): Added extra 0 for OS X 10.10 and above * config/darwin-driver.c (darwin_find_version_from_kernel): Removed kernel version check to avoid incrementing it after every major OS X release gcc/testsuite/ChangeLog: * gcc.db/darwin-minversion-1.c: Fixed formatting * gcc.db/darwin-minversion-2.c: Fixed formatting * gcc.db/darwin-minversion-3.c: Fixed formatting * gcc.dg/darwin-minversion-4.c: Added test for OS X 10.10 --- gcc/config/darwin-c.c | 25 +++-- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 892ba35..7fe4b1f 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -571,21 +571,34 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp) } /* Return the value of darwin_macosx_version_min suitable for the - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, - so '10.4.2' becomes 1040. The lowest digit is always zero. + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2' + becomes 1040 and '10.10.0' becomes 101000. The lowest digit is + always zero, as is the second lowest for '10.10.x' and above. Print a warning if the version number can't be understood. */ static const char * version_as_macro (void) { - static char result[] = "1000"; + static char result[7] = "1000"; + int minorDigitIdx; if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) goto fail; if (! ISDIGIT (darwin_macosx_version_min[3])) goto fail; - result[2] = darwin_macosx_version_min[3]; - if (darwin_macosx_version_min[4] != '\0' - && darwin_macosx_version_min[4] != '.') + + minorDigitIdx = 3; + result[2] = darwin_macosx_version_min[minorDigitIdx++]; + if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx])) + { +/* Starting with OS X 10.10, the macro ends '00' rather than '0', + i.e. 10.10.x becomes 101000 rather than 10100. */ +result[3] = darwin_macosx_version_min[minorDigitIdx++]; +result[4] = '0'; +result[5] = '0'; +result[6] = '\0'; + } + if (darwin_macosx_version_min[minorDigitIdx] != '\0' + && darwin_macosx_version_min[minorDigitIdx] != '.') goto fail; return result; diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index 8b6ae93..eb478e8 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -57,8 +57,6 @@ darwin_find_version_from_kernel (char *new_flag) version_p = osversion + 1; if (ISDIGIT (*version_p)) major_vers = major_vers * 10 + (*version_p++ - '0'); - if (major_vers > 4 + 9) -goto parse_failed; if (*version_p++ != '.') goto parse_failed; version_pend = strchr(version_p, '.'); diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-1.c b/gcc/testsuite/gcc.dg/darwin-minversion-1.c index d8a3243..6221d61 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-1.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-1.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-2.c b/gcc/testsuite/gcc.dg/darwin-minversion-2.c index fd4975a..8e18d52 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-2.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-2.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-3.c b/gcc/testsuite/gcc.dg/darwin-minversion-3.c index d0c5934..4fcb969 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-3.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-3.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.4.10" } */ /* { dg-do compile { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1040 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-4.c b/gcc/testsuite/gcc.dg/darwin-minversion-4.c new file mode 100644 index 000..1cb42eb --- /dev/null +++ b/gcc/test
[PATCH v3 2/2] Fixed dirent sanitizer for 32-bit OS X builds
The _DARWIN_FEATURE_64_BIT_INODE macro indicates whether dirent.d_ino is 64-bit or not, which should be sized appropriately, and whether dirent.d_seekoff should be defined/checked. libsanitizer/ChangeLog: * sanitizer_common/sanitizer_platform_limits_posix.cc: Only check dirent.d_seekoff on OS X when performing a 64-bit build. * sanitizer_common/sanitizer_platform_limits_posix.h: Only define dirent.d_seekoff on OS X when performing a 64-bit build, and make dirent.d_ino the correct size (32-bit) when performing a 32-bit build. --- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | 3 ++- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h | 9 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index a93d38d..7ffe298 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -940,7 +940,8 @@ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent)); CHECK_SIZE_AND_OFFSET(dirent, d_ino); -#if SANITIZER_MAC +#if SANITIZER_MAC && _DARWIN_FEATURE_64_BIT_INODE +// The 'd_seekoff' field is only present on OS X for 64-bit builds CHECK_SIZE_AND_OFFSET(dirent, d_seekoff); #elif SANITIZER_FREEBSD // There is no 'd_off' field on FreeBSD. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index dece2d3..ac61fa5 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -392,12 +392,21 @@ namespace __sanitizer { #endif #if SANITIZER_MAC +# if _DARWIN_FEATURE_64_BIT_INODE struct __sanitizer_dirent { unsigned long long d_ino; unsigned long long d_seekoff; unsigned short d_reclen; // more fields that we don't care about }; +# else + struct __sanitizer_dirent { +unsigned int d_ino; +// No d_seekoff for 32-bit +unsigned short d_reclen; +// more fields that we don't care about + }; +# endif #elif SANITIZER_FREEBSD struct __sanitizer_dirent { unsigned int d_fileno; -- 2.1.0
Re: [PATCH libstdc++ v3] - Add xmethods for std::vector and std::unique_ptr
Shouldn't there be a change to python/Makefile.am so that xmethods.py gets installed alongside printers.py? Otherwise you can use these new xmethods in the libstdc++ testssuite, but they're not available to users. I'd also expect something to call the register_libstdcxx_xmethods function automatically, as in the attached patch, although this doesn't work for me. How am I expected to use these xmethods? commit 3b04eb18e94cace91cfbc2cd80c0acd0bf7d7d86 Author: Jonathan Wakely Date: Tue Aug 26 18:52:39 2014 +0100 * python/Makefile.am (nobase_python_DATA): Add xmethods.py. * python/Makefile.in: Regenerate. * python/hook.in: Load the xmethods. diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am index ac7341a..c34c860 100644 --- a/libstdc++-v3/python/Makefile.am +++ b/libstdc++-v3/python/Makefile.am @@ -33,6 +33,7 @@ all-local: gdb.py nobase_python_DATA = \ libstdcxx/v6/printers.py \ +libstdcxx/v6/xmethods.py \ libstdcxx/v6/__init__.py \ libstdcxx/__init__.py diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in index 21d74a90..7d0c8ac 100644 --- a/libstdc++-v3/python/Makefile.in +++ b/libstdc++-v3/python/Makefile.in @@ -316,6 +316,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) @ENABLE_PYTHONDIR_TRUE@pythondir = $(prefix)/$(python_mod_dir) nobase_python_DATA = \ libstdcxx/v6/printers.py \ +libstdcxx/v6/xmethods.py \ libstdcxx/v6/__init__.py \ libstdcxx/__init__.py diff --git a/libstdc++-v3/python/hook.in b/libstdc++-v3/python/hook.in index 3620523..29c0f3c 100644 --- a/libstdc++-v3/python/hook.in +++ b/libstdc++-v3/python/hook.in @@ -58,3 +58,8 @@ if gdb.current_objfile () is not None: # Load the pretty-printers. from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (gdb.current_objfile ()) + +if hasattr(gdb, 'xmethod'): +# Load the xmethods +from libstdcxx.v6.xmethods import register_libstdcxx_xmethods +register_libstdcxx_xmethods (gdb.current_objfile ())
[PATCH v4 0/2] Fix OS X Yosemite-related issues
These patches combine to address PR target/61407, meaning that GCC is able to bootstrap on OS X Yosemite. Changes from v3: [PATCH v4 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__: * Unchanged [PATCH v4 2/2] Fixed dirent sanitizer for 32-bit OS X builds: * Check whether the _DARWIN_FEATURE_64_BIT_INODE macro is defined rather than its value James Clarke (2): Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ Fixed dirent sanitizer for 32-bit OS X builds gcc/config/darwin-c.c | 25 -- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 +++ .../sanitizer_platform_limits_posix.cc | 3 ++- .../sanitizer_platform_limits_posix.h | 9 8 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c -- 2.1.0
[PATCH v4 1/2] Fix __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
Previously, this macro had taken the form 10X0, where X is the minor version number, e.g. 1090 for OS X 10.9 Mavericks. However, as of OS X 10.10 Yosemite, it should take the form 10XX00, i.e. 101000 for 10.10. Added a test for the new format and fixed the formatting for the existing ones. gcc/ChangeLog: * config/darwin-c.c (version_as_macro): Added extra 0 for OS X 10.10 and above * config/darwin-driver.c (darwin_find_version_from_kernel): Removed kernel version check to avoid incrementing it after every major OS X release gcc/testsuite/ChangeLog: * gcc.db/darwin-minversion-1.c: Fixed formatting * gcc.db/darwin-minversion-2.c: Fixed formatting * gcc.db/darwin-minversion-3.c: Fixed formatting * gcc.dg/darwin-minversion-4.c: Added test for OS X 10.10 --- gcc/config/darwin-c.c | 25 +++-- gcc/config/darwin-driver.c | 2 -- gcc/testsuite/gcc.dg/darwin-minversion-1.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-2.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-3.c | 3 ++- gcc/testsuite/gcc.dg/darwin-minversion-4.c | 12 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-minversion-4.c diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index 892ba35..7fe4b1f 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -571,21 +571,34 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp) } /* Return the value of darwin_macosx_version_min suitable for the - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, - so '10.4.2' becomes 1040. The lowest digit is always zero. + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2' + becomes 1040 and '10.10.0' becomes 101000. The lowest digit is + always zero, as is the second lowest for '10.10.x' and above. Print a warning if the version number can't be understood. */ static const char * version_as_macro (void) { - static char result[] = "1000"; + static char result[7] = "1000"; + int minorDigitIdx; if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) goto fail; if (! ISDIGIT (darwin_macosx_version_min[3])) goto fail; - result[2] = darwin_macosx_version_min[3]; - if (darwin_macosx_version_min[4] != '\0' - && darwin_macosx_version_min[4] != '.') + + minorDigitIdx = 3; + result[2] = darwin_macosx_version_min[minorDigitIdx++]; + if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx])) + { +/* Starting with OS X 10.10, the macro ends '00' rather than '0', + i.e. 10.10.x becomes 101000 rather than 10100. */ +result[3] = darwin_macosx_version_min[minorDigitIdx++]; +result[4] = '0'; +result[5] = '0'; +result[6] = '\0'; + } + if (darwin_macosx_version_min[minorDigitIdx] != '\0' + && darwin_macosx_version_min[minorDigitIdx] != '.') goto fail; return result; diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c index 8b6ae93..eb478e8 100644 --- a/gcc/config/darwin-driver.c +++ b/gcc/config/darwin-driver.c @@ -57,8 +57,6 @@ darwin_find_version_from_kernel (char *new_flag) version_p = osversion + 1; if (ISDIGIT (*version_p)) major_vers = major_vers * 10 + (*version_p++ - '0'); - if (major_vers > 4 + 9) -goto parse_failed; if (*version_p++ != '.') goto parse_failed; version_pend = strchr(version_p, '.'); diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-1.c b/gcc/testsuite/gcc.dg/darwin-minversion-1.c index d8a3243..6221d61 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-1.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-1.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-2.c b/gcc/testsuite/gcc.dg/darwin-minversion-2.c index fd4975a..8e18d52 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-2.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-2.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3" } */ /* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-3.c b/gcc/testsuite/gcc.dg/darwin-minversion-3.c index d0c5934..4fcb969 100644 --- a/gcc/testsuite/gcc.dg/darwin-minversion-3.c +++ b/gcc/testsuite/gcc.dg/darwin-minversion-3.c @@ -2,7 +2,8 @@ /* { dg-options "-mmacosx-version-min=10.4.10" } */ /* { dg-do compile { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1040 fail me; diff --git a/gcc/testsuite/gcc.dg/darwin-minversion-4.c b/gcc/testsuite/gcc.dg/darwin-minversion-4.c new file mode 100644 index 000..1cb42eb --- /dev/null +++ b/gcc/test
[PATCH v4 2/2] Fixed dirent sanitizer for 32-bit OS X builds
The _DARWIN_FEATURE_64_BIT_INODE macro indicates whether dirent.d_ino is 64-bit or not, which should be sized appropriately, and whether dirent.d_seekoff should be defined/checked. libsanitizer/ChangeLog: * sanitizer_common/sanitizer_platform_limits_posix.cc: Only check dirent.d_seekoff on OS X when performing a 64-bit build. * sanitizer_common/sanitizer_platform_limits_posix.h: Only define dirent.d_seekoff on OS X when performing a 64-bit build, and make dirent.d_ino the correct size (32-bit) when performing a 32-bit build. --- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | 3 ++- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h | 9 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index a93d38d..69c84de 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -940,7 +940,8 @@ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent)); CHECK_SIZE_AND_OFFSET(dirent, d_ino); -#if SANITIZER_MAC +#if SANITIZER_MAC && defined(_DARWIN_FEATURE_64_BIT_INODE) +// The 'd_seekoff' field is only present on OS X for 64-bit builds CHECK_SIZE_AND_OFFSET(dirent, d_seekoff); #elif SANITIZER_FREEBSD // There is no 'd_off' field on FreeBSD. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index dece2d3..0523465 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -392,12 +392,21 @@ namespace __sanitizer { #endif #if SANITIZER_MAC +# if defined(_DARWIN_FEATURE_64_BIT_INODE) struct __sanitizer_dirent { unsigned long long d_ino; unsigned long long d_seekoff; unsigned short d_reclen; // more fields that we don't care about }; +# else + struct __sanitizer_dirent { +unsigned int d_ino; +// No d_seekoff for 32-bit +unsigned short d_reclen; +// more fields that we don't care about + }; +# endif #elif SANITIZER_FREEBSD struct __sanitizer_dirent { unsigned int d_fileno; -- 2.1.0
Re: [patch, fortran] use vec<> in frontend-passes.c
Hi Tobias, > first, thanks Trevor for the first round of review! Also thanks from my side! > I still see: >> - expr_count = 0; >> + expr_array.truncate (0); > > Is there is a reason for not using release() here? No, changed in the committed version. Regards Thomas
Re: [C++ RFH/Patch] PR 52892 (and others)
On 08/26/2014 12:01 PM, Paolo Carlini wrote: the difference, for the latter and for more complex cases, is that adjust_temp_type calls cp_fold_convert which ends up returning a NOP_EXPR (eg, build in fold_convert_loc). Perhaps we should address this in adjust_temp_type, either by ignoring the conversion to a canonically equivalent type or by directly changing the type of the ADDR_EXPR. Jason
Re: [PATCH 40/50] rtlanal.c:for_each_inc_dec
[Jeff, sorry for the duplicate, sent the original from an account that adds disclaimers.] Jeff Law writes: > On 08/09/14 04:13, Richard Sandiford wrote: >> Jeff Law writes: >>> On 08/03/14 08:32, Richard Sandiford wrote: The old for_each_inc_dec callback had a for_each_rtx-like return value, with >0 being returned directly, 0 meaning "continue" and <0 meaning "skip subrtxes". But there's no reason to distinguish the latter two cases since auto-inc/dec expressions aren't allowed to contain other auto-inc/dec expressions. And if for_each_rtx is going away, there's no longer any consistency argument for using the same interface. gcc/ * rtl.h (for_each_inc_dec_fn): Remove special case for -1. * cselib.c (cselib_record_autoinc_cb): Update accordingly. (cselib_record_sets): Likewise. * dse.c (emit_inc_dec_insn_before, check_for_inc_dec_1) (check_for_inc_dec): Likewise. * rtlanal.c (for_each_inc_dec_ops): Delete. (for_each_inc_dec_find_inc_dec): Take the MEM as argument, rather than a pointer to the memory address. Replace for_each_inc_dec_ops argument with separate function and data arguments. Abort on non-autoinc addresses. (for_each_inc_dec_find_mem): Delete. (for_each_inc_dec): Use FOR_EACH_SUBRTX_VAR to visit every autoinc MEM. >>> So this patch has me a little bit concerned. >>> @@ -2523,7 +2523,7 @@ cselib_record_sets (rtx insn) data.sets = sets; data.n_sets = n_sets_before_autoinc = n_sets; - for_each_inc_dec (&insn, cselib_record_autoinc_cb, &data); + for_each_inc_dec (&PATTERN (insn), cselib_record_autoinc_cb, &data); n_sets = data.n_sets; >>> So wouldn't this miss an autoincrement operation embedded in a note, >>> such as a REG_EQUAL note? My memory is very fuzzy here, but I can't >>> recall any policy which prohibits an autoincrement addressing mode from >>> appearing in a REG_EQUAL note. Worse yet, I have vague memories of >>> embedded side effects actually showing up in REG_EQUAL notes. >> >> But either: >> >> (a) those notes would contain side effects that are also present in the >> main pattern, e.g.: >> >>(set (reg Z) (plus (mem (pre_inc X)) (reg Y))) >>REG_EQUAL: (plus (mem (pre_inc X)) (const_int Z)) >> >> (b) those notes would contain side effects that are not present in the >> main pattern. >> >> (b) seems completely invalid to me. REG_EQUAL notes are just a hint >> and it's perfectly OK to remove them if they're no longer accurate >> (e.g. because a register value used in the note is no longer available). >> It's also possible to remove them if the set destination gets combined >> with something else. Plus the whole idea of a REG_EQUAL note is that >> you could replace the SET_SRC with the note value without changing the >> effect of the instruction. >> >> For (a) the current code would end up recording the same side-effect >> twice, so looking at just the pattern is likely to be a bug fix. >> But (a) is probably invalid too in practice. > The note shows another way to express what appears on the RHS. In > theory the note is supposed to be a simpler form. So in the case of > (a) we might have a PARALLEL in the pattern, but a REG_INC in the note. > I don't see how that'd be terribly helpful though. > > I agree (b) is invalid. > > > > >> >> Just a guess, but maybe the thing you were thinking of was related to >> the old REG_LIBCALL/REG_RETVAL support? Although I only vaguely remember >> how that worked now... > I thought it was something in reload's reg_equiv handling that I > stumbled over at some point. The tiny bit I remember was an auto-inc in > the note and something wanting to substitute the note for a use > elsewhere in the insn stream. My recollection was the note had an > auto-inc addressing mode which significantly complicates the validity of > such a transformation. > > However, the only thread I can find is one from 2009 between myself and > Ian, but it's not dealing with an autoinc addressing mode in the note. > And at some level it simply doesn't make much sense to have the auto-inc > addressing mode in a REG_EQUAL note. I guess we could declare that > invalid and cope with it if we ever find one. Perhaps a bit of > ENABLE_CHECKING to detect if we ever create such a note? I suppose an assert means that it'd be up to each piece of code that creates a note to check whether the equivalent value has autoinc addresses. How about just dropping those REG_EQUAL and REG_EQUIV notes instead, like we already do for ASM_OPERANDS? Here I've extended it to all notes with side effects. The additional cases are: case CLOBBER: /* Reject CLOBBER with a non-VOID mode. These are made by combine.c when some combination can't be done. If we see one, don't think that we can simplify the expression. */ retu
C++ PATCH for middle-end/58624 (thread_local static data member)
This PR points out an ICE caused by thread_local on static data members, which we weren't handling properly at all. There is still the issue that calling set_decl_tls_model on a template variable adds it to the symbol table, causing problems later on, but this patch fixes the front end handling. Tested x86_64-pc-linux-gnu, applying to trunk. commit ccf3f3b41516b34d7d564bed1b3f4e3cf270e43a Author: Jason Merrill Date: Tue Aug 26 13:56:17 2014 -0400 PR c++/58624 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model. (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper. * semantics.c (finish_id_expression): Don't call TLS wrapper in a template. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 59df387..eac837f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11225,6 +11225,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) } SET_DECL_VALUE_EXPR (r, ve); } + if (TREE_STATIC (r) || DECL_EXTERNAL (r)) + set_decl_tls_model (r, decl_tls_model (t)); } else if (DECL_SELF_REFERENCE_P (t)) SET_DECL_SELF_REFERENCE_P (r); @@ -15410,6 +15412,17 @@ tsubst_copy_and_build (tree t, case PARM_DECL: { tree r = tsubst_copy (t, args, complain, in_decl); + if (VAR_P (r) + && !processing_template_decl + && !cp_unevaluated_operand + && (TREE_STATIC (r) || DECL_EXTERNAL (r)) + && DECL_THREAD_LOCAL_P (r)) + { + if (tree wrap = get_tls_wrapper_fn (r)) + /* Replace an evaluated use of the thread_local variable with + a call to its wrapper. */ + r = build_cxx_call (wrap, 0, NULL, tf_warning_or_error); + } if (TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE) /* If the original type was a reference, we'll be wrapped in diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 16abad0..9c9fc1c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3500,6 +3500,7 @@ finish_id_expression (tree id_expression, tree wrap; if (VAR_P (decl) && !cp_unevaluated_operand + && !processing_template_decl && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)) && DECL_THREAD_LOCAL_P (decl) && (wrap = get_tls_wrapper_fn (decl))) diff --git a/gcc/testsuite/g++.dg/tls/thread_local10.C b/gcc/testsuite/g++.dg/tls/thread_local10.C new file mode 100644 index 000..48c1b86 --- /dev/null +++ b/gcc/testsuite/g++.dg/tls/thread_local10.C @@ -0,0 +1,23 @@ +// PR c++/58624 + +// { dg-do run { target c++11 } } +// { dg-add-options tls } +// { dg-require-effective-target tls_runtime } + +int i; + +template struct A +{ + static thread_local int s; + + A () { i = s; } +}; + +int f() { return 42; } +template thread_local int A::s = f(); + +int main () { + A a; + if (i != 42) +__builtin_abort(); +}
Re: [C++ RFH/Patch] PR 52892 (and others)
Hi, On 08/26/2014 08:58 PM, Jason Merrill wrote: On 08/26/2014 12:01 PM, Paolo Carlini wrote: the difference, for the latter and for more complex cases, is that adjust_temp_type calls cp_fold_convert which ends up returning a NOP_EXPR (eg, build in fold_convert_loc). Perhaps we should address this in adjust_temp_type, either by ignoring the conversion to a canonically equivalent type or by directly changing the type of the ADDR_EXPR. Ok. I didn't tell you in my first message that I already tried changing the 'TREE_TYPE (temp) == type' to 'same_type_p (TREE_TYPE (temp), type)' and it works for the simple case I posted, but it doesn't in more complex cases, involving templates too. Thus something more complex in adjust_temp_type, I suppose... Paolo.
Re: [PATCH i386 AVX512] [22/n] Extend unaligned loads & stores.
Hello Uroš, On 23 Aug 09:44, Uros Bizjak wrote: > On Fri, Aug 22, 2014 at 1:51 PM, Kirill Yukhin > wrote: > > > This patch extends unaligned loads and stores patterns. > At this stage, I'd still prefer simple constraints (the solution, > proposed above), even for the price of additional patterns. Looking at > the patterns, it is quite hard to calculate final condition for the > particular mode/target combo, even without enable attribute and > conditional operand constraints/predicates. With the solution above, > the complexity is conveniently pushed to mask define_subst attribute. In the bottom patch which splits unaligned ld/st patterns. Bootstrapped and avx512-regtested on simulator. gcc/ * config/i386/sse.md (define_mode_iterator VI48_AVX512VL): New. (define_mode_iterator VI_UNALIGNED_LOADSTORE): Delete. (define_mode_iterator VI_ULOADSTORE_AVX512BW): New. (define_mode_iterator VI_ULOADSTORE_AVX512F): Ditto. (define_expand "_loaddqu" with VI1): Change mode iterator. (define_expand "_loaddqu" with VI_ULOADSTORE_AVX512BW): New. (define_expand "_loaddqu" with VI_ULOADSTORE_AVX512F): Ditto. (define_insn "*_loaddqu" with VI1): Change mode iterator. (define_insn "*_loaddqu" with VI_ULOADSTORE_AVX512BW): New. (define_insn "*_loaddqu" with VI_ULOADSTORE_AVX512F): Ditto. (define_insn "_storedqu with VI1): Change mode iterator. (define_insn "_storedqu with VI_ULOADSTORE_AVX512BW): New. (define_insn "_storedqu with VI_ULOADSTORE_AVX512F): Ditto. (define_insn "avx512f_storedqu_mask"): Delete. (define_insn "_storedqu_mask" with VI48_AVX512VL): New. (define_insn "_storedqu_mask" with VI12_AVX512VL): Ditto. Is it ok for trunk? -- Thanks, K diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 0624582..0245ec4 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -235,6 +235,10 @@ (define_mode_iterator VF_512 [V16SF V8DF]) +(define_mode_iterator VI48_AVX512VL + [V16SI (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL") + V8DI (V4DI "TARGET_AVX512VL") (V2DI "TARGET_AVX512VL")]) + (define_mode_iterator VF2_AVX512VL [V8DF (V4DF "TARGET_AVX512VL") (V2DF "TARGET_AVX512VL")]) @@ -259,9 +263,13 @@ (define_mode_iterator VI1 [(V32QI "TARGET_AVX") V16QI]) -(define_mode_iterator VI_UNALIGNED_LOADSTORE - [(V32QI "TARGET_AVX") V16QI - (V16SI "TARGET_AVX512F") (V8DI "TARGET_AVX512F")]) +(define_mode_iterator VI_ULOADSTORE_AVX512BW + [V64QI + V32HI (V8HI "TARGET_AVX512VL") (V16HI "TARGET_AVX512VL")]) + +(define_mode_iterator VI_ULOADSTORE_AVX512F + [V16SI (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL") + V8DI (V4DI "TARGET_AVX512VL") (V2DI "TARGET_AVX512VL")]) ;; All DImode vector integer modes (define_mode_iterator VI8 @@ -1172,18 +1180,18 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) +/* For AVX, normal *mov_internal pattern will handle unaligned loads + just fine if misaligned_operand is true, and without the UNSPEC it can + be combined with arithmetic instructions. If misaligned_operand is + false, still emit UNSPEC_LOADU insn to honor user's request for + misaligned load. */ (define_expand "_loaddqu" - [(set (match_operand:VI_UNALIGNED_LOADSTORE 0 "register_operand") - (unspec:VI_UNALIGNED_LOADSTORE - [(match_operand:VI_UNALIGNED_LOADSTORE 1 "nonimmediate_operand")] + [(set (match_operand:VI1 0 "register_operand") + (unspec:VI1 + [(match_operand:VI1 1 "nonimmediate_operand")] UNSPEC_LOADU))] - "TARGET_SSE2 && " + "TARGET_SSE2 && && " { - /* For AVX, normal *mov_internal pattern will handle unaligned loads - just fine if misaligned_operand is true, and without the UNSPEC it can - be combined with arithmetic instructions. If misaligned_operand is - false, still emit UNSPEC_LOADU insn to honor user's request for - misaligned load. */ if (TARGET_AVX && misaligned_operand (operands[1], mode)) { @@ -1197,25 +1205,61 @@ } }) +(define_expand "_loaddqu" + [(set (match_operand:VI_ULOADSTORE_AVX512BW 0 "register_operand") + (unspec:VI_ULOADSTORE_AVX512BW + [(match_operand:VI_ULOADSTORE_AVX512BW 1 "nonimmediate_operand")] + UNSPEC_LOADU))] + "TARGET_AVX512BW" +{ + if (misaligned_operand (operands[1], mode)) +{ + rtx src = operands[1]; + if () + src = gen_rtx_VEC_MERGE (mode, operands[1], +operands[2 * ], +operands[3 * ]); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], src)); + DONE; +} +}) + +(define_expand "_loaddqu" + [(set (match_operand:VI_ULOADSTORE_AVX512F 0 "register_operand") + (unspec:VI_ULOADSTORE_AVX512F + [(match_operand:VI_ULOADSTORE_AVX512F 1 "nonimmediate_operand")] + UNSPEC_LO
[patch] Why xstrdup cgraph node names for dumpfiles?
Hello Martin, Honza, I noticed most of the cgraph and IPA files use xstrdup for cgraph node names when printing to dump_file. Very leaky... What is the reason for all those xstrdups? I couldn't think of any. Thoughts? Ciao! Steven * cgraph.c (cgraph_node::get_create): Don't xstrdup cgraph node names. (cgraph_edge::make_speculative): Likewise. (cgraph_edge::resolve_speculation): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. (cgraph_node::dump): Likewise. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * ipa-cp.c (perhaps_add_new_callers): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (flatten_function): Likewise. (inline_always_inline_functions): Likewise. (early_inline_small_functions): Likewise. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_print_node_jump_functions): Likewise. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. * tree-sra.c (convert_callers_for_node): Likewise. Index: cgraph.c === --- cgraph.c(revision 214545) +++ cgraph.c(working copy) @@ -489,11 +489,11 @@ cgraph_node::get_create (tree decl) if (dump_file) fprintf (dump_file, "Introduced new external node " "(%s/%i) and turned into root of the clone tree.\n", -xstrdup (node->name ()), node->order); +node->name (), node->order); } else if (dump_file) fprintf (dump_file, "Introduced new external node " -"(%s/%i).\n", xstrdup (node->name ()), +"(%s/%i).\n", node->name (), node->order); return node; } @@ -1036,8 +1036,8 @@ cgraph_edge::make_speculative (cgraph_node *n2, gc { fprintf (dump_file, "Indirect call -> speculative call" " %s/%i => %s/%i\n", - xstrdup (n->name ()), n->order, - xstrdup (n2->name ()), n2->order); + n->name (), n->order, + n2->name (), n2->order); } speculative = true; e2 = n->create_edge (n2, call_stmt, direct_count, direct_frequency); @@ -1155,16 +1155,16 @@ cgraph_edge::resolve_speculation (tree callee_decl { fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has " "turned out to have contradicting known target ", - xstrdup (edge->caller->name ()), edge->caller->order, - xstrdup (e2->callee->name ()), e2->callee->order); + edge->caller->name (), edge->caller->order, + e2->callee->name (), e2->callee->order); print_generic_expr (dump_file, callee_decl, 0); fprintf (dump_file, "\n"); } else { fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n", - xstrdup (edge->caller->name ()), edge->caller->order, - xstrdup (e2->callee->name ()), e2->callee->order); + edge->caller->name (), edge->caller->order, + e2->callee->name (), e2->callee->order); } } } @@ -1284,9 +1284,9 @@ cgraph_edge::redirect_call_stmt_to_callee (void) if (dump_file) fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n" "Type mismatch.\n", -xstrdup (e->caller->name ()), +e->caller->name (), e->caller->order, -xstrdup (e->callee->name ()), +e->callee->name (), e->callee->order); e = e->resolve_speculation (); /* We are producing the final function body and will throw away the @@ -1303,9 +1303,9 @@ cgraph_edge::redirect_call_stmt_to_callee (void) fprintf (dump_file, "Expanding speculative call of %s/%i -> %s/%i count:" "%"PRId64"\n", -xstrdup (e->caller->name ()), +e->caller->name (), e->caller->order, -xstrdup (e->callee->name ()), +e->callee->name (), e->callee->order, (int64_t)e->count); gcc_assert (e2->speculative); @@ -1353,8 +1353,8 @@ cgraph_edge::redirect_call_stmt_to_callee (void) if (symtab->dump_file) { fprintf (symtab->dump_file, "updating call of %s/%i -> %s/%i: ", - xstrdup (e->caller->name ()), e->caller->order, - xstrdup (e->callee->na
Fwd: [PATCH i386 AVX512] [22/n] Extend unaligned loads & stores.
On Tue, Aug 26, 2014 at 9:55 PM, Kirill Yukhin wrote: > Hello Uroš, > On 23 Aug 09:44, Uros Bizjak wrote: >> On Fri, Aug 22, 2014 at 1:51 PM, Kirill Yukhin >> wrote: >> >> > This patch extends unaligned loads and stores patterns. >> At this stage, I'd still prefer simple constraints (the solution, >> proposed above), even for the price of additional patterns. Looking at >> the patterns, it is quite hard to calculate final condition for the >> particular mode/target combo, even without enable attribute and >> conditional operand constraints/predicates. With the solution above, >> the complexity is conveniently pushed to mask define_subst attribute. > In the bottom patch which splits unaligned ld/st patterns. > Bootstrapped and avx512-regtested on simulator. > > gcc/ > * config/i386/sse.md > (define_mode_iterator VI48_AVX512VL): New. > (define_mode_iterator VI_UNALIGNED_LOADSTORE): Delete. > (define_mode_iterator VI_ULOADSTORE_AVX512BW): New. > (define_mode_iterator VI_ULOADSTORE_AVX512F): Ditto. > (define_expand "_loaddqu" > with VI1): Change mode iterator. > (define_expand "_loaddqu" > with VI_ULOADSTORE_AVX512BW): New. > (define_expand "_loaddqu" > with VI_ULOADSTORE_AVX512F): Ditto. > (define_insn "*_loaddqu" > with VI1): Change mode iterator. > (define_insn "*_loaddqu" > with VI_ULOADSTORE_AVX512BW): New. > (define_insn "*_loaddqu" > with VI_ULOADSTORE_AVX512F): Ditto. > (define_insn "_storedqu > with VI1): Change mode iterator. > (define_insn "_storedqu > with VI_ULOADSTORE_AVX512BW): New. > (define_insn "_storedqu > with VI_ULOADSTORE_AVX512F): Ditto. > (define_insn "avx512f_storedqu_mask"): Delete. > (define_insn "_storedqu_mask" with > VI48_AVX512VL): New. > (define_insn "_storedqu_mask" with > VI12_AVX512VL): Ditto. > > Is it ok for trunk? OK with a renamed mode iterator as suggested below. Thanks, Uros. > -(define_mode_iterator VI_UNALIGNED_LOADSTORE > - [(V32QI "TARGET_AVX") V16QI > - (V16SI "TARGET_AVX512F") (V8DI "TARGET_AVX512F")]) > +(define_mode_iterator VI_ULOADSTORE_AVX512BW > + [V64QI > + V32HI (V8HI "TARGET_AVX512VL") (V16HI "TARGET_AVX512VL")]) > + > +(define_mode_iterator VI_ULOADSTORE_AVX512F > + [V16SI (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL") > + V8DI (V4DI "TARGET_AVX512VL") (V2DI "TARGET_AVX512VL")]) Please name these two VI_ULOADSTORE_BW_AVX512VL and VI_ULOADSTORE_F_AVX512VL to be consistent with other names and put these nearby loadstore patterns.
Re: [patch] Why xstrdup cgraph node names for dumpfiles?
Hello! > I noticed most of the cgraph and IPA files use xstrdup for cgraph node > names when printing to dump_file. Very leaky... > > What is the reason for all those xstrdups? I couldn't think of any. Please see [1] and [2]. [1] https://gcc.gnu.org/ml/gcc-patches/2012-04/msg01904.html [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53136 Uros.
Re: [patch] Why xstrdup cgraph node names for dumpfiles?
On Tue, Aug 26, 2014 at 10:52 PM, Uros Bizjak wrote: > Hello! > >> I noticed most of the cgraph and IPA files use xstrdup for cgraph node >> names when printing to dump_file. Very leaky... >> >> What is the reason for all those xstrdups? I couldn't think of any. > > Please see [1] and [2]. > > [1] https://gcc.gnu.org/ml/gcc-patches/2012-04/msg01904.html > [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53136 Thanks. Well, that is surprising. The cxx_printable_name_internal uses a ring buffer for caching the names. Apparently that didn't work in your PR. The leaks get quite large over time, especially with a large code base and many small functions. I noticed this when compiling a large code base with dumping enabled and ran out of memory. I assume you also tried increasing the ring buffer size? Oh well, probably not very robust, and we do seem to leak a lot of strings in general... Ciao! Steven
[patch] make dwarf2out_decl static
This doesn't seem to be used anywhere but in dwarf2out.c. OK for mainline? commit 8a48cdd576442cee103399ab4f1f67ee215ee6b8 Author: Aldy Hernandez Date: Tue Aug 26 14:30:22 2014 -0700 * dwarf2out.h (dwarf2out_decl): Remove prototype. * dwarf2out.c (dwarf2out_decl): Make static. 2014-08-26 David Malcolm * cselib.h (struct elt_loc_list): Strengthen field "setting_insn" diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1a9e50a..fb01732 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -102,6 +102,7 @@ along with GCC; see the file COPYING3. If not see static void dwarf2out_source_line (unsigned int, const char *, int, bool); static rtx_insn *last_var_location_insn; static rtx_insn *cached_next_real_insn; +static void dwarf2out_decl (tree); #ifdef VMS_DEBUGGING_INFO int vms_file_stats_name (const char *, long long *, long *, char *, int *); @@ -20881,7 +20882,7 @@ gen_namelist_decl (tree name, dw_die_ref scope_die, tree item_decls) /* Write the debugging output for DECL. */ -void +static void dwarf2out_decl (tree decl) { dw_die_ref context_die = comp_unit_die (); diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index bac5077..7843e0a 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -249,7 +249,6 @@ extern enum dw_cfi_oprnd_type dw_cfi_oprnd2_desc extern void output_cfi_directive (FILE *f, struct dw_cfi_node *cfi); -extern void dwarf2out_decl (tree); extern void dwarf2out_emit_cfi (dw_cfi_ref cfi); extern void debug_dwarf (void);
Re: [patch] make dwarf2out_decl static
On 08/26/14 15:32, Aldy Hernandez wrote: This doesn't seem to be used anywhere but in dwarf2out.c. OK for mainline? OK jeff
Re: Enable EBX for x86 in 32bits PIC code
On 26 Aug 11:25, Vladimir Makarov wrote: > On 08/26/2014 04:57 AM, Ilya Enkovich wrote: > > I've looked into one of fails. There is still a problem with > > allocation in reload. Here is a piece of code which uses float > > constant: > > > > (insn 1199 1198 1200 96 (set (reg:SI 3 bx) > > (reg:SI 1301 [528])) /usr/include/bits/stdlib-float.h:28 90 > > {*movsi_internal} > > (nil)) > > (call_insn 1200 1199 1201 96 (set (reg:DF 8 st) > > (call (mem:QI (symbol_ref:SI ("strtod") [flags 0x41] > > ) [0 strtod S1 A8]) > > (const_int 8 [0x8]))) /usr/include/bits/stdlib-float.h:28 > > 661 {*call_value} > > (expr_list:REG_DEAD (reg:SI 3 bx) > > (expr_list:REG_CALL_DECL (symbol_ref:SI ("strtod") [flags > > 0x41] ) > > (expr_list:REG_EH_REGION (const_int 0 [0]) > > (nil > > (expr_list (use (reg:SI 3 bx)) > > (expr_list:SI (use (reg:SI 3 bx)) > > (expr_list:SI (use (mem/f:SI (reg/f:SI 7 sp) [0 S4 A32])) > > (expr_list:SI (use (mem/f:SI (plus:SI (reg/f:SI 7 sp) > > (const_int 4 [0x4])) [0 S4 A32])) > > (nil)) > > (insn 1201 1200 1202 96 (set (reg:DF 321 [ D.7817 ]) > > (reg:DF 8 st)) /usr/include/bits/stdlib-float.h:28 128 > > {*movdf_internal} > > (expr_list:REG_DEAD (reg:DF 8 st) > > (nil))) > > (insn 1202 1201 1203 96 (set (reg:SF 322 [ D.7804 ]) > > (float_truncate:SF (reg:DF 321 [ D.7817 ]))) read_arch.c:700 > > 157 {*truncdfsf_fast_sse} > > (expr_list:REG_DEAD (reg:DF 321 [ D.7817 ]) > > (nil))) > > (insn 1203 1202 1204 96 (set (mem:SF (reg/f:SI 198 [ D.7812 ]) [4 > > _130->frequency+0 S4 A32]) > > (reg:SF 322 [ D.7804 ])) read_arch.c:700 129 {*movsf_internal} > > (nil)) > > (insn 1204 1203 1205 96 (set (reg:SF 1209) > > (mem/u/c:SF (plus:SI (reg:SI 1301 [528]) > > (const:SI (unspec:SI [ > > (symbol_ref/u:SI ("*.LC12") [flags 0x2]) > > ] UNSPEC_GOTOFF))) [4 S4 A32])) > > read_arch.c:701 129 {*movsf_internal} > > (expr_list:REG_EQUAL (const_double:SF 0.0 [0x0.0p+0]) > > (nil))) > > (note 1205 1204 1206 96 NOTE_INSN_DELETED) > > (note 1206 1205 1207 96 NOTE_INSN_DELETED) > > (insn 1207 1206 1208 96 (set (reg:CCFP 17 flags) > > (compare:CCFP (reg:SF 1209) > > (reg:SF 322 [ D.7804 ]))) read_arch.c:701 53 {*cmpisf_sse} > > (nil)) > > (jump_insn 1208 1207 3075 96 (set (pc) > > (if_then_else (ge (reg:CCFP 17 flags) > > (const_int 0 [0])) > > (label_ref:SI 3114) > > (pc))) read_arch.c:701 606 {*jcc_1} > > (expr_list:REG_DEAD (reg:CCFP 17 flags) > > (int_list:REG_BR_PROB 2 (nil))) > > -> 3114) > > (note 3075 1208 1209 97 [bb 97] NOTE_INSN_BASIC_BLOCK) > > (insn 1209 3075 1210 97 (set (reg:SF 1208) > > (mem/u/c:SF (plus:SI (reg:SI 1301 [528]) > > (const:SI (unspec:SI [ > > (symbol_ref/u:SI ("*.LC11") [flags 0x2]) > > ] UNSPEC_GOTOFF))) [4 S4 A32])) > > read_arch.c:701 129 {*movsf_internal} > > (expr_list:REG_EQUIV (const_double:SF 1.0e+0 [0x0.8p+1]) > > (nil))) > > (note 1210 1209 1211 97 NOTE_INSN_DELETED) > > (note 1211 1210 1212 97 NOTE_INSN_DELETED) > > (insn 1212 1211 1213 97 (set (reg:CCFP 17 flags) > > (compare:CCFP (reg:SF 322 [ D.7804 ]) > > (reg:SF 1208))) read_arch.c:701 53 {*cmpisf_sse} > > (nil)) > > > > We have PIC register r1301 (former r528) used for constant load (insn > > 1209). This register was actually loaded to bx (insn 1199) and this > > hard reg may be used by insn 1209. During reload we have insn 1209 > > removed and a new one created instead: > > > > (insn 3864 1211 1212 104 (set (reg:SI 0 ax [1468]) > > (plus:SI (reg:SI 6 bp [528]) > > (const:SI (unspec:SI [ > > (symbol_ref/u:SI ("*.LC11") [flags 0x2]) > > ] UNSPEC_GOTOFF read_arch.c:701 213 {*leasi} > > (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC11") [flags 0x2]) > > (nil))) > > (insn 1212 3864 1213 104 (set (reg:CCFP 17 flags) > > (compare:CCFP (reg:SF 21 xmm0 [orig:322 D.7804 ] [322]) > > (mem/u/c:SF (reg:SI 0 ax [1468]) [4 S4 A32]))) > > read_arch.c:701 53 {*cmpisf_sse} > > (nil)) > > > > In this new instruction bp is used which is wrong. We actually have > > required value in bx. In debugger I also checked that bp doesn't have > > required value. I suppose I enabled flag correctly because found this > > in the log: "Spill r1301 after risky transformations". Is it possible > > we are still not allowed to use the original PIC register (r528) and > > should use a reg copy created for particular region (in this case > > r1301)? > > > It is hard for me to say without the full patch and the test. I can > only guess that 130
[Patch AArch64] Fix for PR62262
Hi In insn pattern "*andim_ashift_bfiz", if the operands[2] is larger than the size of register, gcc may generate invalid assembler code. If operands[2] is larger than the size of the underlying type of INTVAL, the following insn condition may also be undefined. "exact_log2 ((INTVAL (operands[3]) >> INTVAL (operands[2])) + 1) >= 0 && (INTVAL (operands[3]) & ((1 << INTVAL (operands[2])) - 1)) == 0" It can be fixed by checking the value of operands[2] before using it. Passed regression test without failure. OK for trunk and 4.9 branch? thanks Guozhi Wei 2014-08-26 Guozhi Wei PR target/62262 * config/aarch64/aarch64.md (*andim_ashift_bfiz): Check the shift amount before using it. 2014-08-26 Guozhi Wei PR target/62262 * gcc.target/aarch64/pr62262.c: New test. patch Description: Binary data
Re: Doc Bug: cxa-atexit not use-cxa-atexit
On 8/23/2014 11:19 AM, Gerald Pfeifer wrote: > On Mon, 18 Aug 2014, Joel Sherrill wrote: >> I think this is a minor documentation bug which is in the head but also >> seems to be in the gcc 4.4.7 docs shipped with CentOS 6.x. >> >> OK to commit? >> >> 2014-08-18 Joel Sherrill >> >> * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit. > Sure thing. Okay for all open branches. I think it is safely committed to 4.8 and newer. > Gerald -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.comOn-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available(256) 722-9985
[committed] Update 4.8 baseline symbols on hppa-linux
Attached is an update to the baseline symbols on hppa-linux to fix the abi test failure in the current 4.8 tree. Dave -- John David Anglin dave.ang...@bell.net 2014-08-26 John David Anglin * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update. Index: config/abi/post/hppa-linux-gnu/baseline_symbols.txt === --- config/abi/post/hppa-linux-gnu/baseline_symbols.txt (revision 214400) +++ config/abi/post/hppa-linux-gnu/baseline_symbols.txt (working copy) @@ -400,6 +400,7 @@ FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE6getlocEv@@GLIBCXX_3.4 FUNC:_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4 FUNC:_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4 +FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18 FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4 FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4 FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4 @@ -587,6 +588,8 @@ FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4 FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4 FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4 +FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEj@@GLIBCXX_3.4.18 +FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEjjj@@GLIBCXX_3.4.18 FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9 FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4 FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4 @@ -1204,6 +1207,7 @@ FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15 FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15 FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15 +FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIxSt5ratioILx1ELx1NS1_IxS2_ILx1ELx10@@GLIBCXX_3.4.18 FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4 FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1 FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4 @@ -1471,6 +1475,11 @@ FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4 FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4 FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4 +FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18 +FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18 +FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18 +FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18 +FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18 FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4 FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4 FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4 @@ -1900,6 +1909,8 @@ FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11 +FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19 +FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4 @@ -2436,6 +2447,7 @@ FUNC:__cxa_guard_release@@CXXABI_1.3 FUNC:__cxa_pure_virtual@@CXXABI_1.3 FUNC:__cxa_rethrow@@CXXABI_1.3 +FUNC:__cxa_thread_atexit@@CXXABI_1.3.7 FUNC:__cxa_throw@@CXXABI_1.3 FUNC:__cxa_tm_cleanup@@CXXABI_TM_1 FUNC:__cxa_vec_cctor@@CXXABI_1.3 @@ -2482,6 +2494,7 @@ OBJECT:0:CXXABI_1.3.4 OBJECT:0:CXXABI_1.3.5 OBJECT:0:CXXABI_1.3.6 +OBJECT:0:CXXABI_1.3.7 OBJECT:0:CXXABI_TM_1 OBJECT:0:GLIBCXX_3.4 OBJECT:0:GLIBCXX_3.4.1 @@ -2493,6 +2506,8 @@ OBJECT:0:GLIBCXX_3.4.15 OBJECT:0:GLIBCXX_3.4.16 OBJECT:0:GLIBCXX_3.4.17 +OBJECT:0:GLIBCXX_3.4.18 +OBJECT:0:GLIBCXX_3.4.19 OBJECT:0:GLIBCXX_3.4.2 OBJECT:0:GLIBCXX_3.4.3 OBJECT:0:GLIBCXX_3.4.4 @@ -2992,6 +3007,8 @@ OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4 OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4 OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11 +OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19 +OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19 OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11 OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11 OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
[PATCH,rs6000] Add some more vector built-ins
Hi, This patch adds a few more cases of overloaded vector built-ins to support V2DI and V2DF modes: vec_xl, vec_xst, vec_splat, vec_div, vec_mul, vec_round. These are all straightforward. For vec_div and vec_mul, the most efficient thing appears to be to just scalarize these; at least I couldn't come up with a magic sequence for multiply at this width. Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions. Is this ok for trunk? Thanks, Bill [gcc] 2014-08-26 Bill Schmidt * config/rs6000/altivec.h (vec_xl): New #define. (vec_xst): Likewise. * config/rs6000/rs6000-builtin.def (XXSPLTD_V2DF): New built-in. (XXSPLTD_V2DI): Likewise. (DIV_V2DI): Likewise. (UDIV_V2DI): Likewise. (MUL_V2DI): Likewise. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add entries for VSX_BUILTIN_XVRDPI, VSX_BUILTIN_DIV_V2DI, VSX_BUILTIN_UDIV_V2DI, VSX_BUILTIN_MUL_V2DI, VSX_BUILTIN_XXSPLTD_V2DF, and VSX_BUILTIN_XXSPLTD_V2DI). * config/rs6000/vsx.md (UNSPEC_VSX_XXSPLTD): New unspec. (UNSPEC_VSX_DIVSD): Likewise. (UNSPEC_VSX_DIVUD): Likewise. (UNSPEC_VSX_MULSD): Likewise. (vsx_mul_v2di): New insn-and-split. (vsx_div_v2di): Likewise. (vsx_udiv_v2di): Likewise. (vsx_xxspltd_): New insn. [gcc/testsuite] 2014-08-26 Bill Schmidt * gcc.target/powerpc/builtins-1.c: Add tests for vec_xl, vec_xst, vec_round, vec_splat, vec_div, and vec_mul. * gcc.target/powerpc/builtins-2.c: New test. Index: gcc/config/rs6000/altivec.h === --- gcc/config/rs6000/altivec.h (revision 214281) +++ gcc/config/rs6000/altivec.h (working copy) @@ -322,6 +322,8 @@ #define vec_sqrt __builtin_vec_sqrt #define vec_vsx_ld __builtin_vec_vsx_ld #define vec_vsx_st __builtin_vec_vsx_st +#define vec_xl __builtin_vec_vsx_ld +#define vec_xst __builtin_vec_vsx_st /* Note, xxsldi and xxpermdi were added as __builtin_vsx_ functions instead of __builtin_vec_ */ Index: gcc/config/rs6000/rs6000-builtin.def === --- gcc/config/rs6000/rs6000-builtin.def(revision 214281) +++ gcc/config/rs6000/rs6000-builtin.def(working copy) @@ -1258,6 +1258,11 @@ BU_VSX_2 (VEC_MERGEL_V2DF,"mergel_2df", CONST, BU_VSX_2 (VEC_MERGEL_V2DI,"mergel_2di",CONST, vsx_mergel_v2di) BU_VSX_2 (VEC_MERGEH_V2DF,"mergeh_2df",CONST, vsx_mergeh_v2df) BU_VSX_2 (VEC_MERGEH_V2DI,"mergeh_2di",CONST, vsx_mergeh_v2di) +BU_VSX_2 (XXSPLTD_V2DF, "xxspltd_2df",CONST, vsx_xxspltd_v2df) +BU_VSX_2 (XXSPLTD_V2DI, "xxspltd_2di",CONST, vsx_xxspltd_v2di) +BU_VSX_2 (DIV_V2DI, "div_2di",CONST, vsx_div_v2di) +BU_VSX_2 (UDIV_V2DI, "udiv_2di", CONST, vsx_udiv_v2di) +BU_VSX_2 (MUL_V2DI, "mul_2di",CONST, vsx_mul_v2di) /* VSX abs builtin functions. */ BU_VSX_A (XVABSDP, "xvabsdp",CONST, absv2df2) Index: gcc/config/rs6000/rs6000-c.c === --- gcc/config/rs6000/rs6000-c.c(revision 214281) +++ gcc/config/rs6000/rs6000-c.c(working copy) @@ -604,6 +604,8 @@ const struct altivec_builtin_types altivec_overloa RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0, 0 }, { ALTIVEC_BUILTIN_VEC_ROUND, ALTIVEC_BUILTIN_VRFIN, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ROUND, VSX_BUILTIN_XVRDPI, +RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0, 0 }, { ALTIVEC_BUILTIN_VEC_RECIP, ALTIVEC_BUILTIN_VRECIPFP, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, { ALTIVEC_BUILTIN_VEC_RECIP, VSX_BUILTIN_RECIP_V2DF, @@ -1161,6 +1163,10 @@ const struct altivec_builtin_types altivec_overloa RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, { VSX_BUILTIN_VEC_DIV, VSX_BUILTIN_XVDIVDP, RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 }, + { VSX_BUILTIN_VEC_DIV, VSX_BUILTIN_DIV_V2DI, +RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 }, + { VSX_BUILTIN_VEC_DIV, VSX_BUILTIN_UDIV_V2DI, +RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX_V2DF, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF, 0 }, { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX_V2DI, @@ -1822,6 +1828,10 @@ const struct altivec_builtin_types altivec_overloa RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_XVMULDP, RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 }, + { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_MUL_V2DI, +RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 }, + { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_MUL_V2DI, +RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, { ALTIVEC
[debug-early] reuse variable DIEs and fix their context
This patch fixes a bunch of guality failures. With it I get 144 guality.exp failures vs. 163 for "make check-gcc RUNTESTFLAGS=guality.exp". A lot better than 100% fail rate ;-). Variable DIEs were not being reused. Instead, variable DIEs even had the wrong context (unilaterally the compilation unit). The attached patch reuses variable DIEs that have been outputted earlier. It also fixes the context by correcting the context on the second round. I have also added a bit field to the DIE structure to record if a DIE has been generated early. Again, this is all a rough draft, but feel free to comment. Committed to branch. Aldy commit 71d1672200b6bcfe258ae0bfe92ea59af3ea Author: Aldy Hernandez Date: Tue Aug 26 19:12:17 2014 -0700 * dwarf2out.c (struct die_struct): Add dumped_early field. (reparent_child): New. (splice_child_die): Use reparent_child. (gen_subprogram_die): Do not regenerate parameters if previously dumped. (gen_variable_die): Fix parent of decls that have been dumped early to reflect correct context. Do not regenerate decls if previously dumped. (dwarf2out_decl): Add return value. (dwarf2out_early_decl): Set dumped_early bit. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0aa4456..32c17ce 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -102,7 +102,7 @@ along with GCC; see the file COPYING3. If not see static void dwarf2out_source_line (unsigned int, const char *, int, bool); static rtx_insn *last_var_location_insn; static rtx_insn *cached_next_real_insn; -static void dwarf2out_decl (tree); +static dw_die_ref dwarf2out_decl (tree); #ifdef VMS_DEBUGGING_INFO int vms_file_stats_name (const char *, long long *, long *, char *, int *); @@ -2608,6 +2608,8 @@ typedef struct GTY((chain_circular ("%h.die_sib"))) die_struct { /* Die is used and must not be pruned as unused. */ BOOL_BITFIELD die_perennial_p : 1; BOOL_BITFIELD comdat_type_p : 1; /* DIE has a type signature */ + /* Die was generated early via dwarf2out_early_decl. */ + BOOL_BITFIELD dumped_early : 1; /* Lots of spare bits. */ } die_node; @@ -4808,6 +4810,21 @@ add_child_die (dw_die_ref die, dw_die_ref child_die) die->die_child = child_die; } +/* Unassociate CHILD from its parent, and make its parent be + NEW_PARENT. */ + +static void +reparent_child (dw_die_ref child, dw_die_ref new_parent) +{ + for (dw_die_ref p = child->die_parent->die_child; ; p = p->die_sib) +if (p->die_sib == child) + { + remove_child_with_prev (child, p); + break; + } + add_child_die (new_parent, child); +} + /* Move CHILD, which must be a child of PARENT or the DIE for which PARENT is the specification, to the end of PARENT's list of children. This is done by removing and re-adding it. */ @@ -4815,8 +4832,6 @@ add_child_die (dw_die_ref die, dw_die_ref child_die) static void splice_child_die (dw_die_ref parent, dw_die_ref child) { - dw_die_ref p; - /* We want the declaration DIE from inside the class, not the specification DIE at toplevel. */ if (child->die_parent != parent) @@ -4831,14 +4846,7 @@ splice_child_die (dw_die_ref parent, dw_die_ref child) || (child->die_parent == get_AT_ref (parent, DW_AT_specification))); - for (p = child->die_parent->die_child; ; p = p->die_sib) -if (p->die_sib == child) - { - remove_child_with_prev (child, p); - break; - } - - add_child_die (parent, child); + reparent_child (child, parent); } /* Return a pointer to a newly created DIE node. */ @@ -18288,16 +18296,17 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* ??? Hmmm, early dwarf generation happened earlier, so no sense in removing the parameters. Let's keep them and augment them with location information later. */ -#if 0 - /* Clear out the declaration attribute and the formal parameters. -Do not remove all children, because it is possible that this -declaration die was forced using force_decl_die(). In such -cases die that forced declaration die (e.g. TAG_imported_module) -is one of the children that we do not want to remove. */ - remove_AT (subr_die, DW_AT_declaration); - remove_AT (subr_die, DW_AT_object_pointer); - remove_child_TAG (subr_die, DW_TAG_formal_parameter); -#endif + if (!old_die->dumped_early) + { + /* Clear out the declaration attribute and the formal parameters. +Do not remove all children, because it is possible that this +declaration die was forced using force_decl_die(). In such +cases die that forced declaration die (e.g. TAG_imported_module) +is one of the children that we do not want to remove. */ + remove_AT (subr_die, DW_AT_declaration); +
Go patch committed: Disallow call of *T method using **T variable
This patch by Chris Manghane fixes the Go frontend to not permit calling a pointer method on *T with a variable of **T. Previously it was incorrectly dereferencing the **T to get a *T and using that to call the method. Fixing this required tweaking one test case. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. This fixes issue 8583 in the Go project. Ian Index: gcc/go/gofrontend/types.cc === --- gcc/go/gofrontend/types.cc (revision 213928) +++ gcc/go/gofrontend/types.cc (working copy) @@ -9453,10 +9453,11 @@ Type::bind_field_or_method(Gogo* gogo, c else go_unreachable(); go_assert(m != NULL); - if (dereferenced && m->is_value_method()) + if (dereferenced) { error_at(location, - "calling value method requires explicit dereference"); + "calling method %qs requires explicit dereference", + Gogo::message_name(name).c_str()); return Expression::make_error(location); } if (!m->is_value_method() && expr->type()->points_to() == NULL) Index: gcc/testsuite/go.test/test/fixedbugs/bug371.go === --- gcc/testsuite/go.test/test/fixedbugs/bug371.go (revision 213928) +++ gcc/testsuite/go.test/test/fixedbugs/bug371.go (working copy) @@ -8,10 +8,10 @@ package main -type T struct {} +type T struct{} func (t *T) pm() {} -func (t T) m() {} +func (t T) m() {} func main() { p := &T{} @@ -20,5 +20,5 @@ func main() { q := &p q.m() // ERROR "requires explicit dereference" - q.pm() + q.pm() // ERROR "requires explicit dereference" }
Re: [PATCH 4.8] libstdc++ pretty-printers: Backport Python 3 support from mainline
Ping! -- Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!