[Bug rtl-optimization/83424] New: [8 Regression] wrong code with -O -fno-tree-ccp -fno-tree-coalesce-vars

2017-12-14 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83424

Bug ID: 83424
   Summary: [8 Regression] wrong code with -O -fno-tree-ccp
-fno-tree-coalesce-vars
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42882
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42882=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-ccp -fno-tree-coalesce-vars testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255624-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255624-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171214 (experimental) (GCC) 

Tested revisions:
r255624 - FAIL
r255606 - FAIL
r23 - FAIL
r255386 - OK


foo() is optimized to just "retn"

This seems to go wrong in .combine:

...
Trying 21, 11 -> 22:
   21: {r112:TI=-r101:TI;clobber flags:CC;}
  REG_UNUSED flags:CC
   11: r98:QI=~r105:QI
  REG_DEAD r105:QI
  REG_EQUAL ~[`b']
   22: {r113:QI=r98:QI*r112:TI#0;clobber flags:CC;}
  REG_DEAD r112:TI
  REG_DEAD r98:QI
  REG_UNUSED flags:CC
Failed to match this instruction:
(parallel [
(set (reg:QI 113 [ xD.1900 ])
(mult:QI (plus:QI (reg:QI 105 [ bD.1896 ])
(const_int 1 [0x1]))
(subreg:QI (reg/v:TI 101 [ pD.1897 ]) 0)))
(clobber (reg:CC 17 flags))
])
Failed to match this instruction:
(set (reg:QI 113 [ xD.1900 ])
(mult:QI (plus:QI (reg:QI 105 [ bD.1896 ])
(const_int 1 [0x1]))
(subreg:QI (reg/v:TI 101 [ pD.1897 ]) 0)))
Successfully matched this instruction:
(set (reg:QI 112)
(plus:QI (reg:QI 105 [ bD.1896 ])
(const_int 1 [0x1])))
Successfully matched this instruction:
(set (reg:QI 113 [ xD.1900 ])
(mult:QI (reg:QI 112)
(subreg:QI (reg/v:TI 101 [ pD.1897 ]) 0)))
allowing combination of insns 11, 21 and 22
original costs 4 + 8 + 24 = 36
replacement costs 4 + 24 = 28
deferring deletion of insn with uid = 11.
modifying insn i221: {r112:QI=r105:QI+0x1;clobber flags:CC;}
  REG_UNUSED flags:CC
  REG_DEAD r105:QI
deferring rescan insn with uid = 21.
modifying insn i322: {r113:QI=r112:QI*r101:TI#0;clobber flags:CC;}
  REG_DEAD r101:TI
  REG_UNUSED flags:CC
  REG_DEAD r112:QI
deferring rescan insn with uid = 22.
...

It seems the REG_DEAD r101:TI note should not be there, this r101 is later used
by insn 29.

[Bug rtl-optimization/83422] New: [8 Regression] ICE: in final_scan_insn, at final.c:2429 after "variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without"

2017-12-14 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83422

Bug ID: 83422
   Summary: [8 Regression] ICE: in final_scan_insn, at
final.c:2429 after "variable tracking size limit
exceeded with -fvar-tracking-assignments, retrying
without"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42880
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42880=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -g --param=max-vartrack-size=1 testcase.c
testcase.c: In function 'foo':
testcase.c:2:1: note: variable tracking size limit exceeded with
-fvar-tracking-assignments, retrying without
 foo(int i, int j, int k)
 ^~~
during RTL pass: final
testcase.c:5:1: internal compiler error: in final_scan_insn, at final.c:2429
 }
 ^
0x9a1102 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
/repo/gcc-trunk/gcc/final.c:2429
0x9a1531 final(rtx_insn*, _IO_FILE*, int)
/repo/gcc-trunk/gcc/final.c:2064
0x9a1f61 rest_of_handle_final
/repo/gcc-trunk/gcc/final.c:4551
0x9a1f61 execute
/repo/gcc-trunk/gcc/final.c:4625
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-trunk-255606-checking-yes-rtl-df-extra-nographite-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255606-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255606-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171213 (experimental) (GCC) 

Tested revisions:
r255624 - FAIL
r255606 - FAIL
r255576 - FAIL
r24 - OK

[Bug rtl-optimization/83398] [8 Regression] ICE: in try_ready, at haifa-sched.c:7524 with -O2 -fsched2-use-superblocks -g

2017-12-14 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83398

--- Comment #2 from Zdenek Sojka  ---
This stopped failing between r255606 (ICEs) and r255624 (OK).

[Bug target/47988] ICE: in reload_cse_simplify_operands, at postreload.c:403: insn does not satisfy its constraints

2017-12-13 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47988

--- Comment #2 from Zdenek Sojka  ---
(In reply to Dominique d'Humieres from comment #1)
> Are sure that the expected values after cshift are right?
> 
> Is the problem still present?

The testcase was reduced from testsuite/gfortran.dg/cshift_large_1.f90

I can not reproduce it anymore with trunk.

[Bug rtl-optimization/83398] [8 Regression] ICE: in try_ready, at haifa-sched.c:7524 with -O2 -fsched2-use-superblocks -g

2017-12-13 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83398

--- Comment #1 from Zdenek Sojka  ---
Created attachment 42871
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42871=edit
reduced testcase

[Bug rtl-optimization/83398] New: [8 Regression] ICE: in try_ready, at haifa-sched.c:7524 with -O2 -fsched2-use-superblocks -g

2017-12-12 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83398

Bug ID: 83398
   Summary: [8 Regression] ICE: in try_ready, at
haifa-sched.c:7524 with -O2 -fsched2-use-superblocks
-g
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fsched2-use-superblocks -g testcase.c 
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:16:1: internal compiler error: in try_ready, at haifa-sched.c:7524
 }
 ^
0x16a5e51 try_ready(rtx_insn*)
/repo/gcc-trunk/gcc/haifa-sched.c:7520
0x17273d3 init_ready_list
/repo/gcc-trunk/gcc/sched-ebb.c:129
0x16a963e schedule_block(basic_block_def**, void*)
/repo/gcc-trunk/gcc/haifa-sched.c:6522
0x1727af0 schedule_ebb(rtx_insn*, rtx_insn*, bool)
/repo/gcc-trunk/gcc/sched-ebb.c:537
0x17282b6 schedule_ebbs()
/repo/gcc-trunk/gcc/sched-ebb.c:657
0xe0b254 rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.c:3735
0xe0b254 execute
/repo/gcc-trunk/gcc/sched-rgn.c:3873
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.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-trunk-255576-checking-yes-rtl-df-extra-nographite-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255576-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255576-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171212 (experimental) (GCC) 


Tested revisions:
r255581 - FAIL
r255576 - FAIL
r24 - OK

[Bug rtl-optimization/83393] [8 Regression] wrong code with -O2 -fno-forward-propagate -fno-tree-bit-ccp

2017-12-12 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83393

--- Comment #1 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #0)

> ... even though insn 16 output (r108) should be used insn 20; ...

s/insn 16/insn 14/


Later, there is:

Trying 18 -> 20:
   18: r116:SI=0
   20: {r108:HI=r108:HI<

[Bug rtl-optimization/83393] New: [8 Regression] wrong code with -O2 -fno-forward-propagate -fno-tree-bit-ccp

2017-12-12 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83393

Bug ID: 83393
   Summary: [8 Regression] wrong code with -O2
-fno-forward-propagate -fno-tree-bit-ccp
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42848
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42848=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-forward-propagate -fno-tree-bit-ccp
testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255576-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255576-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171212 (experimental) (GCC) 

Tested revisions:
trunk r255576 - FAIL
trunk r255386 - FAIL

.combine shows:

insn_cost 4 for 8: r111:SI=[`d']
insn_cost 4 for 9: r112:HI=r111:SI#0
  REG_DEAD r111:SI
insn_cost 4 for11: {r114:HI=r112:HI<<0xf;clobber flags:CC;}
  REG_DEAD r112:HI
  REG_UNUSED flags:CC
insn_cost 6 for14: {r108:HI=r114:HI-0x23;clobber flags:CC;}
  REG_DEAD r114:HI
  REG_UNUSED flags:CC
insn_cost 4 for15: r115:SI=zero_extend(r108:HI)
insn_cost 4 for16: flags:CC=cmp(r108:HI,0x23)
  REG_DEAD r108:HI
insn_cost 4 for17: r117:QI=leu(flags:CC,0)
  REG_DEAD flags:CC
insn_cost 4 for18: r116:SI=zero_extend(r117:QI)
  REG_DEAD r117:QI
insn_cost 4 for19: {r93:SI=r115:SI<<r116:SI#0;clobber flags:CC;}
  REG_DEAD r116:SI
  REG_DEAD r115:SI
  REG_UNUSED flags:CC
insn_cost 4 for20: r108:HI=r93:SI#0



Trying 8 -> 9:
...
deferring deletion of insn with uid = 8.
modifying insn i3 9: r112:HI=[`d']
deferring rescan insn with uid = 9.


Trying 19 -> 20:
...
deferring deletion of insn with uid = 19.
modifying insn i320: {r108:HI=r115:SI#0<<r116:SI#0;clobber flags:CC;}
  REG_UNUSED flags:CC
  REG_DEAD r115:SI
  REG_DEAD r116:SI
deferring rescan insn with uid = 20.


Trying 15 -> 20:
   15: r115:SI=zero_extend(r108:HI)
   20: {r108:HI=r115:SI#0<<r116:SI#0;clobber flags:CC;}
  REG_UNUSED flags:CC
  REG_DEAD r115:SI
  REG_DEAD r116:SI
Successfully matched this instruction:
(parallel [
(set (reg/v:HI 108 [ fD.1899 ])
(ashift:HI (reg/v:HI 108 [ fD.1899 ])
(subreg:QI (reg:SI 116) 0)))
(clobber (reg:CC 17 flags))
])
allowing combination of insns 15 and 20
original costs 4 + 4 = 8
replacement cost 4
deferring deletion of insn with uid = 15.
modifying insn i320: {r108:HI=r108:HI<<r116:SI#0;clobber flags:CC;}
  REG_DEAD r116:SI
  REG_UNUSED flags:CC
deferring rescan insn with uid = 20.


Trying 14, 16 -> 18:
   14: {r108:HI=r114:HI-0x23;clobber flags:CC;}
  REG_DEAD r114:HI
  REG_UNUSED flags:CC
   16: flags:CC=cmp(r108:HI,0x23)
  REG_DEAD r108:HI
   18: r116:SI=leu(flags:CC,0)
  REG_DEAD flags:CC
Successfully matched this instruction:
(set (reg:SI 116)
(const_int 0 [0]))
allowing combination of insns 14, 16 and 18
original costs 6 + 4 + 4 = 14
replacement cost 4
deferring deletion of insn with uid = 16.
deferring deletion of insn with uid = 14.
deferring deletion of insn with uid = 9.
deferring deletion of insn with uid = 11.
modifying insn i318: r116:SI=0
deferring rescan insn with uid = 18.


It seems insns 9, 11, 14, 16 get deleted, even though insn 16 output (r108)
should be used insn 20; it is likely I overlooked something though. I don't
know if r108 reuse (insn 14 sets; insn 16 dead; insn 20 sets again) might be
related to this.

[Bug tree-optimization/83364] New: [8 Regression] wrong code with -O -fno-forward-propagate -fno-tree-coalesce-vars -fno-tree-ter

2017-12-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83364

Bug ID: 83364
   Summary: [8 Regression] wrong code with -O
-fno-forward-propagate -fno-tree-coalesce-vars
-fno-tree-ter
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42834
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42834=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -w -O -fno-forward-propagate -fno-tree-coalesce-vars
-fno-tree-ter testcase.c
$ ./a.out 
Aborted

$ /repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171207 (experimental) (GCC)

[Bug tree-optimization/83363] New: [8 Regression] wrong code at -O2 -fno-forward-propagate

2017-12-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83363

Bug ID: 83363
   Summary: [8 Regression] wrong code at -O2
-fno-forward-propagate
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42833=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-forward-propagate testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171207 (experimental) (GCC)

[Bug tree-optimization/83362] New: [8 Regression] wrong code at -O1

2017-12-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83362

Bug ID: 83362
   Summary: [8 Regression] wrong code at -O1
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Created attachment 42832
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42832=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O1 testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255464-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171207 (experimental) (GCC) 

All tested targets (arm, powerpc, x86) seem to be affected.

[Bug target/83330] New: [7/8 Regression] generating unaligned store to stack for SSE register with -mno-push-args

2017-12-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83330

Bug ID: 83330
   Summary: [7/8 Regression] generating unaligned store to stack
for SSE register with -mno-push-args
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42816
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42816=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-dce -mno-push-args testcase.c
$ ./a.out 
Segmentation fault


foo() disassembly:

foo:
sub rsp, 16
pxorxmm0, xmm0
movaps  XMMWORD PTR [rsp], xmm0 <== crashes HERE
pop rax
mov rax, QWORD PTR g[rip]
pop rdx
ret

According to the ABI, rsp is aligned to 16 bytes before the function call;
thus, rsp % 16 == 0 at the point of crash.

Also, I do not understand why bar() is apparently inlined, when the function
has noinline,noclone attributes (noipa helps; -fno-ipa-pure-const helps too);
but "noipa" implies just noinline,noclone,no_icf according to
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes

[Bug rtl-optimization/82881] New: [8 Regression] ICE: in df_compact_blocks, at df-core.c:1729 with -freorder-blocks-algorithm=simple

2017-11-07 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82881

Bug ID: 82881
   Summary: [8 Regression] ICE: in df_compact_blocks, at
df-core.c:1729 with -freorder-blocks-algorithm=simple
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42558
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42558=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -freorder-blocks-algorithm=simple testcase.c 
during RTL pass: bbro
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in df_compact_blocks, at
df-core.c:1729
 }
 ^
0x8a6b3f df_compact_blocks()
/repo/gcc-trunk/gcc/df-core.c:1729
0x1543a45 compact_blocks()
/repo/gcc-trunk/gcc/cfg.c:160
0x153c150 reorder_basic_blocks
/repo/gcc-trunk/gcc/bb-reorder.c:2502
0x153c150 execute
/repo/gcc-trunk/gcc/bb-reorder.c:2592
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-254487-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-254487-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171107 (experimental) (GCC)

[Bug tree-optimization/82788] New: wrong code with -fstack-clash-protection --param=stack-clash-protection-probe-interval=10 on simple code

2017-10-31 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82788

Bug ID: 82788
   Summary: wrong code with -fstack-clash-protection
--param=stack-clash-protection-probe-interval=10 on
simple code
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Created attachment 42507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42507=edit
reduced testcase

$ cat testcase.c 
int main() { int a[1442]; }
$ x86_64-pc-linux-gnu-gcc -fstack-clash-protection
--param=stack-clash-protection-probe-interval=10 testcase.c
$ ./a.out 
Segmentation fault

In the assembly, there is a loop that never finishes (until it segfaults):
...
lea r11, [rsp-5120]
.LPSRL0:
sub rsp, 4096
or  DWORD PTR [rsp], 0
cmp rsp, r11
jne .LPSRL0
...


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-254242-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-254242-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171030 (experimental) (GCC)

[Bug target/82621] New: [6/7/8 Regression] wrong code with -Og -fgcse -fweb

2017-10-19 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82621

Bug ID: 82621
   Summary: [6/7/8 Regression] wrong code with -Og -fgcse -fweb
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 42404
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42404=edit
reduced testcase

Output:
$ powerpc-unknown-linux-gnu-gcc -Og -fgcse -fweb testcase.c
$ ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

$ powerpc-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-powerpc/bin/powerpc-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-253803-checking-yes-rtl-df-extra-nographite-powerpc/bin/../libexec/gcc/powerpc-unknown-linux-gnu/8.0.0/lto-wrapper
Target: powerpc-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl
--with-sysroot=/usr/powerpc-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc-unknown-linux-gnu
--with-ld=/usr/bin/powerpc-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-253803-checking-yes-rtl-df-extra-nographite-powerpc
Thread model: posix
gcc version 8.0.0 20171017 (experimental) (GCC) 

The problem seems to be that .combine does:
...
insn_cost 4 for   109: r188:SI=0
insn_cost 4 for77: {r196:SI=0-r188:SI;ca:SI=leu(r188:SI,0);}
  REG_UNUSED ca:SI
insn_cost 4 for79: {r203:SI=r130:SI-r188:SI;ca:SI=leu(r188:SI,r130:SI);}
  REG_DEAD r188:SI
  REG_DEAD r130:SI
  REG_UNUSED ca:SI
insn_cost 4 for81: r182:SI=high(`b')
insn_cost 8 for83: r183:SI=[r182:SI+low(`b')]
  REG_DEAD r182:SI
  REG_EQUAL [`b']
insn_cost 4 for89:
{r198:SI=r203:SI+r183:SI;ca:SI=ltu(r203:SI+r183:SI,r203:SI);}
  REG_DEAD r203:SI
  REG_DEAD r183:SI
insn_cost 4 for90: {r197:SI=r196:SI+r196:SI+ca:SI;clobber ca:SI;}
  REG_DEAD r196:SI
  REG_DEAD ca:SI
  REG_UNUSED ca:SI
...
Trying 77 -> 90:
Failed to match this instruction:
(parallel [
(set (reg:SI 197)
(const_int 1 [0x1]))
(clobber (reg:SI 76 ca))
])
Successfully matched this instruction:
(set (reg:SI 197)
(const_int 1 [0x1]))
allowing combination of insns 77 and 90
original costs 4 + 4 = 8
replacement cost 4
deferring deletion of insn with uid = 77.
deferring deletion of insn with uid = 77.
modifying insn i390: r197:SI=0x1
deferring rescan insn with uid = 90.
...


Even though ca from insn 89 should be used in insn 90.

[Bug target/69888] ICE: SIGSEGV in decide_alg (i386.c:26169) due to infinite (?) recursion with -minline-all-stringops -mmemset-strategy=no_stringop:-1:noalign

2017-10-18 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69888

--- Comment #9 from Zdenek Sojka  ---
I think this bug can be closed now: it was fixed for gcc 6+ and gcc 5.4+.

[Bug debug/47361] ICE: in build_abbrev_table, at dwarf2out.c:10477 with -g -feliminate-dwarf2-dups

2017-09-23 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47361

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||8.0

--- Comment #4 from Zdenek Sojka  ---
-feliminate-dwarf2-dups was removed in gcc 8.0.

[Bug rtl-optimization/82024] [8 Regression] wrong code with -Og -fgcse-sm -frerun-cse-after-loop --param=max-combine-insns=3

2017-08-30 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82024

--- Comment #3 from Zdenek Sojka  ---
(In reply to Segher Boessenkool from comment #2)
> What were the original insns?  (combine dump shows that right at the
> start, with the insn costs for-em).

The dump shows:

insn_cost 4 for 2: r101:DI=di:DI
  REG_DEAD di:DI
insn_cost 4 for 6: r102:SI=[`c']
insn_cost 6 for 7: {r88:SI=r102:SI|0x5fff;clobber flags:CC;}
  REG_DEAD r102:SI
  REG_UNUSED flags:CC
  REG_EQUAL [`c']|0x5fff
insn_cost 4 for 8: [`c']=r88:SI
insn_cost 3 for11: r103:DI=0xfffc
insn_cost 4 for12: {r98:DI=r101:DI+r103:DI;clobber flags:CC;}
  REG_DEAD r103:DI
  REG_DEAD r101:DI
  REG_UNUSED flags:CC
  REG_EQUAL r101:DI+0xfffc
insn_cost 4 for13: r104:DI=0x1
insn_cost 0 for14:
{r105:DI=udiv(r98:DI,r104:DI);r106:DI=umod(r98:DI,r104:DI);clobber flags:CC;}
  REG_DEAD r104:DI
  REG_DEAD r98:DI
  REG_UNUSED flags:CC
insn_cost 1 for16: r107:DI=zero_extend(r88:SI)
  REG_DEAD r88:SI
insn_cost 4 for17: {r100:DI=r107:DI+r105:DI;clobber flags:CC;}
  REG_DEAD r107:DI
  REG_DEAD r105:DI
  REG_UNUSED flags:CC
insn_cost 6 for20: flags:CC=cmp(r106:DI,0x)
  REG_DEAD r106:DI
  REG_UNUSED flags:CC
  REG_EQUAL cmp(0,0x)
insn_cost 4 for25: [`a']=0
insn_cost 4 for29: ax:DI=r100:DI
  REG_DEAD r100:DI
insn_cost 0 for30: use ax:DI

[Bug rtl-optimization/82024] New: [8 Regression] wrong code with -Og -fgcse-sm -frerun-cse-after-loop --param=max-combine-insns=3

2017-08-29 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82024

Bug ID: 82024
   Summary: [8 Regression] wrong code with -Og -fgcse-sm
-frerun-cse-after-loop --param=max-combine-insns=3
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42079
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42079=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Og -fgcse-sm -frerun-cse-after-loop
--param=max-combine-insns=3 testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-251387-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-251387-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20170828 (experimental) (GCC) 


.combine does:
...
Trying 13, 12 -> 14:
...
Successfully matched this instruction:
(set (reg:DI 106)
(const_int 0 [0]))
Successfully matched this instruction:
(set (reg:DI 105)
(plus:DI (reg/v:DI 101 [ eD.1821 ])
(reg:DI 103)))
allowing combination of insns 12, 13 and 14
original costs 4 + 4 + 0 = 0
replacement costs 4 + 4 = 8
deferring deletion of insn with uid = 12.
modifying insn i213: r106:DI=0
deferring rescan insn with uid = 13.
modifying insn i314: r105:DI=r101:DI+r103:DI
  REG_DEAD r101:DI
  REG_DEAD r103:DI
deferring rescan insn with uid = 14.
...
Trying 14, 13 -> 20:
Successfully matched this instruction:
(set (reg:DI 105)
(plus:DI (reg/v:DI 101 [ eD.1821 ])
(reg:DI 103)))
allowing combination of insns 13, 14 and 20
original costs 4 + 4 + 6 = 14
replacement cost 4
deferring rescan insn with uid = 20.
deferring deletion of insn with uid = 14.
deferring deletion of insn with uid = 13.
modifying insn i320: r105:DI=r101:DI+r103:DI
  REG_DEAD r103:DI
  REG_DEAD r101:DI
deferring rescan insn with uid = 20.
...


which results in:
...
(insn 17 16 20 2 (parallel [
(set (reg/v:DI 100 [  ])
(plus:DI (reg:DI 107 [ _2 ])
(reg:DI 105)))
(clobber (reg:CC 17 flags))
]) "testcase.c":16 218 {*adddi_1}
 (expr_list:REG_DEAD (reg:DI 107 [ _2 ])
(expr_list:REG_DEAD (reg:DI 105)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)
(insn 20 17 25 2 (set (reg:DI 105)
(plus:DI (reg/v:DI 101 [ eD.1821 ])
(reg:DI 103))) "testcase.c":18 214 {*leadi}
 (expr_list:REG_DEAD (reg:DI 103)
(expr_list:REG_DEAD (reg/v:DI 101 [ eD.1821 ])
(nil
...

insn 17 uses r105, which is now set in insn 20, which appears after it

[Bug tree-optimization/81913] New: [8 Regression] wrong code at -O1

2017-08-21 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81913

Bug ID: 81913
   Summary: [8 Regression] wrong code at -O1
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42020
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42020=edit
reduced testcase

$ x86_64-pc-linux-gnu-gcc -O testcase.c
$ ./a.out
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-251215-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-251215-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20170821 (experimental) (GCC) 


All tested targets are affected (not x86 specific).

[Bug target/81291] [5/6/7/8 Regression] wrong code with -O2 -fno-rerun-cse-after-loop -fno-tree-ter -fno-tree-vrp -funroll-loops due to improper carry

2017-07-04 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81291

--- Comment #1 from Zdenek Sojka  ---
Created attachment 41673
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41673=edit
testcase needing less compiler flags

$ powerpc-unknown-linux-gnu-gcc -Og -fgcse -fweb testcase.c
$ qemu-ppc ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

$ powerpc-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk//binary-latest-powerpc/bin/powerpc-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-249846-checking-yes-rtl-df-extra-nographite-powerpc/bin/../libexec/gcc/powerpc-unknown-linux-gnu/8.0.0/lto-wrapper
Target: powerpc-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl
--with-sysroot=/usr/powerpc-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc-unknown-linux-gnu
--with-ld=/usr/bin/powerpc-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-249846-checking-yes-rtl-df-extra-nographite-powerpc
Thread model: posix
gcc version 8.0.0 20170630 (experimental) (GCC) 

The situations seems to be the same as in comment #0:

$ cat testcase.c.259.init-regs
...
(insn 73 99 75 5 (parallel [
(set (reg:SI 185 [+4 ])
(minus:SI (const_int 0 [0])
(reg:SI 179 [ _5+4 ])))
(set (reg:SI 76 ca)
(leu:SI (reg:SI 179 [ _5+4 ])
(const_int 0 [0])))
]) "testcase.c":12 104 {subfsi3_carry}
 (expr_list:REG_UNUSED (reg:SI 76 ca)
(nil)))
...
(insn 79 78 80 5 (parallel [
(set (reg:SI 187 [+4 ])
(plus:SI (reg:SI 189 [+4 ])
(const_int 1 [0x1])))
(set (reg:SI 76 ca)
(geu:SI (reg:SI 189 [+4 ])
(const_int -1 [0x])))
]) "testcase.c":14 79 {*addsi3_imm_carry_pos}
 (expr_list:REG_DEAD (reg:SI 189 [+4 ])
(nil)))
(insn 80 79 102 5 (parallel [
(set (reg:SI 186)
(plus:SI (reg:SI 185 [+4 ])
(reg:SI 76 ca)))
(clobber (reg:SI 76 ca))
]) "testcase.c":14 85 {addsi3_carry_in_0}
 (expr_list:REG_DEAD (reg:SI 185 [+4 ])
(expr_list:REG_DEAD (reg:SI 76 ca)
(expr_list:REG_UNUSED (reg:SI 76 ca)
(nil)
...

$ cat testcase.c.261.combine
...
Trying 73 -> 80:
Failed to match this instruction:
(parallel [
(set (reg:SI 186)
(const_int 1 [0x1]))
(clobber (reg:SI 76 ca))
])
Successfully matched this instruction:
(set (reg:SI 186)
(const_int 1 [0x1]))
allowing combination of insns 73 and 80
original costs 0 + 4 = 0
replacement cost 4
deferring deletion of insn with uid = 73.
deferring deletion of insn with uid = 73.
modifying insn i380: r186:SI=0x1
deferring rescan insn with uid = 80.
...

But the analysis I did in comment #0 is not correct, since I misunderstood some
of the semantics from the dumps.

[Bug target/81286] [6/7 Regression] building for powerpc*-unknown-linux-gnu target fails with RTL checking enabled

2017-07-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81286

--- Comment #2 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #1)
> Created attachment 41666 [details]
> gcc7-pr81286.patch
> 
> Untested fix.  gpc_reg_operand allows in some cases a SUBREG of a REG, but
> REGNO is not valid in that case.

I can confirm that I can build both 6-branch and 7-branch with the patch
applied.

[Bug target/81291] New: [5/6/7/8 Regression] wrong code with -O2 -fno-rerun-cse-after-loop -fno-tree-ter -fno-tree-vrp -funroll-loops due to improper carry

2017-07-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81291

Bug ID: 81291
   Summary: [5/6/7/8 Regression] wrong code with -O2
-fno-rerun-cse-after-loop -fno-tree-ter -fno-tree-vrp
-funroll-loops due to improper carry
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 41667
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41667=edit
reduced testcase

Output:
$ powerpc-unknown-linux-gnu-gcc -O2 -fno-rerun-cse-after-loop -fno-tree-ter
-fno-tree-vrp -funroll-loops testcase.c
$ qemu-ppc ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

The wrong value of "x" is 0x0001. It seems to be created as:
$ cat testcase.c
...
li 11,1  # _20,
 # testcase.c:11:   a %= ~(u64)0;
sth 8,a@l(7) # aD.2487, a.0_1
 # testcase.c:10:   b = (u64)-a > a;
sth 10,b@l(6)# bD.2488, _7
 # testcase.c:13: }
adde 3,3,11  #, c.4_12, _20
blr
...
eg. r11 is unconditionally set to 1, which seems to be wrong.

It is visible at least after combine; before combine, there is:
$ cat testcase.c.260r.ud_dce
...
(insn 45 88 47 6 (parallel [
(set (reg:SI 179 [+4 ])
(minus:SI (const_int 0 [0])
(reg:SI 167 [ _8+4 ])))
(set (reg:SI 76 ca)
(leu:SI (reg:SI 167 [ _8+4 ])
(const_int 0 [0])))
]) "testcase.c":11 104 {subfsi3_carry}
 (expr_list:REG_UNUSED (reg:SI 76 ca)
(nil)))
...
(insn 66 63 67 6 (parallel [
(set (reg:SI 175 [ _20+4 ])
(plus:SI (reg:SI 130 [ d.5_10+-2 ])
(reg:SI 133 [ e.7_14+-2 ])))
(set (reg:SI 76 ca)
(ltu:SI (plus:SI (reg:SI 130 [ d.5_10+-2 ])
(reg:SI 133 [ e.7_14+-2 ]))
(reg:SI 130 [ d.5_10+-2 ])))
]) 78 {addsi3_carry}
 (expr_list:REG_DEAD (reg:SI 133 [ e.7_14+-2 ])
(expr_list:REG_DEAD (reg:SI 130 [ d.5_10+-2 ])
(nil
(insn 67 66 68 6 (parallel [
(set (reg:SI 174 [ _20 ])
(plus:SI (plus:SI (reg:SI 179 [+4 ])
(reg:SI 179 [+4 ]))
(reg:SI 76 ca)))
(clobber (reg:SI 76 ca))
]) 83 {*addsi3_carry_in_internal}
 (expr_list:REG_DEAD (reg:SI 179 [+4 ])
(expr_list:REG_DEAD (reg:SI 76 ca)
(expr_list:REG_UNUSED (reg:SI 76 ca)
(nil)
...

And after combine:
$ cat testcase.c.261r.combine
...
Trying 45 -> 67:
Failed to match this instruction:
(parallel [
(set (reg:SI 174 [ _20 ])
(const_int 1 [0x1]))
(clobber (reg:SI 76 ca))
])
Successfully matched this instruction:
(set (reg:SI 174 [ _20 ])
(const_int 1 [0x1]))
allowing combination of insns 45 and 67
original costs 0 + 8 = 0
replacement cost 4
deferring deletion of insn with uid = 45.
deferring deletion of insn with uid = 45.
modifying insn i367: r174:SI=0x1
deferring rescan insn with uid = 67.
...
(note 45 88 47 6 NOTE_INSN_DELETED)
...
(insn 66 63 67 6 (parallel [
(set (reg:SI 175 [ _20+4 ])
(plus:SI (reg:SI 130 [ d.5_10+-2 ])
(reg:SI 133 [ e.7_14+-2 ])))
(set (reg:SI 76 ca)
(ltu:SI (plus:SI (reg:SI 130 [ d.5_10+-2 ])
(reg:SI 133 [ e.7_14+-2 ]))
(reg:SI 130 [ d.5_10+-2 ])))
]) 78 {addsi3_carry}
 (expr_list:REG_DEAD (reg:SI 133 [ e.7_14+-2 ])
(expr_list:REG_DEAD (reg:SI 130 [ d.5_10+-2 ])
(nil
(insn 67 66 68 6 (set (reg:SI 174 [ _20 ])
(const_int 1 [0x1])) 479 {*movsi_internal1}
 (nil))
...

I don't see how 45 and 67 can be combined when 67 is using reg 76 which is set
by insn 66, but I also do not really understand why insn 67 was present in the
first place (it does r179+r179+ca; why? which is (0-r167)+(0-r167)+ca, which is
0-0+0-0+ca, which is "ca" from insn 66, but value of "ca" from insn 45 (=(0==0)
-> =1) is taken?)

[Bug target/81286] New: [6/7 Regression] building for powerpc*-unknown-linux-gnu target fails with RTL checking enabled

2017-07-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81286

Bug ID: 81286
   Summary: [6/7 Regression] building for
powerpc*-unknown-linux-gnu target fails with RTL
checking enabled
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-checking, ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc*-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Hello,

there is a new regression on the 6-branch and 7-branch. Trying to build an
x86_64-pc-linux-gnu -> powerpc*-unknown-linux-gnu (powerpc-*, powerpc64-*,
powerpc64le-*) crosscompiler with RTL checking enabled fails with:

7-branch r249891:
/repo/gcc-7-branch/libsanitizer/sanitizer_common/sanitizer_coverage_libcdep.cc:
In member function 'void __sanitizer::CoverageData::DumpOffsets()':
/repo/gcc-7-branch/libsanitizer/sanitizer_common/sanitizer_coverage_libcdep.cc:814:6:
internal compiler error: RTL check: expected code 'reg', have 'subreg' in
rhs_regno, at rtl.h:1804
 void CoverageData::DumpOffsets() {
  ^~~~
0xd60bd7 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-7-branch/gcc/rtl.c:829
0x5b7e0b rhs_regno
/repo/gcc-7-branch/gcc/rtl.h:1804
0x12da6bb rhs_regno
/repo/gcc-7-branch/gcc/config/rs6000/rs6000.md:1660
0x12da6bb gen_addsi3(rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-7-branch/gcc/config/rs6000/rs6000.md:1657
0xcb7870 expand_binop_directly
/repo/gcc-7-branch/gcc/optabs.c:1071
0xcb7de5 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-7-branch/gcc/optabs.c:1151
0xa69dc9 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-7-branch/gcc/expr.c:9567
0xa53071 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-7-branch/gcc/expr.c:11102
0xa6207e expand_expr
/repo/gcc-7-branch/gcc/expr.h:276
0xa6207e expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
/repo/gcc-7-branch/gcc/expr.c:7672
0xa6b554 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-7-branch/gcc/expr.c:8792
0xa53071 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-7-branch/gcc/expr.c:11102
0xf38132 expand_expr
/repo/gcc-7-branch/gcc/expr.h:276
0xf38132 computation_cost
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:3627
0xf44551 get_computation_cost_at
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:5052
0xf4bf3e get_computation_cost
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:5072
0xf4bf3e determine_group_iv_cost_generic
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:5095
0xf4bf3e determine_group_iv_cost
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:5670
0xf4 determine_group_iv_costs
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:5815
0xf4 tree_ssa_iv_optimize_loop
/repo/gcc-7-branch/gcc/tree-ssa-loop-ivopts.c:7813
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.


6-branch r249890:
/repo/gcc-6-branch/libsanitizer/libbacktrace/../../libbacktrace/dwarf.c: In
function 'read_function_entry':
/repo/gcc-6-branch/libsanitizer/libbacktrace/../../libbacktrace/dwarf.c:2343:23:
internal compiler error: RTL check: expected code 'reg', have 'subreg' in
rhs_regno, at rtl.h:1785
lhdr->filenames[val.u.uint - 1];
~~~^~~~
0xb07477 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-6-branch/gcc/rtl.c:811
0x57d0ca rhs_regno
/repo/gcc-6-branch/gcc/rtl.h:1785
0xfea5cb rhs_regno
/repo/gcc-6-branch/gcc/config/rs6000/rs6000.md:1567
0xfea5cb gen_addsi3(rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-6-branch/gcc/config/rs6000/rs6000.md:1564
0xa64ce0 expand_binop_directly
/repo/gcc-6-branch/gcc/optabs.c:1070
0xa65245 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-6-branch/gcc/optabs.c:1150
mv -f .deps/mmapio.Tpo .deps/mmapio.Plo
0x822edf force_operand(rtx_def*, rtx_def*)
/repo/gcc-6-branch/gcc/expr.c:7194
0x830bd2 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-6-branch/gcc/expr.c:8649
0x818cce expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-6-branch/gcc/expr.c:9595
0x825198 expand_expr
/repo/gcc-6-branch/gc

[Bug rtl-optimization/81020] New: [6/7/8 Regression] wrong code with -O -fno-tree-bit-ccp -fno-tree-coalesce-vars -fno-tree-vrp

2017-06-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81020

Bug ID: 81020
   Summary: [6/7/8 Regression] wrong code with -O
-fno-tree-bit-ccp -fno-tree-coalesce-vars
-fno-tree-vrp
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 41504
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41504=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-bit-ccp -fno-tree-coalesce-vars
-fno-tree-vrp testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-248824-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-248824-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20170602 (experimental) (GCC)

[Bug rtl-optimization/81019] New: [6/7/8 Regression] wrong code with -O -fno-tree-ccp

2017-06-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81019

Bug ID: 81019
   Summary: [6/7/8 Regression] wrong code with -O -fno-tree-ccp
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 41503
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41503=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-ccp testcase.c
$ ./a.out 
Aborted

$ /repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-248824-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-248824-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20170602 (experimental) (GCC)

[Bug rtl-optimization/80693] New: [6/7/8 Regression] wrong code with -O -fno-tree-coalesce-vars

2017-05-09 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80693

Bug ID: 80693
   Summary: [6/7/8 Regression] wrong code with -O
-fno-tree-coalesce-vars
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Created attachment 41335
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41335=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-coalesce-vars testcase.c
$ ./a.out
Aborted

The .combine dump shows:
...
Trying 18, 19 -> 20:
Failed to match this instruction:
(set (reg:HI 116)
(and:HI (not:HI (reg/v:HI 112 [ u16_1D.1800 ]))
(const_int 1 [0x1])))
Successfully matched this instruction:
(set (reg:HI 117)
(not:HI (reg/v:HI 112 [ u16_1D.1800 ])))
Successfully matched this instruction:
(set (reg:HI 116)
(and:HI (reg:HI 117)
(const_int 1 [0x1])))
allowing combination of insns 18, 19 and 20
original costs 0 + 4 + 4 = 0
replacement costs 4 + 4 = 8
deferring deletion of insn with uid = 18.
modifying insn i219: r117:HI=!r112:HI
deferring rescan insn with uid = 19.
modifying insn i320: {r116:HI=r117:HI&0x1;clobber flags:CC;}
  REG_UNUSED flags:CC
  REG_DEAD r117:HI
deferring rescan insn with uid = 20.
...
Trying 19 -> 20:
Successfully matched this instruction:
(parallel [
(set (reg:HI 116)
(xor:HI (reg/v:HI 112 [ u16_1D.1800 ])
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
])
allowing combination of insns 19 and 20
original costs 4 + 4 = 8
replacement cost 4
deferring deletion of insn with uid = 19.
modifying insn i320: {r116:HI=r112:HI^0x1;clobber flags:CC;}
  REG_UNUSED flags:CC
deferring rescan insn with uid = 20.
...


Which looks wrong, since it changes "r116:HI=!r112:HI&1" (can be 0 or 1) to
"r116:HI=r112:HI^0x1" (can be anything).

Also, the costs dump in the first replacement looks wrong:
original costs 0 + 4 + 4 = 0

$ x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-247635-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-247635-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20170505 (experimental) (GCC) 


Tested revisions:
trunk r247635 - FAIL
7-branch r247545 - FAIL
6-branch r247359 - FAIL
5-branch r247456 - OK

[Bug ipa/78644] [7 Regression] ICE: SIGSEGV in is_gimple_reg_type with -Og -fipa-cp

2017-03-16 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78644

--- Comment #6 from Zdenek Sojka  ---
Created attachment 40981
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40981=edit
another testcase

$ x86_64-pc-linux-gnu-gcc -Og -finline-functions-called-once testcase.c
-Wno-psabi
==20182== Invalid read of size 2
==20182==at 0x8D0572: is_gimple_reg_type (gimple-expr.h:75)
==20182==by 0x8D0572: is_gimple_val(tree_node*) (gimple-expr.c:782)
==20182==by 0xC11E70: verify_gimple_assign_unary (tree-cfg.c:3634)
==20182==by 0xC11E70: verify_gimple_assign (tree-cfg.c:4475)
==20182==by 0xC11E70: verify_gimple_stmt(gimple*) (tree-cfg.c:4732)
==20182==by 0xC25B29: verify_gimple_in_cfg(function*, bool)
(tree-cfg.c:5193)
==20182==by 0xABE056: execute_function_todo(function*, void*)
(passes.c:1966)
==20182==by 0xABF10B: execute_todo(unsigned int) (passes.c:2016)
==20182==by 0xAC15AD: execute_one_pass(opt_pass*) (passes.c:2505)
==20182==by 0xAC1CB0: execute_pass_list_1(opt_pass*) (passes.c:2554)
==20182==by 0xAC1CC2: execute_pass_list_1(opt_pass*) (passes.c:2555)
==20182==by 0xAC1D04: execute_pass_list(function*, opt_pass*)
(passes.c:2565)
==20182==by 0x752F12: cgraph_node::expand() (cgraphunit.c:2038)
==20182==by 0x754639: expand_all_functions (cgraphunit.c:2174)
==20182==by 0x754639: symbol_table::compile() [clone .part.51]
(cgraphunit.c:2531)
==20182==by 0x756D16: compile (cgraphunit.c:2624)
==20182==by 0x756D16: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2621)
==20182==by 0xBDD442: compile_file() (toplev.c:492)
==20182==by 0x5A457F: do_compile (toplev.c:2000)
==20182==by 0x5A457F: toplev::main(int, char**) (toplev.c:2134)
==20182==by 0x5A686A: main (main.c:39)
==20182==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==20182== 
testcase.c: In function 'foo':
testcase.c:13:1: internal compiler error: Segmentation fault
 foo (U u, V v)
 ^~~

[Bug rtl-optimization/79910] New: [7 Regression] wrong code with -O -fweb

2017-03-06 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79910

Bug ID: 79910
   Summary: [7 Regression] wrong code with -O -fweb
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 40892
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40892=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fweb testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-245841-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-245841-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.1 20170302 (experimental) (GCC) 


There seems to be a problem in the combine pass.
Before .combine, there is:
...
(insn 16 14 17 2 (parallel [
(set (reg/v:DI 100 [ bD.1802 ])
(lshiftrt:DI (reg:DI 107)
(reg:QI 110)))
(clobber (reg:CC 17 flags))
]) "testcase.c":11 544 {*lshrdi3_1}
 (expr_list:REG_DEAD (reg:QI 110)
(expr_list:REG_DEAD (reg:DI 107)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)
...
(insn 28 27 30 2 (parallel [
(set (reg:DI 128 [ _6 ])
(minus:DI (reg:DI 111 [ p1D.1798 ])
(reg:DI 119)))
(clobber (reg:CC 17 flags))
]) "testcase.c":12 272 {*subdi_1}
 (expr_list:REG_DEAD (reg:DI 119)
(expr_list:REG_DEAD (reg:DI 111 [ p1D.1798 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)
(insn 30 28 31 2 (parallel [
(set (reg:SI 120)
(and:SI (subreg:SI (reg/v:DI 100 [ bD.1802 ]) 0)
(const_int 31 [0x1f])))
(clobber (reg:CC 17 flags))
]) "testcase.c":13 389 {*andsi_1}
 (expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
(insn 31 30 32 2 (set (reg:SI 121)
(const_int 4 [0x4])) "testcase.c":13 82 {*movsi_internal}
 (nil))
(insn 32 31 33 2 (parallel [
(set (reg/v:SI 106 [ p2D.1799 ])
(lshiftrt:SI (reg:SI 121)
(subreg:QI (reg:SI 120) 0)))
(clobber (reg:CC 17 flags))
]) "testcase.c":13 542 {*lshrsi3_1}
 (expr_list:REG_DEAD (reg:SI 121)
(expr_list:REG_DEAD (reg:SI 120)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_EQUAL (lshiftrt:SI (const_int 4 [0x4])
(subreg:QI (reg:SI 120) 0))
(nil))
...


But .combine shows:

...
Trying 27, 28 -> 33:
...
Successfully matched this instruction:
(set (reg:QI 128 [ _6 ])
(plus:QI (subreg:QI (reg:DI 111 [ p1D.1798 ]) 0)
(subreg:QI (reg/v:DI 100 [ bD.1802 ]) 0)))
Successfully matched this instruction:
(set (reg:QI 123 [ p1D.1798 ])
(plus:QI (reg:QI 128 [ _6 ])
(subreg:QI (reg:DI 92 [ _6 ]) 0)))
allowing combination of insns 27, 28 and 33
...
Trying 16, 32 -> 35:
...
Successfully matched this instruction:
(set (reg/v:DI 100 [ bD.1802 ])
(lshiftrt:DI (reg:DI 107)
(reg:QI 110)))
Successfully matched this instruction:
(set (reg:SI 125 [ p2D.1799 ])
(const_int 0 [0]))
allowing combination of insns 16, 32 and 35
...

So after .combine, there is:
...
(insn 28 27 30 2 (parallel [
(set (reg:QI 128 [ _6 ])
(plus:QI (subreg:QI (reg:DI 111 [ p1D.1798 ]) 0)
(subreg:QI (reg/v:DI 100 [ bD.1802 ]) 0)))
(clobber (reg:CC 17 flags))
]) "testcase.c":12 219 {*addqi_1}
 (expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 111 [ p1D.1798 ])
(nil
(note 30 28 31 2 NOTE_INSN_DELETED)
(note 31 30 32 2 NOTE_INSN_DELETED)
(insn 32 31 33 2 (parallel [
(set (reg/v:DI 100 [ bD.1802 ])
(lshiftrt:DI (reg:DI 107)
(reg:QI 110)))
(clobber (reg:CC 17 flags))
]) "testcase.c":13 544 {*lshrdi3_1}
 (expr_list:REG_UNUSED (reg:CC 17 flags)
 

[Bug target/79450] New: [5/6/7 Regression] wrong code with loop at -O1

2017-02-09 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79450

Bug ID: 79450
   Summary: [5/6/7 Regression] wrong code with loop at -O1
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 40710
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40710=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-245149-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-245149-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.1 20170203 (experimental) (GCC) 

All other tested targets:
aarch64-unknown-linux-gnu
armv7a-hardfloat-linux-gnueabi
armv7a-softfp-linux-gnueabi
i686-pc-linux-gnu
powerpc64-unknown-linux-gnu
powerpc-unknown-linux-gnu
sparc64-unknown-linux-gnu
sparc-unknown-linux-gnu
do not seem to have this problem.

[Bug rtl-optimization/79388] New: [6/7 Regression] wrong code with -O -fno-tree-coalesce-vars

2017-02-06 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79388

Bug ID: 79388
   Summary: [6/7 Regression] wrong code with -O
-fno-tree-coalesce-vars
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 40675
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40675=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-coalesce-vars testcase.c
$ ./a.out 
Aborted

$ /repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-245149-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-245149-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.1 20170203 (experimental) (GCC) 


The .combine dump has:
(insn 22 21 23 2 (set (mem/c:SI (symbol_ref:DI ("c") [flags 0x2] ) [1 cD.1797+0 S4 A32])
(reg/v:SI 91 [ pD.1798 ])) "testcase.c":12 82 {*movsi_internal}
 (expr_list:REG_DEAD (reg/v:SI 91 [ pD.1798 ])
(nil)))
(note 23 22 24 2 NOTE_INSN_DELETED)
(insn 24 23 29 2 (set (reg:SI 102)
(mem/c:SI (symbol_ref:DI ("a") [flags 0x2] )
[1 aD.1796+0 S4 A32])) "testcase.c":13 82 {*movsi_internal}
 (nil))

reg 91 was originally used in insn 24, but the use somehow disappeared.

[Bug driver/78957] New: ICE: SIGSEGV with -fno-sso-struct=web

2016-12-31 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78957

Bug ID: 78957
   Summary: ICE: SIGSEGV with -fno-sso-struct=web
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: driver
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Likely similar to PR78933

Compiler output:
$ valgrind x86_64-pc-linux-gnu-gcc /dev/null -o /dev/null -fno-sso-struct=web
==24593== Invalid read of size 8
==24593==at 0x51972C: pp_format(pretty_printer*, text_info*)
(pretty-print.c:317)
==24593==by 0x4DEF55: diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) (diagnostic.c:961)
==24593==by 0x4E1B78: diagnostic_impl (diagnostic.c:1084)
==24593==by 0x4E1B78: internal_error(char const*, ...) (diagnostic.c:1395)
==24593==by 0x4DD13B: fancy_abort(char const*, int, char const*)
(diagnostic.c:1461)
==24593==by 0x496AD7: decode_cmdline_option (opts-common.c:671)
==24593==by 0x496AD7: decode_cmdline_options_to_array(unsigned int, char
const**, unsigned int, cl_decoded_option**, unsigned int*) (opts-common.c:836)
==24593==by 0x4034FF: driver::main(int, char**) (gcc.c:7209)
==24593==by 0x4039BB: main (gcc-main.c:46)
==24593==  Address 0x8 is not stack'd, malloc'd or (recently) free'd

[Bug c/78933] New: ICE: in decode_cmdline_option, at opts-common.c:671 with -fno-strong-eval-order

2016-12-27 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78933

Bug ID: 78933
   Summary: ICE: in decode_cmdline_option, at opts-common.c:671
with -fno-strong-eval-order
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Compiler output:
$ echo "" | x86_64-pc-linux-gnu-gcc -fno-strong-eval-order -x c -
cc1: internal compiler error: in decode_cmdline_option, at opts-common.c:671
0x160a5bc decode_cmdline_option
/repo/gcc-trunk/gcc/opts-common.c:671
0x160a5bc decode_cmdline_options_to_array(unsigned int, char const**, unsigned
int, cl_decoded_option**, unsigned int*)
/repo/gcc-trunk/gcc/opts-common.c:836
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-243928-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-243928-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161226 (experimental) (GCC)

[Bug target/78671] New: ICE: in extract_constrain_insn, at recog.c:2213 with -Og -march=skylake-avx512

2016-12-04 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78671

Bug ID: 78671
   Summary: ICE: in extract_constrain_insn, at recog.c:2213 with
-Og -march=skylake-avx512
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40241
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40241=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -march=skylake-avx512 testcase.c
testcase.c: In function 'foo':
testcase.c:15:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 554 165 166 14 (set (reg:TI 44 r15 [orig:149 _84 ] [149])
(reg:TI 40 r11 [orig:149 _84 ] [149])) "testcase.c":12 80
{*movti_internal}
 (nil))
testcase.c:15:1: internal compiler error: in extract_constrain_insn, at
recog.c:2213
0xc25ec3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0xc25f34 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:119
0xbdc17d extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2213
0xae38a5 check_rtl
/repo/gcc-trunk/gcc/lra.c:2109
0xaea510 lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2517
0xa90a99 do_reload
/repo/gcc-trunk/gcc/ira.c:5386
0xa90a99 execute
/repo/gcc-trunk/gcc/ira.c:5570
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-243200-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-243200-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161202 (experimental) (GCC)

[Bug target/78669] New: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-04 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

Bug ID: 78669
   Summary: ICE: in combine_and_move_insns, at ira.c:3665 with -Os
-fno-tree-ter -mavx512bw
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40239
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40239=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-tree-ter -mavx512bw testcase.c
testcase.c: In function 'bar':
testcase.c:18:1: internal compiler error: in combine_and_move_insns, at
ira.c:3665
 }
 ^
0xa94929 combine_and_move_insns
/repo/gcc-trunk/gcc/ira.c:3665
0xa9c1ed ira
/repo/gcc-trunk/gcc/ira.c:5186
0xa9c1ed execute
/repo/gcc-trunk/gcc/ira.c:5527
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-243200-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-243200-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161202 (experimental) (GCC) 

Tested revisions:
r243200 - FAIL
r242857 - FAIL
r242657 - OK
r242541 - OK

[Bug ipa/78644] New: [7 Regression] ICE: SIGSEGV in is_gimple_reg_type with -Og -fipa-cp

2016-12-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78644

Bug ID: 78644
   Summary: [7 Regression] ICE: SIGSEGV in is_gimple_reg_type with
-Og -fipa-cp
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-checking, ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40224
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40224=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -fipa-cp testcase.c -Wno-psabi -wrapper
valgrind,-q
==13237== Invalid read of size 2
==13237==at 0x99A789: is_gimple_reg_type (gimple-expr.h:75)
==13237==by 0x99A789: is_gimple_val(tree_node*) (gimple-expr.c:781)
==13237==by 0xCE310B: verify_gimple_assign_binary (tree-cfg.c:3797)
==13237==by 0xCE310B: verify_gimple_assign (tree-cfg.c:4477)
==13237==by 0xCE310B: verify_gimple_stmt(gimple*) (tree-cfg.c:4731)
==13237==by 0xCF56E4: verify_gimple_in_cfg(function*, bool)
(tree-cfg.c:5192)
==13237==by 0xB95092: execute_function_todo(function*, void*)
(passes.c:1965)
==13237==by 0xB95A49: execute_todo(unsigned int) (passes.c:2015)
==13237==by 0xB9853D: execute_one_pass(opt_pass*) (passes.c:2410)
==13237==by 0xB98917: execute_pass_list_1(opt_pass*) (passes.c:2459)
==13237==by 0xB98929: execute_pass_list_1(opt_pass*) (passes.c:2460)
==13237==by 0xB98974: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==13237==by 0x81AE63: cgraph_node::expand() (cgraphunit.c:2001)
==13237==by 0x81C747: expand_all_functions (cgraphunit.c:2137)
==13237==by 0x81C747: symbol_table::compile() (cgraphunit.c:2494)
==13237==by 0x81E995: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2584)
==13237==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==13237== 
testcase.c: In function 'bar.constprop':
testcase.c:7:1: internal compiler error: Segmentation fault
 bar (u128 x2, u128 x3)
 ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-243165-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-243165-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161202 (experimental) (GCC) 

Some checking is probably needed in order to have verify_gimple_in_cfg()
called.

[Bug target/78585] New: unaligned vmovaps memory operand generated for i686 target

2016-11-29 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78585

Bug ID: 78585
   Summary: unaligned vmovaps memory operand generated for i686
target
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40189
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40189=edit
reduced testcase

Output:
$ i686-pc-linux-gnu-gcc -Os -fno-ipa-cp -fschedule-insns -mavx testcase.c
$ ./a.out 
Segmentation fault

Stack was correctly aligned when entering foo(). When addressing m128 relative
to ebp, offset%16==8 must hold. But here, offset==68:
...
vmovaps XMMWORD PTR [ebp-68], xmm0
...
vpaddq  xmm2, xmm2, XMMWORD PTR [ebp-68]
...


$ i686-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-i686/bin/i686-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242953-checking-yes-rtl-df-extra-nobootstrap-nographite-i686/bin/../libexec/gcc/i686-pc-linux-gnu/7.0.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--with-sysroot=/usr/i686-pc-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=i686-pc-linux-gnu
--with-ld=/usr/bin/i686-pc-linux-gnu-ld --with-as=/usr/bin/i686-pc-linux-gnu-as
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242953-checking-yes-rtl-df-extra-nobootstrap-nographite-i686
Thread model: posix
gcc version 7.0.0 20161129 (experimental) (GCC)

[Bug rtl-optimization/78575] New: [7 Regression] ICE: in trunc_int_for_mode, at explow.c:55 with -O2 -g

2016-11-28 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78575

Bug ID: 78575
   Summary: [7 Regression] ICE: in trunc_int_for_mode, at
explow.c:55 with -O2 -g
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40184
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40184=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -g testcase.c -Wno-psabi
testcase.c: In function 'foo':
testcase.c:13:1: internal compiler error: in trunc_int_for_mode, at explow.c:55
 }
 ^
0x900b60 trunc_int_for_mode(long, machine_mode)
/repo/gcc-trunk/gcc/explow.c:54
0x8f0bf8 gen_int_mode(long, machine_mode)
/repo/gcc-trunk/gcc/emit-rtl.c:495
0xc75475 simplify_binary_operation_1
/repo/gcc-trunk/gcc/simplify-rtx.c:2399
0xc7c03d simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.c:2068
0xc7fd98 simplify_const_relational_operation(rtx_code, machine_mode, rtx_def*,
rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.c:5022
0xc8074c simplify_relational_operation(rtx_code, machine_mode, machine_mode,
rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.c:4578
0x84da11 cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.c:1823
0x84e71e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/repo/gcc-trunk/gcc/cselib.c:1530
0xf8b7dd vt_expand_var_loc_chain
/repo/gcc-trunk/gcc/var-tracking.c:8326
0xf8b7dd vt_expand_loc_callback
/repo/gcc-trunk/gcc/var-tracking.c:8488
0x84d7ea cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.c:1684
0x84e71e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/repo/gcc-trunk/gcc/cselib.c:1530
0xf8b7dd vt_expand_var_loc_chain
/repo/gcc-trunk/gcc/var-tracking.c:8326
0xf8b7dd vt_expand_loc_callback
/repo/gcc-trunk/gcc/var-tracking.c:8488
0x84d48a cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.c:1722
0x84e71e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/repo/gcc-trunk/gcc/cselib.c:1530
0xf8b7dd vt_expand_var_loc_chain
/repo/gcc-trunk/gcc/var-tracking.c:8326
0xf8b7dd vt_expand_loc_callback
/repo/gcc-trunk/gcc/var-tracking.c:8488
0x84d7ea cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.c:1684
0x84e71e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/repo/gcc-trunk/gcc/cselib.c:1530
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242931-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242931-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161128 (experimental) (GCC) 

Tested revisions:
trunk r242931 - FAIL
6-branch r242029 - OK

[Bug rtl-optimization/78546] [6/7 Regression] wrong code at -O2 and above

2016-11-28 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78546

--- Comment #14 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #12)
> Therefore the comment should be
> /* CST1 - (CST2 - A) -> (CST1 - CST2) - A  */
> rather than
> /* CST - (CST - A) -> CST - A  */

How comes it is not "CST1 - (CST2 - A) -> (CST1 - CST2) + A"?

[Bug rtl-optimization/78547] New: [7 Regression] ICE: in loc_cmp, at var-tracking.c:3417 with -Os -g -mstringop-strategy=libcall -freorder-blocks-algorithm=simple

2016-11-26 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78547

Bug ID: 78547
   Summary: [7 Regression] ICE: in loc_cmp, at var-tracking.c:3417
with -Os -g -mstringop-strategy=libcall
-freorder-blocks-algorithm=simple
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40161=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -g -mstringop-strategy=libcall
-freorder-blocks-algorithm=simple testcase.c -Wno-psabi
testcase.c: In function 'fn1':
testcase.c:12:1: internal compiler error: in loc_cmp, at var-tracking.c:3417
 }
 ^
0xecc62f loc_cmp
/repo/gcc-trunk/gcc/var-tracking.c:3417
0xecd0bd onepart_variable_different_p
/repo/gcc-trunk/gcc/var-tracking.c:4913
0xedfd2f emit_notes_for_differences_1(variable**, hash_table<variable_hasher,
xcallocator>*)
/repo/gcc-trunk/gcc/var-tracking.c:9084
0xeea048 void hash_table<variable_hasher,
xcallocator>::traverse_noresize<hash_table<variable_hasher, xcallocator>*,
&(emit_notes_for_differences_1(variable**, hash_table<variable_hasher,
xcallocator>*))>(hash_table<variable_hasher, xcallocator>*)
/repo/gcc-trunk/gcc/hash-table.h:950
0xeea048 void hash_table<variable_hasher,
xcallocator>::traverse<hash_table<variable_hasher, xcallocator>*,
&(emit_notes_for_differences_1(variable**, hash_table<variable_hasher,
xcallocator>*))>(hash_table<variable_hasher, xcallocator>*)
/repo/gcc-trunk/gcc/hash-table.h:972
0xee6f28 emit_notes_for_differences
/repo/gcc-trunk/gcc/var-tracking.c:9122
0xee6f28 vt_emit_notes
/repo/gcc-trunk/gcc/var-tracking.c:9503
0xee84a8 variable_tracking_main_1
/repo/gcc-trunk/gcc/var-tracking.c:10363
0xee84a8 variable_tracking_main()
/repo/gcc-trunk/gcc/var-tracking.c:10377
0xee84a8 execute
/repo/gcc-trunk/gcc/var-tracking.c:10414
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161125 (experimental) (GCC) 


Tested revisions:
trunk r242884 - FAIL
6-branch r242029 - OK

[Bug tree-optimization/78546] [6/7 Regression] wrong code at -O2 and above

2016-11-26 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78546

Zdenek Sojka  changed:

   What|Removed |Added

  Attachment #40159|0   |1
is obsolete||

--- Comment #2 from Zdenek Sojka  ---
Created attachment 40160
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40160=edit
reduced testcase (correct one)

[Bug tree-optimization/78546] New: [6/7 Regression] wrong code at -O2 and above

2016-11-26 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78546

Bug ID: 78546
   Summary: [6/7 Regression] wrong code at -O2 and above
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40159
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40159=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
$ ./a.out 
Aborted


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161125 (experimental) (GCC) 


Tested revisions:
trunk r242884 - FAIL
6-branch r242029 - FAIL
5-branch r242028 - OK

[Bug tree-optimization/78542] New: [7 Regression] wrong code at -Og results in endless loop

2016-11-26 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78542

Bug ID: 78542
   Summary: [7 Regression] wrong code at -Og results in endless
loop
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40157
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40157=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Og testcase.c -Wno-psabi
$ ulimit -t 5
$ ./a.out 
Killed

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161125 (experimental) (GCC) 

It seems that the "x = 1;" assignment is not present in the generated code.

Tested revisions:
trunk r242884 - FAIL
6-branch r242029 - OK

[Bug tree-optimization/78540] New: [6/7 Regression] ICE: in df_refs_verify, at df-scan.c:4062 with -O -march=core2

2016-11-26 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78540

Bug ID: 78540
   Summary: [6/7 Regression] ICE: in df_refs_verify, at
df-scan.c:4062 with -O -march=core2
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40155
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40155=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -march=core2 testcase.c
testcase.c: In function 'fn1':
testcase.c:7:1: warning: AVX512F vector return without AVX512F enabled changes
the ABI [-Wpsabi]
 {
 ^
testcase.c:6:1: note: The ABI for passing parameters with 64-byte alignment has
changed in GCC 4.6
 fn1 (V a)
 ^~~
testcase.c: In function 'fn2':
testcase.c:23:1: internal compiler error: in df_refs_verify, at df-scan.c:4062
 }
 ^
0x7bfc90 df_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:4062
0x7c483e df_insn_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:4129
0x7c69ce df_bb_verify
/repo/gcc-trunk/gcc/df-scan.c:4154
0x7c6e87 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.c:4286
0x7af588 df_verify()
/repo/gcc-trunk/gcc/df-core.c:1831
0x7af60a df_analyze_1
/repo/gcc-trunk/gcc/df-core.c:1217
0x8e16b2 thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.c:5947
0x8e1e82 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.c:6427
0x8e1e82 execute
/repo/gcc-trunk/gcc/function.c:6469
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242884-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161125 (experimental) (GCC) 


--enable-checking=df might be needed in order to reproduce.


Tested revisions:
r242884 - FAIL
6-branch r242029 - FAIL
5-branch r242028 - OK

[Bug rtl-optimization/78526] New: [7 Regression] ICE: in decompose, at rtl.h:2117 with -g -mavx512bw

2016-11-25 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78526

Bug ID: 78526
   Summary: [7 Regression] ICE: in decompose, at rtl.h:2117 with
-g -mavx512bw
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40148
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40148=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-ccp -fno-tree-sra -g -mavx512bw
testcase.c
testcase.c: In function 'foo':
testcase.c:16:1: internal compiler error: in decompose, at rtl.h:2117
 }
 ^
0xbbcb00 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long*,
unsigned int, std::pair<rtx_def*, machine_mode> const&)
/repo/gcc-trunk/gcc/rtl.h:2117
0xbbcb00 wide_int_ref_storage::wide_int_ref_storage<std::pair<rtx_def*,
machine_mode> >(std::pair<rtx_def*, machine_mode> const&, unsigned int)
/repo/gcc-trunk/gcc/wide-int.h:976
0xbbcb00 generic_wide_int<wide_int_ref_storage
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&, unsigned int)
/repo/gcc-trunk/gcc/wide-int.h:753
0xbbcb00 unsigned long wi::extract_uhwi<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&, unsigned int, unsigned int)
/repo/gcc-trunk/gcc/wide-int.h:3054
0xbbcb00 simplify_immed_subreg
/repo/gcc-trunk/gcc/simplify-rtx.c:5745
0xbd62e8 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
/repo/gcc-trunk/gcc/simplify-rtx.c:6220
0xbd8666 simplify_replace_fn_rtx(rtx_def*, rtx_def const*, rtx_def*
(*)(rtx_def*, rtx_def const*, void*), void*)
/repo/gcc-trunk/gcc/simplify-rtx.c:491
0xec18dc propagate_for_debug(rtx_insn*, rtx_insn*, rtx_def*, rtx_def*,
basic_block_def*)
/repo/gcc-trunk/gcc/valtrack.c:201
0x14ac03c try_combine
/repo/gcc-trunk/gcc/combine.c:4357
0x14b3660 combine_instructions
/repo/gcc-trunk/gcc/combine.c:1264
0x14b3660 rest_of_handle_combine
/repo/gcc-trunk/gcc/combine.c:14548
0x14b3660 execute
/repo/gcc-trunk/gcc/combine.c:14593
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242789-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242789-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161123 (experimental) (GCC) 


The reduced testcase has out-of-bounds vector index; the original testcase
didn't have it though.


Tested revisions:
r242789 - FAIL
r242600 - FAIL
6-branch r242830 - OK

[Bug ipa/78515] New: [7 Regression] ICE: in fold_binary_loc, at fold-const.c:8999 with -Os -mavx512bw

2016-11-24 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78515

Bug ID: 78515
   Summary: [7 Regression] ICE: in fold_binary_loc, at
fold-const.c:8999 with -Os -mavx512bw
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40143
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40143=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -mavx512bw testcase.c
testcase.c:23:1: internal compiler error: in fold_binary_loc, at
fold-const.c:8999
 }
 ^
0x8abc6e fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/repo/gcc-trunk/gcc/fold-const.c:8996
0x152f1a5 ipa_get_jf_pass_through_result
/repo/gcc-trunk/gcc/ipa-cp.c:1233
0x1534c46 propagate_vals_accross_pass_through
/repo/gcc-trunk/gcc/ipa-cp.c:1572
0x1534c46 propagate_scalar_accross_jump_function
/repo/gcc-trunk/gcc/ipa-cp.c:1654
0x1534c46 propagate_constants_accross_call
/repo/gcc-trunk/gcc/ipa-cp.c:2257
0x1538900 propagate_constants_topo
/repo/gcc-trunk/gcc/ipa-cp.c:3162
0x1538900 ipcp_propagate_stage
/repo/gcc-trunk/gcc/ipa-cp.c:3272
0x153ad76 ipcp_driver
/repo/gcc-trunk/gcc/ipa-cp.c:5002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242789-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242789-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161123 (experimental) (GCC)

[Bug target/65496] ICE: in maybe_record_trace_start, at dwarf2cfi.c:2318 with -O3 -fsched2-use-superblocks -mavx512dq --param=max-pending-list-length=0

2016-11-24 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65496

Zdenek Sojka  changed:

   What|Removed |Added

  Known to fail||7.0

--- Comment #4 from Zdenek Sojka  ---
Another testcase:
$ cat testcase.c
int c;
__int128 x;

void
foo ()
{
  if (c)
x /= 5;
}
$ powerpc64-unknown-linux-gnu-gcc -O2 -fsched2-use-superblocks -g
--param=max-pending-list-length=0 testcase.c  
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2328
 }
 ^
0x78d4b0 maybe_record_trace_start
/repo/gcc-trunk/gcc/dwarf2cfi.c:2328
0x78e360 scan_trace
/repo/gcc-trunk/gcc/dwarf2cfi.c:2510
0x78ebca create_cfi_notes
/repo/gcc-trunk/gcc/dwarf2cfi.c:2664
0x78ebca execute_dwarf2_frame
/repo/gcc-trunk/gcc/dwarf2cfi.c:3022
0x78ebca execute
/repo/gcc-trunk/gcc/dwarf2cfi.c:3502
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug rtl-optimization/78447] New: [7 Regression] wrong code when combine changes shifts by << 5 and >> 15 to >> 10 at -O

2016-11-21 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78447

Bug ID: 78447
   Summary: [7 Regression] wrong code when combine changes shifts
by << 5 and >> 15 to >> 10 at -O
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
      Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40099
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40099=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
$ ./a.out
Aborted

$ x86_64-pc-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242583-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242583-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161118 (experimental) (GCC) 


Before .combine:
...
(insn 9 8 10 2 (parallel [
(set (reg:SI 108)
(ashift:SI (reg/v:SI 105 [ xD.1799 ])
(const_int 5 [0x5])))
(clobber (reg:CC 17 flags))
]) "testcase.c":13 529 {*ashlsi3_1}
 (expr_list:REG_DEAD (reg/v:SI 105 [ xD.1799 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil
...

(insn 11 10 12 2 (parallel [
(set (reg:HI 110)
(lshiftrt:HI (subreg:HI (reg:SI 109) 0)
(const_int 15 [0xf])))
(clobber (reg:CC 17 flags))
]) "testcase.c":15 572 {*lshrhi3_1}
 (expr_list:REG_DEAD (reg:SI 109)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil
(insn 12 11 13 2 (set (reg:QI 92 [ _11 ])
(subreg:QI (reg:HI 110) 0)) "testcase.c":15 85 {*movqi_internal}
 (expr_list:REG_DEAD (reg:HI 110)
(nil)))
...


.combine shows:
...
Trying 9, 11 -> 12:
...
Successfully matched this instruction:
(set (reg:SI 110)
(lshiftrt:SI (reg/v:SI 105 [ xD.1799 ])
(const_int 10 [0xa])))
Successfully matched this instruction:
(set (subreg:SI (reg:QI 92 [ _11 ]) 0)
(and:SI (reg:SI 110)
(const_int 255 [0xff])))
allowing combination of insns 9, 11 and 12
original costs 4 + 4 + 4 = 12
replacement costs 4 + 4 = 8


Which is probably wrong.


Tested revisions:
r242657 - FAIL
r242583 - FAIL
r242510 - FAIL
r242408 - OK

[Bug rtl-optimization/78416] New: wrong code for division by (u128)~INT64_MAX at -O0

2016-11-18 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78416

Bug ID: 78416
   Summary: wrong code for division by (u128)~INT64_MAX at -O0
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40079
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40079=edit
reduced testcase

Compiler output:
$ gcc testcase.c
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242583-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242583-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161118 (experimental) (GCC) 


All tested 64bit targets seem to be affected:
aarch64-unknown-linux-gnu
powerpc64-unknown-linux-gnu
sparc64-unknown-linux-gnu
x86_64-pc-linux-gnu
x86_64-pc-linux-gnux32

The .expand dump has:
;; x_2 = x_1 / 0x8000;

(insn 6 5 7 (set (reg:TI 90)
(mem/c:TI (plus:DI (reg/f:DI 82 virtual-stack-vars)
(const_int -16 [0xfff0])) [1 xD.1797+0 S16 A128]))
"testcase.c":7 -1
 (nil))

(insn 7 6 8 (parallel [
(set (reg:TI 89)
(lshiftrt:TI (reg:TI 90)
(const_int 63 [0x3f])))
(clobber (reg:CC 17 flags))
]) "testcase.c":7 -1
 (expr_list:REG_EQUAL (udiv:TI (reg:TI 90)
(const_int -9223372036854775808 [0x8000]))
(nil)))


Which, I think, is wrong. But I have been wrong many times already.

[Bug rtl-optimization/78400] New: [7 Regression] ICE: in df_refs_verify, at df-scan.c:4045 when building powerpc crosscompiler

2016-11-17 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78400

Bug ID: 78400
   Summary: [7 Regression] ICE: in df_refs_verify, at
df-scan.c:4045 when building powerpc crosscompiler
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40072
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40072=edit
reduced testcase

Compiler output:
$ $
/repo/build-trunk-242552-checking-yes-rtl-df-extra-nographite-powerpc/./gcc/cc1
-quiet -O2 testcase.c
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in df_refs_verify, at df-scan.c:4045
 }
 ^
0x7924a2 df_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:4045
0x797f30 df_insn_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:4125
0x79a272 df_bb_verify
/repo/gcc-trunk/gcc/df-scan.c:4154
0x79a597 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.c:4286
0x782e78 df_verify()
/repo/gcc-trunk/gcc/df-core.c:1831
0x782efa df_analyze_1
/repo/gcc-trunk/gcc/df-core.c:1217
0xb8d304 try_shrink_wrapping_separate(basic_block_def*)
/repo/gcc-trunk/gcc/shrink-wrap.c:1694
0x8b0d7f thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.c:5960
0x8b1572 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.c:6419
0x8b1572 execute
/repo/gcc-trunk/gcc/function.c:6461
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$
/repo/build-trunk-242552-checking-yes-rtl-df-extra-nographite-powerpc/./gcc/xgcc
-v
Using built-in specs.
COLLECT_GCC=/repo/build-trunk-242552-checking-yes-rtl-df-extra-nographite-powerpc/./gcc/xgcc
Target: powerpc-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl
--with-sysroot=/usr/powerpc-unknown-linux-gnu
--target=powerpc-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc-unknown-linux-gnu
--with-ld=/usr/bin/powerpc-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242552-checking-yes-rtl-df-extra-nographite-powerpc
Thread model: posix
gcc version 7.0.0 20161117 (experimental) (GCC) 


The compiler was configured with --enable-checking=yes,rtl,df,extra ; maybe df
checking is needed to reproduce.

[Bug rtl-optimization/78378] [5/6/7 Regression] wrong code when combining shift + mult + zero_extend

2016-11-16 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78378

--- Comment #3 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #2)
> r163380 still works, r163394 fails, so most likely one of r163383, r163384
> or r163389.

r163383 added the four-insn combinations, and this is what happens in the
testcase, if I understand the dump correctly.

[Bug rtl-optimization/78378] New: [5/6/7 Regression] wrong code when combining shift + mult + zero_extend

2016-11-16 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78378

Bug ID: 78378
   Summary: [5/6/7 Regression] wrong code when combining shift +
mult + zero_extend
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40056
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40056=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c && ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-trunk-242408-checking-yes-rtl-df-extra-nographite-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242408-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242408-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161115 (experimental) (GCC) 

Only x86_64-pc-linux-gnu{,x32} seems to be affected.
i686-pc-linux-gnu, powerpc{,64}-unknown-linux-gnu,
sparc{,64}-unknown-linux-gnu, aarch64-unknown-linux-gnu,
armv7a-softfp-linux-gnueabi, armv7a-hardfloat-linux-gnueabi do not have this
problem.


.combine shows that several complex instructions are combined to one:

...
Trying 6, 7, 9 -> 10:
Successfully matched this instruction:
(set (reg:SI 99 [ xD.1799 ])
(const_int 0 [0]))
allowing combination of insns 6, 7, 9 and 10
original costs 4 + 4 + 32 + 4 = 44
replacement cost 4
...

which is probably wrong. I don't know if the "(const_int 0 [0])" in fact
represents an unhandled combine failure.

Tested revisions:
r242408 - FAIL
6-branch r242077 - FAIL
5-branch r242124 - FAIL
4_9-branch r239063 - FAIL
4_8-branch r224828 - FAIL
4_7-branch r211571 - FAIL
4_6-branch r197894 - FAIL (maybe first version where 4 instructions can be
combined?)
4_5-branch r189152 - OK
4_4-branch r185318 - OK

[Bug target/78362] New: [7 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1804 during libgomp build

2016-11-15 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78362

Bug ID: 78362
   Summary: [7 Regression] ICE: RTL check: expected code 'reg',
have 'subreg' in rhs_regno, at rtl.h:1804 during
libgomp build
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 40046
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40046=edit
reduced testcase

Compiler output:
$
/repo/build-trunk-242408-checking-yes-rtl-df-extra-nographite-aarch64/./gcc/cc1
-quiet -O testcase.c
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1804
 foo (void)
 ^~~
0xb3e687 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.c:811
0x1057c4d rhs_regno
/repo/gcc-trunk/gcc/rtl.h:1804
0x10b368a rhs_regno
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:1632
0x10b368a gen_addsi3(rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:1613
0xa9c2ea expand_binop_directly
/repo/gcc-trunk/gcc/optabs.c:1071
0xa9a0d7 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-trunk/gcc/optabs.c:1151
0x844238 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:9515
0x82dc99 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:11050
0x83bdee expand_expr
/repo/gcc-trunk/gcc/expr.h:276
0x83bdee expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
/repo/gcc-trunk/gcc/expr.c:7684
0x844379 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:8526
0x82dc99 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:11050
0x846f22 expand_expr
/repo/gcc-trunk/gcc/expr.h:276
0x846f22 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:8303
0x82dc99 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:11050
0xd208a2 expand_expr
/repo/gcc-trunk/gcc/expr.h:276
0xd208a2 computation_cost
/repo/gcc-trunk/gcc/tree-ssa-loop-ivopts.c:3639
0xd2ed72 get_computation_cost_at
/repo/gcc-trunk/gcc/tree-ssa-loop-ivopts.c:5064
0xd33ff7 get_computation_cost
/repo/gcc-trunk/gcc/tree-ssa-loop-ivopts.c:5084
0xd33ff7 determine_group_iv_cost_cond
/repo/gcc-trunk/gcc/tree-ssa-loop-ivopts.c:5631
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$
/repo/build-trunk-242408-checking-yes-rtl-df-extra-nographite-aarch64/./gcc/xgcc
-v
Using built-in specs.
COLLECT_GCC=/repo/build-trunk-242408-checking-yes-rtl-df-extra-nographite-aarch64/./gcc/xgcc
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu
--target=aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242408-checking-yes-rtl-df-extra-nographite-aarch64
Thread model: posix
gcc version 7.0.0 20161115 (experimental) (GCC) 

I am failing to build the aarch64 crosscompiler with RTL checking enabled due
to this.

[Bug tree-optimization/78312] [7 Regression] wrong code probably due to VRP of multiplication

2016-11-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78312

--- Comment #2 from Zdenek Sojka  ---
(In reply to Richard Biener from comment #1)
> Hmm.
> 
> So [0, 1] * ~[1, 65534] gets
> 
> MEET ([0, 1] * [0, 0] == [0, 0],
>   [0, 1] * [65535, 65535] == ~[1, 65534]) == ~[1, 65534]
> 
> that looks ok to me.
> 
> And then ~[1, 65534] * ~[1, 65534] is [0, 1], also ok.
> 

Thanks, I didn't realize that ((65535 * 65535) & 0x) == 1.

[Bug tree-optimization/78312] New: [7 Regression] wrong code probably due to VRP of multiplication

2016-11-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78312

Bug ID: 78312
   Summary: [7 Regression] wrong code probably due to VRP of
multiplication
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 40022
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40022=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c -O2
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242046-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242046-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161110 (experimental) (GCC) 


The .vrp1 dump shows:
...
  # RANGE ~[1, 65534]
  _6 = _2 * _5;
  # RANGE [0, 1] NONZERO 1
  _7 = _6 * _6;
...

I believe that the code has defined behavior due to the (unsigned) cast.

[Bug target/78310] New: ICE: insn does not satisfy its constraints: {*bmi2_rorxdi3_1} with -mbmi2

2016-11-11 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78310

Bug ID: 78310
   Summary: ICE: insn does not satisfy its constraints:
{*bmi2_rorxdi3_1} with -mbmi2
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 40021
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40021=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mbmi2 testcase.c 
testcase.c: In function 'fn1':
testcase.c:12:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 24 11 13 2 (set (reg:DI 0 ax [orig:92 _6 ] [92])
(rotatert:DI (reg:DI 0 ax [orig:90 a.0_4 ] [90])
(const_int 64 [0x40]))) "testcase.c":10 603 {*bmi2_rorxdi3_1}
 (nil))
testcase.c:12:1: internal compiler error: in extract_constrain_insn, at
recog.c:2213
0xb666b3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0xb66727 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:119
0xb1d59d extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2213
0xb2c448 copyprop_hardreg_forward_1
/repo/gcc-trunk/gcc/regcprop.c:794
0xb2d994 execute
/repo/gcc-trunk/gcc/regcprop.c:1301
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-242046-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-242046-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161110 (experimental) (GCC)

[Bug target/78262] New: [7 Regression] wrong code with -fschedule-insns

2016-11-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78262

Bug ID: 78262
   Summary: [7 Regression] wrong code with -fschedule-insns
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 39996
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39996=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fschedule-insns testcase.c
$ ./a.out
Aborted

At the assembly level, the problem seems to be:
# testcase.c:12:   u128_0 = u128_0 << 127 | u128_0 >> 1;
mov rax, rcx# tmp99, _2
shrdrcx, rbx, 1 # _2, _2,
shrdrbx, rax, 1 # _2, tmp99,
# testcase.c:13:   u128_0 >>= (u8)u128_0;
shrdrcx, rbx, cl# _5, _5, _2
shr rbx, cl # _5, _2

^^^ the last shrd modifies rcx (and thus cl), which is used in the last shr
instruction - but it should use the original, unmodified value.

This might be a duplicate of some other bug that I cannot find now.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-241953-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-241953-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161108 (experimental) (GCC)

[Bug rtl-optimization/78241] [7 Regression] wrong code with -funroll-loops

2016-11-07 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78241

--- Comment #1 from Zdenek Sojka  ---
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-241681-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-241681-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161029 (experimental) (GCC)

[Bug rtl-optimization/78241] New: [7 Regression] wrong code with -funroll-loops

2016-11-07 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78241

Bug ID: 78241
   Summary: [7 Regression] wrong code with -funroll-loops
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 39983
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39983=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Og -funroll-loops testcase.c
$ ./a.out
Aborted

Correct value is 0x, wrong value is 16.
Tested targets that fail in 7.0.0:
aarch64-unknown-linux-gnu
armv7a-hardfloat-linux-gnueabi
armv7a-softfp-linux-gnueabi
powerpc64le-unknown-linux-gnu
powerpc64-unknown-linux-gnu
sparc-unknown-linux-gnu
x86_64-pc-linux-gnu

[Bug target/78227] New: ICE: unrecognizable insn: in extract_insn, at recog.c:2311 with -mavx512bw

2016-11-06 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78227

Bug ID: 78227
   Summary: ICE: unrecognizable insn: in extract_insn, at
recog.c:2311 with -mavx512bw
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39974
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39974=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mavx512bw testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: unrecognizable insn:
 }
 ^
(insn 8 7 9 2 (set (reg:V32HI 87 [ _2 ])
(unspec:SI [
(reg:V32HI 90)
(reg:V32HI 89)
] UNSPEC_MASKED_GT)) "testcase.c":6 -1
 (nil))
testcase.c:7:1: internal compiler error: in extract_insn, at recog.c:2311
0xb62d03 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0xb62d9b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:116
0xb18967 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2311
0x8ca4bd instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.c:1581
0x8ca4bd instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.c:1948
0x8ca4bd execute
/repo/gcc-trunk/gcc/function.c:1997
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-241681-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-241681-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20161029 (experimental) (GCC)

[Bug target/77834] New: [7 Regression] ICE: in make_decl_rtl, at varasm.c:1311 with -O -ftree-pre -mstringop-strategy=libcall

2016-10-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77834

Bug ID: 77834
   Summary: [7 Regression] ICE: in make_decl_rtl, at varasm.c:1311
with -O -ftree-pre -mstringop-strategy=libcall
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39745
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39745=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -ftree-pre -mstringop-strategy=libcall testcase.c
-Wno-psabi
testcase.c: In function 'foo':
testcase.c:12:1: internal compiler error: in make_decl_rtl, at varasm.c:1311
 }
 ^
0xed8c18 make_decl_rtl(tree_node*)
/repo/gcc-trunk/gcc/varasm.c:1307
0x6f7020 nonoverlapping_memrefs_p(rtx_def const*, rtx_def const*, bool)
/repo/gcc-trunk/gcc/alias.c:2757
0x6f80e5 write_dependence_p
/repo/gcc-trunk/gcc/alias.c:3033
0x6f846f canon_anti_dependence(rtx_def const*, bool, rtx_def const*,
machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/alias.c:3060
0x7978c5 cselib_invalidate_mem
/repo/gcc-trunk/gcc/cselib.c:2265
0x799a7b cselib_record_sets
/repo/gcc-trunk/gcc/cselib.c:2557
0x79abf6 cselib_process_insn(rtx_insn*)
/repo/gcc-trunk/gcc/cselib.c:2671
0xae9247 reload_cse_regs_1
/repo/gcc-trunk/gcc/postreload.c:217
0xaebfbd reload_cse_regs
/repo/gcc-trunk/gcc/postreload.c:67
0xaebfbd execute
/repo/gcc-trunk/gcc/postreload.c:2342
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240677-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240677-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160930 (experimental) (GCC)

[Bug target/77833] New: [7 Regression] ICE: in plus_constant, at explow.c:87 with -O -mavx512f

2016-10-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77833

Bug ID: 77833
   Summary: [7 Regression] ICE: in plus_constant, at explow.c:87
with -O -mavx512f
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39744=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c 
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: in plus_constant, at explow.c:87
 }
 ^
0x8438ef plus_constant(machine_mode, rtx_def*, long, bool)
/repo/gcc-trunk/gcc/explow.c:87
0x8436a6 plus_constant(machine_mode, rtx_def*, long, bool)
/repo/gcc-trunk/gcc/explow.c:117
0x6f9a04 init_alias_analysis()
/repo/gcc-trunk/gcc/alias.c:3359
0x9dbe52 ira
/repo/gcc-trunk/gcc/ira.c:5160
0x9dbe52 execute
/repo/gcc-trunk/gcc/ira.c:5512
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240677-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240677-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160930 (experimental) (GCC)

[Bug sanitizer/77823] [7 Regression] ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize=undefined and vector types

2016-10-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77823

--- Comment #4 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 39735 [details]
> gcc7-pr77823.patch
> 
> Short patch to fix the ICE.
> 
> That said, we should think of what to do with the generic vector extension
> for -fsanitize=undefined, right now we don't instrument anything.
> For stuff like shift, division, signed-integer-overflow, maybe also
> bool/enum for vectors of bool or enum, float-divide/float-cast, we either
> should modify
> the libubsan library, so that it would handle TK_Vector_Integer and
> TK_Vector_Float, likely use always passing by reference and somehow encode
> both the bit width of the elements and their kinds and also the number of
> elements in the vector (or log2 thereof) in the TypeInfo field and teach it
> how to print vectors {El1, El2, El3, El4} etc.? - then we could at least for
> some of the tests use also vector operations, e.g. for vector << vector
> shifts compare the second operand against vector containing element
> precision repeated, etc., or instead instrument it as a loop over number of
> elements, checking each operation separately (and reporting the individual
> overflow on each element separately, then as value we'd just use the
> scalars).

Adding ubsan support would be very useful, since when auto-reducing a
wrong-code bug, I often end up with useless code like:

typedef unsigned V __attribute__((vector_size(64)));

int foo(V v)
{
  /* returning out-of-bounds item, not handled by ubsan */
  return v[127];
}

or

V foo(V v)
{
  /* out-of-range shift, not handled by ubsan */
  return v << 127;
}

even though I am using -fsanitize=undefined.

[Bug sanitizer/77823] New: [7 Regression] ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize=undefined and vector types

2016-10-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77823

Bug ID: 77823
   Summary: [7 Regression] ICE: in ubsan_encode_value, at
ubsan.c:137 with -fsanitize=undefined and vector types
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39734
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39734=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fsanitize=undefined -Wno-psabi testcase.c 
testcase.c: In function 'foov':
testcase.c:7:3: internal compiler error: in ubsan_encode_value, at ubsan.c:137
   return v << 30;
   ^~
0xc0647c ubsan_encode_value(tree_node*, bool)
/repo/gcc-trunk/gcc/ubsan.c:137
0x6eac0b ubsan_instrument_shift(unsigned int, tree_code, tree_node*,
tree_node*)
/repo/gcc-trunk/gcc/c-family/c-ubsan.c:192
0x628bc9 build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, int)
/repo/gcc-trunk/gcc/c/c-typeck.c:11764
0x62d3b3 parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr)
/repo/gcc-trunk/gcc/c/c-typeck.c:3616
0x63dab3 c_parser_binary_expression
/repo/gcc-trunk/gcc/c/c-parser.c:6855
0x63dea5 c_parser_conditional_expression
/repo/gcc-trunk/gcc/c/c-parser.c:6495
0x63e5a0 c_parser_expr_no_commas
/repo/gcc-trunk/gcc/c/c-parser.c:6412
0x63ec32 c_parser_expression
/repo/gcc-trunk/gcc/c/c-parser.c:8608
0x63f639 c_parser_expression_conv
/repo/gcc-trunk/gcc/c/c-parser.c:8641
0x65956f c_parser_statement_after_labels
/repo/gcc-trunk/gcc/c/c-parser.c:5334
0x65ae01 c_parser_compound_statement_nostart
/repo/gcc-trunk/gcc/c/c-parser.c:4944
0x65b65e c_parser_compound_statement
/repo/gcc-trunk/gcc/c/c-parser.c:4777
0x657053 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.c:2176
0x662a03 c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.c:1574
0x663489 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.c:1454
0x663489 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.c:18173
0x6ca0e2 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.c:1072
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v 
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240623-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240623-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160929 (experimental) (GCC) 

The failing line is:
ubsan.c
134:  return fold_convert (pointer_sized_int_node, t);
135:}
136:   default:
137:gcc_unreachable ();
138:   }
139:   else
140: {

[Bug target/77761] New: [7 Regression] wrong code with -fschedule-insns -mavx512f --param=max-pending-list-length=512

2016-09-27 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77761

Bug ID: 77761
   Summary: [7 Regression] wrong code with -fschedule-insns
-mavx512f --param=max-pending-list-length=512
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39702
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39702=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-guess-branch-probability -fschedule-insns
-fno-tree-ter -mavx512f --param=max-pending-list-length=512 testcase.c
$ sde64 -- ./a.out 
Aborted

Correct value of x[0] is 0x00ff00ff00fd0002, wrong value is
0x00ff000100fd0001

$ x86_64-pc-linux-gnu-gcc -v 
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240535-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240535-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160927 (experimental) (GCC)

[Bug target/77541] New: [7 Regression] wrong code with 512bit vectors of int128 @ -O1

2016-09-09 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77541

Bug ID: 77541
   Summary: [7 Regression] wrong code with 512bit vectors of
int128 @ -O1
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39592
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39592=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c -Wno-psabi
$ ./a.out 
Aborted

The vector has values:
03020100
instead of:
0706050403020100

$ x86_64-pc-linux-gnu-gcc -v  
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160908 (experimental) (GCC) 


Tested revisions:
r240036 - FAIL
6-branch r239849 - OK
5-branch r239848 - OK

[Bug target/77527] New: [7 Regression] ICE: in make_decl_rtl, at varasm.c:1311 with -mstringop-strategy=libcall

2016-09-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77527

Bug ID: 77527
   Summary: [7 Regression] ICE: in make_decl_rtl, at varasm.c:1311
with -mstringop-strategy=libcall
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39584
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39584=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-copy-prop -fno-tree-dominator-opts
-fno-tree-forwprop -fno-tree-fre -mstringop-strategy=libcall testcase.c
-Wno-psabi
testcase.c: In function 'foo':
testcase.c:13:1: internal compiler error: in make_decl_rtl, at varasm.c:1311
 }
 ^
0xed0887 make_decl_rtl(tree_node*)
/repo/gcc-trunk/gcc/varasm.c:1307
0x6ed404 nonoverlapping_memrefs_p(rtx_def const*, rtx_def const*, bool)
/repo/gcc-trunk/gcc/alias.c:2757
0x6eef34 true_dependence_1
/repo/gcc-trunk/gcc/alias.c:2924
0x149a018 check_mem_read_rtx
/repo/gcc-trunk/gcc/dse.c:2039
0x149a018 check_mem_read_use
/repo/gcc-trunk/gcc/dse.c:2160
0xb5b154 note_uses(rtx_def**, void (*)(rtx_def**, void*), void*)
/repo/gcc-trunk/gcc/rtlanal.c:1934
0x149b498 scan_insn
/repo/gcc-trunk/gcc/dse.c:2266
0x149c72f dse_step1
/repo/gcc-trunk/gcc/dse.c:2525
0x149c72f rest_of_handle_dse
/repo/gcc-trunk/gcc/dse.c:3413
0x149c72f execute
/repo/gcc-trunk/gcc/dse.c:3511
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160908 (experimental) (GCC) 

Tested revisions:
r240036 - ICE
6-branch r239849 - OK

[Bug target/77526] New: [7 Regression] ICE: in verify_dominators, at dominance.c:1039 with -mstringop-strategy=byte_loop

2016-09-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77526

Bug ID: 77526
   Summary: [7 Regression] ICE: in verify_dominators, at
dominance.c:1039 with -mstringop-strategy=byte_loop
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39583
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39583=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-forward-propagate -fno-gcse
-fno-rerun-cse-after-loop -mstringop-strategy=byte_loop testcase.c -Wno-psabi
testcase.c: In function 'foo':
testcase.c:9:1: error: dominator of 5 should be 4, not 2
 }
 ^
testcase.c:9:1: internal compiler error: in verify_dominators, at
dominance.c:1039
0x7bd965 verify_dominators(cdi_direction)
/repo/gcc-trunk/gcc/dominance.c:1039
0x7bdb8f checking_verify_dominators
/repo/gcc-trunk/gcc/dominance.h:71
0x7bdb8f calculate_dominance_info(cdi_direction)
/repo/gcc-trunk/gcc/dominance.c:664
0x74acdd flow_loops_find(loops*)
/repo/gcc-trunk/gcc/cfgloop.c:419
0x9ff122 loop_optimizer_init(unsigned int)
/repo/gcc-trunk/gcc/loop-init.c:93
0x14dd398 if_convert
/repo/gcc-trunk/gcc/ifcvt.c:5407
0x14df20d execute
/repo/gcc-trunk/gcc/ifcvt.c:5628
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160908 (experimental) (GCC) 

Tested revisions:
r240036 - ICE
6-branch r239849 - OK

[Bug target/77452] [7 Regression] ICE: in plus_constant, at explow.c:87 with -fno-split-wide-types -mavx512f --param=max-combine-insns=2

2016-09-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77452

--- Comment #1 from Zdenek Sojka  ---
(gdb) p mode
$4 = SImode
(gdb) p *x  
$6 = {code = CONST_VECTOR, mode = V2SImode, ...

[Bug target/77452] New: [7 Regression] ICE: in plus_constant, at explow.c:87 with -fno-split-wide-types -mavx512f --param=max-combine-insns=2

2016-09-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77452

Bug ID: 77452
   Summary: [7 Regression] ICE: in plus_constant, at explow.c:87
with -fno-split-wide-types -mavx512f
--param=max-combine-insns=2
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39539
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39539=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-split-wide-types -mavx512f
--param=max-combine-insns=2 testcase.c 
testcase.c: In function 'foo':
testcase.c:10:1: internal compiler error: in plus_constant, at explow.c:87
 }
 ^
0x8377af plus_constant(machine_mode, rtx_def*, long, bool)
/repo/gcc-trunk/gcc/explow.c:87
0x83756d plus_constant(machine_mode, rtx_def*, long, bool)
/repo/gcc-trunk/gcc/explow.c:109
0x6ed9bd init_alias_analysis()
/repo/gcc-trunk/gcc/alias.c:3359
0x9cba44 ira
/repo/gcc-trunk/gcc/ira.c:5174
0x9cba44 execute
/repo/gcc-trunk/gcc/ira.c:5526
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-239934-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-239934-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160901 (experimental) (GCC) 

Tested revisions:
trunk r239934 - ICE
6-branch r239849 - OK

[Bug tree-optimization/77450] New: [5/6/7 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2016-09-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

Bug ID: 77450
   Summary: [5/6/7 Regression] ICE: in verify_ssa, at
tree-ssa.c:1016 on very simple code with vectors
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39538
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39538=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in verify_ssa, at tree-ssa.c:1016
 }
 ^
0xde3139 verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.c:1016
0xac5e25 execute_function_todo
/repo/gcc-trunk/gcc/passes.c:1971
0xac6c8f do_per_function
/repo/gcc-trunk/gcc/passes.c:1655
0xac6d06 execute_todo
/repo/gcc-trunk/gcc/passes.c:2014
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc testcase.c -W
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in execute_todo, at passes.c:2009
 }
 ^
0xac6dda execute_todo
/repo/gcc-trunk/gcc/passes.c:2009
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-239934-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-239934-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160901 (experimental) (GCC) 

Tested revisions:
r239934 - ICE
6-branch r239849 - ICE
5-branch r239848 - ICE
4_9-branch r239063 - ICE
4_8-branch r224828 - ICE
4_7-branch r211571 - OK

[Bug target/77403] New: [7 Regression] assemble failure of vinserti64x4 with -masm=intel

2016-08-29 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77403

Bug ID: 77403
   Summary: [7 Regression] assemble failure of vinserti64x4 with
-masm=intel
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: assemble-failure
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39511
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39511=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f -masm=intel testcase.c
/tmp/cc6ywLFg.s: Assembler messages:
/tmp/cc6ywLFg.s:44: Error: operand size mismatch for `vinserti64x4'

$ grep vinserti64x4 testcase.s 
vinserti64x4zmm0, zmm3, ymm0, $0x0

The correct form would be:
vinserti64x4zmm0, zmm3, ymm0, 0x0

gcc-6 produces correct assembly.

[Bug rtl-optimization/77401] [7 Regression] ICE: in simplify_binary_operation_1, at simplify-rtx.c:3731 with out-of-bounds vector access

2016-08-29 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77401

--- Comment #1 from Zdenek Sojka  ---
Created attachment 39507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39507=edit
reduced testcase

[Bug rtl-optimization/77401] New: [7 Regression] ICE: in simplify_binary_operation_1, at simplify-rtx.c:3731 with out-of-bounds vector access

2016-08-29 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77401

Bug ID: 77401
   Summary: [7 Regression] ICE: in simplify_binary_operation_1, at
simplify-rtx.c:3731 with out-of-bounds vector access
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -O testcase.c 
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in simplify_binary_operation_1, at
simplify-rtx.c:3731
 }
 ^
0xba48b8 simplify_binary_operation_1
/repo/gcc-trunk/gcc/simplify-rtx.c:3730
0xba516d simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.c:2063
0x14584b4 combine_simplify_rtx
/repo/gcc-trunk/gcc/combine.c:5529
0x145f033 subst
/repo/gcc-trunk/gcc/combine.c:5461
0x145eeda subst
/repo/gcc-trunk/gcc/combine.c:5399
0x14613a2 try_combine
/repo/gcc-trunk/gcc/combine.c:3271
0x146d39c combine_instructions
/repo/gcc-trunk/gcc/combine.c:1267
0x146d39c rest_of_handle_combine
/repo/gcc-trunk/gcc/combine.c:14389
0x146d39c execute
/repo/gcc-trunk/gcc/combine.c:14432
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in simplify_binary_operation_1, at
simplify-rtx.c:3731
 }
 ^
0xba48b8 simplify_binary_operation_1
/repo/gcc-trunk/gcc/simplify-rtx.c:3730
0xba516d simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.c:2063
0x14584b4 combine_simplify_rtx
/repo/gcc-trunk/gcc/combine.c:5529
0x145f033 subst
/repo/gcc-trunk/gcc/combine.c:5461
0x145eeda subst
/repo/gcc-trunk/gcc/combine.c:5399
0x14613a2 try_combine
/repo/gcc-trunk/gcc/combine.c:3271
0x146d39c combine_instructions
/repo/gcc-trunk/gcc/combine.c:1267
0x146d39c rest_of_handle_combine
/repo/gcc-trunk/gcc/combine.c:14389
0x146d39c execute
/repo/gcc-trunk/gcc/combine.c:14432
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ x86_64-pc-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-239769-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-239769-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160826 (experimental) (GCC) 


I don't know why is the backtrace printed twice.
I got this code while auto-reducing for another ICE.
The resulting code has undefined behaviour due to the out-of-bounds access.

Tested revisions:
r239769 - ICE
6-branch r239319 - OK

[Bug rtl-optimization/76783] New: [7 Regression] wrong code with conditional vector assignment @ -Og

2016-08-15 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=76783

Bug ID: 76783
   Summary: [7 Regression] wrong code with conditional vector
assignment @ -Og
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39444
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39444=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Og testcase.c -w
testcase.c: In function 'foo':
testcase.c:5:1: note: The ABI for passing parameters with 64-byte alignment has
changed in GCC 4.6
 foo (unsigned c, v64u128 v)
 ^~~
$ ./a.out 
Aborted

The function foo returns 'v' unchanged unconditionally:
foo:
mov rax, QWORD PTR [rsp+24]
mov rdx, QWORD PTR [rsp+32]
ret



$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-239460-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-239460-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160815 (experimental) (GCC) 


Tested revisions:
r239460 - FAIL
6-branch r239319 - OK

[Bug target/72717] New: ICE: in emit_move_insn, at expr.c:3693 with vector shift @ powerpc64le

2016-07-27 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72717

Bug ID: 72717
   Summary: ICE: in emit_move_insn, at expr.c:3693 with vector
shift @ powerpc64le
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc64le-unknown-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 39026
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39026=edit
reduced testcase

Compiler output:
$ powerpc64le-unknown-linux-gnu-gcc -v 
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-powerpc64le/bin/powerpc64le-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-238792-checking-yes-rtl-df-extra-nographite-powerpc64le/bin/../libexec/gcc/powerpc64le-unknown-linux-gnu/7.0.0/lto-wrapper
Target: powerpc64le-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl
--with-sysroot=/usr/powerpc64le-unknown-linux-gnu
--target=powerpc64le-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc64le-unknown-linux-gnu
--with-ld=/usr/bin/powerpc64le-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc64le-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-238792-checking-yes-rtl-df-extra-nographite-powerpc64le
Thread model: posix
gcc version 7.0.0 20160727 (experimental) (GCC) 

$ powerpc64le-unknown-linux-gnu-gcc testcase.c -w
testcase.c: In function 'foo':
testcase.c:6:12: internal compiler error: in emit_move_insn, at expr.c:3693
   return v << v[0];
  ~~^~~
0x826623 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:3692
0x802a27 force_reg(machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/explow.c:637
0xef2179 rs6000_expand_vector_init(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/rs6000/rs6000.c:6711
0x105df1b gen_vec_initv2df(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/rs6000/vector.md:841
0xa73ab8 insn_gen_fn::operator()(rtx_def*, rtx_def*) const
/repo/gcc-trunk/gcc/recog.h:301
0xa73ab8 expand_vector_broadcast
/repo/gcc-trunk/gcc/optabs.c:393
0xa73ab8 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-trunk/gcc/optabs.c:1234
0x808241 expand_shift_1
/repo/gcc-trunk/gcc/expmed.c:2442
0x83747b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:9171
0x706ca1 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3686
0x706ca1 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:3746
0x70876e expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:5753
0x70e39e execute
/repo/gcc-trunk/gcc/cfgexpand.c:6367
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

[Bug target/71984] New: [7 Regression] wrong code with -O -mavx512cd

2016-07-24 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71984

Bug ID: 71984
   Summary: [7 Regression] wrong code with -O -mavx512cd
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 38958
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38958=edit
reduced testcase

Output:
$ gcc -O -mavx512cd testcase.c
$ ./a.out
Aborted

The function foo() is simplied to just return 0:

foo:
movl$0, %eax#,
ret



$ gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-238665-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-238665-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160722 (experimental) (GCC)

[Bug rtl-optimization/69891] wrong code with -mstringop-strategy=libcall @ i686

2016-07-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69891

--- Comment #19 from Zdenek Sojka  ---
Target milestone 4.9.4 is not set.

[Bug middle-end/71719] New: [7 Regression] invalid set-but-not-used warning with vectors

2016-06-30 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71719

Bug ID: 71719
   Summary: [7 Regression] invalid set-but-not-used warning with
vectors
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Created attachment 38806
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38806=edit
reduced testcase

Compiler output:
$ gcc -Wall -W unused.c -c
unused.c: In function 'foo':
unused.c:6:8: warning: parameter 'v' set but not used
[-Wunused-but-set-parameter]
 foo (V v)
^
The variable is used (even all its members). Happens at any -O* level.


$ gcc -v  
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-237869-checking-yes-rtl-df-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-237869-checking-yes-rtl-df-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160630 (experimental) (GCC)

[Bug middle-end/71619] New: [7 Regression] ICE: in predict_loops, at predict.c:1772 with --param=max-predicted-iterations=0

2016-06-22 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71619

Bug ID: 71619
   Summary: [7 Regression] ICE: in predict_loops, at
predict.c:1772 with --param=max-predicted-iterations=0
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38743
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38743=edit
reduced testcase

Compiler output:
$ gcc -O --param=max-predicted-iterations=0 testcase.c 
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in predict_loops, at predict.c:1772
 }
 ^
0xad753b predict_loops
/repo/gcc-trunk/gcc/predict.c:1772
0xad7b39 tree_estimate_probability(bool)
/repo/gcc-trunk/gcc/predict.c:2573
0xad972b execute
/repo/gcc-trunk/gcc/predict.c:3271
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-237652-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-237652-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160621 (experimental) (GCC)

[Bug rtl-optimization/71591] New: SIGSEGV in test_uncond_jump (rtl-tests.c:90) with -E -fself-test

2016-06-20 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71591

Bug ID: 71591
   Summary: SIGSEGV in test_uncond_jump (rtl-tests.c:90) with -E
-fself-test
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Compiler output:
$ echo '' | x86_64-pc-linux-gnu-gcc -E -fself-test -xc -
# 1 ""
# 1 ""
# 1 ""
# 31 ""
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "" 2
# 1 ""
cc1: internal compiler error: Segmentation fault
0xbc434f crash_signal
/repo/gcc-trunk/gcc/toplev.c:335
0x1576a3d test_uncond_jump
/repo/gcc-trunk/gcc/rtl-tests.c:90
0x1576fd4 selftest::rtl_tests_c_tests()
/repo/gcc-trunk/gcc/rtl-tests.c:109
0x1536d94 selftest::run_tests()
/repo/gcc-trunk/gcc/selftest-run-tests.c:57
0xbc5979 toplev::run_self_tests()
/repo/gcc-trunk/gcc/toplev.c:2057
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v  
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-237587-checking-yes-rtl-df-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-237587-checking-yes-rtl-df-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160620 (experimental) (GCC)

[Bug target/71555] New: [7 Regression] ICE: compilation "never" finishes with -O -mtune=sandybridge -mavx512bw

2016-06-16 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71555

Bug ID: 71555
   Summary: [7 Regression] ICE: compilation "never" finishes with
-O -mtune=sandybridge -mavx512bw
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 38710
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38710=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mtune=sandybridge -mavx512bw testcase.c
(nothing)

The cc1 process is slowly eating memory.

Backtrace:
(gdb) bt
#0  bitmap_set_bit (head=head@entry=0x7fffcfc0, bit=1153) at
/repo/gcc-trunk/gcc/bitmap.c:602
#1  0x00a346f7 in assign_spill_hard_regs (n=1, pseudo_regnos=0x25f7260)
at /repo/gcc-trunk/gcc/lra-spills.c:275
#2  lra_spill () at /repo/gcc-trunk/gcc/lra-spills.c:587
#3  0x00a0b2ad in lra (f=) at
/repo/gcc-trunk/gcc/lra.c:2380
#4  0x009b24ba in do_reload () at /repo/gcc-trunk/gcc/ira.c:5384
#5  (anonymous namespace)::pass_reload::execute (this=) at
/repo/gcc-trunk/gcc/ira.c:5568
#6  0x00ab8447 in execute_one_pass (pass=pass@entry=0x228db00) at
/repo/gcc-trunk/gcc/passes.c:2344
#7  0x00ab8a18 in execute_pass_list_1 (pass=0x228db00) at
/repo/gcc-trunk/gcc/passes.c:2428
#8  0x00ab8a2a in execute_pass_list_1 (pass=0x228ca80) at
/repo/gcc-trunk/gcc/passes.c:2429
#9  0x00ab8a75 in execute_pass_list (fn=,
pass=) at /repo/gcc-trunk/gcc/passes.c:2439
#10 0x0076a554 in cgraph_node::expand (this=this@entry=0x76e4c000)
at /repo/gcc-trunk/gcc/cgraphunit.c:1983
#11 0x0076beaf in expand_all_functions () at
/repo/gcc-trunk/gcc/cgraphunit.c:2119
#12 symbol_table::compile (this=this@entry=0x76c580a8) at
/repo/gcc-trunk/gcc/cgraphunit.c:2475
#13 0x0076e18a in symbol_table::compile (this=0x76c580a8) at
/repo/gcc-trunk/gcc/cgraphunit.c:2568
#14 symbol_table::finalize_compilation_unit (this=0x76c580a8) at
/repo/gcc-trunk/gcc/cgraphunit.c:2565
#15 0x00bc1fcb in compile_file () at /repo/gcc-trunk/gcc/toplev.c:490
#16 0x005c92fa in do_compile () at /repo/gcc-trunk/gcc/toplev.c:1998
#17 toplev::main (this=this@entry=0x7fffd2e0, argc=,
argc@entry=16, argv=, argv@entry=0x7fffd3e8) at
/repo/gcc-trunk/gcc/toplev.c:2127
#18 0x005cb2b7 in main (argc=16, argv=0x7fffd3e8) at
/repo/gcc-trunk/gcc/main.c:39

[Bug tree-optimization/71428] [7 Regression] wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump)

2016-06-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71428

--- Comment #7 from Zdenek Sojka  ---
*** Bug 71427 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/71427] [7 Regression] wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump)

2016-06-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71427

Zdenek Sojka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Zdenek Sojka  ---
It is a duplicate of PR#71428; bugzilla had timeouts while submitting the
report and uploading attachments. Repeated requests resulted in duplicate
attachments and bugreports.

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

[Bug tree-optimization/71428] [7 Regression] wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump)

2016-06-05 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71428

--- Comment #2 from Zdenek Sojka  ---
I cannot upload any attachment to bugzilla (requests just time out), so here it
is as a plain text:
$ cat testcase.c
typedef unsigned short v64u16 __attribute__ ((vector_size (64)));

v64u16
foo (v64u16 p1)
{
  p1[31] |= p1[1];
  return p1;
}

int
main ()
{
  v64u16 x = foo ((v64u16){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
//  __builtin_printf ("%04x\n", x[31]);
  if (x[31] != 1)
__builtin_abort();
  return 0;
}

[Bug tree-optimization/71428] [7 Regression] wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump)

2016-06-05 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71428

--- Comment #1 from Zdenek Sojka  ---
Created attachment 38649
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38649=edit
reduced testcase

[Bug tree-optimization/71428] New: [7 Regression] wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump)

2016-06-05 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71428

Bug ID: 71428
   Summary: [7 Regression] wrong code with -Os -fno-tree-forwprop
(breaks in the .bswap dump)
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-tree-forwprop testcase.c -Wno-psabi
$ ./a.out 
Aborted

Diffing 6-branch and trunk assembly output shows:
@@ -7,10 +7,10 @@
 .LFB0:
.cfi_startproc
mov dx, WORD PTR [rsp+10]
-   or  WORD PTR [rsp+70], dx
mov rax, rdi
lea rsi, [rsp+8]
mov ecx, 16
+   mov WORD PTR [rsp+70], dx
rep movsd
ret
.cfi_endproc


The "or" seems to disappear in the .bswap dump in trunk.
6-branch .bswap doesn't perform any transformation, but trunk's one does.

[Bug c++/71365] New: [7 Regression] g++ reject access to parent's parent virtual method

2016-05-31 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71365

Bug ID: 71365
   Summary: [7 Regression] g++ reject access to parent's parent
virtual method
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: rejects-valid
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 38615
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38615=edit
testcase (from openttd)

Compiler output:
$ g++ accept.C 
accept.C: In member function 'virtual void C::foo()':
accept.C:7:55: error: 'A' is not a base of 'C'
 class C : public B { virtual void foo() { this->A::foo(); } };
   ^~~
I think this code is valid, and it is accepted by all GCC versions up to 6.1.1.
If it is invalid, the error message should be improved to mention, for example,
"direct base". Note the code is accepted if B is not a template.

[Bug target/70904] New: ICE: Max. number of generated reload insns per insn is achieved (90) with -fno-split-wide-types @ aarch64

2016-05-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70904

Bug ID: 70904
   Summary: ICE: Max. number of generated reload insns per insn is
achieved (90) with -fno-split-wide-types @ aarch64
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 38393
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38393=edit
reduced testcase

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O -fno-split-wide-types testcase.c 
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: Max. number of generated reload insns
per insn is achieved (90)

 }
 ^
0x9dafa9 lra_constraints(bool)
/repo/gcc-trunk/gcc/lra-constraints.c:4440
0x9c63dc lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2290
0x96de19 do_reload
/repo/gcc-trunk/gcc/ira.c:5425
0x96de19 execute
/repo/gcc-trunk/gcc/ira.c:5609
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ aarch64-unknown-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-235588-checking-yes-rtl-df-nographite-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/7.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu
--target=aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-235588-checking-yes-rtl-df-nographite-aarch64
Thread model: posix
gcc version 7.0.0 20160428 (experimental) (GCC)

[Bug target/70903] New: [4.9/5/6/7 Regression] wrong code with bfi @ aarch64 with -Os

2016-05-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70903

Bug ID: 70903
   Summary: [4.9/5/6/7 Regression] wrong code with bfi @ aarch64
with -Os
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 38392
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38392=edit
reduced testcase

Output:
$ aarch64-unknown-linux-gnu-gcc -v   
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-235588-checking-yes-rtl-df-nographite-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/7.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu
--target=aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-235588-checking-yes-rtl-df-nographite-aarch64
Thread model: posix
gcc version 7.0.0 20160428 (experimental) (GCC) 

$ aarch64-unknown-linux-gnu-gcc -Os testcase.c
$ ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

$ diff -u testcase.s testcase.s.fixed 
--- testcase.s  2016-05-02 12:57:29.920221842 +0200
+++ testcase.s.fixed2016-05-02 12:52:41.060217727 +0200
@@ -59,7 +59,7 @@
adrpx1, .LC0// tmp87,
mov x0, x8  // tmp82,
add x4, x1, :lo12:.LC0  // tmp86, tmp87,
-   mov x8, -1  // tmp95,
+   mov x8, 255 // tmp95,
mov x3, 0   // D.2757,
mov x2, 0   // D.2757,
bfi x3, x8, 0, 8// D.2757, tmp95,,

fixes the assembly for this particular testcase.

While (u8)255 == (u8)-1, x8==-1 cannot be used for 32bit load.

[Bug target/70662] New: vpbroadcastq assemble failure with -masm=intel -mavx512vbmi

2016-04-14 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70662

Bug ID: 70662
   Summary: vpbroadcastq assemble failure with -masm=intel
-mavx512vbmi
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: assemble-failure
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38267
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38267=edit
reduced testcase

Compiler output:
$ gcc -Og -fschedule-insns -fno-tree-fre -mavx512vbmi
--param=max-sched-ready-insns=1 -masm=intel testcase.c 
/tmp/cc4IEVUE.s: Assembler messages:
/tmp/cc4IEVUE.s:383: Error: operand size mismatch for `vpbroadcastq'

The failing instruction is:
vpbroadcastqzmm17{k1}, XMMWORD PTR [rsp+4536]
s/XMMWORD/QWORD/ fixes the assembly. The second operand is a QWORD, but if a
register is referenced, it is an XMM register (only 64 bits are used).

[Bug rtl-optimization/70596] New: [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

2016-04-08 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70596

Bug ID: 70596
   Summary: [6 Regression] -fcompare-debug failure with one extra
NOTE_INSN_DELETED
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38222
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38222=edit
reduced testcase

Compiler output:
$ gcc testcase.c -O2 -fno-dce -fschedule-insns -fno-tree-coalesce-vars
-fno-tree-dce -fno-tree-fre -fno-tree-pre -fcompare-debug -mavx512f 
x86_64-pc-linux-gnu-gcc: error: testcase.c: -fcompare-debug failure (length)

$ diff -u testcase*gkd
@@ -648,7 +648,6 @@
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 NOTE_INSN_DELETED)
-(note # 0 0 NOTE_INSN_DELETED)
 (insn/f:TI # 0 0 2 (set (reg:DI 39 r10)
 (plus:DI (reg/f:DI 7 sp)
 (const_int 8 [0x8]))) testcase.c:5# {*leadi}


The .reload dump is the first one where is one more NOTE_INSN_DELETED.

$ grep -c NOTE_INSN_DELETED *.c.*
...
testcase.c.255r.ira:155
testcase.c.256r.reload:646
testcase.c.257r.postreload:646
...
testcase.c.gk.255r.ira:155
testcase.c.gk.256r.reload:647
testcase.c.gk.257r.postreload:647
...

[Bug target/70574] New: [5/6 Regression] wrong code with -mavx2, read of partially initialised stack variable

2016-04-07 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70574

Bug ID: 70574
   Summary: [5/6 Regression] wrong code with -mavx2, read of
partially initialised stack variable
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38210
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38210=edit
reduced testcase

Output:
$ gcc -O -fPIC -frerun-cse-after-loop -fno-tree-ccp -mcmodel=medium -mavx2
testcase.c
$ valgrind -q ./a.out
==1282== Conditional jump or move depends on uninitialised value(s)
==1282==at 0x400653: main (in /home/zso/gcc-bug/89/a.out)
==1282== 
Aborted


The problem most likely is (intel sytax):
...
foo:
...
mov DWORD PTR -52[rbp], edi # %sfp, u64_0
mov QWORD PTR -64[rbp], rcx # %sfp, u128_1
1)  mov BYTE PTR -48[rbp], -1   # %sfp,
vpxor   xmm2, xmm2, xmm2# tmp120
2)  vpinsrb xmm2, xmm2, BYTE PTR -48[rbp], 1# tmp120, tmp120, %sfp,
vmovd   xmm4, DWORD PTR -64[rbp]# tmp124, %sfp
mov eax, 0  # tmp126,
vpinsrb xmm4, xmm4, eax, 1  # tmp125, tmp124, tmp126,
3)  vmovd   xmm3, DWORD PTR -48[rbp]# tmp129, %sfp
...

1 stores a "byte" -1, 2 reads "byte" -1, 3 reads "dword" -1 (3 bytes of
garbage)


$ gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-234794-checking-yes-rtl-df-nographite/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-234794-checking-yes-rtl-df-nographite
Thread model: posix
gcc version 6.0.0 20160406 (experimental) (GCC)

[Bug target/70525] New: generating 'vpandn' without the mode suffix, gnu as fails to assemble (-mavx512bw)

2016-04-04 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70525

Bug ID: 70525
   Summary: generating 'vpandn' without the mode suffix, gnu as
fails to assemble (-mavx512bw)
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: assemble-failure
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38174
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38174=edit
reduced testcase

Output:
$ gcc -O -mavx512bw testcase.c
/tmp/ccuJjUxJ.s: Assembler messages:
/tmp/ccuJjUxJ.s:8: Error: operand type mismatch for `vpandn'

@@ -5,7 +5,7 @@
foo:   
  .LFB0:
.cfi_startproc
-   vpandn  %zmm0, %zmm1, %zmm0
+   vpandnq %zmm0, %zmm1, %zmm0
ret
.cfi_endproc
 .LFE0:


Fixes the assembly (similar fix applies for the intel syntax). (vpandnd can be
used as well)

Both the "vpandnq" and "vpandnd" instructions should be available in the
"foundation" instruction set with -mavx512f, but -mavx512bw is needed to force
generation of the instruction. I will create a missed-optimization for this,
unless I am wrong.

[Bug tree-optimization/70509] wrong code with extract from a v64qi

2016-04-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509

--- Comment #5 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #4)
> x86_64 bootstrap finished (the code is likely not triggered), regtest
> running.

It also fixes several wrong-code testcases that I failed to reduce to a
reasonable size, thus were unreported. During testcase reduction, there started
to be out-of-bounds vector indexes, that I fail to detect (with
-fsanitize=undefined).

[Bug tree-optimization/70509] wrong code with extract from a v64qi

2016-04-03 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509

--- Comment #4 from Zdenek Sojka  ---
(In reply to Marc Glisse from comment #3)
> Rereading this a few years later, I have no idea why I used that type.
> bitsize_int would make more sense...

I've already tried this:
--- gcc/tree-ssa-forwprop.c (revision 234698)
+++ gcc/tree-ssa-forwprop.c (working copy)
@@ -1773,7 +1773,7 @@

   if (code == VEC_PERM_EXPR)
 {
-  tree p, m, index, tem;
+  tree p, m, tem;
   unsigned nelts;
   m = gimple_assign_rhs3 (def_stmt);
   if (TREE_CODE (m) != VECTOR_CST)
@@ -1790,9 +1790,8 @@
  p = gimple_assign_rhs2 (def_stmt);
  idx -= nelts;
}
-  index = build_int_cst (TREE_TYPE (TREE_TYPE (m)), idx * size);
   tem = build3 (BIT_FIELD_REF, TREE_TYPE (op),
-   unshare_expr (p), op1, index);
+   unshare_expr (p), op1, bitsize_int(idx * size));
   gimple_assign_set_rhs1 (stmt, tem);
   fold_stmt (gsi);
   update_stmt (gsi_stmt (*gsi));


x86_64 bootstrap finished (the code is likely not triggered), regtest running.

[Bug tree-optimization/70509] wrong code with extract from a v64qi

2016-04-02 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509

--- Comment #2 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #0)
> First broken dump seems to be .forwprop, where is:

.forwprop4 , that is. The problem might be that simplify_bitfield_ref() does:
tree-ssa-forwprop.c
...
1793:  index = build_int_cst (TREE_TYPE (TREE_TYPE (m)), idx * size);
...

which builds the index of type "unsigned char", which wraps around from 256 to
0.
Is there any reason to have index of type "TREE_TYPE (TREE_TYPE (m))" in that
statement? or am I reading the code incorrectly?

[Bug tree-optimization/70509] wrong code with extract from a casted vector(64)

2016-04-01 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509

--- Comment #1 from Zdenek Sojka  ---
Created attachment 38161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38161=edit
reduced testcase, without casts

Output:
$ sde64 -- ./a.out 
0009
Aborted

[Bug target/70510] New: ICE: output_operand: invalid %-code with -mavx512bw -masm=intel when emitting vpbroatcast

2016-04-01 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70510

Bug ID: 70510
   Summary: ICE: output_operand: invalid %-code with -mavx512bw
-masm=intel when emitting vpbroatcast
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38160
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38160=edit
reduced testcase

Compiler output:
$ gcc -Og -mavx512bw -masm=intel testcase.c
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: output_operand: invalid %-code
 }
 ^
0x859d53 output_operand_lossage(char const*, ...)
/repo/gcc-trunk/gcc/final.c:3409
0x85b0bb output_asm_insn(char const*, rtx_def**)
/repo/gcc-trunk/gcc/final.c:3774
0x85c801 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
/repo/gcc-trunk/gcc/final.c:3015
0x85e4ed final(rtx_insn*, _IO_FILE*, int)
/repo/gcc-trunk/gcc/final.c:2045
0x85ec6b rest_of_handle_final
/repo/gcc-trunk/gcc/final.c:4441
0x85ec6b execute
/repo/gcc-trunk/gcc/final.c:4516
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

bt shows:
#2  0x0085b0bc in output_asm_insn (templ=templ@entry=0x1b38db8
"vpbroadcastd\t{%x1, %0|%0, %1}", operands=0x2170140 )
at /repo/gcc-trunk/gcc/final.c:3774

[Bug tree-optimization/70509] New: wrong code with extract from a casted vector(64)

2016-04-01 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509

Bug ID: 70509
   Summary: wrong code with extract from a casted vector(64)
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
Target: x86_64-pc-linux-gnu

Created attachment 38159
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38159=edit
reduced testcase

Output:
$ gcc -O -mavx512bw testcase.c
$ sde64 -- ./a.out 
0008
Aborted

First broken dump seems to be .forwprop, where is:
  _2 = VIEW_CONVERT_EXPR<vector(64) charD.7>(v_1(D));
  _4 = VEC_PERM_EXPR <_2, _2, { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 }>;
  _9 = BIT_FIELD_REF <u_8(D), 8, 0>;
  _10 = BIT_FIELD_REF <_2, 8, 0>;
  _11 = _9 / _10;

It extracts from _2 offset 0 instead of 256. -fno-tree-forwprop fixes the
testcase.

<    5   6   7   8   9   10   11   12   13   14   >