[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #11 from Jakub Jelinek  ---
I've been also wondering if the ISA selection shouldn't affect -mtune=generic
tuning, say in TUs or even just functions that have AVX512* enabled the generic
tuning shouldn't be taken just from the set of CPUs that currently support that
ISA.  Of course that would change once some AMD chips start supporting it.

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #10 from Andrew Roberts  ---
Created attachment 42691
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42691&action=edit
Script for matrix.c test program

Script for matrix.c test program

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #9 from Andrew Roberts  ---
Created attachment 42690
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42690&action=edit
Test results for Skylake system with matrix.c

Test results for Skylake system with matrix.c

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #8 from Andrew Roberts  ---
Created attachment 42689
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42689&action=edit
Test results for Haswell system with matrix.c

Test results for Haswell system with matrix.c

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #7 from Andrew Roberts  ---
Created attachment 42688
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42688&action=edit
Test results for Ryzen system with matrix.c

Test results for Ryzen system with matrix.c

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #6 from Andrew Roberts  ---
Created attachment 42687
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42687&action=edit
Test program used for the attached performance results (matrix.c)

Test program used for the attached performance results (matrix.c)

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

--- Comment #5 from Andrew Roberts  ---
I've been testing on a Ryzen system and also comparing with Haswell and
Skylake. From my testing -mtune=znver1 does not perform well and never has,
including as of last snapshot:
gcc version 8.0.0 20171119 (experimental) (GCC)

-mtune=generic seems a better option for all three systems as a default for
-march=native

This is only with one test case (attached), but I've seen the same across many
other tests.

See the attached testcase (matix.c) and performance logs 
Ryzen - znver1-tunebug.txt
Haswell - znver1-tunebug2.txt
Skylake - znver1-tunebug3.txt

[Bug target/81616] Update -mtune=generic for the current Intel and AMD processors

2017-11-22 Thread andrewm.roberts at sky dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616

Andrew Roberts  changed:

   What|Removed |Added

 CC||andrewm.roberts at sky dot com

--- Comment #4 from Andrew Roberts  ---
I've been testing on a Ryzen system and also comparing with Haswell and
Skylake. From my testing -mtune=znver1 does not perform well and never has,
including as of last snapshot:
gcc version 8.0.0 20171119 (experimental) (GCC)

-mtune=generic seems a better option for all three systems as a default for
-march=native

This is only with one test case (attached), but I've seen the same across many
other tests.

See the attached testcase (matix.c) and performance logs 
Ryzen - znver1-tunebug.txt
Haswell - znver1-tunebug2.txt
Skylake - znver1-tunebug3.txt

[Bug c++/83121] New: [8 Regression] ICE: in linemap_ordinary_map_lookup, at libcpp/line-map.c:995

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83121

Bug ID: 83121
   Summary: [8 Regression] ICE: in linemap_ordinary_map_lookup, at
libcpp/line-map.c:995
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

Building Node.js on ppc64le with "-g -flto" leads to:

  g++ -g -Wno-class-memaccess -Wno-ignored-qualifiers -flto=60 -pthread
-rdynamic -m64
-Wl,--whole-archive,/home/trippels/node/out/Release/obj.target/deps/openssl/libopenssl.a
-Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_base.a
-Wl,--no-whole-archive -pthread  -o /home/trippels/node/out/Release/cctest
-Wl,--start-group
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/node_module_reg.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/node_test_fixture.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_aliased_buffer.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_base64.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_environment.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_util.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_url.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_inspector_socket.o
/home/trippels/node/out/Release/obj.target/cctest/test/cctest/test_inspector_socket_server.o
/home/trippels/node/out/Release/obj.target/deps/gtest/libgtest.a
/home/trippels/node/out/Release/obj.target/deps/zlib/libzlib.a
/home/trippels/node/out/Release/obj.target/deps/openssl/libopenssl.a
/home/trippels/node/out/Release/obj.target/deps/http_parser/libhttp_parser.a
/home/trippels/node/out/Release/obj.target/deps/uv/libuv.a
/home/trippels/node/out/Release/obj.target/deps/nghttp2/libnghttp2.a
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_libplatform.a
/home/trippels/node/out/Release/obj.target/tools/icu/libicui18n.a
/home/trippels/node/out/Release/obj.target/deps/cares/libcares.a
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_libbase.a
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_base.a
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_libsampler.a
/home/trippels/node/out/Release/obj.target/tools/icu/libicuucx.a
/home/trippels/node/out/Release/obj.target/tools/icu/libicudata.a
/home/trippels/node/out/Release/obj.target/tools/icu/libicustubdata.a
/home/trippels/node/out/Release/obj.target/deps/v8/src/libv8_snapshot.a
/home/trippels/node/out/Release/obj.target/node/src/async_wrap.o
/home/trippels/node/out/Release/obj.target/node/src/env.o
/home/trippels/node/out/Release/obj.target/node/src/node.o
/home/trippels/node/out/Release/obj.target/node/src/node_buffer.o
/home/trippels/node/out/Release/obj.target/node/src/node_debug_options.o
/home/trippels/node/out/Release/obj.target/node/src/node_i18n.o
/home/trippels/node/out/Release/obj.target/node/src/node_perf.o
/home/trippels/node/out/Release/obj.target/node/src/node_platform.o
/home/trippels/node/out/Release/obj.target/node/src/node_url.o
/home/trippels/node/out/Release/obj.target/node/src/util.o
/home/trippels/node/out/Release/obj.target/node/src/string_bytes.o
/home/trippels/node/out/Release/obj.target/node/src/string_search.o
/home/trippels/node/out/Release/obj.target/node/src/stream_base.o
/home/trippels/node/out/Release/obj.target/node/src/node_constants.o
/home/trippels/node/out/Release/obj.target/node/src/tracing/agent.o
/home/trippels/node/out/Release/obj.target/node/src/tracing/node_trace_buffer.o
/home/trippels/node/out/Release/obj.target/node/src/tracing/node_trace_writer.o
/home/trippels/node/out/Release/obj.target/node/src/tracing/trace_event.o
/home/trippels/node/out/Release/obj.target/node/gen/node_javascript.o
/home/trippels/node/out/Release/obj.target/node/src/node_crypto.o
/home/trippels/node/out/Release/obj.target/node/src/node_crypto_bio.o
/home/trippels/node/out/Release/obj.target/node/src/node_crypto_clienthello.o
/home/trippels/node/out/Release/obj.target/node/src/tls_wrap.o
/home/trippels/node/out/Release/obj.target/node/src/inspector_agent.o
/home/trippels/node/out/Release/obj.target/node/src/inspector_io.o
/home/trippels/node/out/Release/obj.target/node/src/inspector_js_api.o
/home/trippels/node/out/Release/obj.target/node/src/inspector_socket.o
/home/trippels/node/out/Release/obj.target/node/src/inspector_socket_server.o
/home/trippels/node/out/Release/obj.target/node/src/backtrace_posix.o -lm -ldl
-lrt -Wl,--end-group
../src/env.h:389: warning: type ‘struct AsyncHooks’ violates the C++ One
Definition Rule [-Wodr]
   class AsyncHooks {

../src/env.h:389: note: a different type is defined in another translation unit
   class AsyncHooks {

../src/env.h

[Bug tree-optimization/83104] [8 Regression] ICE: Segmentation fault

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83104

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||amodra at gmail dot com

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

[Bug tree-optimization/83119] segmentation fault due to two_valued_val_range_p passing NULL to to_wide

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83119

Markus Trippelsdorf  changed:

   What|Removed |Added

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

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

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

[Bug target/83111] [sh] stack smashing detected in gen_udivsi3

2017-11-22 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111

Oleg Endo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-23
 Ever confirmed|0   |1

--- Comment #4 from Oleg Endo  ---
Thanks for reporting and tracking this down.
It seems there more such traps.  Can you please try the following:

Index: gcc/config/sh/sh.md
===
--- gcc/config/sh/sh.md (revision 251045)
+++ gcc/config/sh/sh.md (working copy)
@@ -2277,8 +2277,8 @@
   ""
 {
   rtx last;
+  rtx func_ptr = gen_reg_rtx (Pmode);

-  operands[3] = gen_reg_rtx (Pmode);
   /* Emit the move of the address to a pseudo outside of the libcall.  */
   if (TARGET_DIVIDE_CALL_TABLE)
 {
@@ -2298,16 +2298,16 @@
  emit_move_insn (operands[0], operands[2]);
  DONE;
}
-  function_symbol (operands[3], "__udivsi3_i4i", SFUNC_GOT);
-  last = gen_udivsi3_i4_int (operands[0], operands[3]);
+  function_symbol (func_ptr, "__udivsi3_i4i", SFUNC_GOT);
+  last = gen_udivsi3_i4_int (operands[0], func_ptr);
 }
   else if (TARGET_DIVIDE_CALL_FP)
 {
-  rtx lab = function_symbol (operands[3], "__udivsi3_i4",
SFUNC_STATIC).lab;
+  rtx lab = function_symbol (func_ptr, "__udivsi3_i4", SFUNC_STATIC).lab;
   if (TARGET_FPU_SINGLE)
-   last = gen_udivsi3_i4_single (operands[0], operands[3], lab);
+   last = gen_udivsi3_i4_single (operands[0], func_ptr, lab);
   else
-   last = gen_udivsi3_i4 (operands[0], operands[3], lab);
+   last = gen_udivsi3_i4 (operands[0], func_ptr, lab);
 }
   else if (TARGET_SH2A)
 {
@@ -2318,8 +2318,8 @@
 }
   else
 {
-  rtx lab = function_symbol (operands[3], "__udivsi3", SFUNC_STATIC).lab;
-  last = gen_udivsi3_i1 (operands[0], operands[3], lab);
+  rtx lab = function_symbol (func_ptr, "__udivsi3", SFUNC_STATIC).lab;
+  last = gen_udivsi3_i1 (operands[0], func_ptr, lab);
 }
   emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
   emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
@@ -2405,22 +2405,22 @@
   ""
 {
   rtx last;
+  rtx func_ptr = gen_reg_rtx (Pmode);

-  operands[3] = gen_reg_rtx (Pmode);
   /* Emit the move of the address to a pseudo outside of the libcall.  */
   if (TARGET_DIVIDE_CALL_TABLE)
 {
-  function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT);
-  last = gen_divsi3_i4_int (operands[0], operands[3]);
+  function_symbol (func_ptr, sh_divsi3_libfunc, SFUNC_GOT);
+  last = gen_divsi3_i4_int (operands[0], func_ptr);
 }
   else if (TARGET_DIVIDE_CALL_FP)
 {
-  rtx lab = function_symbol (operands[3], sh_divsi3_libfunc,
+  rtx lab = function_symbol (func_ptr, sh_divsi3_libfunc,
 SFUNC_STATIC).lab;
   if (TARGET_FPU_SINGLE)
-   last = gen_divsi3_i4_single (operands[0], operands[3], lab);
+   last = gen_divsi3_i4_single (operands[0], func_ptr, lab);
   else
-   last = gen_divsi3_i4 (operands[0], operands[3], lab);
+   last = gen_divsi3_i4 (operands[0], func_ptr, lab);
 }
   else if (TARGET_SH2A)
 {
@@ -2431,8 +2431,8 @@
 }
   else
 {
-  function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT);
-  last = gen_divsi3_i1 (operands[0], operands[3]);
+  function_symbol (func_ptr, sh_divsi3_libfunc, SFUNC_GOT);
+  last = gen_divsi3_i1 (operands[0], func_ptr);
 }
   emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
   emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]);
@@ -6519,6 +6519,7 @@
   [(call (mem (match_operand:SI 0 "symbol_ref_operand" ""))
 (match_operand 1 "" ""))
(use (reg:SI FPSCR_MODES_REG))
+   (use (match_scratch 2))
(clobber (reg:SI PR_REG))]
   "TARGET_SH2A && sh2a_is_function_vector_call (operands[0])"
 {
@@ -6629,6 +6630,7 @@
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" ""))
  (match_operand 2 "" "")))
