[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-11-23 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #28 from Randy MacLeod  ---
Alex, thanks for confirming, I was worried that it was one of the _perfectly_
sensible local patches we have in YP.  ;-)

FYI, a local toolchain expert has started working on this defect so stay tuned
/ keeep refreshing.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-10-13 Thread opotapenko at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Alex Potapenko  changed:

   What|Removed |Added

 CC||opotapenko at gmail dot com

--- Comment #27 from Alex Potapenko  ---
I'd like to chime in to do two things: first suggest a (simple) way to
reproduce this using buildroot (GCC 7.2.0), and then post a gdb backtrace in
case there's something useful there (not sure how much different from Randy's
log it is).

1. Reproducing.
1.1) Download and unpack
https://buildroot.org/downloads/buildroot-2017.08.tar.bz2
1.2) Save
https://raw.githubusercontent.com/Optware/Optware-ng/5b3cbfeb2bb2444d47ea15bcce3081ffbaea8046/sources/buildroot-ppc-603e/config
as ".config" in buildroot root
1.3) Patch buildroot to make gcc debuggable:
diff --git a/package/gcc/gcc-final/gcc-final.mk
b/package/gcc/gcc-final/gcc-final.mk
index 213f3d7..4364e2a 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -41,6 +41,7 @@ define  HOST_GCC_FINAL_CONFIGURE_CMDS
(cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
CFLAGS="$(HOST_CFLAGS)" \
+   CXXFLAGS="-ggdb -O0" \
LDFLAGS="$(HOST_LDFLAGS)" \
$(HOST_GCC_FINAL_CONF_ENV) \
./configure \
@@ -107,6 +108,8 @@ HOST_GCC_FINAL_CONF_ENV = \

 HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)

+HOST_GCC_FINAL_MAKE_OPTS += STAGE_CFLAGS="-ggdb -O0"
+
 # Make sure we have 'cc'
 define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
if [ ! -e $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc ]; then \

1.4) Build the toolchain with `make`. You'll have the toolchain in
"buildroot-2017.08/output/host" after build is done

