public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/42542]  New:  g++ -O3 produces incorrect results for less-than operator
@ 2009-12-29 16:11 debian-gcc at lists dot debian dot org
  2009-12-29 19:41 ` [Bug other/42542] " hjl dot tools at gmail dot com
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2009-12-29 16:11 UTC (permalink / raw)
  To: gcc-bugs

seen at least on x86_64. bug submitter writes:

g++ appears to be (incorrectly) using a signed int comparison when -O3
optimization is enabled. Compiling with -O2 or lower produces the correct
output.

#include <numeric>
#include <iostream>

template <typename T>
struct maximum
{
    T operator()(T& a, T& b)
    { 
        return (a < b) ? b : a;
    }
};

int main(void)
{
    typedef unsigned int T;

    T data[13] = {2411691434,  187758716, 2874577865, 1532192406,
                   850395381, 3670100461, 1052104929,  352534891,
                  1000719294, 2219234747, 4264598888, 4166615811,
                  1898580612};

    T init = 0;

    T result = std::accumulate(data, data + 13, init, maximum<T>());

    std::cout << result << std::endl;

    return 0;
}

$ g++ -O2 -Wall bug.cpp && ./a.out 
4264598888
g++ -O3 -Wall bug.cpp && ./a.out 
1898580612


-- 
           Summary:  g++ -O3 produces incorrect results for less-than
                    operator
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org


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


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

* [Bug other/42542] g++ -O3 produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
@ 2009-12-29 19:41 ` hjl dot tools at gmail dot com
  2009-12-29 19:44 ` [Bug other/42542] g++ "-O -ftree-vectorize" " hjl dot tools at gmail dot com
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 19:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2009-12-29 19:41 -------
With -Wall, icc 11.1 complains:

pr42542.cc(10): remark #981: operands are evaluated in unspecified order
          return (a < b) ? b : a;
                    ^
          detected during instantiation of "_Tp std::accumulate(_InputIterator,
_InputIterator, _Tp, _BinaryOperation) [with _InputIterator=unsigned int *,
_Tp=unsigned int, _BinaryOperation=maximum<unsigned int>]" at line 25

Add "-fno-tree-vectorize" generates the correct result.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-12-29 19:41:02
               date|                            |


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


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

* [Bug other/42542] g++ "-O -ftree-vectorize" produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
  2009-12-29 19:41 ` [Bug other/42542] " hjl dot tools at gmail dot com
@ 2009-12-29 19:44 ` hjl dot tools at gmail dot com
  2009-12-29 19:45 ` hjl dot tools at gmail dot com
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-12-29 19:44 -------
Add "-ftree-vectorize" will cause it to fail.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|g++ -O3 produces incorrect  |g++ "-O -ftree-vectorize"
                   |results for less-than       |produces incorrect results
                   |operator                    |for less-than operator


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


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

* [Bug other/42542] g++ "-O -ftree-vectorize" produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
  2009-12-29 19:41 ` [Bug other/42542] " hjl dot tools at gmail dot com
  2009-12-29 19:44 ` [Bug other/42542] g++ "-O -ftree-vectorize" " hjl dot tools at gmail dot com
@ 2009-12-29 19:45 ` hjl dot tools at gmail dot com
  2009-12-29 19:52 ` hjl dot tools at gmail dot com
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 19:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2009-12-29 19:45 -------
It could be a target issue.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com


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


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

* [Bug other/42542] g++ "-O -ftree-vectorize" produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (2 preceding siblings ...)
  2009-12-29 19:45 ` hjl dot tools at gmail dot com
@ 2009-12-29 19:52 ` hjl dot tools at gmail dot com
  2009-12-29 20:48 ` hjl dot tools at gmail dot com
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2009-12-29 19:51 -------
There are no unsigned integer vector compare insns on x86.


-- 


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


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

* [Bug other/42542] g++ "-O -ftree-vectorize" produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (3 preceding siblings ...)
  2009-12-29 19:52 ` hjl dot tools at gmail dot com
