Bug 11092 - [3.4 Regression] [altivec] ICE:unrecognizable insn (vector constant)
Summary: [3.4 Regression] [altivec] ICE:unrecognizable insn (vector constant)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Aldy Hernandez
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-06-04 19:44 UTC by edmar
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host: powerpc-unknown-linux-gnualtivec
Target: powerpc-unknown-linux-gnualtivec
Build: powerpc-unknown-linux-gnualtivec
Known to work:
Known to fail:
Last reconfirmed: 2003-06-04 20:58:51


Attachments
Preprocessed file that causes the ICE (1.96 KB, application/x-gz)
2003-06-04 19:46 UTC, edmar
Details
Preprocessed file that caused ICE (2.21 KB, application/x-gz)
2003-06-04 20:45 UTC, edmar
Details
Original file that causes the ICE (686 bytes, application/x-gz)
2003-06-04 20:47 UTC, edmar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description edmar 2003-06-04 19:44:16 UTC
When compiling the attached preprocessed file (valid code) with optimization,
the compiler gives an ICE in extract_insn, at recog.c:2188

Here is the output:

/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/bin/gcc -v -save-temps
-O2 -c ice.c
Reading specs from
/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/bin/../lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/specs
Configured with: /local2/forge/gnupowerpc/configure
--prefix=/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec
--enable-languages=c,c++,f77 --target=powerpc-unkown-linux-gnualtivec
--host=powerpc-unkown-linux-gnualtivec
Thread model: posix
gcc version 3.4 20030603 (experimental)

/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/bin/../lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/cc1
-E -quiet -v -iprefix
/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/bin/../lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/
-D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux
-Asystem=unix -Asystem=posix ice.c -O2 -o ice.i
ignoring nonexistent directory
"/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/powerpc-unkown-linux-gnualtivec/include"
ignoring duplicate directory
"/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/include"
ignoring nonexistent directory
"/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/powerpc-unkown-linux-gnualtivec/include"
#include "..." search starts here:
#include <...> search starts here:

/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/include
 /usr/local/include
 /home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/include
 /usr/include
End of search list.

/nfs/ibmoto/linuxperf/home/edmar/forge/gnupowerpc-20030603-0-altivec-altivec/bin/../lib/gcc-lib/powerpc-unkown-linux-gnualtivec/3.4/cc1
-fpreprocessed ice.i -quiet -dumpbase ice.c -auxbase ice -O2 -version -o ice.s
GNU C version 3.4 20030603 (experimental) (powerpc-unkown-linux-gnualtivec)
        compiled by GNU C version 3.4 20030603 (experimental).
GGC heuristics: --param ggc-min-expand=81 --param ggc-min-heapsize=96352
ice.c: In function `main':
ice.c:77: error: unrecognizable insn:
(insn 264 26 24 0 (nil) (set (reg:V16QI 77 v0)
        (const_vector:V16QI [
                (const_int 0 [0x0])
                (const_int 1 [0x1])
                (const_int 2 [0x2])
                (const_int 3 [0x3])
                (const_int 4 [0x4])
                (const_int 5 [0x5])
                (const_int 6 [0x6])
                (const_int 7 [0x7])
                (const_int 8 [0x8])
                (const_int 9 [0x9])
                (const_int 10 [0xa])
                (const_int 11 [0xb])
                (const_int 12 [0xc])
                (const_int 13 [0xd])
                (const_int 14 [0xe])
                (const_int 15 [0xf])
            ])) -1 (nil)
    (nil))
ice.c:77: internal compiler error: in extract_insn, at recog.c:2188
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 edmar 2003-06-04 19:46:38 UTC
Created attachment 4166 [details]
Preprocessed file that causes the ICE

Preprocessed file that causes the ICE
Comment 2 Andrew Pinski 2003-06-04 20:18:51 UTC
Could you provide the *un*preprocessed file because all I am getting is errors about 
 pr11092.i:70: error: can't convert between vector values of different size?


[zhivago2:~/src/gccPRs] pinskia% ~/fsf-nocheck/bin/gcc pr11092.i -v -maltivec
Reading specs from /Users/pinskia/fsf-nocheck/lib/gcc-lib/powerpc-apple-darwin6.6/3.4/specs
Configured with: /Volumes/UFS_Partition/pinskia/src/fsf/gcc/src/configure --enable-
threads=posix --disable-nls --disable-multilib --disable-checking --enable-libjava --prefix=/
Users/pinskia/fsf-nocheck
Thread model: posix
gcc version 3.4 20030529 (experimental)
 /Users/pinskia/fsf-nocheck/lib/gcc-lib/powerpc-apple-darwin6.6/3.4/cc1 -fpreprocessed 
pr11092.i -fPIC -quiet -dumpbase pr11092.i -maltivec -auxbase pr11092 -version -o /var/tmp//
cc2Cwpd1.s
GNU C version 3.4 20030529 (experimental) (powerpc-apple-darwin6.6)
        compiled by GNU C version 3.4 20030529 (experimental).
GGC heuristics: --param ggc-min-expand=36 --param ggc-min-heapsize=12800
pr11092.i: In function `main':
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
....

[zhivago2:~/src/gccPRs] pinskia% gcc pr11092.i -maltivec -v
Reading specs from /Users/pinskia/fsf-clean-nocheck/lib/gcc-lib/powerpc-apple-darwin6.6/3.4/
specs
Configured with: /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/configure --enable-
threads=posix --disable-nls --disable-multilib --disable-checking --prefix=/Users/pinskia/fsf-
clean-nocheck
Thread model: posix
gcc version 3.4 20030604 (experimental)
 /Users/pinskia/fsf-clean-nocheck/lib/gcc-lib/powerpc-apple-darwin6.6/3.4/cc1 -fpreprocessed 