2. Now, gdb log from built toolchain (note that test.c is the "smaller
reproducer with manual work-around" uploaded by Randy):

jenkins@u0:~/buildroot-2017.08$ gdb
/home/jenkins/buildroot-2017.08/output/host/libexec/gcc/powerpc-buildroot-linux-gnu/7.2.0/cc1
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from
/home/jenkins/buildroot-2017.08/output/host/libexec/gcc/powerpc-buildroot-linux-gnu/7.2.0/cc1...done.
(gdb) run -quiet -v -imultilib . -imultiarch powerpc-linux-gnu -isysroot
/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot
-D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux
-Asystem=linux -Asystem=unix -Asystem=posix test.c -quiet -dumpbase test.c
-maltivec -mcpu=603e -auxbase test -version -o -
Starting program:
/home/jenkins/buildroot-2017.08/output/host/libexec/gcc/powerpc-buildroot-linux-gnu/7.2.0/cc1
-quiet -v -imultilib . -imultiarch powerpc-linux-gnu -isysroot
/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot
-D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux
-Asystem=linux -Asystem=unix -Asystem=posix test.c -quiet -dumpbase test.c
-maltivec -mcpu=603e -auxbase test -version -o -
GNU C11 (Buildroot 2017.08-g9362d96-dirty) version 7.2.0
(powerpc-buildroot-linux-gnu)
compiled by GNU C version 5.4.0 20160609, GMP version 6.1.2, MPFR
version 3.1.5, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot/usr/local/include/powerpc-linux-gnu"
ignoring nonexistent directory
"/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot/usr/local/include"
ignoring nonexistent directory
"/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot/usr/include/powerpc-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:

/home/jenkins/buildroot-2017.08/output/host/lib/gcc/powerpc-buildroot-linux-gnu/7.2.0/include

/home/jenkins/buildroot-2017.08/output/host/lib/gcc/powerpc-buildroot-linux-gnu/7.2.0/include-fixed

/home/jenkins/buildroot-2017.08/output/host/lib/gcc/powerpc-buildroot-linux-gnu/7.2.0/../../../../powerpc-buildroot-linux-gnu/include

/home/jenkins/buildroot-2017.08/output/host/powerpc-buildroot-linux-gnu/sysroot/usr/include
End of search list.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-09-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #26 from Segher Boessenkool  ---
I still can't reproduce the problem, and I don't see where the null
pointer is coming from either.  Someone who can reproduce the problem
will have to do some debugging.  Sorry.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-09-13 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #25 from Randy MacLeod  ---
Any progress or need for additional information? 
What should I expect over the coming weeks?

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-08-16 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #24 from Randy MacLeod  ---
This ICE still happens with gcc-7.2. 
Here's the stacktrace:

(gdb) bt
#0  store_expr_with_bounds (exp=exp@entry=0x76275900,
target=target@entry=0x7625d660, call_param_p=call_param_p@entry=0,
nontemporal=nontemporal@entry=false, reverse=reverse@entry=false, 
btarget=btarget@entry=0x76524318) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/expr.c:5575
#1  0x00760cb0 in expand_assignment (to=0x76524318,
from=from@entry=0x76275900, nontemporal=nontemporal@entry=false) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/expr.c:5321
#2  0x0067309b in expand_call_stmt (stmt=0x76521750) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cfgexpand.c:2656
#3  expand_gimple_stmt_1 (stmt=0x76521750) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cfgexpand.c:3571
#4  expand_gimple_stmt (stmt=stmt@entry=0x76521750) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cfgexpand.c:3737
#5  0x00674a91 in expand_gimple_basic_block (bb=0x7659f680,
disable_tail_calls=disable_tail_calls@entry=false) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cfgexpand.c:5744
#6  0x0067957f in (anonymous namespace)::pass_expand::execute
(this=, fun=0x7639a0b0) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cfgexpand.c:6357
#7  0x0092c99b in execute_one_pass (pass=pass@entry=0x1a8a650) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/passes.c:2465
#8  0x0092d1b8 in execute_pass_list_1 (pass=0x1a8a650) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/passes.c:2554
#9  0x0092d215 in execute_pass_list (fn=,
pass=) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/passes.c:2565
#10 0x006a3dad in cgraph_node::expand (this=0x7649be60) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cgraphunit.c:2042
#11 0x006a52dd in expand_all_functions () at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cgraphunit.c:2178
#12 symbol_table::compile (this=this@entry=0x76585000) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cgraphunit.c:2535
#13 0x006a6d38 in symbol_table::compile (this=0x76585000) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cgraphunit.c:2599
#14 symbol_table::finalize_compilation_unit (this=0x76585000) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/cgraphunit.c:2625
#15 0x009e8060 in compile_file () at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/toplev.c:492
#16 0x0057817c in do_compile () at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/toplev.c:2003
#17 toplev::main (this=this@entry=0x7fffada0, argc=argc@entry=27,
argv=argv@entry=0x7fffaea8) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/toplev.c:2137
#18 0x0057a517 in main (argc=27, argv=0x7fffaea8) at
../../../../../../../work-shared/gcc-7.2.0-r0/gcc-7.2.0/gcc/main.c:39


Aside from the address variations and the newer toolchain version, the stack
trackes look the same to my untrained dragon slaying eyes. :)

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-21 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #23 from Randy MacLeod  ---
Here is the 'bt' and 'bt full' with line numbers and symbols. YP diff to enable
this is below as well. Thanks for you patience as I re-learn these ropes.