@ 2009-12-29 20:48 ` hjl dot tools at gmail dot com
  2009-12-29 20:52 ` [Bug target/42542] " hjl dot tools at gmail dot com
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 20:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2009-12-29 20:48 -------
"-ftree-vectorize -msse4" works fine since it generates pmaxud in SSE4.1.
It seems that gcc doesn't properly emulate pmaxud.


-- 


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


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

* [Bug target/42542] g++ "-O -ftree-vectorize" produces incorrect results for less-than operator
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (4 preceding siblings ...)
  2009-12-29 20:48 ` hjl dot tools at gmail dot com
@ 2009-12-29 20:52 ` hjl dot tools at gmail dot com
  2009-12-29 21:40 ` [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers hjl dot tools at gmail dot com
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 20:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl dot tools at gmail dot com  2009-12-29 20:52 -------
The bug may be in "umaxv4si3" pattern.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|other                       |target


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (5 preceding siblings ...)
  2009-12-29 20:52 ` [Bug target/42542] " hjl dot tools at gmail dot com
@ 2009-12-29 21:40 ` hjl dot tools at gmail dot com
  2009-12-29 23:50 ` hjl dot tools at gmail dot com
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 21:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hjl dot tools at gmail dot com  2009-12-29 21:40 -------
Here is a testcase in C:

[hjl@gnu-6 tmp]$ cat y.c
unsigned int foo[] __attribute__ ((aligned(16))) =
{
  0x80000000, 1, 0xa0000000, 2,
  3, 0xd0000000, 0xf0000000, 0xe0000000
};
unsigned int bar[] __attribute__ ((aligned(16))) =
{
  4, 0xb0000000, 5, 0xc0000000,
  0xd0000000, 6, 7, 8
};

unsigned int val[] =
{
  0x80000000, 0xb0000000, 0xa0000000, 0xc0000000,
  0xd0000000, 0xd0000000, 0xf0000000, 0xe0000000
};

extern void abort ();

void
xxxx ()
{
  int i;

  for (i = 0; i < 8; i++)
    foo[i] = foo[i] < bar [i] ? bar [i] : foo[i];
}

int
main ()
{
  int i;

  xxxx ();
  for (i = 0; i < 8; i++)
    if (val[i] != foo[i])
      abort ();

  return 0;
}
[hjl@gnu-6 tmp]$ gcc /tmp/y.c -O2 -ftree-vectorize
[hjl@gnu-6 tmp]$ ./a.out 
Aborted (core dumped)
[hjl@gnu-6 tmp]$ 


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|                            |x86
            Summary|g++ "-O -ftree-vectorize"   |Vectorizer produces
                   |produces incorrect results  |incorrect results on max of
                   |for less-than operator      |signed intergers


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (6 preceding siblings ...)
  2009-12-29 21:40 ` [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers hjl dot tools at gmail dot com
@ 2009-12-29 23:50 ` hjl dot tools at gmail dot com
  2009-12-30  4:47 ` hjl dot tools at gmail dot com
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-29 23:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl dot tools at gmail dot com  2009-12-29 23:50 -------
Created an attachment (id=19420)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19420&action=view)
A patch

I don't see how we can easily check unsigned underflow in vector
integer subtraction. This patch simply disables it.


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (7 preceding siblings ...)
  2009-12-29 23:50 ` hjl dot tools at gmail dot com
@ 2009-12-30  4:47 ` hjl dot tools at gmail dot com
  2009-12-30  4:49 ` hjl dot tools at gmail dot com
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-30  4:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hjl dot tools at gmail dot com  2009-12-30 04:47 -------
Hi Richard, the code in question is added by

http://gcc.gnu.org/ml/gcc-patches/2005-06/msg02185.html

I don't quite understand how it can properly handle unsigned V4SI
underflow in V4SI vector subtraction.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (8 preceding siblings ...)
  2009-12-30  4:47 ` hjl dot tools at gmail dot com
@ 2009-12-30  4:49 ` hjl dot tools at gmail dot com
  2009-12-30 15:50 ` hjl dot tools at gmail dot com
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-30  4:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hjl dot tools at gmail dot com  2009-12-30 04:49 -------
Created an attachment (id=19422)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19422&action=view)
An updated patch

I am testing this patch now.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #19420|0                           |1
        is obsolete|                            |


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (9 preceding siblings ...)
  2009-12-30  4:49 ` hjl dot tools at gmail dot com
