public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "uaa at mx5 dot nisiq.net" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-107884-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884

            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=53973&action=edit
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 = ms/msx mint32
    MULTILIB_DIRNAMES = h8300s h8sx int32

to disable building H8 normal mode library.

gcc configuration is:

    ../configure --target=h8300-unknown-elf --enable-languages=c,c++ \
    --prefix=/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=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/include/h8300-unknown-elf
-I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/include
-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/include/h8300-unknown-elf
-I/home/uaa/gcc-12.2.0/h8300-unknown-elf/h8300-unknown-elf/libstdc++-v3/include
-I/home/uaa/gcc-12.2.0/libstdc++-v3/libsupc++ -g -O2 -DIN_GLIBCPP_V3 -Wno-error
-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 >= 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 = DMGL_DLANG,
          |                      ^~~~~~~~~~
    /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:59:29: warning:
left shift count >= width of type [-Wshift-count-overflow]
       59 | #define DMGL_RUST        (1 << 17)      /* Rust wraps GNU_V3 style
mangling.  */
          |                             ^~
    /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:92:21: note: in
expansion of macro 'DMGL_RUST'
       92 |   rust_demangling = 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 >= 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_LIMIT'
     2891 |   if ((di->options & DMGL_NO_RECURSE_LIMIT) == 0)
          |                      ^~~~~~~~~~~~~~~~~~~~~
    /home/uaa/gcc-12.2.0/libstdc++-v3/../include/demangle.h:68:34: warning:
left shift count >= 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_LIMIT'
     2916 |   if ((di->options & DMGL_NO_RECURSE_LIMIT) == 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 >= 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_LIMIT'
     6448 |   if (((options & DMGL_NO_RECURSE_LIMIT) == 0)
          |                   ^~~~~~~~~~~~~~~~~~~~~

suggested remedy is attached.

             reply	other threads:[~2022-11-26 23:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 23:16 uaa at mx5 dot nisiq.net [this message]
2022-11-27  0:19 ` [Bug demangler/107884] " pinskia at gcc dot gnu.org
2022-11-27  9:35 ` uaa at mx5 dot nisiq.net
2022-11-28  7:44 ` rguenth at gcc dot gnu.org
2022-11-28  9:13 ` redi at gcc dot gnu.org
2022-11-28 11:37 ` redi at gcc dot gnu.org
2022-11-29 12:29 ` uaa at mx5 dot nisiq.net
2023-01-05 13:56 ` redi at gcc dot gnu.org
2023-02-24 15:25 ` mike at mnmoran dot org
2023-02-24 15:30 ` mike at mnmoran dot org
2023-02-26 12:34 ` uaa at mx5 dot nisiq.net
2023-02-26 14:58 ` mike at mnmoran dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107884-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).