Program received signal SIGSEGV, Segmentation fault.
store_expr_with_bounds (exp=exp@entry=0x7658ed80,
target=target@entry=0x76722930, call_param_p=call_param_p@entry=0, 
nontemporal=nontemporal@entry=false, reverse=reverse@entry=false,
btarget=btarget@entry=0x7658d480)
at ../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/expr.c:5575
5575  if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode
(gdb) bt 
#0  store_expr_with_bounds (exp=exp@entry=0x7658ed80,
target=target@entry=0x76722930, call_param_p=call_param_p@entry=0, 
nontemporal=nontemporal@entry=false, reverse=reverse@entry=false,
btarget=btarget@entry=0x7658d480)
at ../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/expr.c:5575
#1  0x007604e0 in expand_assignment (to=0x7658d480,
from=from@entry=0x7658ed80, nontemporal=nontemporal@entry=false)
at ../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/expr.c:5321
#2  0x006728fb in expand_call_stmt (stmt=0x76715240) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:2656
#3  expand_gimple_stmt_1 (stmt=0x76715240) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:3571
#4  expand_gimple_stmt (stmt=stmt@entry=0x76715240) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:3737
#5  0x006742f1 in expand_gimple_basic_block (bb=0x765a0410,
disable_tail_calls=disable_tail_calls@entry=false)
at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:5744
#6  0x00678ddf in (anonymous namespace)::pass_expand::execute
(this=, fun=0x7671) 
[90/202]
at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:6357
#7  0x0092be4b in execute_one_pass (pass=pass@entry=0x1a80650) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/passes.c:2465
#8  0x0092c668 in execute_pass_list_1 (pass=0x1a80650) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/passes.c:2554
#9  0x0092c6c5 in execute_pass_list (fn=,
pass=)
at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/passes.c:2565
#10 0x006a360d in cgraph_node::expand (this=0x7670c2e0) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cgraphunit.c:2042
#11 0x006a4b3d in expand_all_functions () at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cgraphunit.c:2178
#12 symbol_table::compile (this=this@entry=0x76585000) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cgraphunit.c:2535
---Type  to continue, or q  to quit---
#13 0x006a6598 in symbol_table::compile (this=0x76585000)
at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cgraphunit.c:2599
#14 symbol_table::finalize_compilation_unit (this=0x76585000) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cgraphunit.c:2625
#15 0x009e75b0 in compile_file () at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/toplev.c:492
#16 0x00577a4c in do_compile () at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/toplev.c:2000
#17 toplev::main (this=this@entry=0x7fffada0, argc=argc@entry=27,
argv=argv@entry=0x7fffaea8)
at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/toplev.c:2134
#18 0x00579dd7 in main (argc=27, argv=0x7fffaea8) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/main.c:39
(gdb)


(gdb) bt full  
  [69/202]
#0  store_expr_with_bounds (exp=exp@entry=0x7658ed80,
target=target@entry=0x76722930, call_param_p=call_param_p@entry=0, 
nontemporal=nontemporal@entry=false, reverse=reverse@entry=false,
btarget=btarget@entry=0x7658d480)
at ../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/expr.c:5575
temp = 0x0
alt_rtl = 0x0
loc = 2147483667
__FUNCTION__ = "store_expr_with_bounds"
#1  0x007604e0 in expand_assignment (to=0x7658d480,
from=from@entry=0x7658ed80, nontemporal=nontemporal@entry=false)
at ../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/expr.c:5321
to_rtx = 
result = 
mode = 
align = 
icode = 
__FUNCTION__ = "expand_assignment"
#2  0x006728fb in expand_call_stmt (stmt=0x76715240) at
../../../../../../../work-shared/gcc-7.1.0-r0/gcc-7.1.0/gcc/cfgexpand.c:26[53/202]
exp = 0x7658ed80
i = 
builtin_p = 
#3  expand_gimple_stmt_1 (stmt=0x76715240) at

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-19 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #22 from Randy MacLeod  ---
Yes, the host is an x86-64-linux system running Ubuntu-16.04.1.
The cross-compiler was built using the Open Embedded (OE) build system so of
course, it's not part of Ubuntu. 

I did get a better backtrace as shown below but no full symbol table/line
numbers yet.


The OE build puts the toolchain in a sysroot directory structure so I tried
running gdb using the original executable:

$ file
/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/x86_64-linux/gcc-cross-powerpc/7.1.0-r0/gcc-7.1.0/build.x86_64-linux.powerpc-oe-linux/gcc/cc1
/LONGPATH/build.x86_64-linux.powerpc-oe-linux/gcc/cc1: ELF 64-bit LSB
executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter
/lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32,
BuildID[sha1]=e4f4e565fcaeee1a3c291899d42d96b7fd76db1d, not stripped

$ gdb /LONGPATH/build.x86_64-linux.powerpc-oe-linux/gcc/cc1
(gdb) run -fpreprocessed second.i
...
Program received signal SIGSEGV, Segmentation fault.   
   
   [6/1951]
