Bug 10963 - cc1 fails on generation of SIMD code on target MMX
Summary: cc1 fails on generation of SIMD code on target MMX
Status: RESOLVED DUPLICATE of bug 7277
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-24 09:10 UTC by Yannick Martel
Modified: 2003-06-02 14:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-05-25 00:25:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yannick Martel 2003-05-24 09:10:08 UTC
Here is foo.c:

[bidou@pit tmp]$ cat foo.c
#define vector64 __attribute__((vector_size(8)))
vector64 short a;
vector64 short b;
vector64 short c;


void foo ()
{

c = -a + b*b*(-1LL);
/* c is now {5, 3} */

 printf("result is %llx\n", (long long)c);
}


******************************************************************************
Here is foo.c preprocessed:

[bidou@pit tmp]$ gcc-3.3 -mmmx -E foo.c
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"

__attribute__((vector_size(8))) short a;
__attribute__((vector_size(8))) short b;
__attribute__((vector_size(8))) short c;


void foo ()
{

c = -a + b*b*(-1LL);


 printf("result is %llx\n", (long long)c);
}

******************************************************************************
And here is the command line that failed and its result:

[bidou@pit tmp]$ gcc-3.3 -mmmx -v foo.c
Reading specs from /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc-3.3/configure --prefix=/home/bidou --enable-languages=c
--program-suffix=-3.3
Thread model: posix
gcc version 3.3
 /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/cc1 -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 foo.c -quiet -dumpbase foo.c -mmmx
-auxbase foo -version -o /tmp/ccGuYsey.s
GNU C version 3.3 (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64213
ignoring nonexistent directory "/home/bidou/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/bidou/include
 /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/include
 /usr/include
End of search list.
foo.c: In function `foo':
foo.c:14: internal compiler error: in output_constant_pool, at varasm.c:3492
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

*******************************************************************************
Host and target machine is an Athlon-XP PC running RedHat 8.0.

I tried the same with varying options for building GCC and for the compilation
of foo.c, and got exactly the same result.
The testsuite does not detect this (simd-5.c) because either no MMX code is
tried (no MMX enabling flag) or the -O3 is optimizing out calculation in contact
propagation with my standard CFLAGS.
Comment 1 Dara Hazeghi 2003-05-25 00:19:48 UTC
Hello,

I can confirm that this behavior is present on gcc 3.3 branch and mainline (20030520). The code 
does not compile on gcc 3.2, so it is not a regression.

Dara
Comment 2 Andrew Pinski 2003-05-25 00:25:08 UTC
Confirmed according to Dara, not a regression since 3.2 did not support the vector_size attribute.
Comment 3 Andrew Pinski 2003-06-02 14:29:06 UTC
This is the same problem as bug 7277 but with a simpler testcase.

*** This bug has been marked as a duplicate of 7277 ***