public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/55184] New: Invalid codegen with vectors and casts
@ 2012-11-02 22:33 mathias at gaunard dot com
  2012-11-02 23:08 ` [Bug target/55184] [4.6 Regression] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mathias at gaunard dot com @ 2012-11-02 22:33 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55184
           Summary: Invalid codegen with vectors and casts
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mathias@gaunard.com


Created attachment 28600
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28600
Testcase

On x86-64, when 128-bit vectors of long or unsigned long are aliased, an
invalid optimization seems to occur and causes only the first element of the
vector to be modified.

Output is correct when compiled without optimization, but fails with -O1 or
greater. Usage of -fno-strict-aliasing doesn't change anything.

The problem doesn't seem to appear in the 4.4, 4.5 and 4.7 series.
Nevertheless I'd like to know all the cases it affects and whether there is a
workaround.


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
@ 2012-11-02 23:08 ` pinskia at gcc dot gnu.org
  2012-11-03  0:30 ` mathias at gaunard dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-11-02 23:08 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.4.0, 4.5.0, 4.7.0
   Target Milestone|---                         |4.6.4
            Summary|Invalid codegen with        |[4.6 Regression] Invalid
                   |vectors and casts           |codegen with vectors and
                   |                            |casts
      Known to fail|                            |4.6.3


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
  2012-11-02 23:08 ` [Bug target/55184] [4.6 Regression] " pinskia at gcc dot gnu.org
@ 2012-11-03  0:30 ` mathias at gaunard dot com
  2012-11-04 14:14 ` mikpe at it dot uu.se
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mathias at gaunard dot com @ 2012-11-03  0:30 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Mathias Gaunard <mathias at gaunard dot com> 2012-11-03 00:29:47 UTC ---
Problem seems to occur with i686 as well but only if SSE2 is enabled (you'll
need to replace 'long' by 'long long' for this in the testcase)


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
  2012-11-02 23:08 ` [Bug target/55184] [4.6 Regression] " pinskia at gcc dot gnu.org
  2012-11-03  0:30 ` mathias at gaunard dot com
@ 2012-11-04 14:14 ` mikpe at it dot uu.se
  2012-11-04 17:58 ` mathias at gaunard dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu.se @ 2012-11-04 14:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2012-11-04 14:13:58 UTC ---
I can't reproduce the error with vanilla gcc-4.6.3 on x86_64-linux.


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
                   ` (2 preceding siblings ...)
  2012-11-04 14:14 ` mikpe at it dot uu.se
@ 2012-11-04 17:58 ` mathias at gaunard dot com
  2012-11-04 18:01 ` mathias at gaunard dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mathias at gaunard dot com @ 2012-11-04 17:58 UTC (permalink / raw)
  To: gcc-bugs


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

Mathias Gaunard <mathias at gaunard dot com> changed:

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

--- Comment #3 from Mathias Gaunard <mathias at gaunard dot com> 2012-11-04 17:58:30 UTC ---
Created attachment 28614
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28614
Fixed testcase


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
                   ` (3 preceding siblings ...)
  2012-11-04 17:58 ` mathias at gaunard dot com
@ 2012-11-04 18:01 ` mathias at gaunard dot com
  2012-11-04 21:24 ` mikpe at it dot uu.se
  2013-04-12 16:17 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mathias at gaunard dot com @ 2012-11-04 18:01 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Mathias Gaunard <mathias at gaunard dot com> 2012-11-04 18:01:27 UTC ---
Sorry, I edited the file in between and ended up uploading the wrong test case.

Below is the result on my machine with the fixed testcase.

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -dumpmachine
x86_64-linux-gnu
$ gcc test.c -o test && ./test
1 (should be 1)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
1 (should be 1)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
$ gcc -O1 test.c -o test && ./test
1 (should be 1)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 1)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)
0 (should be 0)


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
                   ` (4 preceding siblings ...)
  2012-11-04 18:01 ` mathias at gaunard dot com
@ 2012-11-04 21:24 ` mikpe at it dot uu.se
  2013-04-12 16:17 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu.se @ 2012-11-04 21:24 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> 2012-11-04 21:24:44 UTC ---
I can confirm the bug with gcc-4.6.3 and the fixed test case.  However, the bug
has since been fixed on 4.6 branch in r187763, the fix for PR52407.  The test
cases for these bugs are very similar, so I'd consider this bug a duplicate of
PR52407.


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

* [Bug target/55184] [4.6 Regression] Invalid codegen with vectors and casts
  2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
                   ` (5 preceding siblings ...)
  2012-11-04 21:24 ` mikpe at it dot uu.se
@ 2013-04-12 16:17 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 16:17 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.6.4                       |4.7.0

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 16:17:37 UTC ---
The 4.6 branch has been closed, fixed in GCC 4.7.0.


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

end of thread, other threads:[~2013-04-12 16:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-02 22:33 [Bug target/55184] New: Invalid codegen with vectors and casts mathias at gaunard dot com
2012-11-02 23:08 ` [Bug target/55184] [4.6 Regression] " pinskia at gcc dot gnu.org
2012-11-03  0:30 ` mathias at gaunard dot com
2012-11-04 14:14 ` mikpe at it dot uu.se
2012-11-04 17:58 ` mathias at gaunard dot com
2012-11-04 18:01 ` mathias at gaunard dot com
2012-11-04 21:24 ` mikpe at it dot uu.se
2013-04-12 16:17 ` 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).