public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/97939] New: ICE on sparc64 with UBsan for "i + 4096" on long: unrecognizable insn during RTL pass: vregs
@ 2020-11-23  0:48 vincent-gcc at vinc17 dot net
  2020-11-23  0:49 ` [Bug target/97939] " vincent-gcc at vinc17 dot net
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vincent-gcc at vinc17 dot net @ 2020-11-23  0:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97939
           Summary: ICE on sparc64 with UBsan for "i + 4096" on long:
                    unrecognizable insn during RTL pass: vregs
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent-gcc at vinc17 dot net
  Target Milestone: ---

On the following code:

long f (long i)
{
  return i + 4096;
}

I get:

vinc17@gcc202:~$ gcc -fsanitize=undefined -c tst.c
tst.c: In function ‘f’:
tst.c:4:1: error: unrecognizable insn:
    4 | }
      | ^
(insn 7 6 8 2 (parallel [
            (set (reg:CCXV 100 %icc)
                (compare:CCXV (plus:DI (reg:DI 113)
                        (const_int 4096 [0x1000]))
                    (unspec:DI [
                            (reg:DI 113)
                            (const_int 4096 [0x1000])
                        ] UNSPEC_ADDV)))
            (set (reg:DI 112)
                (plus:DI (reg:DI 113)
                    (const_int 4096 [0x1000])))
        ]) "tst.c":3:12 -1
     (nil))
during RTL pass: vregs
tst.c:4:1: internal compiler error: in extract_insn, at recog.c:2294
0xfff8000100e72803 __libc_start_main
        ./csu/libc-start.c:308

I don't get any error on the following constants: 2048, 4095, 4097, 8192.
4096 seems special!

Note: I found this issue when trying to build GMP 6.2.1 with UBsan. The failure
occurs on extract-dbl.c at line

  exp = (exp + 64 * GMP_NUMB_BITS) / GMP_NUMB_BITS - 64 * GMP_NUMB_BITS /
GMP_NUMB_BITS + 1;

due to the "exp + 64 * GMP_NUMB_BITS" with GMP_NUMB_BITS = 64.

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

end of thread, other threads:[~2020-11-28 12:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23  0:48 [Bug target/97939] New: ICE on sparc64 with UBsan for "i + 4096" on long: unrecognizable insn during RTL pass: vregs vincent-gcc at vinc17 dot net
2020-11-23  0:49 ` [Bug target/97939] " vincent-gcc at vinc17 dot net
2020-11-23  8:04 ` ebotcazou at gcc dot gnu.org
2020-11-23  8:04 ` ebotcazou at gcc dot gnu.org
2020-11-26  8:25 ` dclarke at blastwave dot org
2020-11-27  7:55 ` dclarke at blastwave dot org
2020-11-27  9:08 ` ebotcazou at gcc dot gnu.org
2020-11-27  9:24 ` vincent-gcc at vinc17 dot net
2020-11-27  9:45 ` vincent-gcc at vinc17 dot net
2020-11-28 12:02 ` cvs-commit at gcc dot gnu.org
2020-11-28 12:03 ` cvs-commit at gcc dot gnu.org
2020-11-28 12:03 ` cvs-commit at gcc dot gnu.org
2020-11-28 12:04 ` ebotcazou 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).