[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  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/gcc/expr.h:260
0

[Bug middle-end/81283] Quirks around 32-bit PowerPC built-in Atomics

2017-07-03 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81283

--- Comment #5 from Andreas Schwab  ---
Link against libatomic.

[Bug bootstrap/81287] New: bootstrap fails with all languages

2017-07-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81287

Bug ID: 81287
   Summary: bootstrap fails with all languages
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bernd.edlinger at hotmail dot de
  Target Milestone: ---

../gcc-8-20170702/configure --prefix=/home/ed/gnu/install
--enable-languages=all

=> build fails with:

/home/ed/gnu/gcc-build/./prev-gcc/xg++ -B/home/ed/gnu/gcc-build/./prev-gcc/
-B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-I/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include 
-I/home/ed/gnu/gcc-8-20170702/libstdc++-v3/libsupc++
-L/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/ed/gnu/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -gtoggle -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
 -DHAVE_CONFIG_H -I. -Ibrig -I../../gcc-8-20170702/gcc
-I../../gcc-8-20170702/gcc/brig -I../../gcc-8-20170702/gcc/../include
-I../../gcc-8-20170702/gcc/../libcpp/include -I/home/ed/gnu/gcc-build/./gmp
-I/home/ed/gnu/gcc-8-20170702/gmp -I/home/ed/gnu/gcc-build/./mpfr/src
-I/home/ed/gnu/gcc-8-20170702/mpfr/src -I/home/ed/gnu/gcc-8-20170702/mpc/src 
-I../../gcc-8-20170702/gcc/../libdecnumber
-I../../gcc-8-20170702/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc-8-20170702/gcc/../libbacktrace
-I/home/ed/gnu/gcc-build/./isl/include
-I/home/ed/gnu/gcc-8-20170702/isl/include  -o brig/brig-function.o -MT
brig/brig-function.o -MMD -MP -MF brig/.deps/brig-function.TPo -I
../../gcc-8-20170702/gcc/brig -I /home/ed/local/include -I
../../gcc-8-20170702/gcc/brig/brigfrontend
../../gcc-8-20170702/gcc/brig/brigfrontend/brig-function.cc
In file included from
../../gcc-8-20170702/gcc/brig/brigfrontend/brig-function.cc:41:0:
../../gcc-8-20170702/gcc/tree-cfg.h:108:8: error: ‘profile_probability’ has not
been declared
profile_probability);
^~~
../../gcc-8-20170702/gcc/brig/Make-lang.in:246: recipe for target
'brig/brig-function.o' failed
make[3]: *** [brig/brig-function.o] Error 1
make[3]: Leaving directory '/home/ed/gnu/gcc-build/gcc'
Makefile:4686: recipe for target 'all-stage2-gcc' failed
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/ed/gnu/gcc-build'
Makefile:30525: recipe for target 'stage2-bubble' failed
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory '/home/ed/gnu/gcc-build'
Makefile:955: recipe for target 'all' failed
make: *** [all] Error 2

[Bug tree-optimization/81192] [8 Regression] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

--- Comment #14 from Tom de Vries  ---
Author: vries
Date: Mon Jul  3 07:20:49 2017
New Revision: 249893

URL: https://gcc.gnu.org/viewcvs?rev=249893&root=gcc&view=rev
Log:
Fix sigsegv in find_same_succ_bb

2017-07-03  Tom de Vries  

PR tree-optimization/81192
* tree-ssa-tail-merge.c (same_succ_flush_bb): Handle
BB_SAME_SUCC (bb) == NULL.

* gcc.dg/pr81192.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr81192.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-tail-merge.c

[Bug tree-optimization/81192] [8 Regression] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

--- Comment #15 from Tom de Vries  ---
Author: vries
Date: Mon Jul  3 07:21:34 2017
New Revision: 249894

URL: https://gcc.gnu.org/viewcvs?rev=249894&root=gcc&view=rev
Log:
Don't tail-merge blocks from different loops

2017-07-03  Tom de Vries  

PR tree-optimization/81192
* tree-ssa-tail-merge.c (same_succ_hash): Use bb->loop_father->num in
hash.
(same_succ::equal): Don't find bbs to be equal if bb->loop_father
differs.
(find_same_succ_bb): Remove obsolete test on bb->loop_father->latch.

* gcc.dg/pr81192.c: Update.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr81192.c
trunk/gcc/tree-ssa-tail-merge.c

[Bug tree-optimization/69468] tail merge should ignore private edge flags

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69468

--- Comment #3 from Tom de Vries  ---
Author: vries
Date: Mon Jul  3 07:23:01 2017
New Revision: 249895

URL: https://gcc.gnu.org/viewcvs?rev=249895&root=gcc&view=rev
Log:
Ignore EDGE_{DFS_BACK,EXECUTABLE} in tail-merge

2017-07-03  Tom de Vries  

PR tree-optimization/69468
* tree-ssa-tail-merge.c (ignore_edge_flags): New constant.
(find_same_succ_bb): Handle ignore_edge_flags.

* gcc.dg/pr81192.c: Update.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr81192.c
trunk/gcc/tree-ssa-tail-merge.c

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
 CC||marxin at gcc dot gnu.org
   Target Milestone|8.0 |---
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Started with r248153.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
I'll have a look.

[Bug c++/81276] Function multiversioning doesn't work with C++ templates

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81276

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
 CC||jason at redhat dot com,
   ||marxin at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, it really does not work with templates.

[Bug target/70676] suboptimal code generation on AVR

2017-07-03 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70676

Georg-Johann Lay  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #8 from Georg-Johann Lay  ---
No reply in more than 6 months, closing...

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|normal  |blocker

--- Comment #1 from Eric Botcazou  ---
Same issue on regular PowerPC64/Linux.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||build, ice-on-valid-code
 CC||pinskia at gcc dot gnu.org
   Target Milestone|--- |8.0

--- Comment #2 from Andrew Pinski  ---
I get an ICE with aarch64-linux-gnu on:
FAIL: gcc.dg/sms-1.c (internal compiler error)


I suspect this is a similar issue as doloop pattern for aarch64 is only enabled
if SMS is enabled.  That is the problem is from the doloop pass.

[Bug tree-optimization/81192] [8 Regression] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

--- Comment #16 from Tom de Vries  ---
Author: vries
Date: Mon Jul  3 08:32:20 2017
New Revision: 249898

URL: https://gcc.gnu.org/viewcvs?rev=249898&root=gcc&view=rev
Log:
Backport "Fix sigsegv in find_same_succ_bb"

2017-07-03  Tom de Vries  

backport from mainline:
2017-07-03  Tom de Vries  

PR tree-optimization/81192
* tree-ssa-tail-merge.c (same_succ_flush_bb): Handle
BB_SAME_SUCC (bb) == NULL.

* gcc.dg/pr81192.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr81192.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-tail-merge.c

[Bug rtl-optimization/81288] New: [5/6/7/8 Regression] ICE on 32-bit BE powerpc targets -w -misel -O2 (-O3, -Ofast, -Os)

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81288

Bug ID: 81288
   Summary: [5/6/7/8 Regression] ICE on 32-bit BE powerpc targets
-w -misel -O2 (-O3, -Ofast, -Os)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: powerpc-*-linux-gnu*, powerpcspe-*-linux-gnu*

gcc from 5 to at least 8.0.0-alpha20170625 snapshot inclusive ICE when
compiling the following snippet w/ -misel -O2 (-O3, -Ofast, -Os):

int
yk (unsigned long long int t4, int f3)
{
  unsigned int *un = (f3 != 0) ? &t4 : 0;

  *un ^= t4;
  if (*un == t4)
f3 = !!t4;

  return f3;
}

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625 -Os -misel -c -w k2ei2ru6.c 
powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625: internal compiler error:
Segmentation fault (program cc1)

gcc 8 demonstrates the following backtrace:

(gdb) where
#0  0x00c26481 in simplify_immed_subreg (outermode=SImode,
op=0x3fff712f480, innermode=DImode, byte=4)
at
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/simplify-rtx.c:5686
Backtrace stopped: Cannot access memory at address 0x3fffbffefd0

And gcc 5.4.0:

