Bug 89424 - __builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000)
Summary: __builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: kelvin
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-02-20 20:38 UTC by kelvin
Modified: 2019-05-20 21:30 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed source code for reproducer (389 bytes, text/plain)
2019-02-20 20:38 UTC, kelvin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kelvin 2019-02-20 20:38:45 UTC
Created attachment 45781 [details]
preprocessed source code for reproducer

The __builtin_vec_ext_v1ti (v, i) function should work with both constant and variable values of int i.

With current trunk

  $GCC_BUILD/GCC/xgcc -B$gcc_build/GCC/ -maltivec -mvsx -O1 -o problem.exe problem.c

ends with an internal cmopiler error:
during RTL pass: expand
prXXXXX-0.c: In function ‘ei’:
prXXXXX-0.c:25:10: internal compiler error: in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:6970
   25 |   return __builtin_vec_ext_v1ti (v, i);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x10faeabf rs6000_expand_vector_extract(rtx_def*, rtx_def*, rtx_def*)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:6970
0x10feeeaf altivec_expand_vec_ext_builtin
	/home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:14736
0x10feeeaf altivec_expand_builtin
	/home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:14969
0x10ff1def rs6000_expand_builtin
	/home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:16530
0x1034702b expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/builtins.c:7226
0x10557feb expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:11025
0x1056d8f3 store_expr(tree_node*, rtx_def*, int, bool, bool)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:5669
0x10571463 expand_assignment(tree_node*, tree_node*, bool)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:5432
0x10571463 expand_assignment(tree_node*, tree_node*, bool)
	/home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:4978
0x1038082b expand_call_stmt
	/home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:2722
0x1038082b expand_gimple_stmt_1
	/home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:3691
0x1038082b expand_gimple_stmt
	/home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:3850
0x1038959f expand_gimple_basic_block
	/home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:5886
0x1038be27 execute
	/home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:6509
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Makefile:26: recipe for target 'prXXXXX-0.exe' failed
make: *** [prXXXXX-0.exe] Error 1
kelvin@genoa:~/gcc-root/tests$
Comment 1 kelvin 2019-05-06 17:01:20 UTC
Author: kelvin
Date: Mon May  6 17:00:46 2019
New Revision: 270918

URL: https://gcc.gnu.org/viewcvs?rev=270918&root=gcc&view=rev
Log:
gcc/ChangeLog:

2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.


Added:
    trunk/gcc/testsuite/gcc.target/powerpc/pr89424-0.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c
    trunk/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13b.c
    trunk/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c
    trunk/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20b.c
Comment 2 kelvin 2019-05-07 16:22:52 UTC
Author: kelvin
Date: Tue May  7 16:22:21 2019
New Revision: 270969

URL: https://gcc.gnu.org/viewcvs?rev=270969&root=gcc&view=rev
Log:
gcc/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.


Added:
    branches/gcc-9-branch/gcc/testsuite/gcc.target/powerpc/pr89424-0.c
Modified:
    branches/gcc-9-branch/gcc/ChangeLog
    branches/gcc-9-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c
    branches/gcc-9-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13b.c
    branches/gcc-9-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c
    branches/gcc-9-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20b.c
Comment 3 kelvin 2019-05-08 22:23:42 UTC
Author: kelvin
Date: Wed May  8 22:23:11 2019
New Revision: 271020

URL: https://gcc.gnu.org/viewcvs?rev=271020&root=gcc&view=rev
Log:
gcc/ChangeLog:

2019-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.


Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.target/powerpc/pr89424-0.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c
    branches/gcc-8-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13b.c
    branches/gcc-8-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c
    branches/gcc-8-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20b.c
Comment 4 kelvin 2019-05-13 21:28:05 UTC
Author: kelvin
Date: Mon May 13 21:27:29 2019
New Revision: 271137

URL: https://gcc.gnu.org/viewcvs?rev=271137&root=gcc&view=rev
Log:
gcc/ChangeLog:

2019-05-13  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-13  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.


Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/pr89424-0.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c
    branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13b.c
    branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c
    branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20b.c
Comment 5 kelvin 2019-05-20 21:30:17 UTC
Patches committed to trunk and backported to gcc9, gcc8, and gcc7.