public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
@ 2020-12-14 11:27 acoplan at gcc dot gnu.org
  2020-12-14 13:55 ` [Bug rtl-optimization/98271] " acoplan at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-14 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98271
           Summary: ICE in apply_scale, at profile-count.h:1082 with large
                    --param=align-loop-iterations
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

The following fails:

$ cat test.c
void a() {
  for (;;)
    ;
}

$ aarch64-elf-gcc -c -O --param=align-loop-iterations=1197120096074465280
test.c
during RTL pass: alignments
test.c: In function 'a':
test.c:4:1: internal compiler error: in apply_scale, at profile-count.h:1082
    4 | }
      | ^
0x9e0637 profile_count::apply_scale(long, long) const
        /home/alecop01/toolchain/src/gcc/gcc/profile-count.h:1082
0x9e0637 compute_alignments()
        /home/alecop01/toolchain/src/gcc/gcc/final.c:746
0x9e086e execute
        /home/alecop01/toolchain/src/gcc/gcc/final.c:825
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.

This appears to the minimum value of align-loop-iterations at which GCC ICEs
here.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/98271] ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
  2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
@ 2020-12-14 13:55 ` acoplan at gcc dot gnu.org
  2020-12-14 16:32 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-14 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alex Coplan <acoplan at gcc dot gnu.org> ---
On further investigation, it seems we ICE when align-loop-iterations is 2^31
and above (i.e. if it's negative, treated as a 32-bit signed integer).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/98271] ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
  2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
  2020-12-14 13:55 ` [Bug rtl-optimization/98271] " acoplan at gcc dot gnu.org
@ 2020-12-14 16:32 ` marxin at gcc dot gnu.org
  2020-12-14 16:33 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-14 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2020-12-14
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
We end up with:

(gdb) p global_options.x_param_align_loop_iterations 
$3 = -2147483648

I'm gonna fix this, we need param overflow check.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/98271] ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
  2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
  2020-12-14 13:55 ` [Bug rtl-optimization/98271] " acoplan at gcc dot gnu.org
  2020-12-14 16:32 ` marxin at gcc dot gnu.org
@ 2020-12-14 16:33 ` marxin at gcc dot gnu.org
  2020-12-16  9:21 ` cvs-commit at gcc dot gnu.org
  2020-12-16  9:22 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-14 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
All params we have are of int type:

#ifdef GENERATOR_FILE
extern int param_align_loop_iterations;
#else
  int x_param_align_loop_iterations;
#define param_align_loop_iterations
global_options.x_param_align_loop_iterations

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/98271] ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
  2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-14 16:33 ` marxin at gcc dot gnu.org
@ 2020-12-16  9:21 ` cvs-commit at gcc dot gnu.org
  2020-12-16  9:22 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-16  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:5c5eb7e4872025e8d5e8ae2f0e568403f7c8803d

commit r11-6111-g5c5eb7e4872025e8d5e8ae2f0e568403f7c8803d
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Dec 15 09:57:19 2020 +0100

    options: fix integer overflow

    gcc/ChangeLog:

            PR rtl-optimization/98271
            PR rtl-optimization/98276
            PR tree-optimization/98279
            * opts-common.c (set_option): Do not allow overflow for integer
            arguments.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/98271
            PR rtl-optimization/98276
            PR tree-optimization/98279
            * gcc.dg/pr98271.c: New test.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/98271] ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations
  2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-12-16  9:21 ` cvs-commit at gcc dot gnu.org
@ 2020-12-16  9:22 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-16  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-16  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 11:27 [Bug rtl-optimization/98271] New: ICE in apply_scale, at profile-count.h:1082 with large --param=align-loop-iterations acoplan at gcc dot gnu.org
2020-12-14 13:55 ` [Bug rtl-optimization/98271] " acoplan at gcc dot gnu.org
2020-12-14 16:32 ` marxin at gcc dot gnu.org
2020-12-14 16:33 ` marxin at gcc dot gnu.org
2020-12-16  9:21 ` cvs-commit at gcc dot gnu.org
2020-12-16  9:22 ` marxin at gcc dot gnu.org

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).