Re: [PATCH] C++0x, implement final on classes
... I'm wondering if wouldn't be more appropriate for the new testcase to be in /cpp0x, with a name like final.C Paolo
[Patch, Fortran] Make -Ofast imply -fstack-arrays
As title says: Make -Ofast imply -fstack-arrays (For Polyhedron shows, -fstack-arrays improves performance by 7% to 10%. Cf. https://userpage.physik.fu-berlin.de/~tburnus/gcc-trunk/benchmark/iff/#rt ) Build on x86-64-linux. OK for the trunk? Tobias 2011-05-14 Tobias Burnus * doc/invoke.texi (-Ofast): Also enables -fstack-arrays. 2011-05-14 Tobias Burnus * options.c (gfc_init_options, gfc_post_options): Enable -fstack-arrays by default if -Ofast is used. * invoke.texi (-fstack-arrays): Document this. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index aee1e6b..6ed289e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -6000,7 +6000,7 @@ Disregard strict standards compliance. @option{-Ofast} enables all @option{-O3} optimizations. It also enables optimizations that are not valid for all standard compliant programs. It turns on @option{-ffast-math} and the Fortran-specific -@option{-fno-protect-parens}. +@option{-fno-protect-parens} and @option{-fstack-arrays}. If you use multiple @option{-O} options, with or without level numbers, the last such option is the one that is effective. diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 9f02239..f0ee096 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -1385,7 +1385,9 @@ The default value for @var{n} is 32768. Adding this option will make the fortran compiler put all local arrays, even those of unknown size onto stack memory. If your program uses very large local arrays it's possible that you'll have to extend your runtime -limits for stack memory on some operating systems. +limits for stack memory on some operating systems. This flag is enabled +by default at optimization level @option{-Ofast}. + @item -fpack-derived @opindex @code{fpack-derived} diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index c67d109..8e352ae 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -125,7 +125,7 @@ gfc_init_options (unsigned int decoded_options_count, /* Default value of flag_max_stack_var_size is set in gfc_post_options. */ gfc_option.flag_max_stack_var_size = -2; - gfc_option.flag_stack_arrays = 0; + gfc_option.flag_stack_arrays = -1; gfc_option.flag_range_check = 1; gfc_option.flag_pack_derived = 0; @@ -275,6 +275,9 @@ gfc_post_options (const char **pfilename) if (gfc_option.flag_protect_parens == -1) gfc_option.flag_protect_parens = !optimize_fast; + if (gfc_option.flag_stack_arrays == -1) +gfc_option.flag_stack_arrays = optimize_fast; + /* By default, disable (re)allocation during assignment for -std=f95, and enable it for F2003/F2008/GNU/Legacy. */ if (gfc_option.flag_realloc_lhs == -1)
Re: [Patch, Fortran] Make -Ofast imply -fstack-arrays
On Sat, May 14, 2011 at 10:14, Tobias Burnus wrote: > As title says: Make -Ofast imply -fstack-arrays > > (For Polyhedron shows, -fstack-arrays improves performance by 7% to 10%. Cf. > https://userpage.physik.fu-berlin.de/~tburnus/gcc-trunk/benchmark/iff/#rt ) > > Build on x86-64-linux. > OK for the trunk? Ok. -- Janne Blomqvist
Re: [patch, fortran] Eliminate duplicate function calls with rank>0 and unknown shape
Hi Jerry, On 05/01/2011 02:49 AM, Thomas Koenig wrote: Hello world, after Paul's fix for allocate on assignment (thanks Paul!), here is a patch for the original test case from PR 22572, where the bounds of the function are unknown at compile time. This uses an allocatable temporary. In the long run, another option is to use interface mapping to evaluate the bounds of intrinsics and explicit-shape functions. For this, it would be necessary to write a front-end-only version of gfc_evaluate_now, which would be complicated by the desire not to disturb common function elimination, so I've put that on the back burner for now. Regression-tested. OK for trunk? Thomas OK and thanks for patch. Waiting for Emacs... Sende fortran/ChangeLog Sende fortran/frontend-passes.c Sende testsuite/ChangeLog Hinzufügen testsuite/gfortran.dg/function_optimize_7.f90 Übertrage Daten Revision 173752 übertragen. Thanks for the review! I'll close the PR itself and add a new one for not using allocatable arrays. Thomas
[Patch, libfortran, committed] PR 48915 Update mixed-language programming section documentation
Hi, I committed the attached patch as obvious. It updates the manual section on mixed-language programming to reflect the changes made as part of PR 48915. Index: gfortran.texi === --- gfortran.texi (revision 173750) +++ gfortran.texi (working copy) @@ -2578,7 +2578,7 @@ int main (int argc, char *argv[]) @table @asis @item @emph{Description}: @code{_gfortran_set_options} sets several flags related to the Fortran -standard to be used, whether backtracing or core dumps should be enabled +standard to be used, whether backtracing should be enabled and whether range checks should be performed. The syntax allows for upward compatibility since the number of passed flags is specified; for non-passed flags, the default value is used. See also @@ -2609,10 +2609,9 @@ Possible values are (bitwise or-ed) @cod standard error. Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}. @item @var{option}[2] @tab If non zero, enable pedantic checking. Default: off. -@item @var{option}[3] @tab If non zero, enable core dumps on run-time -errors. Default: off. +@item @var{option}[3] @tab Unused. @item @var{option}[4] @tab If non zero, enable backtracing on run-time -errors. Default: off. +errors. Default: enabled. Note: Installs a signal handler and requires command-line initialization using @code{_gfortran_set_args}. @item @var{option}[5] @tab If non zero, supports signed zeros. @@ -2627,8 +2626,8 @@ Default: enabled. See -frange-check (@p @item @emph{Example}: @smallexample - /* Use gfortran 4.5 default options. */ - static int options[] = @{68, 255, 0, 0, 0, 1, 0, 1@}; + /* Use gfortran 4.7 default options. */ + static int options[] = @{68, 255, 0, 0, 1, 1, 0, 1@}; _gfortran_set_options (8, &options); @end smallexample @end table Index: ChangeLog === --- ChangeLog (revision 173750) +++ ChangeLog (working copy) @@ -1,5 +1,12 @@ 2011-05-14 Janne Blomqvist + PR libfortran/48915 + * gfortran.texi: Update mixed-language programming section + reflecting the removal of the fdump-core option, and that + -fbacktrace is enabled by default. + +2011-05-14 Janne Blomqvist + PR libfortran/48915 * gfortran.h (gfc_option_t): Remove flag_dump_core. * gfortran.texi (GFORTRAN_ERROR_DUMPCORE): Remove section. -- Janne Blomqvist
Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes
Janne Blomqvist wrote: PR libfortran/48915 * lang.opt: Remove -fdump-core. Shouldn't one set this one to "Ignore" instead of removing it? In particular as in a way the default option is kind of "-fdump-core"? * runtime/stop.c (stop_numeric): Call exit(). (error_stop_string): Call sys_abort(). (error_stop_numeric): Print backtrace, exit with provided code. I disagree with the ERROR STOP change. The useful point about backtraces is that one can find out where the program aborted. That's useful when signalling NaN occurs, NULL pointers are dereferenced etc. However, if either the program prints an error (ERROR STOP) or if the library prints an error where the file/line number is in the error message, it does not make sense to clutter the output by printing a backtrace - especially not if the backtracing is enabled by default. Thus, I do *not* want to see a backtrace for: - STOP with non-zero exit code - ERROR STOP Both: One can easily grep the source code to find the relevant line. Additionally, those messages usually print the exact problem - thus there is no need to clutter the output. - Opening an non-existing file - Out-of-bounds array access - Deallocating an nonallocated variable Here, the reason is that the source line is ready printed in the error. For instance: At line 1 of file test.f90 (unit = 99, file = '�R') Fortran runtime error: File 'nonexist' does not exist Thus, I think one should to change ERROR STOP back to printing no backtrace - at least not by default. (I do not really mind backtraces for deallocation or out-of-bounds errors; they occur rare enough and sometimes a backtrace can be useful even if the line number is known.) Additionally, it is *not* sufficient for ERROR STOP to only modify libgfortran: For -fcoarray=lib, there is also an ERROR STOP version in libgfortran/caf/{single,mpi}.c which should behave analogously - or one changes the code there to call libgfortran's ERROR STOP version from there. Other than that: Nice clean up. One probably should now also implement backtracing support for Windows, which is not difficult (cf. attachment in the MinGW backtrace PR). Tobias
New Chinese (simplified) PO file for 'gcc' (version 4.6.0)
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Chinese (simplified) team of translators. The file is available at: http://translationproject.org/latest/gcc/zh_CN.po (This file, 'gcc-4.6.0.zh_CN.po', has just now been sent to you in a separate email.) All other PO files for your package are available in: http://translationproject.org/latest/gcc/ Please consider including all of these in your next release, whether official or a pretest. Whenever you have a new distribution with a new version number ready, containing a newer POT file, please send the URL of that distribution tarball to the address below. The tarball may be just a pretest or a snapshot, it does not even have to compile. It is just used by the translators when they need some extra translation context. The following HTML page has been updated: http://translationproject.org/domain/gcc.html If any question arises, please contact the translation coordinator. Thank you for all your work, The Translation Project robot, in the name of your translation coordinator.
[Patch, Fortran] Follow up patch to the backtrace changes
This patch re-adds the option -f(no-)backtrace as Ignored to improve backward compatibility. Additionally, for ERROR STOP, no backtrace is printed any more. Build on x86-64-linux. OK for the trunk? Tobias 2011-05-14 Tobias Burnus * lang.opt (fdump-core): Re-add as ignored option for backward compatibility. 2011-05-14 Tobias Burnus * runtime/stop.c (error_stop_string, error_stop_numeric): Do not backtrace for ERROR STOP. diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index a056c5c..1a3d073 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -366,6 +366,10 @@ fdollar-ok Fortran Allow dollar signs in entity names +fdump-core +Fortran Ignore +Does nothing. Preserved for backward compatibility. + fdump-fortran-original Fortran Display the code tree after parsing diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index 2efe239..4c3a0f9 100644 --- a/libgfortran/runtime/stop.c +++ b/libgfortran/runtime/stop.c @@ -92,7 +92,7 @@ error_stop_string (const char *string, GFC_INTEGER_4 len) (void) sizeof (w); /* Avoid compiler warning about not using w. */ estr_write ("\n"); - sys_abort (); + exit (1); } @@ -106,8 +106,5 @@ void error_stop_numeric (GFC_INTEGER_4 code) { st_printf ("ERROR STOP %d\n", (int) code); - if (options.backtrace == 1 - || (options.backtrace == -1 && compile_options.backtrace == 1)) -show_backtrace (); exit (code); }
Re: [patch gimplifier]: Make sure TRUTH_NOT_EXPR has boolean_type_node type and argument
2011/5/14 Eric Botcazou : >> In Fortran (and maybe other langauges) there are booleans with >> different sizes but the same precision. > > Ada doesn't have a C-like boolean type either. The patches have introduced: > > FAIL: gnat.dg/lto1.adb (test for excess errors) > > > /home/eric/svn/gcc/gcc/testsuite/gnat.dg/lto1_pkg.adb:23:1: error: type > mismatch in binary truth expression > boolean > boolean > boolean > D.2419_18 = D.2417_16 || D.2418_17; > +===GNAT BUG DETECTED==+ > | 4.7.0 20110513 (experimental) [trunk revision 173737] (i586-suse-linux-gnu) > GCC error:| > | verify_gimple failed Those issues should be fixed by the attached patch, which relaxes strictness of logical operations in tree-cfg.c file. Not sure if Richard is ok by this, as it shows that FE are generating here gimplify-incompatible SSA trees, which seems to me at least something not that good here. ChangeLog 2011-05-14 Kai Tietz * tree-cfg.c (verify_gimple_assign_unary): Don't enforce boolean_type_node compatible lhs/rhs types for logical expression. (verify_gimple_assign_binary): Likewise. Regards, Kai Index: gcc/gcc/tree-cfg.c === --- gcc.orig/gcc/tree-cfg.c 2011-05-13 17:28:15.0 +0200 +++ gcc/gcc/tree-cfg.c 2011-05-14 16:04:31.995831500 +0200 @@ -3350,15 +3350,6 @@ verify_gimple_assign_unary (gimple stmt) return false; case TRUTH_NOT_EXPR: - if (!useless_type_conversion_p (boolean_type_node, rhs1_type)) -{ - error ("invalid types in truth not"); - debug_generic_expr (lhs_type); - debug_generic_expr (rhs1_type); - return true; -} - break; - case NEGATE_EXPR: case ABS_EXPR: case BIT_NOT_EXPR: @@ -3558,10 +3549,13 @@ do_pointer_plus_expr_check: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: { - /* We allow only boolean typed or compatible argument and result. */ - if (!useless_type_conversion_p (boolean_type_node, rhs1_type) - || !useless_type_conversion_p (boolean_type_node, rhs2_type) - || !useless_type_conversion_p (boolean_type_node, lhs_type)) + /* The gimplify code ensures that just boolean_type_node types + are present, but ADA and FORTRAN using artificial gimple generation + code which is producing non-gimplify compatible trees. So we need + to allow here any kind of integral typed argument and result. */ + if (!INTEGRAL_TYPE_P (rhs1_type) + || !INTEGRAL_TYPE_P (rhs2_type) + || !INTEGRAL_TYPE_P (lhs_type)) { error ("type mismatch in binary truth expression"); debug_generic_expr (lhs_type);
Re: [Patch, Fortran] Follow up patch to the backtrace changes
On 05/14/2011 06:47 AM, Tobias Burnus wrote: This patch re-adds the option -f(no-)backtrace as Ignored to improve backward compatibility. Additionally, for ERROR STOP, no backtrace is printed any more. Build on x86-64-linux. OK for the trunk? Tobias OK, thanks, Jerry
Ping: Re: Updated^2: RFA: Fix middle-end/46500 (void * encapsulated)
This patch hasn't been reviewed for a week: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00582.html
Re: [Patch, Fortran] Make -Ofast imply -fstack-arrays
On 05/14/2011 09:14 AM, Tobias Burnus wrote: As title says: Make -Ofast imply -fstack-arrays I haven't commented on this before, but everyone should realize that automatic arrays were allocated on the stack *always* by g77. I never even bothered to study how gfortran did it, because I assumed it would just have copied g77's behavior. Duh. -- Toon Moene - e-mail: t...@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news
Re: Ping: Re: Updated^2: RFA: Fix middle-end/46500 (void * encapsulated)
Joern Rennecke wrote: This patch hasn't been reviewed for a week: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00582.html The Fortran bits are OK. Tobias PS: For those, who have not looked at the patch, the Fortran-relevant part is '#include "tm.h"' and the removal of "#if 0" code. 2010-05-07 Joern Rennecke PR middle-end/46500 gcc: * target.h: Don't include "tm.h" . [...] gcc/fortran: * trans-types.c: Include "tm.h" . [0] (c_size_t_size): Remove.
Re: [PATCH] C++0x, implement final on classes
At Sat, 14 May 2011 09:01:39 +0200, Paolo Carlini wrote: > ... I'm wondering if wouldn't be more appropriate for the new testcase to be > in /cpp0x, with a name like final.C There are probably other tests there that need moving too, if such moving is done. I don't have a strong opinion either way, but maybe the moving should be done separately? The last patch contained a ligature in the grammar comment for class-virt-specifier.. fixed below. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 293dd1c..40a7643 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1268,6 +1268,10 @@ check_bases (tree t, gcc_assert (COMPLETE_TYPE_P (basetype)); + if (CLASSTYPE_FINAL (basetype)) +error ("cannot derive from % base %qT in derived type %qT", + basetype, t); + /* If any base class is non-literal, so is the derived class. */ if (!CLASSTYPE_LITERAL_P (basetype)) CLASSTYPE_LITERAL_P (t) = false; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1705232..901a17d 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1321,6 +1321,7 @@ struct GTY(()) lang_type_class { unsigned has_complex_move_ctor : 1; unsigned has_complex_move_assign : 1; unsigned has_constexpr_ctor : 1; + unsigned is_final : 1; /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If @@ -1329,7 +1330,7 @@ struct GTY(()) lang_type_class { /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ - unsigned dummy : 3; + unsigned dummy : 2; tree primary_base; VEC(tree_pair_s,gc) *vcall_indices; @@ -1437,6 +1438,11 @@ struct GTY((variable_size)) lang_type { #define CLASSTYPE_LAZY_DESTRUCTOR(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->lazy_destructor) +/* Nonzero means that NODE (a class type) is final */ +#define CLASSTYPE_FINAL(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->is_final) + + /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */ #define TYPE_HAS_COPY_ASSIGN(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_copy_assign) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index fa6cd83..a77d4ff 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -17082,10 +17082,13 @@ cp_parser_class_specifier (cp_parser* parser) class-head: class-key identifier [opt] base-clause [opt] - class-key nested-name-specifier identifier base-clause [opt] + class-key nested-name-specifier identifier class-virt-specifier [opt] base-clause [opt] class-key nested-name-specifier [opt] template-id base-clause [opt] + class-virt-specifier: + final + GNU Extensions: class-key attributes identifier [opt] base-clause [opt] class-key attributes nested-name-specifier identifier base-clause [opt] @@ -17117,6 +17120,7 @@ cp_parser_class_head (cp_parser* parser, tree id = NULL_TREE; tree type = NULL_TREE; tree attributes; + cp_virt_specifiers virt_specifiers = VIRT_SPEC_UNSPECIFIED; bool template_id_p = false; bool qualified_p = false; bool invalid_nested_name_p = false; @@ -17260,8 +17264,11 @@ cp_parser_class_head (cp_parser* parser, pop_deferring_access_checks (); if (id) -cp_parser_check_for_invalid_template_id (parser, id, -type_start_token->location); +{ + cp_parser_check_for_invalid_template_id (parser, id, + type_start_token->location); + virt_specifiers = cp_parser_virt_specifier_seq_opt (parser); +} /* If it's not a `:' or a `{' then we can't really be looking at a class-head, since a class-head only appears as part of a @@ -17277,6 +17284,13 @@ cp_parser_class_head (cp_parser* parser, /* At this point, we're going ahead with the class-specifier, even if some other problem occurs. */ cp_parser_commit_to_tentative_parse (parser); + if (virt_specifiers & VIRT_SPEC_OVERRIDE) +{ + cp_parser_error (parser, + "cannot specify % for a class"); + type = error_mark_node; + goto out; +} /* Issue the error about the overly-qualified name now. */ if (qualified_p) { @@ -17493,6 +17507,8 @@ cp_parser_class_head (cp_parser* parser, if (type) DECL_SOURCE_LOCATION (TYPE_NAME (type)) = type_start_token->location; *attributes_p = attributes; + if (type && (virt_specifiers & VIRT_SPEC_FINAL)) +CLASSTYPE_FINAL (type) = 1; out: parser->colon_corrects_to_scope_p = saved_colon_corrects_to_scope_p; return type; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5e24977..5e059e0 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8209,6 +8209,7 @@ instantiate_class_template_1 (tree type) CLASSTYPE_VISIBILITY_SPECIFIED (type) = 1; CLASSTYPE_VISIBILITY (type) = CLASSTYPE_VISIBILITY (pattern); } + CLASSTYPE_FI
Ping: Re: Improve DSE in the presence of calls
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00781.html
Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes
On Sat, May 14, 2011 at 13:25, Tobias Burnus wrote: > Janne Blomqvist wrote: PR libfortran/48915 >> >> * lang.opt: Remove -fdump-core. > > Shouldn't one set this one to "Ignore" instead of removing it? It suppose one could argue this makes sense, in order to not break existing makefiles. > In particular > as in a way the default option is kind of "-fdump-core"? Well, I don't know about that. I think -fdump-core was just broken. E.g. - When enabled, generate a core dump [1] when the library detects any error such as file not found or EOF and decides to exit with a non-zero exit status. - When not enabled, and -fbacktrace not enabled, still generates a core dump if a fatal signal occurs because that's the default behavior in POSIX and there's nothing to prevent it [1]. [1] Well, depending on the user configured core file size limit, obviously. So what the current behavior is, beyond removing the -fdump-core option, is that it makes gfortran behave more like a good POSIX citizen, i.e. for most errors we just exit() normally with a non-zero exit status (no core dump or backtrace attempted). Backtracing and abort() is reserved for a few situations where we notice something went very bad. >> * runtime/stop.c (stop_numeric): Call exit(). >> (error_stop_string): Call sys_abort(). >> (error_stop_numeric): Print backtrace, exit with provided code. > > I disagree with the ERROR STOP change. My thinking is that the spirit of ERROR STOP is that the program noticed something went seriously wrong (e.g. program state corrupted in some way), and hence a backtrace and/or core dump might help figure out what went wrong. For less serious errors, there's the plain STOP. Similar to how in C there's exit() and abort(). > Other than that: Nice clean up. One probably should now also implement > backtracing support for Windows, which is not difficult (cf. attachment in > the MinGW backtrace PR). There's also a few problems with the async-signal-safety of the current backtrace implementation, see PR 48931. -- Janne Blomqvist
[PATCH, i386]: Merge push{xf,df}_integer, movdf_integer with corresponding base patterns
Hello! Attached patch introduces Yd and Yx conditional register constraints to merge push{xf,df}_integer, movdf_integer with corresponding base patterns. Additionaly, the patch adds standard_sse_constant_p to check for valid SSE constants in relevant patterns and standard_sse_constant_opcode to output SSE insn. 2011-05-14 Uros Bizjak * config/i386/constraint.md (Yd, Yx): New register constraints. * config/i386/i386.md (*pushdf): Merge with *pushdf_nointeger. Use Yd conditional register constraint. (*movtf_internal): Use standard_sse_constant_opcode. (*movxf_internal): Merge with *movxf_internal_nointeger. Use Yx conditional register constraint. (*movdf_internal): Merge with *movdf_internal_nointeger. Use Yd conditional register constraint. Use standard_sse_constant_p to check for valid SSE constants and call standard_sse_constant_opcode to output SSE insn. (*movsf_internal): Use standard_sse_constant_p to check for valid SSE constants and call standard_sse_constant_opcode to output SSE insn. * config/i386/i386.c (ix86_option_ovverride_internal): Set TARGET_INTEGER_DFMODE_MOVES for 64bit targets. Clear it when optimize_size is set. (standard_sse_constant_opcode): Output conditional AVX templates. Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}. Patch was committed to SVN mainline. Uros. Index: i386.md === --- i386.md (revision 173748) +++ i386.md (working copy) @@ -2702,10 +2702,14 @@ [(const_int 0)] "ix86_split_long_move (operands); DONE;") +;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size. +;; Size of pushdf using integer instructions is 2+2*memory operand size +;; On the average, pushdf using integers can be still shorter. + (define_insn "*pushdf" [(set (match_operand:DF 0 "push_operand" "=<,<,<") - (match_operand:DF 1 "general_no_elim_operand" "f,rFo,Y2"))] - "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES" + (match_operand:DF 1 "general_no_elim_operand" "f,Yd*rFo,Y2"))] + "" { /* This insn should be already split before reg-stack. */ gcc_unreachable (); @@ -2714,23 +2718,6 @@ (set_attr "unit" "i387,*,*") (set_attr "mode" "DF,SI,DF")]) -;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size. -;; Size of pushdf using integer instructions is 2+2*memory operand size -;; On the average, pushdf using integers can be still shorter. Allow this -;; pattern for optimize_size too. - -(define_insn "*pushdf_nointeger" - [(set (match_operand:DF 0 "push_operand" "=<,<,<,<") - (match_operand:DF 1 "general_no_elim_operand" "f,Fo,*r,Y2"))] - "!(TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES)" -{ - /* This insn should be already split before reg-stack. */ - gcc_unreachable (); -} - [(set_attr "type" "multi") - (set_attr "unit" "i387,*,*,*") - (set_attr "mode" "DF,SI,SI,DF")]) - ;; %%% Kill this when call knows how to work this out. (define_split [(set (match_operand:DF 0 "push_operand" "") @@ -2822,14 +2809,14 @@ return "%vmovaps\t{%1, %0|%0, %1}"; else return "%vmovdqa\t{%1, %0|%0, %1}"; + case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "%vxorps\t%0, %d0"; - else - return "%vpxor\t%0, %d0"; + return standard_sse_constant_opcode (insn, operands[1]); + case 3: case 4: return "#"; + default: gcc_unreachable (); } @@ -2862,42 +2849,14 @@ "ix86_split_long_move (operands); DONE;") (define_insn "*movxf_internal" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,r,o") - (match_operand:XF 1 "general_operand" "fm,f,G,roF,Fr"))] - "optimize_function_for_speed_p (cfun) - && !(MEM_P (operands[0]) && MEM_P (operands[1])) - && (!can_create_pseudo_p () - || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" -{ - switch (which_alternative) -{ -case 0: -case 1: - return output_387_reg_move (insn, operands); - -case 2: - return standard_80387_constant_opcode (operands[1]); - -case 3: case 4: - return "#"; - -default: - gcc_unreachable (); -} -} - [(set_attr "type" "fmov,fmov,fmov,multi,multi") - (set_attr "mode" "XF,XF,XF,SI,SI")]) - -;; Do not use integer registers when optimizing for size -(define_insn "*movxf_internal_nointeger" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,*r,o") - (match_operand:XF 1 "general_operand" "fm,f,G,*roF,F*r"))] - "optimize_function_for_size_p (cfun) - && !(MEM_P (operands[0]) && MEM_P (operands[1])) + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,Yx*r ,o") + (match_operand:XF 1 "general_operand" "fm,f,G,Yx*roF,FYx*r"))] + "!(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () - |
Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes
Janne Blomqvist wrote: > I disagree with the ERROR STOP change. My thinking is that the spirit of ERROR STOP is that the program noticed something went seriously wrong (e.g. program state corrupted in some way), and hence a backtrace and/or core dump might help figure out what went wrong. For less serious errors, there's the plain STOP. Similar to how in C there's exit() and abort(). Well, typical usages would be: STOP "Calculation finished" and ERROR STOP "No input file found" Admittedly, STOP is also used for the latter as there was no ERROR STOP until Fortran 2008 - and when using numerical arguments, the value is also used as exit status code - with string values, which are rather common, STOP has always the success exit status code 0. Especially with coarrays, one cannot easily prevent the usage of ERROR STOP: Assume that this_image() > 1 processes wait for process 1 ("SYNC IMAGES(1)") to read in the data and to broadcast it. Now, process 1 sees that there is no input file - what shell it do? A STOP would cause a dead lock. Thus, one simply calls ERROR STOP "No input file" - and does not want to have a backtrace ... As written, before if one is able to call STOP or ERROR STOP, one knows where one is in the program - and at least roughly why one stops there. Thus, at least by default, I don't want to have a backtrace. If one had a "-fbacktrace=always" or similar, one could still backtrace ERROR STOP - and maybe even STOP ;-) Maybe, we should make the backtrace functionality available like other compilers have; looking at our code, I find for Intel USE ifcore CALL tracebackqq(USER_EXIT_CODE=-1) and for IBM CALL xl__trbk() Tobias
Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes
On Sat, May 14, 2011 at 18:35, Tobias Burnus wrote: > Janne Blomqvist wrote: >> >> > I disagree with the ERROR STOP change. >> My thinking is that the spirit of ERROR STOP is that the program >> noticed something went seriously wrong (e.g. program state corrupted >> in some way), and hence a backtrace and/or core dump might help >> figure out what went wrong. For less serious errors, there's the plain >> STOP. Similar to how in C there's exit() and abort(). > > Well, typical usages would be: > STOP "Calculation finished" > and > ERROR STOP "No input file found" > > Admittedly, STOP is also used for the latter as there was no ERROR STOP > until Fortran 2008 - and when using numerical arguments, the value is also > used as exit status code - with string values, which are rather common, STOP > has always the success exit status code 0. > > Especially with coarrays, one cannot easily prevent the usage of ERROR STOP: > Assume that this_image() > 1 processes wait for process 1 ("SYNC IMAGES(1)") > to read in the data and to broadcast it. Now, process 1 sees that there is > no input file - what shell it do? A STOP would cause a dead lock. Thus, one > simply calls ERROR STOP "No input file" - and does not want to have a > backtrace ... Good point. Color me convinced. -- Janne Blomqvist
Re: [patch gimplifier]: Make sure TRUTH_NOT_EXPR has boolean_type_node type and argument
> Those issues should be fixed by the attached patch, which relaxes > strictness of logical operations in tree-cfg.c file. Thanks. > 2011-05-14 Kai Tietz > > * tree-cfg.c (verify_gimple_assign_unary): Don't enforce > boolean_type_node > compatible lhs/rhs types for logical expression. > (verify_gimple_assign_binary): Likewise. - /* We allow only boolean typed or compatible argument and result. */ - if (!useless_type_conversion_p (boolean_type_node, rhs1_type) - || !useless_type_conversion_p (boolean_type_node, rhs2_type) - || !useless_type_conversion_p (boolean_type_node, lhs_type)) + /* The gimplify code ensures that just boolean_type_node types + are present, but ADA and FORTRAN using artificial gimple generation + code which is producing non-gimplify compatible trees. So we need + to allow here any kind of integral typed argument and result. */ + if (!INTEGRAL_TYPE_P (rhs1_type) + || !INTEGRAL_TYPE_P (rhs2_type) + || !INTEGRAL_TYPE_P (lhs_type)) What does "artificial gimple generation code" mean exactly? The only thing different in Ada is the definition of boolean_type_node which isn't compatible with the C definition (its precision is 8 instead of 1). That's all. For Ada, you can just do: Index: tree-cfg.c === --- tree-cfg.c (revision 173756) +++ tree-cfg.c (working copy) @@ -3350,7 +3350,7 @@ verify_gimple_assign_unary (gimple stmt) return false; case TRUTH_NOT_EXPR: - if (!useless_type_conversion_p (boolean_type_node, rhs1_type)) + if (TREE_CODE (rhs1_type) != BOOLEAN_TYPE) { error ("invalid types in truth not"); debug_generic_expr (lhs_type); @@ -3558,10 +3558,10 @@ do_pointer_plus_expr_check: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: { - /* We allow only boolean typed or compatible argument and result. */ - if (!useless_type_conversion_p (boolean_type_node, rhs1_type) - || !useless_type_conversion_p (boolean_type_node, rhs2_type) - || !useless_type_conversion_p (boolean_type_node, lhs_type)) + /* We allow only boolean-typed argument and result. */ + if (TREE_CODE (rhs1_type) != BOOLEAN_TYPE + || TREE_CODE (rhs2_type) != BOOLEAN_TYPE + || TREE_CODE (lhs_type) != BOOLEAN_TYPE) { error ("type mismatch in binary truth expression"); debug_generic_expr (lhs_type); -- Eric Botcazou
Re: [PATCH] C++0x, implement final on classes
On 05/14/2011 10:56 AM, Ville Voutilainen wrote: At Sat, 14 May 2011 09:01:39 +0200, Paolo Carlini wrote: ... I'm wondering if wouldn't be more appropriate for the new testcase to be in /cpp0x, with a name like final.C There are probably other tests there that need moving too, if such moving is done. I don't have a strong opinion either way, but maybe the moving should be done separately? Paolo is right, C++0x tests go in cpp0x. I'll move this and your earlier one. Jason
Re: [PATCH] C++0x, implement final on classes
On 14 May 2011 19:41, Jason Merrill wrote: > Paolo is right, C++0x tests go in cpp0x. I'll move this and your earlier > one. Duly noted, I'll keep that in mind for subsequent ones. Is the patch otherwise ok?
Re: [patch gimplifier]: Make sure TRUTH_NOT_EXPR has boolean_type_node type and argument
2011/5/14 Eric Botcazou : >> Those issues should be fixed by the attached patch, which relaxes >> strictness of logical operations in tree-cfg.c file. > > Thanks. > >> 2011-05-14 Kai Tietz >> >> * tree-cfg.c (verify_gimple_assign_unary): Don't enforce >> boolean_type_node >> compatible lhs/rhs types for logical expression. >> (verify_gimple_assign_binary): Likewise. > > - /* We allow only boolean typed or compatible argument and result. */ > - if (!useless_type_conversion_p (boolean_type_node, rhs1_type) > - || !useless_type_conversion_p (boolean_type_node, rhs2_type) > - || !useless_type_conversion_p (boolean_type_node, lhs_type)) > + /* The gimplify code ensures that just boolean_type_node types > + are present, but ADA and FORTRAN using artificial gimple generation > + code which is producing non-gimplify compatible trees. So we need > + to allow here any kind of integral typed argument and result. */ > + if (!INTEGRAL_TYPE_P (rhs1_type) > + || !INTEGRAL_TYPE_P (rhs2_type) > + || !INTEGRAL_TYPE_P (lhs_type)) > > What does "artificial gimple generation code" mean exactly? The only thing > different in Ada is the definition of boolean_type_node which isn't compatible > with the C definition (its precision is 8 instead of 1). That's all. Well, I mean by artificial here, that gimplification is done via gimplify_expr API. As FE and ME have here different assumptions. The ME uses internally most boolean_type_node and IMHO it should be the variant used there. As this conversation to a single boolean_type (with recast to result FE's boolean type on demand) has some advantages on optimization passes. Additionally it simplifies logic in passes on types. For example there are some expressions, which are in general unexpected in ME as they are transformed in gimplification (like TRUTH_ANDIF/ORIF_EXPR). By adding tree manual, you might cause the same issue as for the logical-expression showing up now. > For Ada, you can just do: > > Index: tree-cfg.c > === > --- tree-cfg.c (revision 173756) > +++ tree-cfg.c (working copy) > @@ -3350,7 +3350,7 @@ verify_gimple_assign_unary (gimple stmt) > return false; > > case TRUTH_NOT_EXPR: > - if (!useless_type_conversion_p (boolean_type_node, rhs1_type)) > + if (TREE_CODE (rhs1_type) != BOOLEAN_TYPE) > { > error ("invalid types in truth not"); > debug_generic_expr (lhs_type); > @@ -3558,10 +3558,10 @@ do_pointer_plus_expr_check: > case TRUTH_OR_EXPR: > case TRUTH_XOR_EXPR: > { > - /* We allow only boolean typed or compatible argument and result. */ > - if (!useless_type_conversion_p (boolean_type_node, rhs1_type) > - || !useless_type_conversion_p (boolean_type_node, rhs2_type) > - || !useless_type_conversion_p (boolean_type_node, lhs_type)) > + /* We allow only boolean-typed argument and result. */ > + if (TREE_CODE (rhs1_type) != BOOLEAN_TYPE > + || TREE_CODE (rhs2_type) != BOOLEAN_TYPE > + || TREE_CODE (lhs_type) != BOOLEAN_TYPE) > { > error ("type mismatch in binary truth expression"); > debug_generic_expr (lhs_type); > > -- > Eric Botcazou > Well, this patch might be an alternative, but I see here potential issues in such none-gimplified expressions for comparision and logical not, which not necessariily have BOOLEAN_TYPE. See here the code for fold_truth_not (and some other places) in fold-const. So I think, as long as we have here external gimplication it is more save to check just for integral-kind. At the moment I am discussing with Tobias Burnus about wrapping fold_build calls for logical operations (COND_EXPR (conditional operand); TRUTH..., and possibly comparison too) , so that the operation is done on boolean_type_node and the result gets re-casted back to FE's logical boolean type. This would allow us to keep in tree-cfg the check for one-bit operations for truth-expressions. The general advantage here is that later passes (like reassoc - by moving TRUTH-AND/OR/XOR to binary variant BIT_AND/OR/XOR) would show effects and inner operands can be matched. Also by oiperating on one-bit types here allows us to assume even that TRUTH_NOT_EXPR can be transformed to BIT_NOT_EXPR (or XOR by 1). But well, I would like to know Richard's opinion here. Regards, Kai
Re: [PATCH] C++0x, implement final on classes
On 05/14/2011 12:42 PM, Ville Voutilainen wrote: On 14 May 2011 19:41, Jason Merrill wrote: Paolo is right, C++0x tests go in cpp0x. I'll move this and your earlier one. Duly noted, I'll keep that in mind for subsequent ones. Is the patch otherwise ok? Yes, and I've applied it. Jason
[BACKPORT] Fix PR rtl-optimization/45593
Trunk fails to build using gcc-4.3 and gcc-4.4 when -O1 is specified in STAGE1_CFLAGS on hppa2.0w-hp-hpux11.11. I have had anecdotal reports of similar delay slot problems in glibc and the Linux kernel. Investigation showed that this bug was a delay slot scheduling problem and that the issue was fixed by Eric last September. The fix was back ported to the 4.5 branch but not to previous branches. The identical fix applies to the 4.4 and 4.3 branches. Ok to backport? Dave -- J. David Anglin dave.ang...@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2011-05-14 John David Anglin PR rtl_optimization/48932 Backport from mainline: 2010-09-15 Eric Botcazou PR rtl-optimization/45593 * reorg.c (relax_delay_slots): Use emit_copy_of_insn_after to re-emit insns that were in delay slots as stand-alone insns. Backport from mainline: 2010-09-15 Eric Botcazou * gcc.c-torture/compile/20100915-1.c: New test. Index: gcc/reorg.c === --- gcc/reorg.c (revision 173596) +++ gcc/reorg.c (working copy) @@ -3453,9 +3453,13 @@ We do this by deleting the INSN containing the SEQUENCE, then re-emitting the insns separately, and then deleting the RETURN. This allows the count of the jump target to be properly -decremented. */ +decremented. - /* Clear the from target bit, since these insns are no longer +Note that we need to change the INSN_UID of the re-emitted insns +since it is used to hash the insns for mark_target_live_regs and +the re-emitted insns will no longer be wrapped up in a SEQUENCE. + +Clear the from target bit, since these insns are no longer in delay slots. */ for (i = 0; i < XVECLEN (pat, 0); i++) INSN_FROM_TARGET_P (XVECEXP (pat, 0, i)) = 0; @@ -3463,13 +3467,10 @@ trial = PREV_INSN (insn); delete_related_insns (insn); gcc_assert (GET_CODE (pat) == SEQUENCE); - after = trial; - for (i = 0; i < XVECLEN (pat, 0); i++) - { - rtx this_insn = XVECEXP (pat, 0, i); - add_insn_after (this_insn, after, NULL); - after = this_insn; - } + add_insn_after (delay_insn, trial, NULL); + after = delay_insn; + for (i = 1; i < XVECLEN (pat, 0); i++) + after = emit_copy_of_insn_after (XVECEXP (pat, 0, i), after); delete_scheduled_jump (delay_insn); continue; } @@ -3571,9 +3572,13 @@ We do this by deleting the INSN containing the SEQUENCE, then re-emitting the insns separately, and then deleting the jump. This allows the count of the jump target to be properly -decremented. */ +decremented. - /* Clear the from target bit, since these insns are no longer +Note that we need to change the INSN_UID of the re-emitted insns +since it is used to hash the insns for mark_target_live_regs and +the re-emitted insns will no longer be wrapped up in a SEQUENCE. + +Clear the from target bit, since these insns are no longer in delay slots. */ for (i = 0; i < XVECLEN (pat, 0); i++) INSN_FROM_TARGET_P (XVECEXP (pat, 0, i)) = 0; @@ -3581,13 +3586,10 @@ trial = PREV_INSN (insn); delete_related_insns (insn); gcc_assert (GET_CODE (pat) == SEQUENCE); - after = trial; - for (i = 0; i < XVECLEN (pat, 0); i++) - { - rtx this_insn = XVECEXP (pat, 0, i); - add_insn_after (this_insn, after, NULL); - after = this_insn; - } + add_insn_after (delay_insn, trial, NULL); + after = delay_insn; + for (i = 1; i < XVECLEN (pat, 0); i++) + after = emit_copy_of_insn_after (XVECEXP (pat, 0, i), after); delete_scheduled_jump (delay_insn); continue; } --- /dev/null Sat May 14 08:48:19 2011 +++ gcc/testsuite/gcc.c-torture/compile/20100915-1.cMon May 9 18:17:54 2011 @@ -0,0 +1,82 @@ +/* PR rtl-optimization/45593 */ +/* Testcase by Arnaud Lacombe */ + +typedef unsigned int __u32; +typedef __u32 __be32; +static inline __attribute__((always_inline)) int __attribute__((__cold__)) printk(const char *s, ...) { return 0; } +typedef struct journal_s journal_t; +typedef struct journal_header_s +{ + __be32 h_magic; + __be32 h_blocktype; + __be32 h_sequence; +} journal_header_t; +typedef struct journal_superblock_s +{ + journal_header_t s_header; + __be32 s_blocksize; + __be32 s_maxlen; +} journal_superblock_t; +struct journal_s +{ + struct buffer_head *j_sb_buffer; + journal_superblock_t *j_superblock; + int j_format_vers
Re: [PATCH] C++0x, implement final on classes
On 14 May 2011 21:15, Jason Merrill wrote: > On 05/14/2011 12:42 PM, Ville Voutilainen wrote: >> Duly noted, I'll keep that in mind for subsequent ones. Is the patch >> otherwise ok? > Yes, and I've applied it. Cool, thanks! I'm not quite sure whether there are ambiguities in the case of elaborate-specifiers, but I suppose those can be fixed later. Should these facilities be somehow flagged 0x-only? I haven't done that at all.. Somebody should probably update the C++0x status page, and refer to N3206 rather than to N2928 for explicit virtual overrides, and mark it done?
Re: [BACKPORT] Fix PR rtl-optimization/45593
> Investigation showed that this bug was a delay slot scheduling problem > and that the issue was fixed by Eric last September. The fix was back > ported to the 4.5 branch but not to previous branches. The identical > fix applies to the 4.4 and 4.3 branches. > > Ok to backport? OK, thanks. Note that another delay slot bug was fixed around the same time: 2010-09-20 Eric Botcazou PR rtl-optimization/42775 * cfgrtl.c (rest_of_pass_free_cfg): Recompute notes if delay slot scheduling is enabled. This one was installed on the 4.6/4.5/4.4 branches. -- Eric Botcazou
[Patch, libfortran] PR 48931 Async-signal-safety of backtrace signal handler
Hi, the current version of showing the backtrace is not async-signal-safe as it uses backtrace_symbols() which, in turn, uses malloc(). The attached patch changes the backtrace printing functionality to instead use backtrace_symbols_fd() and pipes. Also, it does some other work on backtrace printing: - Nowadays the main program has the same debug symbol name as whatever the name of the main program is, rather than MAIN__. Therefore remove special case logic related to that. - Don't filter out stack frames from inside libgfortran, as this might lose information in case the reason for the crash is in the library. - Reformat the output slightly, so the each stack frame fits on one line, and begins with #NUM, similar to GDB. For instance, the small program subroutine c call abort () end subroutine c subroutine b call c end subroutine b subroutine a call b end subroutine a program bt call a end program bt compiled with -g -fno-whole-file now generates Backtrace for this error: #0 /home/janne/src/gfortran/trunk/install/lib64/libgfortran.so.3(+0x182b7)[0x7f9c8a2c42b7] #1 /home/janne/src/gfortran/trunk/install/lib64/libgfortran.so.3(+0x19d07)[0x7f9c8a2c5d07] #2 /home/janne/src/gfortran/trunk/install/lib64/libgfortran.so.3(+0xe1e49)[0x7f9c8a38de49] #3 in b_ at bt.f90:5 (0x400612) #4 in b_ at bt.f90:7 (0x400620) #5 in a_ at bt.f90:11 (0x400630) #6 in bt at bt.f90:15 (0x400640) Aborted In this case the 3 first frames are the output from backtrace_symbols_fd() since addr2line can't get the symbols from libgfortran. With static linking addr2line can see it: Backtrace for this error: #0 in _gfortrani_show_backtrace at backtrace.c:85 (0x405427) #1 in _gfortrani_sys_abort at error.c:176 (0x4007B7) #2 in _gfortran_abort (0x404469) #3 in b_ at bt.f90:5 (0x400402) #4 in b_ at bt.f90:7 (0x400410) #5 in a_ at bt.f90:11 (0x400420) #6 in bt at bt.f90:15 (0x400430) Aborted Regtested on x86_64-unknown-linux-gnu, Ok for trunk? 2011-05-14 Janne Blomqvist PR libfortran/48931 * configure.ac: Check for backtrace_symbols_fd instead of backtrace_symbols. * config.h.in: Regenerated. * configure: Regenerated. * runtime/backtrace.c (local_strcasestr): Remove. (bt_header): New function. (dump_glibc_backtrace): Remove. (show_backtrace): Rework to use backtrace_symbols_fd and pipes, reformat output. -- Janne Blomqvist diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index cf38fb0..9bb6210 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -267,7 +267,7 @@ AC_CHECK_FUNCS(localtime_r gmtime_r strerror_r getpwuid_r ttyname_r) AC_CHECK_FUNCS(clock_gettime strftime) # Check for glibc backtrace functions -AC_CHECK_FUNCS(backtrace backtrace_symbols) +AC_CHECK_FUNCS(backtrace backtrace_symbols_fd) # Check libc for getgid, getpid, getuid AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])]) diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index 10917d3..ce1a0c7 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -54,56 +54,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \ && defined(HAVE_WAIT)) #define GLIBC_BACKTRACE (defined(HAVE_BACKTRACE) \ - && defined(HAVE_BACKTRACE_SYMBOLS)) + && defined(HAVE_BACKTRACE_SYMBOLS_FD)) #define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \ && defined(HAVE_DUP2) && defined(HAVE_FDOPEN) \ && defined(HAVE_CLOSE)) -#if GLIBC_BACKTRACE && CAN_PIPE -static char * -local_strcasestr (const char *s1, const char *s2) +/* GDB style #NUM index for each stack frame. */ +static void +bt_header (int num) { -#ifdef HAVE_STRCASESTR - return strcasestr (s1, s2); -#else - - const char *p = s1; - const size_t len = strlen (s2); - const char u = *s2, v = isupper((int) *s2) ? tolower((int) *s2) - : (islower((int) *s2) ? toupper((int) *s2) - : *s2); - - while (1) -{ - while (*p != u && *p != v && *p) - p++; - if (*p == 0) - return NULL; - if (strncasecmp (p, s2, len) == 0) - return (char *)p; -} -#endif + st_printf (" #%d ", num); } -#endif - - -#if GLIBC_BACKTRACE -static void -dump_glibc_backtrace (int depth, char *str[]) -{ - int i; - - for (i = 0; i < depth; i++) -{ - estr_write (" + "); - estr_write (str[i]); - estr_write ("\n"); -} - free (str); -} -#endif /* show_backtrace displays the backtrace, currently obtained by means of the glibc backtrace* functions. */ @@ -116,63 +79,49 @@ show_backtrace (void) #define BUFSIZE 1024 void *trace[DEPTH]; - char **str; int depth; depth = backtrace (trace, DEPTH); if (depth <= 0) return; - str = backtrace_symbols (trace, depth); - #if CAN_PIPE -#ifndef STDIN_FILENO -#define STDIN_FILE
Re: [BACKPORT] Fix PR rtl-optimization/45593
> OK, thanks. Note that another delay slot bug was fixed around the same time: > > 2010-09-20 Eric Botcazou > > PR rtl-optimization/42775 > * cfgrtl.c (rest_of_pass_free_cfg): Recompute notes if delay slot > scheduling is enabled. > > This one was installed on the 4.6/4.5/4.4 branches. Thanks for the note. While 4.4 can now successfully bootstrap trunk with -O1, I still have a problem with 4.3. I'll see if this helps. Dave -- J. David Anglin dave.ang...@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
Small adjustment in tree-ssa-loop-im.c
The Tree LIM pass keeps track of the execution status of statements by means of /* The outermost loop for that execution of the header guarantees that the block will be executed. */ #define ALWAYS_EXECUTED_IN(BB) ((struct loop *) (BB)->aux) and there is a fill_always_executed_in function: /* Fills ALWAYS_EXECUTED_IN information for basic blocks of LOOP, i.e. for each such basic block bb records the outermost loop for that execution of its header implies execution of bb. CONTAINS_CALL is the bitmap of blocks that contain a nonpure call. */ It turns out that the function never references ALWAYS_EXECUTED_IN, which is a little confusing. Instead it accesses the AUX field directly. Changed to using ALWAYS_EXECUTED_IN in all cases. Tested on i586-suse-linux, applied on the mainline as obvious. 2011-05-14 Eric Botcazou * tree-ssa-loop-im.c (SET_ALWAYS_EXECUTED_IN): New macro. (fill_always_executed_in): Use [SET_]ALWAYS_EXECUTED_IN. (tree_ssa_lim_finalize): Likewise. -- Eric Botcazou Index: tree-ssa-loop-im.c === --- tree-ssa-loop-im.c (revision 173756) +++ tree-ssa-loop-im.c (working copy) @@ -197,9 +197,10 @@ static bool ref_indep_loop_p (struct loo /* Minimum cost of an expensive expression. */ #define LIM_EXPENSIVE ((unsigned) PARAM_VALUE (PARAM_LIM_EXPENSIVE)) -/* The outermost loop for that execution of the header guarantees that the +/* The outermost loop for which execution of the header guarantees that the block will be executed. */ #define ALWAYS_EXECUTED_IN(BB) ((struct loop *) (BB)->aux) +#define SET_ALWAYS_EXECUTED_IN(BB, VAL) ((BB)->aux = (void *) (VAL)) static struct lim_aux_data * init_lim_data (gimple stmt) @@ -2440,7 +2441,7 @@ fill_always_executed_in (struct loop *lo edge e; struct loop *inn_loop = loop; - if (!loop->header->aux) + if (ALWAYS_EXECUTED_IN (loop->header) == NULL) { bbs = get_loop_body_in_dom_order (loop); @@ -2482,7 +2483,7 @@ fill_always_executed_in (struct loop *lo while (1) { - last->aux = loop; + SET_ALWAYS_EXECUTED_IN (last, loop); if (last == loop->header) break; last = get_immediate_dominator (CDI_DOMINATORS, last); @@ -2537,9 +2538,7 @@ tree_ssa_lim_finalize (void) htab_t h; FOR_EACH_BB (bb) -{ - bb->aux = NULL; -} +SET_ALWAYS_EXECUTED_IN (bb, NULL); pointer_map_destroy (lim_aux_data_map);
Re: [PATCH] C++0x, implement final on classes
On 05/14/2011 02:19 PM, Ville Voutilainen wrote: Cool, thanks! I'm not quite sure whether there are ambiguities in the case of elaborate-specifiers, but I suppose those can be fixed later. Good point. In the case that !cp_parser_next_token_starts_class_definition_p, we should rewind to before what we parsed as virt-specifiers. Should these facilities be somehow flagged 0x-only? I haven't done that at all.. Yes, we should maybe_warn_cpp0x about them. Somebody should probably update the C++0x status page, and refer to N3206 rather than to N2928 for explicit virtual overrides, and mark it done? Will do. Jason
Re: [PATCH] C++0x, implement final on classes
On 05/14/2011 06:49 PM, Jason Merrill wrote: On 05/14/2011 02:19 PM, Ville Voutilainen wrote: Cool, thanks! I'm not quite sure whether there are ambiguities in the case of elaborate-specifiers, but I suppose those can be fixed later. Good point. In the case that !cp_parser_next_token_starts_class_definition_p, we should rewind to before what we parsed as virt-specifiers. cp_lexer_token_position and cp_lexer_set_token_position should be useful for this. Jason
Re: PATCH RFA: Fix PR 45687
On Mon, Oct 25, 2010 at 9:24 PM, Ian Lance Taylor wrote: > This patch implements Jakub's suggestion for fixing PR 45687. The patch > is mainly by inspection. The test case fails before the patch and > succeeds afterward, but the test case only tests the first hunk of the > patch, not the third (the second is just a formatting fix). > > Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for mainline? > > Ian > > > gcc/ChangeLog: > > 2010-10-25 Ian Lance Taylor > > PR middle-end/45687 > * ipa-prop.c (ipa_modify_call_arguments): Correct type of MEM_REF > offset. > This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49000 -- H.J.