https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #7 from Parker Thompson ---
(In reply to Jakub Jelinek from comment #6)
> GCC assumes pointers returned by malloc are at least MALLOC_ABI_ALIGNMENT
> bytes aligned. That is because:
> "The pointer returned if the allocation succeeds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #6 from Jakub Jelinek ---
GCC assumes pointers returned by malloc are at least MALLOC_ABI_ALIGNMENT bytes
aligned. That is because:
"The pointer returned if the allocation succeeds is suitably aligned so that it
may be assigned to a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #5 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Parker Thompson from comment #3)
> > As for alloc alignment, glibc strdup() does not use aligned_alloc, just
> > malloc. Which by my read of the spe
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
Andrew Pinski changed:
What|Removed |Added
Status|WAITING |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #3 from Parker Thompson ---
(In reply to Andrew Pinski from comment #2)
> Also aligned_alloc normally does not allow alignment of 1.
>
> So GCC is doing the correct thing.
The replacement of strdup here is just to illustrate the iss
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #1 from Andrew Pinski ---
A pointer returned from strdup has to be valid to be able pass to free.
Your testcase makes that invalid.