(use (reg:SI FPSCR_MODES_REG))
+   (use (match_scratch 3))
(clobber (reg:SI PR_REG))]
   "TARGET_SH2A && sh2a_is_function_vector_call (operands[1])"
 {
@@ -7044,13 +7046,11 @@
   [(const_int 0)]
 {
   rtx lab = PATTERN (gen_call_site ());
-  rtx call_insn;
+  rtx tmp =  gen_rtx_REG (SImode, R1_REG);

-  operands[3] =  gen_rtx_REG (SImode, R1_REG);
-
-  sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
-  call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
-   operands[3],
+  sh_expand_sym_label2reg (tmp, operands[1], lab, true);
+  rtx call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
+   tmp,
operands[2],

[Bug libstdc++/83120] [8 Regression] ext/special_functions/hyperg failure on AIX

2017-11-22 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83120

David Edelsohn  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-23
 Ever confirmed|0   |1

--- Comment #1 from David Edelsohn  ---
Confirmed.

[Bug libstdc++/83120] New: [8 Regression] ext/special_functions/hyperg failure on AIX

2017-11-22 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83120

Bug ID: 83120
   Summary: [8 Regression] ext/special_functions/hyperg failure on
AIX
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dje at gcc dot gnu.org
  Target Milestone: ---
Target: power*-*-aix*

$ ./check_value.exe  
/nasfarm/edelsohn/src/src/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_value.cc:12315:
void test(const testcase_hyperg (&)[Num], Ret) [with Ret = double;
unsigned int Num = 19]: Assertion 'max_abs_frac < toler' failed.
IOT/Abort trap (core dumped)

$ ./check_value.exe 
line 12315  max_abs_frac = 4.82864e-13
line 12315  max_abs_frac = 5.15741e-12
line 12315  max_abs_frac = 3.10473e-11
line 12315  max_abs_frac = 1.09304e-12
line 12315  max_abs_frac = 4.82864e-13
line 12315  max_abs_frac = 2.64325e-12
line 12315  max_abs_frac = 3.21576e-12
line 12315  max_abs_frac = 2.58658e-12
line 12315  max_abs_frac = 6.15743e-13
line 12315  max_abs_frac = 1.87073e-10
line 12315  max_abs_frac = 7.72796e-10
line 12315  max_abs_frac = 5.19491e-09
line 12315  max_abs_frac = 2.15517e-10
line 12315  max_abs_frac = 5.15741e-12
line 12315  max_abs_frac = 3.10473e-11
line 12315  max_abs_frac = 1.09304e-12
line 12315  max_abs_frac = 1.87073e-10
line 12315  max_abs_frac = 7.72796e-10
line 12315  max_abs_frac = 5.19491e-09
line 12315  max_abs_frac = 2.15517e-10
line 12315  max_abs_frac = 1.68813e-09
line 12315  max_abs_frac = 2.64594e-08
line 12315  max_abs_frac = 3.02697e-07
line 12315  max_abs_frac = 4.34529e-07
line 12315  max_abs_frac = 2.36511e-07

[Bug tree-optimization/83119] New: segmentation fault due to two_valued_val_range_p passing NULL to to_wide

2017-11-22 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83119

Bug ID: 83119
   Summary: segmentation fault due to two_valued_val_range_p
passing NULL to to_wide
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: amodra at gmail dot com
  Target Milestone: ---

Created attachment 42686
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42686&action=edit
preprocessed source

during GIMPLE pass: vrp
fetch-value.c: In function '_td_locate_field':
fetch-value.c:44:1: internal compiler error: Segmentation fault
 _td_locate_field (td_thragent_t *ta,
 ^~~~
0x1097582b crash_signal
/home/amodra/src/gcc/gcc/toplev.c:325
0x10321d34 tree_int_cst_elt_check(tree_node const*, int, char const*, int, char
const*)
/home/amodra/src/gcc/gcc/tree.h:3277
0x10321d34 wi::to_wide(tree_node const*)
/home/amodra/src/gcc/gcc/tree.h:5246
0x10db57cf vr_values::two_valued_val_range_p(tree_node*, tree_node**,
tree_node**)
/home/amodra/src/gcc/gcc/vr-values.c:4053
0x10dbd983 vr_values::simplify_stmt_using_ranges(gimple_stmt_iterator*)
/home/amodra/src/gcc/gcc/vr-values.c:4116
0x10cfff33 vrp_folder::simplify_stmt_using_ranges(gimple_stmt_iterator*)
/home/amodra/src/gcc/gcc/tree-vrp.c:6362
0x10cfff33 vrp_folder::fold_stmt(gimple_stmt_iterator*)
/home/amodra/src/gcc/gcc/tree-vrp.c:6437
0x10bce873
substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
/home/amodra/src/gcc/gcc/tree-ssa-propagate.c:1073
0x112ad263 dom_walker::walk(basic_block_def*)
/home/amodra/src/gcc/gcc/domwalk.c:308
0x10bcd3c7 substitute_and_fold_engine::substitute_and_fold()
/home/amodra/src/gcc/gcc/tree-ssa-propagate.c:1173
0x10d0019b vrp_prop::vrp_finalize(bool)
/home/amodra/src/gcc/gcc/tree-vrp.c:6788
0x10d1236b execute_vrp
/home/amodra/src/gcc/gcc/tree-vrp.c:6864

Starting program: /home/amodra/gnu/libexec/gcc/powerpc64-linux/8.0.0/cc1
-fpreprocessed fetch-value.i -msecure-plt -quiet -dumpbase fetch-value.c
-mcpu=power7 -mlong-double-128 -auxbase-strip
/home/amodra/build/glibc/nptl_db/fetch-value.os -g -O2 -Wall -Werror -Wundef
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition -std=gnu11 -version
-fgnu89-inline -fmerge-all-constants -fno-stack-protector -frounding-math -fpic
-o fetch-value.s

GNU C11 (GCC) version 8.0.0 20171122 (experimental) (powerpc64-linux)
compiled by GNU C version 8.0.0 20171122 (experimental), GMP version
6.0.0, MPFR version 3.1.1, MPC version 1.0.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C11 (GCC) version 8.0.0 20171122 (experimental) (powerpc64-linux)
compiled by GNU C version 8.0.0 20171122 (experimental), GMP version
6.0.0, MPFR version 3.1.1, MPC version 1.0.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7c4ca94b129285c9da74e4b0a828d58f

Program received signal SIGSEGV, Segmentation fault.
wi::to_wide (t=0x0) at /home/amodra/src/gcc/gcc/tree.h:5246
5246  return wi::storage_ref (&TREE_INT_CST_ELT (t, 0), TREE_INT_CST_NUNITS
(t),
Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7.ppc64
gmp-6.0.0-15.el7.ppc64 libmpc-1.0.1-3.el7.ppc64 mpfr-3.1.1-4.el7.ppc64
(gdb) up
#1  0x10db57d0 in vr_values::two_valued_val_range_p
(this=this@entry=0x3fffe248, 
var=var@entry=0x3fffb5b7ac20, a=a@entry=0x3fffdd08,
b=b@entry=0x3fffdd00)
at /home/amodra/src/gcc/gcc/vr-values.c:4053
4053  - wi::to_wide (vrp_val_min (TREE_TYPE (var == 1
(gdb) p debug_tree(var)
 >
sizes-gimplified asm_written public unsigned DI
size 
unit-size 
align:64 warn_if_not_align:0 symtab:16383 alias-set -1 canonical-type
0x3fffb5b91068 context 
pointer_to_this >
var 
def_stmt idx_62 = ASSERT_EXPR ;
version:62
ptr-info 0x3fffb3a12ca0>
$1 = void

[Bug c++/82401] [8 Regression] error: qsort comparator non-negative on sorted output: 1 in insert_late_enum_def_bindings on an invalid code

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82401

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/82407] [8 Regression][meta-bug] qsort_chk fallout tracking

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82407
Bug 82407 depends on bug 82401, which changed state.

Bug 82401 Summary: [8 Regression] error: qsort comparator non-negative on 
sorted output: 1 in insert_late_enum_def_bindings on an invalid code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82401

   What|Removed |Added

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

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #8 from Jakub Jelinek  ---
Fixed.

[Bug lto/80717] LTO wrappers segfault if run with absolute path

2017-11-22 Thread bpiotrowski at archlinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717

Bartłomiej Piotrowski  changed:

   What|Removed |Added

 CC||bpiotrowski at archlinux dot 
org

--- Comment #4 from Bartłomiej Piotrowski  ---
Problematic change has been reverted in r253886 and backported to gcc-7-branch.
(We also did that downstream in Arch Linux prior the revert.)

[Bug fortran/83118] [7/8 Regression] Bad intrinsic assignment of class(*) array component of derived type

2017-11-22 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83118

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||6.4.0
   Keywords||wrong-code
   Last reconfirmed||2017-11-22
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|Bad intrinsic assignment of |[7/8 Regression] Bad
   |class(*) array component of |intrinsic assignment of
   |derived type (8.0   |class(*) array component of
   |regression) |derived type
   Target Milestone|--- |7.3
  Known to fail||7.2.0, 8.0

--- Comment #2 from Dominique d'Humieres  ---
The change occurred between revisions r241509 + 3 patches (2016-10-25, OK) and
r241635 (2016-10-27, wrong), may be r241630 (pr78026).

[Bug c++/82401] [8 Regression] error: qsort comparator non-negative on sorted output: 1 in insert_late_enum_def_bindings on an invalid code

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82401

--- Comment #2 from Jakub Jelinek  ---
Author: jakub
Date: Wed Nov 22 22:35:52 2017
New Revision: 255084

URL: https://gcc.gnu.org/viewcvs?rev=255084&root=gcc&view=rev
Log:
PR c++/82401
* name-lookup.c (member_name_cmp): Return 0 if a == b.

* g++.dg/cpp0x/pr82401.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr82401.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/83118] Bad intrinsic assignment of class(*) array component of derived type (8.0 regression)

2017-11-22 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83118

--- Comment #1 from Neil Carlson  ---
Note that the incorrect string "b" is not actually 1 character long, but 3
characters: a "b" followed by 2 non-printing characters.  Vim shows them as ^@

[Bug fortran/83118] New: Bad intrinsic assignment of class(*) array component of derived type (8.0 regression)

2017-11-22 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83118

Bug ID: 83118
   Summary: Bad intrinsic assignment of class(*) array component
of derived type (8.0 regression)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

Intrinsic assignment of a derived type with allocatable CLASS(*) array
component is not being done correctly with version 8.0 when the dynamic type is
CHARACTER.

Version 6.4.1 gives the expected result:

orig=["foo","bar"]
copy=["foo","bar"]


But 8.0 (20171122) gives an incorrect result:

orig=["foo","bar"]
copy=["foo","b"]

Here's the code:

type :: any_vector
  class(*), allocatable :: v(:)
end type
type(any_vector) :: x, y
allocate(x%v,source=['foo','bar'])
select type (v => x%v)
type is (character(*))
  print '("orig=[""",a,''","'',a,''"]'')', v ! expect orig=["foo","bar"]
end select
y = x ! THIS ASSIGNMENT IS NOT BEING DONE CORRECTLY
select type (v => y%v)
type is (character(*))
  print '("copy=[""",a,''","'',a,''"]'')', v ! expect copy=["foo","bar"]
end select
end

[Bug target/79242] ICE in simplify_subreg, at simplify-rtx.c:6029

2017-11-22 Thread jozefl.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79242

Jozef Lawrynowicz  changed:

   What|Removed |Added

 CC||jozefl.gcc at gmail dot com

--- Comment #7 from Jozef Lawrynowicz  ---
(In reply to Andrei Pushkin from comment #6)
> Still broken in 7.2
> 
> What are the chances of this bug getting some love?

I'm happy to report that I am back working on MSP430 GCC. However, I have some
other startup items to complete before I can get back to fixing bugs, but this
is top of my bug list.

[Bug rtl-optimization/83030] [8 regression] ICE in create_pseudo_cfg, at dwarf2cfi.c:2840

2017-11-22 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83030

Eric Botcazou  changed:

   What|Removed |Added

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

--- Comment #7 from Eric Botcazou  ---
.

[Bug rtl-optimization/83030] [8 regression] ICE in create_pseudo_cfg, at dwarf2cfi.c:2840

2017-11-22 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83030

--- Comment #6 from Eric Botcazou  ---
Author: ebotcazou
Date: Wed Nov 22 21:43:22 2017
New Revision: 255083

URL: https://gcc.gnu.org/viewcvs?rev=255083&root=gcc&view=rev
Log:
PR rtl-optimization/83030
* doc/rtl.texi (Flags in an RTL Expression): Alphabetize, add entry
for CROSSING_JUMP_P and mention usage of 'jump' for JUMP_INSNs.
(Insns): Delete entry for REG_CROSSING_JUMP in register notes.
* bb-reorder.c (update_crossing_jump_flags): Do not test whether the
CROSSING_JUMP_P flag is already set before setting it.
* cfgrtl.c (fixup_partition_crossing): Likewise.
* reorg.c (relax_delay_slots): Do not consider a CROSSING_JUMP_P insn
as useless.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/bb-reorder.c
trunk/gcc/cfgrtl.c
trunk/gcc/doc/rtl.texi
trunk/gcc/reorg.c

[Bug fortran/82392] Allign arrays for faster execution

2017-11-22 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82392

--- Comment #2 from Thomas Koenig  ---
Test case for the fact that we don't align, or that this
causes a performance loss?

[Bug tree-optimization/82583] missing -Warray-bounds on out-of-bounds inner indices

2017-11-22 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82583

--- Comment #5 from David Malcolm  ---
Author: dmalcolm
Date: Wed Nov 22 21:12:36 2017
New Revision: 255082

URL: https://gcc.gnu.org/viewcvs?rev=255082&root=gcc&view=rev
Log:
jit: update test suite for change to -Warray-bounds

jit.dg/test-error-array-bounds.c is a test of how libgccjit
handles errors coming from the middle-end, using -Warray-bounds as
an example.

It started failing as of r254830 (aka
987b3316c4e7c908e3c7d2151c20971f9707ad66),
due to that commit changing the wording of the message.

This commit fixes the jit testcase by updating it to use the new
wording.

gcc/testsuite/ChangeLog:
PR tree-optimization/82588
PR tree-optimization/82583
* jit.dg/test-error-array-bounds.c (verify_code): Update expected
error message from -Warray-bounds.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/jit.dg/test-error-array-bounds.c

[Bug tree-optimization/82588] missing -Warray-bounds on a excessively large index

2017-11-22 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82588

--- Comment #6 from David Malcolm  ---
Author: dmalcolm
Date: Wed Nov 22 21:12:36 2017
New Revision: 255082

URL: https://gcc.gnu.org/viewcvs?rev=255082&root=gcc&view=rev
Log:
jit: update test suite for change to -Warray-bounds

jit.dg/test-error-array-bounds.c is a test of how libgccjit
handles errors coming from the middle-end, using -Warray-bounds as
an example.

It started failing as of r254830 (aka
987b3316c4e7c908e3c7d2151c20971f9707ad66),
due to that commit changing the wording of the message.

This commit fixes the jit testcase by updating it to use the new
wording.

gcc/testsuite/ChangeLog:
PR tree-optimization/82588
PR tree-optimization/82583
* jit.dg/test-error-array-bounds.c (verify_code): Update expected
error message from -Warray-bounds.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/jit.dg/test-error-array-bounds.c

[Bug target/83117] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

Uroš Bizjak  changed:

   What|Removed |Added

 Target||x86_64
 CC||dansan at gcc dot gnu.org

--- Comment #1 from Uroš Bizjak  ---
CC author.

[Bug target/83117] New: FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

Bug ID: 83117
   Summary: FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test
for excess errors)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ubizjak at gmail dot com
  Target Milestone: ---

Recently ms-sysv.c tests start to FAIL:

FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p1" (test for
excess errors)
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p5" (test for
excess errors)
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p1" (test for excess errors)
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p5" (test for excess errors)

These all fail with some hundred(?) of:

Excess errors:
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:18060:9:
warning: function called through a non-compatible type
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:18064:9:
warning: function called through a non-compatible type
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:18068:9:
warning: function called through a non-compatible type
...
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:32369:9:
warning: function called through a non-compatible type
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:32374:9:
warning: function called through a non-compatible type
/ssd/uros/gcc-build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:32380:9:
warning: function called through a non-compatible type

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Wed Nov 22 20:49:56 2017
New Revision: 255080

URL: https://gcc.gnu.org/viewcvs?rev=255080&root=gcc&view=rev
Log:
PR libgomp/83106
* target.c (gomp_target_init): Compute lengths just once and
use them in both malloc size and subsequent copying.

Modified:
trunk/libgomp/ChangeLog
trunk/libgomp/target.c

[Bug c++/62170] wrong quoting (and colors) for typedef diagnostics

2017-11-22 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62170

David Malcolm  changed:

   What|Removed |Added

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

--- Comment #5 from David Malcolm  ---
Should be fixed on trunk for gcc 8 by r255076.

[Bug c++/62170] wrong quoting (and colors) for typedef diagnostics

2017-11-22 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62170

--- Comment #4 from David Malcolm  ---
Author: dmalcolm
Date: Wed Nov 22 20:37:58 2017
New Revision: 255076

URL: https://gcc.gnu.org/viewcvs?rev=255076&root=gcc&view=rev
Log:
C/C++: fix quoting of "aka" typedef information (PR 62170)

PR 62170 describes a problem with how the quoting in pp_format
interacts with the "aka" information for typedefs in %qT for
the C family of frontends, and also now for %qH and %qI in the
C++ frontend: we print:

  'Py_ssize_t* {aka int*}'
   ^^ colorized as "quote"

i.e.
  '[START_COLOR]Py_ssize_t* {aka int*}[END_COLOR]'

when we should print:

  'Py_ssize_t*' {aka 'int*'}
   ^^^ colorized as "quote"

i.e.
  '[START_COLOR]Py_ssize_t*[END_COLOR]' {aka '[START_COLOR]int*[END_COLOR]'}

where the opening and closing quote characters and colorization are
added by the 'q' handling within pp_format.

This patch fixes the quoting by updating the %T handling in C and C++
and the %H/%I handling in C++ to insert the quoting appropriately.
It converts the "quote" param of the pp_format_decoder callback from
bool to bool *, allowing for the %T and %H/%I handlers to write
false back to it, to avoid printing the closing quote for the cases
like the above where the trailing closing quote isn't needed.

It introduces pp_begin_quote/pp_end_quote to simplify this.  These
take a "bool show_color", rather than using "pp_show_color (pp)"
since cxx_pp's pp_show_color isn't currently initialized (since
cxx_initialize_diagnostics happens before diagnostic_color_init).

gcc/c/ChangeLog:
PR c++/62170
* c-objc-common.c (c_tree_printer): Convert penultimate param from
bool to bool *.  Within '%T' handling, if showing an "aka", use
"quoted" param to add appropriate quoting.

gcc/cp/ChangeLog:
PR c++/62170
* error.c (type_to_string): Add leading comment.  Add params
"postprocessed", "quote", and "show_color", using them to fix
quoting of the "aka" for types involving typedefs.
(arg_to_string): Update for new params to type_to_string.
(cxx_format_postprocessor::handle): Likewise.
(cp_printer): Convert penultimate param from bool to bool *.
Update call to type_to_string and calls to
defer_phase_2_of_type_diff.

gcc/fortran/ChangeLog:
PR c++/62170
* error.c (gfc_notify_std): Convert "quoted" param from bool to
bool *.

gcc/ChangeLog:
PR c++/62170
* pretty-print.c (pp_format): Move quoting implementation to
pp_begin_quote and pp_end_quote.  Update pp_format_decoder call
to pass address of "quote" local.
(pp_begin_quote): New function.
(pp_end_quote): New function.
* pretty-print.h (printer_fn): Convert penultimate param from bool
to bool *.
(pp_begin_quote): New decl.
(pp_end_quote): New decl.
* tree-diagnostic.c (default_tree_printer): Convert penultimate
param from bool to bool *.
* tree-diagnostic.h (default_tree_printer): Likewise.

gcc/testsuite/ChangeLog:
PR c++/62170
* g++.dg/diagnostic/aka1.C: Update expected error messages to
reflect fixes to quoting.
* g++.dg/diagnostic/aka2.C: New test case.
* g++.dg/parse/error55.C: Update expected error messages to
reflect fixes to quoting.
* gcc.dg/diag-aka-1.c: Likewise.
* gcc.dg/diag-aka-2.c: New test case.
* gcc.dg/pr13804-1.c: Update expected error messages to reflect
fixes to quoting.
* gcc.dg/pr56980.c: Likewise.
* gcc.dg/pr65050.c: Likewise.
* gcc.dg/redecl-14.c: Likewise.
* gcc.dg/utf16-4.c Likewise.
* gcc.target/i386/sse-vect-types.c (__m128d): Likewise.
* obj-c++.dg/invalid-type-1.mm: Likewise.
* objc.dg/proto-lossage-4.m: Likewise.


Added:
trunk/gcc/testsuite/g++.dg/diagnostic/aka2.C
trunk/gcc/testsuite/gcc.dg/diag-aka-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-objc-common.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/error.c
trunk/gcc/pretty-print.c
trunk/gcc/pretty-print.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/diagnostic/aka1.C
trunk/gcc/testsuite/g++.dg/parse/error55.C
trunk/gcc/testsuite/gcc.dg/diag-aka-1.c
trunk/gcc/testsuite/gcc.dg/pr13804-1.c
trunk/gcc/testsuite/gcc.dg/pr56980.c
trunk/gcc/testsuite/gcc.dg/pr65050.c
trunk/gcc/testsuite/gcc.dg/redecl-14.c
trunk/gcc/testsuite/gcc.dg/utf16-4.c
trunk/gcc/testsuite/gcc.target/i386/sse-vect-types.c
trunk/gcc/testsuite/obj-c++.dg/invalid-type-1.mm
trunk/gcc/testsuite/objc.dg/proto-lossage-4.m
trunk/gcc/tree-diagnostic.c
trunk/gcc/tree-diagnostic.h

[Bug c++/83116] New: Statement with no effect causes wrong code of static object constexpr method

2017-11-22 Thread gcc at gajoch dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83116

Bug ID: 83116
   Summary: Statement with no effect causes wrong code of static
object constexpr method
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at gajoch dot pl
  Target Milestone: ---

Created attachment 42685
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42685&action=edit
Preprocessed source

Following testcase:

$ cat main.cpp 
#include 

struct foo {
constexpr foo() : size_(0) {
(void)size();
}
constexpr int size() {
return size_;
}
int size_;
};

int main() {
static foo var;
var.size_ = 5;
std::printf("%d %d", var.size_, var.size());
return 0;
}

$ g++ -Wall -Wextra -pedantic -O0 main.cpp -o main && ./main
5 5

$ g++ -Wall -Wextra -pedantic -O1 main.cpp -o main && ./main
5 0

(Same happens on -Og, -O2 and -O3)

Tested on:
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.2.0 (GCC)


Correct behavior is seen using gcc-5.4, clang and msvc.
Removing constructor body gives correct code - this is stripped version,
originally there was assert(this->size() >= 0);
UBSAN gives no results.

This bug occurs also on 6.1.0, 6.2.0, 6.3.0, 7.1.0, 7.2.0 and today's trunk
(8.0.0 20171122), as tested on compiler explorer: https://godbolt.org/g/hr4Nq4

[Bug middle-end/83074] Shared object built with `-pie --coverage' hangs forever

2017-11-22 Thread stvar at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83074

--- Comment #7 from Stefan Vargyas  ---
> 
> libc.so.6 is a shared library, not a PIE.  It is normally linked with -shared,
> just arranged to have .interp section and a meaningful e_entry in Ehdr.
> PIE is something significantly different, in particular it is the executable,
> albeit position independent, e.g. required to be the first in symbol search
> scope so that its symbols bind locally.
> 

Jakub, thank you very much for your deeply insightful info.

I should have had a look at glibc prior to using the `-pie' hackery
for to achive the desired result of running 'foo.so' by itself.

The right solution (at least on GNU/Linux ELF platforms) is to rely on
`-shared', `-Wl,--entry' and a proper '.interp' section in the ELF file
built. (E.g. one cannot get rid of the issues seen above implied by
'__libc_csu_{init,fini}'.)

[Bug c++/83115] Capturing the local variable/function parameter by value generates a compilation error

2017-11-22 Thread alexandr.kolesov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83115

--- Comment #1 from Alexander Kolesov  ---
The error we can see:

prog.cc: In function 'void doSomething(double)':
prog.cc:6:44: error: 'value' was not declared in this scope
  [ now = std::chrono::system_clock::now(), value]{}();
^
prog.cc:6:44: error: declaration of 'value' shadows a
parameter
prog.cc:4:31: warning: unused parameter 'value' [-Wunused-parameter]
 void doSomething(const double value)
  ~^

[Bug c++/83115] New: Capturing the local variable/function parameter by value generates an compilation error

2017-11-22 Thread alexandr.kolesov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83115

Bug ID: 83115
   Summary: Capturing the local variable/function parameter by
value generates an compilation error
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alexandr.kolesov at gmail dot com
  Target Milestone: ---

// This simple code cannot be compiled in some cases:

#include 
#include 

void doSomething(const double value)
{
   [ now = std::chrono::system_clock::now(), value]{}(); // Error
// [ now = std::chrono::system_clock::now(), value = value]{}(); // OK
// [ value, now = std::chrono::system_clock::now()]{}(); // OK
}

int main()
{
   doSomething(42.0);
   return 0;
}

[Bug ada/83016] gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada

2017-11-22 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83016

--- Comment #10 from Eric Botcazou  ---
> errm - I think I need to rebuild the host compiler so I get the proper
> gnatlink to rebuild the cross compiler. Sorry.

See also PR ada/81878.

[Bug fortran/79072] ICE with class(*) pointer function result and character value

2017-11-22 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79072

--- Comment #19 from Neil Carlson  ---
This fixes the code of comment 12 for me.  All the other test cases continue to
work as expected.  This can be closed as "fixed" as far as I'm concerned.
Thanks Paul!

[Bug rtl-optimization/83030] [8 regression] ICE in create_pseudo_cfg, at dwarf2cfi.c:2840

2017-11-22 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83030

Eric Botcazou  changed:

   What|Removed |Added

  Component|gcov-profile|rtl-optimization

--- Comment #5 from Eric Botcazou  ---
Recategorizing.

[Bug libfortran/83097] Use __BYTE_ORDER__ instead of runtime test

2017-11-22 Thread jb at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83097

Janne Blomqvist  changed:

   What|Removed |Added

 CC||jb at gcc dot gnu.org

--- Comment #3 from Janne Blomqvist  ---
We now use __BYTE_ORDER__. Leaving this PR open as a reminder to optimize
memcmp_char4.

[Bug libfortran/83097] Use __BYTE_ORDER__ instead of runtime test

2017-11-22 Thread jb at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83097

--- Comment #2 from Janne Blomqvist  ---
Author: jb
Date: Wed Nov 22 19:19:13 2017
New Revision: 255072

URL: https://gcc.gnu.org/viewcvs?rev=255072&root=gcc&view=rev
Log:
PR 83097 Use __BYTE_ORDER__ predefined macro instead of runtime check

By using the __BYTE_ORDER__ predefined macro we don't need the
determine_endianness function anymore.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2017-11-22  Janne Blomqvist  

PR libfortran/83097
* io/inquire.c (inquire_via_unit): Use __BYTE_ORDER__ predefined
macro.
* io/open.c (st_open): Likewise.
* io/transfer.c (data_transfer_init): Likewise.
* io/write.c (btoa_big): Likewise.
(otoa_big): Likewise.
(ztoa_big): Likewise.
* libgfortran.h (big_endian): Remove variable.
(GFOR_POINTER_TO_L1): Use __BYTE_ORDER__ macro.
* runtime/main.c (determine_endianness): Remove function.
(init): Remove call to determine_endianness.
* runtime/minimal.c: Remove setting big_endian variable.

Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/inquire.c
trunk/libgfortran/io/open.c
trunk/libgfortran/io/transfer.c
trunk/libgfortran/io/write.c
trunk/libgfortran/libgfortran.h
trunk/libgfortran/runtime/main.c
trunk/libgfortran/runtime/minimal.c

[Bug target/83114] [7/8 Regression] ICE in gen_vec_cmpv2dfv2di, at config/aarch64/aarch64-simd.md:2495

2017-11-22 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83114

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed.

[Bug target/83114] New: [7/8 Regression] ICE in gen_vec_cmpv2dfv2di, at config/aarch64/aarch64-simd.md:2495

2017-11-22 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83114

Bug ID: 83114
   Summary: [7/8 Regression] ICE in gen_vec_cmpv2dfv2di, at
config/aarch64/aarch64-simd.md:2495
   Product: gcc
   Version: 7.2.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 the branch and the trunk, doesn't show with -O2. Maybe a duplicate of
PR81228.

void *a;
void b() {
  char c;
  long d;
  char *e = a;
  for (; d; d++) {
double f, g;
c = g < f || g > f;
e[d] = c;
  }
}

$ gcc -c -g -O3 ts_expr_node.i
ts_expr_node.i: In function 'b':
ts_expr_node.i:2:6: internal compiler error: in gen_vec_cmpv2dfv2di, at
config/aarch64/aarch64-simd.md:2495
 void b() {
  ^
Please submit a full bug report,
with preprocessed source if appropriate.

[Bug target/81228] [7/8 Regression] ICE in gen_vec_cmpv2dfv2di, at config/aarch64/aarch64-simd.md:2508

2017-11-22 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81228

Matthias Klose  changed:

   What|Removed |Added

 CC||doko at gcc dot gnu.org

--- Comment #3 from Matthias Klose  ---
seen recently in a mariadb 10.1 build, worked around with -O2 instead building
with -O3.

void *a;
void b() {
  char c;
  long d;
  char *e = a;
  for (; d; d++) {
double f, g;
c = g < f || g > f;
e[d] = c;
  }
}

$ gcc -c -g -O3 ts_expr_node.i
ts_expr_node.i: In function 'b':
ts_expr_node.i:2:6: internal compiler error: in gen_vec_cmpv2dfv2di, at
config/aarch64/aarch64-simd.md:2495
 void b() {
  ^
Please submit a full bug report,
with preprocessed source if appropriate.

[Bug ada/83016] gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada

2017-11-22 Thread simon at pushface dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83016

--- Comment #9 from simon at pushface dot org ---
errm - I think I need to rebuild the host compiler so I get the proper gnatlink
to rebuild the cross compiler. Sorry.

[Bug ada/83016] gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada

2017-11-22 Thread simon at pushface dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83016

simon at pushface dot org changed:

   What|Removed |Added

 CC||simon at pushface dot org

--- Comment #8 from simon at pushface dot org ---
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255003
138bc75d-0d04-0410-961f-82ee72b054a4

I configured with

Target: arm-eabi
Configured with: /Volumes/Miscellaneous/tmp/gcc/configure
--build=x86_64-apple-darwin15 --disable-libada --disable-libcc1
--disable-libcilkrts --disable-libffi --disable-libgomp --disable-libmudflap
--disable-libquadmath --disable-libsanitizer --disable-libssp
--disable-libstdcxx-pch --disable-lto --disable-nls --disable-shared
--disable-threads --disable-tls --enable-languages=c,ada
--prefix=/Volumes/Miscellaneous/arm/gcc-8.0.0 --target=arm-eabi --with-gnu-as
--with-gnu-ld --with-libgloss --with-newlib
--with-stage1-ldflags='-static-libstdc++ -static-libgcc
-Wl,-headerpad_max_install_names' --with-system-zlib --without-libiconv-prefix
--with-multilib-list=rmprofile

(note the --with-stage1-ldflags)

and while building gnat tools get

gnatlink -v gnatmake -o ../../gnatmake \
  --GCC="gcc -I../generated
-I/opt/gcc-8.0.0/lib/gcc/x86_64-apple-darwin15/8.0.0/adalib/../adainclude
-I/opt/gcc-8.0.0/lib/gcc/x86_64-apple-darwin15/8.0.0/adalib -I.
-I/Volumes/Miscellaneous/tmp/gcc/gcc/ada" --LINK="g++ -static-libstdc++
-static-libgcc -static-libstdc++ -static-libgcc
-Wl,-headerpad_max_install_names -Wl,-no_pie " ../link.o ../targext.o
../../ggc-none.o ../../libcommon-target.a ../../libcommon.a
../../../libcpp/libcpp.a   -liconv ../../../libbacktrace/.libs/libbacktrace.a
../../../libiberty/libiberty.a
gnatlink: Could not locate linker: g++ -static-libstdc++ -static-libgcc
-static-libstdc++ -static-libgcc -Wl,-headerpad_max_install_names -Wl,-no_pie

[Bug target/82674] ICE with -fstack-clash-protection

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

Segher Boessenkool  changed:

   What|Removed |Added

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

--- Comment #9 from Segher Boessenkool  ---
Fixed.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-22 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #3 from James Clarke  ---
With the same example, I can reproduce on aarch64, armel, powerpc, ppc64 and
ppc64el.

[Bug middle-end/82253] [6/7/8 Regression] ICE in convert_move, at expr.c:604

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82253

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 42684
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42684&action=edit
gcc8-pr82253.patch

Untested fix.

[Bug target/83111] [sh] stack smashing detected in gen_udivsi3

2017-11-22 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111

--- Comment #3 from Tom de Vries  ---
By reverting the patch, I was able to finish the build.

[Bug rtl-optimization/83095] [8 regression] many tests fail starting with r255001

2017-11-22 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83095

seurer at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #3 from seurer at gcc dot gnu.org ---
I ran a test with r255067 and these failing tests now succeed.

[Bug fortran/83113] Bogus "duplicate allocatable attribute" error for submodule character function

2017-11-22 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83113

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-22
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed for 6.4.0, 7.2.0, and trunk (8.0).

[Bug fortran/83113] New: Bogus "duplicate allocatable attribute" error for submodule character function

2017-11-22 Thread werner.blokbuster at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83113

Bug ID: 83113
   Summary: Bogus "duplicate allocatable attribute" error for
submodule character function
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: werner.blokbuster at gmail dot com
  Target Milestone: ---

The code below gives the (I believe, bogus) error with gfortran 7.2:

test_suballoc.f:18:46:

 character(:), allocatable :: next_line
  1
Error: Duplicate ALLOCATABLE attribute specified at (1)

module mm
implicit none
interface
module function next_line(lu)
implicit none
integer, intent(in) :: lu
character(:), allocatable :: next_line
end function next_line
end interface
end module mm

submodule (mm) oo
implicit none
contains
module function next_line(lu)
integer, intent(in) :: lu
character(:), allocatable :: next_line
next_line = 'Hello!'
end function next_line
end submodule oo

program test_suballoc
use mm
implicit none
write(*,*) next_line(3)
end program test_suballoc


If the two "character(:), allocatable" lines are replaced with "character(6)"
the code compiles and runs as expected.

WB

[Bug tree-optimization/83104] [8 Regression] ICE: Segmentation fault

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83104

Markus Trippelsdorf  changed:

   What|Removed |Added

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

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

[Bug libgcc/83112] Silence warnings from PowerPC libgcc float128-ifunc.c compilation

2017-11-22 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83112

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-11-22
 CC||dje at gcc dot gnu.org,
   ||meissner at gcc dot gnu.org,
   ||segher at gcc dot gnu.org,
   ||wschmidt at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |meissner at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug target/82190] Possibly latent miscompilation issue on ppc64le-linux-gnu for memcpy-bi.c with -fweb -fno-optimize-strlen

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

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-22
 Ever confirmed|0   |1

--- Comment #1 from Segher Boessenkool  ---
Confirmed.  Only fails on LE (or with ABIv2 at least), and needs -mcpu=power7
or higher to fail.

[Bug libgcc/83112] New: Silence warnings from PowerPC libgcc float128-ifunc.c compilation

2017-11-22 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83112

Bug ID: 83112
   Summary: Silence warnings from PowerPC libgcc float128-ifunc.c
compilation
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: meissner at gcc dot gnu.org
  Target Milestone: ---

The ifunc handlers in libgcc to switch between using PowerPC ISA 2.07 software
emulation for IEEE 128-bit floating point and ISA 3.0 hardware instructions get
a lot of warnings due to the new option -Wattribute-alias.

The solution is to change the ifunc handler from returning void * to a pointer
to the appropriate function.

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

--- Comment #6 from Andreas Schwab  ---
If you already know strlen (d) you can use strcpy or memcpy instead.

[Bug target/83111] [sh] stack smashing detected in gen_udivsi3

2017-11-22 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111

Tom de Vries  changed:

   What|Removed |Added

 CC||olegendo at gcc dot gnu.org

--- Comment #2 from Tom de Vries  ---
This looks like the offending commit:
...
commit 0e3876bfd55e2888a012d3e304196eb2d4231ecf
Author: olegendo 
Date:   Tue May 3 06:47:34 2016 +

gcc/
* config/sh/sh.md (udivsi3, divsi3, mulsi3): Simplify.
(mulhisi3, umulhisi3, (smulsi3_highpart, umulsi3_highpart): Convert to
define_insn_and_split.
(mulsi3_i): New define_insn_and_split.
(mulsi3_call): Convert to define_insn.
(mulsidi3, mulsidi3_compact, umulsidi3, umulsidi3_compact):
Remove constraints.
...

which contains this change:
...
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index da1dfe9..2d9502b 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -2244,16 +2244,9 @@


 (define_expand "udivsi3"
-  [(set (match_dup 3) (symbol_ref:SI "__udivsi3"))
-   (set (reg:SI R4_REG) (match_operand:SI 1 "general_operand" ""))
-   (set (reg:SI R5_REG) (match_operand:SI 2 "general_operand" ""))
-   (parallel [(set (match_operand:SI 0 "register_operand" "")
-  (udiv:SI (reg:SI R4_REG)
-   (reg:SI R5_REG)))
- (clobber (reg:SI T_REG))
- (clobber (reg:SI PR_REG))
- (clobber (reg:SI R4_REG))
- (use (match_dup 3))])]
+  [(set (match_operand:SI 0 "register_operand")
+   (udiv:SI (match_operand:SI 1 "general_operand")
+(match_operand:SI 2 "general_operand")))]
   ""
 {
   rtx last;
...

The "operands[3]" refers to the "(match_dup 3)" that was removed here.

[Bug target/82907] [8 regression] gcc.target/powerpc/p9-xxbr-1.c fails after r254464

2017-11-22 Thread carll at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82907

Carl Love  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #2 from Carl Love  ---
The fix for the regression was committed on 22/14/2017.  The commit number is
254732 by Carl Love

[Bug target/83111] [sh] stack smashing detected in gen_udivsi3

2017-11-22 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111

Tom de Vries  changed:

   What|Removed |Added

 Target||sh

--- Comment #1 from Tom de Vries  ---
Looking at insn-emit.c, we see:
...
/* src/gcc/config/sh/sh.md:2273 */
rtx
gen_udivsi3 (rtx operand0,
rtx operand1,
rtx operand2)
{
  rtx_insn *_val = 0;
  start_sequence ();
  {
rtx operands[3];
operands[0] = operand0;
operands[1] = operand1;
operands[2] = operand2;
#define FAIL return (end_sequence (), _val)
#define DONE return (_val = get_insns (),end_sequence (), _val)
// #line 2278 "src/gcc/config/sh/sh.md"
{
  rtx last;

  operands[3] = gen_reg_rtx (Pmode);
...

In other words, we declare an array with size 3: "rtx operands[3]", and then
write the 4th element: "operands[3] = gen_reg_rtx (Pmode)".

[Bug c++/80711] warn on non-const accessor member functions

2017-11-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80711

--- Comment #3 from Martin Sebor  ---
There is a warning like that in the middle-end: -Wsuggest-attribute=pure. 
Unfortunately, it's only good for functions that are actually emitted (i.e.,
not for C++ inline functions).

$ cat t.C && gcc -O2 -S -Wall -Wsuggest-attribute=pure t.C
typedef int X;

struct indirect_cmp {
  bool operator()(const X* l, const X* r);
};

bool indirect_cmp::operator()(const X* l, const X* r) { return *l < *r; }
t.C: In member function ‘bool indirect_cmp::operator()(const X*, const X*)’:
t.C:7:6: warning: function might be candidate for attribute ‘pure’
[-Wsuggest-attribute=pure]
 bool indirect_cmp::operator()(const X* l, const X* r) { return *l < *r; }
  ^~~~

[Bug tree-optimization/83104] [8 Regression] ICE: Segmentation fault

2017-11-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83104

--- Comment #4 from Marc Glisse  ---
Author: glisse
Date: Wed Nov 22 16:44:46 2017
New Revision: 255068

URL: https://gcc.gnu.org/viewcvs?rev=255068&root=gcc&view=rev
Log:
Avoid two_valued_val_range_p for pointers.

2017-11-22  Marc Glisse  

PR tree-optimization/83104
gcc/
* vr-values.c (simplify_stmt_using_ranges): Check integral argument,
not result.

gcc/testsuite/
* gcc.c-torture/compile/pr83104.c: New file.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr83104.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/vr-values.c

[Bug target/83111] New: [sh] stack smashing detected in gen_udivsi3

2017-11-22 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111

Bug ID: 83111
   Summary: [sh] stack smashing detected in gen_udivsi3
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

During a sh-linux-gnu build, I run into a build breaker:
...
sh/build/./gcc/xgcc -Bsh/build/./gcc/ -Bsh/install/sh-linux-gnu/bin/
-Bsh/install/sh-linux-gnu/lib/ -isystem sh/install/sh-linux-gnu/include
-isystem sh/install/sh-linux-gnu/sys-include-g -O2 -mb -O2  -g -O2 -DIN_GCC
 -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include   -fpic -DNO_FPSCR_VALUES -w -Wno-sync-nand -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic -DNO_FPSCR_VALUES
-w -Wno-sync-nand -I. -I. -I../../.././gcc -I/src/libgcc -I/src/libgcc/.
-I/src/libgcc/../gcc -I/src/libgcc/../include-o _moddi3.o -MT _moddi3.o -MD
-MP -MF _moddi3.dep -DL_moddi3 -c /src/libgcc/libgcc2.c   -fexceptions
-fnon-call-exceptions -fvisibility=hidden -DHIDE_EXPORTS
*** stack smashing detected ***: sh/build/./gcc/cc1 terminated
during RTL pass: expand
/src/libgcc/libgcc2.c: In function ‘__moddi3’:
/src/libgcc/libgcc2.c:1092:9: internal compiler error: Aborted
d0 = 1 / d0; /* Divide intentionally by zero.  */
~~~^~~~
0x109919b crash_signal
/src/gcc/toplev.c:325
0x175dbbe gen_udivsi3(rtx_def*, rtx_def*, rtx_def*)
sh/build/gcc/insn-emit.c:12919
0xdd4687 insn_gen_fn::operator()(rtx_def*, rtx_def*, rtx_def*) const
/src/gcc/recog.h:302
0xe85b15 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/src/gcc/optabs.c:7103
0xe733e3 expand_binop_directly
/src/gcc/optabs.c:1071
0xe738b2 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/src/gcc/optabs.c:1159
0xe75ead sign_expand_binop(machine_mode, optab_tag, optab_tag, rtx_def*,
rtx_def*, rtx_def*, int, optab_methods)
/src/gcc/optabs.c:1879
0xb097aa expand_divmod(int, tree_code, machine_mode, rtx_def*, rtx_def*,
rtx_def*, int)
/src/gcc/expmed.c:5091
0xb362c8 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/src/gcc/expr.c:8844
0x9747a9 expand_gimple_stmt_1
/src/gcc/cfgexpand.c:3713
0x974ad1 expand_gimple_stmt
/src/gcc/cfgexpand.c:3773
0x97e208 expand_gimple_basic_block
/src/gcc/cfgexpand.c:5774
0x97fa5e execute
/src/gcc/cfgexpand.c:6375
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
...

[Bug target/83110] New: Relocation error when taking address of protected function in shared library.

2017-11-22 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83110

Bug ID: 83110
   Summary: Relocation error when taking address of protected
function in shared library.
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yyc1992 at gmail dot com
  Target Milestone: ---

This is very similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
although that one is marked as fixed.
(This could be a dup of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19520 but
I can't really tell...)

The difference from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 is that
this now only happens for me with protected functions and not global variables.

The code to reproduce is

```
__attribute__((visibility("protected")))
void f()
{
}

// __attribute__((visibility("protected")))
// int f;

void f2(void (*cb)(void*))
{
cb((void*)&f);
}
```

Which gives the error
```
% LANG=C g++ a.cpp -o liba.so -pthread -fPIC -shared
/bin/ld: /tmp/ccvUACGZ.o: relocation R_X86_64_PC32 against protected symbol
`_Z1fv' can not be used when making a shared object
/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
```

[Bug fortran/83064] DO CONCURRENT inconsistent results

2017-11-22 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83064

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #3 from Dominique d'Humieres  ---
I confirm the results in comment 0 with revisions r254869 and r255053, except I
get 'always zero' with 'unrolled do-loop' and '-O1'.

With revision r254940, the 'unrolled do-loop' is parallelized with '-O1',
'-O2', and '-Ofast' only, with a wrong result for '-O1'. The other tests are
parallelized with '-O1' and '-O2' only, with a wrong result in both cases.

For all revisions the 'unrolled do-loop' is parallelized with
'-ftree-parallelize-loops=4 -Ofast' only, with the right result.

[Bug middle-end/83069] [8 Regression] internal compiler error: in from_gcov_type, at profile-count.h:676

2017-11-22 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83069

--- Comment #3 from H.J. Lu  ---
(In reply to seurer from comment #2)
> The specific revision this starts failing with is 254888.

This is r254888.

[Bug middle-end/83069] [8 Regression] internal compiler error: in from_gcov_type, at profile-count.h:676

2017-11-22 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83069

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-22
 Ever confirmed|0   |1

[Bug middle-end/83069] [8 Regression] internal compiler error: in from_gcov_type, at profile-count.h:676

2017-11-22 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83069

--- Comment #2 from seurer at gcc dot gnu.org ---
The specific revision this starts failing with is 254888.

[Bug target/82862] [8 Regression] SPEC CPU2006 465.tonto performance regression with r253975 (up to 40% drop for particular loop)

2017-11-22 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82862

Jan Hubicka  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
 CC||amker.cheng at gmail dot com,
   ||vmakarov at redhat dot com
   Assignee|hubicka at gcc dot gnu.org |unassigned at gcc dot 
gnu.org

--- Comment #5 from Jan Hubicka  ---
Adding Vladimir and Bin to CC. Perhaps they will have some ideas.
I think stack store/restore is not too confusing for RA (it would be nice to
get rid of it completely and get frame pointer back).

[Bug target/82268] [8 regression] i386/pr82196-1.c fail

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82268

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords|wrong-code  |
 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #6 from Jakub Jelinek  ---
Fixed.

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

--- Comment #5 from Martin Sebor  ---
Yes, exactly.  It's these unintended uses that are a common problem and that
the warning is designed to help prevent.  They are rare in carefully written
code bases like GCC but more common in software developed by less experienced
programmers.  Often they come up as code is being updated to comply with a
security policy (e.g., replace all strcpy/strcat calls with "safe bounded
functions").  The warning tries to avoid triggering for the safe uses where it
can but there is, unfortunately, not always a good way to do that.

[Bug target/83109] New: [CET] improper code generation for builtin_longjmp with -fcf-protection -mcet

2017-11-22 Thread igor.v.tsimbalist at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83109

Bug ID: 83109
   Summary: [CET] improper code generation for builtin_longjmp
with -fcf-protection -mcet
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: igor.v.tsimbalist at intel dot com
  Target Milestone: ---

As inssp instruction adust the shadow stack pointer (ssp) only by value in the
range of [0..255] there should be a loop generated to adjust ssp if the value
greater then 255.

Currently builtin_longjmp does one time adjustment with incssp.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #32 from Marek Polacek  ---
Should be fixed for GCC 8.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239
Bug 67239 depends on bug 60336, which changed state.

Bug 60336 Summary: empty struct value is passed differently in C and C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

   What|Removed |Added

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

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Marek Polacek  changed:

   What|Removed |Added

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

[Bug target/68355] C++ constexpr is passed on stack

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68355
Bug 68355 depends on bug 60336, which changed state.

Bug 60336 Summary: empty struct value is passed differently in C and C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

   What|Removed |Added

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

[Bug c/53871] Please warn about endless loops if they are obvious

2017-11-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53871

Eric Gallager  changed:

   What|Removed |Added

 CC||david at westcontrol dot com

--- Comment #9 from Eric Gallager  ---
*** Bug 80872 has been marked as a duplicate of this bug. ***

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #51 from Marek Polacek  ---
Implemented for GCC 8.

[Bug c/80872] There is no warning on accidental infinite loops

2017-11-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80872

Eric Gallager  changed:

   What|Removed |Added

 Status|SUSPENDED   |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Eric Gallager  ---
(In reply to Eric Gallager from comment #1)
> Confirmed that such a warning would be nice to have, but probably impossible
> to implement properly due to the halting problem. Thus setting status to
> SUSPENDED.

actually this is probably a dup of bug 53871

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

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #31 from Marek Polacek  ---
Author: mpolacek
Date: Wed Nov 22 16:06:18 2017
New Revision: 255066

URL: https://gcc.gnu.org/viewcvs?rev=255066&root=gcc&view=rev
Log:
PR c++/60336
PR middle-end/67239
PR target/68355
* c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* class.c (layout_class_type): Set DECL_PADDING_P on padding.
* decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
(grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P.

* calls.c (initialize_argument_information): Call
warn_parameter_passing_abi target hook.
(store_one_arg): Use 0 for empty record size.  Don't push 0 size
argument onto stack.
(must_pass_in_stack_var_size_or_pad): Return false for empty types.
* common.opt: Update -fabi-version description.
* config/i386/i386.c (init_cumulative_args): Set cum->warn_empty.
(ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of
int_size_in_bytes.
(ix86_is_empty_record): New function.
(ix86_warn_parameter_passing_abi): New function.
(TARGET_EMPTY_RECORD_P): Redefine.
(TARGET_WARN_PARAMETER_PASSING_ABI): Redefine.
* config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in (TARGET_EMPTY_RECORD_P,
TARGET_WARN_PARAMETER_PASSING_ABI): Add.
* dwarf2out.c (get_ultimate_context): Move to tree.c.
* explow.c (hard_function_value): Call arg_int_size_in_bytes
instead of int_size_in_bytes.
* expr.c (copy_blkmode_to_reg): Likewise.
* function.c (aggregate_value_p): Return 0 for empty types.
(assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target
hook.
(locate_and_pad_parm): Call arg size_in_bytes instead
size_in_bytes.
* lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P.
* stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P.
* target.def (empty_record_p, warn_parameter_passing_abi): New target
hooks.
* targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook.
(std_gimplify_va_arg_expr): Skip empty records.  Call
arg_size_in_bytes instead size_in_bytes.
* targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare.
* tree-core.h (tree_type_common): Add empty_flag.
(tree_decl_common): Update comments.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree.c (default_is_empty_type): New function.
(default_is_empty_record): New function.
(arg_int_size_in_bytes): New function.
(arg_size_in_bytes): New function.
(get_ultimate_context): New function.
* tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and
TRANSLATION_UNIT_WARN_EMPTY_P.
(default_is_empty_record, arg_int_size_in_bytes,
arg_size_in_bytes, get_ultimate_context): Declare.

* g++.dg/abi/empty12.C: New test.
* g++.dg/abi/empty12.h: New test.
* g++.dg/abi/empty12a.c: New test.
* g++.dg/abi/empty13.C: New test.
* g++.dg/abi/empty13.h: New test.
* g++.dg/abi/empty13a.c: New test.
* g++.dg/abi/empty14.C: New test.
* g++.dg/abi/empty14.h: New test.
* g++.dg/abi/empty14a.c: New test.
* g++.dg/abi/empty15.C: New test.
* g++.dg/abi/empty15.h: New test.
* g++.dg/abi/empty15a.c: New test.
* g++.dg/abi/empty16.C: New test.
* g++.dg/abi/empty16.h: New test.
* g++.dg/abi/empty16a.c: New test.
* g++.dg/abi/empty17.C: New test.
* g++.dg/abi/empty17.h: New test.
* g++.dg/abi/empty17a.c: New test.
* g++.dg/abi/empty18.C: New test.
* g++.dg/abi/empty18.h: New test.
* g++.dg/abi/empty18a.c: New test.
* g++.dg/abi/empty19.C: New test.
* g++.dg/abi/empty19.h: New test.
* g++.dg/abi/empty19a.c: New test.
* g++.dg/abi/empty20.C: New test.
* g++.dg/abi/empty21.C: New test.
* g++.dg/abi/empty22.C: New test.
* g++.dg/abi/empty22.h: New test.
* g++.dg/abi/empty22a.c: New test.
* g++.dg/abi/empty23.C: New test.
* g++.dg/abi/empty24.C: New test.
* g++.dg/abi/empty25.C: New test.
* g++.dg/abi/empty25.h: New test.
* g++.dg/abi/empty25a.c: New test.
* g++.dg/abi/empty26.C: New test.
* g++.dg/abi/empty26.h: New test.
* g++.dg/abi/empty26a.c: New test.
* g++.dg/abi/em

[Bug target/68355] C++ constexpr is passed on stack

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68355

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Wed Nov 22 16:06:18 2017
New Revision: 255066

URL: https://gcc.gnu.org/viewcvs?rev=255066&root=gcc&view=rev
Log:
PR c++/60336
PR middle-end/67239
PR target/68355
* c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* class.c (layout_class_type): Set DECL_PADDING_P on padding.
* decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
(grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P.

* calls.c (initialize_argument_information): Call
warn_parameter_passing_abi target hook.
(store_one_arg): Use 0 for empty record size.  Don't push 0 size
argument onto stack.
(must_pass_in_stack_var_size_or_pad): Return false for empty types.
* common.opt: Update -fabi-version description.
* config/i386/i386.c (init_cumulative_args): Set cum->warn_empty.
(ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of
int_size_in_bytes.
(ix86_is_empty_record): New function.
(ix86_warn_parameter_passing_abi): New function.
(TARGET_EMPTY_RECORD_P): Redefine.
(TARGET_WARN_PARAMETER_PASSING_ABI): Redefine.
* config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in (TARGET_EMPTY_RECORD_P,
TARGET_WARN_PARAMETER_PASSING_ABI): Add.
* dwarf2out.c (get_ultimate_context): Move to tree.c.
* explow.c (hard_function_value): Call arg_int_size_in_bytes
instead of int_size_in_bytes.
* expr.c (copy_blkmode_to_reg): Likewise.
* function.c (aggregate_value_p): Return 0 for empty types.
(assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target
hook.
(locate_and_pad_parm): Call arg size_in_bytes instead
size_in_bytes.
* lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P.
* stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P.
* target.def (empty_record_p, warn_parameter_passing_abi): New target
hooks.
* targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook.
(std_gimplify_va_arg_expr): Skip empty records.  Call
arg_size_in_bytes instead size_in_bytes.
* targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare.
* tree-core.h (tree_type_common): Add empty_flag.
(tree_decl_common): Update comments.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree.c (default_is_empty_type): New function.
(default_is_empty_record): New function.
(arg_int_size_in_bytes): New function.
(arg_size_in_bytes): New function.
(get_ultimate_context): New function.
* tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and
TRANSLATION_UNIT_WARN_EMPTY_P.
(default_is_empty_record, arg_int_size_in_bytes,
arg_size_in_bytes, get_ultimate_context): Declare.

* g++.dg/abi/empty12.C: New test.
* g++.dg/abi/empty12.h: New test.
* g++.dg/abi/empty12a.c: New test.
* g++.dg/abi/empty13.C: New test.
* g++.dg/abi/empty13.h: New test.
* g++.dg/abi/empty13a.c: New test.
* g++.dg/abi/empty14.C: New test.
* g++.dg/abi/empty14.h: New test.
* g++.dg/abi/empty14a.c: New test.
* g++.dg/abi/empty15.C: New test.
* g++.dg/abi/empty15.h: New test.
* g++.dg/abi/empty15a.c: New test.
* g++.dg/abi/empty16.C: New test.
* g++.dg/abi/empty16.h: New test.
* g++.dg/abi/empty16a.c: New test.
* g++.dg/abi/empty17.C: New test.
* g++.dg/abi/empty17.h: New test.
* g++.dg/abi/empty17a.c: New test.
* g++.dg/abi/empty18.C: New test.
* g++.dg/abi/empty18.h: New test.
* g++.dg/abi/empty18a.c: New test.
* g++.dg/abi/empty19.C: New test.
* g++.dg/abi/empty19.h: New test.
* g++.dg/abi/empty19a.c: New test.
* g++.dg/abi/empty20.C: New test.
* g++.dg/abi/empty21.C: New test.
* g++.dg/abi/empty22.C: New test.
* g++.dg/abi/empty22.h: New test.
* g++.dg/abi/empty22a.c: New test.
* g++.dg/abi/empty23.C: New test.
* g++.dg/abi/empty24.C: New test.
* g++.dg/abi/empty25.C: New test.
* g++.dg/abi/empty25.h: New test.
* g++.dg/abi/empty25a.c: New test.
* g++.dg/abi/empty26.C: New test.
* g++.dg/abi/empty26.h: New test.
* g++.dg/abi/empty26a.c: New test.
* g++.dg/abi/emp

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

--- Comment #50 from Marek Polacek  ---
Author: mpolacek
Date: Wed Nov 22 16:06:18 2017
New Revision: 255066

URL: https://gcc.gnu.org/viewcvs?rev=255066&root=gcc&view=rev
Log:
PR c++/60336
PR middle-end/67239
PR target/68355
* c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* class.c (layout_class_type): Set DECL_PADDING_P on padding.
* decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
(grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P.

* calls.c (initialize_argument_information): Call
warn_parameter_passing_abi target hook.
(store_one_arg): Use 0 for empty record size.  Don't push 0 size
argument onto stack.
(must_pass_in_stack_var_size_or_pad): Return false for empty types.
* common.opt: Update -fabi-version description.
* config/i386/i386.c (init_cumulative_args): Set cum->warn_empty.
(ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of
int_size_in_bytes.
(ix86_is_empty_record): New function.
(ix86_warn_parameter_passing_abi): New function.
(TARGET_EMPTY_RECORD_P): Redefine.
(TARGET_WARN_PARAMETER_PASSING_ABI): Redefine.
* config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in (TARGET_EMPTY_RECORD_P,
TARGET_WARN_PARAMETER_PASSING_ABI): Add.
* dwarf2out.c (get_ultimate_context): Move to tree.c.
* explow.c (hard_function_value): Call arg_int_size_in_bytes
instead of int_size_in_bytes.
* expr.c (copy_blkmode_to_reg): Likewise.
* function.c (aggregate_value_p): Return 0 for empty types.
(assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target
hook.
(locate_and_pad_parm): Call arg size_in_bytes instead
size_in_bytes.
* lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P.
* stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P.
* target.def (empty_record_p, warn_parameter_passing_abi): New target
hooks.
* targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook.
(std_gimplify_va_arg_expr): Skip empty records.  Call
arg_size_in_bytes instead size_in_bytes.
* targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare.
* tree-core.h (tree_type_common): Add empty_flag.
(tree_decl_common): Update comments.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree.c (default_is_empty_type): New function.
(default_is_empty_record): New function.
(arg_int_size_in_bytes): New function.
(arg_size_in_bytes): New function.
(get_ultimate_context): New function.
* tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and
TRANSLATION_UNIT_WARN_EMPTY_P.
(default_is_empty_record, arg_int_size_in_bytes,
arg_size_in_bytes, get_ultimate_context): Declare.

* g++.dg/abi/empty12.C: New test.
* g++.dg/abi/empty12.h: New test.
* g++.dg/abi/empty12a.c: New test.
* g++.dg/abi/empty13.C: New test.
* g++.dg/abi/empty13.h: New test.
* g++.dg/abi/empty13a.c: New test.
* g++.dg/abi/empty14.C: New test.
* g++.dg/abi/empty14.h: New test.
* g++.dg/abi/empty14a.c: New test.
* g++.dg/abi/empty15.C: New test.
* g++.dg/abi/empty15.h: New test.
* g++.dg/abi/empty15a.c: New test.
* g++.dg/abi/empty16.C: New test.
* g++.dg/abi/empty16.h: New test.
* g++.dg/abi/empty16a.c: New test.
* g++.dg/abi/empty17.C: New test.
* g++.dg/abi/empty17.h: New test.
* g++.dg/abi/empty17a.c: New test.
* g++.dg/abi/empty18.C: New test.
* g++.dg/abi/empty18.h: New test.
* g++.dg/abi/empty18a.c: New test.
* g++.dg/abi/empty19.C: New test.
* g++.dg/abi/empty19.h: New test.
* g++.dg/abi/empty19a.c: New test.
* g++.dg/abi/empty20.C: New test.
* g++.dg/abi/empty21.C: New test.
* g++.dg/abi/empty22.C: New test.
* g++.dg/abi/empty22.h: New test.
* g++.dg/abi/empty22a.c: New test.
* g++.dg/abi/empty23.C: New test.
* g++.dg/abi/empty24.C: New test.
* g++.dg/abi/empty25.C: New test.
* g++.dg/abi/empty25.h: New test.
* g++.dg/abi/empty25a.c: New test.
* g++.dg/abi/empty26.C: New test.
* g++.dg/abi/empty26.h: New test.
* g++.dg/abi/empty26a.c: New test.
* g++.dg/abi/em

[Bug c++/82401] [8 Regression] error: qsort comparator non-negative on sorted output: 1 in insert_late_enum_def_bindings on an invalid code

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82401

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #1 from Jakub Jelinek  ---
Created attachment 42683
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42683&action=edit
gcc8-pr82401.patch

Untested fix.

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

--- Comment #4 from Jakub Jelinek  ---
(In reply to Martin Sebor from comment #3)
> The warning for strncat helps find similar bugs as for strncpy: defeating
> the size constraint by specifying the length of the source rather than the
> amount of space in the destination:
> 
>   strncat (d, s, strlen (s));
> 
> This is, of course, equivalent to strcat (d, s) and so an
> unnecessary/unintended use of the function.  Similar recommendation as for
> strncpy also applies to strncat:
> 
>   strncat (d, s, sizeof d - strlen (d) - 1);
> 
> See for example:
> https://www.us-cert.gov/bsi/articles/knowledge/coding-practices/strncpy-and-
> strncat
> 
> The GCC code happens to be safe but there's no good way to distinguish safe
> but unintended uses from unsafe ones and so the warning errs on the side of
> caution.

Only if you misuse strncat for something it has not been designed for.
If you already compute strlen (d), it makes no sense to use a function that
needs to compute it again.
See e.g. https://en.wikipedia.org/wiki/C_string_handling on what it says about
these functions.  target.c uses strncat properly, trying to use it for security
purposes of not overflowing destination is typically just a bug.

[Bug tree-optimization/66264] [untaken optimization] switch & enums without default-case

2017-11-22 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66264

Martin Jambor  changed:

   What|Removed |Added

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

--- Comment #5 from Martin Jambor  ---
So I did not do it, but this is now working as requested in trunk (and I
believe also gcc 7) and switch conversion loads the value from a table.

[Bug c++/59930] template friend declarations, namespaces, and explicit instantiations don't mix

2017-11-22 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59930

--- Comment #2 from Nathan Sidwell  ---
When we parse the template friend declaration, we're not injecting an invisible
template decl into the enclosing namespace.

When we instantiate the template we do an unqualified lookup (and ask for
hidden objects) from the enclosing namespace. 

In the first testcase, this fails to find anything.  Then we explicitly inject
into the global scope, as Richard surmised:
  /* The friend template has not already been declared.  In this
 case, the instantiation of the template class will cause the
 injection of this template into the global scope.  */
That just seems wrong.  Perhaps it was right at some point?

In the second testcase we perform the unqualified lookup, but find the ::B, as
it's declared at the point of the instantiation.  So we make it a friend.  Bah.

10.3.1.2/3 talks about invisible friend injection, and AFAICT doesn't prohibit
that happening during template parsing time.

[Bug tree-optimization/83007] [8 Regression] -Wstringop-overflow false positive

2017-11-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83007

Martin Sebor  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83106

--- Comment #4 from Martin Sebor  ---
The target.c use is safe but indistinguishable from the common unsafe use case:

  strncat (d, s, strlen (s));

This latter use case is what the warning is designed to help prevent.  See also
bug 83106 for some more background.

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

--- Comment #3 from Martin Sebor  ---
The warning for strncat helps find similar bugs as for strncpy: defeating the
size constraint by specifying the length of the source rather than the amount
of space in the destination:

  strncat (d, s, strlen (s));

This is, of course, equivalent to strcat (d, s) and so an
unnecessary/unintended use of the function.  Similar recommendation as for
strncpy also applies to strncat:

  strncat (d, s, sizeof d - strlen (d) - 1);

See for example:
https://www.us-cert.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat

The GCC code happens to be safe but there's no good way to distinguish safe but
unintended uses from unsafe ones and so the warning errs on the side of
caution.

[Bug tree-optimization/83007] [8 Regression] -Wstringop-overflow false positive

2017-11-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83007

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
(In reply to Martin Sebor from comment #1)
> A common mistake with strncat is to specify as the bound the source of the
> source string (instead of the remaining space in the destination), as in:

That doesn't really make sense to me.  If you know the remaining space in the
destination, that would mean also you know the length of the string in the
destination; then you should just use the known location of the '\0' as the
spot to memcpy + termination.
target.c uses strncat for a completely different purpose, which better matches
what the function does - sometimes it wants to copy the whole src string, but
sometimes just a portion of it and that is what is specified by the third
strncat argument.

[Bug target/82862] [8 Regression] SPEC CPU2006 465.tonto performance regression with r253975 (up to 40% drop for particular loop)

2017-11-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82862

--- Comment #4 from Richard Biener  ---
I don't have any good ideas here.  Fortran with allocated arrays tends to use
quite some integer registers for all the IV setup and computation.

One can experiment with less peeling of vector epilogues (--param
max-completely-peel-times=1) as well as maybe adding another code sinking pass.
 In the end
it's intelligent remat of expressions (during RA) that needs to be done as I
fully expect not having enough integer registers to compute and keep live
everything.

There seems to be missed invariant motion on the GIMPLE side and also
stack allocation in an inner loop which we might be able to hoist.  Maybe
that (__builtin_stack_save/restore) confuses RA.

Those builtins confuse LIM at least (a present memcpy does as well, and
we expand that to a libcall).  -fno-tree-loop-distribute-patterns helps for
that.

But even then we still spill a lot.  Thus, try
-fno-tree-loop-distribute-patterns plus

Index: gcc/tree-ssa-loop-im.c
===
--- gcc/tree-ssa-loop-im.c  (revision 255051)
+++ gcc/tree-ssa-loop-im.c  (working copy)
@@ -1432,7 +1432,10 @@ gather_mem_refs_stmt (struct loop *loop,
   bool is_stored;
   unsigned id;

-  if (!gimple_vuse (stmt))
+  if (!gimple_vuse (stmt)
+  || gimple_call_builtin_p (stmt, BUILT_IN_STACK_SAVE)
+  || gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE)
+  || gimple_call_builtin_p (stmt, BUILT_IN_ALLOCA_WITH_ALIGN))
 return;

   mem = simple_mem_ref_in_stmt (stmt, &is_stored);

[Bug c/83108] Unaligned 128bit dereference causes segfault with -O2 on x86-64

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83108

--- Comment #4 from Markus Trippelsdorf  ---
(In reply to Jon Levell from comment #3)
> I'm surprised this was closed invalid.
> 
> "While the x86 architecture originally did not require aligned memory
> access, and still works without it, some SSE2 instructions on x86 CPUs do
> require the data to be 128-bit (16-byte) aligned"
> 
> I'm not doing anything SSE2 related. I'm surprised this is considered
> undefined behaviour?

It has nothing to do with SSE2. GCC simply assumes that __uint128_t is
16byte alignmented and optimizes accordingly (clang does the same).

[Bug libgomp/83106] [8 regression] libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=]

2017-11-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83106

Martin Sebor  changed:

   What|Removed |Added

 CC||mliska at suse dot cz

--- Comment #2 from Martin Sebor  ---
Martin Liska has a patch out for review to fix this warning:
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01763.html

[Bug c/83108] Unaligned 128bit dereference causes segfault with -O2 on x86-64

2017-11-22 Thread gcc-bugspam at coralbark dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83108

--- Comment #3 from Jon Levell  ---
I'm surprised this was closed invalid.

"While the x86 architecture originally did not require aligned memory access,
and still works without it, some SSE2 instructions on x86 CPUs do require the
data to be 128-bit (16-byte) aligned"

I'm not doing anything SSE2 related. I'm surprised this is considered undefined
behaviour?

[Bug c/83108] Unaligned 128bit dereference causes segfault with -O2 on x86-64

2017-11-22 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83108

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #2 from Markus Trippelsdorf  ---
unsigned __int128 always needs 16 byte alignement, otherwise you are invoking
undefined behavior.

[Bug c/83108] Unaligned 128bit dereference causes segfault with -O2 on x86-64

2017-11-22 Thread gcc-bugspam at coralbark dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83108

--- Comment #1 from Jon Levell  ---
Created attachment 42682
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42682&action=edit
Plain source file

[Bug c/83108] New: Unaligned 128bit dereference causes segfault with -O2 on x86-64

2017-11-22 Thread gcc-bugspam at coralbark dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83108

Bug ID: 83108
   Summary: Unaligned 128bit dereference causes segfault with -O2
on x86-64
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc-bugspam at coralbark dot net
  Target Milestone: ---

Created attachment 42681
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42681&action=edit
Preprocessed Source file

If I have a __uint128_t *unalignedPtr
Which points to an 8 byte (but not 16 byte) location then
*unalignedPtr = 0;
causes a seg fault on my x86-64 machine using:
gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

I'm attaching the example source file and the preprocessed source.

I compile with (to see the problem):
 gcc -O2 128alignchk.c -o 128alignchk

I've tried turning on individual optimisation to track down the problem but if
I compile with:
gcc -O1 -fthread-jumps -falign-functions  -falign-jumps -falign-loops 
-falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps 
-fcse-skip-blocks -fdelete-null-pointer-checks -fdevirtualize
-fdevirtualize-speculatively -fexpensive-optimizations -fgcse  -fgcse-lm 
-fhoist-adjacent-loads -finline-small-functions -findirect-inlining -fipa-cp
-fipa-bit-cp -fipa-vrp -fipa-sra -fipa-icf
-fisolate-erroneous-paths-dereference -flra-remat -foptimize-sibling-calls
-foptimize-strlen -fpartial-inlining -fpeephole2 -freorder-blocks-algorithm=stc
-freorder-blocks-and-partition -freorder-functions -frerun-cse-after-loop 
-fsched-interblock  -fsched-spec   -fschedule-insns2 -fstore-merging
-fstrict-aliasing -ftree-builtin-call-dce -ftree-switch-conversion
-ftree-tail-merge -fcode-hoisting -ftree-pre -ftree-vrp -fipa-ra
-fstrict-overflow -fvect-cost-model=cheap 128alignchk.c -o 128alignchk

The resulting binary works fine (even though the output of -Q --help=optimizers
is the same as with -O2).

[Bug go/83102] [8 Regression] go bootstrap error in ast-dump.cc due to __is_invocable failure

2017-11-22 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83102

Ian Lance Taylor  changed:

   What|Removed |Added

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

--- Comment #9 from Ian Lance Taylor  ---
Should be fixed.

  1   2   >