0x0075f743 in store_expr_with_bounds(tree_node*, rtx_def*, int, bool,
bool, tree_node*) ()
(gdb) bt full
#0  0x0075f743 in store_expr_with_bounds(tree_node*, rtx_def*, int,
bool, bool, tree_node*) ()
No symbol table info available.
#1  0x007604e0 in expand_assignment(tree_node*, tree_node*, bool) ()
No symbol table info available.
#2  0x006728fb in expand_gimple_stmt(gimple*) ()
No symbol table info available.
#3  0x006742f1 in expand_gimple_basic_block(basic_block_def*, bool) ()
No symbol table info available.
#4  0x00678ddf in (anonymous
namespace)::pass_expand::execute(function*) ()
No symbol table info available.
#5  0x0092be4b in execute_one_pass(opt_pass*) ()
No symbol table info available.
#6  0x0092c668 in execute_pass_list_1(opt_pass*) [clone .constprop.88]
()
No symbol table info available.
#7  0x0092c6c5 in execute_pass_list(function*, opt_pass*) ()
No symbol table info available.
#8  0x006a360d in cgraph_node::expand() ()
No symbol table info available.
#9  0x006a4b3d in symbol_table::compile() [clone .part.51] ()
No symbol table info available.
#10 0x006a6598 in symbol_table::finalize_compilation_unit() ()
No symbol table info available.
#11 0x009e75b0 in compile_file() ()
No symbol table info available.
#12 0x00577a4c in toplev::main(int, char**) ()
No symbol table info available.
#13 0x00579dd7 in main ()
No symbol table info available.
(gdb) info register
rax0x0  0
rbx0x7658ed80   140737326411136
rcx0x0  0
rdx0x7fffa8b0   140737488332976
rsi0x7fffa8a0   140737488332960
rdi0x0  0
rbp0x76722930   0x76722930
rsp0x7fffa880   0x7fffa880
r8 0x0  0
r9 0x0  0
r100x7658d798   140737326405528
r110x0  0
r120x0  0
r130x0  0
r140x0  0
r150x7658d480   140737326404736
rip0x75f743 0x75f743 
eflags 0x10246  [ PF ZF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0  0
es 0x0  0
fs 0x0  0
gs 0x0  0
(gdb) 

I'm not sure why the symbol table isn't available but I can work on that
tomorrow if needed.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #21 from Segher Boessenkool  ---
Hrm, those ?? are a bit worrying, is that normal on x86_64-linux
(that is what this is, as host?)

I also don't see line numbers.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-19 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #20 from Randy MacLeod  ---
I can try! ;) How's this:

$ gdb
/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/../../libexec/powerpc-oe-linux/gcc/powerpc-oe-linux/7.1.0/cc1

(gdb) run -fpreprocessed second.i -msecure-plt -quiet -dumpbase second.c -m32
-mhard-float -mcpu=7400 -mno-spe -maltivec -auxbase second -g -O2 -Wall
-freport-bug -feliminate-unused-debug-types
-fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0=/usr/src/debug/libjpeg-turbo/1_1.5.1-r0
-fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot-native=
-fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot=
-fPIC -o - -frandom-seed=0 -fdump-noaddr

