[Bug tree-optimization/98279] ICE in apply_scale with --param=hot-bb-frequency-fraction >= 2^31

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 14 14:55:29 GMT 2020


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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #1 from ktkachov at gcc dot gnu.org ---
(In reply to Alex Coplan from comment #0)
> The following fails:
> 
> $ cat test.c
> int a() {}
> $ aarch64-elf-gcc test.c -c -O --param=hot-bb-frequency-fraction=2147483648
> during GIMPLE pass: cdce
> test.c: In function 'a':
> test.c:1:5: internal compiler error: in apply_scale, at profile-count.h:1082
>     1 | int a() {}
>       |     ^
> 0xcf2c8d profile_count::apply_scale(long, long) const
>         /home/alecop01/toolchain/src/gcc/gcc/profile-count.h:1082
> 0xce6ed7 maybe_hot_count_p(function*, profile_count)
>         /home/alecop01/toolchain/src/gcc/gcc/predict.c:175
> 0xce7459 maybe_hot_bb_p(function*, basic_block_def const*)
>         /home/alecop01/toolchain/src/gcc/gcc/predict.c:193
> 0xce76c1 optimize_bb_for_size_p(basic_block_def const*)
>         /home/alecop01/toolchain/src/gcc/gcc/predict.c:301
> 0xe11269 execute
>         /home/alecop01/toolchain/src/gcc/gcc/tree-call-cdce.c:1195
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <https://gcc.gnu.org/bugs/> for instructions.
> 
> Related to PR98271 and PR98276 (both ICEs that occur when a --param is >=
> 2^31). Perhaps a meta-bug would be useful here?
> 
> Equally, perhaps I'm misunderstanding the contract for --param values: are
> these meant to be user-facing or internal? I.e. is it expected that the
> compiler ICEs if the user provides an unreasonable value for the param?

My understanding is the compiler should never ICE, even for developer-oriented
params. The fact that this is an ICE due to an outrageous input to a param
would lower the priority of the bug, but it doesn't invalidate it.


More information about the Gcc-bugs mailing list