(gdb) where 10
#0  0x02aaab00ec7e in vec::vec() ()
#1  0x02aaab00ecee in auto_vec::auto_vec() ()
#2  0x02aaab00e9a2 in df_collection_rec::df_collection_rec() ()
#3  0x02aaab0062ab in df_insn_rescan(rtx_insn*) ()
#4  0x02aaab426c13 in confirm_change_group() ()
#5  0x02aaab426c79 in apply_change_group() ()
#6  0x02aaabb4f43d in ?? ()
#7  0x02aaabb4f8cf in ?? ()
#8  0x02aaabb4f8cf in ?? ()
#9  0x02aaabb4f8cf in ?? ()
(More stack frames follow...)
(gdb) where -20
#190606 0x02aaabb4f8cf in ?? ()
#190607 0x02aaabb5225f in ?? ()
#190608 0x02aaabb52630 in ?? ()
#190609 0x02aaabb589f3 in ?? ()
#190610 0x02aaabb58f4b in ?? ()
#190611 0x02aaabb5b236 in ?? ()
#190612 0x02aaabb5b3c9 in ?? ()
#190613 0x02aaab3ed4b7 in execute_one_pass(opt_pass*) ()
#190614 0x02aaab3ed746 in ?? ()
#190615 0x02aaab3ed777 in ?? ()
#190616 0x02aaab3ed7ee in execute_pass_list(function*, opt_pass*) ()
#190617 0x02fca86e in cgraph_node::expand() ()
#190618 0x02fcad99 in ?? ()
#190619 0x02fcb94d in symbol_table::compile() ()
#190620 0x02fcba8c in symbol_table::finalize_compilation_unit() ()
#190621 0x02e27901 in c_write_global_declarations() ()
#190622 0x02aaab50bcff in ?? ()
#190623 0x02aaab50e6b9 in ?? ()
#190624 0x02aaab50e9cb in toplev::main(int, char**) ()
#190625 0x02aaabcb5b9f in main ()

[Bug c/81289] New: [8 Regression] ICE in libcpp/line-map.c

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81289

Bug ID: 81289
   Summary: [8 Regression] ICE in libcpp/line-map.c
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: powerpc-*-linux-gnu*, powerpcspe-*-linux-gnu*

gcc-8.0.0-alpha20170625 snapshot ICEs most of the time in one of the following
ways when compiling this snippet:

8<

ke ()
{
  mm == *&&

>8

ICE 1:

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625 -w pnr6edbg.c
pnr6edbg.c: In function 'ke':
pnr6edbg.c:3:3: error: 'mm' undeclared (first use in this function)
   mm == *&&
   ^~
pnr6edbg.c:3:3: note: each undeclared identifier is reported only once for each
function it appears in
pnr6edbg.c:3:3: error: expected identifier at end of input
pnr6edbg.c:3:3: internal compiler error: Segmentation fault
0xc5e1f9 crash_signal
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/toplev.c:338
0x14e4064 get_range_from_adhoc_loc
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/libcpp/line-map.c:276
0x14e4064 get_range_from_loc(line_maps*, unsigned int)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/libcpp/line-map.c:287
0x14beffb get_finish
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/input.h:107
0x14beffb make_location(unsigned int, unsigned int, unsigned int)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/input.c:859
0x637cb4 c_parser_unary_expression
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:7014
0x638d87 c_parser_cast_expression
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:6927
0x63960e c_parser_binary_expression
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:6857
0x63a1b7 c_parser_conditional_expression
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:6475
0x63a9b5 c_parser_expr_no_commas
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:6392
0x63ac6d c_parser_expression
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:8623
0x63d363 c_parser_expression_conv
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:8656
0x6506c8 c_parser_statement_after_labels
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:5410
0x6521c4 c_parser_compound_statement_nostart
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:4924
0x65275e c_parser_compound_statement
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:4757
0x64e29a c_parser_declaration_or_fndef
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:2125
0x655dd6 c_parser_external_declaration
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:1469
0x6567f1 c_parser_translation_unit
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:1349
0x6567f1 c_parse_file()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c/c-parser.c:18131
0x6bda82 c_common_parse_file()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/c-family/c-opts.c:1104

ICE 2:

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625 -O2 -w pnr6edbg.c
pnr6edbg.c: In function 'ke':
pnr6edbg.c:3:3: error: 'mm' undeclared (first use in this function)
   mm == *&&
   ^~
pnr6edbg.c:3:3: note: each undeclared identifier is reported only once for each
function it appears in
pnr6edbg.c:3:3: error: expected identifier at end of input
pnr6edbg.c:3:3: internal compiler error: in linemap_macro_map_lookup, at
libcpp/line-map.c:1013
0x14e3f6d linemap_macro_map_lookup
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/libcpp/line-map.c:1013
0x14e3f6d linemap_lookup(line_maps*, unsigned int)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha201

[Bug tree-optimization/81192] [8 Regression] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

--- Comment #17 from Tom de Vries  ---
Author: vries
Date: Mon Jul  3 08:43:40 2017
New Revision: 249899

URL: https://gcc.gnu.org/viewcvs?rev=249899&root=gcc&view=rev
Log:
Backport "Fix sigsegv in find_same_succ_bb"

2017-07-03  Tom de Vries  

backport from mainline:
2017-07-03  Tom de Vries  

PR tree-optimization/81192
* tree-ssa-tail-merge.c (same_succ_flush_bb): Handle
BB_SAME_SUCC (bb) == NULL.

* gcc.dg/pr81192.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr81192.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-tail-merge.c

[Bug tree-optimization/69468] tail merge should ignore private edge flags

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69468

Tom de Vries  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Tom de Vries  ---
Patch with test-case committed.

Marking resolved-fixed.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #3 from Jakub Jelinek  ---
Actually, can't reproduce so far (neither x86_64-linux native, nor cross to
powerpc64le-linux-gnu).

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #4 from Markus Trippelsdorf  ---
(In reply to Jakub Jelinek from comment #3)
> Actually, can't reproduce so far (neither x86_64-linux native, nor cross to
> powerpc64le-linux-gnu).

Yes, it isn't 100% reproducible. Please try the unreduced testcase.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #3 from Arseny Solokha  ---
*** Bug 81284 has been marked as a duplicate of this bug. ***

[Bug bootstrap/81284] [8 Regression] Bootstrap failure for 32-bit powerpc targets

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81284

Arseny Solokha  changed:

   What|Removed |Added

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

--- Comment #1 from Arseny Solokha  ---
Closing in favor of PR81285, as there's already some discussion in the latter.

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

[Bug tree-optimization/81192] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-07-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

Tom de Vries  changed:

   What|Removed |Added

Summary|[8 Regression] gcc ICE at   |gcc ICE at -Os on
   |-Os on x86_64-linux-gnu:|x86_64-linux-gnu:
   |Segmentation fault  |Segmentation fault

--- Comment #18 from Tom de Vries  ---
Patch 1 and 2 committed to trunk. Patch 1 backported to gcc-{5,7}-branch.

Since patch 1 is committed to trunk, this PR is no longer a regression, so
removing '[8 Regression]' from title.

Leaving PR open to backport patch 1 to gcc-6-branch, once it's unfrozen.

[Bug sanitizer/81275] [5/6/7/8 Regression] -fsanitize=thread produce incorrect -Wreturn-type warning

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81275

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
  Known to work||4.9.0
Summary|[gcc7 gcc8] |[5/6/7/8 Regression]
   |-fsanitize=thread produce   |-fsanitize=thread produce
   |incorrect -Wreturn-type |incorrect -Wreturn-type
   |warning |warning
 Ever confirmed|0   |1

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic
   Target Milestone|--- |5.5

--- Comment #1 from Martin Liška  ---
Confirmed, started with r219202.

