https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85742
Bug ID: 85742 Summary: sizeof allocatable arrays returning wrong value Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: cesar at gcc dot gnu.org Target Milestone: --- Created attachment 44113 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44113&action=edit sizeof test As of trunk revision 257065, the sizeof function is returning incorrect results on assume-sized allocated arrays and scalars. See the attached test case for more details. I hit this problem while rebasing openacc-gcc-7-branch Fortran changes to GCC 8. Basically, OpenACC provides a Fortran module which contains an acc_is_present routine, which passes the sizeof an array along with the pointer to the array to the runtime to determine if that array is resident on the device. However, now sizeof is returning bogus results.