@ 2009-12-30 15:50 ` hjl dot tools at gmail dot com
  2010-01-04 15:15 ` [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers hjl at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-30 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from hjl dot tools at gmail dot com  2009-12-30 15:50 -------
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01208.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2009-
                   |                            |12/msg01208.html


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (10 preceding siblings ...)
  2009-12-30 15:50 ` hjl dot tools at gmail dot com
@ 2010-01-04 15:15 ` hjl at gcc dot gnu dot org
  2010-01-05 20:44 ` hjl at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-04 15:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from hjl at gcc dot gnu dot org  2010-01-04 15:14 -------
Subject: Bug 42542

Author: hjl
Date: Mon Jan  4 15:14:31 2010
New Revision: 155618

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155618
Log:
Don't convert GTU to GT for V4SI and V2DI

gcc/

2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * config/i386/i386.c (ix86_expand_int_vcond): Don't convert
        GTU to GT for V4SI and V2DI.

        * config/i386/sse.md (umaxv4si3): Enabled for SSE4.1 and XOP.
        (umin<mode>3): Removed.
        (uminv8hi3): New.
        (uminv4si3): Likewise.

gcc/testsuite/

2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * gcc.target/i386/pr42542-1.c: New.
        * gcc.target/i386/pr42542-1a.c: Likewise.
        * gcc.target/i386/pr42542-1b.c: Likewise.
        * gcc.target/i386/pr42542-2.c: Likewise.
        * gcc.target/i386/pr42542-2a.c: Likewise.
        * gcc.target/i386/pr42542-2b.c: Likewise.
        * gcc.target/i386/pr42542-3.c: Likewise.
        * gcc.target/i386/pr42542-3a.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr42542-1.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-1a.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-1b.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-2.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-2a.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-2b.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-3.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-3a.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (11 preceding siblings ...)
  2010-01-04 15:15 ` [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers hjl at gcc dot gnu dot org
@ 2010-01-05 20:44 ` hjl at gcc dot gnu dot org
  2010-01-05 23:54 ` hjl at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-05 20:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from hjl at gcc dot gnu dot org  2010-01-05 20:44 -------
Subject: Bug 42542

Author: hjl
Date: Tue Jan  5 20:44:14 2010
New Revision: 155660

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155660
Log:
Properly convert GTU to GT for V4SI and V2DI

gcc/

2010-01-05  Paolo Bonzini  <bonzinI@gnu.rg>
            H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * config/i386/i386.c (ix86_expand_int_vcond): Convert GTU to GT
        for V4SI and V2DI by subtracting (-(INT MAX) - 1) from both
        operands to make them signed.

        * config/i386/sse.md (umaxv4si3): Revert the last change.
        (umin<mode>3): Likewise.
        (uminv8hi3): Removed.
        (uminv4si3): Likewise.

gcc/testsuite/

2010-01-05  H.J. Lu  <hongjiu.lu@intel.com>

        * gcc.target/i386/pr42542-1.c (res): Make it 8 elements.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/pr42542-1.c


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (12 preceding siblings ...)
  2010-01-05 20:44 ` hjl at gcc dot gnu dot org
@ 2010-01-05 23:54 ` hjl at gcc dot gnu dot org
  2010-01-06  8:55 ` sezeroz at gmail dot com
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-05 23:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hjl at gcc dot gnu dot org  2010-01-05 23:53 -------
Subject: Bug 42542

Author: hjl
Date: Tue Jan  5 23:53:29 2010
New Revision: 155666

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155666
Log:
Add smaxv2di3, umaxv2di3, sminv2di3 and uminv2di3

gcc/

2010-01-05  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * config/i386/sse.md (smaxv2di3): New.
        (umaxv2di3): Likewise.
        (sminv2di3): Likewise.
        (uminv2di3): Likewise.

gcc/testsuite/

2010-01-05  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * gcc.target/i386/pr42542-4.c: New.
        * gcc.target/i386/pr42542-4a.c: Likewise.
        * gcc.target/i386/pr42542-5.c: Likewise.
        * gcc.target/i386/pr42542-5a.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr42542-4.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-4a.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-5.c
    trunk/gcc/testsuite/gcc.target/i386/pr42542-5a.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (13 preceding siblings ...)
  2010-01-05 23:54 ` hjl at gcc dot gnu dot org
@ 2010-01-06  8:55 ` sezeroz at gmail dot com
  2010-01-06 14:59 ` hjl dot tools at gmail dot com
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sezeroz at gmail dot com @ 2010-01-06  8:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from sezeroz at gmail dot com  2010-01-06 08:55 -------
Can we expect a 4.4 backport for this, at least in the ix86/4.4 branch if not
in the main 4.4 branch?


-- 

sezeroz at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sezeroz at gmail dot com


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (14 preceding siblings ...)
  2010-01-06  8:55 ` sezeroz at gmail dot com
@ 2010-01-06 14:59 ` hjl dot tools at gmail dot com
  2010-01-06 15:00 ` hjl dot tools at gmail dot com
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-06 14:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from hjl dot tools at gmail dot com  2010-01-06 14:59 -------
(In reply to comment #15)
> Can we expect a 4.4 backport for this, at least in the ix86/4.4 branch if not
> in the main 4.4 branch?
> 

It will be backported to 4.3/4.4 in a few days.


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (15 preceding siblings ...)
  2010-01-06 14:59 ` hjl dot tools at gmail dot com
@ 2010-01-06 15:00 ` hjl dot tools at gmail dot com
  2010-01-07 19:56 ` hjl at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-06 15:00 UTC (permalink / raw)
  To: gcc-bugs



-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.6
            Version|4.5.0                       |4.3.5


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (16 preceding siblings ...)
  2010-01-06 15:00 ` hjl dot tools at gmail dot com
@ 2010-01-07 19:56 ` hjl at gcc dot gnu dot org
  2010-01-07 19:58 ` hjl at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-07 19:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from hjl at gcc dot gnu dot org  2010-01-07 19:55 -------
Subject: Bug 42542

Author: hjl
Date: Thu Jan  7 19:55:44 2010
New Revision: 155707

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155707
Log:
Properly convert GTU to GT for V4SI and V2DI

gcc/

2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline
        2010-01-05  Paolo Bonzini  <bonzinI@gnu.rg>
                    H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * config/i386/i386.c (ix86_expand_int_vcond): Convert GTU to GT
        for V4SI and V2DI by subtracting (-(INT MAX) - 1) from both
        operands to make them signed.

gcc/testsuite/

2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline
        2010-01-05  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * gcc.target/i386/pr42542-1.c: New.
        * gcc.target/i386/pr42542-1a.c: Likewise.
        * gcc.target/i386/pr42542-1b.c: Likewise.
        * gcc.target/i386/pr42542-2.c: Likewise.
        * gcc.target/i386/pr42542-2a.c: Likewise.
        * gcc.target/i386/pr42542-2b.c: Likewise.
        * gcc.target/i386/pr42542-3.c: Likewise.
        * gcc.target/i386/pr42542-3a.c: Likewise.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-1a.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-1b.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-2.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-2a.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-2b.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-3.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42542-3a.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/i386/i386.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (17 preceding siblings ...)
  2010-01-07 19:56 ` hjl at gcc dot gnu dot org
@ 2010-01-07 19:58 ` hjl at gcc dot gnu dot org
  2010-01-07 20:00 ` hjl dot tools at gmail dot com
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-07 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from hjl at gcc dot gnu dot org  2010-01-07 19:58 -------
Subject: Bug 42542

Author: hjl
Date: Thu Jan  7 19:58:16 2010
New Revision: 155709

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155709
Log:
Properly convert GTU to GT for V4SI and V2DI

gcc/

2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline
        2010-01-05  Paolo Bonzini  <bonzinI@gnu.rg>
                    H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * config/i386/i386.c (ix86_expand_int_vcond): Convert GTU to GT
        for V4SI and V2DI by subtracting (-(INT MAX) - 1) from both
        operands to make them signed.

gcc/testsuite/

2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline
        2010-01-05  H.J. Lu  <hongjiu.lu@intel.com>

        PR target/42542
        * gcc.target/i386/pr42542-1.c: New.
        * gcc.target/i386/pr42542-1a.c: Likewise.
        * gcc.target/i386/pr42542-1b.c: Likewise.
        * gcc.target/i386/pr42542-2.c: Likewise.
        * gcc.target/i386/pr42542-2a.c: Likewise.
        * gcc.target/i386/pr42542-2b.c: Likewise.
        * gcc.target/i386/pr42542-3.c: Likewise.
        * gcc.target/i386/pr42542-3a.c: Likewise.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-1.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-1a.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-1b.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-2.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-2a.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-2b.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-3.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr42542-3a.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/i386/i386.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (18 preceding siblings ...)
  2010-01-07 19:58 ` hjl at gcc dot gnu dot org
@ 2010-01-07 20:00 ` hjl dot tools at gmail dot com
  2010-01-08  7:48 ` ubizjak at gmail dot com
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-07 20:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from hjl dot tools at gmail dot com  2010-01-07 20:00 -------
Fixed.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (19 preceding siblings ...)
  2010-01-07 20:00 ` hjl dot tools at gmail dot com
@ 2010-01-08  7:48 ` ubizjak at gmail dot com
  2010-01-11 23:32 ` sje at cup dot hp dot com
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: ubizjak at gmail dot com @ 2010-01-08  7:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from ubizjak at gmail dot com  2010-01-08 07:48 -------
According to http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00213.html, ia64
should be fixed in the same way as x86.

The wrong code is located in ia64/ia64.c ia64_expand_vecint_compare, around
line 1730. Correct code is in i386/i386.c ix86_expand_int_vcond, around line
16250.

So, adding ia64 maintainer to CC and reopening PR as ia64 target bug.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com
             Status|RESOLVED                    |REOPENED
 GCC target triplet|x86                         |x86, ia64
         Resolution|FIXED                       |


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (20 preceding siblings ...)
  2010-01-08  7:48 ` ubizjak at gmail dot com
@ 2010-01-11 23:32 ` sje at cup dot hp dot com
  2010-01-11 23:33 ` sje at cup dot hp dot com
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sje at cup dot hp dot com @ 2010-01-11 23:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from sje at cup dot hp dot com  2010-01-11 23:32 -------
Created an attachment (id=19544)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19544&action=view)
ia64 patch (fixes int, not short or char)


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (21 preceding siblings ...)
  2010-01-11 23:32 ` sje at cup dot hp dot com
@ 2010-01-11 23:33 ` sje at cup dot hp dot com
  2010-01-12  0:41 ` hjl dot tools at gmail dot com
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sje at cup dot hp dot com @ 2010-01-11 23:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from sje at cup dot hp dot com  2010-01-11 23:33 -------
I am looking at this on IA64 and fixing it for V2SI seems simple enough.  
I will attach a patch.  But I am not sure what to do for V4HI and V8QI. 
The current code uses an 'unsigned saturating subtraction' and that
seems to be what x86 is using for V16QI and V8HI.  But when I run
pr42542-2.c and pr42542-3.c (short and char) on IA64 they fail.  My
patch does make pr42542-1.c (int) work.  I tried handling V4HI and V8QI
in the same way as V2SI but that didn't seem to work either.


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (22 preceding siblings ...)
  2010-01-11 23:33 ` sje at cup dot hp dot com
@ 2010-01-12  0:41 ` hjl dot tools at gmail dot com
  2010-01-12  0:58 ` sje at cup dot hp dot com
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-12  0:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from hjl dot tools at gmail dot com  2010-01-12 00:41 -------
(In reply to comment #22)
> I am looking at this on IA64 and fixing it for V2SI seems simple enough.  
> I will attach a patch.  But I am not sure what to do for V4HI and V8QI. 
> The current code uses an 'unsigned saturating subtraction' and that
> seems to be what x86 is using for V16QI and V8HI.  But when I run
> pr42542-2.c and pr42542-3.c (short and char) on IA64 they fail.  My
> patch does make pr42542-1.c (int) work.  I tried handling V4HI and V8QI
> in the same way as V2SI but that didn't seem to work either.
> 

What was the problem with V4HI and V8QI? The existing code works
OK on pr42542-2.c and pr42542-3.c for me.


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (23 preceding siblings ...)
  2010-01-12  0:41 ` hjl dot tools at gmail dot com
@ 2010-01-12  0:58 ` sje at cup dot hp dot com
  2010-01-17 18:52 ` hjl at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sje at cup dot hp dot com @ 2010-01-12  0:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from sje at cup dot hp dot com  2010-01-12 00:58 -------
Never mind, when I copied (and modified) the x86 tests for ia64 I forgot to put
a 'return 0' at the end of the main program so I was getting a non-zero exit. 
I will test my patch tonight and if all looks good submit it tomorrow.


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (24 preceding siblings ...)
  2010-01-12  0:58 ` sje at cup dot hp dot com
@ 2010-01-17 18:52 ` hjl at gcc dot gnu dot org
  2010-01-17 18:55 ` hjl at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-17 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from hjl at gcc dot gnu dot org  2010-01-17 18:52 -------
Subject: Bug 42542

Author: hjl
Date: Sun Jan 17 18:51:47 2010
New Revision: 155988

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155988
Log:
Backport ia64 fix for PR target/42542 from mainline.

gcc/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * config/ia64/ia64.c (ia64_expand_vecint_compare): Convert GTU to GT
        for V2SI by subtracting (-(INT MAX) - 1) from both operands to make
        them signed.

gcc/testsuite/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * gcc.target/ia64/pr42542-1.c: New.
        * gcc.target/ia64/pr42542-2.c: New.
        * gcc.target/ia64/pr42542-3.c: New.

Added:
    branches/ix86/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-1.c
      - copied unchanged from r155987,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-1.c
    branches/ix86/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-2.c
      - copied unchanged from r155987,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-2.c
    branches/ix86/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-3.c
      - copied unchanged from r155987,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-3.c
Modified:
    branches/ix86/gcc-4_4-branch/gcc/ChangeLog
    branches/ix86/gcc-4_4-branch/gcc/config/ia64/ia64.c
    branches/ix86/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (25 preceding siblings ...)
  2010-01-17 18:52 ` hjl at gcc dot gnu dot org
@ 2010-01-17 18:55 ` hjl at gcc dot gnu dot org
  2010-01-17 18:57 ` hjl at gcc dot gnu dot org
  2010-01-17 19:00 ` hjl dot tools at gmail dot com
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-17 18:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from hjl at gcc dot gnu dot org  2010-01-17 18:55 -------
Subject: Bug 42542

Author: hjl
Date: Sun Jan 17 18:55:03 2010
New Revision: 155989

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155989
Log:
Backport ia64 fix for PR target/42542 from mainline.

gcc/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * config/ia64/ia64.c (ia64_expand_vecint_compare): Convert GTU to GT
        for V2SI by subtracting (-(INT MAX) - 1) from both operands to make
        them signed.

gcc/testsuite/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * gcc.target/ia64/pr42542-1.c: New.
        * gcc.target/ia64/pr42542-2.c: New.
        * gcc.target/ia64/pr42542-3.c: New.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/ia64/pr42542-1.c
      - copied unchanged from r155988,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-1.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/ia64/pr42542-2.c
      - copied unchanged from r155988,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-2.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/ia64/pr42542-3.c
      - copied unchanged from r155988,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-3.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/ia64/ia64.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (26 preceding siblings ...)
  2010-01-17 18:55 ` hjl at gcc dot gnu dot org
@ 2010-01-17 18:57 ` hjl at gcc dot gnu dot org
  2010-01-17 19:00 ` hjl dot tools at gmail dot com
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-17 18:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from hjl at gcc dot gnu dot org  2010-01-17 18:57 -------
Subject: Bug 42542

Author: hjl
Date: Sun Jan 17 18:57:33 2010
New Revision: 155990

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155990
Log:
Backport ia64 fix for PR target/42542 from mainline.

gcc/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * config/ia64/ia64.c (ia64_expand_vecint_compare): Convert GTU to GT
        for V2SI by subtracting (-(INT MAX) - 1) from both operands to make
        them signed.

gcc/testsuite/

2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-13  Steve Ellcey  <sje@cup.hp.com>

        PR target/42542
        * gcc.target/ia64/pr42542-1.c: New.
        * gcc.target/ia64/pr42542-2.c: New.
        * gcc.target/ia64/pr42542-3.c: New.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-1.c
      - copied unchanged from r155989,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-2.c
      - copied unchanged from r155989,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-2.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/ia64/pr42542-3.c
      - copied unchanged from r155989,
trunk/gcc/testsuite/gcc.target/ia64/pr42542-3.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/ia64/ia64.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers
  2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
                   ` (27 preceding siblings ...)
  2010-01-17 18:57 ` hjl at gcc dot gnu dot org
@ 2010-01-17 19:00 ` hjl dot tools at gmail dot com
  28 siblings, 0 replies; 30+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-01-17 19:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #28 from hjl dot tools at gmail dot com  2010-01-17 19:00 -------
Fixed.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-01-17 19:00 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-29 16:11 [Bug other/42542] New: g++ -O3 produces incorrect results for less-than operator debian-gcc at lists dot debian dot org
2009-12-29 19:41 ` [Bug other/42542] " hjl dot tools at gmail dot com
2009-12-29 19:44 ` [Bug other/42542] g++ "-O -ftree-vectorize" " hjl dot tools at gmail dot com
2009-12-29 19:45 ` hjl dot tools at gmail dot com
2009-12-29 19:52 ` hjl dot tools at gmail dot com
2009-12-29 20:48 ` hjl dot tools at gmail dot com
2009-12-29 20:52 ` [Bug target/42542] " hjl dot tools at gmail dot com
2009-12-29 21:40 ` [Bug target/42542] Vectorizer produces incorrect results on max of signed intergers hjl dot tools at gmail dot com
2009-12-29 23:50 ` hjl dot tools at gmail dot com
2009-12-30  4:47 ` hjl dot tools at gmail dot com
2009-12-30  4:49 ` hjl dot tools at gmail dot com
2009-12-30 15:50 ` hjl dot tools at gmail dot com
2010-01-04 15:15 ` [Bug target/42542] Vectorizer produces incorrect results on max/min of unsigned intergers hjl at gcc dot gnu dot org
2010-01-05 20:44 ` hjl at gcc dot gnu dot org
2010-01-05 23:54 ` hjl at gcc dot gnu dot org
2010-01-06  8:55 ` sezeroz at gmail dot com
2010-01-06 14:59 ` hjl dot tools at gmail dot com
2010-01-06 15:00 ` hjl dot tools at gmail dot com
2010-01-07 19:56 ` hjl at gcc dot gnu dot org
2010-01-07 19:58 ` hjl at gcc dot gnu dot org
2010-01-07 20:00 ` hjl dot tools at gmail dot com
2010-01-08  7:48 ` ubizjak at gmail dot com
2010-01-11 23:32 ` sje at cup dot hp dot com
2010-01-11 23:33 ` sje at cup dot hp dot com
2010-01-12  0:41 ` hjl dot tools at gmail dot com
2010-01-12  0:58 ` sje at cup dot hp dot com
2010-01-17 18:52 ` hjl at gcc dot gnu dot org
2010-01-17 18:55 ` hjl at gcc dot gnu dot org
2010-01-17 18:57 ` hjl at gcc dot gnu dot org
2010-01-17 19:00 ` hjl dot tools 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).