[PATCH][PING][sanitizer/106558] asan: fix unsafe optimization of Asan checks.

2022-11-21 Thread Yuri Gribov via Gcc-patches
on bootstrap-asan) so I decided to skip the more complicated alias oracle-based approach that was suggested by Jakub in the PR. Best regards, Yuri From 4729f2db3f1b6b40ef0124e4a645788d7f66f426 Mon Sep 17 00:00:00 2001 From: Yuri Gribov Date: Sun, 14 Aug 2022 08:42:44 +0300 Subject: [PATCH] asan: fix uns

[PATCH][sanitizer/106558] asan: fix unsafe optimization of Asan checks.

2022-09-05 Thread Yuri Gribov via Gcc-patches
rap-asan) so I decided to skip the more complicated alias oracle-based approach that was suggested by Jakub in the PR. Best regards, Yuri From 3aebd2adc30e164065327c7d3820ad98fe59cad8 Mon Sep 17 00:00:00 2001 From: Yuri Gribov Date: Sun, 14 Aug 2022 08:42:44 +0300 Subject: [PATCH] asan: fix uns

[PATCH][PR 87633] Do not generate unordered integer comparisons

2018-10-21 Thread Yuri Gribov
Hi all, My recent patch which replaced (float_type)int_var1 CMP (float_type)int_var2 with int_var1 CMP int_var2 may generate unordered comparisons of integer values which are both unnecessary and may also upset later passes. This patch fixes the problem and bootstraps without regressions on x

Re: [PATCHv3][PR 81376] Remove unnecessary float casts in comparisons

2018-10-05 Thread Yuri Gribov
On Wed, Oct 3, 2018 at 5:11 PM Jeff Law wrote: snip > OK. You've got commit privileges, right? Yup, will commit myself. -I

[PATCHv3][PR 81376][PING] Remove unnecessary float casts in comparisons

2018-10-02 Thread Yuri Gribov
Hi all, This is a second iteration of patch which gets rid of float casts in comparisons when all values of casted integral type are exactly representable by the float type (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376). The new version addresses issue spotted by Richard in previous version

[PATCHv3][PR 81376] Remove unnecessary float casts in comparisons

2018-09-17 Thread Yuri Gribov
Hi all, This is a second iteration of patch which gets rid of float casts in comparisons when all values of casted integral type are exactly representable by the float type (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376). The new version addresses issue spotted by Richard in previous version

[PATCHv2] PR 85822 - Fix handling of negative constants

2018-05-20 Thread Yuri Gribov
On Sun, May 20, 2018 at 1:01 PM, Alexander Monakov wrote: > On Sun, 20 May 2018, Yuri Gribov wrote: > >> Hi all, >> >> This fixes PR 85822 by removing incorrect reversal of condition in VRP >> assertion. Bootstrapped and regtested on x86_64. >> >> Ok f

[PATCH] PR 85822 - Fix handling of negative constants

2018-05-20 Thread Yuri Gribov
Hi all, This fixes PR 85822 by removing incorrect reversal of condition in VRP assertion. Bootstrapped and regtested on x86_64. Ok for trunk? -Y pr85822-1.patch Description: Binary data

Re: [PATCHv2][PR 81376] Remove unnecessary float casts in comparisons

2018-02-19 Thread Yuri Gribov
On Sun, Feb 18, 2018 at 8:46 PM, Jeff Law wrote: > On 02/18/2018 11:52 AM, Yuri Gribov wrote: >> Hi all, >> >> This is a second iteration of patch which gets rid of float casts in >> comparisons when all values of casted integral type are exactly >> represen

[PATCHv2][PR 81376] Remove unnecessary float casts in comparisons

2018-02-18 Thread Yuri Gribov
Hi all, This is a second iteration of patch which gets rid of float casts in comparisons when all values of casted integral type are exactly representable by the float type (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376). The new version addresses Richard's review (https://gcc.gnu.org/ml/gcc-

[PATCH][PING][PR 81376] Remove unnecessary float casts in comparisons

2017-10-09 Thread Yuri Gribov
Hi all, This patch gets rid of float casts in comparisons when all values of casted integral type are exactly representable by the float type (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376). Bootstrapped and regtested on x64_64. Ok to commit? -Y pr81376-1.patch Description: Binary data

[PATCH][PR 81376] Remove unnecessary float casts in comparisons

2017-10-01 Thread Yuri Gribov
Hi all, (Previous mail was sent with spurious HTML, sorry!) This patch gets rid of float casts in comparisons when all values of casted integral type are exactly representable by the float type (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376). Bootstrapped and regtested on x64_64. Ok to comm

[PR middle-end/82319] Fix ICE in pattern

2017-09-26 Thread Yuri Gribov
Hi all, This patch fixes a trivial ICE in recent pattern. Bootstrapped and regtested on x86_64. Ok to commit? -Y pr82319-1.patch Description: Binary data

Re: [PATCH] Introduce TARGET_SUPPORTS_ALIASES

