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

            Bug ID: 84912
           Summary: __builtin_divde* produce Internal Compiler Error when
                    compiled -m32
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kelvin at gcc dot gnu.org
  Target Milestone: ---

__builtin_divde, __builtin_divdeo, __builtin_divdeu, __builtin_divdeou are all
documented to require a 64-bit environment.  However, the implementation of
these builtins does not enforce this.

Compile $GCC_SRC/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c with
options -m32 to see the problem.  Here is a captured trace:

$GCC_INSTALL/bin/gcc -B$GCC_BUILD/gcc/ -m32 -o0 -Wall -Wno-deprecated -o
extend-divide-2 extend-divide-2.c
extend-divide-2.c: In function ‘div_de’:
extend-divide-2.c:17:1: error: unrecognizable insn:
 }
 ^
(insn 15 14 16 2 (set (reg:DI 123 [ _3 ])
        (unspec:DI [
                (reg:DI 121 [ _1 ])
                (reg:DI 122 [ _2 ])
            ] UNSPEC_DIVE)) "extend-divide-2.c":16 -1
     (nil))
during RTL pass: vregs
extend-divide-2.c:17:1: internal compiler error: in extract_insn, at
recog.c:2304
0x1013775f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /home/kelvin/gcc/gcc-trunk/gcc/rtl-error.c:108
0x101377a3 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /home/kelvin/gcc/gcc-trunk/gcc/rtl-error.c:116
0x1087eb4b extract_insn(rtx_insn*)
        /home/kelvin/gcc/gcc-trunk/gcc/recog.c:2304
0x105751af instantiate_virtual_regs_in_insn
        /home/kelvin/gcc/gcc-trunk/gcc/function.c:1591
0x105751af instantiate_virtual_regs
        /home/kelvin/gcc/gcc-trunk/gcc/function.c:1959
0x105751af execute
        /home/kelvin/gcc/gcc-trunk/gcc/function.c:2008
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.
make: *** [extend-divide-2] Error 1

Reply via email to