Recognizing loop pattern

2020-10-26 Thread Stefan Schulze Frielinghaus via Gcc
I'm trying to detect loops of the form while (*x != y) ++x; which mimic the behaviour of function rawmemchr. Note, the size of *x is not necessarily one byte. Thus ultimately I would like to detect such loops and replace them with calls to builtins rawmemchr8, rawmemchr16, rawmemchr32 if

Re: [__mulvti3] register allocator plays shell game

2020-10-26 Thread Richard Biener via Gcc
On Sun, Oct 25, 2020 at 8:37 PM Stefan Kanthak wrote: > > Hi, > > for the AMD64 alias x86_64 platform and the __int128_t [DW]type, > the first few lines of the __mulvDI3() function from libgcc2.c > > | DWtype > | __mulvDI3 (DWtype u, DWtype v) > | { > | /* The unchecked multiplication needs 3 Wt

RE: Recognizing loop pattern

2020-10-26 Thread Kyrylo Tkachov via Gcc
> -Original Message- > From: Gcc On Behalf Of Stefan Schulze > Frielinghaus via Gcc > Sent: 26 October 2020 09:58 > To: gcc@gcc.gnu.org > Subject: Recognizing loop pattern > > I'm trying to detect loops of the form > > while (*x != y) > ++x; > > which mimic the behaviour of fun

Re: Question about whether a code fragment is expected to parse.

2020-10-26 Thread Nathan Sidwell
On 10/25/20 7:52 AM, Iain Sandoe wrote: Hi Given that GNU attributes are not part of the standard.. I wonder if the following is expected to work? __attribute__((__deprecated__)) extern "C" __attribute__((__visibility__("default"))) void foo () { } t.C:3:8: error: expected unqualified-id bef

Re: Question about whether a code fragment is expected to parse.

2020-10-26 Thread Nathan Sidwell
On 10/26/20 7:08 AM, Nathan Sidwell wrote: On 10/25/20 7:52 AM, Iain Sandoe wrote: Hi Given that GNU attributes are not part of the standard.. I wonder if the following is expected to work? __attribute__((__deprecated__)) extern "C" __attribute__((__visibility__("default"))) void foo () { }

Re: Recognizing loop pattern

2020-10-26 Thread Richard Biener via Gcc
On Mon, Oct 26, 2020 at 10:59 AM Stefan Schulze Frielinghaus via Gcc wrote: > > I'm trying to detect loops of the form > > while (*x != y) > ++x; > > which mimic the behaviour of function rawmemchr. Note, the size of *x is not > necessarily one byte. Thus ultimately I would like to detect

Re: Question about whether a code fragment is expected to parse.

2020-10-26 Thread Iain Sandoe via Gcc
Nathan Sidwell wrote: On 10/26/20 7:08 AM, Nathan Sidwell wrote: On 10/25/20 7:52 AM, Iain Sandoe wrote: Given that GNU attributes are not part of the standard.. I wonder if the following is expected to work? __attribute__((__deprecated__)) extern "C" __attribute__((__visibility__("defaul

Re: [__mulvti3] register allocator plays shell game

2020-10-26 Thread Stefan Kanthak
Richard Biener wrote: > On Sun, Oct 25, 2020 at 8:37 PM Stefan Kanthak > wrote: >> >> Hi, >> >> for the AMD64 alias x86_64 platform and the __int128_t [DW]type, >> the first few lines of the __mulvDI3() function from libgcc2.c >> >> | DWtype >> | __mulvDI3 (DWtype u, DWtype v) >> | { >> | /*

gsi_remove on a call

2020-10-26 Thread Gary Oblock via Gcc
I'm running into grief in verify_node in cgraph.c when I use gsi_remove on a call statement. Specifically it's a free statement which I've replaced with other free statements as part of my structure reorg optimizations. Note, in other working code I do this with malloc and it doesn't seem to be a