Re: [PATCH] improve string find algorithm

2017-01-06 Thread Jonathan Wakely
On 06/01/17 08:42 -0600, Aditya Kumar wrote: Yes, we do. Sorry for the mistake, it happened because I first wrote this for libcxx (https://reviews.llvm.org/D27068) and while porting that line got missed. Thanks, -Aditya diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/inc

Re: [PATCH] improve string find algorithm

2017-01-06 Thread Jonathan Wakely
On 06/01/17 13:35 +, Jonathan Wakely wrote: I'm surprised we don't have any tests for this case, but apparently we don't, as your patch passes all our tests. My bad, we do have tests that FAIL with this patch, but only after a 'make clean' (otherwise the explicit instantiation definitions i

RE: [PATCH] improve string find algorithm

2017-01-06 Thread Aditya Kumar
Thanks for the correction and updating the comments. -Aditya -Original Message- From: Jonathan Wakely [mailto:jwak...@redhat.com] Sent: Friday, January 06, 2017 2:21 PM To: Aditya Kumar Cc: libstd...@gcc.gnu.org; gcc-patches@gcc.gnu.org; hiradi...@msn.com Subject: Re: [PATCH] improve stri

Re: [PATCH] improve string find algorithm

2017-01-06 Thread Jonathan Wakely
On 06/01/17 14:34 -0600, Aditya Kumar wrote: Thanks for the correction and updating the comments. Could you try the corrected patch on your benchmarks? The performance with the patch is worse for the first string::find benchmark in our testsuite: s = "aabbaabbaaxd adbffdadgaxaabbbddhatyb

Re: [PATCH] avoid false positives due to signed to unsigned conversion (PR 78973)

2017-01-06 Thread Jeff Law
On 01/05/2017 02:53 PM, Martin Sebor wrote: When the size passed to a call to a function like memcpy is a signed integer whose range has a negative lower bound and a positive upper bound the lower bound of the range of the argument after conversion to size_t may be in excess of the maximum object

Re: [bootstrap-O1] change value type to avoid sprintf buffer size warning

2017-01-06 Thread Georg-Johann Lay
Alexandre Oliva schrieb: On Jan 4, 2017, Martin Sebor wrote: The manual recommends to use a length modifier to constrain the length of output to that of a narrower type: sprintf (xname, "", ((unsigned short)((uintptr_t)(t) & 0x))); This should work even without optimization. It

Re: [PATCH, GCC/testsuite/ARM, ping] Skip optional_mthumb tests if GCC has a default mode

2017-01-06 Thread Jeff Law
On 01/03/2017 10:19 AM, Thomas Preudhomme wrote: Ping? Best regards, Generic parts seem fine to me. They may be a bit specific to arm right now, but we can generalize as needed in the future. jeff

Re: [PATCH][M68K] allow long offsets in jump tables (wrong-code PR target/57583)

2017-01-06 Thread Jeff Law
On 01/06/2017 12:52 PM, Mikael Pettersson wrote: 2017-01-06 Mikael Pettersson PR target/57583 * config/m68k/m68k.opt (LONG_JUMP_TABLE_OFFSETS): New option. * config/m68k/linux.h (ASM_RETURN_CASE_JUMP): Handle TARGET_LONG_JUMP_TABLE_OFFSETS. * config/m68

Re: [PATCH] improve string find algorithm

2017-01-06 Thread Jonathan Wakely
On 06/01/17 20:32 +, Jonathan Wakely wrote: On 06/01/17 13:35 +, Jonathan Wakely wrote: I'm surprised we don't have any tests for this case, but apparently we don't, as your patch passes all our tests. My bad, we do have tests that FAIL with this patch, but only after a 'make clean' (o

[IPA PATCH] Refactor decl localizing

2017-01-06 Thread Nathan Sidwell
This patch refactors the decl localizing that happens in function_and_variable_visibility. It doesn't fix the bug I'm working on (that's next). Both the FOR_EACH_FUNCTION and FOR_EACH_VARIABLE loops contain very similar, but not quite the same code for localizing a definition that it's deter

Re: [PATCH] improve string find algorithm

2017-01-06 Thread Aditya K
> Could you try the corrected patch on your benchmarks? For the test-case you gave there is a regression. Benchmark    Time   CPU      Iterations --- Without th

<    1   2