public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/62058] New: Undefined behaviour in tree-data-ref.c with options -O1 -ftree-loop-vectorize
@ 2014-08-08  8:05 zeccav at gmail dot com
  2014-09-04 10:19 ` [Bug tree-optimization/62058] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zeccav at gmail dot com @ 2014-08-08  8:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 62058
           Summary: Undefined behaviour in tree-data-ref.c with options
                    -O1 -ftree-loop-vectorize
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com

/* from testsuite p60183.c */
/* gcc 4.9.1 -S -O1 -ftree-loop-vectorize */
/* ../../gcc-4.9.1/gcc/tree-data-ref.c:2423:16: runtime error: signed integer
overflow: 65536 * -65536 cannot be represented in type 'int' */
/* ../../gcc-4.9.1/gcc/tree-data-ref.c:2334:38: runtime error: signed integer
overflow: 1073741824 + 1073741824 cannot be represented in type 'int' */
/* ../../gcc-4.9.1/gcc/tree-data-ref.c:2425:16: runtime error: negation of
-2147483648 (INT_MIN) cannot be represented in type 'int'; cast to an unsigned
type to negate this value to itself */
/* ../../gcc-4.9.1/gcc/tree-data-ref.c:2424:16: runtime error: negation of
-2147483648 (INT_MIN) cannot be represented in type 'int'; cast to an unsigned
type to negate this value to itself */
/* on x86-64 from testsuite pr60183.c */
unsigned char c[0x30001] = { 1 };
int j = 0; /* independent of the j initialization value */ 

static void
foo (unsigned long *x, unsigned char *y)
{
  int i;
  unsigned long w = x[0];
  for (i = 0; i < j; i++)
    {
      w += *y;
      y += 0x10000;
      w += *y;
    }
  x[1] = w;
}

void
bar (unsigned long *x)
{
  foo (x, c);
}


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

end of thread, other threads:[~2021-02-27  9:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08  8:05 [Bug c/62058] New: Undefined behaviour in tree-data-ref.c with options -O1 -ftree-loop-vectorize zeccav at gmail dot com
2014-09-04 10:19 ` [Bug tree-optimization/62058] " mpolacek at gcc dot gnu.org
2014-10-30 10:42 ` jakub at gcc dot gnu.org
2015-06-26 20:07 ` jakub at gcc dot gnu.org
2015-06-26 20:35 ` jakub at gcc dot gnu.org
2015-06-26 21:20 ` pinskia at gcc dot gnu.org
2015-08-24 12:12 ` zeccav at gmail dot com
2021-02-27  9:34 ` zeccav at gmail dot com

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