pr11092.i -fPIC -quiet -dumpbase pr11092.i -maltivec -auxbase pr11092 -version -o /var/tmp//
cczVlPzr.s
GNU C version 3.4 20030604 (experimental) (powerpc-apple-darwin6.6)
        compiled by GNU C version 3.4 20030604 (experimental).
GGC heuristics: --param ggc-min-expand=36 --param ggc-min-heapsize=12800
pr11092.i: In function `main':
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
pr11092.i:17: error: can't convert between vector values of different size
....
Comment 3 edmar 2003-06-04 20:45:13 UTC
Created attachment 4168 [details]
Preprocessed file that caused ICE

I am sorry, I forgot the original file had the constants written as
(vector ...)( ...), which is not supported by FSF.
This version should have all constants written with {...}.
Comment 4 edmar 2003-06-04 20:47:03 UTC
Created attachment 4169 [details]
Original file that causes the ICE

Just in case I missed any literal constant.
Comment 5 edmar 2003-06-04 20:49:24 UTC
Subject: Re:  [altivec] ICE:unrecognizable insn (vector 
 constant)

I forgot that the original file had vector constants written in a way
that is not supported by FSF.
Please refer to the new attachments.

Comment 6 Andrew Pinski 2003-06-04 20:58:51 UTC
Confirmed on the mainline (20030604), this is a regression from the mainline (20030131).
Comment 7 Andrew Pinski 2003-06-14 23:46:41 UTC
Now it is rejects-valid-code on the mainline (20030614).
Comment 8 Dara Hazeghi 2003-06-16 21:35:15 UTC
Peculiar. Using current mainline (20030616), compiling either ice.i or ice.c
with -O2 -maltivec works fine for me. Has this bug been fixed in the interim, or
am I missing a necessary option (powerpc-unknown-linux-gnu)?

Dara
Comment 9 Andrew Pinski 2003-06-16 21:41:51 UTC
I had forgot to add -maltivec to the command line when testing, woops, I checked this at least 
twice before writing my previous comment but I messed up.  Yes I get an ICE with the mainline 
(20030616), still.
Comment 10 Andrew Pinski 2003-06-16 21:47:54 UTC
I think the regression was caused by this patch which causes constant vector generated by one 
instruction instead of in the const pool:
2003-02-31  Aldy Hernandez  <aldyh@redhat.com>

        * testsuite/gcc.c-torture/execute/simd-3.c: New.

        * expr.c (expand_expr): Handle VECTOR_CST.
        (const_vector_from_tree): New.

        * varasm.c (output_constant): Handle VECTOR_CST.

        * c-typeck.c (digest_init): Build a vector constant from a
        VECTOR_TYPE.

        * config/rs6000/rs6000.c: Remove prototype for  
        easy_vector_constant.
        (easy_vector_constant): Add mode parameter.  Rewrite to handle 
        more easy constants.
        (rs6000_emit_move): Pass mode to easy_vector_constant. 
        Call emit_easy_vector_insn for SPE V2SI vector constant moves.
        (emit_easy_vector_insn): New.
        (easy_vector_same): New.
        (EASY_VECTOR_15): New macro.
        (EASY_VECTOR_15_ADD_SELF): New macro.
        (bdesc_2arg): Rename to xorv2si3.
        (easy_vector_constant_add_self): New.
        (input_operand): Allow vector constants.

        * config/rs6000/rs6000.h (PREDICATE_CODES): Add
        easy_vector_constant, easy_vector_constant_add_self.
        (EXTRA_CONSTRAINT): Add 'W'.

        * config/rs6000/rs6000-protos.h: Add prototype for
        easy_vector_constant, emit_easy_vector_insn.

        * config/rs6000/altivec.md (xorv8hi3): New.
        (xorv16qi3): New.
        Remove all _const0 patterns.
        (movv4si_internal): Rewrite to use code.  Add vector constant to
        vector alternative.  Add splitter.
        (movv8hi_internal): Same.
        (movv16qi_internal): Same.
        (movv4sf_internal): Same.
        Change the unspecs for vspltis* to use constants.

        * config/rs6000/spe.md ("xorv4hi3"): New.
        ("spe_evxor"): Rename to xorv2si3.
        ("xorv1di3"): New.
        Remove all _const0 patterns.
        (movv2si_internal): Rewrite to use code.  Add vector constant to
        alternatives.  Add splitter.
        (movv4hi_internal): Add vector constant to alternatives.
        (movv1di_internal): Same.
        (movv2sf_internal): Same.
Comment 11 Dara Hazeghi 2003-06-16 21:54:41 UTC
That's not quite what I meant. With mainline, I can compile the testcase
successfully (ice.c or ice.i). I've tried -O0, -O1, -O2 and -O3 in conjunction
with -maltivec. Perhaps this is because I'm on powerpc-linux...?
Comment 12 Andrew Pinski 2003-06-16 22:43:53 UTC
Yes you on powerpc-unknown-linux-gnu to have -mabi=altivec with -maltivec to get the same 
results as powerpc-unknown-linux-gnualtivec, also powerpc-apple-darwin6.6 ICE's so it target 
but not totally powerpc-unknown-linux-gnualtivec but powerpc-*-* with -mabi=altivec -maltivec.
Comment 13 Aldy Hernandez 2003-06-20 20:09:18 UTC
fixed by: 
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02445.html