Re: Use gcov for line coverage info of GIMPLE code

2020-06-17 Thread Shuai Wang via Gcc
Hey Martin, Thanks a lot for the info. I tried to play with __sanitizer_cov_trace_pc but still quite confused on whether it can instrument extra basic blocks introduced by ASAN. Let me present the GIMPLE code for your reference: Given the following C code: int main(int argc ,char **argv) {

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Jeff Law via Gcc
On Wed, 2020-06-17 at 15:10 +0800, Shuai Wang via Gcc wrote: > Dear Martin, > > Thanks for the information. I am tentatively experimenting some random > gadgets; given the critical if condition belonging to each sanitizer check, > i will do some data flow analysis and then decide whether to remove

Re: RFC/RFH - proof of concept for GCC OpenMP 5.0 non-rectangular worksharing-loop implementation

2020-06-17 Thread Philippe Clauss
Dear Jakub and all, When handling loop nests whose loop bounds are linearly depending on outer loop iterators and size parameters, it is known that the number of iterations is a specific kind of polynomial of the size parameters, also called an Ehrhart polynomial. I have recently published a

Re: AVR CC0 transition

2020-06-17 Thread John Paul Adrian Glaubitz
Hi! On 5/25/20 2:56 PM, John Paul Adrian Glaubitz wrote: >> I'm thinking about attempting to do the CC0 transition for the >> AVR port in my spare time. I've read the CC0Transition gcc wiki >> page, and as the AVR ISA does not have non-condition-code >> clobbering arithmetic instructions, conclud

Re: RFC/RFH - proof of concept for GCC OpenMP 5.0 non-rectangular worksharing-loop implementation

2020-06-17 Thread Jakub Jelinek via Gcc
On Wed, Jun 17, 2020 at 02:29:40PM +0200, Richard Biener wrote: > So this remembers me of the loop scalarization pass Sebastian once > implemented - that is, with the above constraints it looks like we > can do the actual collapsing, replacing collapsed loops with a new > one with a canonical IV fr

Re: RFC/RFH - proof of concept for GCC OpenMP 5.0 non-rectangular worksharing-loop implementation

2020-06-17 Thread Richard Biener
On Tue, 16 Jun 2020, Jakub Jelinek wrote: > Hi! > > Before OpenMP 5.0, all OpenMP loop nests had to be rectangular (and OpenMP > has various other restrictions that make implementation easier), so that it > was very easy to compute the number of iterations of the collapsed loop > by computing num

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Richard Biener via Gcc
On Wed, Jun 17, 2020 at 4:11 AM Shuai Wang via Gcc wrote: > > Hello, > > Suppose I have changed certain if condition in the GIMPLE code (generated > by the `sanopt` pass) into the following format: > > if (0 == 1) > { > > } > > Then, in order to completely remove this unnecessary if condit

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Martin Liška
On 6/17/20 9:10 AM, Shuai Wang wrote: Dear Martin, Thanks for the information. I am tentatively experimenting some random gadgets; given the critical if condition belonging to each sanitizer check, i will do some data flow analysis and then decide whether to remove that check or not (done). I

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Shuai Wang via Gcc
Dear Martin, Thanks for the information. I am tentatively experimenting some random gadgets; given the critical if condition belonging to each sanitizer check, i will do some data flow analysis and then decide whether to remove that check or not (done). If so, I will rewrite that if condition into

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Martin Liška
On 6/17/20 9:00 AM, Shuai Wang wrote: Dear Martin, Thanks for the kind reply. Hey. You're welcome. I don't have a strong preference between `asan0` vs. `sanopt`. But I note that I am primarily working on sanitizer enabled code, where I can only find some .ASAN_CHECK function calls in `asa

Re: Use gcov for line coverage info of GIMPLE code

2020-06-17 Thread Martin Liška
On 6/17/20 8:57 AM, Shuai Wang wrote: Hello Martin, The issue is that I want to count the coverage of "true/false" branches taken in sanitizer's if conditions.. I see. Well, you may abuse a bit the existing: -fsanitize-coverage=trace-pc Enable coverage-guided fuzzing code i

Re: Re-optimize instrumented GIMPLE code

2020-06-17 Thread Shuai Wang via Gcc
Dear Martin, Thanks for the kind reply. I don't have a strong preference between `asan0` vs. `sanopt`. But I note that I am primarily working on sanitizer enabled code, where I can only find some .ASAN_CHECK function calls in `asan0`, but those function calls seem have been inlined in `sanopt`. In