public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105753] New: [avr] ICE: in add_clobbers, at config/avr/avr-dimode.md:2705
@ 2022-05-27 22:35 filip.hejsek at gmail dot com
  2022-05-28  2:55 ` [Bug target/105753] " filip.hejsek at gmail dot com
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: filip.hejsek at gmail dot com @ 2022-05-27 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105753
           Summary: [avr] ICE: in add_clobbers, at
                    config/avr/avr-dimode.md:2705
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.hejsek at gmail dot com
  Target Milestone: ---
            Target: avr

GCC fails when compiling the following C program for AVR (with at least -O1):

int digit_sum(unsigned long n) {
  int sum = 0;

  do {
    int x = n % 10;
    n /= 10;
    sum += x;
  } while(n);

  return sum;
}

I have tested both GCC 12.1.0 form Arch Linux and a development version (GCC
13.0.0) compiled from git sources.

Here is the compiler output:

$ ~/avr_gcc_install/bin/avr-gcc -c -O1 bug.c
during RTL pass: combine
bug.c: In function ‘digit_sum’:
bug.c:13:1: internal compiler error: in add_clobbers, at
config/avr/avr-dimode.md:2705
   13 | }
      | ^
0x770d30 add_clobbers(rtx_def*, int)
        ../../gcc/gcc/config/avr/avr-dimode.md:2705
0x1645c94 recog_for_combine_1
        ../../gcc/gcc/combine.cc:11422
0x164979e recog_for_combine
        ../../gcc/gcc/combine.cc:11622
0x165aef7 try_combine
        ../../gcc/gcc/combine.cc:3543
0x165e72f combine_instructions
        ../../gcc/gcc/combine.cc:1266
0x165e72f rest_of_handle_combine
        ../../gcc/gcc/combine.cc:14976
0x165e72f execute
        ../../gcc/gcc/combine.cc:15021
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ ~/avr_gcc_install/bin/avr-gcc -v
Using built-in specs.
Reading specs from
/home/filiph/avr_gcc_install/lib/gcc/avr/13.0.0/device-specs/specs-avr2
COLLECT_GCC=/home/filiph/avr_gcc_install/bin/avr-gcc
COLLECT_LTO_WRAPPER=/home/filiph/avr_gcc_install/libexec/gcc/avr/13.0.0/lto-wrapper
Target: avr
Configured with: ../gcc/configure --prefix=/home/filiph/avr_gcc_install
--target=avr --enable-languages=c --with-as=/usr/bin/avr-as --with-gnu-as
--with-ld=/usr/bin/avr-ld --with-gnu-ld
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20220525 (experimental) [master -gda2c56ee6] (GCC) 

$ avr-gcc -c -O1 bug.c
during RTL pass: combine
bug.c: In function 'digit_sum':
bug.c:13:1: internal compiler error: in add_clobbers, at
config/avr/avr-dimode.md:2705
   13 | }
      | ^
0x140115b diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x140209d internal_error(char const*, ...)
        ???:0
0x5bafbc fancy_abort(char const*, int, char const*)
        ???:0
0x5b1839 add_clobbers(rtx_def*, int) [clone .cold]
        ???:0
0x1213b97 recog_for_combine_1(rtx_def**, rtx_insn*, rtx_def**)
        ???:0
0x1215e8e recog_for_combine(rtx_def**, rtx_insn*, rtx_def**)
        ???:0
0x1228da5 try_combine(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, int*,
rtx_insn*)
        ???:0
0x122c0a4 (anonymous namespace)::pass_combine::execute(function*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ avr-gcc -v
Using built-in specs.
Reading specs from /usr/lib/gcc/avr/12.1.0/device-specs/specs-avr2
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/12.1.0/lto-wrapper
Target: avr
Configured with: /build/avr-gcc/src/gcc-12.1.0/configure
--disable-install-libiberty --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-linker-build-id --disable-nls
--disable-werror --disable-__cxa_atexit --enable-checking=release
--enable-clocale=gnu --enable-gnu-unique-object --enable-gold
--enable-languages=c,c++ --enable-ld=default --enable-lto --enable-plugin
--enable-shared --infodir=/usr/share/info --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --prefix=/usr --target=avr
--with-as=/usr/bin/avr-as --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/avr-ld
--with-plugin-ld=ld.gold --with-system-zlib --with-isl
--enable-gnu-indirect-function
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.0 (GCC) 

(This bug seems to be similar to bug 88051, but that one was on i386.)

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

end of thread, other threads:[~2023-05-20  6:46 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 22:35 [Bug target/105753] New: [avr] ICE: in add_clobbers, at config/avr/avr-dimode.md:2705 filip.hejsek at gmail dot com
2022-05-28  2:55 ` [Bug target/105753] " filip.hejsek at gmail dot com
2022-06-04 22:19 ` pinskia at gcc dot gnu.org
2022-06-12 23:41 ` filip.hejsek at gmail dot com
2022-06-12 23:48 ` pinskia at gcc dot gnu.org
2022-09-11 10:19 ` triffid.hunter at gmail dot com
2022-09-25 21:45 ` pinskia at gcc dot gnu.org
2022-10-02  8:06 ` rainer-gcc at wwad dot de
2022-12-09 14:26 ` fiesh at zefix dot tv
2022-12-09 14:31 ` fiesh at zefix dot tv
2023-01-25 18:45 ` user99627 at gmx dot com
2023-01-25 19:39 ` user99627 at gmx dot com
2023-01-31 23:26 ` user99627 at gmx dot com
2023-02-01  7:48 ` fiesh at zefix dot tv
2023-02-01 10:36 ` user99627 at gmx dot com
2023-04-20 19:55 ` gjl at gcc dot gnu.org
2023-04-20 20:40 ` [Bug rtl-optimization/105753] " gjl at gcc dot gnu.org
2023-04-21  7:47 ` gjl at gcc dot gnu.org
2023-04-21  9:00 ` gjl at gcc dot gnu.org
2023-04-23 10:58 ` gjl at gcc dot gnu.org
2023-05-20  5:53 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:20 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:35 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:46 ` gjl 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).