[ping] Fix error recovery issue with alias
http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01417.html Thanks in advance. -- Eric Botcazou
Re: [RFC] Issues with intraprocedural devirtualization
> On 08/17/2013 05:44 PM, Jan Hubicka wrote: > > 1) we want the type to not have base because we may have inlined the > > constructor. > > During construction the vtables are filled by base's vtable and thus we > > can > > not simply devirtualize based on the final virtual table without > > proving that > > constructor was not (partially) inlined. > > If the constructor is inlined into the current function, then we can > see the most recent assignment to the vptr and use that for > devirtualization. In most cases, yes. There are some special issues, like partial inlining (where the "wrong" assignment gets inlined, but the final assignment not) But I think tracking inlining those (it will need to make middle end aware of constructors that I think is good idea anyway) and leaving those to the constant propagation should work well enough in practice. > > >I do not know if one can do > >something like having automatic variable of class A and use placement new > >to change it to class B. > > This is something of a grey area in the standard, with a few defect > reports yet to be resolved. I think it should be undefined > behavior. I would preffer it being so ;) > > >Finally I decided to replace the lookup of base binfo by call to > >get_binfo_at_offset. This is not possible. For example my base > >variable can be: > > > >struct {class A a; class B b} var; > > > >and offset 10 may point to class B. Here I get an ICE since TYPE_BINFO > >of the structure is NULL (it is not class). > > I don't understand. In C++ a struct is a class. You are right. I get the ICE here only why I handle arrays and unions, too. (as I do in my tree, but not in the patches posted). In the example above the struct seems to have TYPE_BINFO even though it is useless. Since handling arrays and union seems to make sense and resolves some real testcases from firefox, I think we could keep the tree structured in a way making this possible. I.e. having the type walk as proposed in the patch instead of calling get_binfo_at_offset. > > >I wonder if we can track functions that return pointers/values of objects > >exactly of given type (i.e. no derivations). > > If the function returns by value, it's always a value of that exact type. OK, good! > > >Is the dynamic type upon return from constructor always known to be of > >constructor's type? > > Yes. > > > We may want to introduce assert_type_expr use like: > > > >obj_ptr = assert_type_expr obj_ptr; > > > >that can be dropped by FE for us to drive those more interesting cases, > > like > >partial construction. > > I guess we would need to be careful to insert those after vptr > assignments within the constructor body, as well. Yes, if we go this way, we will need C++ FE to produce the asserts. The original patch seems resonable? Honza > > Jason
Re: [RFC] Issues with intraprocedural devirtualization
> > On 08/17/2013 05:44 PM, Jan Hubicka wrote: > > > 1) we want the type to not have base because we may have inlined the > > > constructor. > > > During construction the vtables are filled by base's vtable and thus > > > we can > > > not simply devirtualize based on the final virtual table without > > > proving that > > > constructor was not (partially) inlined. > > > > If the constructor is inlined into the current function, then we can > > see the most recent assignment to the vptr and use that for > > devirtualization. > > In most cases, yes. There are some special issues, like partial inlining > (where the "wrong" assignment gets inlined, but the final assignment not) But > I > think tracking inlining those (it will need to make middle end aware of ^ of constructors, partial or not. > constructors that I think is good idea anyway) and leaving those to the > constant propagation should work well enough in practice. Basicaly if ctor of given type was inlined, we will make the assumption that the type can be partially constructed. > > >Finally I decided to replace the lookup of base binfo by call to > > >get_binfo_at_offset. This is not possible. For example my base > > >variable can be: > > > > > >struct {class A a; class B b} var; > > > > > >and offset 10 may point to class B. Here I get an ICE since TYPE_BINFO > > >of the structure is NULL (it is not class). > > > > I don't understand. In C++ a struct is a class. > > You are right. I get the ICE here only why I handle arrays and unions, too. ^^^ when > (as I do in my tree, but not in the patches posted). In the example above > the struct seems to have TYPE_BINFO even though it is useless. > > Since handling arrays and union seems to make sense and resolves some real > testcases from firefox, I think we could keep the tree structured in a way > making this possible. I.e. having the type walk as proposed in the patch > instead of calling get_binfo_at_offset. Honza
Re: [patch] documentation: clarify that Cilk Plus implementation is incomplete
On Wed, 26 Jun 2013, Aldy Hernandez wrote: This is a small cleanup to the Cilk Plus mention in our documentation, but more importantly, it clarifies that the Cilk Plus implementation in GCC is only partial. OK for trunk? * doc/invoke.texi (-fcilkplus): Clarify that implementation is incomplete. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index dd82880..3150c8d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1804,13 +1804,17 @@ have support for @option{-pthread}. @item -fcilkplus @opindex fcilkplus @cindex Enable Cilk Plus -Enable the usage of Cilk Language extension features for C/C++. When the flag -@option{-fcilkplus} is specified, all the Cilk Plus components are converted -to the appropriate C/C++ code. The present implementation follows ABI version -0.9. There are four major parts to Cilk Plus language -extension: Array Notations, Cilk Keywords, SIMD annotations and elemental -functions. Detailed information about Cilk Plus can be found at -@w{@uref{http://www.cilkplus.org}}. +When the option @option{-fcilkplus} is specified, enable the usage of +the Cilk Plus Language extension features for C/C++. The present +implementation follows ABI version 0.9. This is an experimental +feature that is only partially complete, and whose interface may +change in future versions of GCC, as the official specification +changes. Currently only the array notation feature of the language +specification has been implemented. More features will be implemented +in subsequent release cycles. + +Detailed information about Cilk Plus can be found at +@w{@uref{http://www.cilkplus.org}}. I would keep the first sentence as is, which is more in line how we generally describe options. No comma before "as the official". And personally I would omit the last sentence, but it's fine to keep if you really want to leave it. Fine with these changes. Thanks, Gerald
[wwwdocs] Streamline testing/index.html a bit
While looking at this page before asking Jan-Benedict to add his tester, I noticed some updates to make here. Streamline the first paragraph and split it in two. Remove reference to Michael Chastain's testing (which is not happening any more). Applied. Gerald Index: testing/index.html === RCS file: /cvs/gcc/wwwdocs/htdocs/testing/index.html,v retrieving revision 1.28 diff -u -3 -p -r1.28 index.html --- testing/index.html 21 Oct 2012 12:16:40 - 1.28 +++ testing/index.html 18 Aug 2013 10:51:08 - @@ -9,8 +9,9 @@ GCC Testing Efforts This page describes regular efforts to test GCC thoroughly, plus ideas -for additional testing by volunteers who have machine cycles to spare. -For basic information about running the GCC testsuites, see +for additional testing. + +For information about running the GCC testsuites, see http://gcc.gnu.org/install/test.html";>Installing GCC: Testing. For information about testsuite organization and adding new tests, see http://gcc.gnu.org/onlinedocs/gccint/Testsuites.html";> @@ -33,13 +34,6 @@ the test suite directories. send their test results to the http://gcc.gnu.org/ml/gcc-testresults/";>gcc-testresults mailing list. - - Michael Chastain runs the GDB test suite regularly and looks for - regressions caused by GCC debug output changes. He tests native - i686-pc-linux-gnu once every 4-10 days, and reports to the http://gcc.gnu.org/ml/gcc-testresults/";>gcc-testresults - and http://sourceware.org/ml/gdb-testers/";>gdb-testers - mailing lists. Ideas for further testing
Re: [PATCH][4.8][4.7][4.6] Make -shared-libgcc the default on Cygwin.
On Wed, 13 Mar 2013, Dave Korn wrote: > Committed revision 196634, with the attached documentation update and cvs > log entry: > > * htdocs/gcc-4.8/changes.html: Add OS-specific section and entry > for Windows (Cygwin). I applied this small editorial patch. Gerald Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v retrieving revision 1.119 diff -u -3 -p -r1.119 changes.html --- changes.html31 May 2013 08:49:25 - 1.119 +++ changes.html18 Aug 2013 11:56:32 - @@ -143,7 +143,7 @@ by this change. -fsanitize=thread. Instructions will be instrumented to detect data races. The ThreadSanitizer is available on x86-64 GNU/Linux. -A new local register allocator has been implemented, which +A new local register allocator (LRA) has been implemented, which replaces the 26 year old reload pass and improves generated code quality. For now it is active on the ia32 and x86-64 targets. @@ -858,11 +858,12 @@ int i = A().f(); // error, f() requires Executables are now linked against shared libgcc by default. The previous default was to link statically, which can still be -done by explicitly specifying -static or -static-libgcc on the +done by explicitly specifying -static or +static-libgcc on the command line. However it is strongly advised against, as it will cause problems for any application that makes use of DLLs compiled by GCC. It should be alright for a monolithic stand-alone -application that only links against the Windows OS DLLs, but +application that only links against the Windows DLLs, but offers little or no benefit.
Re: [ping] Fix error recovery issue with alias
> http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01417.html OK, thank you! Honza > > Thanks in advance. > > -- > Eric Botcazou
[Patch, Fortran, F03] PR 46271: OpenMP default(none) and procedure pointers
Hi all, here is a pretty-much-trivial patch for a problem with OpenMP and procedure pointers (proc-ptrs to functions are working, but not subroutines). Regtested on x86_64-unknown-linux-gnu. Will commit as obvious tomorrow if no one protests in the meantime ... Cheers, Janus 2013-08-18 Janus Weil PR fortran/46271 * openmp.c (resolve_omp_clauses): Bugfix for procedure pointers. 2013-08-18 Janus Weil PR fortran/46271 * gfortran.dg/gomp/proc_ptr_1.f90: New. pr46271.diff Description: Binary data proc_ptr_1.f90 Description: Binary data
[wwwdocs] gcc-4.8/changes.html -- use LRA as well
For GCC 4.8 we announced the new local register allocator. Some people might (and all of us on the lists) may be looking for it under the name of LRA, so I added that in parentheses. Gerald Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v retrieving revision 1.120 diff -u -3 -p -r1.120 changes.html --- changes.html18 Aug 2013 11:57:48 - 1.120 +++ changes.html18 Aug 2013 13:25:04 - @@ -143,7 +143,7 @@ by this change. -fsanitize=thread. Instructions will be instrumented to detect data races. The ThreadSanitizer is available on x86-64 GNU/Linux. -A new local register allocator has been implemented, which +A new local register allocator (LRA) has been implemented, which replaces the 26 year old reload pass and improves generated code quality. For now it is active on the ia32 and x86-64 targets.
Re: [Patch] Regex back-reference support
Bootstrap passed; tested under -m32, -m64, debug; ...and committed. -- Tim Shen
[PATCH] Fix tree-parloops (PR tree-optimization/58006)
Hi! take_address_of ICEs if an object has NULL DECL_NAME, the first hunk fixes that. But, there is no point creating extra runtime code for clobbers, like computing the address of the object, passing it from the serial code to the outlined parallelized routine and then just have a clobber there (not to mention that in 4.8 indirect clobbers aren't even allowed). So the patch also just kills clobbers from the parallelized regions. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.8? 2013-08-18 Jakub Jelinek PR tree-optimization/58006 * tree-parloops.c (take_address_of): Don't ICE if get_name returns NULL. (eliminate_local_variables_stmt): Remove clobber stmts. * g++.dg/opt/pr58006.C: New test. --- gcc/tree-parloops.c.jj 2013-05-06 17:08:48.0 +0200 +++ gcc/tree-parloops.c 2013-08-16 16:35:54.454310095 +0200 @@ -494,9 +494,12 @@ take_address_of (tree obj, tree type, ed if (gsi == NULL) return NULL; addr = TREE_OPERAND (*var_p, 0); - name = make_temp_ssa_name (TREE_TYPE (addr), NULL, -get_name (TREE_OPERAND - (TREE_OPERAND (*var_p, 0), 0))); + const char *obj_name + = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0)); + if (obj_name) + name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name); + else + name = make_ssa_name (TREE_TYPE (addr), NULL); stmt = gimple_build_assign (name, addr); gsi_insert_on_edge_immediate (entry, stmt); @@ -694,6 +697,12 @@ eliminate_local_variables_stmt (edge ent dta.changed = true; } } + else if (gimple_clobber_p (stmt)) +{ + stmt = gimple_build_nop (); + gsi_replace (gsi, stmt, false); + dta.changed = true; +} else { dta.gsi = gsi; --- gcc/testsuite/g++.dg/opt/pr58006.C.jj 2013-08-16 16:55:49.398132255 +0200 +++ gcc/testsuite/g++.dg/opt/pr58006.C 2013-08-16 16:54:13.0 +0200 @@ -0,0 +1,22 @@ +// PR tree-optimization/58006 +// { dg-do compile } +// { dg-require-effective-target pthread } +// { dg-options "-Ofast -ftree-parallelize-loops=2" } + +extern "C" float sqrtf (float); + +struct S +{ + float i, j; + float foo () const { return sqrtf (i * i + j * j); } + S () : i (1), j (1) {} +}; + +void +bar (int a, int b) +{ + int i; + float f; + for (i = a; i < b; i++) +f = S ().foo (); +} Jakub
Re: [PATCH] Fix tree-parloops (PR tree-optimization/58006)
Jakub Jelinek wrote: >Hi! > >take_address_of ICEs if an object has NULL DECL_NAME, the first hunk >fixes >that. But, there is no point creating extra runtime code for clobbers, >like >computing the address of the object, passing it from the serial code to >the >outlined parallelized routine and then just have a clobber there (not >to >mention that in 4.8 indirect clobbers aren't even allowed). So the >patch >also just kills clobbers from the parallelized regions. > >Bootstrapped/regtested on x86_64-linux and i686-linux, ok for >trunk/4.8? > Ok, Thanks, Richard. >2013-08-18 Jakub Jelinek > > PR tree-optimization/58006 > * tree-parloops.c (take_address_of): Don't ICE if get_name > returns NULL. > (eliminate_local_variables_stmt): Remove clobber stmts. > > * g++.dg/opt/pr58006.C: New test. > >--- gcc/tree-parloops.c.jj 2013-05-06 17:08:48.0 +0200 >+++ gcc/tree-parloops.c2013-08-16 16:35:54.454310095 +0200 >@@ -494,9 +494,12 @@ take_address_of (tree obj, tree type, ed > if (gsi == NULL) > return NULL; > addr = TREE_OPERAND (*var_p, 0); >- name = make_temp_ssa_name (TREE_TYPE (addr), NULL, >- get_name (TREE_OPERAND >- (TREE_OPERAND (*var_p, 0), 0))); >+ const char *obj_name >+ = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0)); >+ if (obj_name) >+ name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name); >+ else >+ name = make_ssa_name (TREE_TYPE (addr), NULL); > stmt = gimple_build_assign (name, addr); > gsi_insert_on_edge_immediate (entry, stmt); > >@@ -694,6 +697,12 @@ eliminate_local_variables_stmt (edge ent > dta.changed = true; > } > } >+ else if (gimple_clobber_p (stmt)) >+{ >+ stmt = gimple_build_nop (); >+ gsi_replace (gsi, stmt, false); >+ dta.changed = true; >+} > else > { > dta.gsi = gsi; >--- gcc/testsuite/g++.dg/opt/pr58006.C.jj 2013-08-16 16:55:49.398132255 >+0200 >+++ gcc/testsuite/g++.dg/opt/pr58006.C 2013-08-16 16:54:13.0 >+0200 >@@ -0,0 +1,22 @@ >+// PR tree-optimization/58006 >+// { dg-do compile } >+// { dg-require-effective-target pthread } >+// { dg-options "-Ofast -ftree-parallelize-loops=2" } >+ >+extern "C" float sqrtf (float); >+ >+struct S >+{ >+ float i, j; >+ float foo () const { return sqrtf (i * i + j * j); } >+ S () : i (1), j (1) {} >+}; >+ >+void >+bar (int a, int b) >+{ >+ int i; >+ float f; >+ for (i = a; i < b; i++) >+f = S ().foo (); >+} > > Jakub
[Patch, libgcov, committed] fix PR 58127
Hi, This was approved by Honza in the PR thread. applied as 201829 cheers Iain libgcc: PR gcov-profile/58127 * libgcov.c (__gcov_indirect_call_callee): Don't make this a __thread var for emulated TLS. (__gcov_indirect_call_counters): Likewise. Index: libgcc/libgcov.c === --- libgcc/libgcov.c(revision 201825) +++ libgcc/libgcov.c(working copy) @@ -1162,11 +1162,11 @@ __gcov_indirect_call_profiler (gcov_type* counter, The variables are set directly by GCC instrumented code, so declaration here must match one in tree-profile.c */ -#ifdef HAVE_CC_TLS +#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif void * __gcov_indirect_call_callee; -#ifdef HAVE_CC_TLS +#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) __thread #endif gcov_type * __gcov_indirect_call_counters;
Re: [ping] Fix error recovery issue with alias
The test gnat.dg/specs/linker_alias.ads fails on x86_64-apple-darwin10: FAIL: gnat.dg/specs/linker_alias.ads (test for errors, line 5) FAIL: gnat.dg/specs/linker_alias.ads (test for excess errors) with :0:0: error: only weak aliases are supported in this configuration gnatmake: "/opt/gcc/work/gcc/testsuite/gnat.dg/specs/linker_alias.ads" compilation error Dominique
Type inheritance graph analysis & speculative devirtualization, part 2/6 (type inheritance graph builder)
Hi, this patch implements the type inheritance graph builder. Once the graph is built it stays in memory and unchanged thorough the compilation (we do not expect to invent new virtual methods during the optimization) The graph is dumped into new IPA dump file "type-inheritance". Construction does not work in LTO. I will update and post the code to merge types based on ODR in an followup patch. There is new function to lookup possible targets of given polymorphic call and function to dump those. Callgraph construction is extended so obviously unreachable virtual functions are not lowered and are removed early. Result of target lookups are stored in a global cache that is flushed each time when any virtual function that is target of a virtual call is removed. This probably won't happen too many times in a practice - generally only after remove_unreachable_function when given type of virtual calls becomes dead. I founded ipa-devirt file for the code. It is supposed to be used by IPA passes, but also by the intraprocedural gimple OBJ_TYPE_REF folding. I think, as a followup, we can move there other devirtualization related tools and analysis - get_binfo_at_offset, gimple_get_virt_method_for_binfo and logic checking dynamic type changes. The construction and target lookup seems to work resonably well for Firefox LTO build. The time spent by polymorphic call target lookup is about 2%. This is still more than it needs to be. Most of time is spent by parsing vtables the difficult way via gimple_get_virt_method_for_binfo. This can be fixed by representing vtables directly in the type-inheritance graph, but also by implementing gimple_get_virt_method_for_binfo in less general way (it goes through folding ctor access, figuring out if method can be references and doing other expensive and unnecesary steps). Bootstrapped/regtested ppc64-linux. Will commit it tomorrow if there are no objections. Any comments are welcome. Honza * Makeifle-in (ipa-devirt.o): New. (GTFILES): Add ipa-utils.h and ipa-devirt.c * cgraphunit.c (decide_is_symbol_needed): Do not care about virtuals. (analyze_functions): Look into possible targets of polymorphic call. * dumpfile.c (dump_files): Add type-inheritance dump. * dumpfile.h (TDI_inheritance): New. * ipa-devirt.c: New file. * ipa-utils.h (odr_type_d): Forward declare. (odr_type): New type. (build_type_inheritance_graph): Declare. (possible_polymorphic_call_targets): Declare and introduce inline variant when only edge is pased. (dump_possible_polymorphic_call_targets): Likewise. * timevar.def (TV_IPA_INHERITANCE, TV_IPA_VIRTUAL_CALL): New. * tree.c (type_in_anonymous_namespace_p): Break out from ... (types_same_for_odr): ... here. * tree.h (type_in_anonymous_namespace_p): Declare. * g++.dg/ipa/type-inheritance-1.C: New testcase. Index: Makefile.in === --- Makefile.in (revision 201824) +++ Makefile.in (working copy) @@ -1275,6 +1275,7 @@ OBJS = \ init-regs.o \ internal-fn.o \ ipa-cp.o \ + ipa-devirt.o \ ipa-split.o \ ipa-inline.o \ ipa-inline-analysis.o \ @@ -2945,6 +2946,9 @@ ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) co $(TREE_PASS_H) $(GIMPLE_H) $(TARGET_H) $(GGC_H) pointer-set.h \ $(IPA_UTILS_H) tree-inline.h $(HASH_TABLE_H) profile.h $(PARAMS_H) \ $(LTO_STREAMER_H) $(DATA_STREAMER_H) +ipa-devirt.o : ipa-devirt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) \ + $(GIMPLE_H) $(TARGET_H) $(GGC_H) pointer-set.h \ + $(IPA_UTILS_H) $(HASH_TABLE_H) ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \ $(TREE_FLOW_H) $(TM_H) $(TREE_PASS_H) $(FLAGS_H) $(TREE_H) \ @@ -3784,7 +3788,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h $(srcdir)/cgraph.h \ $(srcdir)/reload.h $(srcdir)/caller-save.c $(srcdir)/symtab.c \ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ - $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c \ + $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-utils.h \ $(srcdir)/dbxout.c \ $(srcdir)/dwarf2out.h \ $(srcdir)/dwarf2asm.c \ @@ -3826,7 +3830,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp $(srcdir)/ipa-inline.h \ $(srcdir)/vtable-verify.c \ $(srcdir)/asan.c \ - $(srcdir)/tsan.c \ + $(srcdir)/tsan.c $(srcdir)/ipa-devirt.c \ @all_gtfiles@ # Compute the list of GT header files from the corresponding C sources, Index: cgraphunit.c === --- cgraphunit.c(revision 201824) +++ cgraphunit.c(working copy) @@ -235,10 +235,6 @@ decide_is_symbol_needed (symtab_node nod if (!node->symbol.definition)
[Patch, backport 4.7] fix pr48109 on the branch.
Hi The PR was fixed on trunk by ... http://gcc.gnu.org/ml/gcc-patches/2012-06/msg01185.html .. before 4.8 forked and is thus fixed everywhere except 4.7. This is a wrong code bug under LTO and was reported against 4.6, so I'd like to back port it to 4.7. [FWIW, the only change needed is add_asm_node() => cgraph_add_asm_node()] OK? Iain
Re: [ping] Fix error recovery issue with alias
> The test gnat.dg/specs/linker_alias.ads fails on x86_64-apple-darwin10: > > FAIL: gnat.dg/specs/linker_alias.ads (test for errors, line 5) > FAIL: gnat.dg/specs/linker_alias.ads (test for excess errors) > > with > > :0:0: error: only weak aliases are supported in this > configuration gnatmake: > "/opt/gcc/work/gcc/testsuite/gnat.dg/specs/linker_alias.ads" compilation > error Can you try and add pragma Weak_External (Var); on line 8 and see whether it passes? If so, you can commit the patchlet. -- Eric Botcazou
Re: RFA: Fix declaration of default value of TARGET_NARROW_VOLATILE_BITFIELD
Hi Nick, it looks this patch did not get applied. Is this because you failed to get approval? With a patch Joseph did recently, this would now be in gcc/target.def, and from what I can see both parts of the patch are fine. Unless anyone objects, can you please ago ahead and commit an update patch? Thanks, Gerald On Wed, 24 Apr 2013, Nick Clifton wrote: > The TARGET_NARROW_VOLATILE_BITFIELD target macro defaults to false: > > DEFHOOK > (narrow_volatile_bitfield, > "", > bool, (void), > hook_bool_void_false) > > but the documentation currently states that it defaults to > !TARGET_STRICT_ALIGN. The patch below corrects this, and also fixes a > small typo in the description of TARGET_CANONICALIZE_COMPARISON. > > Ok to apply ? > > Cheers > Nick > > gcc/ChangeLog > 2013-04-24 Nick Clifton > > * doc/tm.texi.in (TARGET_NARROW_VOLATILE_BITFIELD): Change the > default to false. > (TARGET_CANONICALIZE_COMPARISON); Correct typo. > * doc/tm.texi: Regenerate. > > Index: gcc/doc/tm.texi.in > === > --- gcc/doc/tm.texi.in(revision 198216) > +++ gcc/doc/tm.texi.in(working copy) > @@ -1236,7 +1236,7 @@ > should use the narrowest mode possible. It should return @code{false} if > these accesses should use the bitfield container type. > > -The default is @code{!TARGET_STRICT_ALIGN}. > +The default is @code{false}. > @end deftypefn > > @hook TARGET_MEMBER_TYPE_FORCES_BLK > @@ -5947,7 +5947,7 @@ > valid but will see if the resulting insn matches a pattern in the > @file{md} file. > > -You need not to implement this hook if it would never change the > +You need not implement this hook if it would never change the > comparison code or operands. > @end deftypefn
Re: [PATCH] Add a new option "-fstack-protector-strong"
Hi H., On Mon, 15 Apr 2013, Han Shen(沈涵) wrote: > Hi, I'm to bring up this patch about '-fstack-protector-strong' for trunk. > > Background - some times stack-protector is too-simple while > stack-protector-all over-kills, for example, to build one of our core > systems, we forcibly add "-fstack-protector-all" to all compile > commands, which brings big performance penalty (due to extra stack > guard/check insns on function prologue and epilogue) on both atom and > arm. To use "-fstack-protector" is just regarded as not secure enough > (only "protects" <2% functions) by the system secure team. So I'd like > to add the option "-fstack-protector-strong", that hits the balance > between "-fstack-protector" and "-fstack-protector-all". the patch has been committed, but I see that the release notes at http://gcc.gnu.org/gcc-4.9/changes.html do not mentioned this. Can you please add a note? (http://gcc.gnu.org/about.html has some background on our web site setup, and I am working to consolidate all our documentation in this area -- plus I am happy to lend a helping hand.) Gerald
[wwwdocs] PATCH for Re: [Ada] gnatname creates backup copy of project file
On Thu, 11 Apr 2013, Arnaud Charlet wrote: > Another important change was done in this commit, I've updated the changelog > accordingly: > > (Ada_Version_Default): Switch to Ada 2012 by default. > > Since Ada 2012 is the new Ada standard, GNAT is switched to Ada 2012 > instead of Ada 2005 by default. I updated the release notes as follows. (The change around C++ is for the sake of consistency.) Gerald Index: gcc-4.9/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.9/changes.html,v retrieving revision 1.24 diff -u -3 -p -r1.24 changes.html --- gcc-4.9/changes.html12 Aug 2013 06:02:04 - 1.24 +++ gcc-4.9/changes.html18 Aug 2013 19:41:31 - @@ -41,10 +41,11 @@ New Languages and Language specific improvements - +Ada + +GNAT switched to Ada 2012 instead of Ada 2005 by default. + C family @@ -82,9 +83,7 @@ --> - - -C++ +C++ The G++ implementation of C++1y return type deduction for normal
[Patch Darwin/Objc] Fix PR 48094.
Hi, The PR is a(nother) bad interaction between [Darwin/NeXT] ObjC meta-data and LTO. (for the NeXT runtime) the compiler emits a small block of meta-data "ImageInfo" that conveys to the run-time whether the User had enabled fix-and-continue or objc-gc. Since these data are anonymous (the run time finds these data by examining the sections) when we have multiple files, and LTO, we end up with multiple copies of the metadata - which get concatenated. This is correct behaviour - LTO-wise, but wrong behaviour run-time wise; when presented with multiple objects, the linker normally processes the input copies and produces just one output. It now complains that that specific meta-data section is too large (we've always been emitting the wrong data, but only picked up on this when the system linker became more picky). We can't make the section merge-able, or comdat - the first won't work if multiple inputs have differing flags, and the second isn't correct section flags for the runtime. --- Fortunately, the content of the particular meta-data section only depends on command line switches; Further, these should be the switches in force when the back end runs - and thus should be the switches on the LTO command line. So the fix proposed does this: (i) removes the generation of this meta-data from the ObjC FE. (ii) make LTO recognise the relevant c/l switches. (iii) detect the presence of ObjC/ObjC++ [classes or other metadata] during code-gen. (iv) When objc is detected emit the ImageInfo section from the backend. I did think that there should perhaps be some consideration of keeping the flags and merging them in LTO. However, I don't think we need to do this with the current code-gen. There is also evidence that this capability is "going away" in modern Darwin/OSX versions. In any event, this is an incremental improvement, fixing the cases we see at present; preserving and checking flags in LTO would be an enhancement that could be provided if it proves necessary. OK for trunk, and open branches? (wrong code). Iain gcc/c-family: * c.opt (fgnu-runtime, fnext-runtime, fobjc-abi-version, fobjc-gc, freplace-objc-classes): Accept for LTO. gcc: * config/darwin.c (darwin_objc2_section): Note if ObjC Metadata is seen. (darwin_objc1_section): Likewise. (darwin_file_end): Emit Image Info section when required. gcc/objc: * objc-next-runtime-abi-01.c (generate_objc_image_info): Remove. (objc_generate_v1_next_metadata): Remove generation of ImageInfo. * objc-next-runtime-abi-02.c (generate_v2_objc_image_info): Remove. (objc_generate_v2_next_metadata): Remove generation of ImageInfo. diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 9690a08..b2c5c03 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -941,7 +941,7 @@ C++ ObjC++ Var(flag_no_gnu_keywords, 0) Recognize GNU-defined keywords fgnu-runtime -ObjC ObjC++ Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME) +ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME) Generate code for GNU runtime environment fgnu89-inline @@ -1015,7 +1015,7 @@ fnew-abi C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fnext-runtime -ObjC ObjC++ Report RejectNegative Var(flag_next_runtime) +ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime) Generate code for NeXT (Apple Mac OS X) runtime environment fnil-receivers @@ -1033,7 +1033,7 @@ C++ ObjC++ Optimization Var(flag_nothrow_opt) Treat a throw() exception specification as noexcept to improve code size fobjc-abi-version= -ObjC ObjC++ Joined Report RejectNegative UInteger Var(flag_objc_abi) +ObjC ObjC++ LTO Joined Report RejectNegative UInteger Var(flag_objc_abi) Specify which ABI to use for Objective-C family code and meta-data generation. ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods @@ -1053,7 +1053,7 @@ ObjC ObjC++ Var(flag_objc_exceptions) Enable Objective-C exception and synchronization syntax fobjc-gc -ObjC ObjC++ Var(flag_objc_gc) +ObjC ObjC++ LTO Var(flag_objc_gc) Enable garbage collection (GC) in Objective-C/Objective-C++ programs fobjc-nilcheck @@ -1113,7 +1113,7 @@ C++ ObjC++ Var(flag_pretty_templates) Init(1) -fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments freplace-objc-classes -ObjC ObjC++ Var(flag_replace_objc_classes) +ObjC ObjC++ LTO Var(flag_replace_objc_classes) Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime frepo diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index e07fa4c..d470003 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1329,6 +1329,9 @@ is_objc_metadata (tree decl) return NULL_TREE; } +static int classes_seen; +static int objc_metadata_seen; + /* Return the section required for Objective C ABI 2 metadata. *
[wwwdocs] Consolidate GCC web pages documentation (1/3)
This is something I wanted to do for ages -- shorten some of the documentation, and merge three pages into one. This is the first, and largest step. Streamline about.html a bit and merge (a streamlined version of) cvs.html into about.html, removing cvs.html after all those years. Installed. Gerald Index: about.html === RCS file: /cvs/gcc/wwwdocs/htdocs/about.html,v retrieving revision 1.17 diff -u -3 -p -r1.17 about.html --- about.html 21 Sep 2006 14:17:36 - 1.17 +++ about.html 18 Aug 2013 20:28:32 - @@ -10,27 +10,76 @@ These pages are maintained by the GCC team, which consists of numerous -http://gcc.gnu.org/onlinedocs/gcc/Contributors.html";>volunteers -and contributors. +http://gcc.gnu.org/onlinedocs/gcc/Contributors.html";> +contributors. -The web effort was originally led by Jeff Law and later Gerald Pfeifer. -These days, Gerald and Janis Johnson maintain the web pages, but again, -there are lots of people who contribute. - -The pages on gcc.gnu.org are updated "live" (that is, directly after -a change has been made); www.gnu.org is updated once a day at 4:00 -0700 +The web effort was originally led by Jeff Law. For the last decade +or so Gerald Pfeifer has been leading the effort, but again, there are +lots of people who contribute. + +The web pages are under CVS control and you +can http://gcc.gnu.org/cgi-bin/cvsweb.cgi/wwwdocs/";>browse +the repository online. +The pages on gcc.gnu.org are updated "live" (that is, directly after a +change has been made); www.gnu.org is updated once a day at 4:00 -0700 (PDT). Please send feedback, problem reports and patches to our mailing lists. -The web pages are under CVS control. Changes -to the CVS repository immediately propagate to the web server and you -can easily track any changes or contribute some of your own. - - Want to contribute? Please check our TODO list! + + + +Using the CVS repository + +Assuming you have both CVS +and SSH installed, you can check out the web pages as follows: + + + Set CVS_RSH in your environment to ssh. + cvs -q -d :ext:username@gcc.gnu.org:/cvs/gcc checkout +-P wwwdocs where username is your user name at gcc.gnu.org + + +For anonymous access, use +-d :pserver:c...@gcc.gnu.org:/cvs/gcc instead. + + +Checking in a change + +The following is a very quick overview of how +to check in a change. We recommend you list files explicitly +to avoid accidental checkins and prefer that each checkin be of a +complete, single logical change. + + +Sync your sources with the master repository via "cvs +update". +This will also identify any files in your local +tree that you have modified. + +We recommend reviewing the output of "cvs diff". + +Use "cvs commit" to check in the patch. + +Upon checkin a message will be sent to the gcc-cvs-wwwdocs mailing +list. + + + +The host system + +The setup of the machine running the gcc.gnu.org site is also +available, through +http://sourceware.org/cgi-bin/cvsweb.cgi/?cvsroot=sourceware";> +cvsweb and anonymous read-only CVS. Use the same procedure +as above, but use +:pserver:anon...@gcc.gnu.org:/cvs/sourceware for the +repository and infra for the module. + + Index: cvs.html === RCS file: cvs.html diff -N cvs.html --- cvs.html21 Jun 2012 00:26:32 - 1.221 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -1,71 +0,0 @@ - - - - - -GCC: CVS access to our web pages - - - -GCC: CVS access to our web pages - -Our web pages and related scripts are available via our CVS -repository. You can also http://gcc.gnu.org/cgi-bin/cvsweb.cgi/wwwdocs/";>browse them -online or view details on the -setup. - -Using the CVS repository - -Assuming you have both CVS -and SSH installed, you can check out the web pages as follows: - - - Set CVS_RSH in your environment to ssh. - cvs -q -d :ext:username@gcc.gnu.org:/cvs/gcc checkout --P wwwdocs where username is your user name at gcc.gnu.org - - -For anonymous access, use --d :pserver:c...@gcc.gnu.org:/cvs/gcc instead. - - - -Checking in a change - -When you check in changes to our web pages, they will -automatically be checked out into the web server's data area. - -The following is a very quick overview of how -to check in a change. We recommend you list files explicitly -to avoid accidental checkins and prefer that each checkin be of a -complete, single logical change. - - -Sync your sources with the master repository via "cvs -update". -This will also identify any files in your local -tree that you have modified. - -We recommend reviewing the output of "cvs diff" after -applying a patch to a local tree. - -Use "cvs commit" to check in the patch. - -Upon successfull checkin a message will be sent to the -gcc-cvs-wwwdocs mailing list. - - - -The host system - -The setup of the machine running the gcc.gnu.org site is also -available, through -http://sourceware.org/cgi-bin/cvsweb.cgi/?cvsroot=so
[wwwdocs] Consolidate GCC web pages documentation (2/3)
This is the second part, mostly mechanical, but also giving us the opportunity to streamline a bit further. Replace remaining references to cvs.html. Shorten descriptive text around these reference. Installed. Gerald Index: contribute.html === RCS file: /cvs/gcc/wwwdocs/htdocs/contribute.html,v retrieving revision 1.80 diff -u -3 -p -r1.80 contribute.html --- contribute.html 22 May 2013 19:08:02 - 1.80 +++ contribute.html 18 Aug 2013 20:54:29 - @@ -177,7 +177,7 @@ file" mode of the validator. Please mark patches with the tag [wwwdocs] in the subject line. -Web site sources are in CVS. +Web site sources are in CVS. Submitting Patches Index: svn.html === RCS file: /cvs/gcc/wwwdocs/htdocs/svn.html,v retrieving revision 1.187 diff -u -3 -p -r1.187 svn.html --- svn.html5 Aug 2013 07:27:40 - 1.187 +++ svn.html18 Aug 2013 20:54:29 - @@ -17,12 +17,11 @@ large. That way you can pick up any version (including releases) of GCC that is in our repository. -Our web pages are still maintained via CVS, and can be accessed -using the directions for our CVS setup. - In addition you can http://gcc.gnu.org/viewcvs/";>browse our SVN history online. +(Our web pages are managed via CVS.) + Using the SVN repository Index: svnwrite.html === RCS file: /cvs/gcc/wwwdocs/htdocs/svnwrite.html,v retrieving revision 1.26 diff -u -3 -p -r1.26 svnwrite.html --- svnwrite.html 3 Feb 2012 22:07:56 - 1.26 +++ svnwrite.html 18 Aug 2013 20:54:30 - @@ -15,8 +15,7 @@ significant developers. Maintainers are also encouraged to edit our bugs database. -Read/write access to the wwwdocs repository containing GCC -www documents is still done using CVS +Our web pages are managed via CVS. Index: projects/web.html === RCS file: /cvs/gcc/wwwdocs/htdocs/projects/web.html,v retrieving revision 1.13 diff -u -3 -p -r1.13 web.html --- projects/web.html 21 Jun 2012 00:03:19 - 1.13 +++ projects/web.html 18 Aug 2013 20:54:32 - @@ -8,11 +8,8 @@ GCC: Web Pages -Contributing changes to -our web pages is simple. - -Our web pages are managed via CVS and can be accessed using the -directions for our CVS setup. +Contributing changes +to our web pages is simple. As changes are checked in, the respective pages are preprocessed via the script wwwdocs/bin/preprocess which in turn
Re: Fix class type lookup from OBJ_TYPE_REF
On Aug 17, 2013, at 8:54 AM, Jan Hubicka wrote: > Moreover objc apparently never produce any virtual functions/methods. Objective-C++ might. :-) > Can someone explain me in greater detail how the objc use works? Objective-C uses it to manage code generation for post-increments of method calls that involve a cast… in greater detail, no, that's just from a quick read of the code.
Re: [Patch, backport 4.7] fix pr48109 on the branch.
On Aug 18, 2013, at 11:44 AM, Iain Sandoe wrote: > The PR was fixed on trunk by ... > > http://gcc.gnu.org/ml/gcc-patches/2012-06/msg01185.html > > .. before 4.8 forked and is thus fixed everywhere except 4.7. > > This is a wrong code bug under LTO and was reported against 4.6, so I'd like > to back port it to 4.7. > > [FWIW, the only change needed is add_asm_node() => cgraph_add_asm_node()] > > OK? Ok.
Re: [Patch Darwin/Objc] Fix PR 48094.
On Aug 18, 2013, at 12:52 PM, Iain Sandoe wrote: > The PR is a(nother) bad interaction between [Darwin/NeXT] ObjC meta-data and > LTO. > > So the fix proposed does this: > > (i) removes the generation of this meta-data from the ObjC FE. > (ii) make LTO recognise the relevant c/l switches. > (iii) detect the presence of ObjC/ObjC++ [classes or other metadata] during > code-gen. > (iv) When objc is detected emit the ImageInfo section from the backend. > OK for trunk, and open branches? Ok.
RE: [PATCH] Fix for PR c/57490
> -Original Message- > From: Jason Merrill [mailto:ja...@redhat.com] > Sent: Saturday, August 17, 2013 12:55 AM > To: Iyer, Balaji V; Rainer Orth > Cc: Jakub Jelinek; gcc-patches@gcc.gnu.org; Marek Polacek > (pola...@redhat.com) > Subject: Re: [PATCH] Fix for PR c/57490 > > On 08/16/2013 02:13 PM, Iyer, Balaji V wrote: > >>> + /* If it is a built-in array notation function, then the return type of > >>> + the function is the type of the array passed in as array notation. > >>> */ > >> > >> How can the function return an array? > > > > float x, A[10]; > > x = __sec_reduce_add (A[:]); // The sec_reduce_add function's return type is > the type of A[] which is float. > > Ah, then the comment should say "...is the element type of the array...". Thanks. Here is a fixed patch. Is this Ok for trunk? Here are the ChangeLog entries gcc/c/ChangeLog 2013-08-18 Balaji V. Iyer PR c/57490 * c-array-notation.c (fix_conditional_array_notations_1): Added a check for truth values. (expand_array_notation_exprs): Added truth values case. Removed an unwanted else. Added for-loop to walk through subtrees in default case. gcc/cp/ChangeLog 2013-08-18 Balaji V. Iyer PR c/57490 * cp-array-notation.c (cp_expand_cond_array_notations): Added a check for truth values. (expand_array_notation_exprs): Added truth values case. Removed an unwanted else. Added for-loop to walk through subtrees in default case. * typeck.c (cp_build_binary_op): Inherited the type of the array notation for built-in array notation functions. gcc/testsuite/ChangeLog 2013-08-18 Balaji V. Iyer PR c/57490 * c-c++-common/cilk-plus/AN/pr57490.c: New test. sincerely, Balaji V. Iyer. > > Jason diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index 7788f7b..5747bcb 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -906,6 +906,8 @@ fix_conditional_array_notations_1 (tree stmt) cond = COND_EXPR_COND (stmt); else if (TREE_CODE (stmt) == SWITCH_EXPR) cond = SWITCH_COND (stmt); + else if (truth_value_p (TREE_CODE (stmt))) +cond = TREE_OPERAND (stmt, 0); else /* Otherwise dont even touch the statement. */ return stmt; @@ -1232,6 +1234,12 @@ expand_array_notation_exprs (tree t) case BIND_EXPR: t = expand_array_notation_exprs (BIND_EXPR_BODY (t)); return t; +case TRUTH_ORIF_EXPR: +case TRUTH_ANDIF_EXPR: +case TRUTH_OR_EXPR: +case TRUTH_AND_EXPR: +case TRUTH_XOR_EXPR: +case TRUTH_NOT_EXPR: case COND_EXPR: t = fix_conditional_array_notations (t); @@ -1246,8 +1254,6 @@ expand_array_notation_exprs (tree t) COND_EXPR_ELSE (t) = expand_array_notation_exprs (COND_EXPR_ELSE (t)); } - else - t = expand_array_notation_exprs (t); return t; case STATEMENT_LIST: { @@ -1284,6 +1290,10 @@ expand_array_notation_exprs (tree t) Replace those with just void zero node. */ t = void_zero_node; default: + for (int ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (t)); ii++) + if (contains_array_notation_expr (TREE_OPERAND (t, ii))) + TREE_OPERAND (t, ii) = + expand_array_notation_exprs (TREE_OPERAND (t, ii)); return t; } return t; diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index eb6a70d..f4581f0 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -857,6 +857,19 @@ cp_expand_cond_array_notations (tree orig_stmt) return error_mark_node; } } + else if (truth_value_p (TREE_CODE (orig_stmt))) +{ + size_t left_rank = 0, right_rank = 0; + tree left_expr = TREE_OPERAND (orig_stmt, 0); + tree right_expr = TREE_OPERAND (orig_stmt, 1); + if (!find_rank (EXPR_LOCATION (left_expr), left_expr, left_expr, true, + &left_rank) + || !find_rank (EXPR_LOCATION (right_expr), right_expr, right_expr, +true, &right_rank)) + return error_mark_node; + if (right_rank == 0 && left_rank == 0) + return orig_stmt; +} if (!find_rank (EXPR_LOCATION (orig_stmt), orig_stmt, orig_stmt, true, &rank)) @@ -1213,6 +1226,12 @@ expand_array_notation_exprs (tree t) if (TREE_OPERAND (t, 0) == error_mark_node) return TREE_OPERAND (t, 0); return t; +case TRUTH_ANDIF_EXPR: +case TRUTH_ORIF_EXPR: +case TRUTH_AND_EXPR: +case TRUTH_OR_EXPR: +case TRUTH_XOR_EXPR: +case TRUTH_NOT_EXPR: case COND_EXPR: t = cp_expand_cond_array_notations (t); if (TREE_CODE (t) == COND_EXPR) @@ -1222,8 +1241,6 @@ expand_array_notation_exprs (tree t) COND_EXPR_ELSE (t) = expand_array_notation_exprs (COND_EXPR_ELSE (t)); } - else - t = expand_array_notation_exprs (t);
[c++-concepts] Merge from trunk
The c++-concepts branch was synchronized with trunk at revision 201834. -- Gaby
[RS6000] Fix for PR57865, _savegpr64 breakage on spe
When I made the following change -#define FIRST_SAVED_GP_REGNO 13 +#define FIRST_SAVED_GP_REGNO (FIXED_R13 ? 14 : 13) in http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01274.html, I checked all uses of FIRST_SAVED_GP_REGNO, but missed the signifigance of FIRST_SAVRES_REGISTER appearing in the ool_adjust calculation. Using FIRST_SAVRES_REGISTER in ool_adjust was not exactly the best choice of available constants. Why use a value that is the minimum over gp, fp and vector regs, when what you need is specific to gp regs? Fixed as follows, bootstrapped and regression tested. OK for mainline and 4.8? PR target/57865 * config/rs6000/rs6000.c (rs6000_emit_prologue): Correct ool_adjust. (rs6000_emit_epilogue): Likewise. Index: gcc/config/rs6000/rs6000.c === --- gcc/config/rs6000/rs6000.c (revision 200501) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -21043,8 +21039,7 @@ rs6000_emit_prologue (void) HOST_WIDE_INT offset; if (!(strategy & SAVE_INLINE_GPRS)) - ool_adjust = 8 * (info->first_gp_reg_save - - (FIRST_SAVRES_REGISTER + 1)); + ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO); offset = info->spe_gp_save_offset + frame_off - ool_adjust; spe_save_area_ptr = gen_rtx_REG (Pmode, 11); save_off = frame_off - offset; @@ -22286,8 +22281,7 @@ rs6000_emit_epilogue (int sibcall) anew to every function. */ if (!restoring_GPRs_inline) - ool_adjust = 8 * (info->first_gp_reg_save - - (FIRST_SAVRES_REGISTER + 1)); + ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO); frame_reg_rtx = gen_rtx_REG (Pmode, 11); emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, GEN_INT (info->spe_gp_save_offset -- Alan Modra Australia Development Lab, IBM
[PATCH] lower-subreg and IBM long double
On Tue, Jun 11, 2013 at 09:56:11AM +0930, Alan Modra wrote: >[snip] > It isn't hard to see why we are going wrong. IBM long double is > really a two element array of double, and the rs6000 backend uses > subregs to access the elements. The problem is that lower-subreg > lowers to word_mode, so we get DImode. word_mode makes sense for most > targets where subregs of FP modes might be used to narrow an access > for bit-twiddling operations on the sign bit. It doesn't make sense > for us. We want DFmode for FP operations. An example is the expander > used by the testcase. This is a repost of http://gcc.gnu.org/ml/gcc/2013-06/msg00053.html, taking into account Joseph's doc review comments and adding a testcase. David has already acked the rs6000.c changes. Bootstrapped and regression tested powerpc64-linux. OK to apply? gcc/ * rs6000.c (TARGET_INIT_LOWER_SUBREG): Define. (rs6000_init_lower_subreg): New function. * lower-subreg.c (init_lower_subreg): Call targetm.init_lower_subreg. * target.def (init_lower_subreg): New. * doc/tm.texi.in (TARGET_INIT_LOWER_SUBREG): Document. * doc/tm.texi: Regenerate. gcc/testsuite/ * gcc.target/powerpc/fabsl.c: New test. Index: gcc/config/rs6000/rs6000.c === --- gcc/config/rs6000/rs6000.c (revision 201834) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -59,6 +59,7 @@ #include "opts.h" #include "tree-vectorizer.h" #include "dumpfile.h" +#include "lower-subreg.h" #if TARGET_XCOFF #include "xcoffout.h" /* get declarations of xcoff_*_section_name */ #endif @@ -1364,6 +1365,8 @@ static const struct attribute_spec rs6000_attribut #define TARGET_RTX_COSTS rs6000_rtx_costs #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_mode_as_bool_0 +#undef TARGET_INIT_LOWER_SUBREG +#define TARGET_INIT_LOWER_SUBREG rs6000_init_lower_subreg #undef TARGET_DWARF_REGISTER_SPAN #define TARGET_DWARF_REGISTER_SPAN rs6000_dwarf_register_span @@ -27971,6 +27974,20 @@ rs6000_memory_move_cost (enum machine_mode mode, r return ret; } +static void +rs6000_init_lower_subreg (void *data) +{ + if (!TARGET_IEEEQUAD + && TARGET_HARD_FLOAT + && (TARGET_FPRS || TARGET_E500_DOUBLE) + && TARGET_LONG_DOUBLE_128) +{ + struct target_lower_subreg *info = (struct target_lower_subreg *) data; + info->x_choices[0].move_modes_to_split[TFmode] = false; + info->x_choices[1].move_modes_to_split[TFmode] = false; +} +} + /* Returns a code for a target-specific builtin that implements reciprocal of the function, or NULL_TREE if not available. */ Index: gcc/lower-subreg.c === --- gcc/lower-subreg.c (revision 201834) +++ gcc/lower-subreg.c (working copy) @@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "df.h" #include "lower-subreg.h" +#include "target.h" #ifdef STACK_GROWS_DOWNWARD # undef STACK_GROWS_DOWNWARD @@ -287,6 +288,9 @@ init_lower_subreg (void) if (LOG_COSTS) fprintf (stderr, "\nSpeed costs\n===\n\n"); compute_costs (true, &rtxes); + + if (targetm.init_lower_subreg) +targetm.init_lower_subreg (this_target_lower_subreg); } static bool Index: gcc/target.def === --- gcc/target.def (revision 201834) +++ gcc/target.def (working copy) @@ -5110,6 +5110,14 @@ comparison code or operands.", void, (int *code, rtx *op0, rtx *op1, bool op0_preserve_value), default_canonicalize_comparison) +/* Allow modification of subreg choices. */ +DEFHOOK +(init_lower_subreg, + "This hook allows modification of the choices the lower_subreg pass \ +will make for particular subreg modes. @var{data} is a pointer to a \ +@code{struct target_lower_subreg}.", + void, (void *data), NULL) + DEFHOOKPOD (atomic_test_and_set_trueval, "This value should be set if the result written by\ Index: gcc/doc/tm.texi.in === --- gcc/doc/tm.texi.in (revision 201834) +++ gcc/doc/tm.texi.in (working copy) @@ -4939,6 +4939,8 @@ Define this macro if a non-short-circuit operation @hook TARGET_ADDRESS_COST +@hook TARGET_INIT_LOWER_SUBREG + @node Scheduling @section Adjusting the Instruction Scheduler -- Alan Modra Australia Development Lab, IBM
Re: Type inheritance graph analysis & speculative devirtualization, part 2/6 (type inheritance graph builder)
Jan Hubicka wrote: >Hi, >this patch implements the type inheritance graph builder. Once the >graph is >built it stays in memory and unchanged thorough the compilation (we do >not >expect to invent new virtual methods during the optimization) >The graph is dumped into new IPA dump file "type-inheritance". > >Construction does not work in LTO. I will update and post the code to >merge >types based on ODR in an followup patch. > >There is new function to lookup possible targets of given polymorphic >call and >function to dump those. Callgraph construction is extended so >obviously >unreachable virtual functions are not lowered and are removed early. >Result of >target lookups are stored in a global cache that is flushed each time >when any >virtual function that is target of a virtual call is removed. This >probably >won't happen too many times in a practice - generally only after >remove_unreachable_function when given type of virtual calls becomes >dead. > >I founded ipa-devirt file for the code. It is supposed to be used by >IPA >passes, but also by the intraprocedural gimple OBJ_TYPE_REF folding. I >think, >as a followup, we can move there other devirtualization related tools >and >analysis - get_binfo_at_offset, gimple_get_virt_method_for_binfo and >logic >checking dynamic type changes. > >The construction and target lookup seems to work resonably well for >Firefox LTO >build. The time spent by polymorphic call target lookup is about 2%. >This is >still more than it needs to be. Most of time is spent by parsing >vtables the >difficult way via gimple_get_virt_method_for_binfo. This can be fixed >by >representing vtables directly in the type-inheritance graph, but also >by >implementing gimple_get_virt_method_for_binfo in less general way (it >goes >through folding ctor access, figuring out if method can be references >and doing >other expensive and unnecesary steps). > >Bootstrapped/regtested ppc64-linux. Will commit it tomorrow if there >are >no objections. Any comments are welcome. I believe you can get derived objects of derived type not visible in the tu, so the list of targets does only contain local methods and implicitly all methods only defined in other tus? That is, you cannot rely no that list to be complete? Richard. >Honza > > * Makeifle-in (ipa-devirt.o): New. > (GTFILES): Add ipa-utils.h and ipa-devirt.c > * cgraphunit.c (decide_is_symbol_needed): Do not care about virtuals. > (analyze_functions): Look into possible targets of polymorphic call. > * dumpfile.c (dump_files): Add type-inheritance dump. > * dumpfile.h (TDI_inheritance): New. > * ipa-devirt.c: New file. > * ipa-utils.h (odr_type_d): Forward declare. > (odr_type): New type. > (build_type_inheritance_graph): Declare. > (possible_polymorphic_call_targets): Declare and introduce inline > variant when only edge is pased. > (dump_possible_polymorphic_call_targets): Likewise. > * timevar.def (TV_IPA_INHERITANCE, TV_IPA_VIRTUAL_CALL): New. > * tree.c (type_in_anonymous_namespace_p): Break out from ... > (types_same_for_odr): ... here. > * tree.h (type_in_anonymous_namespace_p): Declare. > > * g++.dg/ipa/type-inheritance-1.C: New testcase. > >Index: Makefile.in >=== >--- Makefile.in(revision 201824) >+++ Makefile.in(working copy) >@@ -1275,6 +1275,7 @@ OBJS = \ > init-regs.o \ > internal-fn.o \ > ipa-cp.o \ >+ ipa-devirt.o \ > ipa-split.o \ > ipa-inline.o \ > ipa-inline-analysis.o \ >@@ -2945,6 +2946,9 @@ ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) co >$(TREE_PASS_H) $(GIMPLE_H) $(TARGET_H) $(GGC_H) pointer-set.h \ > $(IPA_UTILS_H) tree-inline.h $(HASH_TABLE_H) profile.h $(PARAMS_H) \ >$(LTO_STREAMER_H) $(DATA_STREAMER_H) >+ipa-devirt.o : ipa-devirt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h >$(TM_H) $(CGRAPH_H) \ >+ $(GIMPLE_H) $(TARGET_H) $(GGC_H) pointer-set.h \ >+ $(IPA_UTILS_H) $(HASH_TABLE_H) > ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ >langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) >$(DIAGNOSTIC_H) \ >$(TREE_FLOW_H) $(TM_H) $(TREE_PASS_H) $(FLAGS_H) $(TREE_H) \ >@@ -3784,7 +3788,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp >$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h >$(srcdir)/cgraph.h \ > $(srcdir)/reload.h $(srcdir)/caller-save.c $(srcdir)/symtab.c \ >$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c >$(srcdir)/cgraph.c \ >- $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c \ >+ $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-utils.h \ > $(srcdir)/dbxout.c \ > $(srcdir)/dwarf2out.h \ > $(srcdir)/dwarf2asm.c \ >@@ -3826,7 +3830,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp > $(srcdir)/ipa-inline.h \ > $(srcdir)/vtable-verify.c \ > $(srcdir)/asan.c \ >- $(srcdir)/tsan.c \ >+ $(srcdir)/tsan.c $(srcdir)/ipa-dev