Re: [PATCH] Cleanup of input.c
On 10/01/16 00:16, David Malcolm wrote: > On Mon, 2016-09-26 at 14:30 +, Bernd Edlinger wrote: >> Hi, >> >> this started, because I saw get_next_line returns -1 on error, >> instead >> of false: PR 77699. >> >> But when I was there I also saw that read_line_num is using memmove >> on >> non-aliased src & dest, instead of memcpy. But then I see that >> also adding a NUL byte is superfluos, and all the copying as well >> >> >> So the result is a cleanup of input.c that avoids lots of copying >> altogether, because it is no longer necessary to do so. >> >> >> Bootstrapped and reg-tested on x86_64-pc-linux-gnu. >> Is it OK for trunk? > > I'll attempt to review this with my "diagnostics maintainer" hat on - > but I'm not as familiar with input.c's implementation as with the restof > the diagnostics subsystem. > Yes. I gave a few review comments when Dodji Seketeli wrote the line buffering code, but Jakub did most of the review. So I am already a bit familiar with the history of the code here. > Did you try running this under valgrind? >(e.g. "make selftest-valgrind" at least) > did not try. > FWIW I made the following notes to try to understand the existing > behavior: > >get_next_line: > sets its *line to values related to c->data, the buffered content >of all of the file so far... >c->data can be reallocated in maybe_grow, called by read_data, >called by maybe_read_line, called by get_next_line >invalidating the exposed ptr whenever the buffer growth needs a >re-allocation. > Additionally the file cache can be evicted, and the buffer can be re-used for another file. >read_next_line: > copies the exposed part of c->data to *line > Note that it's a different *line: > It calls get_next_line with &l, so *line in get_next_line is > writing to "l" in read_next_line, exposing part of c->data > read_next_line ensures that the passed-in-ptr's buffer is big > enough, then does a memcpy to it, effectively from c->data. > >goto_next_line: > also calls get_next_line, but doesn't bother copying the result > anywhere > >read_line_num: > calls goto_next_line repeatedly > then calls read_next_line, thus effectively read_next_line is > copying data to the passed-in-ptr > >location_get_source_line: > calls read_next_line, managing: >static char *buffer; >static ssize_t len; > as the place where the copies are written to > Hence only one such buffer is live per-process, and it can't leak. > Hence location_get_source_line can't leak, but the buffer exposed > to the caller is only valid until the next call to > location_get_source_line. > >> 2016-09-26 Bernd Edlinger >> >> PR preprocessor/77699 >> * input.c (maybe_grow): Don't allocate one byte extra > headroom. >> (get_next_line): Return false on error. >> (read_next_line): Removed, use get_next_line instead. >> (read_line_num): Don't copy the line. >> (location_get_source_line): Don't use static data. >> >> >> Index: gcc/input.c >> === >> --- gcc/input.c (revision 240471) >> +++ gcc/input.c (working copy) >> @@ -432,7 +432,7 @@ maybe_grow (fcache *c) >> return; >> >> size_t size = c->size == 0 ? fcache_buffer_size : c->size * 2; >> - c->data = XRESIZEVEC (char, c->data, size + 1); >> + c->data = XRESIZEVEC (char, c->data, size); >> c->size = size; >> } > > Seems reasonable; I can't see anywhere where an extra byte could get > used. > Yes. It was used only in the memmove which copied one extra byte, but that was set to zero afterwards. > >> @@ -534,7 +534,7 @@ get_next_line (fcache *c, char **line, ssize_t > *li >> } >> >> if (ferror (c->fp)) >> -return -1; >> +return false; > > OK > >> /* At this point, we've found the end of the of line. It either >>points to the '\n' or to one byte after the last byte of the >> @@ -597,36 +597,6 @@ get_next_line (fcache *c, char **line, ssize_t > *li >> return true; >> } >> >> -/* Reads the next line from FILE into *LINE. If *LINE is too small >> - (or NULL) it is allocated (or extended) to have enough space to >> - containe the line. *LINE_LENGTH must contain the size of the >> - initial*LINE buffer. It's then updated by this function to the >> - actual length of the returned line. Note that the returned line >> - can contain several zero bytes. Also note that the returned > string >> - is allocated in static storage that is going to be re-used by >> - subsequent invocations of read_line. */ >> - >> -static bool >> -read_next_line (fcache *cache, char ** line, ssize_t *line_len) >> -{ >> - char *l = NULL; >> - ssize_t len = 0; >> - >> - if (!get_next_line (cache, &l, &len)) >> -return false; >> - >> - if (*line == NULL) >> -*line = XNEWVEC (char, len); >> - else
Re: [PATCH] Fix bootstrap with --enable-languages=all,go
On 30/09/16 23:16, Rainer Orth wrote: > me too, though mostly to have maximum test coverage (primarily on > Solaris). As expected, a x86_64-apple-darwin16 bootstrap with > --enable-objc-gc just failed for me. I'm testing the following patch > (on top of Jakub's). > > Rainer > > > 2016-10-01 Rainer Orth > > * configure.ac (target_libraries): Readd target-boehm-gc. > Restore --enable-objc-gc handling. > * configure: Regenerate. Thanks everybody. My apologies. Andrew.
Re: [PATCH] FALLTHRU markers for sse.md and some cleanups
On Fri, Sep 30, 2016 at 10:17 PM, Jakub Jelinek wrote: > On Thu, Sep 29, 2016 at 06:21:13PM +0200, Marek Polacek wrote: >> On Tue, Sep 27, 2016 at 09:58:20PM +0200, Jakub Jelinek wrote: >> > On Tue, Sep 27, 2016 at 09:29:10PM +0200, Florian Weimer wrote: >> > > Not sure if I read this code correctly, but if we fall through from >> > > V32HImode, and we have TARGET_SSE2 set, we execute this code: >> > > >> > > tmp = "p"; >> > > ssesuffix = TARGET_AVX512VL ? "q" : ""; >> > > >> > > And not gcc_unreachable (), as is probably intended. >> > >> > It really doesn't matter. >> > The instruction uses >> > (define_mode_iterator VI12_AVX_AVX512F >> > [ (V64QI "TARGET_AVX512F") (V32QI "TARGET_AVX") V16QI >> > (V32HI "TARGET_AVX512F") (V16HI "TARGET_AVX") V8HI]) >> > iterator (and, after all, ix86_hard_regno_mode_ok should ensure the same), >> > which means V64QI/V32HI will only show up for TARGET_AVX512F, V32QI/V16HI >> > only for TARGET_AVX (which implies TARGET_SSE2), and the slightly >> > nonsensical >> > gcc_assert (TARGET_SSE2 || TARGET_AVX512VL); >> > before the switch (the || TARGET_AVX512VL is pointless, because >> > TARGET_AVX512VL implies TARGET_SSE2 as well as TARGET_AVX2). >> > So, I'd go perhaps for (untested) following patch, first diff -up, followed >> > by diff -upb: >> >> Looks good, are you going to test/commit it? Or should I? > > Here it is, bootstrapped/regtested on x86_64-linux and i686-linux, ok for > trunk? > > 2016-09-30 Jakub Jelinek > > * config/i386/sse.md (): Add FALLTHRU > comments. Simplify asserts, remove unnecessary conditions. > Formatting fixes. > (*3): Likewise. OK. Thanks, Uros.
Re: [PATCH] Fix -Wimplicit-fallthrough -C, handle some more comment styles and comments in between FALLTHRU comment and label
> See Tom Tromey's explanation why accepting too much is bad (at least unless > we want multiple levels). Tom's changes made to GDB are IMO the perfect examples of what we don't want: - /* ... fall through for unsigned ints ... */ + /* fall through */ -/* For other instructions, fallthru. */ +/* fallthru. */ - /* fall thru to manual case */ + /* fall thru */ So, because of its excessive pickiness, the warning ends up making the user butcher informative comments. How is that helpful? -- Eric Botcazou
Re: [PATCH] Fix (part of) PR77399
/usr/local/gcc/gcc-20161001/gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c:9:10: internal compiler error: in expand_float, at optabs.c:4774 0x40af810f expand_float(rtx_def*, rtx_def*, int) ../../gcc/optabs.c:4774 0x40699f6f expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) ../../gcc/expr.c:8867 0x4067ae4f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:9720 0x4068be5f expand_normal ../../gcc/expr.h:285 0x4068be5f copy_blkmode_to_reg(machine_mode, tree_node*) ../../gcc/expr.c:2716 0x4042e16f expand_return ../../gcc/cfgexpand.c:3516 0x4042e16f expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3618 0x4042e16f expand_gimple_stmt ../../gcc/cfgexpand.c:3745 0x4043145f expand_gimple_basic_block ../../gcc/cfgexpand.c:5752 0x4044006f execute ../../gcc/cfgexpand.c:6363 /daten/aranym/gcc/gcc-20161001/gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c:9:10: internal compiler error: in expand_float, at optabs.c:4774 0x9da792 expand_float(rtx_def*, rtx_def*, int) ../../gcc/optabs.c:4774 0x7b6a86 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) ../../gcc/expr.c:8867 0x7a534b expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:9720 0x7ae0b1 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*) ../../gcc/expr.c:5550 0x7b04e5 expand_assignment(tree_node*, tree_node*, bool) ../../gcc/expr.c:5316 0x6a307c expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3649 0x6a307c expand_gimple_stmt ../../gcc/cfgexpand.c:3745 0x6a4e96 expand_gimple_basic_block ../../gcc/cfgexpand.c:5752 0x6aa806 execute ../../gcc/cfgexpand.c:6363 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Re: [PATCH] Fix -Wimplicit-fallthrough -C, handle some more comment styles and comments in between FALLTHRU comment and label
On Sat, Oct 01, 2016 at 10:49:03AM +0200, Eric Botcazou wrote: > > See Tom Tromey's explanation why accepting too much is bad (at least unless > > we want multiple levels). > > Tom's changes made to GDB are IMO the perfect examples of what we don't want: > > - /* ... fall through for unsigned ints ... */ > + /* fall through */ > > -/* For other instructions, fallthru. */ > +/* fallthru. */ > > - /* fall thru to manual case */ > + /* fall thru */ > > > So, because of its excessive pickiness, the warning ends up making the user > butcher informative comments. How is that helpful? Note, the wast majority of the fallthru comments are already recognized, it is only when people start to write those in free form. E.g. today I wanted to try Marek's testcase from some PR and have commented out [[fallthrough]]; attribute - // [[fallthrough]]; if we are not picky enough, it will be handled as a valid fallthrough comment, which might not be the intent. The more this is discussed, the more I lean towards the multiple levels of the warning, so that projects can choose what exactly they want, starting with only allowing attributes, down to accepting any comments whatsoever. Jakub
Re: [PATCH] Fix PR77407
This introduces an ICE ("bogus comparison result type") on s390 for the following test case: #include void foo(int dim) { int ba, sign; ba = abs (dim); sign = dim / ba; } Doing diff --git a/gcc/match.pd b/gcc/match.pd index ba7e013..2455592 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -158,7 +158,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (div @0 (abs @0)) (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)) && TYPE_OVERFLOW_UNDEFINED (type)) -(cond (lt @0 { build_zero_cst (type); }) +(cond (convert (lt @0 { build_zero_cst (type); })) { build_minus_one_cst (type); } { build_one_cst (type); }))) /* X / -X is -1. */ (simplify fixes the ICE but is that necessary and/or the right thing to do? Regards Robin
[Fortran, Patch, pr77663, v1] libgfortran/caf/single.c: three minor problems and a lost token
Hi all, attached patch fixes some issue in caf/single.c that were reported as pure style issues, but uncovered at least one significant error when handling sending data to a remote image when the memory and associated token was not allocated yet. The send_by_ref-routine stored the new token only on the stack when the component to allocate was scalar which lead to crashes, when that token was later on accessed. Furthermore was the memory and the token lost. This patch fixes the issue. Bootstraps and regtests ok on x86_64-linux/F23. Ok for trunk? Regards, Andre -- Andre Vehreschild * Email: vehre ad gmx dot de gcc/testsuite/ChangeLog: 2016-10-01 Andre Vehreschild * gfortran.dg/coarray_send_by_ref_1.f08: New test. libgfortran/ChangeLog: 2016-10-01 Andre Vehreschild * caf/single.c (caf_internal_error): Fix not terminating va-list. (_gfortran_caf_register): Free memory also when other allocs failed. (_gfortran_caf_get_by_ref): Fixed style. (send_by_ref): Token is now stored at the correct position preventing inaccessible tokens, memory loss and possibly crashes. diff --git a/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 b/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 new file mode 100644 index 000..73f91e0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 @@ -0,0 +1,29 @@ +! { dg-do run } +! { dg-options "-fcoarray=lib -lcaf_single" } + +program check_caf_send_by_ref + + implicit none + + type T +integer, allocatable :: scal +integer, allocatable :: array(:) + end type T + + type(T), save :: obj[*] + integer :: me, np, i + + me = this_image() + np = num_images() + + obj[np]%scal = 42 + + ! Check the token for the scalar is set. + if (obj[np]%scal /= 42) call abort() + + ! Now the same for arrays. + obj[np]%array = [(i * np + me, i = 1, 15)] + if (any(obj[np]%array /= [(i * np + me, i = 1, 15)])) call abort() + +end program check_caf_send_by_ref + diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c index c472446..55171fd 100644 --- a/libgfortran/caf/single.c +++ b/libgfortran/caf/single.c @@ -87,6 +87,7 @@ caf_internal_error (const char *msg, int *stat, char *errmsg, if ((size_t)errmsg_len > len) memset (&errmsg[len], ' ', errmsg_len - len); } + va_end (args); return; } else @@ -149,6 +150,13 @@ _gfortran_caf_register (size_t size, caf_register_t type, caf_token_t *token, if (unlikely (local == NULL || *token == NULL)) { + /* Freeing the memory conditionally seems pointless, but + caf_internal_error () may return, when a stat is given and then the + memory may be lost. */ + if (local) + free (local); + if (*token) + free (*token); caf_internal_error (alloc_fail_msg, stat, errmsg, errmsg_len); return; } @@ -1465,7 +1473,7 @@ _gfortran_caf_get_by_ref (caf_token_t token, bool array_extent_fixed = false; realloc_needed = realloc_required = GFC_DESCRIPTOR_DATA (dst) == NULL; - assert (!realloc_needed || (realloc_needed && dst_reallocatable)); + assert (!realloc_needed || dst_reallocatable); if (stat) *stat = 0; @@ -1909,14 +1917,14 @@ send_by_ref (caf_reference_t *ref, size_t *i, size_t *src_index, GFC_DESCRIPTOR_DATA (&static_dst) = NULL; GFC_DESCRIPTOR_DTYPE (&static_dst) = GFC_DESCRIPTOR_DTYPE (src); - /* The component may be allocated now, because it is a + /* The component can be allocated now, because it is a scalar. */ - single_token = *(caf_single_token_t*) - (ds + ref->u.c.caf_token_offset); _gfortran_caf_register (ref->item_size, CAF_REGTYPE_COARRAY_ALLOC, - (caf_token_t *)&single_token, + ds + ref->u.c.caf_token_offset, &static_dst, stat, NULL, 0); + single_token = *(caf_single_token_t *) + (ds + ref->u.c.caf_token_offset); /* In case of an error in allocation return. When stat is NULL, then register_component() terminates on error. */ if (stat != NULL && *stat) @@ -2005,15 +2013,13 @@ send_by_ref (caf_reference_t *ref, size_t *i, size_t *src_index, /* The size of the array is given by size. */ _gfortran_caf_register (size * ref->item_size, CAF_REGTYPE_COARRAY_ALLOC, - (void **)&single_token, + ds + ref->u.c.caf_token_offset, dst, stat, NULL, 0); /* In case of an error in allocation return. When stat is NULL, then register_component() terminates on error. */ if (stat != NULL && *stat) return; /* The memptr, descriptor and the token are set below. */ - *(caf_single_token_t *)(ds + ref->u.c.caf_token_offset) - = single_token; } single_token = *(caf_single_token_t*)(ds + ref->u.c.caf_token_offset); send_by_ref (ref->next, i, src_index, single_token,
Re: C/C++ PATCH to implement -Wbool-operation (PR c/77490)
On Sat, Oct 01, 2016 at 01:46:02AM +0200, Jakub Jelinek wrote: > On Fri, Sep 23, 2016 at 12:44:22PM +0200, Marek Polacek wrote: > > 2016-09-23 Marek Polacek > > > > PR c/77490 > ... > > * c-c++-common/Wbool-operation-1.c: New test. > > I've noticed this test fails on i686-linux and likely also on powerpc-linux. Sorry. I must remember this when testing sth with vectors... Marek
Re: [Patch 2/11] Implement TARGET_C_EXCESS_PRECISION for i386
On Fri, Sep 30, 2016 at 6:59 PM, James Greenhalgh wrote: > > Hi, > > This patch ports the logic from i386's TARGET_FLT_EVAL_METHOD to the new > target hook TARGET_C_EXCESS_PRECISION. > > Bootstrapped and tested with no issues. > > OK? > > Thanks, > James > > --- > gcc/ > > 2016-09-30 James Greenhalgh > > * config/i386/i386.c (ix86_excess_precision): New. > (TARGET_C_EXCESS_PRECISION): Define. > OK for mainline. Thanks, Uros.
Re: Use version namespace in normal mode
On 30/09/2016 17:40, Jonathan Wakely wrote: On 29/09/16 21:59 +0200, François Dumont wrote: Hi I think _GLIBCXX_BEGIN_NAMESPACE_ALGO should default to _GLIBCXX_BEGIN_NAMESPACE_VERSION when parallel mode is not active. Same for _GLIBCXX_BEGIN_NAMESPACE_CONTAINER, no ? Hmm, yes, I think this is correct, otherwise we're missing the VERSION namespace in normal mode. But it seems we've always been missing it since those macros were introduced in GCC 4.6 so I'd like to investigate the consequences for gnu-versioned-namespace more carefuly. * include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_ALGO) (_GLIBCXX_END_NAMESPACE_ALGO): Default to respectively _GLIBCXX_BEGIN_NAMESPACE_VERSION and _GLIBCXX_END_NAMESPACE_VERSION when parallel mode is not active. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER, _GLIBCXX_END_NAMESPACE_CONTAINER): Likewise. Ok to commit after normal check ? Should I rebuild library with versioned namespace activated ? Any change affecting the NAMESPACE_VERSION macros should be tested with the gnu-versioned-namespace, since those macros are only used for that mode. But it can't be tested currently, see PR 77794. So let's wait until I've fixed 77794, when we can test it. The reason I am proposing this is that if my debug algos patch is applied a lot of algos won't be in versionned namespace anymore. Broken for broken I might apply it even if not really tested, no ?
Re: [Fortran, Patch, pr77663, v1] libgfortran/caf/single.c: three minor problems and a lost token
Hi Andre, It looks fine to me - OK for trunk. Thanks for the patch Paul On 1 October 2016 at 13:30, Andre Vehreschild wrote: > Hi all, > > attached patch fixes some issue in caf/single.c that were reported as pure > style issues, but uncovered at least one significant error when handling > sending > data to a remote image when the memory and associated token was not allocated > yet. The send_by_ref-routine stored the new token only on the stack when the > component to allocate was scalar which lead to crashes, when that token was > later on accessed. Furthermore was the memory and the token lost. This patch > fixes the issue. > > Bootstraps and regtests ok on x86_64-linux/F23. Ok for trunk? > > Regards, > Andre > -- > Andre Vehreschild * Email: vehre ad gmx dot de -- The difference between genius and stupidity is; genius has its limits. Albert Einstein
Re: [PATCH] Fix PR77407
On October 1, 2016 11:47:45 AM GMT+02:00, Robin Dapp wrote: >This introduces an ICE ("bogus comparison result type") on s390 for the >following test case: > >#include > >void foo(int dim) >{ > int ba, sign; > > ba = abs (dim); > sign = dim / ba; >} > > >Doing > >diff --git a/gcc/match.pd b/gcc/match.pd >index ba7e013..2455592 100644 >--- a/gcc/match.pd >+++ b/gcc/match.pd >@@ -158,7 +158,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) >(div @0 (abs @0)) >(if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)) >&& TYPE_OVERFLOW_UNDEFINED (type)) >-(cond (lt @0 { build_zero_cst (type); }) >+(cond (convert (lt @0 { build_zero_cst (type); })) > { build_minus_one_cst (type); } { build_one_cst (type); }))) > /* X / -X is -1. */ > (simplify > >fixes the ICE but is that necessary and/or the right thing to do? No, I have a patch for genmatch in testing that fixes this. Richard. >Regards > Robin
Re: [Fortran, Patch, pr77663, v1] libgfortran/caf/single.c: three minor problems and a lost token
Hi Paul, thanks for the fast review. Committed as r240695. Regards, Andre On Sat, 1 Oct 2016 14:42:35 +0200 Paul Richard Thomas wrote: > Hi Andre, > > It looks fine to me - OK for trunk. > > Thanks for the patch > > Paul > > On 1 October 2016 at 13:30, Andre Vehreschild wrote: > > Hi all, > > > > attached patch fixes some issue in caf/single.c that were reported as pure > > style issues, but uncovered at least one significant error when handling > > sending data to a remote image when the memory and associated token was not > > allocated yet. The send_by_ref-routine stored the new token only on the > > stack when the component to allocate was scalar which lead to crashes, when > > that token was later on accessed. Furthermore was the memory and the token > > lost. This patch fixes the issue. > > > > Bootstraps and regtests ok on x86_64-linux/F23. Ok for trunk? > > > > Regards, > > Andre > > -- > > Andre Vehreschild * Email: vehre ad gmx dot de > > > -- Andre Vehreschild * Email: vehre ad gmx dot de Index: gcc/testsuite/ChangeLog === --- gcc/testsuite/ChangeLog (Revision 240694) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2016-10-01 Andre Vehreschild + + PR fortran/77663 + * gfortran.dg/coarray_send_by_ref_1.f08: New test. + 2016-10-01 Jakub Jelinek PR c/77490 Index: gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 === --- gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 (nicht existent) +++ gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 (Arbeitskopie) @@ -0,0 +1,29 @@ +! { dg-do run } +! { dg-options "-fcoarray=lib -lcaf_single" } + +program check_caf_send_by_ref + + implicit none + + type T +integer, allocatable :: scal +integer, allocatable :: array(:) + end type T + + type(T), save :: obj[*] + integer :: me, np, i + + me = this_image() + np = num_images() + + obj[np]%scal = 42 + + ! Check the token for the scalar is set. + if (obj[np]%scal /= 42) call abort() + + ! Now the same for arrays. + obj[np]%array = [(i * np + me, i = 1, 15)] + if (any(obj[np]%array /= [(i * np + me, i = 1, 15)])) call abort() + +end program check_caf_send_by_ref + Index: libgfortran/ChangeLog === --- libgfortran/ChangeLog (Revision 240694) +++ libgfortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,12 @@ +2016-10-01 Andre Vehreschild + + PR fortran/77663 + * caf/single.c (caf_internal_error): Fix not terminating va-list. + (_gfortran_caf_register): Free memory also when other allocs failed. + (_gfortran_caf_get_by_ref): Fixed style. + (send_by_ref): Token is now stored at the correct position preventing + inaccessible tokens, memory loss and possibly crashes. + 2016-09-28 Jerry DeLisle PR libgfortran/77707 Index: libgfortran/caf/single.c === --- libgfortran/caf/single.c (Revision 240694) +++ libgfortran/caf/single.c (Arbeitskopie) @@ -87,6 +87,7 @@ if ((size_t)errmsg_len > len) memset (&errmsg[len], ' ', errmsg_len - len); } + va_end (args); return; } else @@ -149,6 +150,13 @@ if (unlikely (local == NULL || *token == NULL)) { + /* Freeing the memory conditionally seems pointless, but + caf_internal_error () may return, when a stat is given and then the + memory may be lost. */ + if (local) + free (local); + if (*token) + free (*token); caf_internal_error (alloc_fail_msg, stat, errmsg, errmsg_len); return; } @@ -1465,7 +1473,7 @@ bool array_extent_fixed = false; realloc_needed = realloc_required = GFC_DESCRIPTOR_DATA (dst) == NULL; - assert (!realloc_needed || (realloc_needed && dst_reallocatable)); + assert (!realloc_needed || dst_reallocatable); if (stat) *stat = 0; @@ -1909,14 +1917,14 @@ GFC_DESCRIPTOR_DATA (&static_dst) = NULL; GFC_DESCRIPTOR_DTYPE (&static_dst) = GFC_DESCRIPTOR_DTYPE (src); - /* The component may be allocated now, because it is a + /* The component can be allocated now, because it is a scalar. */ - single_token = *(caf_single_token_t*) - (ds + ref->u.c.caf_token_offset); _gfortran_caf_register (ref->item_size, CAF_REGTYPE_COARRAY_ALLOC, - (caf_token_t *)&single_token, + ds + ref->u.c.caf_token_offset, &static_dst, stat, NULL, 0); + single_token = *(caf_single_token_t *) + (ds + ref->u.c.caf_token_offset); /* In case of an error in allocation return. When stat is NULL, then register_component() terminates on error. */ if (stat != NULL && *stat) @@ -2005,15 +2013,12 @@ /* The size of the array is given by size. */ _gfortran_caf_register (size * ref->item_size, CAF_REGTYPE_COARRAY_ALLOC, - (void **)&single_token, +
[PATCH] Fix PR77789
This fixes a type error. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2016-10-01 Richard Biener PR middle-end/77798 * genmatch.c (get_operand_type): Add operand position arg and handle COND_EXPR comparison operand with fixed boolean_type_node. (expr::gen_transform): Adjust. (dt_simplify::gen_1): Likewise. * gfortran.fortran-torture/compile/pr77798.f90: New testcase. Index: gcc/genmatch.c === --- gcc/genmatch.c (revision 240647) +++ gcc/genmatch.c (working copy) @@ -2216,11 +2216,12 @@ is_conversion (id_base *op) || *op == VIEW_CONVERT_EXPR); } -/* Get the type to be used for generating operands of OP from the +/* Get the type to be used for generating operand POS of OP from the various sources. */ static const char * -get_operand_type (id_base *op, const char *in_type, +get_operand_type (id_base *op, unsigned pos, + const char *in_type, const char *expr_type, const char *other_oprnd_type) { @@ -2235,6 +2236,9 @@ get_operand_type (id_base *op, const cha else if (is_a (op) && strcmp (as_a (op)->tcc, "tcc_comparison") == 0) return other_oprnd_type; + else if (*op == COND_EXPR + && pos == 0) +return "boolean_type_node"; else { /* Otherwise all types should match - choose one in order of @@ -2319,7 +2323,7 @@ expr::gen_transform (FILE *f, int indent char dest[32]; snprintf (dest, 32, "ops%d[%u]", depth, i); const char *optype - = get_operand_type (opr, in_type, expr_type, + = get_operand_type (opr, i, in_type, expr_type, i == 0 ? NULL : op0type); ops[i]->gen_transform (f, indent, dest, gimple, depth + 1, optype, cinfo, indexes, @@ -3157,7 +3169,7 @@ dt_simplify::gen_1 (FILE *f, int indent, char dest[32]; snprintf (dest, 32, "res_ops[%d]", j); const char *optype - = get_operand_type (opr, + = get_operand_type (opr, j, "type", e->expr_type, j == 0 ? NULL : "TREE_TYPE (res_ops[0])"); /* We need to expand GENERIC conditions we captured from @@ -3247,7 +3273,7 @@ dt_simplify::gen_1 (FILE *f, int indent, snprintf (dest, 32, "res_op%d", j); } const char *optype - = get_operand_type (opr, + = get_operand_type (opr, j, "type", e->expr_type, j == 0 ? NULL : "TREE_TYPE (res_op0)"); Index: gcc/testsuite/gfortran.fortran-torture/compile/pr77798.f90 === --- gcc/testsuite/gfortran.fortran-torture/compile/pr77798.f90 (revision 0) +++ gcc/testsuite/gfortran.fortran-torture/compile/pr77798.f90 (working copy) @@ -0,0 +1,17 @@ +subroutine foo(self,value) +integer(kind=kind(1)), dimension(:) :: self +integer(kind=kind(1)), intent(in) :: value +integer(kind=kind(1)) :: x,y,sign +intent(inout) :: self +integer(kind=kind(1)) :: len,i + +len = size(self) +do i = 1,len + x = self(i) + if (x==0.0d0) cycle + y = abs(x) + sign = x/y + self(i) = sign*min(value,y) +end do + +end subroutine
Re: C/C++ PATCH to implement -Wpointer-compare warning (PR c++/64767)
On Fri, Sep 30, 2016 at 05:48:03PM -0400, Jason Merrill wrote: > On Fri, Sep 30, 2016 at 12:43 PM, Marek Polacek wrote: > > On Fri, Sep 23, 2016 at 10:31:33AM -0400, Jason Merrill wrote: > >> On Fri, Sep 23, 2016 at 9:15 AM, Marek Polacek wrote: > >> > On Wed, Sep 21, 2016 at 03:52:09PM -0400, Jason Merrill wrote: > >> >> On Mon, Sep 19, 2016 at 2:49 PM, Jason Merrill wrote: > >> >> > I suppose that an INTEGER_CST of character type is necessarily a > >> >> > character constant, so adding a check for !char_type_p ought to do the > >> >> > trick. > >> >> > >> >> Indeed it does. I'm checking this in: > >> > > >> > Nice, thanks. What about the original patch? We still need to warn > >> > (or error for C++11) for pointer comparisons. > >> > >> If we still accept pointer comparisons in C++, that's another bug with > >> treating \0 as a null pointer constant. This seems to be because > >> ocp_convert of \0 to int produces an INTEGER_CST indistinguishable > >> from literal 0. > > > > I was trying to fix this in ocp_convert, by using NOP_EXPRs, but that wasn't > > successful. But since we're interested in ==/!=, I think this can be fixed > > easily in cp_build_binary_op. Actually, all that seems to be needed is > > using > > orig_op as the argument to null_ptr_cst_p, but that wouldn't give the > > correct > > diagnostics, so I did this. By checking orig_op we can see if the operands > > are > > character literals or not, because orig_op is an operand before the default > > conversions. > > What is wrong about the diagnostic from just using orig_op? "ISO C++ > forbids comparison between pointer and integer" seems fine to me, and > will help the user to realize that they need to index off the pointer. > > I see that some of the calls to null_ptr_cst_p in cp_build_binary_op > have already been changed to check orig_op*, but not all. Let's > update the remaining calls, that should do the trick without adding a > new error. Here you go: Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk? 2016-10-01 Marek Polacek Core 903 * typeck.c (cp_build_binary_op): Pass original operands to null_ptr_cst_p, not those after the default conversions. * g++.dg/cpp0x/nullptr37.C: New test. diff --git gcc/cp/typeck.c gcc/cp/typeck.c index 617ca55..8b780be 100644 --- gcc/cp/typeck.c +++ gcc/cp/typeck.c @@ -4573,7 +4573,7 @@ cp_build_binary_op (location_t location, || code1 == COMPLEX_TYPE || code1 == ENUMERAL_TYPE)) short_compare = 1; else if (((code0 == POINTER_TYPE || TYPE_PTRDATAMEM_P (type0)) - && null_ptr_cst_p (op1)) + && null_ptr_cst_p (orig_op1)) /* Handle, eg, (void*)0 (c++/43906), and more. */ || (code0 == POINTER_TYPE && TYPE_PTR_P (type1) && integer_zerop (op1))) @@ -4587,7 +4587,7 @@ cp_build_binary_op (location_t location, warn_for_null_address (location, op0, complain); } else if (((code1 == POINTER_TYPE || TYPE_PTRDATAMEM_P (type1)) - && null_ptr_cst_p (op0)) + && null_ptr_cst_p (orig_op0)) /* Handle, eg, (void*)0 (c++/43906), and more. */ || (code1 == POINTER_TYPE && TYPE_PTR_P (type0) && integer_zerop (op0))) @@ -4604,7 +4604,7 @@ cp_build_binary_op (location_t location, || (TYPE_PTRDATAMEM_P (type0) && TYPE_PTRDATAMEM_P (type1))) result_type = composite_pointer_type (type0, type1, op0, op1, CPO_COMPARISON, complain); - else if (null_ptr_cst_p (op0) && null_ptr_cst_p (op1)) + else if (null_ptr_cst_p (orig_op0) && null_ptr_cst_p (orig_op1)) /* One of the operands must be of nullptr_t type. */ result_type = TREE_TYPE (nullptr_node); else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) @@ -4623,7 +4623,7 @@ cp_build_binary_op (location_t location, else return error_mark_node; } - else if (TYPE_PTRMEMFUNC_P (type0) && null_ptr_cst_p (op1)) + else if (TYPE_PTRMEMFUNC_P (type0) && null_ptr_cst_p (orig_op1)) { if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta) @@ -4664,7 +4664,7 @@ cp_build_binary_op (location_t location, } result_type = TREE_TYPE (op0); } - else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (op0)) + else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (orig_op0)) return cp_build_binary_op (location, code, op1, op0, complain); else if (TYPE_PTRMEMFUNC_P (type0) && TYPE_PTRMEMFUNC_P (type1)) { @@ -4877,21 +4877,21 @@ cp_build_binary_op (location_t location, else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) result_type = composite_pointer_type (type0, type1, op0, op1, CPO_COMPARISON, complain); - else if (
Re: PATCH to fix bogus -Wimplicit-fallthrough warning (PR c++/77803)
On Sat, Oct 01, 2016 at 07:17:50AM +0200, Markus Trippelsdorf wrote: > On 2016.09.30 at 23:31 +0200, Marek Polacek wrote: > > This PR reports a bogus -Wimplicit-fallthrough warning on the attached test. > > The problem is that last_stmt_in_scope should for GIMPLE_TRY, if the last > > statement of the eval part can't fallthrough, return this statement and > > don't > > warn. And the same should be true for FALLTHROUGH (). This patch fixes > > it. > > > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > Try to compile the testcase without the fallthrough attribute... Nuts. Forgot that gimple_call_internal_p doesn't handle NULL. Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk? 2016-10-01 Marek Polacek PR c++/77803 * gimplify.c (last_stmt_in_scope): Add check for FALLTHROUGH (). * g++.dg/warn/Wimplicit-fallthrough-1.C: New test. diff --git gcc/gimplify.c gcc/gimplify.c index 66bb8be..a60d947 100644 --- gcc/gimplify.c +++ gcc/gimplify.c @@ -1687,6 +1687,8 @@ last_stmt_in_scope (gimple *stmt) stmt = gimple_seq_last_stmt (gimple_try_eval (try_stmt)); gimple *last_eval = last_stmt_in_scope (stmt); if (gimple_stmt_may_fallthru (last_eval) + && (last_eval == NULL + || !gimple_call_internal_p (last_eval, IFN_FALLTHROUGH)) && gimple_try_kind (try_stmt) == GIMPLE_TRY_FINALLY) { stmt = gimple_seq_last_stmt (gimple_try_cleanup (try_stmt)); diff --git gcc/testsuite/g++.dg/warn/Wimplicit-fallthrough-1.C gcc/testsuite/g++.dg/warn/Wimplicit-fallthrough-1.C index e69de29..053ed68 100644 --- gcc/testsuite/g++.dg/warn/Wimplicit-fallthrough-1.C +++ gcc/testsuite/g++.dg/warn/Wimplicit-fallthrough-1.C @@ -0,0 +1,33 @@ +// PR c++/77803 +// { dg-do compile { target c++11 } } +// { dg-options "-Wimplicit-fallthrough" } + +struct A {}; +int a; + +void +fn1 () +{ + switch (0) { + case 0: + { +A b; +[[fallthrough]]; + } + default: +a = 0; + } +} + +void +fn2 () +{ + switch (0) { + case 0: + { +A b; // { dg-warning "statement may fall through" } + } + default: +a = 0; + } +} Marek
Re: [PATCH] Fix (part of) PR77399
On Sat, 1 Oct 2016, Andreas Schwab wrote: > /usr/local/gcc/gcc-20161001/gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c:9:10: > internal compiler error: in expand_float, at optabs.c:4774 > 0x40af810f expand_float(rtx_def*, rtx_def*, int) > ../../gcc/optabs.c:4774 > 0x40699f6f expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, > expand_modifier) > ../../gcc/expr.c:8867 > 0x4067ae4f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > ../../gcc/expr.c:9720 > 0x4068be5f expand_normal > ../../gcc/expr.h:285 > 0x4068be5f copy_blkmode_to_reg(machine_mode, tree_node*) > ../../gcc/expr.c:2716 > 0x4042e16f expand_return > ../../gcc/cfgexpand.c:3516 > 0x4042e16f expand_gimple_stmt_1 > ../../gcc/cfgexpand.c:3618 > 0x4042e16f expand_gimple_stmt > ../../gcc/cfgexpand.c:3745 > 0x4043145f expand_gimple_basic_block > ../../gcc/cfgexpand.c:5752 > 0x4044006f execute > ../../gcc/cfgexpand.c:6363 > > /daten/aranym/gcc/gcc-20161001/gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c:9:10: > internal compiler error: in expand_float, at optabs.c:4774 > 0x9da792 expand_float(rtx_def*, rtx_def*, int) > ../../gcc/optabs.c:4774 > 0x7b6a86 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, > expand_modifier) > ../../gcc/expr.c:8867 > 0x7a534b expand_expr_real_1(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > ../../gcc/expr.c:9720 > 0x7ae0b1 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, > tree_node*) > ../../gcc/expr.c:5550 > 0x7b04e5 expand_assignment(tree_node*, tree_node*, bool) > ../../gcc/expr.c:5316 > 0x6a307c expand_gimple_stmt_1 > ../../gcc/cfgexpand.c:3649 > 0x6a307c expand_gimple_stmt > ../../gcc/cfgexpand.c:3745 > 0x6a4e96 expand_gimple_basic_block > ../../gcc/cfgexpand.c:5752 > 0x6aa806 execute > ../../gcc/cfgexpand.c:6363 Which architecture? Richard.
Re: Fix PR tree-optimization/77808, ICE in duplicate_ssa_name_ptr_info, at tree-ssanames.c:630 starting with r240439
Hi Doug, On 1 October 2016 at 03:35, Doug Gilmore wrote: > My commit r240439 didn't handle the situation where setting > --param prefetch-latency=0 can cause the prefetch address to > be the same as the original address. In this case, no > copying of points-to information should be done. > > Bootstrapped and regression tested on x86_64-linux, ok for > trunk? > > Doug I can confirm that your patch fixes the ICE I was seeing. However, the new testcase does not pass on low end architectures: cc1: warning: -fprefetch-loop-arrays not supported for this target (try -march switches) Can you add a guard? Thanks, Christophe
Re: [PATCH] Fix PR77407
On Wed, 28 Sep 2016, Richard Biener wrote: --- gcc/match.pd(revision 240565) +++ gcc/match.pd(working copy) @@ -147,12 +147,25 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (op @0 integer_onep) (non_lvalue @0))) -/* X / -1 is -X. */ (for div (trunc_div ceil_div floor_div round_div exact_div) + /* X / -1 is -X. */ (simplify (div @0 integer_minus_onep@1) (if (!TYPE_UNSIGNED (type)) -(negate @0 +(negate @0))) + /* X / abs (X) is X < 0 ? -1 : 1. */ + (simplify + (div @0 (abs @0)) Should this be div:C ? + (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)) + && TYPE_OVERFLOW_UNDEFINED (type)) +(cond (lt @0 { build_zero_cst (type); }) + { build_minus_one_cst (type); } { build_one_cst (type); }))) How does that work for vectors? It ICEs for me at revision 240696 typedef int vec __attribute__((vector_size(16))); vec f(vec x){ vec y=(x<0)?-x:x; return x/y; } (I wasn't sure if you had added a feature to turn cond into vec_cond automatically in some cases) -- Marc Glisse
Re: [PATCH] Fix (part of) PR77399
On Okt 01 2016, Richard Biener wrote: > Which architecture? http://gcc.gnu.org/ml/gcc-testresults/2016-10/msg00021.html http://gcc.gnu.org/ml/gcc-testresults/2016-10/msg00049.html Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
[PATCH] Remove .jcr registry from the crtfiles
Hi! Now that GCJ is gone, I think we should remove the the tests for .jcr sections from the crtfiles, which slows down (by a couple of instructions and some relocations) every gcc compiled binary/library. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2016-10-01 Jakub Jelinek gcc/ * defaults.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Remove. * doc/tm.texi.in (TARGET_USE_JCR_SECTION): Remove. * doc/tm.texi: Regenerated. * config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Remove. * config/i386/cygming.h (TARGET_USE_JCR_SECTION): Remove. * config/darwin.h (JCR_SECTION_NAME): Remove. * config/pa/pa64-hpux.h (JCR_SECTION_NAME): Remove. * config/rs6000/aix71.h (TARGET_USE_JCR_SECTION): Remove. * config/rs6000/aix51.h (TARGET_USE_JCR_SECTION): Remove. * config/rs6000/aix52.h (TARGET_USE_JCR_SECTION): Remove. * config/rs6000/aix53.h (TARGET_USE_JCR_SECTION): Remove. * config/rs6000/aix61.h (TARGET_USE_JCR_SECTION): Remove. gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Don't define __LIBGCC_JCR_SECTION_NAME__. libgcc/ * config/i386/cygming-crtbegin.c (_Jv_RegisterClasses): Remove. (__JCR_LIST__): Remove. (__gcc_register_frame): Don't attempt to _Jv_RegisterClasses. * config/i386/cygming-crtend.c (__JCR_END__): Remove. * config/ia64/crtbegin.S (__JCR_LIST__): Remove. * config/ia64/crtend.S (__JCR_END__): Remove. * crtstuff.c: Remove __LIBGCC_JCR_SECTION_NAME__ from preprocessor conditionals. (__JCR_LIST__, __JCR_END__): Remove. (frame_dummy): Don't attempt to _Jv_RegisterClasses. (__do_global_ctors_1): Likewise. --- gcc/config/i386/mingw32.h.jj2016-05-20 09:05:08.836063467 +0200 +++ gcc/config/i386/mingw32.h 2016-10-01 18:55:14.646199686 +0200 @@ -239,9 +239,6 @@ do { \ #undef TARGET_N_FORMAT_TYPES #define TARGET_N_FORMAT_TYPES 3 -/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */ -#undef TARGET_USE_JCR_SECTION - #define HAVE_ENABLE_EXECUTE_STACK #undef CHECK_EXECUTE_STACK_ENABLED #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable --- gcc/config/i386/cygming.h.jj2016-09-27 09:46:13.0 +0200 +++ gcc/config/i386/cygming.h 2016-10-01 18:56:16.133441952 +0200 @@ -443,11 +443,6 @@ do { \ #endif /* HAVE_GAS_WEAK */ -/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true, - but for .jcr section to work we also need crtbegin and crtend - objects. */ -#define TARGET_USE_JCR_SECTION 1 - /* Decide whether it is safe to use a local alias for a virtual function when constructing thunks. */ #undef TARGET_USE_LOCAL_THUNK_ALIAS_P --- gcc/config/darwin.h.jj 2016-09-15 13:39:14.518013115 +0200 +++ gcc/config/darwin.h 2016-10-01 18:55:40.056886539 +0200 @@ -825,9 +825,6 @@ enum machopic_addr_class { #define EH_FRAME_SECTION_NAME "__TEXT" #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support" -/* Java runtime class list. */ -#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip" - #undef ASM_PREFERRED_EH_DATA_FORMAT #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ (((CODE) == 2 && (GLOBAL) == 1) \ --- gcc/config/pa/pa64-hpux.h.jj2016-04-08 19:19:23.894042211 +0200 +++ gcc/config/pa/pa64-hpux.h 2016-10-01 18:55:35.171946738 +0200 @@ -170,8 +170,6 @@ along with GCC; see the file COPYING3. #define DATA_SECTION_ASM_OP"\t.data" #define BSS_SECTION_ASM_OP "\t.section\t.bss" -#define JCR_SECTION_NAME ".jcr" - #define HP_INIT_ARRAY_SECTION_ASM_OP "\t.section\t.init" #define GNU_INIT_ARRAY_SECTION_ASM_OP "\t.section\t.init_array" #define HP_FINI_ARRAY_SECTION_ASM_OP "\t.section\t.fini" @@ -382,8 +380,8 @@ do { \ initializers specified here. */ /* We need to add frame_dummy to the initializer list if EH_FRAME_SECTION_NAME - or JCR_SECTION_NAME is defined. */ -#if defined(EH_FRAME_SECTION_NAME) || defined(JCR_SECTION_NAME) + is defined. */ +#if defined(EH_FRAME_SECTION_NAME) #define PA_INIT_FRAME_DUMMY_ASM_OP ".dword P%frame_dummy" #else #define PA_INIT_FRAME_DUMMY_ASM_OP "" --- gcc/config/rs6000/aix71.h.jj2016-01-21 21:28:01.218834652 +0100 +++ gcc/config/rs6000/aix71.h 2016-10-01 18:55:49.667768100 +0200 @@ -210,8 +210,6 @@ extern long long intatoll(const char /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION, but does not have crtbegin/end. */ -#define TARGET_USE_JCR_SECTION 0 - #define TARGET_AIX_VERSION 71 /* AIX 7.1 supports DWARF3 debugging, but XCOFF remains the default. */ --- gcc/config/rs6000/aix51.h.jj2016-06-20 10:30:35.629607920 +0200 +++ gcc/config/rs6000/aix51.h 2016-10-01 18:55:51.659743552 +0200 @@
Re: [BUILDROBOT] dwarf2out_do_cfi_startproc(bool)’: may write a terminating nul past the end of the destination
On Fri, Sep 30, 2016 at 08:59:52PM +0200, Jakub Jelinek wrote: > Ok if it passes bootstrap/regtest? Passed bootstrap/regtest on x86_64-linux and i686-linux. > > 2016-09-30 Jakub Jelinek > > * dwarf2out.c (output_fde, output_call_frame_info, > dwarf2out_do_cfi_startproc, set_indirect_string, > gen_internal_sym, output_die, output_line_info): Use > MAX_ARTIFICIAL_LABEL_BYTES as char array sizes for > ASM_GENERATE_INTERNAL_LABEL output. Jakub
Re: [PATCH] Remove .jcr registry from the crtfiles
* Jakub Jelinek: > Now that GCJ is gone, I think we should remove the the tests for .jcr > sections from the crtfiles, which slows down (by a couple of instructions > and some relocations) every gcc compiled binary/library. Why were they needed *in every DSO* in the first place? We still have _ITM_registerTMCloneTable, _ITM_deregisterTMCloneTable, and __gmon_start__ on amd64, which don't look terribly relevant for most users, either.
Re: [PATCH] Remove .jcr registry from the crtfiles
On Sat, Oct 01, 2016 at 10:46:53PM +0200, Florian Weimer wrote: > * Jakub Jelinek: > > > Now that GCJ is gone, I think we should remove the the tests for .jcr > > sections from the crtfiles, which slows down (by a couple of instructions > > and some relocations) every gcc compiled binary/library. > > Why were they needed *in every DSO* in the first place? They aren't strictly needed, I guess it would be possible to add additional crt files for the various compilation modes (-fgnu-tm, in the past linking with gcj driver, etc.) and do the registration only there. But it is actually implemented in the shared crt files, by looking at the section sizes and testing weak undef function symbols. > We still have _ITM_registerTMCloneTable, _ITM_deregisterTMCloneTable, > and __gmon_start__ on amd64, which don't look terribly relevant for > most users, either. Jakub