This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/60960] [4.8/4.9/4.10 Regression] Wrong result when a vector variable is divided by a literal constant
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Apr 2014 07:12:10 +0000
- Subject: [Bug middle-end/60960] [4.8/4.9/4.10 Regression] Wrong result when a vector variable is divided by a literal constant
- Auto-submitted: auto-generated
- References: <bug-60960-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60960
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.8.3
Summary|Wrong result when a vector |[4.8/4.9/4.10 Regression]
|variable is divided by a |Wrong result when a vector
|literal constant |variable is divided by a
| |literal constant
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
typedef unsigned char v4qi __attribute__ ((vector_size (4)));
__attribute__((noinline, noclone)) v4qi
f1 (v4qi v)
{
return v / 2;
}
__attribute__((noinline, noclone)) v4qi
f2 (v4qi v)
{
return v / (v4qi) { 2, 2, 2, 2 };
}
__attribute__((noinline, noclone)) v4qi
f3 (v4qi x, v4qi y)
{
return x / y;
}
int
main ()
{
v4qi x = { 5, 5, 5, 5 };
v4qi y = { 2, 2, 2, 2 };
v4qi z = f1 (x);
if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
__builtin_abort ();
z = f2 (x);
if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
__builtin_abort ();
z = f3 (x, y);
if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
__builtin_abort ();
return 0;
}
Started with my r189043. Will have a look.