Re: problems with memory allocation and the alignment check

2021-02-23 Thread Michael J. Baars
On Mon, 2021-02-22 at 01:41 -0800, Andrew Pinski wrote: > On Mon, Feb 22, 2021 at 1:37 AM Michael J. Baars > wrote: > > On Mon, 2021-02-22 at 01:29 -0800, Andrew Pinski wrote: > > > On Mon, Feb 22, 2021 at 1:17 AM Michael J. Baars > > > wrote: > > > > Hi, > > > > > > > > I just wrote this little

RE: problems with memory allocation and the alignment check

2021-02-23 Thread David Laight
> > > I just wrote this little program to demonstrate a possible flaw in both > > > malloc and calloc. > > > > > > If I allocate a the simplest memory region from main(), one out of three > > > optimization flags fail. > > > If I allocate the same region from a function, three out of three > > >

Re: problems with memory allocation and the alignment check

2021-02-22 Thread Michael J. Baars
On Mon, 2021-02-22 at 01:29 -0800, Andrew Pinski wrote: > On Mon, Feb 22, 2021 at 1:17 AM Michael J. Baars > wrote: > > Hi, > > > > I just wrote this little program to demonstrate a possible flaw in both > > malloc and calloc. > > > > If I allocate a the simplest memory region from main(), one

Re: problems with memory allocation and the alignment check

2021-02-22 Thread Michael J. Baars
On Mon, 2021-02-22 at 01:41 -0800, Andrew Pinski wrote: > On Mon, Feb 22, 2021 at 1:37 AM Michael J. Baars > wrote: > > On Mon, 2021-02-22 at 01:29 -0800, Andrew Pinski wrote: > > > On Mon, Feb 22, 2021 at 1:17 AM Michael J. Baars > > > wrote: > > > > Hi, > > > > > > > > I just wrote this little

Re: problems with memory allocation and the alignment check

2021-02-22 Thread Andrew Pinski
On Mon, Feb 22, 2021 at 1:37 AM Michael J. Baars wrote: > > On Mon, 2021-02-22 at 01:29 -0800, Andrew Pinski wrote: > > On Mon, Feb 22, 2021 at 1:17 AM Michael J. Baars > > wrote: > > > Hi, > > > > > > I just wrote this little program to demonstrate a possible flaw in both > > > malloc and callo

problems with memory allocation and the alignment check

2021-02-22 Thread Michael J. Baars
Hi, I just wrote this little program to demonstrate a possible flaw in both malloc and calloc. If I allocate a the simplest memory region from main(), one out of three optimization flags fail. If I allocate the same region from a function, three out of three optimization flags fail. Does some

Re: problems with memory allocation and the alignment check

2021-02-22 Thread Andrew Pinski
On Mon, Feb 22, 2021 at 1:17 AM Michael J. Baars wrote: > > Hi, > > I just wrote this little program to demonstrate a possible flaw in both > malloc and calloc. > > If I allocate a the simplest memory region from main(), one out of three > optimization flags fail. > If I allocate the same region