* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
@ 2024-06-23 10:38 ` ebotcazou at gcc dot gnu.org
2024-06-23 10:47 ` ebotcazou at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-23 10:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu.org
Summary|ICE in riscv64-elf cross |internal error on global
|compiler, handling imported |variable-length array
|addresses |
Build|x86_64-apple-darwin21.6.0 |
Status|UNCONFIRMED |NEW
Component|ada |target
Last reconfirmed| |2024-06-23
Ever confirmed|0 |1
--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It's a buglet in the RISC-V back-end:
(gdb) bt
#0 internal_error (gmsgid=0x584aa67 "in %s, at %s:%d")
at /home/eric/cvs/gcc/gcc/diagnostic.cc:2255
#1 0x0000000004ad30a2 in fancy_abort (
file=0x4ea1be0 "/home/eric/cvs/gcc/gcc/tree.cc", line=6488,
function=0x4ea3cc1 "tree_to_uhwi")
at /home/eric/cvs/gcc/gcc/diagnostic.cc:2380
#2 0x0000000002469386 in tree_to_uhwi (t=0x7ffff705aca8)
at /home/eric/cvs/gcc/gcc/tree.cc:6488
#3 0x0000000002555b2e in riscv_valid_lo_sum_p (sym_type=SYMBOL_ABSOLUTE,
mode=E_BLKmode, x=0x7ffff717bb58)
at /home/eric/cvs/gcc/gcc/config/riscv/riscv.cc:1706
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
2024-06-23 10:38 ` [Bug target/115591] internal error on global variable-length array ebotcazou at gcc dot gnu.org
@ 2024-06-23 10:47 ` ebotcazou at gcc dot gnu.org
2024-06-23 14:42 ` simon at pushface dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-23 10:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The immediate fix is:
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index c17141d909a..5e34dc92210 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -1702,7 +1702,9 @@ riscv_valid_lo_sum_p (enum riscv_symbol_type sym_type,
machine_mode mode,
align = (SYMBOL_REF_DECL (x)
? DECL_ALIGN (SYMBOL_REF_DECL (x))
: 1);
- size = (SYMBOL_REF_DECL (x) && DECL_SIZE (SYMBOL_REF_DECL (x))
+ size = (SYMBOL_REF_DECL (x)
+ && DECL_SIZE (SYMBOL_REF_DECL (x))
+ && tree_fits_uhwi_p (DECL_SIZE (SYMBOL_REF_DECL (x)))
? tree_to_uhwi (DECL_SIZE (SYMBOL_REF_DECL (x)))
: 2*BITS_PER_WORD);
}
but I cannot really test it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
2024-06-23 10:38 ` [Bug target/115591] internal error on global variable-length array ebotcazou at gcc dot gnu.org
2024-06-23 10:47 ` ebotcazou at gcc dot gnu.org
@ 2024-06-23 14:42 ` simon at pushface dot org
2024-06-24 10:54 ` simon at pushface dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: simon at pushface dot org @ 2024-06-23 14:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #3 from simon at pushface dot org ---
On 23 Jun 2024, at 11:47, ebotcazou at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
>
> --- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The immediate fix is:
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index c17141d909a..5e34dc92210 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -1702,7 +1702,9 @@ riscv_valid_lo_sum_p (enum riscv_symbol_type sym_type,
> machine_mode mode,
> align = (SYMBOL_REF_DECL (x)
> ? DECL_ALIGN (SYMBOL_REF_DECL (x))
> : 1);
> - size = (SYMBOL_REF_DECL (x) && DECL_SIZE (SYMBOL_REF_DECL (x))
> + size = (SYMBOL_REF_DECL (x)
> + && DECL_SIZE (SYMBOL_REF_DECL (x))
> + && tree_fits_uhwi_p (DECL_SIZE (SYMBOL_REF_DECL (x)))
> ? tree_to_uhwi (DECL_SIZE (SYMBOL_REF_DECL (x)))
> : 2*BITS_PER_WORD);
> }
>
> but I cannot really test it.
Can I help with testing? (beyond applying the patch and checking that the error
is fixed)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
` (2 preceding siblings ...)
2024-06-23 14:42 ` simon at pushface dot org
@ 2024-06-24 10:54 ` simon at pushface dot org
2024-06-25 9:06 ` ebotcazou at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: simon at pushface dot org @ 2024-06-24 10:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #4 from simon at pushface dot org ---
bug.adb compiles without error after applying the patch.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
` (3 preceding siblings ...)
2024-06-24 10:54 ` simon at pushface dot org
@ 2024-06-25 9:06 ` ebotcazou at gcc dot gnu.org
2024-07-02 16:56 ` law at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-25 9:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Jeff, this looks like an obvious fix given the comment just above the modified
code, but only a maintainer can probably assess that.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
` (4 preceding siblings ...)
2024-06-25 9:06 ` ebotcazou at gcc dot gnu.org
@ 2024-07-02 16:56 ` law at gcc dot gnu.org
2024-07-02 17:15 ` ebotcazou at gcc dot gnu.org
2024-07-02 19:19 ` law at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2024-07-02 16:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #6 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Eric,
Just threw this into my tester. Figure ~90 minutes to get back the cross
results.
I assume that if we go forward that you'll handle putting together a regression
test since it's Ada source?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
` (5 preceding siblings ...)
2024-07-02 16:56 ` law at gcc dot gnu.org
@ 2024-07-02 17:15 ` ebotcazou at gcc dot gnu.org
2024-07-02 19:19 ` law at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-07-02 17:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Just threw this into my tester. Figure ~90 minutes to get back the cross
> results.
Thanks!
> I assume that if we go forward that you'll handle putting together a
> regression test since it's Ada source?
Yes, will do.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/115591] internal error on global variable-length array
2024-06-22 13:23 [Bug ada/115591] New: ICE in riscv64-elf cross compiler, handling imported addresses simon at pushface dot org
` (6 preceding siblings ...)
2024-07-02 17:15 ` ebotcazou at gcc dot gnu.org
@ 2024-07-02 19:19 ` law at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2024-07-02 19:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115591
--- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Passed without issue. I'll go ahead and ACK the patch here. It's good to go
IMHO.
^ permalink raw reply [flat|nested] 9+ messages in thread