* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
@ 2021-11-14 8:56 ` marxin at gcc dot gnu.org
2021-11-14 9:21 ` [Bug ipa/103230] New: " Jan Hubicka
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-14 8:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Known to fail| |12.0
Priority|P3 |P1
Last reconfirmed| |2021-11-14
Target Milestone|--- |12.0
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
2021-11-14 8:56 ` [Bug ipa/103230] " marxin at gcc dot gnu.org
@ 2021-11-14 9:21 ` Jan Hubicka
2021-11-14 9:21 ` [Bug ipa/103230] " hubicka at kam dot mff.cuni.cz
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jan Hubicka @ 2021-11-14 9:21 UTC (permalink / raw)
To: marxin at gcc dot gnu.org; +Cc: gcc-bugs
> Happens with UBSAN compiler for:
>
> $ gcc gcc/testsuite/gcc.c-torture/execute/pr71494.c -O1 -flto
> ...
> /home/marxin/Programming/gcc/gcc/ipa-modref-tree.h:550:33: runtime error: load
> of value 255, which is not a valid value for type 'bool'
> #0 0x18acc38 in modref_tree<tree_node*>::merge(modref_tree<tree_node*>*,
> vec<modref_parm_map, va_heap, vl_ptr>*, modref_parm_map*, bool)
> /home/marxin/Programming/gcc/gcc/ipa-modref-tree.h:550
> #1 0x188452c in modref_propagate_in_scc
At 4385 I have:
changed |= cur_summary_lto->stores->merge
(callee_summary_lto->stores, &parm_map, &chain_map, !first);
parm-map is the vector, however there is no read of it.
There is bool which is relevant only when parm_index is not unknown, so
I suspect it may a full copy with uninitialized bool which would be
harmless. We had similar issues with asan before.
How do you build ubsan compiler?
Honza
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
2021-11-14 8:56 ` [Bug ipa/103230] " marxin at gcc dot gnu.org
2021-11-14 9:21 ` [Bug ipa/103230] New: " Jan Hubicka
@ 2021-11-14 9:21 ` hubicka at kam dot mff.cuni.cz
2021-11-14 9:26 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2021-11-14 9:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #1 from hubicka at kam dot mff.cuni.cz ---
> Happens with UBSAN compiler for:
>
> $ gcc gcc/testsuite/gcc.c-torture/execute/pr71494.c -O1 -flto
> ...
> /home/marxin/Programming/gcc/gcc/ipa-modref-tree.h:550:33: runtime error: load
> of value 255, which is not a valid value for type 'bool'
> #0 0x18acc38 in modref_tree<tree_node*>::merge(modref_tree<tree_node*>*,
> vec<modref_parm_map, va_heap, vl_ptr>*, modref_parm_map*, bool)
> /home/marxin/Programming/gcc/gcc/ipa-modref-tree.h:550
> #1 0x188452c in modref_propagate_in_scc
At 4385 I have:
changed |= cur_summary_lto->stores->merge
(callee_summary_lto->stores, &parm_map, &chain_map, !first);
parm-map is the vector, however there is no read of it.
There is bool which is relevant only when parm_index is not unknown, so
I suspect it may a full copy with uninitialized bool which would be
harmless. We had similar issues with asan before.
How do you build ubsan compiler?
Honza
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (2 preceding siblings ...)
2021-11-14 9:21 ` [Bug ipa/103230] " hubicka at kam dot mff.cuni.cz
@ 2021-11-14 9:26 ` marxin at gcc dot gnu.org
2021-11-14 9:47 ` Jan Hubicka
2021-11-14 9:47 ` hubicka at kam dot mff.cuni.cz
` (7 subsequent siblings)
11 siblings, 1 reply; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-14 9:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
> How do you build ubsan compiler?
F="-O0 -g -fsanitize=undefined" ; make -j16 all-host -k CFLAGS="$F"
CXXFLAGS="$F" LDFLAGS="$F"
is the fastest approach.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (3 preceding siblings ...)
2021-11-14 9:26 ` marxin at gcc dot gnu.org
@ 2021-11-14 9:47 ` hubicka at kam dot mff.cuni.cz
2021-11-14 10:01 ` marxin at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2021-11-14 9:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #3 from hubicka at kam dot mff.cuni.cz ---
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
>
> --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
> > How do you build ubsan compiler?
>
> F="-O0 -g -fsanitize=undefined" ; make -j16 all-host -k CFLAGS="$F"
> CXXFLAGS="$F" LDFLAGS="$F"
>
> is the fastest approach.
Thanks, it is similar to what I tried. I guess there should be no ";"
but yet it leds to misconfigured libiberty for me on kunlun. I will
look into that.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (4 preceding siblings ...)
2021-11-14 9:47 ` hubicka at kam dot mff.cuni.cz
@ 2021-11-14 10:01 ` marxin at gcc dot gnu.org
2021-11-14 10:04 ` marxin at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-14 10:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to hubicka from comment #3)
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
> >
> > --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
> > > How do you build ubsan compiler?
> >
> > F="-O0 -g -fsanitize=undefined" ; make -j16 all-host -k CFLAGS="$F"
> > CXXFLAGS="$F" LDFLAGS="$F"
> >
> > is the fastest approach.
> Thanks, it is similar to what I tried. I guess there should be no ";"
> but yet it leds to misconfigured libiberty for me on kunlun. I will
> look into that.
Note that kunlun may have an old system GCC compiler.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (5 preceding siblings ...)
2021-11-14 10:01 ` marxin at gcc dot gnu.org
@ 2021-11-14 10:04 ` marxin at gcc dot gnu.org
2021-11-16 8:46 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-14 10:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
The canonical approach would be using config/bootstrap-ubsan.mk config file.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (6 preceding siblings ...)
2021-11-14 10:04 ` marxin at gcc dot gnu.org
@ 2021-11-16 8:46 ` marxin at gcc dot gnu.org
2021-11-18 9:30 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-16 8:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Still reproduces with the current master:
g:e69b7c5779863469479698f863ab25e0d9b4586e.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (7 preceding siblings ...)
2021-11-16 8:46 ` marxin at gcc dot gnu.org
@ 2021-11-18 9:30 ` pinskia at gcc dot gnu.org
2021-11-18 12:12 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-18 9:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think it is changed that is being read here.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (8 preceding siblings ...)
2021-11-18 9:30 ` pinskia at gcc dot gnu.org
@ 2021-11-18 12:12 ` marxin at gcc dot gnu.org
2021-11-19 11:33 ` cvs-commit at gcc dot gnu.org
2021-11-19 11:34 ` marxin at gcc dot gnu.org
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-18 12:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got a patch candidate for it.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (9 preceding siblings ...)
2021-11-18 12:12 ` marxin at gcc dot gnu.org
@ 2021-11-19 11:33 ` cvs-commit at gcc dot gnu.org
2021-11-19 11:34 ` marxin at gcc dot gnu.org
11 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-19 11:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:
https://gcc.gnu.org/g:74a4ece02df1b1b6f396fd0e24dbbf8b0897858a
commit r12-5399-g74a4ece02df1b1b6f396fd0e24dbbf8b0897858a
Author: Martin Liska <mliska@suse.cz>
Date: Thu Nov 18 13:14:25 2021 +0100
Fix IPA modref ubsan.
modref_tree<tree_node*>::merge(modref_tree<tree_node*>*,
vec<modref_parm_map, va_heap, vl_ptr>*, modref_parm_map*, bool)
is called with modref_parm_map chain_map;
The variable has uninitialized m.parm_offset_known and it is accessed
here:
gcc/ipa-modref-tree.h:572 a.parm_offset_known &= m.parm_offset_known;
PR ipa/103230
gcc/ChangeLog:
* ipa-modref-tree.h (struct modref_parm_map): Add default
constructor.
* ipa-modref.c (ipa_merge_modref_summary_after_inlining): Use it.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/103230] ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool'
2021-11-14 8:55 [Bug ipa/103230] New: ipa-modref-tree.h:550:33: runtime error: load of value 255, which is not a valid value for type 'bool' marxin at gcc dot gnu.org
` (10 preceding siblings ...)
2021-11-19 11:33 ` cvs-commit at gcc dot gnu.org
@ 2021-11-19 11:34 ` marxin at gcc dot gnu.org
11 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-19 11:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103230
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread