From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9967A385B53A; Sat, 26 Nov 2022 23:16:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9967A385B53A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669504616; bh=IhW58/Adaxvfx/szulWfebX8DOKliJj5/8bqo/Gkvcw=; h=From:To:Subject:Date:From; b=r74d76zFunMMJR++LdplGxFIhveJkVtVKy4UsKEKfo6Ix+Q3XIh2WffHSxZfLJgqx 5VIWmuaT/1kYpK1E6wHBXTpZbv7ZtXwR/EevzFkkxozFGKHIUgGEJctg7GyTgOZaVq 14kbusQYWCVkbBYi5IXunYYIZTxr5hVhfZHdo3rM= From: "uaa at mx5 dot nisiq.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h Date: Sat, 26 Nov 2022 23:16:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: uaa at mx5 dot nisiq.net 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D107884 Bug ID: 107884 Summary: H8/300: cp-demangle.c fix warning related demangle.h Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: uaa at mx5 dot nisiq.net Target Milestone: --- Created attachment 53973 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53973&action=3Dedit pack DMGL_* option bit within 16bit width On building gcc-12.2.0 with newlib-4.1.0 (newlib and libgloss) and binutils-2.36.1 on Debian-11.5/amd64. gcc/config/h8300/t-h8300 is modified with: MULTILIB_OPTIONS =3D ms/msx mint32 MULTILIB_DIRNAMES =3D h8300s h8sx int32 to disable building H8 normal mode library. gcc configuration is: ../configure --target=3Dh8300-unknown-elf --enable-languages=3Dc,c++ \ --prefix=3D/home/uaa/h8300 --with-newlib --disable-nls --disable-libssp= \ --disable-libgomp --disable-libstdcxx-pch \ --disable-libstdcxx-filesystem-ts --with-newlib --disable-wchar_t include/demangle.h related warning occurs cross-compiled cp-demangle.c, due to the size of int is 16bit (H8/300 default). bin/bash ../libtool --tag CC --tag disable-shared --mode=3Dcompile /home/uaa/gcc-12.2.0/h8300-unknown-elf/./gcc/xgcc -B/home/uaa/gcc-12.2.0/h8300-unknown-elf/./gcc/ -nostdinc -B/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/newlib/ -isystem /home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/newlib/targ-include -isystem /home/uaa/gcc-12.2.0/newlib/libc/include -B/home/uaa/h8300/h8300-unknown-elf/bin/ -B/home/uaa/h8300/h8300-unknown-elf/lib/ -isystem /home/uaa/h8300/h8300-unknown-elf/include -isystem /home/uaa/h8300/h8300-unknown-elf/sys-include -DHAVE_CONFIG_H -I.. -I/home/uaa/gcc-12.2.0/libstdc++-v3/../libiberty -I/home/uaa/gcc-12.2.0/libstdc++-v3/../include=20=20 -I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/inc= lude/h8300-unknown-elf -I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/inc= lude -I/home/uaa/gcc-12.2.0/libstdc++-v3/libsupc++ -g -O2 -DIN_GLIBCPP_V3 -Wno-error -c cp-demangle.c libtool: compile: /home/uaa/gcc-12.2.0/h8300-unknown-elf/./gcc/xgcc -B/home/uaa/gcc-12.2.0/h8300-unknown-elf/./gcc/ -nostdinc -B/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/newlib/ -isystem /home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/newlib/targ-include -isystem /home/uaa/gcc-12.2.0/newlib/libc/include -B/home/uaa/h8300/h8300-unknown-elf/bin/ -B/home/uaa/h8300/h8300-unknown-elf/lib/ -isystem /home/uaa/h8300/h8300-unknown-elf/include -isystem /home/uaa/h8300/h8300-unknown-elf/sys-include -DHAVE_CONFIG_H -I.. -I/home/uaa/gcc-12.2.0/libstdc++-v3/../libiberty -I/home/uaa/gcc-12.2.0/libstdc++-v3/../include -I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/inc= lude/h8300-unknown-elf -I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/inc= lude -I/home/uaa/gcc-12.2.0/libstdc++-v3/libsupc++ -g -O2 -DIN_GLIBCPP_V3 -Wno-e= rror -c cp-demangle.c -o cp-demangle.o In file included from cp-demangle.c:139: /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:58:29: warning: left shift count >=3D width of type [-Wshift-count-overflow] 58 | #define DMGL_DLANG (1 << 16) | ^~ /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:91:22: note: in expansion of macro 'DMGL_DLANG' 91 | dlang_demangling =3D DMGL_DLANG, | ^~~~~~~~~~ /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:59:29: warning: left shift count >=3D width of type [-Wshift-count-overflow] 59 | #define DMGL_RUST (1 << 17) /* Rust wraps GNU_V3 st= yle mangling. */ | ^~ /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:92:21: note: in expansion of macro 'DMGL_RUST' 92 | rust_demangling =3D DMGL_RUST | ^~~~~~~~~ cp-demangle.c: In function 'd_function_type': /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:68:34: warning: left shift count >=3D width of type [-Wshift-count-overflow] 68 | #define DMGL_NO_RECURSE_LIMIT (1 << 18) | ^~ cp-demangle.c:2891:22: note: in expansion of macro 'DMGL_NO_RECURSE_LIM= IT' 2891 | if ((di->options & DMGL_NO_RECURSE_LIMIT) =3D=3D 0) | ^~~~~~~~~~~~~~~~~~~~~ /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:68:34: warning: left shift count >=3D width of type [-Wshift-count-overflow] 68 | #define DMGL_NO_RECURSE_LIMIT (1 << 18) | ^~ cp-demangle.c:2916:22: note: in expansion of macro 'DMGL_NO_RECURSE_LIM= IT' 2916 | if ((di->options & DMGL_NO_RECURSE_LIMIT) =3D=3D 0) | ^~~~~~~~~~~~~~~~~~~~~ cp-demangle.c: In function 'd_demangle_callback': /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:68:34: warning: left shift count >=3D width of type [-Wshift-count-overflow] 68 | #define DMGL_NO_RECURSE_LIMIT (1 << 18) | ^~ cp-demangle.c:6448:19: note: in expansion of macro 'DMGL_NO_RECURSE_LIM= IT' 6448 | if (((options & DMGL_NO_RECURSE_LIMIT) =3D=3D 0) | ^~~~~~~~~~~~~~~~~~~~~ suggested remedy is attached.=