2017-07-31 Thread Yuri Gribov
On Mon, Jul 31, 2017 at 9:04 AM, Martin Liška wrote: > Hi. > > Doing the transformation suggested by Honza. > > Patch can bootstrap on ppc64le-redhat-linux and x86_64-linux-gnu and survives > regression tests. > And I also verified that works on hppa2.0w-hp-hpux11.11 (target w/o aliasing > suppo

Re: [PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons

2017-07-27 Thread Yuri Gribov
On Tue, Jul 25, 2017 at 9:32 PM, Jeff Law wrote: > On 07/25/2017 08:10 AM, Richard Biener wrote: >> On Mon, Jul 17, 2017 at 9:29 AM, Yuri Gribov wrote: >>> Hi all, >>> >>> This is an updated version of patch in >>> https://gcc.gnu.org/ml/gc

Re: [PATCH] Improve extraction of changed file in contrib/mklog

2017-07-27 Thread Yuri Gribov
On Wed, Jul 26, 2017 at 6:11 PM, Jeff Law wrote: > On 07/09/2017 01:03 PM, Yuri Gribov wrote: >> Hi, >> >> Currently mklog will fail to analyze lines like this in patches: >> diff -rupN gcc/gcc/testsuite/lib/profopt.exp >> gcc-compare-checks/gcc/testsuite/lib/pro

Re: [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520).

2017-07-24 Thread Yuri Gribov
On Mon, Jul 24, 2017 at 1:52 PM, Martin Liška wrote: > Hi. > > The patch fixed PR mentioned in subject of this email. We should not call the > transformation > on targets that do not support aliases. > > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. > Apart from that,

[PATCHv2][PR 59521] Respect __builtin_expect in switch statements

2017-07-20 Thread Yuri Gribov
Hi all, This patch adds support for __builtin_expect in switch statements at tree level (RTL part would be reviewed/commited separately). It's an update of https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01016.html , rebased and retested. Ok for trunk? -Y pr59521-2.patch Description: Binary dat

Re: [PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-20 Thread Yuri Gribov
On Thu, Jul 20, 2017 at 8:41 PM, Steven Bosscher wrote: > On Tue, Jul 18, 2017 at 9:04 AM, Yuri Gribov wrote: >> Hi all, >> >> Currently all cases in switch statement are treated as having equal >> probabilities which causes suboptimal code as demonstrated in >

Re: [PATCH v2] Add no_tail_call attribute

2017-07-19 Thread Yuri Gribov
On Wed, Jul 19, 2017 at 8:19 PM, Alexander Monakov wrote: > On Wed, 19 Jul 2017, Yuri Gribov wrote: >> So to reiterate, your logic here is that someone would wipe dlsym type >> (e.g. by casting to void *), then later cast to another type which >> lacks tailcall attribute.

Re: [PATCH v2] Add no_tail_call attribute

2017-07-19 Thread Yuri Gribov
On Wed, Jul 19, 2017 at 4:30 PM, Alexander Monakov wrote: > On Wed, 19 Jul 2017, Jeff Law wrote: >> > Glibc people were worried that attribute would be lost when taking a >> > pointer to function >> > (https://sourceware.org/ml/libc-alpha/2017-01/msg00482.html). I think >> > their reasoning was th

Re: [PATCH 4/6] lra-assigns.c: give up on qsort checking in assign_by_spills

2017-07-18 Thread Yuri Gribov
On Sat, Jul 15, 2017 at 9:47 PM, Alexander Monakov wrote: > The reload_pseudo_compare_func comparator, when used from assign_by_spills, > can be non-transitive, indicating A < B < C < A if both A and C satisfy > !bitmap_bit_p (&non_reload_pseudos, rAC), but B does not. > > This function was origin

Re: [PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-18 Thread Yuri Gribov
On Tue, Jul 18, 2017 at 8:45 AM, Jan Hubicka wrote: >> Hi all, >> >> Currently all cases in switch statement are treated as having equal >> probabilities which causes suboptimal code as demonstrated in >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch >> modifies expander to selec

Re: [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls

2017-07-18 Thread Yuri Gribov
On Mon, Jul 17, 2017 at 10:27 AM, Jan Hubicka wrote: >> Hi all, >> >> This is a new version of previous patch >> (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed >> after Rainer's remarks. > Hi, > the patch looks OK, but I wonder why you included can_be_discarded check? > If funct

[PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-18 Thread Yuri Gribov
Hi all, Currently all cases in switch statement are treated as having equal probabilities which causes suboptimal code as demonstrated in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch modifies expander to select pivot point for decision tree so that probabilities of cases on the

Re: [PATCH][PING] Improve extraction of changed file in contrib/mklog

2017-07-17 Thread Yuri Gribov
On Mon, Jul 17, 2017 at 11:37 AM, Trevor Saunders wrote: > On Mon, Jul 17, 2017 at 08:22:56AM +0100, Yuri Gribov wrote: >> Hi, >> >> Currently mklog will fail to analyze lines like this in patches: >> diff -rupN gcc/gcc/testsuite/lib/profopt.exp >> gcc-compare-che

[PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons

2017-07-17 Thread Yuri Gribov
Hi all, This is an updated version of patch in https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00409.html . It prevents optimization in presense of sNaNs (and qNaNs when comparison operator is > >= < <=) to preserve FP exceptions. Note that I had to use -fsignaling-nans in pr57371-5.c test because

[RFC][PR 67336][PING^6] Verify pointers during stack unwind

2017-07-17 Thread Yuri Gribov
Hi all, I've rebased the previous patch to trunk per Andrew's suggestion. Original patch description/motivation/questions are in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01869.html -Y safe-unwind-2.patch Description: Binary data #include #include struct _Unwind_Context; typedef int (*_

[PATCH][PING] Improve extraction of changed file in contrib/mklog

2017-07-17 Thread Yuri Gribov
Hi, Currently mklog will fail to analyze lines like this in patches: diff -rupN gcc/gcc/testsuite/lib/profopt.exp gcc-compare-checks/gcc/testsuite/lib/profopt.exp (it fails with "Error: failed to parse diff for ... and ..."). This patch fixes it. Ok for trunk? -Y mklog-filename-fix-1.patch Des

[PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls

2017-07-17 Thread Yuri Gribov
Hi all, This is a new version of previous patch (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed after Rainer's remarks. -Y pr56727-2.patch Description: Binary data

[PATCH] Fix qsort ordering violation in tree-vrp.c

2017-07-15 Thread Yuri Gribov
Hi, This is a follow-up on https://gcc.gnu.org/ml/gcc/2017-07/msg00078.html compare_assert_loc in tree-vrp.c could return unpredictable results due to implicit conversion of unsigned subtraction to int here: return ha - hb; This could return inconsistent results for objects with the following

[PATCHv4][PR 57371] Remove useless floating point casts in comparisons

2017-07-11 Thread Yuri Gribov
Hi all, This is an updated version of patch in https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00409.html . It prevents optimization in presense of sNaNs (and qNaNs when comparison operator is > >= < <=) to preserve FP exceptions. Note that I had to use -fsignaling-nans in pr57371-5.c test because

Re: [PATCH] Ignore random output from Asan tests in dg-cmp-results

2017-07-10 Thread Yuri Gribov
On Mon, Jul 10, 2017 at 10:52 PM, Mike Stump wrote: > On Jul 10, 2017, at 2:21 PM, Mike Stump wrote: >> >> Someone with such a system will have to drill down into why. > > Found it, fixed in dejagnu 1.5.3, just use a newer dejagnu, 1.5.3 or later > should be fine. > > Apparently, I should have j

Re: [PATCH] Ignore random output from Asan tests in dg-cmp-results

2017-07-10 Thread Yuri Gribov
On Mon, Jul 10, 2017 at 1:13 PM, Thomas Preudhomme wrote: > [adding Mike Stump who approved my last patch to dg-cmp-results] > > Hi Yuri, > > On 09/07/17 20:06, Yuri Gribov wrote: >> >> Hi, >> >> Currently dg-cmp-results fails to compare fails in Asan

Re: [PATCHv2][PR 57371] Remove useless floating point casts in comparisons

2017-07-10 Thread Yuri Gribov
On Mon, Jul 10, 2017 at 11:06 AM, Joseph Myers wrote: > On Sat, 8 Jul 2017, Yuri Gribov wrote: > >> On Fri, Jul 7, 2017 at 11:51 PM, Joseph Myers >> wrote: >> > On Fri, 7 Jul 2017, Yuri Gribov wrote: >> > >> >> > I suspect infinities

[PATCHv2][PING][PR 56727] Bypass PLT for recursive calls

2017-07-10 Thread Yuri Gribov
Hi all, This is a new version of previous patch (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed after Rainer's remarks. -Y pr56727-2.patch Description: Binary data

[RFC][PR 67336][PING^5] Verify pointers during stack unwind

2017-07-10 Thread Yuri Gribov
Hi all, I've rebased the previous patch to trunk per Andrew's suggestion. Original patch description/motivation/questions are in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01869.html -Y safe-unwind-2.patch Description: Binary data #include #include struct _Unwind_Context; typedef int (*_

Re: [PATCH] Ignore random output from Asan tests in dg-cmp-results

2017-07-10 Thread Yuri Gribov
On Mon, Jul 10, 2017 at 10:32 AM, Thomas Preudhomme wrote: > Hi Yuri, > > On 09/07/17 20:06, Yuri Gribov wrote: >> >> Hi, >> >> Currently dg-cmp-results fails to compare fails in Asan tests because >> their output includes failing process id: >> N

[PATCH] Ignore random output from Asan tests in dg-cmp-results

2017-07-09 Thread Yuri Gribov
Hi, Currently dg-cmp-results fails to compare fails in Asan tests because their output includes failing process id: NA->FAIL: c-c++-common/asan/bitfield-1.c -O0 output pattern test, is ==18161==ERROR FAIL->NA: c-c++-common/asan/bitfield-1.c -O0 output pattern test, is ==26667==ERROR This pa

[PATCH] Improve extraction of changed file in contrib/mklog

2017-07-09 Thread Yuri Gribov
Hi, Currently mklog will fail to analyze lines like this in patches: diff -rupN gcc/gcc/testsuite/lib/profopt.exp gcc-compare-checks/gcc/testsuite/lib/profopt.exp (it fails with "Error: failed to parse diff for ... and ..."). This patch fixes it. Ok for trunk? -Y mklog-filename-fix-1.patch Des

[PATCH] Print relative names in UNSUPPORTED AutoFDO tests

2017-07-09 Thread Yuri Gribov
Hi, This patch fixes AutoFDO Dejagnu tests to print relative filenames instead of absolute ones when AutoFDO is unsupported. This is to prevent spurious differences in dg-cmp-results.sh, like this: NA->UNSUPPORTED: /home/yugr/src/gcc-57371/gcc/testsuite/g++.dg/bprob/g++-bprob-1.C -fauto-profile

[PATCHv3][PR 57371] Remove useless floating point casts in comparisons

2017-07-08 Thread Yuri Gribov
Hi all, This is an updated version of patch in https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00351.html . It adds Inf and NaN tests suggested by Joseph. Bootstrapped and regtested on x64. Ok for trunk? -Y pr57371-3a.patch Description: Binary data

Re: [PATCHv2][PR 57371] Remove useless floating point casts in comparisons

2017-07-07 Thread Yuri Gribov
On Sat, Jul 8, 2017 at 5:30 AM, Yuri Gribov wrote: > On Fri, Jul 7, 2017 at 11:51 PM, Joseph Myers wrote: >> On Fri, 7 Jul 2017, Yuri Gribov wrote: >> >>> > I suspect infinities would already work with the patch as-is (the logic >>> > dealing with constant

Re: [PATCHv2][PR 57371] Remove useless floating point casts in comparisons

2017-07-07 Thread Yuri Gribov
On Fri, Jul 7, 2017 at 11:51 PM, Joseph Myers wrote: > On Fri, 7 Jul 2017, Yuri Gribov wrote: > >> > I suspect infinities would already work with the patch as-is (the logic >> > dealing with constants outside the range of the integer type). I'm less >> > cle

Re: [PATCHv2][PR 57371] Remove useless floating point casts in comparisons

2017-07-07 Thread Yuri Gribov
On Fri, Jul 7, 2017 at 6:07 PM, Joseph Myers wrote: > On Fri, 7 Jul 2017, Yuri Gribov wrote: > >> Hi all, >> >> This is an updated version of patch in >> https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00034.html . It should >> be much more complete, both in fun

[PATCHv2][PR 57371] Remove useless floating point casts in comparisons

2017-07-06 Thread Yuri Gribov
Hi all, This is an updated version of patch in https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00034.html . It should be much more complete, both in functionality and in tests. Bootstrapped and regtested on x64. Ok for trunk? -Y pr57371-2.patch Description: Binary data

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-05 Thread Yuri Gribov
On Wed, Jul 5, 2017 at 8:00 PM, Jonathan Wakely wrote: > This patch adds AddressSanitizer annotations to std::vector, so that > ASan can detect out-of-bounds accesses to the unused capacity of a > vector. e.g. > > std::vector v(2); > int* p = v.data(); > v.pop_back(); > return p[1]; // ERROR

[RFC][PR 67336][PING^4] Verify pointers during stack unwind

2017-07-05 Thread Yuri Gribov
Hi all, I've rebased the previous patch to trunk per Andrew's suggestion. Original patch description/motivation/questions are in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01869.html -Y safe-unwind-2.patch Description: Binary data #include #include struct _Unwind_Context; typedef int (*_

Re: [PATCH][PR 57371] Remove useless floating point casts in comparisons

2017-07-03 Thread Yuri Gribov
On Mon, Jul 3, 2017 at 4:28 PM, Jeff Law wrote: > On 07/03/2017 08:52 AM, Joseph Myers wrote: >> I'd expect much more thorough testcases here, both for cases that get >> optimized and cases that don't. You're only testing comparisons with >> zero. There should be comparisons with other values, b

Re: [PATCH][PR 57371] Remove useless floating point casts in comparisons

2017-07-03 Thread Yuri Gribov
On Mon, Jul 3, 2017 at 4:38 PM, Jeff Law wrote: > On 07/02/2017 11:03 AM, Yuri Gribov wrote: >> Hi all, >> >> This is initial patch for >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371 . Per Joseph's >> suggestion it optimizes >> (float)lhs CMP

Re: [PATCH v2] Add no_tail_call attribute

2017-07-03 Thread Yuri Gribov
On Mon, Jul 3, 2017 at 6:03 PM, Jeff Law wrote: > On 05/29/2017 11:24 PM, Yuri Gribov wrote: >> On Mon, May 29, 2017 at 8:14 AM, Yuri Gribov wrote: >>> Hi all, >>> >>> As discussed in >>> https://sourceware.org/ml/libc-alpha/2017-01/msg00455.html , so

Re: [PATCH][PR 57371] Remove useless floating point casts in comparisons

2017-07-02 Thread Yuri Gribov
On Sun, Jul 2, 2017 at 6:03 PM, Yuri Gribov wrote: > Hi all, > > This is initial patch for > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371 . Per Joseph's > suggestion it optimizes > (float)lhs CMP rhs > (double)lhs CMP rhs > to > lhs CMP (typeof(x)

Re: [PATCH][PR 57371] Remove useless floating point casts in comparisons

2017-07-02 Thread Yuri Gribov
On Sun, Jul 2, 2017 at 6:32 PM, Marc Glisse wrote: > On Sun, 2 Jul 2017, Yuri Gribov wrote: > >> This is initial patch for >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371 . > > Thanks. I have had this unfinished, probably wrong patch on my hard drive > for 4 years

[PATCH][PR 57371] Remove useless floating point casts in comparisons

2017-07-02 Thread Yuri Gribov
Hi all, This is initial patch for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371 . Per Joseph's suggestion it optimizes (float)lhs CMP rhs (double)lhs CMP rhs to lhs CMP (typeof(x))rhs whenever typeof(x) can be precisely represented by floating-point type (e.g. short by float or int by d

[PATCHv2][PR 56727] Bypass PLT for recursive calls

2017-07-02 Thread Yuri Gribov
Hi all, This is a new version of previous patch (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed after Rainer's remarks. -Y pr56727-2.patch Description: Binary data

Re: [PATCH][PR 56727] Bypass PLT for recursive calls

2017-07-02 Thread Yuri Gribov
On Sat, Jul 1, 2017 at 9:56 PM, Rainer Orth wrote: > Hi Yuri, > >> diff -rupN gcc/gcc/testsuite/gcc.dg/pr56727-1.c >> gcc-56727/gcc/testsuite/gcc.dg/pr56727-1.c >> --- gcc/gcc/testsuite/gcc.dg/pr56727-1.c 1970-01-01 01:00:00.0 >> +0100 >> +++ gcc-56727/gcc/testsuite/gcc.dg/pr56727-

[PATCH][PR 56727] Bypass PLT for recursive calls

2017-07-01 Thread Yuri Gribov
Hi all, This is a fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727 which replaces recursive PLT calls with direct calls to static aliases. In presense of function aliases this patch takes a conservative approach and keeps the PLT call (Jan suggested to optimize more aggressively even wh

[PATCH][PR bootstrap/80565] Fixed bootstrap errors due to uninitialized memory

2017-06-29 Thread Yuri Gribov
Hi, This patch fixes uninitialized memory errors which caused bootstrap to fail on some distros (e.g. gcc12 on compile farm). This was reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80565 (and maybe also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79224#c15). x86_64 bootstrap completed

[RFC][PR 67336][PING^3] Verify pointers during stack unwind

2017-06-28 Thread Yuri Gribov
Hi all, I've rebased the previous patch to trunk per Andrew's suggestion. Original patch description/motivation/questions are in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01869.html -Y safe-unwind-2.patch Description: Binary data #include #include struct _Unwind_Context; typedef int (*_

Re: [RFC][PR 67336][PING^2] Verify pointers during stack unwind

2017-06-26 Thread Yuri Gribov
On Sun, Jun 25, 2017 at 8:13 PM, Andrew Pinski wrote: > On Sun, Jun 25, 2017 at 12:08 PM, Yuri Gribov wrote: >> Hi all, >> >> Libgcc unwinder currently does not do any verification of pointers >> which it chases on stack. In practice this not so rarely causes >

[RFC][PR 67336][PING^2] Verify pointers during stack unwind

2017-06-25 Thread Yuri Gribov
Hi all, Libgcc unwinder currently does not do any verification of pointers which it chases on stack. In practice this not so rarely causes segfaults when unwinding on corrupted stacks (e.g. when when trying to print diagnostic on fatal error) [1]. Ironically this usually happens in error reporting

[PATCH][PR 81089][PING] Fix -O3 bootstrap

2017-06-15 Thread Yuri Gribov
On Thu, Jun 15, 2017 at 6:08 AM, Yuri Gribov wrote: > Hi all, > > This patch fixes regression at bootstrap-O3. > > Local x64 bootstrap-O3 has completed w/o errors. I didn't run regtests > (I think it's not needed, given that new code can now run in fewer > cases

[PATCH][PR 81089] Add missing check

2017-06-14 Thread Yuri Gribov
Hi all, This patch fixes regression at bootstrap-O3. Local x64 bootstrap-O3 has completed w/o errors. I didn't run regtests (I think it's not needed, given that new code can now run in fewer cases than before). Ok to commit? (if yes - could someone commit for me?) -Y pr-81089-1.patch Descript

Re: [PATCH 4/4 v3][PR 67328] Optimize some masked comparisons to efficient bittest

2017-06-08 Thread Yuri Gribov
On Wed, May 31, 2017 at 12:19 PM, Richard Biener wrote: > On Mon, 29 May 2017, Yuri Gribov wrote: > >> This no longer fixes the PR but still works in some cases as >> demonstrated by the test. So I decided to keep it. > > As Richard noticed you don't need wide

Re: [PATCH 1/4 v3][PR 67328] Generate bittests in range checks if possible

2017-06-08 Thread Yuri Gribov
On Tue, May 30, 2017 at 7:25 AM, Richard Sandiford wrote: > Yuri Gribov writes: >> Added special case to build_range_check. Fixed couple of existing >> tests where it changed codegen. >> >> -I >> >> From b7819f341e2ffa0437be497024f61d0a4e1be588 Mon Se

[PATCH v2][PING] Add no_tail_call attribute

2017-06-07 Thread Yuri Gribov
On Mon, May 29, 2017 at 8:14 AM, Yuri Gribov wrote: > Hi all, > > As discussed in > https://sourceware.org/ml/libc-alpha/2017-01/msg00455.html , some > libdl functions rely on return address to figure out the calling > DSO and then use this information in computation (e.

Re: [PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints

2017-05-30 Thread Yuri Gribov
On Tue, May 30, 2017 at 4:35 PM, Richard Sandiford wrote: > Yuri Gribov writes: >> On Tue, May 30, 2017 at 11:35 AM, Richard Sandiford >> wrote: >>> Yuri Gribov writes: >>>> On Tue, May 30, 2017 at 7:35 AM, Richard Sandiford >>>>

Re: [PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints

2017-05-30 Thread Yuri Gribov
On Tue, May 30, 2017 at 11:35 AM, Richard Sandiford wrote: > Yuri Gribov writes: >> On Tue, May 30, 2017 at 7:35 AM, Richard Sandiford >> wrote: >>> Yuri Gribov writes: >>>> From 330209f721a598ec393dcb5d62de3457ee282153 Mon Sep 17 00:00:00 2001 >>&g

Re: [PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints

2017-05-30 Thread Yuri Gribov
On Tue, May 30, 2017 at 7:35 AM, Richard Sandiford wrote: > Yuri Gribov writes: >> From 330209f721a598ec393dcb5d62de3457ee282153 Mon Sep 17 00:00:00 2001 >> From: Yury Gribov >> Date: Fri, 26 May 2017 07:53:10 +0100 >> Subject: [PATCH 3/4] Added bool conversion for wi

[PATCH v2] Add no_tail_call attribute

2017-05-29 Thread Yuri Gribov
On Mon, May 29, 2017 at 8:14 AM, Yuri Gribov wrote: > Hi all, > > As discussed in > https://sourceware.org/ml/libc-alpha/2017-01/msg00455.html , some > libdl functions rely on return address to figure out the calling > DSO and then use this information in computation (e.

Re: [PATCH] Add no_tail_call attribute

2017-05-29 Thread Yuri Gribov
On Mon, May 29, 2017 at 9:14 AM, Alexander Monakov wrote: > Hi, > > On Mon, 29 May 2017, Yuri Gribov wrote: > >> Hi all, >> >> As discussed in >> https://sourceware.org/ml/libc-alpha/2017-01/msg00455.html , some >> libdl functions rely on return address

Re: [RFC, PATCH][ASAN] Implement dynamic allocas/VLAs sanitization.

2017-05-29 Thread Yuri Gribov
On Wed, May 17, 2017 at 1:24 PM, Maxim Ostapenko wrote: > Hi, > > this patch implements dynamic allocas/VLAs sanitization in ASan. Basically, > this is implemented at compiler part in the following way: > > 1) For each __builtin_alloca{_with_align} increase its size and alignment to > contain ASan

[PATCH] Add no_tail_call attribute

2017-05-29 Thread Yuri Gribov
Hi all, As discussed in https://sourceware.org/ml/libc-alpha/2017-01/msg00455.html , some libdl functions rely on return address to figure out the calling DSO and then use this information in computation (e.g. output of dlsym depends on which library called it). As reported in https://gcc.gnu.org

[PATCH 4/4 v3][PR 67328] Optimize some masked comparisons to efficient bittest

2017-05-29 Thread Yuri Gribov
This no longer fixes the PR but still works in some cases as demonstrated by the test. So I decided to keep it. -I 0004-Optimize-some-masked-comparisons-to-efficient-bittes.patch Description: Binary data

[PATCH 3/4 v3][PR 67328] Added bool conversion for wide_ints

2017-05-29 Thread Yuri Gribov
0003-Added-bool-conversion-for-wide_ints.patch Description: Binary data

[PATCH 2/4 v3][PR 67328] Analyze some bit tests in VRP

2017-05-28 Thread Yuri Gribov
This improve VRP handling for bitfield comparisons added by previous patch. -I 0002-Analyze-some-bit-tests-in-VRP.patch Description: Binary data

[PATCH 1/4 v3][PR 67328] Generate bittests in range checks if possible

2017-05-28 Thread Yuri Gribov
Added special case to build_range_check. Fixed couple of existing tests where it changed codegen. -I 0001-Generate-bittests-in-range-checks-if-possible.patch Description: Binary data

[PATCH 0/4 v3][PR 67328] Improve bitfield range tests

2017-05-28 Thread Yuri Gribov
Hi all, This is a follow up for my previous fix for PR 67328. My original simple addition to match.pd no longer worked with GCC 7 codebase so I instead added a special case to build_range_check. I kept match.pd pattern as it still works in some other useful cases as illustrated by fold-masked-cmp

Re: [PATCH][PR 67328] Improve bitfield testing

2017-01-25 Thread Yuri Gribov
On Wed, Jan 25, 2017 at 10:49 AM, Richard Biener wrote: > On Wed, 25 Jan 2017, Yuri Gribov wrote: > >> Hi all, >> >> This fixes inefficient bitfield code reported in >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67328 >> >> Bootstrapped and regtest

[PATCH][PR 67328] Improve bitfield testing

2017-01-25 Thread Yuri Gribov
Hi all, This fixes inefficient bitfield code reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67328 Bootstrapped and regtested on x86_64. Ok for trunk? -I pr67328-2.patch Description: Binary data

[RFC][PATCH][PR 67336][PING] Verify pointers during stack unwind

2017-01-18 Thread Yuri Gribov
Hi all, Libgcc unwinder currently does not do any verification of pointers which it chases on stack. In practice this not so rarely causes segfaults when unwinding on corrupted stacks (e.g. when when trying to print diagnostic on fatal error) [1]. Ironically this usually happens in error reporting

[RFC][PATCH][Libgcc] Verify pointers during stack unwind

2017-01-12 Thread Yuri Gribov
Hi all, Libgcc unwinder currently does not do any verification of pointers which it chases on stack. In practice this not so rarely causes segfaults when unwinding on corrupted stacks (e.g. when when trying to print diagnostic on fatal error) [1]. Ironically this usually happens in error reporting

Re: [PATCH v2] Support ASan ODR indicators at compiler side.

2016-11-21 Thread Yuri Gribov
On Mon, Nov 21, 2016 at 11:50 AM, Jakub Jelinek wrote: > On Mon, Nov 21, 2016 at 11:43:56AM +0000, Yuri Gribov wrote: >> > This is just weird. DECL_NAME in theory could be NULL, or can be a symbol >> > much longer than 100 bytes, at which point you have strlen (tmp

Re: [PATCH v2] Support ASan ODR indicators at compiler side.

2016-11-21 Thread Yuri Gribov
On Mon, Nov 21, 2016 at 11:38 AM, Jakub Jelinek wrote: > On Mon, Nov 14, 2016 at 11:44:26AM +0300, Maxim Ostapenko wrote: >> this is the second attempt to support ASan odr indicators in GCC. I've fixed >> issues with several flags (e.g.TREE_ADDRESSABLE) and introduced new "asan >> odr indicator" a

Re: [PATCH 0/7] Libsanitizer merge from upstream r285547.

2016-11-07 Thread Yuri Gribov
On Mon, Nov 7, 2016 at 9:20 AM, Jakub Jelinek wrote: > On Mon, Nov 07, 2016 at 12:14:39PM +0300, Maxim Ostapenko wrote: >> libubsan is definitely compatible. > > Nice. > >> For libtsan we have several changes: >> >> 1) Several interceptors (34 of them) were added and __interceptor_lstat{64} >> wer

Re: [PATCH][PR sanitizer/64354] Define __SANITIZE_THREAD__ and __SANITIZE_UNDEFINED__ macros if corresponding switches are enabled.

2016-05-18 Thread Yuri Gribov
On Wed, May 18, 2016 at 8:33 PM, Maxim Ostapenko wrote: > Hi, > > when compiling with -fsanitize=address we define __SANITIZE_ADDRESS__ > macros, but we don't do this for -fsanitize=thread and -fsanitize=undefined. > Perhaps we should be more symmetric here and define corresponding > __SANITIZE_TH

Re: [PATCH][PR sanitizer/64354] Define __SANITIZE_THREAD__ and __SANITIZE_UNDEFINED__ macros if corresponding switches are enabled.

2016-05-18 Thread Yuri Gribov
On Wed, May 18, 2016 at 8:36 PM, Jakub Jelinek wrote: > On Wed, May 18, 2016 at 08:33:53PM +0300, Maxim Ostapenko wrote: >> when compiling with -fsanitize=address we define __SANITIZE_ADDRESS__ >> macros, but we don't do this for -fsanitize=thread and -fsanitize=undefined. >> Perhaps we should be

Re: [PATCH 5/5] Fix intransitive comparison in dr_group_sort_cmp

2015-12-18 Thread Yuri Gribov
On Fri, Dec 18, 2015 at 11:20 PM, Yury Gribov wrote: > On 12/17/2015 03:51 PM, Richard Biener wrote: >> >> On Thu, 17 Dec 2015, Yury Gribov wrote: >> >>> On 12/17/2015 02:57 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: > That's an interesting one. The origin

Re: [PINGv2][PATCH] Ignore alignment by option

2014-12-04 Thread Yuri Gribov
On Thu, Dec 4, 2014 at 8:06 PM, 'Dmitry Vyukov' via address-sanitizer wrote: > You answered your own question about user space :) Yeah, I hoped someone would rush to overpersuade me... -Y

Re: [PATCH][Commited] Fix PR sanitizer/63638

2014-10-24 Thread Yuri Gribov
On Sat, Oct 25, 2014 at 12:19 AM, Yuri Gribov wrote: > Same fix for 5.0 will be probably commited in Forgot to mention that this one is for 4.9. -Y

[PATCH][Commited] Fix PR sanitizer/63638

2014-10-24 Thread Yuri Gribov
Hi all, This patch fixes was approved by Jakub in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63638 . Same fix for 5.0 will be probably commited in https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02066.html . -Y commit 87a472b057af66d46a5437137e9535c70de5c786 Author: Yury Gribov Date: Fri Oct 2

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yuri Gribov
On Sun, Sep 7, 2014 at 8:18 AM, Yuri Gribov wrote: > Replying to all this time. > > On Sat, Sep 6, 2014 at 11:35 PM, Segher Boessenkool > wrote: >>> Hm, isn't it already enabled by default for Emacs (in .dirs-local.el)? >> >> That may well be. But Vim is n

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yuri Gribov
Replying to all this time. On Sat, Sep 6, 2014 at 11:35 PM, Segher Boessenkool wrote: >> Hm, isn't it already enabled by default for Emacs (in .dirs-local.el)? > > That may well be. But Vim is not Emacs. Why is Vim special? As a developer I'd prefer the unified approach: either nuke both or mov

Re: [PATCH] Asan static optimization (draft)

2014-08-18 Thread Yuri Gribov
On Fri, Aug 15, 2014 at 10:34 PM, Konstantin Serebryany wrote: > If this is -O1 or higher, then most (but not all) of your cases > *should* be optimized by the compiler before asan kicks in. You mean hoisting memory accesses from branches? Sure, the tests are simplified beyond all limits. On the

Re: [PATCH] Asan static optimization (draft)

2014-08-15 Thread Yuri Gribov
On Fri, Aug 8, 2014 at 2:43 PM, Dmitry Vyukov wrote: >> Similar optimization could be used for tsan builtins, or some of the ubsan >> builtins (which is the reason why the pass is called sanopt). > > That would be great. > Note that tsan optimizations must be based around a different > criteria. A

Re: [PATCH] Asan static optimization (draft)

2014-08-14 Thread Yuri Gribov
On Thu, Aug 14, 2014 at 8:53 PM, Konstantin Serebryany wrote: > In order for your work to be generally useful, I'd ask several things: > - Update > https://code.google.com/p/address-sanitizer/wiki/CompileTimeOptimizations > with examples that will be handled Done (to be honest I only plan to do

Re: [PATCH] Move Asan instrumentation to sanopt pass

2014-07-19 Thread Yuri Gribov
On Sat, Jul 19, 2014 at 1:31 PM, Jakub Jelinek wrote: > On Fri, Jul 18, 2014 at 10:21:16PM +0400, Yuri Gribov wrote: > Sounds like a bug, most likely in the lim pass. If it for some reason > decides to load from possibly uninitialized memory before the loop, it > better shou

Re: [PATCH] Move Asan instrumentation to sanopt pass

2014-07-18 Thread Yuri Gribov
On Fri, Jul 18, 2014 at 9:23 PM, Jakub Jelinek wrote: > On Fri, Jul 18, 2014 at 08:42:35PM +0400, Yuri Gribov wrote: >> > Uh. Can you please explain this? That sounds weird. >> >> Sure, this caused maybe-uninitialized warnings with iterator during >> bootstrap. I

Re: [PATCH] Move Asan instrumentation to sanopt pass

2014-07-18 Thread Yuri Gribov
> For formatting, can you please just replace 8 spaces with tabs > in the ^+ lines in the patch? Sorry, I thought I cleared all these out but looks like I indeed missed some whites. I should probably take some time and finally setup my editor to do this. > Can you avoid using // comments in code

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Yuri Gribov
On Fri, Jun 20, 2014 at 2:57 PM, Jakub Jelinek wrote: > On Fri, Jun 20, 2014 at 02:49:12PM +0400, Maxim Ostapenko wrote: >> This patch fixes invalid sanitization of trailing byte in __builtin_strlen ( >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61547). >> >> Tested on x86_64-unknown-linux-gnu,

  1   2   >