Program received signal SIGSEGV, Segmentation fault.
0x0075f743 in store_expr_with_bounds(tree_node*, rtx_def*, int, bool,
bool, tree_node*) ()
(gdb) bt
#0  0x0075f743 in store_expr_with_bounds(tree_node*, rtx_def*, int,
bool, bool, tree_node*) ()
#1  0x007604e0 in expand_assignment(tree_node*, tree_node*, bool) ()
#2  0x006728fb in ?? ()
#3  0x006742f1 in ?? ()
#4  0x00678ddf in ?? ()
#5  0x0092be4b in execute_one_pass(opt_pass*) ()
#6  0x0092c668 in ?? ()
#7  0x0092c6c5 in execute_pass_list(function*, opt_pass*) ()
#8  0x006a360d in cgraph_node::expand() ()
#9  0x006a4b3d in ?? ()
#10 0x006a6598 in symbol_table::finalize_compilation_unit() ()
#11 0x009e75b0 in ?? ()
#12 0x00577a4c in toplev::main(int, char**) ()
#13 0x00579dd7 in main ()
(gdb) 
(gdb) info regs
Undefined info command: "regs".  Try "help info".
(gdb) info registers
rax0x0  0
rbx0x7658ed80   140737326411136
rcx0x0  0
rdx0x7fffa870   140737488332912
rsi0x7fffa860   140737488332896
rdi0x0  0
rbp0x76722930   0x76722930
rsp0x7fffa840   0x7fffa840
r8 0x0  0
r9 0x0  0
r100x7658d798   140737326405528
r110x0  0
r120x0  0
r130x0  0
r140x0  0
r150x7658d480   140737326404736
rip0x75f743 0x75f743 
eflags 0x10246  [ PF ZF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0  0
es 0x0  0
fs 0x0  0
gs 0x0  0
(gdb)

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #19 from Segher Boessenkool  ---
(In reply to Randy MacLeod from comment #18)
> 2. The "smaller reproducer with manual work-around " DOES STILL result in an
> ICE as does the libjpeg-turbo build as you'd expect.

I still cannot reproduce that ICE though.  Will, can you?  Randy, do
you have a backtrace?

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-19 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #18 from Randy MacLeod  ---
With both patches applied:
1. The "minimal testcase produced by the delta utility" no longer ICEs the
toolchain. 
2. The "smaller reproducer with manual work-around " DOES STILL result in an
ICE as does the libjpeg-turbo build as you'd expect.


Here's the patch I'm using just to keep myself honest:

$ diffstat meta/recipes-devtools/gcc/gcc-7.1/backport-gcc-altivec-no-lhs.patch 
 rs6000-c.c |2 ++
 rs6000.c   |1 +
 2 files changed, 3 insertions(+)

$ cat meta/recipes-devtools/gcc/gcc-7.1/backport-gcc-altivec-no-lhs.patch 
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -6216,6 +6216,8 @@
   /* Strip qualifiers like "const" from the pointer arg.  */
   tree arg1_type = TREE_TYPE (arg1);
   tree inner_type = TREE_TYPE (arg1_type);
+  if (!POINTER_TYPE_P (arg1_type))
+ goto bad;
   if (TYPE_QUALS (TREE_TYPE (arg1_type)) != 0)
{
  arg1_type = build_pointer_type (build_qualified_type (inner_type,
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -17001,6 +17001,7 @@
 = (enum rs6000_builtins) DECL_FUNCTION_CODE (fndecl);
   tree arg0, arg1, lhs;

+  if (!gimple_call_lhs (stmt)) return false;
   switch (fn_code)
 {
 /* Flavors of vec_add.  We deliberately don't expand

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-16 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #17 from Randy MacLeod  ---
Back from vacation, I plan to test the latest patch this week.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-13 Thread willschm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #16 from Will Schmidt  ---
(In reply to Bill Schmidt from comment #13)
> CCing Will Schmidt for the general gimple-folding issue of built-in calls
> with missing LHSes.

revision 250185 has been committed to handle the gimple-folding issue.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Segher Boessenkool  changed:

   What|Removed |Added

  Attachment #41722|0   |1
is obsolete||

--- Comment #15 from Segher Boessenkool  ---
Created attachment 41723
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41723=edit
patch for the orig problem

I hate clicky interfaces.  Ugh.  Sorry.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #14 from Segher Boessenkool  ---
Created attachment 41722
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41722=edit
second patch, for the original problem

This one should solve the original problem.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Bill Schmidt  changed:

   What|Removed |Added

 CC||willschm at gcc dot gnu.org

--- Comment #13 from Bill Schmidt  ---
CCing Will Schmidt for the general gimple-folding issue of built-in calls with
missing LHSes.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Bill Schmidt  changed:

   What|Removed |Added

 CC||wschmidt at gcc dot gnu.org

--- Comment #12 from Bill Schmidt  ---
(In reply to Segher Boessenkool from comment #11)
> 
>   __builtin_altivec_vsubuhm (cbh, pw_cj);
> 
> 
> is transformed to
> 
> 
>  = cbh - pw_cj;
> 
> 
> and that blows up.

Yeah, well...the original source is obviously wrong, since
__builtin_altivec_vsubuhm produces a result that is thrown away.

We should avoid optimizing in this situation, but it's an ice-on-invalid.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #11 from Segher Boessenkool  ---
The original testcase still ICEs ("smaller reproducer" I never got to fail).

(trunk, no options whatsoever):

81317-1.c: In function 'jsimd_ycc_rgb_convert_altivec':
81317-1.c:184:6: internal compiler error: Segmentation fault
 void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE
input_buf,
  ^
0x108f8edb crash_signal
/home/segher/src/gcc/gcc/toplev.c:338
0x1093ed98 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
/home/segher/src/gcc/gcc/tree.h:3196
0x1093ed98 verify_gimple_assign_binary
/home/segher/src/gcc/gcc/tree-cfg.c:3828
0x10946927 verify_gimple_in_seq_2
/home/segher/src/gcc/gcc/tree-cfg.c:4936
0x1094c0ef verify_gimple_in_seq(gimple*)
/home/segher/src/gcc/gcc/tree-cfg.c:4975
0x105af4a7 gimplify_body(tree_node*, bool)
/home/segher/src/gcc/gcc/gimplify.c:12589
0x105af91f gimplify_function_tree(tree_node*)
/home/segher/src/gcc/gcc/gimplify.c:12679
0x1039d487 cgraph_node::analyze()
/home/segher/src/gcc/gcc/cgraphunit.c:668
0x103a11d7 analyze_functions
/home/segher/src/gcc/gcc/cgraphunit.c:1129
0x103a298f symbol_table::finalize_compilation_unit()
/home/segher/src/gcc/gcc/cgraphunit.c:2607


  __builtin_altivec_vsubuhm (cbh, pw_cj);


is transformed to


 = cbh - pw_cj;


and that blows up.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Segher Boessenkool  changed:

   What|Removed |Added

  Attachment #41718|0   |1
is obsolete||

--- Comment #10 from Segher Boessenkool  ---
Created attachment 41719
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41719=edit
proposed patch

Again, but without whitespace damage.  Sigh.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Segher Boessenkool  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #9 from Segher Boessenkool  ---
Created attachment 41718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41718=edit
proposed patch

Hi Randy,

Could you test this patch please?

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-11
 CC||segher at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #8 from Segher Boessenkool  ---
Hi Randy,

It is development stage 1, which means we are all pretty busy, so
that's why no one had looked at your bug yet.

I cannot get the "smaller reproducer" to fail (with trunk); but your
minimal testcase in comment 1 fails alright (needs no compiler options
at all):

81317-2.c:4:21: internal compiler error: Segmentation fault
 ( 1, jsimd_ycc_extbgrx_convert_altivec_outptr )
 ^
0x102e1ad4 tree_class_check(tree_node*, tree_code_class, char const*, int, char 
const*)
/home/segher/src/gcc/gcc/tree.h:3205
0x102e1ad4 altivec_resolve_overloaded_builtin(unsigned int, tree_node*, void*)
/home/segher/src/gcc/gcc/config/rs6000/rs6000-c.c:6458

(The first arg to tree_class_check is NULL).

So, confirmed.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-07 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #7 from Randy MacLeod  ---
Is anyone working on this bug? I'm not pushing, but rather trying to understand
what to expect.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-04 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #6 from Randy MacLeod  ---
Created attachment 41682
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41682=edit
smaller reproducer with manual work-around

The work-around clearly isn't a viable one. 
I believe that builtin_vec_ld(a,b) can take 'a' as a variable but perhaps not.

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-04 Thread randy.macleod at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

--- Comment #5 from Randy MacLeod  ---
I agree that the creduce output should be ignored. :(

I ran 'delta' again with a manually cleaned up input and I got a minimal
reproducer that is shorter:

wc -l output:

old:
  4756 /tmp/jdcolor-altivec.i
   269 /tmp/jdcolor-altivec-testcase-min.i
new:
   104 /tmp/bar.i

Note the comment in bar.i:
unaligned_shift_index =
  __builtin_vec_ld( num_cols , outptr); 
 /* replacing num_cols above with a constant such as 0, passes compile
*/

[Bug target/81317] builtin_vec_ld fails for powerpc with altivec

2017-07-04 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317

Andrew Pinski  changed:

   What|Removed |Added

 Target||powerpc-oe-linux
  Component|c   |target

--- Comment #4 from Andrew Pinski  ---
I suspect there are two separate issues here.  The reduced testcase looks like
invalid code while the original looks valid.