Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-18 Thread Andreas Schwab
On Jul 18 2021, Segher Boessenkool wrote: > On Sat, Jul 17, 2021 at 03:13:59PM -0700, Andrew Pinski wrote: >> On Sat, Jul 17, 2021 at 2:31 PM Segher Boessenkool >> wrote: >> > On Fri, Jul 16, 2021 at 11:35:25AM -0700, apinski--- via Gcc-patches wrote: >> > > --- a/gcc/c-family/c-common.c >> > > +

Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-18 Thread Segher Boessenkool
On Sat, Jul 17, 2021 at 03:13:59PM -0700, Andrew Pinski wrote: > On Sat, Jul 17, 2021 at 2:31 PM Segher Boessenkool > wrote: > > On Fri, Jul 16, 2021 at 11:35:25AM -0700, apinski--- via Gcc-patches wrote: > > > --- a/gcc/c-family/c-common.c > > > +++ b/gcc/c-family/c-common.c > > > @@ -5799,7 +579

Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-17 Thread Andrew Pinski via Gcc-patches
On Sat, Jul 17, 2021 at 2:31 PM Segher Boessenkool wrote: > > Hi! > > On Fri, Jul 16, 2021 at 11:35:25AM -0700, apinski--- via Gcc-patches wrote: > > --- a/gcc/c-family/c-common.c > > +++ b/gcc/c-family/c-common.c > > @@ -5799,7 +5799,7 @@ parse_optimize_options (tree args, bool attr_p) > > > >

Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-17 Thread Segher Boessenkool
Hi! On Fri, Jul 16, 2021 at 11:35:25AM -0700, apinski--- via Gcc-patches wrote: > --- a/gcc/c-family/c-common.c > +++ b/gcc/c-family/c-common.c > @@ -5799,7 +5799,7 @@ parse_optimize_options (tree args, bool attr_p) > >if (TREE_CODE (value) == INTEGER_CST) > { > - char buffer

Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-16 Thread Richard Biener via Gcc-patches
On July 16, 2021 8:35:25 PM GMT+02:00, apinski--- via Gcc-patches wrote: >From: Andrew Pinski > >The problem is the buffer is too small to hold "-O" and >the interger. This fixes the problem by use the correct size >instead. > >Changes since v1: >* v2: Use HOST_BITS_PER_LONG and just divide by

Re: [PATCH] Fix PR 101453: ICE with optimize and large integer constant

2021-07-16 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 15, 2021 at 06:59:17PM -0700, apinski--- via Gcc-patches wrote: > From: Andrew Pinski > > Every base 10 digit will take use ~3.32 bits to represent. So for > a 64bit signed integer, it is 20 characters. The buffer was only > 20 so it did not fit; add in the null character and "-O" par