From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 498063858D37; Fri, 3 Nov 2023 09:14:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 498063858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699002883; bh=YtE207AktAxQxQabmJqQjOydi0HgaQG+oxXcQIDuh9c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=B/8Lsh2qZamtrZNxFvGMH47SO6wSdAodR2ZoC7h57PMpthg3dHqgHN1rth7o09ztW XthD16P65gRM2E52+eSOln1A4dq+JB1VHdXoHksM0UVlYaF5/WNZSkXW4xaaiiD2GT W4qwjN2s9pl4GiXMb0NzHiED1lgzCVvG5RM+GqRE= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/112364] calloc used incorrectly Date: Fri, 03 Nov 2023 09:14:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: easyhack, internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112364 --- Comment #3 from Xi Ruoyao --- (In reply to Martin Uecker from comment #2) > I don't think this is correct. The requirement is "The pointer returned = if > the allocation succeeds is suitably aligned so that it may be assigned to= a > pointer to any type of object with a fundamental alignment requirement and > size less than or equal to the size requested." >=20 > So it only has to take into account fundamental alignments for objects be= low > the given size and the fundamental alignment requirement differs for > different objects. Note that there is no "fundamental alignment".=20 > max_align_t would have the "greatest fundamental alignment", but the word= ing > for allocation functions does not refer to the greatest fundamental > alignment. Hmm, the "and size less than or equal to the size requested" clause does not exist in N1570 (C11), but it does exist in N3054 (C2x). It looks like a su= btly backward-incompatible change in the standard...=