[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-07-03
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Your testcase cannot be built.  On GIMPLE ShowBug looks ok so the issue must
be at RTL expansion.  _NOTE_ that *(volatile uint32_t*) makes alignment
guarantees to the access while your TimerRegisters struct is aligned at byte
boundary only!  I suppose you may want
__attribute__((__packed__,aligned(alignof(uint32_t)?

[Bug ipa/81277] assert() in multiversioned functions causes compilation error

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81277

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||marxin at gcc dot gnu.org
  Component|c++ |ipa

--- Comment #1 from Richard Biener  ---
wonder if other cloners are similarly affected.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

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

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.4

[Bug c/81289] [8 Regression] ICE in libcpp/line-map.c

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81289

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug rtl-optimization/81288] [5/6/7/8 Regression] ICE on 32-bit BE powerpc targets -w -misel -O2 (-O3, -Ofast, -Os)

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81288

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |5.5

[Bug ipa/81277] assert() in multiversioned functions causes compilation error

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81277

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
I'll take a look.

[Bug ipa/79857] cgraph_node::verify_node should call internal_error instead of error

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79857

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Liška  ---
Looks there's no result from the discussion whether to translate or not
internal messages. Thus I'm unassigning the PR.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #4 from Jan Hubicka  ---
> ../../../gcc/libgcc/libgcov-driver.c: In function ‘gcov_do_dump’:
> ../../../gcc/libgcc/libgcov-driver.c:853:1: error: verify_flow_info:
> REG_BR_PROB is set but cfg probability is not
>  }
>  ^
> during RTL pass: loop2_doloop
> ../../../gcc/libgcc/libgcov-driver.c:853:1: internal compiler error:
> verify_flow_info failed
> 0x1039eeb3 verify_flow_info()
> ../../gcc/gcc/cfghooks.c:259
> 0x107fc44b execute_function_todo
> ../../gcc/gcc/passes.c:2001
> 0x107fd183 do_per_function
> ../../gcc/gcc/passes.c:1655
> 0x107fd403 execute_todo

I suppose loop-doloop.c:add_test needs to maintain profile.
Let me see if I can reproduce it in a cross compiler.

Honza

[Bug other/78366] target_clones does not generate resovler function

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78366

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
  Known to work||8.0
  Known to fail||5.4.0, 6.3.0, 7.1.0

--- Comment #6 from Martin Liška  ---
As discussed in PR81214, the behavior was changed to generate ifunc resolver
even when a target_clone function is not directly used. Please take a look at
r249840.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

Andreas Schwab  changed:

   What|Removed |Added

 Target|ppc64le |powerpc64le-*-*, ia64-*-*

--- Comment #5 from Andreas Schwab  ---
Also broken on ia64.

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

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

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-07-03
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 41666
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41666&action=edit
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.

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-07-03 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #8 from Jan Hubicka  ---
We discussed this on IRC some time ago. The problem is that bb partitioning
seems broken on Darwin. Until the mentioned revision only -fprofile-use enabled
it and thus the bug probably went unnoticed because no-one tests
profiledbootstrap on darwin.

bb-partitioning was developed by apple years ago, so it used to work on Darwin.
it would be useful to figure out what broke and if we can fix it.  Without any
further analysis we would need to simply disable it as follows:

Index: darwin.c
===
--- darwin.c(revision 249872)
+++ darwin.c(working copy)
@@ -3146,29 +3146,9 @@
   && !TARGET_64BIT)
 global_options.x_flag_asynchronous_unwind_tables = 0;

-   /* Disable -freorder-blocks-and-partition when unwind tables are being
-  emitted for Darwin < 9 (OSX 10.5).
-  The strategy is, "Unless the User has specifically set/unset an unwind
-  flag we will switch off -freorder-blocks-and-partition when unwind
tables
-  will be generated".  If the User specifically sets flags... we assume
-  (s)he knows why...  */
-   if (generating_for_darwin_version < 9
-   && global_options_set.x_flag_reorder_blocks_and_partition
-   && ((global_options.x_flag_exceptions   /* User, c++, java */
-   && !global_options_set.x_flag_exceptions)   /* User specified... */
-  || (global_options.x_flag_unwind_tables
-  && !global_options_set.x_flag_unwind_tables)
-  || (global_options.x_flag_non_call_exceptions
-  && !global_options_set.x_flag_non_call_exceptions)
-  || (global_options.x_flag_asynchronous_unwind_tables
-  && !global_options_set.x_flag_asynchronous_unwind_tables)))
-{
-  inform (input_location,
- "-freorder-blocks-and-partition does not work with exceptions "
- "on this architecture");
-  flag_reorder_blocks_and_partition = 0;
-  flag_reorder_blocks = 1;
-}
+  /* Disable flag_reorder_blocks_and_partition as it is broken on Darwin.
+ See PR 81033.  */
+  flag_reorder_blocks_and_partition = 0;

 /* FIXME: flag_objc_sjlj_exceptions is no longer needed since there is
only
one valid choice of exception scheme for each runtime.  */


Looking into the error I suppose problem is:
___cold_sect_of_allocate:
__ZN9__gnu_cxx16bitmap_allocatorIcE8allocateEmPKv.cold.42:

and bit later

___cold_sect_of_allocate:
__ZN9__gnu_cxx16bitmap_allocatorIwE8allocateEm.cold.47:

So perhaps the following fix it?
Index: darwin.c
===
--- darwin.c(revision 249872)
+++ darwin.c(working copy)
@@ -3685,7 +3665,7 @@
 {
   char buf[128];
   snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
-   IDENTIFIER_POINTER (DECL_NAME (decl)));
+   IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
   /* Make sure we pick up all the relevant quotes etc.  */
   assemble_name_raw (fp, (const char *) buf);
   fputs (":\n", fp);

[Bug rtl-optimization/81290] New: [8 Regression] ICE in update_br_prob_note

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81290

Bug ID: 81290
   Summary: [8 Regression] ICE in update_br_prob_note
   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: asolokha at gmx dot com
  Target Milestone: ---

gcc-8.0.0-alpha20170702 snapshot ICEs when compiling the following snippet w/
-O2 -funroll-loops:

int vz;

void
ms (int sw, int cm)
{
  for (vz = 0; vz < 19; ++vz)
{
 fx:
  sw *= 2;
}

  for (;;)
{
  if (sw != 0)
for (;;)
  {
  }
  if (1 / 0 && cm != 0)
goto fx;
}
}

% gcc-8.0.0-alpha20170702 -O2 -funroll-loops -c -w vev3ezql.c   
during RTL pass: loop2_unroll
vev3ezql.c: In function 'ms':
vev3ezql.c:21:1: internal compiler error: Segmentation fault
 }
 ^

(gdb) where
#0  0x0088fc37 in update_br_prob_note(basic_block_def*) ()
#1  0x00bc2cb9 in force_edge_cold(edge_def*, bool) ()
#2  0x00bc2c6e in force_edge_cold(edge_def*, bool) ()
#3  0x00bc2c6e in force_edge_cold(edge_def*, bool) ()
#4  0x00889800 in duplicate_loop_to_header_edge(loop*, edge_def*,
unsigned int, simple_bitmap_def*, edge_def*, vec*,
int) ()
#5  0x00b0a747 in unroll_loops(int) ()
#6  0x00af92a0 in (anonymous
namespace)::pass_rtl_unroll_loops::execute(function*) ()
#7  0x00bac04a in execute_one_pass(opt_pass*) ()
#8  0x00bac8f4 in execute_pass_list_1(opt_pass*) ()
#9  0x00bac915 in execute_pass_list_1(opt_pass*) ()
#10 0x00bac915 in execute_pass_list_1(opt_pass*) ()
#11 0x00bac939 in execute_pass_list(function*, opt_pass*) ()
#12 0x008ac7c0 in cgraph_node::expand() ()
#13 0x008adb91 in symbol_table::compile() [clone .part.54] ()
#14 0x008afecd in symbol_table::finalize_compilation_unit() ()
#15 0x00c87e88 in compile_file() ()
#16 0x0072f5c7 in toplev::main(int, char**) ()
#17 0x0073155b in main ()

Maybe related to the recent REG_BR_PROB fallout?

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #5 from Jakub Jelinek  ---
The bisection looks weird, that is the point before which the unreduced
testcase obviously will fail to compile, but that doesn't mean it is the point
where the -fcompare-debug bug has been introduced.

