Re: [patch, fortran] Fix PR 52893
Dear Thomas, > after some time with a defective computer, I am back online. It seems to be catching both my linux laptop and my desktop are as dead as door-nails. > > Here is a fix for PR 52893 (which I just submitted, I wanted to > set a new record between bug posting and patch submissin :-), a > wrong-code regression for trunk and 4.7. Regression-tested. > > OK for both? OK for trunk and for 4.7. As a matter of curiosity, why did you not inhibit common function extraction when the function arguments contain an implicit loop variable, rather than when they are in an implicit loop? That would make the optimisation rather less conservative. Thanks for the patch Paul
[SH] Use braced strings in MD
Hi, In my original patch http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01315.html I forgot two cases, which are addressed by the attached patch. Tested with 'make all-gcc'. OK? Cheers, Oleg ChangeLog: * config/sh/sh.md: Use braced string notation where applicable. Index: gcc/config/sh/sh.md === --- gcc/config/sh/sh.md (revision 186212) +++ gcc/config/sh/sh.md (working copy) @@ -909,8 +909,10 @@ (match_operand:DI 1 "arith_operand" "r")) (const_int 0)))] "TARGET_SH1" - "* return output_branchy_insn (EQ, \"tst\\t%S1,%S0\;bf\\t%l9\;tst\\t%R1,%R0\", - insn, operands);" +{ + return output_branchy_insn (EQ, "tst\t%S1,%S0;bf\t%l9;tst\t%R1,%R0", + insn, operands); +} [(set_attr "length" "6") (set_attr "type" "arith3b")]) @@ -5638,7 +5640,9 @@ "TARGET_SH1 && (arith_reg_operand (operands[0], DImode) || arith_reg_operand (operands[1], DImode))" - "* return output_movedouble (insn, operands, DImode);" +{ + return output_movedouble (insn, operands, DImode); +} [(set_attr "length" "4") (set_attr "type" "pcload,move,load,store,move,pcload,move,move")])
Re: RFA: consolidate DWARF strings into libiberty
Hi Tom, Built and regtested on x86-64 Fedora 16. Ok? Tom 2012-03-15 Tom Tromey * dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name. (dwarf_tag_name): Use get_DW_TAG_name. (dwarf_attr_name): Use get_DW_AT_name. (dwarf_form_name): Use get_DW_FORM_name. * dwarf2cfi.c (dwarf_cfi_name): Use get_DW_CFA_name. 2012-03-15 Tom Tromey * dwarf2.h (enum dwarf_tag, enum dwarf_form, enum dwarf_attribute) (enum dwarf_location_atom, enum dwarf_type, enum dwarf_call_frame_info): Remove. (DW_TAG, DW_TAG_DUP, DW_FORM, DW_AT, DW_AT_DUP, DW_OP) (DW_OP_DUP, DW_ATE, DW_ATE_DUP, DW_CFA): New macros. Include dwarf2.def. (get_DW_TAG_name, get_DW_AT_name, get_DW_FORM_name) (get_DW_OP_name, get_DW_ATE_name): Declare. * dwarf2.def: New file, from dwarf2.h. 2012-03-15 Tom Tromey * dwarfnames.c: New file. * Makefile.in (CFILES): Add dwarfnames. (REQUIRED_OFILES): Add dwarfnames. (./dwarfnames.$(objext)): New target. This is OK from a binutils point of view. Cheers Nick
Re: [C++ Patch] for c++/52465
2012/3/29 Jason Merrill : > On 03/08/2012 04:34 PM, Fabien Chêne wrote: >> >> * decl.c (grokdeclarator): Call strip_using_decl. > > > I would think we ought to be stripping USING_DECLs at a lower level, when we > first look up the name in the parser. They shouldn't make it as far as > grokdeclarator. Perhaps it is more correct like that, in cp_parser_set_decl_spec_type ? Bootstrapped/tested x86_64-unknown-linux-gnu. gcc/testsuite/ChangeLog 2012-04-07 Fabien Chêne PR c++/52465 * g++.dg/lookup/using52.C: New. gcc/cp/ChangeLog 2012-04-07 Fabien Chêne PR c++/52465 * parser.c (cp_parser_class_name): Call strip_using_decl and perform some checks on the target decl. (cp_parser_set_decl_spec_type): Change its prototype so that the second argument be modifiable, and strip using declarations of that argument. (cp_parser_type_specifier): Adjust the calls to cp_parser_set_decl_spec_type. (cp_parser_simple_type_specifier): Likewise. * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl to be stripped is NULL_TREE. (qualify_lookup): Call strip_using_decl and perform some checks on the target decl. -- Fabien 52465_2.patch Description: Binary data
Re: [C++ Patch] for c++/52465
2012/3/12 Fabien Chêne : > Salut Dodji, > > 2012/3/12 Dodji Seketeli : > [...] >>> Index: gcc/cp/decl.c >>> === >>> --- gcc/cp/decl.c (revision 184891) >>> +++ gcc/cp/decl.c (working copy) >>> @@ -8686,6 +8686,9 @@ grokdeclarator (const cp_declarator *dec >>> type = NULL_TREE; >>> type_was_error_mark_node = true; >>> } >>> + >>> + type = strip_using_decl (type); >>> + >> >> I am a little bit curious as to why this change is necessary. It seems >> to me that the test case of your patch would pass even without this >> change, wouldn't it? > > Yes, this testcase would pass, but an existing testcase wouldn't. I > don't remeber which one, but I think it was related to using > declarations that refer to a typedef. > > struct A { typedef int T; }; > stuct B : A { using B::T; }; More precisely, the testcase which was failing is g++.other/using5.C. -- Fabien
Re: [patch, fortran] Fix PR 52893
Hi Paul, OK for trunk and for 4.7. Committed as rev. 186213. As a matter of curiosity, why did you not inhibit common function extraction when the function arguments contain an implicit loop variable, rather than when they are in an implicit loop? That would make the optimisation rather less conservative. The main reason was simplicity; it would have been necessary to keep track of all the iterator variables (which can be nested) and check if the function has any of them as arguments. Not impossible, but I wanted this bug fix out of the door as soon as possible. I have added a FIXME in the comment for this. Thanks for the review! Thomas
[SH] Fold prefetch insns
Hi, The attached patch folds the prefetch insns for SH4 and SH2A. As far as I can see, there is no need to have two of them. The patch also adapts the sh2a-prefetch test case to be ran for SH4, too. Tested by running said test case with make check-gcc RUNTESTFLAGS="sh.exp=prefetch* --target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m2a-single/-mb,-m4/-ml,-m4/-mb, -m4-single/-ml,-m4-single/-mb,-m4a-single/-ml,-m4a-single/-mb}" OK? Cheers, Oleg ChangeLog: * config/sh/sh.md (*prefetch_i4, prefetch_m2a): Merge into ... (*prefetch): ... this new insn. testsuite/ChangeLog: * gcc.target/sh/sh2a-prefetch.c: Rename to ... * gcc.target/sh/prefetch.c: ... this. Enable test case for m4*. Index: gcc/testsuite/gcc.target/sh/prefetch.c === --- gcc/testsuite/gcc.target/sh/prefetch.c (revision 0) +++ gcc/testsuite/gcc.target/sh/prefetch.c (revision 0) @@ -0,0 +1,35 @@ +/* Testcase to check generation of a SH4 and SH2A operand cache prefetch + instruction PREF @Rm. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O0" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" "-m4*" } } */ +/* { dg-final { scan-assembler "pref"} } */ + +void +opt (void) +{ + int *p, wk; + int data[100]; + + /* data prefetch , instructions hit the cache. */ + + __builtin_prefetch (&data[0], 0, 0); + __builtin_prefetch (&data[0], 0, 1); + __builtin_prefetch (&data[0], 0, 2); + __builtin_prefetch (&data[0], 0, 3); + __builtin_prefetch (&data[0], 1, 0); + __builtin_prefetch (&data[0], 1, 1); + __builtin_prefetch (&data[0], 1, 2); + __builtin_prefetch (&data[0], 1, 3); + + + for (p = &data[0]; p < &data[9]; p++) +{ + if (*p > *(p + 1)) +{ + wk = *p; + *p = *(p + 1); + *(p + 1) = wk; +} +} +} Index: gcc/testsuite/gcc.target/sh/sh2a-prefetch.c === --- gcc/testsuite/gcc.target/sh/sh2a-prefetch.c (revision 186209) +++ gcc/testsuite/gcc.target/sh/sh2a-prefetch.c (working copy) @@ -1,34 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction PREF @Rm. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "pref"} } */ - -void -opt (void) -{ - int *p, wk; - int data[100]; - - /* data prefetch , instructions hit the cache. */ - - __builtin_prefetch (&data[0], 0, 0); - __builtin_prefetch (&data[0], 0, 1); - __builtin_prefetch (&data[0], 0, 2); - __builtin_prefetch (&data[0], 0, 3); - __builtin_prefetch (&data[0], 1, 0); - __builtin_prefetch (&data[0], 1, 1); - __builtin_prefetch (&data[0], 1, 2); - __builtin_prefetch (&data[0], 1, 3); - - - for (p = &data[0]; p < &data[9]; p++) -{ - if (*p > *(p + 1)) -{ - wk = *p; - *p = *(p + 1); - *(p + 1) = wk; -} -} -} Index: gcc/config/sh/sh.md === --- gcc/config/sh/sh.md (revision 186212) +++ gcc/config/sh/sh.md (working copy) @@ -13559,14 +13559,6 @@ } [(set_attr "type" "other")]) -(define_insn "*prefetch_i4" - [(prefetch (match_operand:SI 0 "register_operand" "r") - (match_operand:SI 1 "const_int_operand" "n") - (match_operand:SI 2 "const_int_operand" "n"))] - "(TARGET_HARD_SH4 || TARGET_SHCOMPACT) && !TARGET_VXWORKS_RTP" - "pref @%0"; - [(set_attr "type" "other")]) - ;; In user mode, the "pref" instruction will raise a RADDERR exception ;; for accesses to [0x8000,0x]. This makes it an unsuitable ;; implementation of __builtin_prefetch for VxWorks RTPs. @@ -13585,12 +13577,12 @@ operands[0] = force_reg (Pmode, operands[0]); }) -(define_insn "prefetch_m2a" +(define_insn "*prefetch" [(prefetch (match_operand:SI 0 "register_operand" "r") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] - "TARGET_SH2A" - "pref\\t@%0" + "(TARGET_SH2A || TARGET_HARD_SH4 || TARGET_SHCOMPACT) && !TARGET_VXWORKS_RTP" + "pref @%0" [(set_attr "type" "other")]) (define_insn "alloco_i"
Re: [PATCH] Compact SSA version namespace when releasing the freelist
On 4/6/12 1:48 PM, Richard Guenther wrote: That's with changed statistics accounting, it's a histogram for the per-function number SSA names that got released, thus for 16 functions we released zero SSA names, for 13 functions one. Great, thanks. Is this documented in the internals documentation? Diego.
Re: [C++ Patch] for c++/52465
On 04/07/2012 11:37 AM, Fabien Chêne wrote: Perhaps it is more correct like that, in cp_parser_set_decl_spec_type ? Even that seems late. Why not just return the target decl from cp_parser_class_name? Jason
[committed] Add labels to g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C
contrib/compare_tests gets confused if the same message is printed for the same line but with different status (PASS vs. XFAIL). Trivially fixed by giving different labels to each test. Committed as obvious. 2012-04-08 Manuel López-Ibáñez * g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Add labels to directives. Index: gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C === --- gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (revision 186215) +++ gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C (working copy) @@ -4,9 +4,9 @@ int foo() { int x; - float& q = reinterpret_cast (x); /* { dg-message "dereferencing type-punned" "" { target *-*-* } } */ - q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */ + float& q = reinterpret_cast (x); /* { dg-message "dereferencing type-punned" "deref" { target *-*-* } } */ + q = 1.0; /* { dg-warning "does break strict-aliasing" "strict-aliasing" { xfail *-*-* } } */ return x; } -/* { dg-message "initialized" "" { xfail *-*-* } 7 } */ +/* { dg-message "initialized" "note" { xfail *-*-* } 7 } */
Re: [PATCH] Caret diagnostics
On 7 April 2012 04:31, Jason Merrill wrote: > On 04/06/2012 06:30 PM, Manuel López-Ibáñez wrote: >>> >>> width if it's set; otherwise I would lean toward unlimited width. And I'm >>> not sure why we need a right margin at all. >> >> >> The right margin is because: > >>[snip] > > Ah, I read "margin" and assumed it meant you were leaving blank space at the > right side of the screen. Now I understand. I'll be happy to change it to whatever is more understandable. I think in CSS is called "padding". New version attached. Bootstrapped and regression tested including obj-c++. Cheers, Manuel. 2012-04-05 Manuel López-Ibáñez PR 24985 libstdc++-v3/ * testsuite/lib/prune.exp: Handle caret. libmudflap/ * testsuite/lib/libmudflap.exp: Handle caret. gcc/ * diagnostic.h (show_caret): Declare. (diagnostic_show_locus): Declare. * diagnostic.c (diagnostic_initialize): Initialize to false. (diagnostic_show_locus): New. (diagnostic_report_diagnostic): Call it. (getenv_columns): New function. * input.c (read_line): New. (location_get_source_line): New. * input.h (location_get_source_line): Declare. * toplev.c (general_init): Initialize show_caret from options. * dwarf2out.c (gen_producer_string): Handle fdiagnostics-show-caret. * opts.c (common_handle_option): Likewise. * common.opt (fdiagnostics-show-caret): New option. * testsuite/lib/prune.exp: Add -fno-diagnostics-show-caret. caret-diagnostics-20120408.diff Description: Binary data
Re: [SH] Use braced strings in MD
Oleg Endo wrote: > In my original patch > http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01315.html > I forgot two cases, which are addressed by the attached patch. > Tested with 'make all-gcc'. > OK? OK. Regards, kaz
Re: [SH] Fold prefetch insns
Oleg Endo wrote: > The attached patch folds the prefetch insns for SH4 and SH2A. > As far as I can see, there is no need to have two of them. > The patch also adapts the sh2a-prefetch test case to be ran for SH4, > too. > > Tested by running said test case with > make check-gcc RUNTESTFLAGS="sh.exp=prefetch* --target_board=sh-sim > \{-m2/-ml,-m2/-mb,-m2a/-mb,-m2a-single/-mb,-m4/-ml,-m4/-mb, > -m4-single/-ml,-m4-single/-mb,-m4a-single/-ml,-m4a-single/-mb}" > > OK? OK. Regards, kaz
Re: [SH] Use braced strings in MD
On Sun, 2012-04-08 at 08:01 +0900, Kaz Kojima wrote: > Oleg Endo wrote: > > In my original patch > > http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01315.html > > I forgot two cases, which are addressed by the attached patch. > > Tested with 'make all-gcc'. > > OK? > > OK. > Just spotted two more of those "{ ... }". I will commit the attached version of the patch, OK? Cheers, Oleg Index: gcc/config/sh/sh.md === --- gcc/config/sh/sh.md (revision 186214) +++ gcc/config/sh/sh.md (working copy) @@ -909,8 +909,10 @@ (match_operand:DI 1 "arith_operand" "r")) (const_int 0)))] "TARGET_SH1" - "* return output_branchy_insn (EQ, \"tst\\t%S1,%S0\;bf\\t%l9\;tst\\t%R1,%R0\", - insn, operands);" +{ + return output_branchy_insn (EQ, "tst\t%S1,%S0;bf\t%l9;tst\t%R1,%R0", + insn, operands); +} [(set_attr "length" "6") (set_attr "type" "arith3b")]) @@ -3156,7 +3158,6 @@ (and:SI (match_operand:SI 1 "logical_reg_operand" "") (match_operand:SI 2 "logical_operand" "")))] "" - " { if (TARGET_SH1 && CONST_INT_P (operands[2]) && INTVAL (operands[2]) == 255) @@ -3165,7 +3166,7 @@ gen_lowpart (QImode, operands[1]))); DONE; } -}") +}) (define_insn_and_split "anddi3" [(set (match_operand:DI 0 "arith_reg_dest" "=r,r,r") @@ -3179,14 +3180,13 @@ "reload_completed && ! logical_operand (operands[2], DImode)" [(const_int 0)] - " { if ((unsigned)INTVAL (operands[2]) == (unsigned) 0x) emit_insn (gen_mshflo_l_di (operands[0], operands[1], CONST0_RTX (DImode))); else emit_insn (gen_mshfhi_l_di (operands[0], CONST0_RTX (DImode), operands[1])); DONE; -}" +} [(set_attr "type" "arith_media")]) (define_insn "andcsi3" @@ -5638,7 +5638,9 @@ "TARGET_SH1 && (arith_reg_operand (operands[0], DImode) || arith_reg_operand (operands[1], DImode))" - "* return output_movedouble (insn, operands, DImode);" +{ + return output_movedouble (insn, operands, DImode); +} [(set_attr "length" "4") (set_attr "type" "pcload,move,load,store,move,pcload,move,move")])
Re: [SH] Use braced strings in MD
Oleg Endo wrote: > Just spotted two more of those "{ ... }". > I will commit the attached version of the patch, OK? OK. Regards, kaz
Re: [PATCH] Caret diagnostics
On 04/07/2012 06:29 PM, Manuel López-Ibáñez wrote: I'll be happy to change it to whatever is more understandable. I think in CSS is called "padding". That wouldn't be any clearer; my confusion was that I thought you were padding the right side of the source line, but you aren't; you are only making sure that the caret isn't too close to the edge of the terminal. No need to change anything here. +getenv_columns (void) I had been thinking to check COLUMNS once at the beginning of compilation; I don't think the value can change while the compiler is running since we don't respond to SIGWINCH. And let's use this value in c_common_initialize_diagnostics, too. +# Also it may trim a source line by mistake since it matches repeated lines. Let's clarify this comment; because dejagnu gets the whole compiler output as a single string, .* in a test regexp can match across multiple lines, which with caret diagnostics is likely to mean that the beginning of the regexp matches the error message and the end of the regexp matches the regexp itself in the printed source line. Jason
[PATCH][Cilkplus] Parsing support for Elemental function for C++
Hello Everyone, This patch is for the Cilkplus branch affecting mainly the C++ compiler. It provides parsing support for elemental function attributes. Thanks, Balaji V. Iyer.diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index 6b7c176..dc96718 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,8 @@ +2012-04-06 Balaji V. Iyer + + * c-parser.c (c_parser_elem_fn_expr_list): Fixed a bug and consumed + one token. + 2012-04-05 Balaji V. Iyer * config/i386/i386.c (type_natural_mode): Added a flag_enable_cilk diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 4aa4c2d..00a5064 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -12203,6 +12203,7 @@ c_parser_elem_fn_expr_list (c_parser *parser) && simple_cst_equal (token->value, get_identifier ("mask")) == 1) { + c_parser_consume_token (parser); gcc_assert (mask_list == NULL_TREE); mask_list = get_identifier ("mask"); if (c_parser_next_token_is (parser, CPP_COMMA)) diff --git a/gcc/cp/ChangeLog.cilk b/gcc/cp/ChangeLog.cilk index 0970089..65880f9 100644 --- a/gcc/cp/ChangeLog.cilk +++ b/gcc/cp/ChangeLog.cilk @@ -1,3 +1,13 @@ +2012-04-06 Balaji V. Iyer + + * parser.c (cp_parser_attribute_list): Added code to catch vector + attribute. + (cp_parser_elem_fn_processor_clause): New function. + (cp_parser_elem_fn_uniform_clause): Likewise. + (cp_parser_elem_fn_vlength_clause): Likewise. + (cp_parser_elem_fn_linear_clause): Likewise. + (cp_parser_elem_fn_expression_list): Likewise. + 2012-03-16 Balaji V. Iyer * decl.c (finish_function_body): called DECL_HAS_SPAWN_P and set it to @@ -5,7 +15,7 @@ * pt.c (tsubst_copy): Carried the spawn call information from one call expression to another. (tsubst_copy_and_build): Likewise. - + 2012-02-14 Balaji V. Iyer * parser.c (cp_parser_compound_stmt): Added a check to see if the diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f6408ae..9cc8794 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -241,7 +241,8 @@ static tree cp_literal_operator_id static tree cp_parser_array_notation (cp_parser *, tree, tree); - +static VEC(tree,gc) *cp_parser_elem_fn_expression_list + (cp_parser *); /* Manifest constants. */ #define CP_LEXER_BUFFER_SIZE ((256 * 1024) / sizeof (cp_token)) @@ -20760,10 +20761,17 @@ cp_parser_attribute_list (cp_parser* parser) VEC(tree,gc) *vec; int attr_flag = (attribute_takes_identifier_p (identifier) ? id_attr : normal_attr); - vec = cp_parser_parenthesized_expression_list - (parser, attr_flag, /*cast_p=*/false, -/*allow_expansion_p=*/false, -/*non_constant_p=*/NULL); + /* If we do find a vector attribute, we call the + * cp_parser_elem_fn_expression_list */ + if (TREE_CODE (identifier) == IDENTIFIER_NODE + && simple_cst_equal (identifier, + get_identifier ("vector")) == 1) + vec = cp_parser_elem_fn_expression_list (parser); + else + vec = cp_parser_parenthesized_expression_list + (parser, attr_flag, /*cast_p=*/false, + /*allow_expansion_p=*/false, + /*non_constant_p=*/NULL); if (vec == NULL) arguments = error_mark_node; else @@ -29206,4 +29214,402 @@ cp_parser_array_notation (cp_parser *parser, tree init_index, tree array_value) return value_tree; } +/* this function handles the processor clause in elemental func. attribute */ +static tree +cp_parser_elem_fn_processor_clause (cp_parser *parser) +{ + VEC (tree,gc) *proc_vec_list = NULL; + tree proc_tree_list = NULL_TREE; + + if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN)) +{ + cp_parser_error (parser, "expected %<)%>"); + cp_parser_skip_to_end_of_block_or_statement (parser); + return NULL_TREE; +} + else +cp_lexer_consume_token (parser->lexer); + + proc_vec_list = make_tree_vector (); + + if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)) +{ + cp_token *token = cp_lexer_consume_token (parser->lexer); + if (token->u.value + && TREE_CODE (token->u.value) == IDENTIFIER_NODE + && simple_cst_equal (token->u.value, + get_identifier ("pentium_4")) == 1) + VEC_safe_push (tree, gc, proc_vec_list, + build_string (strlen ("pentium_4"), "pentium_4")); + else if (token->u.value + && TREE_CODE (token->u.value) == IDENTIFIER_NODE + && simple_cst_equal (token->u.value, + get_identifier ("pentium4_sse3")) == 1) + VEC_safe_push (tree, gc