Re: [patch] Add new DW_AT and DW_FORM codes for Fission
On Wed, Jan 25, 2012 at 05:54:26PM -0800, Cary Coutant wrote: > I'd like to add these new DW_AT and DW_FORM codes for the Fission project: > >http://gcc.gnu.org/wiki/DebugFission > > We're currently working on the Fission implementation in GCC, gold, > and binutils, but I'd like to at least lay claim to the actual values > to prevent overlap with any other extensions that someone might start > working on. > > In GCC, we're working on the (git-only) google/debugfission branch. > We'll be sending gold and binutils patches soon. > > Any objections? Is this OK for trunk in binutils and gcc trees? If the DW_FORM_ values are meant to be in a vendor range of forms (which DWARF4 unfortunately doesn't have), aren't they too low, i.e. isn't there risk that eventually they'll clash with standard forms? The forms numbers aren't limited to 0 .. 0x7f, at the expense of a slightly bigger abbrev table you could as well use something very high, like 0x380+. And, if you want to standardize it, I'd assume the codes would be lower on the other side (there are still even free codes from 0x1a through to 0x1f). Jakub
Re: RFA: tree.c PATCH for c++/51992 (TARGET_EXPR in LTO stream)
On Wed, 25 Jan 2012, Jason Merrill wrote: > The problem here turns out to be that when free_lang_data_in_cgraph tries to > find all the decls and types in a function, it doesn't catch a type that only > appears in the fntype of a GIMPLE_CALL. This patch fixes the bug; is there a > better way to handle it? No, that looks exactly right. > Tested x86_64-pc-linux-gnu, OK for trunk? Ok. Thanks, Richard.
Re: [patch, arm, testsuite] fix regression in test di-longlong64-sync-withldrexd.c
On 25 January 2012 20:55, Richard Henderson wrote: > On 01/26/2012 02:35 AM, Greta Yorsh wrote: >> Before the change, __sync_lock_release expanded into STRD, storing DI value >> 0. > > The most important question is: Is STRD guaranteed to perform the store > atomically? (And conversely, does LDRD perform the load atomically?) > ldrd and strd by themselves are not mandated to be "single-copy" atomic. > If so (even for a subset of arch revisions going forward), then the > correct solution is to define atomic_{load,store}di patterns. > > If not, then your patch is correct. The patch is OK. Ramana
[PATCH] FIx for PR51990 - ICE in copy_reference_ops_from_ref
Richard, This patch fixes PR51990. The patch adds handling of WITH_SIZE_EXPR in copy_reference_ops_from_ref and create_component_ref_by_pieces_1, preventing ICEs on the test-cases. Bootstrapped and reg-tested on x86_64. Ok for stage4 or stage1? Thanks, - Tom 2012-01-26 Tom de Vries PR tree-optimization/51990 * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle WITH_SIZE_EXPR. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Same. * gcc.dg/pr51990.c: New test. * gcc.dg/pr51990-2.c: Same. Index: gcc/tree-ssa-sccvn.c === --- gcc/tree-ssa-sccvn.c (revision 183325) +++ gcc/tree-ssa-sccvn.c (working copy) @@ -624,6 +624,10 @@ copy_reference_ops_from_ref (tree ref, V switch (temp.opcode) { + case WITH_SIZE_EXPR: + temp.op0 = TREE_OPERAND (ref, 1); + temp.off = 0; + break; case MEM_REF: /* The base address gets its own vn_reference_op_s structure. */ temp.op0 = TREE_OPERAND (ref, 1); @@ -740,6 +744,7 @@ copy_reference_ops_from_ref (tree ref, V VEC_safe_push (vn_reference_op_s, heap, *result, &temp); if (REFERENCE_CLASS_P (ref) + || TREE_CODE (ref) == WITH_SIZE_EXPR || (TREE_CODE (ref) == ADDR_EXPR && !is_gimple_min_invariant (ref))) ref = TREE_OPERAND (ref, 0); Index: gcc/tree-ssa-pre.c === --- gcc/tree-ssa-pre.c (revision 183325) +++ gcc/tree-ssa-pre.c (working copy) @@ -2780,6 +2780,7 @@ create_component_ref_by_pieces_1 (basic_ case REALPART_EXPR: case IMAGPART_EXPR: case VIEW_CONVERT_EXPR: +case WITH_SIZE_EXPR: { tree folded; tree genop0 = create_component_ref_by_pieces_1 (block, ref, @@ -2787,8 +2788,12 @@ create_component_ref_by_pieces_1 (basic_ stmts, domstmt); if (!genop0) return NULL_TREE; - folded = fold_build1 (currop->opcode, currop->type, - genop0); + + folded + = (currop->opcode == WITH_SIZE_EXPR + ? fold_build2 (currop->opcode, currop->type, genop0, currop->op0) + : fold_build1 (currop->opcode, currop->type, genop0)); + return folded; } break; Index: gcc/testsuite/gcc.dg/pr51990.c === --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/pr51990.c (revision 0) @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +zzz (char *s1, char *s2, int len, int *q) +{ + int z = 5; + unsigned int i, b; + struct s { char a[z]; }; + struct s x; + + extern int foo (int, ...) __attribute__((pure)); + + for (i = 0; i < len; i++) +s1[i] = s2[i]; + + b = z & 0x3; + + len += (b == 0 ? 0 : 1) + z; + + *q = len; + return foo (z, x, x); +} Index: gcc/testsuite/gcc.dg/pr51990-2.c === --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/pr51990-2.c (revision 0) @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int y; +extern int foo (int, ...) __attribute__((pure)); + +int +zzz (char *s1, char *s2, int len, int *q, int c) +{ + int z = 5; + unsigned int i, b; + struct s { char a[z]; }; + struct s x; + int y_tmp = 5; + + for (i = 0; i < len; i++) +s1[i] = s2[i]; + + b = z & 0x3; + + len += (b == 0 ? 0 : 1) + z; + + *q = len; + + if (c) + y_tmp = foo (z, x, x) + 4; + + z = foo (z, x, x) + 4; + y = y_tmp; + + return z; +}
[Committed] S/390: Fix some testsuite fails
Hi, I've applied the attached patch to mainline in order to make some testsuite fails to disappear on s390 and s390x. gcc.dg/pr46309.c: This testcase depends on branch cost being above 1. I've copied the AVR solution and added a -mbranch-cost option to the back-end. That's probably quite handy in other situations as well. gcc.dg/pr44194-1.c: On s390 and s390x the ABI requires us to return structs always in memory what makes the testcase fail. "Fixed" by disabling the testcase on s390 and s390x. gfortran.dg/reassoc_4.f: For z10 and higher we override max-completely-peeled-insns and other parameters in the back-end what makes this testcase fail. The solution is to force the value to the default in order to make the testcase work with -march=z10 and higher again. Bye, -Andreas- 2012-01-26 Andreas Krebbel * config/s390/s390.h: Make BRANCH_COST an option. * config/s390/s390.opt: New option -mbranch-cost. 2012-01-26 Andreas Krebbel * gcc.dg/pr46309.c: Set branch-cost to 2 for s390 and s390x. * gcc.dg/pr44194-1.c: Disable since s390 returns structs always in memory. * gfortran.dg/reassoc_4.f: Force max-completely-peeled-insns to the default value for s390 and s390x. --- gcc/config/s390/s390.h|2 !! gcc/config/s390/s390.opt |6 ++ gcc/testsuite/gcc.dg/pr44194-1.c |2 !! gcc/testsuite/gcc.dg/pr46309.c|2 !! gcc/testsuite/gfortran.dg/reassoc_4.f |1 + 5 files changed, 7 insertions(+), 6 modifications(!) Index: gcc/config/s390/s390.h === *** gcc/config/s390/s390.h.orig --- gcc/config/s390/s390.h *** do { \ *** 722,728 /* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */ ! #define BRANCH_COST(speed_p, predictable_p) 1 /* Nonzero if access to memory by bytes is slow and undesirable. */ #define SLOW_BYTE_ACCESS 1 --- 722,728 /* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */ ! #define BRANCH_COST(speed_p, predictable_p) s390_branch_cost /* Nonzero if access to memory by bytes is slow and undesirable. */ #define SLOW_BYTE_ACCESS 1 Index: gcc/config/s390/s390.opt === *** gcc/config/s390/s390.opt.orig --- gcc/config/s390/s390.opt *** Warn if a single function's framesize ex *** 140,142 --- 140,148 mzarch Target Report RejectNegative Negative(mesa) Mask(ZARCH) z/Architecture + + mbranch-cost= + Target Report Joined RejectNegative UInteger Var(s390_branch_cost) Init(1) + Set the branch costs for conditional branch instructions. Reasonable + values are small, non-negative integers. The default branch cost is + 1. Index: gcc/testsuite/gcc.dg/pr46309.c === *** gcc/testsuite/gcc.dg/pr46309.c.orig --- gcc/testsuite/gcc.dg/pr46309.c *** *** 4,10 /* The transformation depends on BRANCH_COST being greater than 1 (see the notes in the PR), so try to force that. */ /* { dg-additional-options "-mtune=octeon2" { target mips*-*-* } } */ ! /* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* } } */ int f1 (int a) --- 4,10 /* The transformation depends on BRANCH_COST being greater than 1 (see the notes in the PR), so try to force that. */ /* { dg-additional-options "-mtune=octeon2" { target mips*-*-* } } */ ! /* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* s390*-*-* } } */ int f1 (int a) Index: gcc/testsuite/gfortran.dg/reassoc_4.f === *** gcc/testsuite/gfortran.dg/reassoc_4.f.orig --- gcc/testsuite/gfortran.dg/reassoc_4.f *** *** 1,6 --- 1,7 ! { dg-do compile } ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" } ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peel-times=16" { target spu-*-* } } + ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peeled-insns=400" { target s390*-*-* } } subroutine anisonl(w,vo,anisox,s,ii1,jj1,weight) integer ii1,jj1,i1,iii1,j1,jjj1,k1,l1,m1,n1 real*8 w(3,3),vo(3,3),anisox(3,3,3,3),s(60,60),weight Index: gcc/testsuite/gcc.dg/pr44194-1.c === *** gcc/testsuite/gcc.dg/pr44194-1.c.orig --- gcc/testsuite/gcc.dg/pr44194-1.c *** *** 1,4 ! /* { dg-do compile { target { { { i?86-*-* x86_64-*-* } && x32 } || lp64 } } } */ /* { dg-options "-O2 -fdump-rtl-dse1" }
[PATCH] Fix ARM pic_add_dot_plus_eight + load peephole (PR target/52006)
Hi! On this testcase we ICE because we have (insn 65 64 9 2 (set (reg/f:SI 2 r2 [141]) (unspec:SI [ (reg/f:SI 2 r2 [141]) (const_int 8 [0x8]) (const_int 1 [0x1]) ] UNSPEC_PIC_BASE)) rh784748.i:13 187 {pic_add_dot_plus_eight} (expr_list:REG_EQUAL (symbol_ref:SI ("*.LANCHOR0") [flags 0x182]) (nil))) (insn 9 65 10 2 (set (reg:SI 77 s14 [orig:143 b ] [143]) (mem/c:SI (reg/f:SI 2 r2 [141]) [2 b+0 S4 A32])) rh784748.i:13 640 {*arm_movsi_vfp} (expr_list:REG_DEAD (reg/f:SI 2 r2 [141]) (nil))) peephole2ed together. Unfortunately tls_load_pic_dot_plus_eight pattern uses "=r" constraint for the result, but here we have s14 register instead. We need to limit this only to mem loads into GENERAL_REGS (or pseudos) in order to satisfy that constraint. Peepholes don't have constraints, so we need to use either some predicate (this fix, apparently that is what other peephole2 and splitters in arm.md already do) or some condition. Ok for trunk? 2012-01-26 Jakub Jelinek PR target/52006 * config/arm/arm.md (pic_add_dot_plus_eight peephole2): Use arm_general_register_operand predicate for operand 2 instead of register_operand. * gcc.target/arm/pr52006.c: New test. --- gcc/config/arm/arm.md.jj2012-01-20 12:35:15.0 +0100 +++ gcc/config/arm/arm.md 2012-01-26 10:24:13.082570508 +0100 @@ -5719,7 +5719,8 @@ (define_peephole2 (const_int 8) (match_operand 1 "" "")] UNSPEC_PIC_BASE)) - (set (match_operand:SI 2 "register_operand" "") (mem:SI (match_dup 0)))] + (set (match_operand:SI 2 "arm_general_register_operand" "") + (mem:SI (match_dup 0)))] "TARGET_ARM && peep2_reg_dead_p (2, operands[0])" [(set (match_dup 2) (mem:SI (unspec:SI [(match_dup 3) --- gcc/testsuite/gcc.target/arm/pr52006.c.jj 2012-01-26 10:32:27.989658669 +0100 +++ gcc/testsuite/gcc.target/arm/pr52006.c 2012-01-26 10:32:34.626620068 +0100 @@ -0,0 +1,19 @@ +/* PR target/52006 */ +/* { dg-do compile } */ +/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */ + +unsigned long a; +static int b; + +void +foo (void) +{ + asm volatile ("" : "=r" (b)); +} + +void +bar (float f) +{ + if (f < b / 100.0) +a = 1; +} Jakub
Re: [PATCH] Fix libstdc++ build (PR bootstrap/51985)
On Wed, Jan 25, 2012 at 5:01 PM, Jakub Jelinek wrote: > Hi! > > Apparently $(inst_sources) is included in libc__98convenience_la_SOURCES and > libc__98_la_SOURCES twice, once directly, once through $(host_sources_extra) > included in $(sources). On x86_64-linux and others it causes just lots > of bloat (libstdc++.a is much bigger, as several objects are there twice, > and libstdc++.so.6 contains bigger .debug_* sections), but reportedly on > other targets it results in build failures. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for > trunk? Ok (I think it's obvious). Thanks, Richard. > I've verified abilists before Benjamin's change, after that without this > patch and with this patch and the changes are ok (the only changes are some > GLOBAL -> UNIQUE changes caused by Benjamin's patch, with this patch no > abilist changes at all). > > 2012-01-25 Jakub Jelinek > > PR bootstrap/51985 > * src/c++98/Makefile.am (libc__98_la_SOURCES, > libc__98convenience_la_SOURCES): Remove $(inst_sources). > * src/c++98/Makefile.in: Regenerated. > > --- libstdc++-v3/src/c++98/Makefile.am.jj 2012-01-25 13:04:07.0 > +0100 > +++ libstdc++-v3/src/c++98/Makefile.am 2012-01-25 13:59:04.560221970 +0100 > @@ -156,8 +156,8 @@ sources = \ > vpath % $(top_srcdir)/src/c++98 > vpath % $(top_srcdir) > > -libc__98_la_SOURCES = $(sources) $(inst_sources) > -libc__98convenience_la_SOURCES = $(sources) $(inst_sources) > +libc__98_la_SOURCES = $(sources) > +libc__98convenience_la_SOURCES = $(sources) > > # Use special rules for the deprecated source files so that they find > # deprecated include files. > --- libstdc++-v3/src/c++98/Makefile.in.jj 2012-01-25 13:04:07.0 > +0100 > +++ libstdc++-v3/src/c++98/Makefile.in 2012-01-25 13:59:51.549947625 +0100 > @@ -114,10 +114,10 @@ am__objects_6 = bitmap_allocator.lo pool > math_stubs_long_double.lo stdexcept.lo strstream.lo tree.lo \ > istream.lo streambuf.lo valarray.lo $(am__objects_1) \ > $(am__objects_5) > -am_libc__98_la_OBJECTS = $(am__objects_6) $(am__objects_2) > +am_libc__98_la_OBJECTS = $(am__objects_6) > libc__98_la_OBJECTS = $(am_libc__98_la_OBJECTS) > libc__98convenience_la_LIBADD = > -am_libc__98convenience_la_OBJECTS = $(am__objects_6) $(am__objects_2) > +am_libc__98convenience_la_OBJECTS = $(am__objects_6) > libc__98convenience_la_OBJECTS = $(am_libc__98convenience_la_OBJECTS) > DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) > depcomp = > @@ -423,8 +423,8 @@ sources = \ > ${host_sources} \ > ${host_sources_extra} > > -libc__98_la_SOURCES = $(sources) $(inst_sources) > -libc__98convenience_la_SOURCES = $(sources) $(inst_sources) > +libc__98_la_SOURCES = $(sources) > +libc__98convenience_la_SOURCES = $(sources) > > # Use special rules for the deprecated source files so that they find > # deprecated include files. > > Jakub
Re: [patch tree-eh]: Fix bootstrap issue for libjava for 32-bit mingw target
On Wed, Jan 25, 2012 at 10:00 PM, Andrew Pinski wrote: > On Wed, Jan 25, 2012 at 12:58 PM, Richard Henderson wrote: >> On 01/26/2012 05:44 AM, Kai Tietz wrote: >>> the following patch fixes a bootstrap issue for libjava (compile of >>> verify.cc ICEs). It is caused by the assumption that a GIMPLE_COND >>> lhs side has always a type. This isn't necessarily true, but it has >>> by default boolean_type_node as type. >> >> A perfectly valid assumption. The Java front end must have forgotten >> to set the type (to at least void_type_node). > > verify.cc is a C++ code so it is the C++ front-end. Still the assumption is perfectly valid - I suppose you simply got an SSA name that is on the free list here for some reason? Richard. > Thanks, > Andrew Pinski
Re: Fix PR48794 some more
On Wed, Jan 25, 2012 at 10:54 PM, Richard Henderson wrote: > On 01/26/2012 03:04 AM, Michael Matz wrote: >> Actually, resx/eh_dispatch always are the last BB statements, so the loop >> doesn't need to look at all statements in a BB, making it quite somewhat >> faster. Consider the tree-eh.c to be looking like so: > > For the record, is this without optimization or something? > > A region without a landing pad is unreachable. Thus I'd normally > expect the region's blocks, including the offending RESX referencing > the region, to be deleted as dead code. Even without optimization I hope. > Otherwise, this second patch is ok. > > > r~
[C++ Patch] PR 51370
Hi, in this minor diagnostic regression we ICE in dump_decl when we try to print the template arguments, which in this case are just error_mark_node, nothing sensible, not a TREE_VEC actually (the user entered repeated ). The fix I'm proposing for 4.7.0 seems to me very safe but for 4.8 we may want to revisit these things, maybe we want to keep the invariant that even in error conditions the arguments are always stored in a TREE_VEC (I *think* we used to have it, we should investigate whether we gave up on purpose) or something else entirely, like managing to not instantiate at all. For your immediate curiosity, the error_mark_node is created in tsubst_template_args:9687 but that is done in various situations, for packs too, I don't feel like fiddling with it just now (and simply removing it for sure leads to worse diagnostics for eg, typename7.C) Tested x86_64-linux. Thanks, Paolo. /cp 2012-01-26 Paolo Carlini PR c++/51370 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node as TREE_OPERAND (t, 1). /testsuite 2012-01-26 Paolo Carlini PR c++/51370 * g++.dg/template/crash112.C: New. Index: testsuite/g++.dg/template/crash112.C === --- testsuite/g++.dg/template/crash112.C(revision 0) +++ testsuite/g++.dg/template/crash112.C(revision 0) @@ -0,0 +1,15 @@ +// PR c++/51370 + +struct A +{ + template void foo() {} +}; + +template struct B {}; // { dg-error "declaration" } + +template struct C +{ + B<&A::foo > b; // { dg-error "declaration|type" } +}; + +C<0> c; Index: cp/error.c === --- cp/error.c (revision 183555) +++ cp/error.c (working copy) @@ -1,7 +1,7 @@ /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -1118,14 +1118,17 @@ dump_decl (tree t, int flags) case TEMPLATE_ID_EXPR: { tree name = TREE_OPERAND (t, 0); + tree args = TREE_OPERAND (t, 1); if (is_overloaded_fn (name)) name = DECL_NAME (get_first_fn (name)); dump_decl (name, flags); pp_cxx_begin_template_argument_list (cxx_pp); - if (TREE_OPERAND (t, 1)) - dump_template_argument_list (TREE_OPERAND (t, 1), flags); - pp_cxx_end_template_argument_list (cxx_pp); + if (args == error_mark_node) + pp_string (cxx_pp, M_("")); + else if (args) + dump_template_argument_list (args, flags); + pp_cxx_end_template_argument_list (cxx_pp); } break;
Re: [PATCH] FIx for PR51990 - ICE in copy_reference_ops_from_ref
On Thu, Jan 26, 2012 at 10:35 AM, Tom de Vries wrote: > Richard, > > This patch fixes PR51990. > > The patch adds handling of WITH_SIZE_EXPR in copy_reference_ops_from_ref and > create_component_ref_by_pieces_1, preventing ICEs on the test-cases. The create_component_ref_by_pieces_1 handling is incorrect - you fail to properly re-instantiate operand 1 (currop->op0). You should add a new case for WITH_SIZE_EXPR and properly handle it via op0expr = get_or_alloc_expr_for (currop->op0); genop0 = find_or_generate_expression (block, op0expr, stmts, domstmt); if (!genop0) return NULL_TREE; Richard. > Bootstrapped and reg-tested on x86_64. > > Ok for stage4 or stage1? > > Thanks, > - Tom > > 2012-01-26 Tom de Vries > > PR tree-optimization/51990 > * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle > WITH_SIZE_EXPR. > * tree-ssa-pre.c (create_component_ref_by_pieces_1): Same. > > * gcc.dg/pr51990.c: New test. > * gcc.dg/pr51990-2.c: Same.
Re: [PATCH] Fix ARM pic_add_dot_plus_eight + load peephole (PR target/52006)
On 26 January 2012 10:47, Jakub Jelinek wrote: > Hi! > > On this testcase we ICE because we have > (insn 65 64 9 2 (set (reg/f:SI 2 r2 [141]) > (unspec:SI [ > (reg/f:SI 2 r2 [141]) > (const_int 8 [0x8]) > (const_int 1 [0x1]) > ] UNSPEC_PIC_BASE)) rh784748.i:13 187 {pic_add_dot_plus_eight} > (expr_list:REG_EQUAL (symbol_ref:SI ("*.LANCHOR0") [flags 0x182]) > (nil))) > > (insn 9 65 10 2 (set (reg:SI 77 s14 [orig:143 b ] [143]) > (mem/c:SI (reg/f:SI 2 r2 [141]) [2 b+0 S4 A32])) rh784748.i:13 640 > {*arm_movsi_vfp} > (expr_list:REG_DEAD (reg/f:SI 2 r2 [141]) > (nil))) > peephole2ed together. Unfortunately tls_load_pic_dot_plus_eight pattern > uses "=r" constraint for the result, but here we have s14 register instead. > We need to limit this only to mem loads into GENERAL_REGS (or pseudos) in > order to satisfy that constraint. Peepholes don't have constraints, so > we need to use either some predicate (this fix, apparently that is what > other peephole2 and splitters in arm.md already do) or some condition. The analysis is reasonable and it's interesting that we haven't hit this before even with the softfp variant of the PCS. Not peephole'ing this form is correct given that the VFP doesn't really have the [pc, reg] addressing form. > Ok for trunk? OK if no regressions. Ramana > > 2012-01-26 Jakub Jelinek > >PR target/52006 >* config/arm/arm.md (pic_add_dot_plus_eight peephole2): Use >arm_general_register_operand predicate for operand 2 instead of >register_operand. > >* gcc.target/arm/pr52006.c: New test. > > --- gcc/config/arm/arm.md.jj2012-01-20 12:35:15.0 +0100 > +++ gcc/config/arm/arm.md 2012-01-26 10:24:13.082570508 +0100 > @@ -5719,7 +5719,8 @@ (define_peephole2 >(const_int 8) >(match_operand 1 "" "")] > UNSPEC_PIC_BASE)) > - (set (match_operand:SI 2 "register_operand" "") (mem:SI (match_dup 0)))] > + (set (match_operand:SI 2 "arm_general_register_operand" "") > + (mem:SI (match_dup 0)))] > "TARGET_ARM && peep2_reg_dead_p (2, operands[0])" > [(set (match_dup 2) >(mem:SI (unspec:SI [(match_dup 3) > --- gcc/testsuite/gcc.target/arm/pr52006.c.jj 2012-01-26 10:32:27.989658669 > +0100 > +++ gcc/testsuite/gcc.target/arm/pr52006.c 2012-01-26 10:32:34.626620068 > +0100 > @@ -0,0 +1,19 @@ > +/* PR target/52006 */ > +/* { dg-do compile } */ > +/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */ > + > +unsigned long a; > +static int b; > + > +void > +foo (void) > +{ > + asm volatile ("" : "=r" (b)); > +} > + > +void > +bar (float f) > +{ > + if (f < b / 100.0) > +a = 1; > +} > >Jakub
[C++ Patch] PR 51989
Hi, the straightforward fix per the audit trail. Tested x86_64-linux. Ok for Stage 1? Thanks, Paolo. /cp 2012-01-26 Paolo Carlini PR c++/51989 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and propagate it. * cp-tree.h (build_x_arrow): Adjust prototype. * pt.c (tsubst_copy_and_build): Adjust call. * parser.c (cp_parser_postfix_dot_deref_expression): Likewise. /testsuite 2012-01-26 Paolo Carlini PR c++/51989 * g++.dg/cpp0x/sfinae32.C: New. Index: testsuite/g++.dg/cpp0x/sfinae32.C === --- testsuite/g++.dg/cpp0x/sfinae32.C (revision 0) +++ testsuite/g++.dg/cpp0x/sfinae32.C (revision 0) @@ -0,0 +1,18 @@ +// PR c++/51989 +// { dg-options -std=c++0x } + +template +struct is_container +{ + template begin())> + static char test(U* u); + + template static long test(...); + + enum { value = sizeof test(0) == 1 }; +}; + +int main() +{ + return is_container::value; +} Index: cp/typeck2.c === --- cp/typeck2.c(revision 183555) +++ cp/typeck2.c(working copy) @@ -1462,7 +1462,7 @@ build_scoped_ref (tree datum, tree basetype, tree* delegation is detected. */ tree -build_x_arrow (tree expr) +build_x_arrow (tree expr, tsubst_flags_t complain) { tree orig_expr = expr; tree type = TREE_TYPE (expr); @@ -1486,7 +1486,7 @@ tree while ((expr = build_new_op (COMPONENT_REF, LOOKUP_NORMAL, expr, NULL_TREE, NULL_TREE, - &fn, tf_warning_or_error))) + &fn, complain))) { if (expr == error_mark_node) return error_mark_node; @@ -1497,7 +1497,8 @@ tree if (vec_member (TREE_TYPE (expr), types_memoized)) { - error ("circular pointer delegation detected"); + if (complain & tf_error) + error ("circular pointer delegation detected"); return error_mark_node; } @@ -1510,7 +1511,8 @@ tree if (last_rval == NULL_TREE) { - error ("base operand of %<->%> has non-pointer type %qT", type); + if (complain & tf_error) + error ("base operand of %<->%> has non-pointer type %qT", type); return error_mark_node; } @@ -1530,13 +1532,16 @@ tree return expr; } - return cp_build_indirect_ref (last_rval, RO_NULL, tf_warning_or_error); + return cp_build_indirect_ref (last_rval, RO_NULL, complain); } - if (types_memoized) -error ("result of %()%> yields non-pointer result"); - else -error ("base operand of %<->%> is not a pointer"); + if (complain & tf_error) +{ + if (types_memoized) + error ("result of %()%> yields non-pointer result"); + else + error ("base operand of %<->%> is not a pointer"); +} return error_mark_node; } Index: cp/pt.c === --- cp/pt.c (revision 183555) +++ cp/pt.c (working copy) @@ -13678,7 +13678,7 @@ tsubst_copy_and_build (tree t, /* Remember that there was a reference to this entity. */ if (DECL_P (op1)) mark_used (op1); - return build_x_arrow (op1); + return build_x_arrow (op1, complain); case NEW_EXPR: { Index: cp/parser.c === --- cp/parser.c (revision 183555) +++ cp/parser.c (working copy) @@ -5910,7 +5910,8 @@ cp_parser_postfix_dot_deref_expression (cp_parser /* If this is a `->' operator, dereference the pointer. */ if (token_type == CPP_DEREF) -postfix_expression = build_x_arrow (postfix_expression); +postfix_expression = build_x_arrow (postfix_expression, + tf_warning_or_error); /* Check to see whether or not the expression is type-dependent. */ dependent_p = type_dependent_expression_p (postfix_expression); /* The identifier following the `->' or `.' is not qualified. */ Index: cp/cp-tree.h === --- cp/cp-tree.h(revision 183555) +++ cp/cp-tree.h(working copy) @@ -5876,7 +5876,7 @@ extern void check_narrowing (tree, tree); extern tree digest_init(tree, tree, tsubst_flags_t); extern tree digest_init_flags (tree, tree, int); extern tree build_scoped_ref (tree, tree, tree *); -extern tree build_x_arrow (tree); +extern tree build_x_arrow (tree, tsubst_flags_t); extern tree build_m_component_ref (tree, tree); extern tree build_functional_cast (tree, tree, tsubst_flags_t); extern tree add_exception_specifier
[PATCH] PR c++/51641 - Lookup finds enclosing class member instead of template parameter
Hello, In the example of the patch, the U in 'typename U::X r' should bind to the template parameter U rather than the class member U. I think the problem comes from parameter_of_template_p that compares parameters by using pointer equality, rather than by using type equivalence like compparms does. As a result, binding_to_template_parms_of_scope_p and then outer_binding (via binding_to_template_parms_of_scope_p) misses the template parameter U and returns the class member U instead. Fixed thus, tested on x86_64-unknown-linux-gnu against trunk. OK for trunk when stage 1 opens? gcc/cp/ PR c++/51641 * cp-tree.h (template_type_parameter_p): Declare ... * pt.c (template_type_parameter_p): ... new function. (parameter_of_template_p): Rely on type equivalence rather than pointer equality to compare template parms. gcc/testsuite/ PR c++/51641 * g++.dg/lookup/hidden-class17.C: New test. --- gcc/cp/cp-tree.h |1 + gcc/cp/pt.c | 29 ++--- gcc/testsuite/g++.dg/lookup/hidden-class17.C | 22 +++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/lookup/hidden-class17.C diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f27755e..972c600 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5361,6 +5361,7 @@ extern bool parameter_of_template_p (tree, tree); extern void init_template_processing (void); extern void print_template_statistics (void); bool template_template_parameter_p (const_tree); +bool template_type_parameter_p (const_tree); extern bool primary_template_instantiation_p(const_tree); extern tree get_primary_template_innermost_parameters (const_tree); extern tree get_template_parms_at_level (tree, int); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e440be7..cb9554a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2890,6 +2890,18 @@ template_template_parameter_p (const_tree parm) return DECL_TEMPLATE_TEMPLATE_PARM_P (parm); } +/* Return true iff PARM is a DECL representing a type template + parameter. */ + +bool +template_type_parameter_p (const_tree parm) +{ + return (parm + && (TREE_CODE (parm) == TYPE_DECL + || TREE_CODE (parm) == TEMPLATE_DECL) + && DECL_TEMPLATE_PARM_P (parm)); +} + /* Return the template parameters of T if T is a primary template instantiation, NULL otherwise. */ @@ -8160,10 +8172,19 @@ parameter_of_template_p (tree parm, tree templ) if (p == error_mark_node) continue; - if (parm == p - || (DECL_INITIAL (parm) - && DECL_INITIAL (parm) == DECL_INITIAL (p))) - return true; + if (template_type_parameter_p (parm)) + { + if (same_type_p (TREE_TYPE (parm), TREE_TYPE (p))) + return true; + } + else + { + if (DECL_INITIAL (parm) + && DECL_INITIAL (p) + && same_type_p (TREE_TYPE (DECL_INITIAL (parm)), + TREE_TYPE (DECL_INITIAL (p + return true; + } } return false; diff --git a/gcc/testsuite/g++.dg/lookup/hidden-class17.C b/gcc/testsuite/g++.dg/lookup/hidden-class17.C new file mode 100644 index 000..3d5ccec --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/hidden-class17.C @@ -0,0 +1,22 @@ +// Origin PR c++/51641 +// { dg-do compile } + +struct A { +struct B { typedef int X; }; +}; + +template struct C : A { +B::X q; // Ok: A::B. +struct U { typedef int X; }; +template +struct D; +}; + +template +template +struct C::D { +typename U::X r; // { dg-error "" } +}; + +C::D y; + -- 1.7.6.5 -- Dodji
[Committed] S/390: Fix another branch cost dependent testcase
2012-01-26 Andreas Krebbel * gcc.dg/ssa-dom-thread-4.c: Set -mbranch-cost=2 for s390 and s390x. --- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c |1 + 1 file changed, 1 insertion(+) Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c === *** gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c.orig --- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c *** *** 1,5 --- 1,6 /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-dom1-details" } */ + /* { dg-additional-options "-mbranch-cost=2" { target s390*-*-* } } */ struct bitmap_head_def; typedef struct bitmap_head_def *bitmap; typedef const struct bitmap_head_def *const_bitmap;
Re: [PATCH][3/n] Fix PR50444, misalignment issues and SRA
On Tue, Jan 24, 2012 at 04:38:46PM +0100, Richard Guenther wrote: > Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk? > 2012-01-24 Richard Guenther > > PR tree-optimization/50444 > * expr.c (expand_assignment): Handle misaligned bases consistently, > even when wrapped inside component references. This is ok for trunk, unless somebody objects within next 24 hours. Jakub
Re: [Committed] S/390: Fix some testsuite fails
On Thu, Jan 26, 2012 at 11:05:21AM +0100, Andreas Krebbel wrote: > *** gcc/testsuite/gfortran.dg/reassoc_4.f.orig > --- gcc/testsuite/gfortran.dg/reassoc_4.f > *** > *** 1,6 > --- 1,7 > ! { dg-do compile } > ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" } > ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param > max-completely-peel-times=16" { target spu-*-* } } > + ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param > max-completely-peeled-insns=400" { target s390*-*-* } } Better would be to use dg-additional-options here (both for s390 and spu). Jakub
Re: [patch tree-eh]: Fix bootstrap issue for libjava for 32-bit mingw target
2012/1/26 Richard Guenther : > On Wed, Jan 25, 2012 at 10:00 PM, Andrew Pinski wrote: >> On Wed, Jan 25, 2012 at 12:58 PM, Richard Henderson wrote: >>> On 01/26/2012 05:44 AM, Kai Tietz wrote: the following patch fixes a bootstrap issue for libjava (compile of verify.cc ICEs). It is caused by the assumption that a GIMPLE_COND lhs side has always a type. This isn't necessarily true, but it has by default boolean_type_node as type. >>> >>> A perfectly valid assumption. The Java front end must have forgotten >>> to set the type (to at least void_type_node). >> >> verify.cc is a C++ code so it is the C++ front-end. > > Still the assumption is perfectly valid - I suppose you simply got an SSA name > that is on the free list here for some reason? > > Richard. Sorry for the noise. I have found the problem. It was self-made. Kai
Re: Fix PR48794 some more
Hi, On Thu, 26 Jan 2012, Richard Henderson wrote: > On 01/26/2012 03:04 AM, Michael Matz wrote: > > Actually, resx/eh_dispatch always are the last BB statements, so the loop > > doesn't need to look at all statements in a BB, making it quite somewhat > > faster. Consider the tree-eh.c to be looking like so: > > For the record, is this without optimization or something? Yes, it's with various -fno-xyz options that result in certain code to be removed later than usual. But it seems to me that with a sophisticated enough testcase it could be reproduced also with just -O2, because ... > A region without a landing pad is unreachable. Thus I'd normally expect > the region's blocks, including the offending RESX referencing the > region, to be deleted as dead code. ... just because a region has no landing pads anymore merely means any associated RESX is externally throwing. The resx itself might very well still be reachable. That's what happens with that testcase, the situation before the first ehcleanup: 1 cleanup land:{2,} 2 cleanup land:{1,} 3 must_not_throw ... finally_tmp.4D.1912_6 = 1; switch (finally_tmp.4D.1912_6) , case 1: > ... : return; # SUCC: EXIT # BLOCK 4 # PRED: 2 : [LP 2] resx 2 # SUCC: 5 (eh) # BLOCK 5 # PRED: 4 (eh) : [LP 2] resx 1 # SUCC: Nothing is using landing pad 1 (L21, indeed that label isn't in the insn stream anymore even). So we remove bb 5 and mark the resx2 as not be associated with a region anymore, leaving us with: 1 cleanup land:{2,} 2 cleanup ... finally_tmp.4D.1912_6 = 1; switch (finally_tmp.4D.1912_6) , case 1: > ... : return; # SUCC: EXIT # BLOCK 4 # PRED: 2 : resx 2 # SUCC: Note how bb 4 can still be reached by the switch (that will later be optimized, because in reality finally_tmp.4D.1912_6 will always be 1, therefore that path is unreachable), and will be externally throwing. Without the patch, though, we now happily remove region 2, without doing anything on that resx (and I'm not sure we actually can do much about it, it must stay something externally throwing). And the removed section 2 then wreaks havok in the inliner when it wants to remap the resx statement. Perhaps the better solution would simply be to robustify the inliner (a resx with a null region is externally throwing and hence, when inlined could be transformed into a resx associated with the innermost region of the inline call) instead of avoiding to remove the region, but as Jakub already went the current way with remove_unreachable_handlers I thought it most conservative for this stage to do similar. > Otherwise, this second patch is ok. Thanks. r183559. Ciao, Michael.
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
> Now that Richi has fixed up SRA not to pessimize code by changing non-BLK > mode arguments into their BLKmode subparts, I think it would be nice > to fix up also the expansion of the BLKmode MEM_REFs that have non-BLKmode > non-addressable base decl. While this doesn't happen for this testcase > anymore, it rarely still occurs and I think it is wrong to expand > a BLKmode MEM_REF into a non-BLKmode rtx. While the callers sometimes > can cope with it, often they can't. Another example is PR middle-end/51959, the BLKmode MEM_REF with non-BLKmode base is created by inlining, expanded to a DImode REG in expand_assignment and then sent to store_field, which attemps to spill it to memory but runs into an alias set conflict. I'll try to redirect it to the regular MEM_REF expander instead, so your patch might be a prerequisite. > Bootstrapped/regtested on x86_64-linux and i686-linux, bootstrapped on > powerpc64-linux (both --with-cpu=default32 and with real 64-bit > profiledbootstrap). Ok for trunk? > > 2012-01-19 Jakub Jelinek > > PR middle-end/51895 > * expr.c (expand_expr_real_1): Handle BLKmode MEM_REF of > non-addressable non-BLKmode base correctly. > > * g++.dg/opt/pr51895.C: New test. I think that it should be applied. -- Eric Botcazou
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
On Thu, 26 Jan 2012, Eric Botcazou wrote: > > Now that Richi has fixed up SRA not to pessimize code by changing non-BLK > > mode arguments into their BLKmode subparts, I think it would be nice > > to fix up also the expansion of the BLKmode MEM_REFs that have non-BLKmode > > non-addressable base decl. While this doesn't happen for this testcase > > anymore, it rarely still occurs and I think it is wrong to expand > > a BLKmode MEM_REF into a non-BLKmode rtx. While the callers sometimes > > can cope with it, often they can't. > > Another example is PR middle-end/51959, the BLKmode MEM_REF with non-BLKmode > base is created by inlining, expanded to a DImode REG in expand_assignment > and > then sent to store_field, which attemps to spill it to memory but runs into > an > alias set conflict. I'll try to redirect it to the regular MEM_REF expander > instead, so your patch might be a prerequisite. Hmm, how can store_field run into an "alias set conflict"? ... Richard.
Re: [C++ Patch] PR 51370
On 01/26/2012 06:01 AM, Paolo Carlini wrote: The fix I'm proposing for 4.7.0 seems to me very safe OK. but for 4.8 we may want to revisit these things, maybe we want to keep the invariant that even in error conditions the arguments are always stored in a TREE_VEC I think I prefer the current situation of error_mark_node bubbling out like an exception. Along those lines, I would be inclined to replace the TEMPLATE_ID_EXPR with an error_mark_node if the arguments are error_mark_node. Jason
Re: [C++ Patch] PR 51989
On 01/26/2012 06:40 AM, Paolo Carlini wrote: Ok for Stage 1? Yep. Jason
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
> Hmm, how can store_field run into an "alias set conflict"? ... Bad wording... I meant an alias set issue. The two alias sets (that of the BLKmode type and that of the non-BLKmode type) precisely don't conflict when store_field does its spilling trick (third "if" in the function) so it stops. -- Eric Botcazou
Re: [trans-mem] Do not instrument thread locals
On 01/25/12 14:16, Richard Henderson wrote: On 01/25/2012 01:30 PM, Patrick Marlier wrote: From my point of view, no. When it is a thread local, it should not be shared to someone else. If the thread dies, what happens to the thread local variable? Should it be discarded completely and this piece of memory never reallocated? Even if the programmer take care of this situation, does it make sense to share a thread local to other threads? No, Andi has a point. It's no more invalid than sharing a variable off the local stack with another thread. All that's required is that the foreign thread not keep the pointer permanently; that the use of the tls variable end before the thread ends. And it's entirely likely that I'd thought of exactly that two years ago when the DECL_THREAD_LOCAL test was omitted from that bit of code, but I failed to add a comment. I guess this patch needs to be reverted... Will do so.
Looking for my special someone, my best friend
Privet, my gentleman True love comes quietly, without banners or flashing lights. If you hear bells, get your ears checked. In the vast uncertainly in the space we call life I know one beautiful day you will come into my mind and fill the emptiness of my life. The hollow ring of the wind will hold music. The black sky will drip with silver stars. You will put your hand in mine and I will find true meaning, something to lift and sustain me against indifference and pain. Here in the cold space of existence that wears an ambiguous facade, will be something that is warm and true and sure, a glowing fragment which will be our very own. And it is just what I need www.myheart-withyou.in Kisses Nastia
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
On Thu, 26 Jan 2012, Richard Guenther wrote: > On Thu, 26 Jan 2012, Eric Botcazou wrote: > > > > Now that Richi has fixed up SRA not to pessimize code by changing non-BLK > > > mode arguments into their BLKmode subparts, I think it would be nice > > > to fix up also the expansion of the BLKmode MEM_REFs that have non-BLKmode > > > non-addressable base decl. While this doesn't happen for this testcase > > > anymore, it rarely still occurs and I think it is wrong to expand > > > a BLKmode MEM_REF into a non-BLKmode rtx. While the callers sometimes > > > can cope with it, often they can't. > > > > Another example is PR middle-end/51959, the BLKmode MEM_REF with > > non-BLKmode > > base is created by inlining, expanded to a DImode REG in expand_assignment > > and > > then sent to store_field, which attemps to spill it to memory but runs into > > an > > alias set conflict. I'll try to redirect it to the regular MEM_REF > > expander > > instead, so your patch might be a prerequisite. > > Hmm, how can store_field run into an "alias set conflict"? ... I think the bug is that if (mode == BLKmode && (REG_P (target) || GET_CODE (target) == SUBREG)) { rtx object = assign_temp (type, 0, 1, 1); rtx blk_object = adjust_address (object, BLKmode, 0); assign_temp here uses TYPE which is not compatible with the requested ALIAS_SET. expand_assignment calls it like result = store_field (to_rtx, bitsize, bitpos, bitregion_start, bitregion_end, mode1, from, TREE_TYPE (tem), get_alias_set (to), nontemporal); but that of course does not work for view-converted to (thus, a MEM_REF on a placement-new accessed storage for example). We need to simply force ALIAS_SET to be set on the assign_temp result - but it looks like that's not easily possible without hitting that very same assert. Ugh. Of course get_inner_reference looks through these kind of conversions when returning the ultimate decl in MEM [&foo], see the jumps in tree-ssa-alias.c we perform to re-discover the view-converting cases ... (at some point I realized that this probably wasn't the best design decision). So maybe if the passed type isn't used in any other way we can get around and discover the view-convert and use the alias-type of the MEM_REF ... Richard.
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
> Of course get_inner_reference looks through these kind of > conversions when returning the ultimate decl in MEM [&foo], > see the jumps in tree-ssa-alias.c we perform to re-discover > the view-converting cases ... (at some point I realized that > this probably wasn't the best design decision). So maybe > if the passed type isn't used in any other way we can > get around and discover the view-convert and use the alias-type > of the MEM_REF ... But I presume that the regular MEM_REF expander can cope with this case? -- Eric Botcazou
Re: [PATCH] Fix expansion of BLKmode MEM_REF with non-addressable non-BLKmode base decl (PR middle-end/51895)
On Thu, 26 Jan 2012, Eric Botcazou wrote: > > Of course get_inner_reference looks through these kind of > > conversions when returning the ultimate decl in MEM [&foo], > > see the jumps in tree-ssa-alias.c we perform to re-discover > > the view-converting cases ... (at some point I realized that > > this probably wasn't the best design decision). So maybe > > if the passed type isn't used in any other way we can > > get around and discover the view-convert and use the alias-type > > of the MEM_REF ... > > But I presume that the regular MEM_REF expander can cope with this case? Sure. Btw, we seem to use the TYPE argument solely for the purpose of the assign_temp call - and in the forwarding to store_field we pass down the very same alias_set which isn't needed, we can just use MEM_ALIAS_SET (blk_object) here it seems, it's different memory after all, no need to conflict with TARGET (or set MEM_KEEP_ALIAS_SET_P - what's that ..., ah, DECL_NONADDRESSABLE ...). Of course if you can simplify the code by using the regular expander all the better (and eliminate the TYPE argument?). @@ -6299,7 +6302,7 @@ store_field (rtx target, HOST_WIDE_INT b store_field (blk_object, bitsize, bitpos, bitregion_start, bitregion_end, - mode, exp, type, alias_set, nontemporal); + mode, exp, type, MEM_ALIAS_SET (blk_object), nontemporal); emit_move_insn (target, object); works for me. Thanks, Richard.
Re: Fix regression on PR46590 (slow compile with -O0)
Hi, On Tue, 24 Jan 2012, Richard Guenther wrote: > > + && !is_gimple_reg (t)) > > + > > Ok with the excessive vertical space removed. Actually the patch as is was regressing some testcases (pr48794.f90, fixed with an tree-eh change in another thread) and pack9.adb, which is fixed with the tree-eh change below. As we emit more clobbers with my gimplify patch we more often run into the situation that certain EH blocks aren't really empty. The easy fix is to try making them empty before checking in cleanup_empty_eh. Compared to the last version I also removed the unrelated changes in the predicate, it was a thinko. This patch as is completed regstrap on x86_64-linux for all,ada,obj-c++ . Still okay? Ciao, Michael. PR tree-optimization/46590 * cfgexpand.c: Revert last change (r183305). * gimplify.c (gimplify_bind_expr): Add clobbers for all non-gimple regs. * tree-eh.c (cleanup_empty_eh): Try to optimize clobbers before checking for emptiness. Index: gimplify.c === --- gimplify.c (revision 183524) +++ gimplify.c (working copy) @@ -1231,7 +1231,7 @@ gimplify_bind_expr (tree *expr_p, gimple && !DECL_HAS_VALUE_EXPR_P (t) /* Only care for variables that have to be in memory. Others will be rewritten into SSA names, hence moved to the top-level. */ - && needs_to_live_in_memory (t)) + && !is_gimple_reg (t)) { tree clobber = build_constructor (TREE_TYPE (t), NULL); TREE_THIS_VOLATILE (clobber) = 1; Index: tree-eh.c === --- tree-eh.c (revision 183559) +++ tree-eh.c (working copy) @@ -4056,6 +4056,7 @@ cleanup_empty_eh (eh_landing_pad lp) edge_iterator ei; edge e, e_out; bool has_non_eh_pred; + bool ret = false; int new_lp_nr; /* There can be zero or one edges out of BB. This is the quickest test. */ @@ -4070,6 +4071,16 @@ cleanup_empty_eh (eh_landing_pad lp) default: return false; } + + resx = last_stmt (bb); + if (resx && is_gimple_resx (resx)) +{ + if (stmt_can_throw_external (resx)) + optimize_clobbers (bb); + else if (sink_clobbers (bb)) + ret = true; +} + gsi = gsi_after_labels (bb); /* Make sure to skip debug statements. */ @@ -4081,9 +4092,9 @@ cleanup_empty_eh (eh_landing_pad lp) { /* For the degenerate case of an infinite loop bail out. */ if (infinite_empty_loop_p (e_out)) - return false; + return ret; - return cleanup_empty_eh_unsplit (bb, e_out, lp); + return ret | cleanup_empty_eh_unsplit (bb, e_out, lp); } /* The block should consist only of a single RESX statement, modulo a @@ -4096,7 +4107,7 @@ cleanup_empty_eh (eh_landing_pad lp) resx = gsi_stmt (gsi); } if (!is_gimple_resx (resx)) -return false; +return ret; gcc_assert (gsi_one_before_end_p (gsi)); /* Determine if there are non-EH edges, or resx edges into the handler. */ @@ -4172,7 +4183,7 @@ cleanup_empty_eh (eh_landing_pad lp) return true; } - return false; + return ret; succeed: if (dump_file && (dump_flags & TDF_DETAILS)) Index: cfgexpand.c === --- cfgexpand.c (revision 183524) +++ cfgexpand.c (working copy) @@ -440,12 +440,11 @@ visit_conflict (gimple stmt ATTRIBUTE_UN /* Helper routine for add_scope_conflicts, calculating the active partitions at the end of BB, leaving the result in WORK. We're called to generate - conflicts when OLD_CONFLICTS is non-null, otherwise we're just tracking - liveness. If we generate conflicts then OLD_CONFLICTS stores the bits - for which we generated conflicts already. */ + conflicts when FOR_CONFLICT is true, otherwise we're just tracking + liveness. */ static void -add_scope_conflicts_1 (basic_block bb, bitmap work, bitmap old_conflicts) +add_scope_conflicts_1 (basic_block bb, bitmap work, bool for_conflict) { edge e; edge_iterator ei; @@ -482,7 +481,7 @@ add_scope_conflicts_1 (basic_block bb, b } else if (!is_gimple_debug (stmt)) { - if (old_conflicts + if (for_conflict && visit == visit_op) { /* If this is the first real instruction in this BB we need @@ -490,27 +489,16 @@ add_scope_conflicts_1 (basic_block bb, b Unlike classical liveness for named objects we can't rely on seeing a def/use of the names we're interested in. There might merely be indirect loads/stores. We'd not add any -conflicts for such partitions. We know that we generated -conflicts between all partitions in old_conflicts already, -so we need to generate only the new ones, avoiding to -repe
[committed] Fix up a warning in make-relative-prefix.c
Hi! My recent change to make_relative_prefix_1 introduced a warning, if alloca is defined as a macro. Fixed thusly, committed to trunk and sources CVS as obvious. 2012-01-26 Jakub Jelinek * make-relative-prefix.c (make_relative_prefix_1): Avoid warning about using preprocessor directives inside of macro arguments. --- libiberty/make-relative-prefix.c.jj 2012-01-03 16:22:42.0 +0100 +++ libiberty/make-relative-prefix.c2012-01-26 15:23:40.249585617 +0100 @@ -248,14 +248,15 @@ make_relative_prefix_1 (const char *prog { char *startp, *endp, *nstore; size_t prefixlen = strlen (temp) + 1; + size_t len; if (prefixlen < 2) prefixlen = 2; - nstore = (char *) alloca (prefixlen + strlen (progname) + 1 + len = prefixlen + strlen (progname) + 1; #ifdef HAVE_HOST_EXECUTABLE_SUFFIX - + strlen (HOST_EXECUTABLE_SUFFIX) + len += strlen (HOST_EXECUTABLE_SUFFIX); #endif - ); + nstore = (char *) alloca (len); startp = endp = temp; while (1) Jakub
Re: [patch] avoid '//' prefixes when sysroot is set to '/'
On 25.01.2012 17:45, Joseph S. Myers wrote: On Wed, 25 Jan 2012, Matthias Klose wrote: This can end up in generation for dependency files, and other files parsing the output. The solution I came up with is to check for sysroot set to '/' and special case this in two places. Afaics, there are no other places. I could imagine a sysroot path that isn't just '/' but ends with '/' resulting in duplicate '/' in the middle of the path - although that's not a correctness issue in the way that '//' at the start could be, maybe the best check is actually for '/' at end of sysroot (in which case skip the '/' at the start of the path within the sysroot)? as in the attached trailing.diff? built and regression tested. Or remove such a '/' at end of sysroot at configure time rather than checking for it later that's not enough. you can pass --sysroot=/ to the driver as well. I tried that in the attached tsr.diff, but I don't like it because the driver then pases `-isysroot ""' to the cc*1 binaries, which looks a bit misleading. Matthias Index: gcc/incpath.c === --- gcc/incpath.c (revision 183555) +++ gcc/incpath.c (working copy) @@ -166,7 +166,15 @@ /* Should this directory start with the sysroot? */ if (sysroot && p->add_sysroot) - str = concat (sysroot, p->fname, NULL); + { + char *sysroot_no_trailing_dir_separator = xstrdup (sysroot); + int sysroot_len = strlen (sysroot); + + if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR) + sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0'; + str = concat (sysroot_no_trailing_dir_separator, p->fname, NULL); + free (sysroot_no_trailing_dir_separator); + } else if (!p->add_sysroot && relocated && !filename_ncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len)) { Index: gcc/gcc.c === --- gcc/gcc.c (revision 183555) +++ gcc/gcc.c (working copy) @@ -2445,9 +2445,17 @@ if (target_system_root) { + char *sysroot_no_trailing_dir_separator = xstrdup (target_system_root); + int sysroot_len = strlen (target_system_root); + + if (sysroot_len > 0 + && target_system_root[sysroot_len - 1] == DIR_SEPARATOR) + sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0'; + if (target_sysroot_suffix) prefix = concat (target_sysroot_suffix, prefix, NULL); - prefix = concat (target_system_root, prefix, NULL); + prefix = concat (sysroot_no_trailing_dir_separator, prefix, NULL); + free (sysroot_no_trailing_dir_separator); /* We have to override this because GCC's notion of sysroot moves along with GCC. */ Index: gcc/gcc.c === --- gcc/gcc.c (revision 183514) +++ gcc/gcc.c (working copy) @@ -3417,6 +3417,12 @@ case OPT__sysroot_: target_system_root = arg; + { +int target_system_root_len = strlen (target_system_root); + +if (target_system_root[target_system_root_len - 1] == DIR_SEPARATOR) + target_system_root[target_system_root_len - 1] = '\0'; + } target_system_root_changed = 1; do_save = false; break; Index: gcc/configure.ac === --- gcc/configure.ac(revision 183514) +++ gcc/configure.ac(working copy) @@ -767,7 +767,7 @@ [ case ${with_sysroot} in yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; - *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + *) TARGET_SYSTEM_ROOT=`echo $with_sysroot | sed 's,/$,,'` ;; esac TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' @@ -1830,7 +1830,7 @@ *) ;; esac -elif test "x$TARGET_SYSTEM_ROOT" != x; then +elif test "x$TARGET_SYSTEM_ROOT_DEFINE" != x; then SYSTEM_HEADER_DIR=$build_system_header_dir fi @@ -4547,7 +4547,7 @@ [Define to PREFIX/include if cpp should also search that directory.]) fi -if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then +if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT_DEFINE" != x; then if test "x$with_headers" != x; then target_header_dir=$with_headers elif test "x$with_sysroot" = x; then
Re: Fix regression on PR46590 (slow compile with -O0)
On Thu, Jan 26, 2012 at 3:23 PM, Michael Matz wrote: > Hi, > > On Tue, 24 Jan 2012, Richard Guenther wrote: > >> > + && !is_gimple_reg (t)) >> > + >> >> Ok with the excessive vertical space removed. > > Actually the patch as is was regressing some testcases (pr48794.f90, fixed > with an tree-eh change in another thread) and pack9.adb, which is fixed > with the tree-eh change below. As we emit more clobbers with my gimplify > patch we more often run into the situation that certain EH blocks aren't > really empty. The easy fix is to try making them empty before checking in > cleanup_empty_eh. > > Compared to the last version I also removed the unrelated changes in the > predicate, it was a thinko. > > This patch as is completed regstrap on x86_64-linux for all,ada,obj-c++ . > Still okay? Ok. Thanks, Richard. > > Ciao, > Michael. > > PR tree-optimization/46590 > * cfgexpand.c: Revert last change (r183305). > * gimplify.c (gimplify_bind_expr): Add clobbers for all non-gimple > regs. > * tree-eh.c (cleanup_empty_eh): Try to optimize clobbers before > checking for emptiness. > > Index: gimplify.c > === > --- gimplify.c (revision 183524) > +++ gimplify.c (working copy) > @@ -1231,7 +1231,7 @@ gimplify_bind_expr (tree *expr_p, gimple > && !DECL_HAS_VALUE_EXPR_P (t) > /* Only care for variables that have to be in memory. Others > will be rewritten into SSA names, hence moved to the top-level. > */ > - && needs_to_live_in_memory (t)) > + && !is_gimple_reg (t)) > { > tree clobber = build_constructor (TREE_TYPE (t), NULL); > TREE_THIS_VOLATILE (clobber) = 1; > Index: tree-eh.c > === > --- tree-eh.c (revision 183559) > +++ tree-eh.c (working copy) > @@ -4056,6 +4056,7 @@ cleanup_empty_eh (eh_landing_pad lp) > edge_iterator ei; > edge e, e_out; > bool has_non_eh_pred; > + bool ret = false; > int new_lp_nr; > > /* There can be zero or one edges out of BB. This is the quickest test. */ > @@ -4070,6 +4071,16 @@ cleanup_empty_eh (eh_landing_pad lp) > default: > return false; > } > + > + resx = last_stmt (bb); > + if (resx && is_gimple_resx (resx)) > + { > + if (stmt_can_throw_external (resx)) > + optimize_clobbers (bb); > + else if (sink_clobbers (bb)) > + ret = true; > + } > + > gsi = gsi_after_labels (bb); > > /* Make sure to skip debug statements. */ > @@ -4081,9 +4092,9 @@ cleanup_empty_eh (eh_landing_pad lp) > { > /* For the degenerate case of an infinite loop bail out. */ > if (infinite_empty_loop_p (e_out)) > - return false; > + return ret; > > - return cleanup_empty_eh_unsplit (bb, e_out, lp); > + return ret | cleanup_empty_eh_unsplit (bb, e_out, lp); > } > > /* The block should consist only of a single RESX statement, modulo a > @@ -4096,7 +4107,7 @@ cleanup_empty_eh (eh_landing_pad lp) > resx = gsi_stmt (gsi); > } > if (!is_gimple_resx (resx)) > - return false; > + return ret; > gcc_assert (gsi_one_before_end_p (gsi)); > > /* Determine if there are non-EH edges, or resx edges into the handler. */ > @@ -4172,7 +4183,7 @@ cleanup_empty_eh (eh_landing_pad lp) > return true; > } > > - return false; > + return ret; > > succeed: > if (dump_file && (dump_flags & TDF_DETAILS)) > Index: cfgexpand.c > === > --- cfgexpand.c (revision 183524) > +++ cfgexpand.c (working copy) > @@ -440,12 +440,11 @@ visit_conflict (gimple stmt ATTRIBUTE_UN > > /* Helper routine for add_scope_conflicts, calculating the active partitions > at the end of BB, leaving the result in WORK. We're called to generate > - conflicts when OLD_CONFLICTS is non-null, otherwise we're just tracking > - liveness. If we generate conflicts then OLD_CONFLICTS stores the bits > - for which we generated conflicts already. */ > + conflicts when FOR_CONFLICT is true, otherwise we're just tracking > + liveness. */ > > static void > -add_scope_conflicts_1 (basic_block bb, bitmap work, bitmap old_conflicts) > +add_scope_conflicts_1 (basic_block bb, bitmap work, bool for_conflict) > { > edge e; > edge_iterator ei; > @@ -482,7 +481,7 @@ add_scope_conflicts_1 (basic_block bb, b > } > else if (!is_gimple_debug (stmt)) > { > - if (old_conflicts > + if (for_conflict > && visit == visit_op) > { > /* If this is the first real instruction in this BB we need > @@ -490,27 +489,16 @@ add_scope_conflicts_1 (basic_block bb, b > Unlike classical liveness for named objects we can't > rely on seeing a def/use of the names we're interested in. > There might merely be indirect loads/
Re: [PATCH] Fix -free ICE on powerpc64 (PR tree-optimization/51987)
> 2012-01-25 Jakub Jelinek > > PR rtl-optimization/51978 > * ree.c (make_defs_and_copies_lists): Change set_pat type > to const_rtx. > (combine_reaching_defs): Likewise. > (struct re_info): Remove. > (add_removable_extension): Remove x and data arguments, > add insn, insn_list and def_map. Use the arguments directly > instead of using struct re_info. > (find_removable_extensions): Don't call add_removable_extension > through note_stores, instead just call it with single_set > result if non-NULL. > (find_and_remove_re): Pass curr_cand->expr instead of > PATTERN (curr_cand->insn) as set_pat argument to > combine_reaching_defs. OK, thanks. -- Eric Botcazou
[pph] Fix #include table handling (issue5578045)
This patch fixes a bug in the handling of #include files in PPH files. The bug is a bit convoluted, so an example is easier. Given the files foo.h #include "1.h" #include "2.h" #include "3.h" 1.h #include "2.h" Assume that all the files are properly double-guarded, and that we are generating PPH images for all the headers. The contents of 2.h and 3.h are not important. When we are generating foo.pph, we read 1.pph, which adds 1.pph and 2.pph to the #include table of foo.pph. When we finish reading 1.pph, the include handler is presented with #include "2.h", which it resolves to 2.pph, which it then reads and adds to the #include table *again*. So, when we generated foo.pph, we had 2.pph in the #include table twice. This means that 3.pph ends up in the 4th slot of the #include table. All the external references to 3.pph are written to address into that slot. However, when we are reading foo.pph, the include hanlder is not active for the files it includes, so 2.pph is only added once to the table. Meaning that external references going to 3.pph are looked up from the wrong slot in the #include table. All this, because we were allowing duplicate entries in the #include table. So, this patch reworks the #include table to only allow a single entry. In generating the test case, I found a second bug. When we have function bodies inside a header file, we were adding call graph nodes for the functions, but we were not resetting the DECL_EXTERNAL field for the FUNCTION_DECL. These functions were being dropped by IPA later on (in function_and_variable_visibility). 2012-01-26 Diego Novillo cp/ChangeLog.pph * pph-core.c (pph_include_handler): Call pph_writer_get_stream. (pph_add_include): Move to pph-in.c (pph_stream_open): Initialize STREAM->INCLUDES.M. (pph_stream_close_1): Free STREAM->INCLUDES.M. * pph-in.c (pph_in_symtab): For functions we are going to expand, set DECL_EXTERNAL to false. (pph_add_include_1): New. (pph_add_include): Move from pph-core.c. Call pph_add_include_1. (pph_read_file): Add argument PARENT. Update all callers. If PARENT is given, add STREAM to PARENT's #include table. * pph-out.c (pph_writer_get_stream): New. * pph-streamer.h (struct pph_stream): Change field INCLUDES to be a structure with two fields V and M. Update all users. (pph_add_include): Remove. (pph_writer_add_include): Remove. (pph_read_file): Add second argument. testsuite/ChangeLog.pph * x0multiple-include.h: New. * x1multiple-include.h: New. * x2multiple-include.h: New. * x3multiple-include.h: New. * x4multiple-include.cc: New. diff --gitc/cp/pph-core.c index 78b6 --- a/gcc/cp/pph-core.c +++ b/gcc/cp/pph-core.c @@ -561,7 +561,7 @@ pph_cache_lookup_in_includes (pph_stream *stream, void *data, in the cache, so instead of ICEing, we ignore the match to force the caller to pickle DATA. */ e = NULL; - FOR_EACH_VEC_ELT (pph_stream_ptr, stream->includes, include_ix, include) + FOR_EACH_VEC_ELT (pph_stream_ptr, stream->includes.v, include_ix, include) { e = pph_cache_lookup (&include->cache, data, &ix, PPH_null); if (e) @@ -723,18 +723,13 @@ pph_include_handler (cpp_reader *reader, && pph_is_valid_here (name, loc) && !cpp_included_before (reader, name, input_location)) { - pph_stream *include = pph_read_file (pph_file); + /* The stream we are currently generating is private to +the writer. As an exception, allow access from the +include handler. */ + pph_stream *pph_writer_get_stream (void); + pph_stream *include = pph_read_file (pph_file, pph_writer_get_stream ()); if (include) - { - /* If we are generating a new PPH image, add the stream we -just read to the list of includes. This way, the parser -will be able to resolve references to symbols in INCLUDE -and its children. */ - if (pph_writer_enabled_p ()) - pph_writer_add_include (include); - - read_text_file_p = false; - } + read_text_file_p = false; else warning_at (loc, OPT_Wmissing_pph, "cannot open PPH file %s for reading: %m\n" @@ -890,7 +885,7 @@ pph_dump_includes (FILE *file, pph_stream *stream, unsigned indent) if (file == NULL) file = stderr; - FOR_EACH_VEC_ELT (pph_stream_ptr, stream->includes, i, include) + FOR_EACH_VEC_ELT (pph_stream_ptr, stream->includes.v, i, include) { for (j = 0; j < indent; j++) fputc (' ', file); @@ -900,22 +895,6 @@ pph_dump_includes (FILE *file, pph_stream *stream, unsigned indent) } -/* Add INCLUDE, and the images included by it, to the list of files - included by STREAM. */ - -void -pph_add_include (pph_stream *stream, pph_stream *include) -{ - pph_stream *include_child; - unsigned
Re: [Committed] S/390: Fix some testsuite fails
On 01/26/2012 01:27 PM, Jakub Jelinek wrote: > On Thu, Jan 26, 2012 at 11:05:21AM +0100, Andreas Krebbel wrote: >> *** gcc/testsuite/gfortran.dg/reassoc_4.f.orig >> --- gcc/testsuite/gfortran.dg/reassoc_4.f >> *** >> *** 1,6 >> --- 1,7 >> ! { dg-do compile } >> ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" } >> ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param >> max-completely-peel-times=16" { target spu-*-* } } >> + ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param >> max-completely-peeled-insns=400" { target s390*-*-* } } > > Better would be to use dg-additional-options here (both for s390 and spu). Ok. Fixed. -Andreas-
[PATCH][Cilkplus] Sec Implicit Index Builtin function Implementation
Hello Everyone, This patch is for the Cilkplus branch affecting both C and C++ compiler. It implements the builtin function called "__sec_implicit_index" that is part of the Array Notations in Cilkplus. Thanking You, Yours Sincerely, Balaji V. Iyer.diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index 8e4fab9..98e0528 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,14 @@ +2012-01-26 Balaji V. Iyer + + * array-notation-common.c (array_notation_init_builtins): Added the + internal array notation function "__sec_reduce_implicit_index." + (is_sec_implicit_index_fn): New function. + (extract_sec_implicit_index_arg): Likewise. + * c-array-notation.c (extract_array_notation_exprs): Added a check to + see if we encountered sec_implicit_index function. + (replace_array_notations): Likewise. + (build_array_notation_expr): Likewise. + 2012-01-25 Balaji V. Iyer * c-array-notation.c (replace_array_notations): Added a new bool as diff --git a/gcc/array-notation-common.c b/gcc/array-notation-common.c index 059adc4..b06f495 100644 --- a/gcc/array-notation-common.c +++ b/gcc/array-notation-common.c @@ -38,6 +38,10 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "dwarf2out.h" +int extract_sec_implicit_index_arg (tree); +bool is_sec_implicit_index_fn (tree); +void array_notation_init_builtins (void); + static void mark_cold (tree fndecl) { @@ -97,5 +101,62 @@ array_notation_init_builtins (void) new_func = build_fn_decl ("__sec_reduce_max_ind", func_type); mark_cold (new_func); new_func = lang_hooks.decls.pushdecl (new_func); + + func_type = build_function_type_list (integer_type_node, integer_type_node, + NULL_TREE); + new_func = build_fn_decl ("__sec_implicit_index", func_type); + mark_cold (new_func); + new_func = lang_hooks.decls.pushdecl (new_func); + return; } + +bool +is_sec_implicit_index_fn (tree func_name) +{ + const char *function_name = NULL; + + if (!func_name) +return false; + + if (TREE_CODE (func_name) == IDENTIFIER_NODE) +function_name = IDENTIFIER_POINTER (func_name); + else if (TREE_CODE (func_name) == ADDR_EXPR) +{ + func_name = TREE_OPERAND (func_name, 0); + if (TREE_CODE (func_name) == FUNCTION_DECL) + if (DECL_NAME (func_name)) + function_name = IDENTIFIER_POINTER (DECL_NAME (func_name)); +} + + if (!function_name) +return false; + else if (!strcmp (function_name, "__sec_implicit_index")) +return true; + else +return false; +} + +int +extract_sec_implicit_index_arg (tree fn) +{ + tree fn_arg; + HOST_WIDE_INT return_int = 0; + if (!fn) +return -1; + + if (TREE_CODE (fn) == CALL_EXPR) +{ + fn_arg = CALL_EXPR_ARG (fn, 0); + if (really_constant_p (fn_arg)) + return_int = (int)int_cst_value (fn_arg); + else + { + error ("__sec_implicit_index parameter must be constant integer " +"expression"); + error ("Bailing out due to previous error"); + exit (ICE_EXIT_CODE); + } +} + return return_int; +} diff --git a/gcc/c-array-notation.c b/gcc/c-array-notation.c index 1dac533..3ff52dc 100644 --- a/gcc/c-array-notation.c +++ b/gcc/c-array-notation.c @@ -47,7 +47,8 @@ struct c_expr fix_array_notation_expr (location_t, enum tree_code, static bool is_builtin_array_notation_fn (tree func_name, an_reduce_type *type); static tree fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var); bool contains_array_notation_expr (tree expr); - +extern bool is_sec_implicit_index_fn (tree); +extern int extract_sec_implicit_index_arg (tree fn); /* This function is to find the rank of an array notation expression. * For example, an array notation of A[:][:] has a rank of 2. */ @@ -159,6 +160,18 @@ extract_array_notation_exprs (tree node, bool ignore_builtin_fn, return; } } + if (is_sec_implicit_index_fn (CALL_EXPR_FN (node))) + { + ii = *list_size; + new_array_list = (tree *) xrealloc (*array_list, (ii + 1) * + sizeof (tree)); + gcc_assert (new_array_list); + new_array_list[ii] = node; + ii++; + *list_size = ii; + *array_list = new_array_list; + return; + } if (TREE_CODE (TREE_OPERAND (node, 0)) == INTEGER_CST) { int length = TREE_INT_CST_LOW (TREE_OPERAND (node, 0)); @@ -223,6 +236,15 @@ replace_array_notations (tree *orig, bool ignore_builtin_fn, tree *list, } return; } + if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig))) + { + for (ii = 0; ii < array_size; ii++) + { + if (*orig == list[ii]) + *orig = array_operand[ii]; + } + return; + } if (TREE_CODE (TREE_OPERAND (*orig, 0)
[PATCH][Cilkplus] Sec Implicit Index Builtin function Implementation
Hello Everyone, This patch is for the Cilkplus branch affecting both C and C++ compiler. It implements the builtin function called "__sec_implicit_index" that is part of the Array Notations in Cilkplus. Thanking You, Yours Sincerely, Balaji V. Iyer. diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index 8e4fab9..98e0528 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,14 @@ +2012-01-26 Balaji V. Iyer + + * array-notation-common.c (array_notation_init_builtins): Added the + internal array notation function "__sec_reduce_implicit_index." + (is_sec_implicit_index_fn): New function. + (extract_sec_implicit_index_arg): Likewise. + * c-array-notation.c (extract_array_notation_exprs): Added a check to + see if we encountered sec_implicit_index function. + (replace_array_notations): Likewise. + (build_array_notation_expr): Likewise. + 2012-01-25 Balaji V. Iyer * c-array-notation.c (replace_array_notations): Added a new bool as diff --git a/gcc/array-notation-common.c b/gcc/array-notation-common.c index 059adc4..b06f495 100644 --- a/gcc/array-notation-common.c +++ b/gcc/array-notation-common.c @@ -38,6 +38,10 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "dwarf2out.h" +int extract_sec_implicit_index_arg (tree); +bool is_sec_implicit_index_fn (tree); +void array_notation_init_builtins (void); + static void mark_cold (tree fndecl) { @@ -97,5 +101,62 @@ array_notation_init_builtins (void) new_func = build_fn_decl ("__sec_reduce_max_ind", func_type); mark_cold (new_func); new_func = lang_hooks.decls.pushdecl (new_func); + + func_type = build_function_type_list (integer_type_node, integer_type_node, + NULL_TREE); + new_func = build_fn_decl ("__sec_implicit_index", func_type); + mark_cold (new_func); + new_func = lang_hooks.decls.pushdecl (new_func); + return; } + +bool +is_sec_implicit_index_fn (tree func_name) +{ + const char *function_name = NULL; + + if (!func_name) +return false; + + if (TREE_CODE (func_name) == IDENTIFIER_NODE) +function_name = IDENTIFIER_POINTER (func_name); + else if (TREE_CODE (func_name) == ADDR_EXPR) +{ + func_name = TREE_OPERAND (func_name, 0); + if (TREE_CODE (func_name) == FUNCTION_DECL) + if (DECL_NAME (func_name)) + function_name = IDENTIFIER_POINTER (DECL_NAME (func_name)); +} + + if (!function_name) +return false; + else if (!strcmp (function_name, "__sec_implicit_index")) +return true; + else +return false; +} + +int +extract_sec_implicit_index_arg (tree fn) +{ + tree fn_arg; + HOST_WIDE_INT return_int = 0; + if (!fn) +return -1; + + if (TREE_CODE (fn) == CALL_EXPR) +{ + fn_arg = CALL_EXPR_ARG (fn, 0); + if (really_constant_p (fn_arg)) + return_int = (int)int_cst_value (fn_arg); + else + { + error ("__sec_implicit_index parameter must be constant integer " +"expression"); + error ("Bailing out due to previous error"); + exit (ICE_EXIT_CODE); + } +} + return return_int; +} diff --git a/gcc/c-array-notation.c b/gcc/c-array-notation.c index 1dac533..3ff52dc 100644 --- a/gcc/c-array-notation.c +++ b/gcc/c-array-notation.c @@ -47,7 +47,8 @@ struct c_expr fix_array_notation_expr (location_t, enum tree_code, static bool is_builtin_array_notation_fn (tree func_name, an_reduce_type *type); static tree fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var); bool contains_array_notation_expr (tree expr); - +extern bool is_sec_implicit_index_fn (tree); +extern int extract_sec_implicit_index_arg (tree fn); /* This function is to find the rank of an array notation expression. * For example, an array notation of A[:][:] has a rank of 2. */ @@ -159,6 +160,18 @@ extract_array_notation_exprs (tree node, bool ignore_builtin_fn, return; } } + if (is_sec_implicit_index_fn (CALL_EXPR_FN (node))) + { + ii = *list_size; + new_array_list = (tree *) xrealloc (*array_list, (ii + 1) * + sizeof (tree)); + gcc_assert (new_array_list); + new_array_list[ii] = node; + ii++; + *list_size = ii; + *array_list = new_array_list; + return; + } if (TREE_CODE (TREE_OPERAND (node, 0)) == INTEGER_CST) { int length = TREE_INT_CST_LOW (TREE_OPERAND (node, 0)); @@ -223,6 +236,15 @@ replace_array_notations (tree *orig, bool ignore_builtin_fn, tree *list, } return; } + if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig))) + { + for (ii = 0; ii < array_size; ii++) + { + if (*orig == list[ii]) + *orig = array_operand[ii]; + } + return; + } if (TREE_CODE (TREE_OPERAND (*orig, 0
Re: [patch] avoid '//' prefixes when sysroot is set to '/'
On Thu, 26 Jan 2012, Matthias Klose wrote: > On 25.01.2012 17:45, Joseph S. Myers wrote: > > On Wed, 25 Jan 2012, Matthias Klose wrote: > > > > > This can end up in generation for dependency files, and other files > > > parsing > > > the output. The solution I came up with is to check for sysroot set to '/' > > > and > > > special case this in two places. Afaics, there are no other places. > > > > I could imagine a sysroot path that isn't just '/' but ends with '/' > > resulting in duplicate '/' in the middle of the path - although that's not > > a correctness issue in the way that '//' at the start could be, maybe the > > best check is actually for '/' at end of sysroot (in which case skip the > > '/' at the start of the path within the sysroot)? > > as in the attached trailing.diff? built and regression tested. Yes, that's OK (with copyright date updates in incpath.c). -- Joseph S. Myers jos...@codesourcery.com
Re: [patch] Add new DW_AT and DW_FORM codes for Fission
> If the DW_FORM_ values are meant to be in a vendor range of forms > (which DWARF4 unfortunately doesn't have), aren't they too low, i.e. isn't > there risk that eventually they'll clash with standard forms? > The forms numbers aren't limited to 0 .. 0x7f, at the expense of a slightly > bigger abbrev table you could as well use something very high, like 0x380+. > And, if you want to standardize it, I'd assume the codes would be lower > on the other side (there are still even free codes from 0x1a through to > 0x1f). FORM codes aren't added very often because they do break compatibility, so I wouldn't expect values in the 0x70-7f range to collide with any future standard FORM codes. I did want to keep them in the single-byte LEB128 range, although as you point out, it wouldn't cost all that much to make them even larger. We can move them to a higher range if you prefer. I do intend to standardize these once we start working on DWARF-5, but I felt it was a good idea to try them out experimentally before reserving any standard values. -cary
Re: libgo patch committed: Update to weekly.2011-12-22
Rainer Orth writes: > Ian Lance Taylor writes: > >>> This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5): >>> >>> /vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: >>> reference to undefined identifier 'syscall.EPOLL_CLOEXEC' >> >> Thanks. Fixed like so. Bootstrapped on x86_64-unknown-linux-gnu. >> Committed to mainline. > > Thanks. Unfortunately, this is not enough: while the build finishes > now, all tests fail with > > /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./libgo/.libs/libgo.so: > undefined reference to `epoll_create1' > collect2: error: ld returned 1 exit status Fixed with the appended patch, which also gathers up all the possibly missing functions that I noticed. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu, which proves little as the system I tested on has all these functions anyhow. Committed to mainline. Thanks for the bug report. Ian diff -r 9013911dbab2 libgo/Makefile.am --- a/libgo/Makefile.am Wed Jan 25 21:42:35 2012 -0800 +++ b/libgo/Makefile.am Thu Jan 26 12:15:48 2012 -0800 @@ -449,6 +449,7 @@ runtime/go-now.c \ runtime/go-new-map.c \ runtime/go-new.c \ + runtime/go-nosys.c \ runtime/go-panic.c \ runtime/go-print.c \ runtime/go-recover.c \ diff -r 9013911dbab2 libgo/configure.ac --- a/libgo/configure.ac Wed Jan 25 21:42:35 2012 -0800 +++ b/libgo/configure.ac Thu Jan 26 12:15:48 2012 -0800 @@ -33,6 +33,8 @@ AM_MAINTAINER_MODE +AC_INCLUDES_DEFAULT + AC_PROG_LD AC_PROG_RANLIB AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy) @@ -465,6 +467,9 @@ AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes) AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes) +AC_CHECK_FUNCS(epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare) +AC_CHECK_TYPES([loff_t]) + CFLAGS_hold="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS_hold="$LIBS" @@ -519,7 +524,7 @@ CFLAGS_hold=$CFLAGS CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" -AC_CHECK_TYPES(off64_t) +AC_CHECK_TYPES([off64_t]) CFLAGS=$CFLAGS_hold dnl Work out the size of the epoll_events struct on GNU/Linux. diff -r 9013911dbab2 libgo/runtime/go-nosys.c --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/libgo/runtime/go-nosys.c Thu Jan 26 12:15:48 2012 -0800 @@ -0,0 +1,192 @@ +/* go-nosys.c -- functions missing from system. + + Copyright 2012 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. */ + +/* This file exists to provide definitions for functions that are + missing from libc, according to the configure script. This permits + the Go syscall package to not worry about whether the functions + exist or not. */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifndef HAVE_OFF64_T +typedef signed int off64_t __attribute__ ((mode (DI))); +#endif + +#ifndef HAVE_LOFF_T +typedef off64_t loff_t; +#endif + +#ifndef HAVE_EPOLL_CREATE1 +int +epoll_create1 (int flags __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_FACCESSAT +int +faccessat (int fd __attribute__ ((unused)), + const char *pathname __attribute__ ((unused)), + int mode __attribute__ ((unused)), + int flags __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_FCHMODAT +int +fchmodat (int dirfd __attribute__ ((unused)), + const char *pathname __attribute__ ((unused)), + mode_t mode __attribute__ ((unused)), + int flags __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_FCHOWNAT +int +fchownat (int dirfd __attribute__ ((unused)), + const char *pathname __attribute__ ((unused)), + uid_t owner __attribute__ ((unused)), + gid_t group __attribute__ ((unused)), + int flags __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_FUTIMESAT +int +futimesat (int dirfd __attribute__ ((unused)), + const char *pathname __attribute__ ((unused)), + const struct timeval times[2] __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_INOTIFY_ADD_WATCH +int +inotify_add_watch (int fd __attribute__ ((unused)), + const char* pathname __attribute__ ((unused)), + uint32_t mask __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_INOTIFY_INIT +int +inotify_init (void) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_INOTIFY_RM_WATCH +int +inotify_rm_watch (int fd __attribute__ ((unused)), + uint32_t wd __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_MKDIRAT +int +mkdirat (int dirfd __attribute__ ((unused)), + const char *pathname __attribute__ ((unused)), + mode_t mode __attribute__ ((unused))) +{ + return ENOSYS; +} +#endif + +#ifndef HAVE_MKNODAT +int +mknodat (int dirfd __attribute__ ((unused)), + const char *pat
[Patch, Fortran] PR51970/51977 MOVE_ALLOC fixes
This patch fixes expressions involving polymorphic arrays and, thus, MOVE_ALLOC. I have also two minor fixes (cf. trans-decl.c). Build and regtested on x86-64-linux. OK for the trunk? Tobias 2012-01-26 Tobias Burnus PR fortran/51970 PR fortran/51977 * primary.c (gfc_match_varspec. gfc_match_rvalue): Set handle array spec for BT_CLASS. * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym) * frontend-passes.c (create_var): Ditto. * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto. * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer instead of attr.pointer. (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS. * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert. * trans-stmt.c (trans_associate_var): Ask for the descriptor. 2012-01-26 Tobias Burnus PR fortran/51970 PR fortran/51977 * gfortran.dg/move_alloc_13.f90: New. Index: gcc/fortran/primary.c === --- gcc/fortran/primary.c (Revision 183575) +++ gcc/fortran/primary.c (Arbeitskopie) @@ -1868,18 +1868,24 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl && (CLASS_DATA (sym)->attr.dimension || CLASS_DATA (sym)->attr.codimension))) { + gfc_array_spec *as; + + tail = extend_ref (primary, tail); + tail->type = REF_ARRAY; + /* In EQUIVALENCE, we don't know yet whether we are seeing an array, character variable or array of character variables. We'll leave the decision till resolve time. */ - tail = extend_ref (primary, tail); - tail->type = REF_ARRAY; - m = gfc_match_array_ref (&tail->u.ar, equiv_flag ? NULL : sym->as, - equiv_flag, - sym->ts.type == BT_CLASS && CLASS_DATA (sym) - ? (CLASS_DATA (sym)->as - ? CLASS_DATA (sym)->as->corank : 0) - : (sym->as ? sym->as->corank : 0)); + if (equiv_flag) + as = NULL; + else if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)) + as = CLASS_DATA (sym)->as; + else + as = sym->as; + + m = gfc_match_array_ref (&tail->u.ar, as, equiv_flag, + as ? as->corank : 0); if (m != MATCH_YES) return m; @@ -2893,7 +2899,10 @@ gfc_match_rvalue (gfc_expr **result) e->value.function.actual = actual_arglist; e->where = gfc_current_locus; - if (sym->as != NULL) + if (sym->ts.type == BT_CLASS && sym->attr.class_ok + && CLASS_DATA (sym)->as) + e->rank = CLASS_DATA (sym)->as->rank; + else if (sym->as != NULL) e->rank = sym->as->rank; if (!sym->attr.function Index: gcc/fortran/trans-stmt.c === --- gcc/fortran/trans-stmt.c (Revision 183575) +++ gcc/fortran/trans-stmt.c (Arbeitskopie) @@ -1175,6 +1175,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_ gfc_se se; gfc_init_se (&se, NULL); + se.descriptor_only = 1; gfc_conv_expr (&se, e); gcc_assert (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (se.expr))); Index: gcc/fortran/expr.c === --- gcc/fortran/expr.c (Revision 183575) +++ gcc/fortran/expr.c (Arbeitskopie) @@ -3805,9 +3805,12 @@ gfc_get_variable_expr (gfc_symtree *var) e->symtree = var; e->ts = var->n.sym->ts; - if (var->n.sym->as != NULL) + if ((var->n.sym->as != NULL && var->n.sym->ts.type != BT_CLASS) + || (var->n.sym->ts.type == BT_CLASS && CLASS_DATA (var->n.sym) + && CLASS_DATA (var->n.sym)->as)) { - e->rank = var->n.sym->as->rank; + e->rank = var->n.sym->ts.type == BT_CLASS + ? CLASS_DATA (var->n.sym)->as->rank : var->n.sym->as->rank; e->ref = gfc_get_ref (); e->ref->type = REF_ARRAY; e->ref->u.ar.type = AR_FULL; @@ -3836,7 +3839,8 @@ gfc_lval_expr_from_sym (gfc_symbol *sym) lval->ref->u.ar.type = AR_FULL; lval->ref->u.ar.dimen = lval->rank; lval->ref->u.ar.where = sym->declared_at; - lval->ref->u.ar.as = sym->as; + lval->ref->u.ar.as = sym->ts.type == BT_CLASS + ? CLASS_DATA (sym)->as : sym->as; } return lval; Index: gcc/fortran/frontend-passes.c === --- gcc/fortran/frontend-passes.c (Revision 183575) +++ gcc/fortran/frontend-passes.c (Arbeitskopie) @@ -328,7 +328,8 @@ create_var (gfc_expr * e) result->ref->type = REF_ARRAY; result->ref->u.ar.type = AR_FULL; result->ref->u.ar.where = e->where; - result->ref->u.ar.as = symbol->as; + result->ref->u.ar.as = symbol->ts.type == BT_CLASS + ? CLASS_DATA (symbol)->as : symbol->as; if (gfc_option.warn_array_temp) gfc_warning ("Creating array temporary at %L", &(e->where)); } Index: gcc/fortran/resolve.c === --- gcc/fortran/resolve.c (Revision 183575) +++ gcc/fortran/resolve.c (Arbeitskopie) @@ -1740,13 +1740,17 @@ resolve_actual_arglist (gfc_actu
[pph] Disable PPH generation if there are errors (issue5580043)
A small fixlet to deal with files that have errors in them. When we are about to generate PPH output, we check if there have been errors emitted for the file. If so, we disable PPH generation. Testing this, I found that we were not clearing pph_out_stream when disabling PPH. Fixed. 2012-01-26 Diego Novillo * pph-core.c (pph_stream_close_1): Add a newline to fprintf call. (pph_finish): If there were errors during compilation, disable PPH generation. * pph-out.c (pph_disable_output): Also set pph_out_stream to NULL. diff --git a/gcc/cp/pph-core.c b/gcc/cp/pph-core.c index a9a8bc2..3f958de 100644 --- a/gcc/cp/pph-core.c +++ b/gcc/cp/pph-core.c @@ -1190,7 +1190,7 @@ pph_stream_close_1 (pph_stream *stream, bool flush_p) if (stream->write_p && !flush_p) { if (flag_pph_tracer >= 1) - fprintf (pph_logfile, "PPH: Removing %s", stream->name); + fprintf (pph_logfile, "PPH: Removing %s\n", stream->name); unlink (stream->name); } @@ -1423,6 +1423,10 @@ pph_streamer_finish (void) void pph_finish (void) { + /* If we found errors during compilation, disable PPH generation. */ + if (errorcount || sorrycount) +pph_disable_output (); + /* Finalize the streamer. */ pph_streamer_finish (); diff --git a/gcc/cp/pph-out.c b/gcc/cp/pph-out.c index f7839d2..69530aa 100644 --- a/gcc/cp/pph-out.c +++ b/gcc/cp/pph-out.c @@ -2847,6 +2847,7 @@ pph_disable_output (void) pph_stream_close_no_flush (pph_out_stream); pph_out_file = NULL; + pph_out_stream = NULL; } #include "gt-cp-pph-out.h" -- This patch is available for review at http://codereview.appspot.com/5580043
[PATCH] Don't add useless reverse_op vta equivalences (PR debug/52001)
Hi! When a VALUE contains already some constant location, it will be always preferable to expressing it by some other expression - const (or some similar reverse operation), so we just should point at adding the reverse_op. This fixes the testcase from the PR on mips64-linux, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2012-01-26 Jakub Jelinek PR debug/52001 * var-tracking.c (reverse_op): Don't add any reverse operation if V already has any constant locations. --- gcc/var-tracking.c.jj 2012-01-23 18:23:45.0 +0100 +++ gcc/var-tracking.c 2012-01-26 16:37:20.110049563 +0100 @@ -5298,6 +5298,7 @@ reverse_op (rtx val, const_rtx expr, rtx { rtx src, arg, ret; cselib_val *v; + struct elt_loc_list *l; enum rtx_code code; if (GET_CODE (expr) != SET) @@ -5333,6 +5334,14 @@ reverse_op (rtx val, const_rtx expr, rtx if (!v || !cselib_preserved_value_p (v)) return; + /* Adding a reverse op isn't useful if V already has an always valid + location. Ignore ENTRY_VALUE, while it is always constant, we should + prefer non-ENTRY_VALUE locations whenever possible. */ + for (l = v->locs; l; l = l->next) +if (CONSTANT_P (l->loc) + && (GET_CODE (l->loc) != CONST || !references_value_p (l->loc, 0))) + return; + switch (GET_CODE (src)) { case NOT: Jakub
Go patch committed: Don't generate fns for private fields of structs
When generating hash and equality functions for types, it's not necessary to generate them for private fields of named structs defined in different packages. There is no way that the code can call those functions directly anyhow. Generating them is problematic because it may lead to calls to functions which are not visible from the current package. This patch implements this fix. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 7d54213ce42e go/gogo.cc --- a/go/gogo.cc Thu Jan 26 12:23:11 2012 -0800 +++ b/go/gogo.cc Thu Jan 26 13:02:49 2012 -0800 @@ -1205,13 +1205,13 @@ { case Type::TYPE_NAMED: { + Named_type* nt = t->named_type(); if (!t->compare_is_identity(this->gogo_) && t->is_comparable()) - t->type_functions(this->gogo_, t->named_type(), NULL, NULL, &hash_fn, - &equal_fn); + t->type_functions(this->gogo_, nt, NULL, NULL, &hash_fn, &equal_fn); // If this is a struct type, we don't want to make functions // for the unnamed struct. - Type* rt = t->named_type()->real_type(); + Type* rt = nt->real_type(); if (rt->struct_type() == NULL) { if (Type::traverse(rt, this) == TRAVERSE_EXIT) @@ -1219,8 +1219,20 @@ } else { - if (rt->struct_type()->traverse_field_types(this) == TRAVERSE_EXIT) - return TRAVERSE_EXIT; + // If this type is defined in another package, then we don't + // need to worry about the unexported fields. + bool is_defined_elsewhere = nt->named_object()->package() != NULL; + const Struct_field_list* fields = rt->struct_type()->fields(); + for (Struct_field_list::const_iterator p = fields->begin(); + p != fields->end(); + ++p) + { + if (is_defined_elsewhere + && Gogo::is_hidden_name(p->field_name())) + continue; + if (Type::traverse(p->type(), this) == TRAVERSE_EXIT) + return TRAVERSE_EXIT; + } } return TRAVERSE_SKIP_COMPONENTS;
Re: [patch] Add new DW_AT and DW_FORM codes for Fission
On Thu, Jan 26, 2012 at 11:18:24AM -0800, Cary Coutant wrote: > FORM codes aren't added very often because they do break > compatibility, so I wouldn't expect values in the 0x70-7f range to > collide with any future standard FORM codes. I did want to keep them > in the single-byte LEB128 range, although as you point out, it > wouldn't cost all that much to make them even larger. We can move them > to a higher range if you prefer. > > I do intend to standardize these once we start working on DWARF-5, but > I felt it was a good idea to try them out experimentally before > reserving any standard values. Especially in this case where it is primarily for experimenting with it I think using higher values would be better, though perhaps still some that fit into two byte ULEB128. Jakub
Re: [PATCH] PR c++/50852 - loose template parameter comparison
Hmm...what if rather than trying to ignore levels when comparing, we make it so the sibling list always has level 1? BTW, let's avoid calling a function named *_real directly from client code. Jason
Re: [PATCH] PR c++/51641 - Lookup finds enclosing class member instead of template parameter
Comparing by same_type_p means that we treat any template parameter of the appropriate level and index as equivalent. But that should be OK, since we only have one set of level N template parameters in scope. So I think we should be able to just compare the level of the template parameter to the level of the parameters of the template. Right? Jason
Re: [PATCH] PR c++/50852 - loose template parameter comparison
Jason Merrill writes: > Hmm...what if rather than trying to ignore levels when comparing, we > make it so the sibling list always has level 1? I am not sure to understand how you'd do that. You mean that instead of pointing to the actual vector of innermost template parms, TEMPLATE_PARM_SIBLINGS would instead point to a vector that is a copy of the innermost template parms into which we'd have substituted and index of level 1 for the index of each parm? > BTW, let's avoid calling a function named *_real directly from client > code. Ah, oops sorry. I thought it would be OK as cp-tree.h already has a few spots of public entry points "overloaded" using that _real suffix. What suffix would be best? -- Dodji
Re: [patch] Add new DW_AT and DW_FORM codes for Fission
On Thu, Jan 26, 2012 at 02:04:59PM -0800, Cary Coutant wrote: > 2012-01-26 Cary Coutant > > * include/dwarf2.h (enum dwarf_form): Add Fission extensions. > (enum dwarf_attribute): Likewise. This is ok. > commit 0097fed73afa307f5cfc5de9cae0d3041f66193f > Author: Cary Coutant > Date: Sat Nov 5 01:17:06 2011 -0700 > > Add new DW_AT and DW_FORM codes for Fission. > > diff --git a/include/dwarf2.h b/include/dwarf2.h > index 37cb83f..8c0c9ed 100644 > --- a/include/dwarf2.h > +++ b/include/dwarf2.h > @@ -188,7 +188,11 @@ enum dwarf_form > DW_FORM_sec_offset = 0x17, > DW_FORM_exprloc = 0x18, > DW_FORM_flag_present = 0x19, > -DW_FORM_ref_sig8 = 0x20 > +DW_FORM_ref_sig8 = 0x20, > +/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ > +DW_FORM_GNU_ref_index = 0x1f00, > +DW_FORM_GNU_addr_index = 0x1f01, > +DW_FORM_GNU_str_index = 0x1f02 >}; > > /* Attribute names and codes. */ > @@ -368,6 +372,13 @@ enum dwarf_attribute > DW_AT_GNU_all_source_call_sites = 0x2118, > /* Section offset into .debug_macro section. */ > DW_AT_GNU_macros = 0x2119, > +/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ > +DW_AT_GNU_dwo_name = 0x2130, > +DW_AT_GNU_dwo_id = 0x2131, > +DW_AT_GNU_ref_base = 0x2132, > +DW_AT_GNU_addr_base = 0x2133, > +DW_AT_GNU_pubnames = 0x2134, > +DW_AT_GNU_pubtypes = 0x2135, > /* VMS extensions. */ > DW_AT_VMS_rtnbeg_pd_address = 0x2201, > /* GNAT extensions. */ Jakub
Re: [patch] Add new DW_AT and DW_FORM codes for Fission
>> 2012-01-26 Cary Coutant >> >> * include/dwarf2.h (enum dwarf_form): Add Fission extensions. >> (enum dwarf_attribute): Likewise. > > This is ok. Thanks. I don't remember what the procedure is, though -- do I check it in to both gcc and binutils trees, or just one and let it sync to the other? -cary
Re: [patch] Add new DW_AT and DW_FORM codes for Fission
On Thu, Jan 26, 2012 at 02:20:12PM -0800, Cary Coutant wrote: > >> 2012-01-26 Cary Coutant > >> > >> * include/dwarf2.h (enum dwarf_form): Add Fission extensions. > >> (enum dwarf_attribute): Likewise. > > > > This is ok. > > Thanks. I don't remember what the procedure is, though -- do I check > it in to both gcc and binutils trees, or just one and let it sync to > the other? I think it is best to check it into both trees. Jakub
[m68k, sparc] Fix atomic_test_and_set
Two of the patches have been posted here before; the libstdc++ patch was approved by Benjamin. All of the patches tested on sparc64-linux, and sanity checked on x86_64-linux. I've cross-compiled for m68k-linux, but I've only been able to visually sanity check the code in libstdc++. Committed. Hopefully that wraps up the atomic patches... r~ * optabs.c (gen_atomic_test_and_set): Remove default. (maybe_emit_atomic_test_and_set): Use maybe_expand_insn. diff --git a/gcc/optabs.c b/gcc/optabs.c index fb01320..87cce8e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7311,39 +7311,34 @@ maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val) #ifndef HAVE_atomic_test_and_set #define HAVE_atomic_test_and_set 0 #define CODE_FOR_atomic_test_and_set CODE_FOR_nothing -#define gen_atomic_test_and_set(x,y,z) \ - (gcc_unreachable (), (void) (0 && (x) && (y) && (z)), NULL_RTX) #endif static rtx maybe_emit_atomic_test_and_set (rtx target, rtx mem, enum memmodel model) { enum machine_mode pat_bool_mode; - const struct insn_data_d *id; + struct expand_operand ops[3]; if (!HAVE_atomic_test_and_set) return NULL_RTX; - id = &insn_data[CODE_FOR_atomic_test_and_set]; - pat_bool_mode = id->operand[0].mode; - - /* ??? We only support test-and-set on single bytes at the moment. - We'd have to change the builtin to allow wider memories. */ - gcc_checking_assert (id->operand[1].mode == QImode); - /* While we always get QImode from __atomic_test_and_set, we get other memory modes from __sync_lock_test_and_set. Note that we use no endian adjustment here. This matches the 4.6 behavior in the Sparc backend. */ + gcc_checking_assert +(insn_data[CODE_FOR_atomic_test_and_set].operand[1].mode == QImode); if (GET_MODE (mem) != QImode) mem = adjust_address_nv (mem, QImode, 0); - if (target == NULL || GET_MODE (target) != pat_bool_mode) -target = gen_reg_rtx (pat_bool_mode); - - emit_insn (gen_atomic_test_and_set (target, mem, GEN_INT (model))); + pat_bool_mode = insn_data[CODE_FOR_atomic_test_and_set].operand[0].mode; + create_output_operand (&ops[0], target, pat_bool_mode); + create_fixed_operand (&ops[1], mem); + create_integer_operand (&ops[2], model); - return target; + if (maybe_expand_insn (CODE_FOR_atomic_test_and_set, 3, ops)) +return ops[0].value; + return NULL_RTX; } /* This function expands the legacy _sync_lock test_and_set operation which is * target.def (TARGET_ATOMIC_TEST_AND_SET_TRUEVAL): New. * c-cppbuiltin.c (cpp_atomic_builtins): Define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL. * doc/tm.texi.in (TARGET_ATOMIC_TEST_AND_SET_TRUEVAL): Add doc hook. * doc/tm.texi: Rebuild. diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 7e7b9c1..608dba6 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -670,6 +670,11 @@ cpp_atomic_builtins (cpp_reader *pfile) builtin_define_with_int_value ("__GCC_ATOMIC_LLONG_LOCK_FREE", (have_swap[SWAP_INDEX (long_long_integer_type_node)]? 2 : 1)); + /* If we're dealing with a "set" value that doesn't exactly correspond + to a boolean truth value, let the library work around that. */ + builtin_define_with_int_value ("__GCC_ATOMIC_TEST_AND_SET_TRUEVAL", +targetm.atomic_test_and_set_trueval); + /* ptr_type_node can't be used here since ptr_mode is only set when toplev calls backend_init which is not done with -E or pch. */ psize = POINTER_SIZE / BITS_PER_UNIT; diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index ceb0d1e..91e4b04 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -11359,3 +11359,7 @@ value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on MIPS, where add-immediate takes a 16-bit signed value, @code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value is zero, which disables this optimization. @end deftypevr + +@deftypevr {Target Hook} {unsigned char} TARGET_ATOMIC_TEST_AND_SET_TRUEVAL +This value should be set if the result written by @code{atomic_test_and_set} is not exactly 1, i.e. the @code{bool} @code{true}. +@end deftypevr diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 55c8432..0ebc15d 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -11237,3 +11237,5 @@ value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on MIPS, where add-immediate takes a 16-bit signed value, @code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value is zero, which disables this optimization. @end deftypevr + +@hook TARGET_ATOMIC_TEST_AND_SET_TRUEVAL diff --git a/gcc/target.def b/gcc/target.def index f86f782..6084b21 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -2667,6 +2667,13 @@ DEFHOOK enum unwind_info_type, (void), default_debug_unwind_info) +DEFHOOKPOD +(atomic_test_and_set_trueval, + "This value should be set if the
[PATCH, rs6000] Correctly set rs6000_always_hint for ppc476
The 476 cpu has dynamic branch prediction, so we don't want to always use static branch prediction hints. Is the following patch ok assuming my currently running bootstrap/regtesting doesn't uncover any regressions? Is this appropriate for the 4.6 and 4.5 branches as well? Peter * config/rs6000/rs6000.c (rs6000_option_override_internal): Set rs6000_always_hint to false for 476. Index: config/rs6000/rs6000.c === --- config/rs6000/rs6000.c (revision 183456) +++ config/rs6000/rs6000.c (working copy) @@ -2960,7 +2960,8 @@ rs6000_option_override_internal (bool gl && rs6000_cpu != PROCESSOR_POWER6 && rs6000_cpu != PROCESSOR_POWER7 && rs6000_cpu != PROCESSOR_PPCA2 - && rs6000_cpu != PROCESSOR_CELL); + && rs6000_cpu != PROCESSOR_CELL + && rs6000_cpu != PROCESSOR_PPC476); rs6000_sched_groups = (rs6000_cpu == PROCESSOR_POWER4 || rs6000_cpu == PROCESSOR_POWER5 || rs6000_cpu == PROCESSOR_POWER7);
Re: [m68k, sparc] Fix atomic_test_and_set
From: Richard Henderson Date: Fri, 27 Jan 2012 09:29:00 +1100 > Two of the patches have been posted here before; the libstdc++ > patch was approved by Benjamin. > > All of the patches tested on sparc64-linux, and sanity checked > on x86_64-linux. I've cross-compiled for m68k-linux, but I've > only been able to visually sanity check the code in libstdc++. > > Committed. Hopefully that wraps up the atomic patches... Why do you need to define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL to 0xff on sparc if you're going to convert the result into a bool in the expander?
Re: [m68k, sparc] Fix atomic_test_and_set
On 01/27/2012 09:34 AM, David Miller wrote: > From: Richard Henderson > Date: Fri, 27 Jan 2012 09:29:00 +1100 > >> Two of the patches have been posted here before; the libstdc++ >> patch was approved by Benjamin. >> >> All of the patches tested on sparc64-linux, and sanity checked >> on x86_64-linux. I've cross-compiled for m68k-linux, but I've >> only been able to visually sanity check the code in libstdc++. >> >> Committed. Hopefully that wraps up the atomic patches... > > Why do you need to define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL to 0xff > on sparc if you're going to convert the result into a bool in the > expander? Because the value stored in memory is 0xff, and not a boolean. The boolean is only the result type of __atomic_test_and_set. r~
Re: [m68k, sparc] Fix atomic_test_and_set
From: Richard Henderson Date: Fri, 27 Jan 2012 09:41:10 +1100 > On 01/27/2012 09:34 AM, David Miller wrote: >> From: Richard Henderson >> Date: Fri, 27 Jan 2012 09:29:00 +1100 >> >>> Two of the patches have been posted here before; the libstdc++ >>> patch was approved by Benjamin. >>> >>> All of the patches tested on sparc64-linux, and sanity checked >>> on x86_64-linux. I've cross-compiled for m68k-linux, but I've >>> only been able to visually sanity check the code in libstdc++. >>> >>> Committed. Hopefully that wraps up the atomic patches... >> >> Why do you need to define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL to 0xff >> on sparc if you're going to convert the result into a bool in the >> expander? > > Because the value stored in memory is 0xff, and not a boolean. > The boolean is only the result type of __atomic_test_and_set. Gotcha, the changes thus look fine to me.
[google] Add DW_AT and DW_FORM codes for Fission
OK to backport this from trunk to google/main and google/gcc-4_6? [I've fixed the include/ChangeLog entry from "include/dwarf2.h" to "dwarf2.h".] -cary On Thu, Jan 26, 2012 at 2:04 PM, Cary Coutant wrote: >> Especially in this case where it is primarily for experimenting with it I >> think using higher values would be better, though perhaps still some that >> fit into two byte ULEB128. > > OK. Revised patch... > > -cary > > > 2012-01-26 Cary Coutant > > * dwarf2.h (enum dwarf_form): Add Fission extensions. > (enum dwarf_attribute): Likewise. > > > commit 0097fed73afa307f5cfc5de9cae0d3041f66193f > Author: Cary Coutant > Date: Sat Nov 5 01:17:06 2011 -0700 > > Add new DW_AT and DW_FORM codes for Fission. > > diff --git a/include/dwarf2.h b/include/dwarf2.h > index 37cb83f..8c0c9ed 100644 > --- a/include/dwarf2.h > +++ b/include/dwarf2.h > @@ -188,7 +188,11 @@ enum dwarf_form > DW_FORM_sec_offset = 0x17, > DW_FORM_exprloc = 0x18, > DW_FORM_flag_present = 0x19, > - DW_FORM_ref_sig8 = 0x20 > + DW_FORM_ref_sig8 = 0x20, > + /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ > + DW_FORM_GNU_ref_index = 0x1f00, > + DW_FORM_GNU_addr_index = 0x1f01, > + DW_FORM_GNU_str_index = 0x1f02 > }; > > /* Attribute names and codes. */ > @@ -368,6 +372,13 @@ enum dwarf_attribute > DW_AT_GNU_all_source_call_sites = 0x2118, > /* Section offset into .debug_macro section. */ > DW_AT_GNU_macros = 0x2119, > + /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ > + DW_AT_GNU_dwo_name = 0x2130, > + DW_AT_GNU_dwo_id = 0x2131, > + DW_AT_GNU_ref_base = 0x2132, > + DW_AT_GNU_addr_base = 0x2133, > + DW_AT_GNU_pubnames = 0x2134, > + DW_AT_GNU_pubtypes = 0x2135, > /* VMS extensions. */ > DW_AT_VMS_rtnbeg_pd_address = 0x2201, > /* GNAT extensions. */
Re: [google] Add DW_AT and DW_FORM codes for Fission
On Thu, Jan 26, 2012 at 17:45, Cary Coutant wrote: > OK to backport this from trunk to google/main and google/gcc-4_6? Yes. Diego.
Re: [google] Add DW_AT and DW_FORM codes for Fission
> OK to backport this from trunk to google/main and google/gcc-4_6? Sorry, that diff isn't right, since an earlier version of this patch is already in those branches. Here's the right diff... -cary 2012-01-26 Cary Coutant * dwarf2.h (enum dwarf_form): Update Fission extensions, add wiki reference. (enum dwarf_attribute): Likewise. Index: include/dwarf2.h === --- include/dwarf2.h(revision 183586) +++ include/dwarf2.h(working copy) @@ -189,10 +189,10 @@ enum dwarf_form DW_FORM_exprloc = 0x18, DW_FORM_flag_present = 0x19, DW_FORM_ref_sig8 = 0x20, -/* Extensions for Fission. */ -DW_FORM_GNU_ref_index = 0x70, -DW_FORM_GNU_addr_index = 0x71, -DW_FORM_GNU_str_index = 0x72 +/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ +DW_FORM_GNU_ref_index = 0x1f00, +DW_FORM_GNU_addr_index = 0x1f01, +DW_FORM_GNU_str_index = 0x1f02 }; /* Attribute names and codes. */ @@ -372,7 +372,7 @@ enum dwarf_attribute DW_AT_GNU_all_source_call_sites = 0x2118, /* Section offset into .debug_macro section. */ DW_AT_GNU_macros = 0x2119, -/* Extensions for Fission. */ +/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ DW_AT_GNU_dwo_name = 0x2130, DW_AT_GNU_dwo_id = 0x2131, DW_AT_GNU_ref_base = 0x2132,
Re: [google] Add DW_AT and DW_FORM codes for Fission
On 1/26/12 5:50 PM, Cary Coutant wrote: OK to backport this from trunk to google/main and google/gcc-4_6? Sorry, that diff isn't right, since an earlier version of this patch is already in those branches. Here's the right diff... The second hunk was already in? Still OK. Diego.
Re: [PATCH] PR c++/50852 - loose template parameter comparison
On 01/26/2012 05:15 PM, Dodji Seketeli wrote: Jason Merrill writes: Hmm...what if rather than trying to ignore levels when comparing, we make it so the sibling list always has level 1? I am not sure to understand how you'd do that. You mean that instead of pointing to the actual vector of innermost template parms, TEMPLATE_PARM_SIBLINGS would instead point to a vector that is a copy of the innermost template parms into which we'd have substituted and index of level 1 for the index of each parm? Yes, that's what I was thinking. Only if they aren't already level 1, of course. BTW, let's avoid calling a function named *_real directly from client code. Ah, oops sorry. I thought it would be OK as cp-tree.h already has a few spots of public entry points "overloaded" using that _real suffix. What suffix would be best? Something that expresses the actual nature of the extra parameter. The problem with _real functions is that often you want to add another parameter later, and then what do you call it? :) Jason
Re: [google] Add DW_AT and DW_FORM codes for Fission
> The second hunk was already in? Still OK. Yeah, Jakub asked me to change the numbers for the DW_FORM codes for upstream checkin, but the DW_AT codes we're using are OK. -cary
Merge trunk to gccgo branch
I have once again merged trunk to gccgo branch, this time revision 183589. Ian
[PATCH][Cilkplus] Array Notation Max/Min Index fix
Hello Everyone, This patch is for the Cilkplus branch affecting both the C and C++ Compilers. This patch will fix a bug for max and min-index builtin function. The original implemention was comparing the max/min index with the value in the array. This patch will add a new variable and store the value in the array to this variable. Thanking You, Yours Sincerely, Balaji V. Iyer.diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index 98e0528..4297c91 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,5 +1,10 @@ 2012-01-26 Balaji V. Iyer + * c-array-notation.c (fix_builtin_array_notation_fn): Initialized the + maximum/minimum value for max/min index builtin function. + +2012-01-26 Balaji V. Iyer + * array-notation-common.c (array_notation_init_builtins): Added the internal array notation function "__sec_reduce_implicit_index." (is_sec_implicit_index_fn): New function. diff --git a/gcc/c-array-notation.c b/gcc/c-array-notation.c index 3ff52dc..d4a94f2 100644 --- a/gcc/c-array-notation.c +++ b/gcc/c-array-notation.c @@ -1379,7 +1379,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) { tree new_var_type = NULL_TREE, func_parm, new_expr, new_yes_expr, new_no_expr; tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list; - tree new_yes_list, new_cond_expr, new_var_init; + tree new_yes_list, new_cond_expr, new_var_init, new_exp_init; an_reduce_type an_type = REDUCE_UNKNOWN; tree *array_list = NULL; int list_size = 0; @@ -1719,6 +1719,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_var_init = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, build_zero_cst (new_var_type), new_var_type); + new_exp_init = build_modify_expr + (UNKNOWN_LOCATION, array_ind_value, TREE_TYPE (array_ind_value), +NOP_EXPR, UNKNOWN_LOCATION, func_parm, TREE_TYPE (func_parm)); new_no_ind = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var)); @@ -1766,6 +1769,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_var_init = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, build_zero_cst (new_var_type), new_var_type); + new_exp_init = build_modify_expr + (UNKNOWN_LOCATION, array_ind_value, TREE_TYPE (array_ind_value), +NOP_EXPR, UNKNOWN_LOCATION, func_parm, TREE_TYPE (func_parm)); new_no_ind = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var)); @@ -1817,12 +1823,12 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) for (ii = 0; ii < rank; ii++) append_to_statement_list (ind_init [ii], &loop); + if (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX) +append_to_statement_list (new_exp_init, &loop); append_to_statement_list (new_var_init, &loop); for (ii = 0; ii < rank; ii++) { - /* append_to_statement_list (ind_init [ii], &loop); */ - append_to_statement_list (build1 (LABEL_EXPR, void_type_node, if_stmt_label[ii]), &loop); append_to_statement_list diff --git a/gcc/cp/ChangeLog.cilk b/gcc/cp/ChangeLog.cilk index cf9d993..dff1fb5 100644 --- a/gcc/cp/ChangeLog.cilk +++ b/gcc/cp/ChangeLog.cilk @@ -1,5 +1,18 @@ 2012-01-26 Balaji V. Iyer + * cp-array-notation.c (fix_builtin_array_notation_fn): Added new var + called "array_ind_value," that stores the max/min value and the *new_var + stores the index. Also, replaced all build_int_cst with build_one_cst + and build_zero_cst. Also, in REDUCE_ANY_ZEROS and REDUCE_ALL_ZEROS + cases, replaced comparing with func_parm with a new_cond_expr. Also + initialized the maximum/minimum value for the max/min index builtin + function. + (contains_array_notation_expr): Deferenced array_list in if statement. + * typeck.c (convert_for_assignment): Checked if the rhs contains array + notation expr, if so we don't do any conversion. + +2012-01-26 Balaji V. Iyer + * cp-array-notation.c (extract_array_notation_exprs): Added a check to see if the call expr is sec_implicit_index function. (replace_array_notations): Likewise. diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index 2a27c62..11bc99a 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -1294,7 +1294,8 @@ static tree fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) { tree new_var_type = NULL_TREE, func_parm, new_expr, new_yes_expr, new_no_expr; - tree new_var_init; + tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list; + tree new_yes_list, new_cond_expr, ne
[Patch, Fortran] Fix elemental diagnostic for polymorphic dummies
Dominique found out that there is no diagnostic for polymorphic arrays. This patch adds it. From the F2008 standard: "C1289 All dummy arguments of an elemental procedure shall be scalar noncoarray dummy data objects and shall not have the POINTER or ALLOCATABLE attribute." "An elemental subroutine has only scalar dummy arguments, but may have array actual arguments. In a reference to an elemental subroutine, either all actual arguments shall be scalar, or all actual arguments corresponding to INTENT (OUT) and INTENT (INOUT) dummy arguments shall be arrays of the same shape and the remaining actual arguments shall be conformable with them." Build and currently regtesting on x86-64-linux. OK for the trunk? Tobias 2012-01-27 Tobias Burnus * resolve.c (resolve_formal_arglist): Fix elemental constraint checks for polymorphic dummies. 2012-01-27 Tobias Burnus * gfortran.dg/elemental_args_check_5.f90: New. Index: gcc/fortran/resolve.c === --- gcc/fortran/resolve.c (Revision 183575) +++ gcc/fortran/resolve.c (Arbeitskopie) @@ -374,21 +374,26 @@ resolve_formal_arglist (gfc_symbol *proc) if (gfc_elemental (proc)) { /* F08:C1289. */ - if (sym->attr.codimension) + if (sym->attr.codimension + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->attr.codimension)) { gfc_error ("Coarray dummy argument '%s' at %L to elemental " "procedure", sym->name, &sym->declared_at); continue; } - if (sym->as != NULL) + if (sym->as || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->as)) { gfc_error ("Argument '%s' of elemental procedure at %L must " "be scalar", sym->name, &sym->declared_at); continue; } - if (sym->attr.allocatable) + if (sym->attr.allocatable + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->attr.allocatable)) { gfc_error ("Argument '%s' of elemental procedure at %L cannot " "have the ALLOCATABLE attribute", sym->name, Index: gcc/testsuite/gfortran.dg/elemental_args_check_5.f90 === --- gcc/testsuite/gfortran.dg/elemental_args_check_5.f90 (Revision 0) +++ gcc/testsuite/gfortran.dg/elemental_args_check_5.f90 (Arbeitskopie) @@ -0,0 +1,30 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! + type t + end type t + type t2 + end type t2 +contains +elemental subroutine foo0(v) ! OK + class(t), intent(in) :: v +end subroutine + +elemental subroutine foo1(w) ! { dg-error "Argument 'w' of elemental procedure at .1. cannot have the ALLOCATABLE attribute" } + class(t), allocatable, intent(in) :: w +end subroutine + +elemental subroutine foo2(x) ! { dg-error "Argument 'x' of elemental procedure at .1. cannot have the POINTER attribute" } + class(t), pointer, intent(in) :: x +end subroutine + +elemental subroutine foo3(y) ! { dg-error "Coarray dummy argument 'y' at .1. to elemental procedure" } + class(t2), intent(in) :: y[*] +end subroutine + +elemental subroutine foo4(z) ! { dg-error "Argument 'z' of elemental procedure at .1. must be scalar" } + class(t), intent(in) :: z(:) +end subroutine + +end
[wwwdocs] Fix quoting in gcc-4.7/porting_to.html
Hi, I noticed that the porting example for c++11 user-defined literals is using "smart" double quotes, when code should have straight quotes. There's also an operator term that should be in the nearby block. Thanks, Josh 2012-01-26 Josh Stone * htdocs/gcc-4.7/porting_to.html: Use straight quotes in code examples, and expand a wrapper around the operator term. Index: htdocs/gcc-4.7/porting_to.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/porting_to.html,v retrieving revision 1.6 diff -u -p -r1.6 porting_to.html --- htdocs/gcc-4.7/porting_to.html 12 Jan 2012 21:15:51 - 1.6 +++ htdocs/gcc-4.7/porting_to.html 26 Jan 2012 23:52:21 - @@ -215,19 +215,19 @@ valid ISO C++03 code -const char *p = “foobar”__TIME__; +const char *p = "foobar"__TIME__; In C++03, the __TIME__ macro expands to some string literal and is concatenated with the other one. In -C++11 __TIME__ isn't expanded, instead operator -“” __TIME__ is being looked up, resulting in the +C++11 __TIME__ isn't expanded, instead operator +"" __TIME__ is being looked up, resulting in the following diagnostic: error: unable to find string literal operator - ‘operator“” __TIME__’ + ‘operator"" __TIME__’
Re: [PATCH, rs6000] Correctly set rs6000_always_hint for ppc476
On Thu, Jan 26, 2012 at 5:30 PM, Peter Bergner wrote: > The 476 cpu has dynamic branch prediction, so we don't want to always > use static branch prediction hints. Is the following patch ok assuming > my currently running bootstrap/regtesting doesn't uncover any regressions? > > Is this appropriate for the 4.6 and 4.5 branches as well? The patch is okay. It is not appropriate for 4.5 and 4.6 branches because it is not a bug fix. Thanks, David
Re: [wwwdocs] Fix quoting in gcc-4.7/porting_to.html
On Thu, 26 Jan 2012, Josh Stone wrote: > I noticed that the porting example for c++11 user-defined literals is > using "smart" double quotes, when code should have straight quotes. > There's also an operator term that should be in the nearby block. Good catches, both of them, Josh! And thanks for even providing a patch which I went ahead and committed right away. Gerald
[PATCH] libgcc: refer to pthread_create, not pthread_cancel
For GNU systems, the fact that libgcc/libstdc++ refers to pthread_cancel is utterly bizarre. I don't know of any rationale for this that has ever applied to glibc. AFAICT the choice was made based on the foibles of various non-glibc systems. In practice, things are working fine on GNU systems now, of course. But they'd work just as well for all extant glibc versions if the reference were to pthread_create instead. That's what makes clear sense on its face: if the program is multithreaded, pthread_create is the one function that certainly must have been linked in. It is actively troublesome for the case of static linking. It necessitates linking in a lot of dead code in a program that uses pthreads but doesn't use pthread_cancel. It only actually works right at all because glibc added a special hack to cope with this bizarre reference to pthread_cancel. It would be nice if we could remove that someday. (I don't intend to start any general discussion here about the level of support for static linking. It's just an example of what's nonsensical about this usage.) With any kind of linking, it has whatever side effects linking in pthread_cancel has. There is at least one port of glibc (to a non-GNU system) where pthread_cancel has a link-time warning because it's not fully supported. Getting this warning on every link that uses C++ at all is rather bewildering, especially to application developers who don't use pthreads directly at all or don't have any idea what pthread_cancel is. What do folks think about this change? It obviously should have no effect whatsoever on builds not using glibc. I'm pretty confident that it won't have any bad effect on a build using any extant version of glibc that had pthreads at all. Thanks, Roland 2012-01-26 Roland McGrath * gthr-posix.h [neither FreeBSD nor Solaris] (__gthread_active_p): If __GLIBC__ is defined, refer to pthread_create, not pthread_cancel. diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h index 46054f6..688253d 100644 --- a/libgcc/gthr-posix.h +++ b/libgcc/gthr-posix.h @@ -241,18 +241,24 @@ __gthread_active_p (void) #else /* neither FreeBSD nor Solaris */ +/* The bionic (Android) C library does not provide pthread_cancel. + The GNU C library provides pthread_cancel, but it is a poor + choice there. For static linking, referring to pthread_cancel + causes it to be linked in even when it's never actually used. + For a program to be multi-threaded the only thing that it + certainly must be using is pthread_create. */ + +#if defined(__GLIBC__) || defined(__BIONIC__) +# define GTHR_ACTIVE_PROXY __gthrw_(pthread_create) +#else +# define GTHR_ACTIVE_PROXY __gthrw_(pthread_cancel) +#endif + static inline int __gthread_active_p (void) { -/* Android's C library does not provide pthread_cancel, check for - `pthread_create' instead. */ -#ifndef __BIONIC__ static void *const __gthread_active_ptr -= __extension__ (void *) &__gthrw_(pthread_cancel); -#else - static void *const __gthread_active_ptr -= __extension__ (void *) &__gthrw_(pthread_create); -#endif += __extension__ (void *) >HR_ACTIVE_PROXY; return __gthread_active_ptr != 0; }
Re: [v3] libstdc++/49829
> > OK. The attached is closer, but still not quite there. > > one step further, to avoid the endless recursion in the install-debug > target. unsure if that is the right approach. the install now works, > but the debug library is now built in the install step, not in the > build step. As checked in. tested x86/linux -benjamin2012-01-27 Benjamin Kosnik Matthias Klose * configure.ac (GLIBCXX_ENABLE_DEBUG_FLAGS): Use -gdwarf-4 -g3 -O0. * configure.in: Regenerated. * src/Makefile.am (all-once, install-data-once): New rules. (all-local, install-data-local): Use them. (build-debug, install-debug): Tweak. * src/Makefile.in: Regenerate. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index c5f7901..7607e5b 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -124,7 +124,7 @@ GLIBCXX_ENABLE_LONG_LONG([yes]) GLIBCXX_ENABLE_WCHAR_T([yes]) GLIBCXX_ENABLE_C99([yes]) GLIBCXX_ENABLE_CONCEPT_CHECKS([no]) -GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0"]) +GLIBCXX_ENABLE_DEBUG_FLAGS(["-gdwarf-4 -g3 -O0"]) GLIBCXX_ENABLE_DEBUG([no]) GLIBCXX_ENABLE_PARALLEL([yes]) GLIBCXX_ENABLE_CXX_FLAGS diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 87b2a16..2cd2774 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -168,16 +168,16 @@ version_arg = version_dep = endif -# Added rules. -# 1 debug library -# 2 supra-convenience library -if GLIBCXX_BUILD_DEBUG -all-local: libstdc++convenience.la build_debug -install-data-local: install_debug -else -all-local: libstdc++convenience.la -install-data-local: -endif + +# Control additional build primary rules. +# EXTRA_LTLIBRARIES = +all-once: libstdc++convenience.la $(STAMP_DEBUG) +install-data-once: $(STAMP_INSTALL_DEBUG) + +all-local: all-once +install-data-local: install-data-once +clean-local: + rm -rf libstdc++convenience.la stamp* $(CLEAN_DEBUG) # Make a non-installed convenience library, so that --disable-static # may work. @@ -188,13 +188,26 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES) fi; \ echo `date` > stamp-libstdc++convenience; -debugdir = debug +# Added rules. +# 1 debug library +# 2 supra-convenience library +if GLIBCXX_BUILD_DEBUG +STAMP_DEBUG = build-debug +STAMP_INSTALL_DEBUG = install-debug +CLEAN_DEBUG = debug +else +STAMP_DEBUG = +STAMP_INSTALL_DEBUG = +CLEAN_DEBUG = +endif -# Build a set of debug objects here. +# Build a debug variant. # Take care to fix all possibly-relative paths. +debugdir = ${glibcxx_builddir}/src/debug stamp-debug: if test ! -d ${debugdir}; then \ mkdir -p ${debugdir}; \ + for d in $(SUBDIRS); do mkdir -p ${debugdir}/$$d; done; \ (cd ${debugdir}; \ sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \ -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \ @@ -202,16 +215,30 @@ stamp-debug: -e 's/VPATH = \.\./VPATH = ..\/../' \ -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \ -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \ - -e 's/all-local: build_debug/all-local:/' \ - -e 's/install-data-local: install_debug/install-data-local:/' \ - < ../Makefile > Makefile) ; \ + < ../Makefile > Makefile ; \ + for d in . $(SUBDIRS); do \ + sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \ + -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \ + -e 's/srcdir = \.\./srcdir = ..\/../' \ + -e 's/VPATH = \.\./VPATH = ..\/../' \ + -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \ + -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \ + < ../$$d/Makefile > $$d/Makefile ; \ + done) ; \ fi; \ echo `date` > stamp-debug; -build_debug: stamp-debug - (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all) - -# Install debug library here. -install_debug: - (cd ${debugdir} && $(MAKE) \ - toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) +build-debug: stamp-debug + (cd ${debugdir}; \ + mv Makefile Makefile.tmp; \ + sed -e 's,all-local: all-once,all-local:,' \ + -e 's,install-data-local: install-data-once,install-data-local:,' \ + -e 's,src/c,src/debug/c,' \ + < Makefile.tmp > Makefile ; \ + $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ; + +# Install debug library. +install-debug: build-debug + (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
[pph] Handle hidden state in cp/decl2.c (issue5577059)
Emit some state hidden in cp/decl2.c: pending_statics, deferred_fns, and no_linkage_decls. One tests is now passing, two tests are now okay, and three tests have improved, but are still failing. Index: gcc/testsuite/ChangeLog.pph 2012-01-26 Lawrence Crowl * g++.dg/pph/x1tmplclass1.cc: Mark passing. * g++.dg/pph/x1tmplclass2.cc: Mark okay. * g++.dg/pph/x4tmplclass1.cc: Mark okay. * g++.dg/pph/x4tmplclass2.cc: Change failure. * g++.dg/pph/z4tmplclass1.cc: Change failure. * g++.dg/pph/z4tmplclass2.cc: Change failure. Index: gcc/cp/ChangeLog.pph 2012-01-26 Lawrence Crowl * decl2.c (#include "pph.h"): New. (pph_out_decl2_hidden_state): New. (pph_in_decl2_hidden_state): New. (pph_dump_decl2_hidden_state): New. * Make-lang.in (cp/decl.o): Add dependence on $(CXX_PPH_H) * pph.h (pph_dump_vec_tree): Externalize. (pph_out_tree_vec): Externalize. (pph_in_tree_vec): Externalize. (pph_union_into_tree_vec): Externalize. (pph_out_decl2_hidden_state): New. (pph_in_decl2_hidden_state): New. (pph_dump_decl2_hidden_state): New. * pph-core.c (pph_dump_vec_tree): Externalize. (pph_dump_global_state): Call pph_dump_decl2_hidden_state. * pph-out.c (pph_out_tree_vec): Externalize. (pph_write_file): Call pph_out_decl2_hidden_state. * pph-in.c (pph_in_tree_vec): Externalize. (pph_union_into_tree_vec): Externalize. (pph_read_file_1): Call pph_in_decl2_hidden_state. Index: gcc/testsuite/g++.dg/pph/x1tmplclass1.cc === --- gcc/testsuite/g++.dg/pph/x1tmplclass1.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/x1tmplclass1.cc(working copy) @@ -1,7 +1,2 @@ -// pph asm xdiff 11432 -// xfail BOGUS MISSVAR -// The assembly is missing a template class static member variable -// base::variable instantiated in a prior pph file. - #include "x0tmplclass13.h" #include "a0tmplclass1_u.h" Index: gcc/testsuite/g++.dg/pph/x1tmplclass2.cc === --- gcc/testsuite/g++.dg/pph/x1tmplclass2.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/x1tmplclass2.cc(working copy) @@ -1,7 +1,5 @@ -// pph asm xdiff 37711 -// xfail BOGUS MISSVAR -// The assembly is missing a template class static member variable -// base::variable instantiated in a prior pph file. -// Others symbols are emitted in a different order. +// pph asm xokay 60608 +// Symbols are emitted in a different order. + #include "x0tmplclass23.h" #include "a0tmplclass2_u.h" Index: gcc/testsuite/g++.dg/pph/z4tmplclass1.cc === --- gcc/testsuite/g++.dg/pph/z4tmplclass1.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/z4tmplclass1.cc(working copy) @@ -1,5 +1,5 @@ -// pph asm xdiff 65352 -// xfail BOGUS DUPVAR DUPFUNC +// pph asm xdiff 43522 +// xfail DUPVAR DUPFUNC #include "x0tmplclass13.h" #include "x0tmplclass14.h" Index: gcc/testsuite/g++.dg/pph/z4tmplclass2.cc === --- gcc/testsuite/g++.dg/pph/z4tmplclass2.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/z4tmplclass2.cc(working copy) @@ -1,5 +1,5 @@ -// pph asm xdiff 46430 -// xfail BOGUS DUPVAR DUPFUNC +// pph asm xdiff 26423 +// xfail DUPVAR DUPFUNC #include "x0tmplclass23.h" #include "x0tmplclass24.h" Index: gcc/testsuite/g++.dg/pph/x4tmplclass1.cc === --- gcc/testsuite/g++.dg/pph/x4tmplclass1.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/x4tmplclass1.cc(working copy) @@ -1,6 +1,6 @@ -// pph asm xokay 63957 -// Assembly differences seem to be due to the order in which the -// symbols in the template hash tables are emitted. +// pph asm xokay 03516 +// Label numbers are different. + #include "x0tmplclass11.h" #include "x0tmplclass12.h" #include "a0tmplclass1_u.h" Index: gcc/testsuite/g++.dg/pph/x4tmplclass2.cc === --- gcc/testsuite/g++.dg/pph/x4tmplclass2.cc(revision 183576) +++ gcc/testsuite/g++.dg/pph/x4tmplclass2.cc(working copy) @@ -1,5 +1,6 @@ -// pph asm xdiff 54639 -// generating different sets of variables +// pph asm xdiff 51443 +// xfail DUPFUNC + #include "x0tmplclass21.h" #include "x0tmplclass22.h" #include "a0tmplclass2_u.h" Index: gcc/cp/pph-core.c === --- gcc/cp/pph-core.c (revision 183576) +++ gcc/cp/pph-core.c (working copy) @@ -273,7 +273,7 @@ pph_dump_binding (FILE *file, cp_binding /* Dump a tree vec v for PPH. */ -static void +void pph_dump_vec_tree (FILE *file, VEC(tree,gc) *v) { unsigned i; @@ -301,6 +301,7 @@ pph_dump_global_state (FILE *file, const fprintf (file, "\nPPH: unemitted_tinfo_decls
Re: [PATCH, rs6000] Correctly set rs6000_always_hint for ppc476
On Thu, 2012-01-26 at 19:13 -0500, David Edelsohn wrote: > On Thu, Jan 26, 2012 at 5:30 PM, Peter Bergner wrote: > > The 476 cpu has dynamic branch prediction, so we don't want to always > > use static branch prediction hints. Is the following patch ok assuming > > my currently running bootstrap/regtesting doesn't uncover any regressions? > > The patch is okay. Ok, I committed it to mainline as revision 183601. Thanks. Peter
[committed] invoke.texi: move -Wcoverage-mismatch blurb
I noticed that the documentation for -Wcoverage-mismatch was placed in the wrong section in invoke.texi. Fixed thusly. -Sandra 2012-01-27 Sandra Loosemore gcc/ * doc/invoke.texi (Language Independent Options): Move -Wcoverage-mismatch blurb from here (Warning Options): ...to here. Index: gcc/doc/invoke.texi === --- gcc/doc/invoke.texi (revision 183601) +++ gcc/doc/invoke.texi (working copy) @@ -2869,21 +2869,6 @@ command line option that directly contro option is known to the diagnostic machinery). Specifying the @option{-fno-diagnostics-show-option} flag suppresses that behavior. -@item -Wcoverage-mismatch -@opindex Wcoverage-mismatch -Warn if feedback profiles do not match when using the -@option{-fprofile-use} option. -If a source file was changed between @option{-fprofile-gen} and -@option{-fprofile-use}, the files with the profile feedback can fail -to match the source file and GCC can not use the profile feedback -information. By default, this warning is enabled and is treated as an -error. @option{-Wno-coverage-mismatch} can be used to disable the -warning or @option{-Wno-error=coverage-mismatch} can be used to -disable the error. Disable the error for this warning can result in -poorly optimized code, so disabling the error is useful only in the -case of very minor changes such as bug fixes to an existing code-base. -Completely disabling the warning is not recommended. - @end table @node Warning Options @@ -3136,6 +3121,21 @@ Warn whenever a comment-start sequence @ comment, or whenever a Backslash-Newline appears in a @samp{//} comment. This warning is enabled by @option{-Wall}. +@item -Wno-coverage-mismatch +@opindex Wno-coverage-mismatch +Warn if feedback profiles do not match when using the +@option{-fprofile-use} option. +If a source file was changed between @option{-fprofile-gen} and +@option{-fprofile-use}, the files with the profile feedback can fail +to match the source file and GCC cannot use the profile feedback +information. By default, this warning is enabled and is treated as an +error. @option{-Wno-coverage-mismatch} can be used to disable the +warning or @option{-Wno-error=coverage-mismatch} can be used to +disable the error. Disabling the error for this warning can result in +poorly optimized code and is useful only in the +case of very minor changes such as bug fixes to an existing code-base. +Completely disabling the warning is not recommended. + @item -Wno-cpp @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
[committed] invoke.texi: fix "command line" vs "command-line" usage
As listed in the GCC Coding Conventions http://gcc.gnu.org/codingconventions.html "command line" is a noun phrase, and the adjective form is hyphenated, as in "command-line option". Since invoke.texi talks a lot about command-line options to GCC, we ought to describe them correctly. ;-) I've checked in this patch as obvious. I have close to 500KB of similar kinds of content-free copy-editing patches to invoke.texi in my queue; does anyone really want to review them, or object to me just continuing to check them in piecewise like this? -Sandra 2012-01-27 Sandra Loosemore gcc/ * doc/invoke.texi: Correct usage of "command line" (noun) vs "command-line" (adjective) throughout. Index: gcc/doc/invoke.texi === --- gcc/doc/invoke.texi (revision 183602) +++ gcc/doc/invoke.texi (working copy) @@ -83,7 +83,7 @@ options control the assembler and linker documented here, since you rarely need to use any of them. @cindex C compilation options -Most of the command line options that you can use with GCC are useful +Most of the command-line options that you can use with GCC are useful for C programs; when an option is only useful with another language (usually C++), the explanation says so explicitly. If the description for a particular option does not mention a source language, you can use @@ -1247,22 +1247,22 @@ no trouble. @item --help @opindex help -Print (on the standard output) a description of the command line options +Print (on the standard output) a description of the command-line options understood by @command{gcc}. If the @option{-v} option is also specified then @option{--help} will also be passed on to the various processes -invoked by @command{gcc}, so that they can display the command line options +invoked by @command{gcc}, so that they can display the command-line options they accept. If the @option{-Wextra} option has also been specified -(prior to the @option{--help} option), then command line options which +(prior to the @option{--help} option), then command-line options which have no documentation associated with them will also be displayed. @item --target-help @opindex target-help -Print (on the standard output) a description of target-specific command -line options for each tool. For some targets extra target-specific +Print (on the standard output) a description of target-specific command-line +options for each tool. For some targets extra target-specific information may also be printed. @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]} -Print (on the standard output) a description of the command line +Print (on the standard output) a description of the command-line options understood by the compiler that fit into all specified classes and qualifiers. These are the supported classes: @@ -1360,7 +1360,7 @@ Here is a truncated example from the ARM -mapcs[disabled] @end smallexample -The output is sensitive to the effects of previous command line +The output is sensitive to the effects of previous command-line options, so for example it is possible to find out which optimizations are enabled at @option{-O2} by using: @@ -1858,7 +1858,7 @@ basic integer types such as @code{int} a @section Options Controlling C++ Dialect @cindex compiler options, C++ -@cindex C++ options, command line +@cindex C++ options, command-line @cindex options, C++ This section describes the command-line options that are only meaningful for C++ programs; but you can also use most of the GNU compiler options @@ -2595,7 +2595,7 @@ In this example, G++ will synthesize a d @section Options Controlling Objective-C and Objective-C++ Dialects @cindex compiler options, Objective-C and Objective-C++ -@cindex Objective-C and Objective-C++ options, command line +@cindex Objective-C and Objective-C++ options, command-line @cindex options, Objective-C and Objective-C++ (NOTE: This manual does not describe the Objective-C and Objective-C++ languages themselves. @xref{Standards,,Language Standards @@ -2754,7 +2754,7 @@ suppresses this behavior and causes call to be retained. This is useful in Zero-Link debugging mode, since it allows for individual class implementations to be modified during program execution. The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")} -regardless of command line options. +regardless of command-line options. @item -gen-decls @opindex gen-decls @@ -2865,7 +2865,7 @@ a message which is too long to fit on a @opindex fno-diagnostics-show-option @opindex fdiagnostics-show-option By default, each diagnostic emitted includes text which indicates the -command line option that directly controls the diagnostic (if such an +command-line option that directly controls the diagnostic (if such an option is known to the diagnostic machinery). Specifying the @option{-fno-di
[Patch, Fortran] PR51953 - allow multiple alloc obj. with SOURCE= in allocate
That's a Fortran 2008 feature. Build and regtested on x86-64-linux. OK for the trunk? Tobias 2012-01-27 Tobias Burnus PR fortran/51953 * match.c (gfc_match_allocate): Allow more than allocate object with SOURCE=. 2012-01-27 Tobias Burnus PR fortran/51953 * gfortran.dg/allocate_alloc_opt_13.f90: New. * gfortran.dg/allocate_alloc_opt_4.f90: Add -std=f2003 and change dg-error string. Index: gcc/fortran/match.c === --- gcc/fortran/match.c (revision 183575) +++ gcc/fortran/match.c (working copy) @@ -3660,12 +3660,11 @@ alloc_opt_list: goto cleanup; } - if (head->next) - { - gfc_error ("SOURCE tag at %L requires only a single entity in " - "the allocation-list", &tmp->where); - goto cleanup; -} + if (head->next + && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: SOURCE tag at %L" + " with more than a single allocate objects", + &tmp->where) == FAILURE) + goto cleanup; source = tmp; tmp = NULL; Index: gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90 === --- gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90 (working copy) @@ -0,0 +1,25 @@ +! { dg-do compile } +! +! PR fortran/51953 +! +! +type t +end type t + +class(t), allocatable :: a, c(:), e(:) +class(t), pointer :: b, d(:) + +allocate (a, b, source=c(1)) +allocate (c(4), d(6), source=e) + +allocate (a, b, source=f()) +allocate (c(1), d(6), source=g()) + +contains +function f() + class(t), allocatable :: f +end function +function g() + class(t), allocatable :: g(:) +end function +end Index: gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 === --- gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 (revision 183575) +++ gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=f2003" } program a implicit none @@ -16,7 +17,7 @@ program a allocate(integer(4) :: i(4), source=n) ! { dg-error "conflicts with the typespec" } - allocate(i(4), j(n), source=n) ! { dg-error "requires only a single entity" } + allocate(i(4), j(n), source=n) ! { dg-error "Fortran 2008: SOURCE tag at .1. with more than a single allocate objects" } allocate(x(4), source=n) ! { dg-error "type incompatible with" }
Re: [PATCH] libgcc: refer to pthread_create, not pthread_cancel
On Thu, Jan 26, 2012 at 05:07:38PM -0800, Roland McGrath wrote: > What do folks think about this change? It obviously should have no effect > whatsoever on builds not using glibc. I'm pretty confident that it won't > have any bad effect on a build using any extant version of glibc that had > pthreads at all. > pthread_create is what has been referenced there up to GCC 3.4. So please see the rationale for changing it from pthread_create to pthread_cancel. http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01093.html http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02517.html (and lots of gcc-patches mails in between the two). Jakub