[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&action=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 debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #6 from Markus Trippelsdorf  ---
(In reply to Jakub Jelinek from comment #5)
> The bisection looks weird, that is the point before which the unreduced
> testcase obviously will fail to compile, but that doesn't mean it is the
> point where the -fcompare-debug bug has been introduced.

Yes. Maybe just try to configure LLVM with -O3 and then run 
"GCC_COMPARE_DEBUG=1 ninja" (this is how I came accross the testcase).
And then use the full failing gcc command for bisection.

I will give it a try later.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #7 from Jakub Jelinek  ---
Anyway, I've reproduced it on x86_64-linux with the unreduced testcase, trying
to find which pass starts the differences on
_ZNK4llvm12DenseMapBaseINS_8DenseMapIPNS_26DIGlobalVariableExpressionENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS2_EENS4_12DenseSetPairIS3_S3_S5_S7_S9_E15LookupBucketForIS3_EEbRKT_RPKS9_

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #8 from Jakub Jelinek  ---
Seems to be between loop and loopinit passes, will need to watch carefully the
SSA_NAME freeing.

[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/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #6 from Jan Hubicka  ---
Hi,
does the following patch fix ppc/ia64 (I have checked that it fixes the
arm testcase mentioned earlier).

honza

Index: loop-doloop.c
===
--- loop-doloop.c   (revision 249885)
+++ loop-doloop.c   (working copy)
@@ -347,6 +347,8 @@ add_test (rtx cond, edge *e, basic_block
   rtx op0 = XEXP (cond, 0), op1 = XEXP (cond, 1);
   enum rtx_code code = GET_CODE (cond);
   basic_block bb;
+  /* The jump is supposed to handle an unlikely special case.  */
+  profile_probability prob = profile_probability::very_unlikely ();

   mode = GET_MODE (XEXP (cond, 0));
   if (mode == VOIDmode)
@@ -357,7 +359,7 @@ add_test (rtx cond, edge *e, basic_block
   op1 = force_operand (op1, NULL_RTX);
   label = block_label (dest);
   do_compare_rtx_and_jump (op0, op1, code, 0, mode, NULL_RTX, NULL, label,
-  profile_probability::uninitialized ());
+  prob);

   jump = get_last_insn ();
   if (!jump || !JUMP_P (jump))
@@ -387,12 +389,14 @@ add_test (rtx cond, edge *e, basic_block

   JUMP_LABEL (jump) = label;

-  /* The jump is supposed to handle an unlikely special case.  */
-  add_int_reg_note (jump, REG_BR_PROB, 0);
-
   LABEL_NUSES (label)++;

-  make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
+  edge e2 = make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
+  e2->probability = prob;
+  e2->count = e2->src->count.apply_probability (prob);
+  (*e)->probability = prob.invert ();
+  (*e)->count = (*e)->count.apply_probability (prob);
+  update_br_prob_note (e2->src);
   return true;
 }

[Bug tree-optimization/81292] New: [8 regression] ICE in zero_length_string, at tree-ssa-strlen.c:822

2017-07-03 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81292

Bug ID: 81292
   Summary: [8 regression] ICE in zero_length_string, at
tree-ssa-strlen.c:822
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r249632 PASS
r249892 FAIL

$ cat x.ii
extern "C" unsigned long strlen(const char *);
int a(char *b) {
  b[strlen(b)] = b[strlen(b)] = ' ';
  return 0;
}

$ /usr/local/gcc_current/bin/g++ -fpreprocessed -O2 -c x.ii
during GIMPLE pass: strlen
x.ii: In function ‘int a(char*)’:
x.ii:2:5: internal compiler error: in zero_length_string, at
tree-ssa-strlen.c:822
 int a(char *b) {
 ^
0x7b5ca9 zero_length_string
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:822
0x1252dfa handle_pointer_plus
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:2175
0x1252dfa strlen_optimize_stmt
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:2546
0x1253641 strlen_dom_walker::before_dom_children(basic_block_def*)
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:2728
0x186f85a dom_walker::walk(basic_block_def*)
/home/dimhen/src/gcc_current/gcc/domwalk.c:265
0x124dc5a execute
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:2800
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.


$ /usr/local/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=generic
Thread model: posix
gcc version 8.0.0 20170703 (experimental) [trunk revision 249892] (GCC)

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

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

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #3 from Eric Botcazou  ---
> Untested fix.  gpc_reg_operand allows in some cases a SUBREG of a REG, but
> REGNO is not valid in that case.

Right, Segher forgot to backport his fixlet:
  https://gcc.gnu.org/ml/gcc-cvs/2017-06/msg00448.html

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

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #4 from Jakub Jelinek  ---
Reassigning to Segher then.

[Bug tree-optimization/81292] [8 regression] ICE in zero_length_string, at tree-ssa-strlen.c:822

2017-07-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81292

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #9 from Martin Liška  ---
(In reply to Jakub Jelinek from comment #5)
> The bisection looks weird, that is the point before which the unreduced
> testcase obviously will fail to compile, but that doesn't mean it is the
> point where the -fcompare-debug bug has been introduced.

Ok, I'll try to do it with original test-case to find a culprit revision.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #10 from Markus Trippelsdorf  ---
(In reply to Martin Liška from comment #9)
> (In reply to Jakub Jelinek from comment #5)
> > The bisection looks weird, that is the point before which the unreduced
> > testcase obviously will fail to compile, but that doesn't mean it is the
> > point where the -fcompare-debug bug has been introduced.
> 
> Ok, I'll try to do it with original test-case to find a culprit revision.

No need to. I'm one step away from final bisection...

[Bug sanitizer/81040] asan false negative if parameter of a global function passed by reference

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81040

--- Comment #13 from Martin Liška  ---
Author: marxin
Date: Mon Jul  3 11:48:47 2017
New Revision: 249903

URL: https://gcc.gnu.org/viewcvs?rev=249903&root=gcc&view=rev
Log:
ASAN: handle addressable params (PR sanitize/81040).

2017-07-03  Martin Liska  

PR sanitize/81040
* g++.dg/asan/function-argument-1.C: New test.
* g++.dg/asan/function-argument-2.C: New test.
* g++.dg/asan/function-argument-3.C: New test.
2017-07-03  Martin Liska  

PR sanitize/81040
* sanopt.c (rewrite_usage_of_param): New function.
(sanitize_rewrite_addressable_params): Likewise.
(pass_sanopt::execute): Call rewrite_usage_of_param.

Added:
trunk/gcc/testsuite/g++.dg/asan/function-argument-1.C
trunk/gcc/testsuite/g++.dg/asan/function-argument-2.C
trunk/gcc/testsuite/g++.dg/asan/function-argument-3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/extend.texi
trunk/gcc/sanopt.c
trunk/gcc/testsuite/ChangeLog

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #11 from Markus Trippelsdorf  ---
Unfortunately the bisection was unsuccessful (no wonder
given that the failure is not 100% reproducible (GC related)).

[Bug sanitizer/81040] asan false negative if parameter of a global function passed by reference

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81040

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Martin Liška  ---
Fixed on trunk.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #7 from Markus Trippelsdorf  ---
Yes, your patch fixes the problem. Thanks.

[Bug tree-optimization/81292] [8 regression] ICE in zero_length_string, at tree-ssa-strlen.c:822

2017-07-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81292

--- Comment #2 from Marek Polacek  ---
Likely r249880.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #12 from Martin Liška  ---
(In reply to Markus Trippelsdorf from comment #11)
> Unfortunately the bisection was unsuccessful (no wonder
> given that the failure is not 100% reproducible (GC related)).

Well, I can help you with that. Any idea which value of ggc-min-heapsize to
select in order to have it "more" bisection stable?

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #13 from Markus Trippelsdorf  ---
(In reply to Martin Liška from comment #12)
> (In reply to Markus Trippelsdorf from comment #11)
> > Unfortunately the bisection was unsuccessful (no wonder
> > given that the failure is not 100% reproducible (GC related)).
> 
> Well, I can help you with that. Any idea which value of ggc-min-heapsize to
> select in order to have it "more" bisection stable?

--param ggc-min-expand=0 --param ggc-min-heapsize=0 would be best, but it 
will of course take ages on the unreduced testcase.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #14 from Martin Liška  ---
Well, I've just noticed that the revision I identified is problematic because
of compilation errors like:

/home/trippels/gcc_test/usr/local/include/c++/8.0.0/type_traits:143:12: error:
‘value’ is not a member of
‘std::is_constructible,
llvm::detail::DenseSetPair, false>,
llvm::DenseMapIterator,
llvm::detail::DenseSetPair, false>&&>’

... and not because of debug compare.
Can you please do a pre-processed file with a bit older compiler in order to
bisect over the revision?

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #8 from Jan Hubicka  ---
Author: hubicka
Date: Mon Jul  3 12:17:59 2017
New Revision: 249904

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

PR bootstrap/81285
* loop-doloop.c (add_test): Update profile.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-doloop.c

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #15 from Markus Trippelsdorf  ---
(In reply to Martin Liška from comment #14)
> Well, I've just noticed that the revision I identified is problematic
> because of compilation errors like:
> 
> /home/trippels/gcc_test/usr/local/include/c++/8.0.0/type_traits:143:12:
> error: ‘value’ is not a member of
> ‘std::is_constructible llvm::detail::DenseSetEmpty, llvm::MDNodeInfo,
> llvm::detail::DenseSetPair, false>,
> llvm::DenseMapIterator llvm::MDNodeInfo,
> llvm::detail::DenseSetPair, false>&&>’
> 
> ... and not because of debug compare.
> Can you please do a pre-processed file with a bit older compiler in order to
> bisect over the revision?

See above. Simply build LLVM trunk (release build) with gcc using
GCC_COMPARE_DEBUG=1.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #9 from Arseny Solokha  ---
Maybe it's also worthwhile to commit testcase from PR81284?

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

--- Comment #10 from Markus Trippelsdorf  ---
(In reply to Arseny Solokha from comment #9)
> Maybe it's also worthwhile to commit testcase from PR81284?

I don't think this is necessary because the ICEs when building libgcc, even
with
--disable-bootstrap, are obvious enough.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Markus Trippelsdorf  ---
Fixed.

[Bug rtl-optimization/81290] [8 Regression] ICE in update_br_prob_note

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81290

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-03
 CC||hubicka at ucw dot cz,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Also started with r249800.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #16 from Jakub Jelinek  ---
Seems a different order in release_ssa_name in that function, in one case it is
198, 2, 199, 23, 40, in the other case 199, 2, 40, 23, 198.  Used
--- tree-ssanames.c.xx  2017-07-01 10:15:12.0 +0200
+++ tree-ssanames.c 2017-07-03 14:43:13.278636615 +0200
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.
 #include "stor-layout.h"
 #include "tree-into-ssa.h"
 #include "tree-ssa.h"
+#include "tree-pretty-print.h"

 /* Rewriting a function into SSA form can create a huge number of SSA_NAMEs,
many of which may be thrown away shortly after their creation if jumps
@@ -309,6 +310,14 @@ make_ssa_name_fn (struct function *fn, t
   else
 SSA_NAME_RANGE_INFO (t) = NULL;

+{
+FILE *f = fopen ("/tmp/ssanames", "a");
+fprintf (f, "@@@make_ssa_name ");
+print_generic_expr (f, t, TDF_VOPS|TDF_MEMSYMS);
+fprintf (f, " %s\n", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
(current_function_decl)));
+fclose (f);
+}
+
   SSA_NAME_IN_FREE_LIST (t) = 0;
   SSA_NAME_IS_DEFAULT_DEF (t) = 0;
   imm = &(SSA_NAME_IMM_USE_NODE (t));
@@ -560,6 +569,14 @@ release_ssa_name_fn (struct function *fn
   int saved_ssa_name_version = SSA_NAME_VERSION (var);
   use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));

+{
+FILE *f = fopen ("/tmp/ssanames", "a");
+fprintf (f, "@@@release_ssa_name ");
+print_generic_expr (f, var, TDF_VOPS|TDF_MEMSYMS);
+fprintf (f, " %s\n", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
(current_function_decl)));
+fclose (f);
+}
+
   if (MAY_HAVE_DEBUG_STMTS)
insert_debug_temp_for_var_def (NULL, var);

hack to find that out.  Now to debug where those release_ssa_name calls come
from and what is the difference.

[Bug rtl-optimization/81290] [8 Regression] ICE in update_br_prob_note

2017-07-03 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81290

Jan Hubicka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||hubicka at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org

--- Comment #2 from Jan Hubicka  ---
this is bug in threadupdate which makes count to be reliably zero while it is
just result of misupdate and another bug in force_edge_cold that does not know
how to give up on entry block.  I am testing fix.

[Bug fortran/80751] NULL pointer dereferencing in gfc_trans_call on compiling call to an elemental procedure (trunk 247930)

2017-07-03 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80751

--- Comment #7 from Vittorio Zecca  ---
After downloading trunk 249883 I can confirm the bug disappeared.

[Bug tree-optimization/81292] [8 regression] ICE in zero_length_string, at tree-ssa-strlen.c:822

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81292

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[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-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81291

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |5.5

[Bug rtl-optimization/81290] [8 Regression] ICE in update_br_prob_note

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81290

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug c++/81293] New: sanitized g++ crashes heap-use-after-free gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:543 in printf_common

2017-07-03 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81293

Bug ID: 81293
   Summary: sanitized g++ crashes heap-use-after-free
gcc/libsanitizer/sanitizer_common/sanitizer_common_int
erceptors_format.inc:543 in printf_common
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zeccav at gmail dot com
  Target Milestone: ---

// in trunk 249883
// from devirt-45.C
// compile with -fdump-ipa-inline-details -fno-early-inlining -O2 
// SUMMARY: AddressSanitizer: heap-use-after-free
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:543
in printf_common
struct A {
  virtual int foo () {return 1;}
  int wrapfoo () {foo();}
  A() {wrapfoo();}
};
inline void* operator new(__SIZE_TYPE__ s, void* buf) throw() {
   return buf;
}
struct B:A {virtual int foo () {return 2;}};

static void
test (struct A *a)
{
  static_cast(a)->~B();
  new(a) B();
}

main()
{
  struct B a;
  test (&a);
}
/*=
==10147==ERROR: AddressSanitizer: heap-use-after-free on address 0x60272470
at pc 0x2b6feac184fb bp 0x7ffcd9ff38e0 sp 0x7ffcd9ff3090
READ of size 2 at 0x60272470 thread T0
#0 0x2b6feac184fa in printf_common
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:543
#1 0x2b6feac534ff in __asan::ErrorDescription::Print()
../../../../gcc/libsanitizer/asan/asan_errors.h:360
#2 0x2b6feac534ff in __asan::ScopedInErrorReport::~ScopedInErrorReport()
../../../../gcc/libsanitizer/asan/asan_report.cc:167
#3 0x2b6feac534ff in __asan::ReportGenericError(unsigned long, unsigned
long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool)
../../../../gcc/libsanitizer/asan/asan_report.cc:397
#4 0x2b6feac1832b in printf_common
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:543
#5 0x2b6feac1925b in __interceptor_vfprintf
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1328
#6 0x2b6feac19326 in __interceptor_fprintf
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1373
#7 0x53ab70c in inline_small_functions ../../gcc/gcc/ipa-inline.c:2048
#8 0x53b10a5 in ipa_inline ../../gcc/gcc/ipa-inline.c:2429
#9 0x53b3fb8 in execute ../../gcc/gcc/ipa-inline.c:2835
#10 0x2833dc7 in execute_one_pass(opt_pass*) ../../gcc/gcc/passes.c:2492
#11 0x28384cc in execute_ipa_pass_list(opt_pass*)
../../gcc/gcc/passes.c:2927
#12 0x178ae2d in ipa_passes ../../gcc/gcc/cgraphunit.c:2388
#13 0x178be18 in symbol_table::compile() ../../gcc/gcc/cgraphunit.c:2474
#14 0x178cec5 in symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2633
#15 0x2dbbe22 in compile_file ../../gcc/gcc/toplev.c:493
#16 0x2dc3f8a in do_compile ../../gcc/gcc/toplev.c:2021
#17 0x2dc49aa in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2155
#18 0x56b3cbe in main ../../gcc/gcc/main.c:39
#19 0x2b6fed475400 in __libc_start_main (/usr/lib64/libc.so.6+0x20400)
#20 0x78a619 in _start
(/home/vitti/1tb/vitti/local/gcc-249691-sanitized/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/cc1plus+0x78a619)

0x60272470 is located 0 bytes inside of 7-byte region
[0x60272470,0x60272477)
freed by thread T0 here:
#0 0x2b6feac49088 in __interceptor_free
../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:45
#1 0x11611c1 in cxx_printable_name_internal ../../gcc/gcc/cp/tree.c:2544
#2 0x116153a in cxx_printable_name(tree_node*, int)
../../gcc/gcc/cp/tree.c:2555
#3 0x16fbf9e in symtab_node::name() const ../../gcc/gcc/symtab.c:522
#4 0x53ab69b in inline_small_functions ../../gcc/gcc/ipa-inline.c:2048
#5 0x53b10a5 in ipa_inline ../../gcc/gcc/ipa-inline.c:2429
#6 0x53b3fb8 in execute ../../gcc/gcc/ipa-inline.c:2835
#7 0x2833dc7 in execute_one_pass(opt_pass*) ../../gcc/gcc/passes.c:2492
#8 0x28384cc in execute_ipa_pass_list(opt_pass*)
../../gcc/gcc/passes.c:2927
#9 0x178ae2d in ipa_passes ../../gcc/gcc/cgraphunit.c:2388
#10 0x178be18 in symbol_table::compile() ../../gcc/gcc/cgraphunit.c:2474
#11 0x178cec5 in symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2633
#12 0x2dbbe22 in compile_file ../../gcc/gcc/toplev.c:493
#13 0x2dc3f8a in do_compile ../../gcc/gcc/toplev.c:2021
#14 0x2dc49aa in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2155
#15 0x56b3cbe in main ../../gcc/gcc/main.c:39
#16 0x2b6fed475400 in __libc_start_main (/usr/lib64/libc.so.6+0x20400)

previously allocated by thread T0 here:
#0 0x2b6feac493aa in __interceptor_malloc
../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:62
#1 0x595d890 in xmalloc ../../gcc/libiberty/xmalloc.c:147
#2 0x595db2f

[Bug sanitizer/81040] asan false negative if parameter of a global function passed by reference

2017-07-03 Thread ryabinin.a.a at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81040

--- Comment #15 from Andrey Ryabinin  ---
(In reply to Martin Liška from comment #14)
> Fixed on trunk.

Thanks.

However there is slight problem with this. Instrumentation is missing without
-fsanitize-address-use-after-scope option.
IMO, it should depend only on --param asan-stack=1.

So the following doesn't produce any output:
gcc -fsanitize=address -fno-sanitize-address-use-after-scope -O2 asan_test.c &&
./a.out

Can we fix this?

[Bug ipa/81214] GCC target_clone support does not work for global functions with no references

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81214

--- Comment #7 from Martin Liška  ---
(In reply to Dominique d'Humieres from comment #6)
> At revision r249851 I see the following regression on darwin
> 
> FAIL: gcc.target/i386/mvc6.c (test for excess errors)
> UNRESOLVED: gcc.target/i386/mvc6.c scan-assembler punpcklbw
> UNRESOLVED: gcc.target/i386/mvc6.c scan-assembler vpshufb
> 
> % gcc8 -c -O3 /opt/gcc/_clean/gcc/testsuite/gcc.target/i386/mvc6.c
> /opt/gcc/_clean/gcc/testsuite/gcc.target/i386/mvc6.c:8:1: error: the call
> requires ifunc, which is not supported by this target
>  foo(char *in, char *out, int size)
>  ^~~
> 
> I suspect this to be caused by revision r249840.

Fixed by Rainer's commit r249912.

[Bug tree-optimization/60510] SLP blocks loop vectorization (with reduction)

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60510

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Mon Jul  3 13:44:13 2017
New Revision: 249919

URL: https://gcc.gnu.org/viewcvs?rev=249919&root=gcc&view=rev
Log:
2017-07-03  Richard Biener  

PR tree-optimization/60510
* tree-vect-loop.c (vect_create_epilog_for_reduction): Pass in
the scalar reduction PHI and use it.
(vectorizable_reduction): Properly guard the single_defuse_cycle
path for non-SLP reduction chains where we cannot use it.
Rework reduc_def/index and vector type deduction.  Rework
vector operand gathering during reduction op code-gen.
* tree-vect-slp.c (vect_analyze_slp): For failed SLP reduction
chains dissolve the chain and leave it to non-SLP reduction
handling.

* gfortran.dg/vect/pr60510.f: New testcase.

Added:
trunk/gcc/testsuite/gfortran.dg/vect/pr60510.f
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-loop.c
trunk/gcc/tree-vect-slp.c

[Bug tree-optimization/60510] SLP blocks loop vectorization (with reduction)

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60510

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #7 from Richard Biener  ---
Fixed for GCC 8.

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-07-03 Thread egall at gwmail dot gwu.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #9 from Eric Gallager  ---
(In reply to Jan Hubicka from comment #8)
> 
> 
> Looking into the error I suppose problem is:
> ___cold_sect_of_allocate:
> __ZN9__gnu_cxx16bitmap_allocatorIcE8allocateEmPKv.cold.42:
> 
> and bit later
> 
> ___cold_sect_of_allocate:
> __ZN9__gnu_cxx16bitmap_allocatorIwE8allocateEm.cold.47:
> 
> So perhaps the following fix it?
> Index: darwin.c
> ===
> --- darwin.c  (revision 249872)
> +++ darwin.c  (working copy)
> @@ -3685,7 +3665,7 @@
>  {
>char buf[128];
>snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
> - IDENTIFIER_POINTER (DECL_NAME (decl)));
> + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
>/* Make sure we pick up all the relevant quotes etc.  */
>assemble_name_raw (fp, (const char *) buf);
>fputs (":\n", fp);

I tried this patch; bootstrap still fails for me, albeit on a different file
now. New error message is:

/private/var/root/gcc-git/my_oddly_named_builddir/./prev-gcc/xg++
-B/private/var/root/gcc-git/my_oddly_named_builddir/./prev-gcc/
-B/usr/local/i386-apple-darwin9.8.0/bin/ -nostdinc++
-B/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/src/.libs
-B/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs

-I/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/include/i386-apple-darwin9.8.0

-I/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/include
 -I/private/var/root/gcc-git/libstdc++-v3/libsupc++
-L/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/src/.libs
-L/private/var/root/gcc-git/my_oddly_named_builddir/prev-i386-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs
-fno-PIE -c   -g -O2 -mdynamic-no-pic  -gtoggle -DIN_GCC -fPIC   
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include
-I/private/var/root/gcc-git/my_oddly_named_builddir/./gmp
-I/private/var/root/gcc-git/gmp
-I/private/var/root/gcc-git/my_oddly_named_builddir/./mpfr/src
-I/private/var/root/gcc-git/mpfr/src -I/private/var/root/gcc-git/mpc/src 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace
-I/private/var/root/gcc-git/my_oddly_named_builddir/./isl/include
-I/private/var/root/gcc-git/isl/include -I/usr/local/include -o
gimple-ssa-store-merging.o -MT gimple-ssa-store-merging.o -MMD -MP -MF
./.deps/gimple-ssa-store-merging.TPo ../../gcc/gimple-ssa-store-merging.c
cc1plus: warning: ‘-mdynamic-no-pic’ overrides ‘-fpic’, ‘-fPIC’, ‘-fpie’ or
‘-fPIE’
/var/tmp//cc2wwOg4.s:2529:FATAL:Symbol
___cold_sect_of__ZN10hash_tableIN8hash_mapI17tree_operand_hashPN12_GLOBAL__N_120imm_store_chain_infoE21simple_hashmap_traitsI19d
already defined.
make[3]: *** [gimple-ssa-store-merging.o] Error 1
make[3]: Leaving directory
`/private/var/root/gcc-git/my_oddly_named_builddir/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/private/var/root/gcc-git/my_oddly_named_builddir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/private/var/root/gcc-git/my_oddly_named_builddir'
make: *** [all] Error 2

[Bug tree-optimization/53947] [meta-bug] vectorizer missed-optimizations

2017-07-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
Bug 53947 depends on bug 60510, which changed state.

Bug 60510 Summary: SLP blocks loop vectorization (with reduction)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60510

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug sanitizer/81040] asan false negative if parameter of a global function passed by reference

2017-07-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81040

Martin Liška  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #16 from Martin Liška  ---
(In reply to Andrey Ryabinin from comment #15)
> (In reply to Martin Liška from comment #14)
> > Fixed on trunk.
> 
> Thanks.
> 
> However there is slight problem with this. Instrumentation is missing without
> -fsanitize-address-use-after-scope option.
> IMO, it should depend only on --param asan-stack=1.
> 
> So the following doesn't produce any output:
> gcc -fsanitize=address -fno-sanitize-address-use-after-scope -O2 asan_test.c
> && ./a.out
> 
> Can we fix this?

It's mistake! I've got patch for that and will send it tomorrow.

[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal

2017-07-03 Thread ldeboer at gateway dot net.au
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273

--- Comment #3 from LdB  ---
I am stunned you could not build the code the only requirement is you include
the stdint.h so the uint32_t types are defined. I will fix the typos are you
really saying you can't compile this?

#include 
struct __attribute__((__packed__)) TimerRegisters {
volatile uint32_t Load; //0x00
volatile uint32_t Value; //0x04
};

uint32_t base_addr = 0x3F00;
#define TIMER ((struct TimerRegisters*)(base_addr + 0xB400))

void ShowBug (void){
   TIMER->Load =  0x400; // -02 compile and look at code
}

void ShowFix1 (void){
*(volatile uint32_t*)TIMER->Load =  0x400;
}

void ShowFix2 (void){
volatile uint32_t temp = 0x400;
TIMER->Load =  temp;
}

Alignment is not really a concern it's a hardware register to the CPU so it's a
given.

[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal

2017-07-03 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273

--- Comment #4 from Richard Earnshaw  ---
(In reply to LdB from comment #3)
> I am stunned you could not build the code the only requirement is you
> include the stdint.h so the uint32_t types are defined. I will fix the typos
> are you really saying you can't compile this?
> 

Most compiler developers do not install a complete build environment when
testing bugs.  As such, they do not have the headers available.  This is why
our bug reporting rules ask you to post _preprocessed_ source code.

You've also failed to give:

The options used to configure the compiler when you built it (see the output of
gcc -v).

The list of options you passed to the compiler when running it.  We can only
infer -O2 from your comments.

> Alignment is not really a concern it's a hardware register to the CPU so
> it's a given.

Absolutely alignment is the issue here.  Packed says that the object can be on
any alignment boundary and that materially affects the compiler's behaviour
here.

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-07-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #10 from Dominique d'Humieres  ---
The last patch in comment 8 exposes another problem: buf[128] is too small.

The following patch which uses the trick proposed in IRC by Richi to split
assemble_name_raw seems to work

--- ../_clean/gcc/config/darwin.c   2017-01-01 17:39:06.0 +0100
+++ gcc/config/darwin.c 2017-07-03 14:21:19.0 +0200
@@ -3683,11 +3683,9 @@ default_function_sections:
 void
 darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
 {
-  char buf[128];
-  snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
-   IDENTIFIER_POINTER (DECL_NAME (decl)));
   /* Make sure we pick up all the relevant quotes etc.  */
-  assemble_name_raw (fp, (const char *) buf);
+  assemble_name_raw (fp, new_is_cold?"__cold_sect_of_":"__hot_sect_of_");
+  assemble_name_raw (fp, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
   fputs (":\n", fp);
 }

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-07-03 Thread simon at pushface dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

simon at pushface dot org changed:

   What|Removed |Added

 CC||simon at pushface dot org

--- Comment #11 from simon at pushface dot org ---
(In reply to Jan Hubicka from comment #8)

> Looking into the error I suppose problem is:
> ___cold_sect_of_allocate:
> __ZN9__gnu_cxx16bitmap_allocatorIcE8allocateEmPKv.cold.42:
> 
> and bit later
> 
> ___cold_sect_of_allocate:
> __ZN9__gnu_cxx16bitmap_allocatorIwE8allocateEm.cold.47:
> 
> So perhaps the following fix it?
> Index: darwin.c
> ===
> --- darwin.c  (revision 249872)
> +++ darwin.c  (working copy)
> @@ -3685,7 +3665,7 @@
>  {
>char buf[128];
>snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
> - IDENTIFIER_POINTER (DECL_NAME (decl)));
> + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
>/* Make sure we pick up all the relevant quotes etc.  */
>assemble_name_raw (fp, (const char *) buf);
>fputs (":\n", fp);

No; bootstrapping from 7.1.0,

/var/folders/_q/fvnxz46903z9hjh38fz0lyhmgs/T//ccCIgbl7.s:34470:1: error:
invalid symbol redefinition
___cold_sect_of__ZNKSt7__cxx119money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES4_S4_bRSt8ios_baseRSt12_Ios_Iost:
^
make[6]: *** [cxx11-locale-inst.lo] Error 1
make[6]: *** Waiting for unfinished jobs
/var/folders/_q/fvnxz46903z9hjh38fz0lyhmgs/T//cc6MyXXO.s:33909:1: error:
invalid symbol redefinition
___cold_sect_of__ZNKSt7__cxx119money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES4_S4_bRSt8ios_baseRSt12_Ios_Iost:
^
make[6]: *** [cxx11-wlocale-inst.lo] Error 1

[Bug ipa/81214] GCC target_clone support does not work for global functions with no references

2017-07-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81214

--- Comment #8 from Dominique d'Humieres  ---
> Fixed by Rainer's commit r249912.

Is this a real fix? IMO introducing ifunc on targets that do not support it
does not look as a good idea!-(

[Bug target/70676] suboptimal code generation on AVR

2017-07-03 Thread night_ghost at ykoctpa dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70676

night_ghost at ykoctpa dot ru changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #9 from night_ghost at ykoctpa dot ru ---
Really this is a best way to fix bugs! Just ignore them - like an ostrich,
hiding  head in the sand.

[Bug debug/81278] [8 Regression] -fcompare-debug failure (length)

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81278

--- Comment #17 from Jakub Jelinek  ---
So, I believe this has been introduced in r244974 from PR71433.
We have 5 asserts for SSA_NAME 66 in the problematic function:
(gdb) p *asserts.m_auto.m_vecdata[0]
$49 = {bb = , e = 
37)>, si = {ptr = 0x7fffd37523c0, seq = 0x7fffd6407588, 
bb = }, comp_code = EQ_EXPR, val =
, expr = , 
  next = 0x3a29bc0}
(gdb) p *asserts.m_auto.m_vecdata[1]
$50 = {bb = , e = 
37)>, si = {ptr = 0x7fffd3752230, seq = 0x7fffd6407450, 
bb = }, comp_code = EQ_EXPR, val =
, expr = , 
  next = 0x3a29c10}
(gdb) p *asserts.m_auto.m_vecdata[2]
$51 = {bb = , e = 
14)>, si = {ptr = 0x7fffd3752230, seq = 0x7fffd6407450, 
bb = }, comp_code = NE_EXPR, val =
, expr = , 
  next = 0x3a29c60}
(gdb) p *asserts.m_auto.m_vecdata[3]
$52 = {bb = , e = 
37)>, si = {ptr = 0x7fffd37521e0, seq = 0x7fffd6407178, 
bb = }, comp_code = EQ_EXPR, val =
, expr = , 
  next = 0x3a29cb0}
(gdb) p *asserts.m_auto.m_vecdata[4]
$53 = {bb = , e = 
13)>, si = {ptr = 0x7fffd37521e0, seq = 0x7fffd6407178, 
bb = }, comp_code = NE_EXPR, val =
, expr = , next = 0x0}
and the new compare_assert_loc first sorts on !a->e != !b->e, then on
destination index (both are fine for -fcompare-debug), but then
on iterative_hash_expr (a->expr, iterative_hash_expr (a->val, 0)) vs.
iterative_hash_expr (b->expr, iterative_hash_expr (b->val, 0));
which is not ok, because the two val values are ADDR_EXPR of a helper variable
which has different DECL_UID between -g and -g0.

Let me try to fix this by doing another qsort afterwards which ignores the hash
and just uses edge indexes.

[Bug rtl-optimization/81290] [8 Regression] ICE in update_br_prob_note

2017-07-03 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81290

--- Comment #3 from Jan Hubicka  ---
Author: hubicka
Date: Mon Jul  3 14:40:46 2017
New Revision: 249924

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

PR middle-end/81290
* predict.c (force_edge_cold): Be more careful about propagation
backward.
* profile-count.h (profile_probability::guessed,
profile_probability::fdo, profile_count::guessed, profile_count::fdo):
New.
* tree-ssa-threadupdate.c (recompute_probabilities): Result is guessed.

* gcc.c-torture/compile/pr81290.c: New.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr81290.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/predict.c
trunk/gcc/profile-count.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadupdate.c

[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal

2017-07-03 Thread ldeboer at gateway dot net.au
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273

--- Comment #5 from LdB  ---
Okay I understand all that and accept my apology and I will try to follow the
rules exactly in future.

I had to change the alignment command slightly to be valid on ARM 6.3.1
struct __attribute__((__packed__,aligned(__alignof(uint32_tTimerRegisters {
volatile uint32_t Load; //0x00
volatile uint32_t Value; //0x04
};

I am getting viable code with that, so it's undeniable it is an alignment
issue.

I am happy to have that as the solution and I understand it is the most
technically correct. It probably needs to be added to the manual because I
suspect it is going to come up a lot. I have never had the compiler spit
unaligned code as the most optimized code before.

[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal

2017-07-03 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273

Richard Earnshaw  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #6 from Richard Earnshaw  ---
The compiler gave you what you asked for (though it might not have been what
you wanted, or even expected).  Optimization is irrelevant here.

Just because the address you finally assigned to the structure was aligned
doesn't mean that the compiler can change the access pattern for a volatile
object.  You'd hardly expect that changing base_addr to 0x3f01 would change
the sequence of loads and stores generated, surely?  And don't forget that
unaligned accesses to DEVICE memory are undefined.

[Bug c/40528] Add a new ifunc attribute

2017-07-03 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40528

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #18 from Jeffrey A. Law  ---
Fixed long ago.

[Bug target/70676] suboptimal code generation on AVR

2017-07-03 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70676

Georg-Johann Lay  changed:

   What|Removed |Added

 Status|REOPENED|WAITING

--- Comment #10 from Georg-Johann Lay  ---
(In reply to night_ghost from comment #9)
> Really this is a best way to fix bugs! Just ignore them - like an ostrich,
> hiding  head in the sand.

I just requested some information as outlines in the bug reporting
instructions.

That you have the information available does not mean I can guess it by magic,
and guessing has turned out to be extremely ineffective, time consuming and
often enough it comes up with guesses that completely diverge from a bug
reportes intention.

At some point I just stopped digging into your stuff and requested some more
information.

Yust the fact that you are not able or not willing to provide that information
does not mean it's nor required.

[Bug c/81294] New: _subborrow_u64 argument order inconsistent with intrinsic reference, icc

2017-07-03 Thread andreser-gccbugs at mit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81294

Bug ID: 81294
   Summary: _subborrow_u64 argument order inconsistent with
intrinsic reference, icc
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andreser-gccbugs at mit dot edu
  Target Milestone: ---

gcc expects _subborrow_u64 arguments in a different order than the one
described in intel intrinsics reference and implemented by icc. I couldn't find
any documentation about it, so I am writing this issue under the presumption it
is not intentional.

The two full-width input arguments are swapped. If what icc does is a-b-carry,
gcc does b-a-carry. Needless to say, this most likely breaks any code using
_subborrow_u64 on one of the two compilers.

Curiously, it seems that the intel intrinsics guide *used to* (in April 2016)
describe the same behavior that gcc implements:
https://web.archive.org/web/20160422045348/https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=subb&expand=5283
Now, however, the reference describes icc behavior:
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=subborrow_u64&expand=5283,5304,5304

To determine what gcc does, I used the following test program:

#include 
#include 
#include 

int main(int argc, char** argv) {
if (argc != 3) {
return 111;
}
uint64_t a = 0;
uint64_t b = 0;
sscanf(argv[1], "%llu", &a);
sscanf(argv[2], "%llu", &b);
unsigned long long s = 0;
uint8_t c = 0;
c = _subborrow_u64(1, a, b, &s);
printf("_subborrow_u64(1, %llu, %llu) = %llx + (%llx<<64)\n", a, b, s,
c);
}


Output if ran with gcc:
$ ./sbb 0 8
_subborrow_u64(1, 2, 8) = 5 + (0<<64)


Compiled with gcc 7.1: https://godbolt.org/g/Usq5Jb
Compiled with icc  17: https://godbolt.org/g/uMdFFm
The difference can be seen by looking at the address that is in rdx when sscanf
is called and then tracing which argument of sbb that number ends up in.

According to
https://stackoverflow.com/questions/29029572/multi-word-addition-using-the-carry-flag/29212615#comment61187795_29212615,
MSVC seems to agree with icc. If that behavior is the consensus of other
implementations (and the intel reference change was fixing an error), I think
it would make sense for gcc to change to match.

The arguments seem to get swapped at
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/adxintrin.h;h=9c4152b9f360c0f9be408c84da4950ded8ad5654;hb=HEAD#l58

_subborrow_u64 (unsigned char __CF, unsigned long long __X,
unsigned long long __Y, unsigned long long *__P)
{ return __builtin_ia32_sbb_u64 (__CF, __Y, __X, __P); }

_subborrow_u32 seems to be affected as well

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-07-03 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #12 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Mon Jul  3 15:53:56 2017
New Revision: 249926

URL: https://gcc.gnu.org/viewcvs?rev=249926&root=gcc&view=rev
Log:
2017-07-03  Dominique d'Humieres  

PR target/81033
* config/darwin.c (darwin_function_switched_text_sections):
Replace DECL_NAME with DECL_ASSEMBLER_NAME, split assemble_name_raw
in two pieces, and suppress the use of buf.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/darwin.c

[Bug c/81294] _subborrow_u64 argument order inconsistent with intrinsic reference, icc

2017-07-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81294

Jakub Jelinek  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com,
   ||jakub at gcc dot gnu.org,
   ||kyukhin at gcc dot gnu.org,
   ||uros at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Seems LLVM also agrees with ICC implementation (rather than the past
documentation).

[Bug target/81295] New: [7 Regression] bootstrap broken on powerpc-linux-gnu

2017-07-03 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81295

Bug ID: 81295
   Summary: [7 Regression] bootstrap broken on powerpc-linux-gnu
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen with r249793 on the gcc-7-branch with powerpc-linux-gnu (32bit) I see code
generated with the stage1 compiler segfaulting (building libgomp stage1). both
with -O0 and -O2.  my last successful build was r249347.

r249732 on the gcc-6-branch built ok. status of the trunk is unknown.

[Bug target/81295] [7 Regression] bootstrap broken on powerpc-linux-gnu

2017-07-03 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81295

Matthias Klose  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #1 from Matthias Klose  ---
gcc configured with
--with-pkgversion=Debian 7.1.0-8
--with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --prefix=/usr
--with-gcc-major-version-only --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm
--disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib
--enable-objc-gc=auto --enable-secureplt --with-cpu=default32
--disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux
--enable-multiarch --disable-werror --with-long-double-128 --enable-multilib
--enable-checking=release
--enable-languages=c,ada,c++,d,fortran,go,lto,objc,obj-c++
--program-transform-name=s&$&-7&;s&^&powerpc-linux-gnu-&
--disable-option-checking --with-target-subdir=powerpc-linux-gnu
--build=powerpc-linux-gnu --host=powerpc-linux-gnu --target=powerpc-linux-gnu
--disable-intermodule --enable-checking=release,types --disable-coverage
--enable-languages=c,ada,c++,lto --disable-build-format-warnings

[Bug fortran/81296] New: derived type I/o problem

2017-07-03 Thread ian at rhymneyconsulting dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81296

Bug ID: 81296
   Summary: derived type I/o problem
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ian at rhymneyconsulting dot co.uk
  Target Milestone: ---

Created attachment 41668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41668&action=edit
source file showing error at run time

I believe the following program to be standard conforming.

module dtio_01_module

  type :: person

character (len=40) :: name
integer :: age

  contains

procedure, private :: pwf
generic :: write (formatted) => pwf

  end type person

contains

  subroutine pwf(dtv, unit, iotype, vlist, iostat, iomsg)

! argument definitions

class (person), intent (in) :: dtv
integer, intent (in) :: unit
character (len=*), intent (in) :: iotype
integer, intent (in) :: vlist(:)
integer, intent (out) :: iostat
character (len=*), intent (inout) :: iomsg

! local variable

character (len= 9) :: pfmt

! vlist(1) and (2) are to be used as the field widths of the two
! components of the derived type variable. First set up the format to
! be used for output.

write ( pfmt, '(a,i2,a,i1,a)' ) '(a', vlist(1), ',i', vlist(2), ')'
print *,pfmt

! now the basic output statement

write (unit, fmt=pfmt, iostat=iostat) dtv%name, dtv%age

  end subroutine pwf

end module dtio_01_module

program ch4001

  use dtio_01_module

  type (person) :: person_01=person('Ian Chivers',65)

  print *,person_01%name
  print *,person_01%age

  WRITE( 6, FMT="( DT (20,3) )" ) person_01

  write (6, 10) person_01
  10 format( DT(15,3) )

end program ch4001

I get the following error at run time.

c:\document\fortran\fourth_edition\examples>gfortran ch4001.f90

c:\document\fortran\fourth_edition\examples>a.exe
 Ian Chivers
  65
 (a20,i3) Ian Chivers  65
At line 58 of file ch4001.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Missing DTIO procedure or intrinsic type passed for item
1 in formatted transfer
( DT(15,3) )
   ^

Error termination. Backtrace:

Could not print backtrace: libbacktrace could not find executable to open
#0  0x
#1  0x
#2  0x
#3  0x
#4  0x
#5  0x
#6  0x
#7  0x
#8  0x
#9  0x
#10  0x
#11  0x
#12  0x
#13  0x

[Bug fortran/81296] derived type I/o problem

2017-07-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81296

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #1 from Dominique d'Humieres  ---
Confirmed. It looks that FORMAT is not (properly?) handled.

[Bug target/81285] [8 Regression] r249888 breaks bootstrap on ppc64le

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81285

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||doko at gcc dot gnu.org

--- Comment #12 from Markus Trippelsdorf  ---
*** Bug 81295 has been marked as a duplicate of this bug. ***

[Bug target/81295] [7 Regression] bootstrap broken on powerpc-linux-gnu

2017-07-03 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81295

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #2 from Markus Trippelsdorf  ---
dup.

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

[Bug target/81295] [7 Regression] bootstrap broken on powerpc-linux-gnu

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Reopening since this is about 7 branch rather than the trunk.

  1   2   >