* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
@ 2022-11-27 0:19 ` pinskia at gcc dot gnu.org
2022-11-27 9:35 ` uaa at mx5 dot nisiq.net
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-27 0:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The patch does not work as you cannot pack bit options like this.
There needs to be some better way of doing this.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
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
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: uaa at mx5 dot nisiq.net @ 2022-11-27 9:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #2 from SASANO Takayoshi <uaa at mx5 dot nisiq.net> ---
Hello, can you tell me more details to do?
I think "some better way" seems to be one of them as follows.
1) change "#if __INT_WIDTH__ > 16 ~ #else ~ #endif" to
"#if defined(__INT_WIDTH__) && (__INT_WIDTH__ <= 16) ~ #else ~ #endif"
to safer choice.
2) remove "#define DMGL_OPT_BIT(x)", all "#define DMGL_..." uses (1 << x).
3) abandon remap bit position for int=16bit architecture,
modify codes that can pass 32bit-value option.
4) others (I have no idea...)
please tell me.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
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
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-28 7:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
Target| |h8
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Since there is I think no ABI constraints here simply using the appearant
unused bits to get them to fit into 16 bits looks possible?
Supposedly C defines literal suffixes for int32_t? Otherwise using (1L << 17)
might work as well here.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (2 preceding siblings ...)
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
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-28 9:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Supposedly C defines literal suffixes for int32_t? Otherwise using (1L <<
> 17) might work as well here.
Yes, it could be:
INT32_C(1) << 17
That expands to int_least32_t not int32_t but that's fine for this purpose.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (3 preceding siblings ...)
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
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-28 11:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Oh, except that we pass it to cplus_demangle(const char*, int) and so anything
above the first 16 bits is lost anyway. Should that function use int32_t
instead?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (4 preceding siblings ...)
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
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: uaa at mx5 dot nisiq.net @ 2022-11-29 12:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #6 from SASANO Takayoshi <uaa at mx5 dot nisiq.net> ---
Created attachment 53980
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53980&action=edit
rewrite int options -> int32_t options
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (5 preceding siblings ...)
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
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-05 13:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-01-05
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (6 preceding siblings ...)
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
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mike at mnmoran dot org @ 2023-02-24 15:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
Michael N. Moran <mike at mnmoran dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mike at mnmoran dot org
--- Comment #7 from Michael N. Moran <mike at mnmoran dot org> ---
Created attachment 54530
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54530&action=edit
Assembler file produced from cp-demangle.c
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (7 preceding siblings ...)
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
10 siblings, 0 replies; 12+ messages in thread
From: mike at mnmoran dot org @ 2023-02-24 15:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #8 from Michael N. Moran <mike at mnmoran dot org> ---
I tried to build with after patching with
https://gcc.gnu.org/bugzilla/attachment.cgi?id=53980 and now get an assembler
failure.
/tmp/cc2C1wMh.s: Assembler messages:
/tmp/cc2C1wMh.s:82060: Error: value of 00012570 too large for field of 2 bytes
at 00000002
I created a corresponding cp-demangle.s file and attached it
https://gcc.gnu.org/bugzilla/attachment.cgi?id=54530
The offending line looks like this:
.Ldebug_line0:
.2byte 0, .LELT0-.LSLT0 <<<<<< line 82060
.LSLT0:
.2byte 0x5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (8 preceding siblings ...)
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
10 siblings, 0 replies; 12+ messages in thread
From: uaa at mx5 dot nisiq.net @ 2023-02-26 12:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #9 from SASANO Takayoshi <uaa at mx5 dot nisiq.net> ---
(In reply to Michael N. Moran from comment #8)
> I created a corresponding cp-demangle.s file and attached it
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54530
Please read this thread carefully, currently this issue targets
H8 advanced mode (24bit address). Your attachment says that
the code is compiled for H8 normal mode (16bit address).
> .file "cp-demangle.c"
> .h8300hn
> .section .text
But, we have to consider why the problem has occurred.
> .Ldebug_ranges3:
> .section .debug_line,"",@progbits
> .Ldebug_line0:
> .2byte 0, .LELT0-.LSLT0
> .LSLT0:
> .2byte 0x5
(snip)
>
> .byte 0x1
> .LELT0:
> .section .debug_str,"MS",@progbits,1
> .LASF248:
(.LELT0 - .LSLT0) shows the size of .debug_line section.
The reported problem means "allocated bitwidth for .Ldebug_line0
is insufficient to store the size of .debug_line section".
I think this is out of topic, should be handled at more suitable place.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug demangler/107884] H8/300: cp-demangle.c fix warning related demangle.h
2022-11-26 23:16 [Bug libstdc++/107884] New: H8/300: cp-demangle.c fix warning related demangle.h uaa at mx5 dot nisiq.net
` (9 preceding siblings ...)
2023-02-26 12:34 ` uaa at mx5 dot nisiq.net
@ 2023-02-26 14:58 ` mike at mnmoran dot org
10 siblings, 0 replies; 12+ messages in thread
From: mike at mnmoran dot org @ 2023-02-26 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107884
--- Comment #10 from Michael N. Moran <mike at mnmoran dot org> ---
(In reply to SASANO Takayoshi from comment #9)
> (In reply to Michael N. Moran from comment #8)
> > I created a corresponding cp-demangle.s file and attached it
> > https://gcc.gnu.org/bugzilla/attachment.cgi?id=54530
>
> Please read this thread carefully, currently this issue targets
> H8 advanced mode (24bit address). Your attachment says that
> the code is compiled for H8 normal mode (16bit address).
>
> > .file "cp-demangle.c"
> > .h8300hn
> > .section .text
>
Indeed. It has been a long time since I looked a all of the modes for the
H8/300.
> But, we have to consider why the problem has occurred.
>
> > .Ldebug_ranges3:
> > .section .debug_line,"",@progbits
> > .Ldebug_line0:
> > .2byte 0, .LELT0-.LSLT0
> > .LSLT0:
> > .2byte 0x5
> (snip)
> >
> > .byte 0x1
> > .LELT0:
> > .section .debug_str,"MS",@progbits,1
> > .LASF248:
>
> (.LELT0 - .LSLT0) shows the size of .debug_line section.
>
> The reported problem means "allocated bitwidth for .Ldebug_line0
> is insufficient to store the size of .debug_line section".
>
> I think this is out of topic, should be handled at more suitable place.
Yes, I divined this later and, after a lot of trial-and-error with various
configuration options, found a configure incantation that seems to work.
Among other things, this configuration used --disable-hosted-libstdcxx, which
prevented the use of `cp-demangle.c` in the build.
configure --target=h8300-none-elf --with-newlib
--disable-newlib-supplied-syscalls --enable-languages=c,c++,lto
--with-libstdcxx-zoneinfo=n --disable-shared --disable-__cxa_atexit
--disable-libstdcxx-verbose --disable-hosted-libstdcxx --disable-libstdcxx-pch
^ permalink raw reply [flat|nested] 12+ messages in thread