From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66D913858D37; Fri, 3 Nov 2023 09:54:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66D913858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699005252; bh=KzyJFHIg8VOoFS3saEkHQluvzNGH+OiflVUHUb2m8NI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aMlANfoPATPbI6poYc9oSHT9rBsCkpnOL5P2ld26YtGo/3PubvEdDBl6wmuDOMhYW C3xeMTIK0T84nXMPCBNeQq/xYeTA/DgJpbhxAQHvNv1KYs2K8eNw8z90UkOd/67S2U GDnFr5bHplDu1jZ15PLTLsjsbFme/FCDLScDz35I= From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112347] [14 regression] ICE on jemalloc-5.3.0: Segmentation fault around convert_for_assignment() Date: Fri, 03 Nov 2023 09:54:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dcb314 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D112347 --- Comment #13 from David Binderman --- I have been trying to get this C++ code to produce the new warning: #include struct S { int a[ 10]; float * b[ 20]; }; extern void g( S * ps); void f( int n) { S * ps =3D (S *) calloc( sizeof( S), 1); g( ps); S * ps2 =3D (S *) calloc( 1, sizeof( S)); g( ps2); S * ps3 =3D (S *) calloc( 1, sizeof( S) / 2); g( ps3); } $ ~/gcc/results/bin/g++ -g -O2 -Wall -Wextra -Walloc-size -c nov2b.cc cc1plus: warning: command-line option =E2=80=98-Walloc-size=E2=80=99 is val= id for C/ObjC but not for C++ nov2b.cc: In function =E2=80=98void f(int)=E2=80=99: nov2b.cc:12:13: warning: unused parameter =E2=80=98n=E2=80=99 [-Wunused-par= ameter] 12 | void f( int n) | ~~~~^ $ ~/gcc/results/bin/g++ -v Using built-in specs. COLLECT_GCC=3D/home/dcb38/gcc/results/bin/g++ COLLECT_LTO_WRAPPER=3D/home/dcb38/gcc/results.20231102.asan.ubsan/libexec/g= cc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../trunk.year/configure --prefix=3D/home/dcb38/gcc/results.20231102.asan.ubsan --disable-multilib --disable-bootstrap --with-build-config=3Dbootstrap-asan --with-build-config=3Dbootstrap-ubsan --with-pkgversion=3D01c18f58d37865d5 --enable-checking=3Ddf,extra,fold,rtl,yes --enable-languages=3Dc,c++,fortran Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20231102 (experimental) (01c18f58d37865d5)=20 $=20 I think calloc is available in C++, so the warning is wrong.=