public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/60613] New: Invalid signed subtraction ubsan diagnostics
@ 2014-03-21 14:44 jakub at gcc dot gnu.org
  2014-03-21 14:49 ` [Bug sanitizer/60613] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-21 14:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60613

            Bug ID: 60613
           Summary: Invalid signed subtraction ubsan diagnostics
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: jakub at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

On x86_64-linux with -O2 -m32 -fsanitize=undefined on:
__attribute__((noinline, noclone)) long long
foo (long long y)
{
  asm ("");
  return 8LL - y;
}

int
main ()
{
  foo (1);
  return 0;
}

we get invalid diagnostics:
runtime error: signed integer overflow: 8 - 1 cannot be represented in type
'long long int'


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

end of thread, other threads:[~2014-03-22 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 14:44 [Bug sanitizer/60613] New: Invalid signed subtraction ubsan diagnostics jakub at gcc dot gnu.org
2014-03-21 14:49 ` [Bug sanitizer/60613] " mpolacek at gcc dot gnu.org
2014-03-21 15:28 ` jakub at gcc dot gnu.org
2014-03-22 16:26 ` jakub at gcc dot gnu.org
2014-03-22 16:27 ` jakub 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).