[Bug bootstrap/77749] New: [7 Regression] profiledbootstrap broken

2016-09-27 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

Bug ID: 77749
   Summary: [7 Regression] profiledbootstrap broken
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

During stageprofile:
...
echo timestamp > s-genrtl-h
build/genhooks "Target Hook" \
 > tmp-target-hooks-def.h
/bin/sh: line 1: 24501 Aborted build/genhooks "Target Hook" >
tmp-target-hooks-def.h
make[3]: *** [Makefile:2368: s-target-hooks-def-h] Error 134
make[3]: *** Waiting for unfinished jobs


Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58  }
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x77a7685d in __GI_abort () at abort.c:89
#2  0x00409ad0 in __gcov_merge_delta (counters=,
n_counters=) at ../../../gcc/libgcc/libgcov-merge.c:147
#3  0x0040db1f in merge_one_data (crc32=2359460089,
eof_pos_p=, summary_pos_p=,
this_prg=0x7fff9c40, prg_p=0x7fffb410,
gi_ptr=0x416420, filename=0x41a010
"/var/tmp/gcc_build_dir_/libiberty/xexit.gcda") at
../../../gcc/libgcc/libgcov-driver.c:476
#4  dump_one_gcov (all_prg=, this_prg=0x7fff9c40,
crc32=2359460089, run_counted=0, gf=, gi_ptr=0x416420)
at ../../../gcc/libgcc/libgcov-driver.c:791
#5  gcov_do_dump (list=, run_counted=0) at
../../../gcc/libgcc/libgcov-driver.c:850
#6  0x0040dea2 in __gcov_dump_one (root=0x419c00 <__gcov_root>) at
../../../gcc/libgcc/libgcov-driver.c:862
#7  gcov_exit () at ../../../gcc/libgcc/libgcov-driver.c:878
#8  0x77a79830 in __run_exit_handlers (status=1, listp=0x77dd1598
<__exit_funcs>, run_list_atexit=run_list_atexit@entry=true,
run_dtors=run_dtors@entry=true)
at exit.c:83
#9  0x77a798ba in __GI_exit (status=) at exit.c:105
#10 0x77a5f2d8 in __libc_start_main (main=0x401680 ,
argc=3, argv=0x7fffe518, init=, fini=,
rtld_fini=, stack_end=0x7fffe508) at
../csu/libc-start.c:320
#11 0x00403a5a in _start () at ../sysdeps/x86_64/start.S:120

[Bug tree-optimization/77745] [5/6/7 Regression] Inconsistent application of aliasing rules

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77745

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #6 from Richard Biener  ---
Mine.  I believe the testcase is valid.  If c1 == c2 you can use p1 to access
the object at p3 as p1 == p3.

Both FRE and DSE remove the store but FRE removes the wrong one.  I thought I
had fixed this one... (DOM contains similar code but it doesn't remove either).

[Bug middle-end/77740] [7 regression] internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1165

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77740

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Confirmed on x86_64-linux-gnu with: gcc pr77740.i -c -O1 -Wall -m32

Started with r240298

[Bug c/77750] New: gcc build not working with -O0

2016-09-27 Thread lkrupp at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750

Bug ID: 77750
   Summary: gcc build not working with -O0
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lkrupp at gcc dot gnu.org
  Target Milestone: ---

Created attachment 39694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39694&action=edit
Possible patch (correctly formatted magic "fall through" comments)

Within the last day or so, building GCC with this command:

make BOOT_CFLAGS='-O0' CFLAGS_FOR_TARGET='-O0' CFLAGS_FOR_BUILD='-O0'

started failing with these warnings, which are treated as errors:

../../gcc_trunk/gcc/combine.c: In function 'rtx_code
simplify_compare_const(rtx_code, machine_mode, rtx, rtx_def**)':
../../gcc_trunk/gcc/combine.c:11364:7: error: this statement may fall through
[-Werror=implicit-fallthrough]
   if (const_op > 0)
   ^~
../../gcc_trunk/gcc/combine.c:11373:5: note: here
 case LE:
 ^~~~
../../gcc_trunk/gcc/combine.c:11393:7: error: this statement may fall through
[-Werror=implicit-fallthrough]
   if (const_op > 0)
   ^~
../../gcc_trunk/gcc/combine.c:11402:5: note: here
 case GT:
 ^~~~
../../gcc_trunk/gcc/combine.c: In function 'rtx_code
simplify_comparison(rtx_code, rtx_def**, rtx_def**)':
../../gcc_trunk/gcc/combine.c:11924:4: error: this statement may fall through
[-Werror=implicit-fallthrough]
if (subreg_lowpart_p (op0)
^~
../../gcc_trunk/gcc/combine.c:11932:2: note: here
  case ZERO_EXTEND:
  ^~~~
../../gcc_trunk/gcc/combine.c:12340:6: error: this statement may fall through
[-Werror=implicit-fallthrough]
  }
  ^
../../gcc_trunk/gcc/combine.c:12343:2: note: here
  case LSHIFTRT:
  ^~~~
../../gcc_trunk/gcc/fold-const.c: In function 'tree_node*
extract_muldiv_1(tree, tree, tree_code, tree, bool*)':
../../gcc_trunk/gcc/fold-const.c:6276:7: error: this statement may fall through
[-Werror=implicit-fallthrough]
   if ((code == TRUNC_MOD_EXPR || code == CEIL_MOD_EXPR
   ^~
../../gcc_trunk/gcc/fold-const.c:6289:5: note: here
 case TRUNC_DIV_EXPR:  case CEIL_DIV_EXPR:  case FLOOR_DIV_EXPR:
 ^~~~

The build works without the '-O0' flags.

[Bug bootstrap/77749] [7 Regression] profiledbootstrap broken

2016-09-27 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf  ---
Started with r240492:

commit 925add3b860b09960735cac1509285412a7712b4
Author: marxin 
Date:   Mon Sep 26 11:04:18 2016 +

Remove HIST_TYPE_CONST_DELTA counter type (PR gcov-profile/23332)

[Bug middle-end/77740] [7 regression] internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1165

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77740

--- Comment #3 from Martin Liška  ---
Minimal test-case:

char *MSVCRT__ecvt_data_0;

void foo()
{
  __builtin_snprintf (MSVCRT__ecvt_data_0, 0, "%.*le");
}

On x86_64-linux-gnu, minimal command line causing the ICE:
$ gcc pr77740.i -Wformat

pr77740.i:3:6: internal compiler error: in gimple_call_arg, at gimple.h:3156
 void foo()
  ^~~
0x12686d5 gimple_call_arg
../../gcc/gimple.h:3156
0x126872b gimple_call_arg
../../gcc/gimple.h:3164
0x126d719 compute_format_length
../../gcc/gimple-ssa-sprintf.c:2212
0x126e65f handle_gimple_call
../../gcc/gimple-ssa-sprintf.c:2654
0x126e767 execute
../../gcc/gimple-ssa-sprintf.c:2680

[Bug c/77750] gcc build not working with -O0

2016-09-27 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750

--- Comment #1 from Andrew Pinski  ---
Comment on attachment 39694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39694
Possible patch (correctly formatted magic "fall through" comments)

>Index: gcc/combine.c
>===
>--- gcc/combine.c  (revision 240520)
>+++ gcc/combine.c  (working copy)
>@@ -11370,6 +11370,8 @@ simplify_compare_const (enum rtx_code code, machin
>   else
>   break;
> 
>+  /* fall through.  */
>+

Yes this is correct  but maybe it is better to rewrite this code slightly:
  if (const_op <= 0)
break;

  const_op -= 1;
  code = LE;
  /* fall through.  */


> case LE:
>   /* <= C is equivalent to < (C + 1); we do this for C < 0  */
>   if (const_op < 0)
>@@ -11399,6 +11401,8 @@ simplify_compare_const (enum rtx_code code, machin
>   else
>   break;
> 
>+  /* fall through.  */

Likewise.

>+
> case GT:
>   /* > C is equivalent to >= (C + 1); we do this for C < 0.  */
>   if (const_op < 0)
>@@ -11927,7 +11931,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0
> else
>   break;
> 
>-/* ... fall through ...  */
>+/* fall through.  */

Likewise.

> 
>   case ZERO_EXTEND:
> mode = GET_MODE (XEXP (op0, 0));
>@@ -12339,7 +12343,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0
> continue;
>   }
> 
>-/* ... fall through ...  */
>+/* fall through.  */

Do something similar:
  /* If the inner mode is narrower and we are extracting the low part,
 we can treat the SUBREG as if it were a ZERO_EXTEND.  */
  if (!subreg_lowpart_p (op0)
  &|| GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))) >=
mode_width)
break;

  /* fall through  */


>+
>   case LSHIFTRT:
> /* If we have (compare (xshiftrt FOO N) (const_int C)) and
>the low order N bits of FOO are known to be zero, we can do this
>Index: gcc/fold-const.c
>===
>--- gcc/fold-const.c   (revision 240520)
>+++ gcc/fold-const.c   (working copy)
>@@ -6284,7 +6284,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code c
> return omit_one_operand (type, integer_zero_node, op0);
>   }
> 
>-  /* ... fall through ...  */
>+  /* fall through.  */

This one is obvious.

> 
> case TRUNC_DIV_EXPR:  case CEIL_DIV_EXPR:  case FLOOR_DIV_EXPR:
> case ROUND_DIV_EXPR:  case EXACT_DIV_EXPR:

[Bug c/77750] [7 Regression] gcc build not working with -O0

2016-09-27 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||build
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
   Target Milestone|--- |7.0
Summary|gcc build not working with  |[7 Regression] gcc build
   |-O0 |not working with -O0
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
.

[Bug bootstrap/77749] [7 Regression] profiledbootstrap broken

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #2 from Martin Liška  ---
Mine.

[Bug bootstrap/77749] [7 Regression] profiledbootstrap broken

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

Richard Biener  changed:

   What|Removed |Added

Version|unknown |7.0
   Target Milestone|--- |7.0

[Bug bootstrap/77751] New: [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread gerald at pfeifer dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

Bug ID: 77751
   Summary: [7 regression] cc1plus: error: unrecognized command
line option "-Wno-implicit-fallthrough" for
insn-emit.o
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerald at pfeifer dot com
CC: polacek at redhat dot com
  Target Milestone: ---

On i?86-unknown-freebsd9, which has GCC 4.2 as system compiler, bootstrap
started to fail as follows:

emit.TPo insn-emit.c
g++ -std=gnu++98 -fno-PIE -c   -g -DIN_GCC-fno-strict-aliasing
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -I. -I. -I/scratch/tmp/gerald/gcc-HEAD/gcc
-I/scratch/tmp/gerald/gcc-HEAD/gcc/.
-I/scratch/tmp/gerald/gcc-HEAD/gcc/../include -I./../intl
-I/scratch/tmp/gerald/gcc-HEAD/gcc/../libcpp/include
-I/home/gerald/9-amd64/include 
-I/scratch/tmp/gerald/gcc-HEAD/gcc/../libdecnumber
-I/scratch/tmp/gerald/gcc-HEAD/gcc/../libdecnumber/dpd -I../libdecnumber
-I/scratch/tmp/gerald/gcc-HEAD/gcc/../libbacktrace   -o insn-extract.o -MT
insn-extract.o -MMD -MP -MF ./.deps/insn-extract.TPo insn-extract.c
cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough"
gmake[3]: *** [Makefile:1102: insn-emit.o] Error 1
gmake[3]: *** Waiting for unfinished jobs
rm fsf-funding.pod gcov.pod gpl.pod cpp.pod gfdl.pod gcc.pod gcov-tool.pod
gmake[3]: Leaving directory '/scratch/tmp/gerald/OBJ-0927-0731/gcc'
gmake[2]: *** [Makefile:4571: all-stage1-gcc] Error 2
gmake[2]: Leaving directory '/scratch/tmp/gerald/OBJ-0927-0731'
gmake[1]: *** [Makefile:24240: stage1-bubble] Error 2
gmake[1]: Leaving directory '/scratch/tmp/gerald/OBJ-0927-0731'
gmake: *** [Makefile:24577: bootstrap] Error 2

I believe this is caused by

2016-09-26  Marek Polacek  

PR c/7652
* Makefile.in (insn-attrtab.o-warn, insn-dfatab.o-warn,
insn-latencytab.o-warn, insn-output.o-warn, insn-emit.o-warn): Add
-Wno-switch-fallthrough.

[Bug c/77750] [7 Regression] gcc build not working with -O0

2016-09-27 Thread louis.krupp at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750

--- Comment #3 from louis.krupp at zoho dot com ---
I agree.  But in the interests of reporting the bug and proposing a patch as
soon as possible, I decided to minimize the risk of unintended consequences by
keeping things as simple as I could.

If you like, I could follow your suggestions and clean this up and check it in,
but I wouldn't be able to do it tonight.  I believe I'm an hour ahead of you,
and I've learned that when I try to do things in a hurry, I usually regret it.

Louis


  On Tue, 27 Sep 2016 00:38:29 -0700 pinskia at gcc dot gnu.org
 wrote  
 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750 
 >  
 > --- Comment #1 from Andrew Pinski  --- 
 > Comment on attachment 39694 
 >   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39694 
 > Possible patch (correctly formatted magic "fall through" comments) 
 >  
 > >Index: gcc/combine.c 
 > >=== 
 > >--- gcc/combine.c(revision 240520) 
 > >+++ gcc/combine.c(working copy) 
 > >@@ -11370,6 +11370,8 @@ simplify_compare_const (enum rtx_code code, machin 
 > >   else 
 > > break; 
 > >  
 > >+  /* fall through.  */ 
 > >+ 
 >  
 > Yes this is correct  but maybe it is better to rewrite this code slightly: 
 >   if (const_op <= 0) 
 > break; 
 >  
 >   const_op -= 1; 
 >   code = LE; 
 >   /* fall through.  */ 
 >  
 >  
 > > case LE: 
 > >   /* <= C is equivalent to < (C + 1); we do this for C < 0  */ 
 > >   if (const_op < 0) 
 > >@@ -11399,6 +11401,8 @@ simplify_compare_const (enum rtx_code code, machin 
 > >   else 
 > > break; 
 > >  
 > >+  /* fall through.  */ 
 >  
 > Likewise. 
 >  
 > >+ 
 > > case GT: 
 > >   /* > C is equivalent to >= (C + 1); we do this for C < 0.  */ 
 > >   if (const_op < 0) 
 > >@@ -11927,7 +11931,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0 
 > >   else 
 > > break; 
 > >  
 > >-  /* ... fall through ...  */ 
 > >+  /* fall through.  */ 
 >  
 > Likewise. 
 >  
 > >  
 > > case ZERO_EXTEND: 
 > >   mode = GET_MODE (XEXP (op0, 0)); 
 > >@@ -12339,7 +12343,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0 
 > >   continue; 
 > > } 
 > >  
 > >-  /* ... fall through ...  */ 
 > >+  /* fall through.  */ 
 >  
 > Do something similar: 
 >   /* If the inner mode is narrower and we are extracting the low
part, 
 >  we can treat the SUBREG as if it were a ZERO_EXTEND.  */ 
 >   if (!subreg_lowpart_p (op0) 
 >   &|| GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))) >= 
 > mode_width) 
 > break; 
 >  
 >   /* fall through  */ 
 >  
 >  
 > >+ 
 > > case LSHIFTRT: 
 > >   /* If we have (compare (xshiftrt FOO N) (const_int C)) and 
 > >  the low order N bits of FOO are known to be zero, we can do this 
 > >Index: gcc/fold-const.c 
 > >=== 
 > >--- gcc/fold-const.c(revision 240520) 
 > >+++ gcc/fold-const.c(working copy) 
 > >@@ -6284,7 +6284,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code c 
 > >   return omit_one_operand (type, integer_zero_node, op0); 
 > > } 
 > >  
 > >-  /* ... fall through ...  */ 
 > >+  /* fall through.  */ 
 >  
 > This one is obvious. 
 >  
 > >  
 > > case TRUNC_DIV_EXPR:  case CEIL_DIV_EXPR:  case FLOOR_DIV_EXPR: 
 > > case ROUND_DIV_EXPR:  case EXACT_DIV_EXPR: 
 >  
 > --  
 > You are receiving this mail because: 
 > You reported the bug.

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

--- Comment #1 from Andrew Pinski  ---
Oh yes older gcc complain about non-existent negative warning options.

[Bug fortran/77666] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:471

2016-09-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77666

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Sep 27 07:52:28 2016
New Revision: 240522

URL: https://gcc.gnu.org/viewcvs?rev=240522&root=gcc&view=rev
Log:
PR fortran/77666
* trans-openmp.c (gfc_omp_private_outer_ref): Return true even for
references to allocatable arrays.

* gfortran.dg/gomp/pr77666.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/gomp/pr77666.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-openmp.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/77752] New: ICE on C++ code on x86_64-linux-gnu (internal compiler error: Segmentation fault, build_list_conv, implicit_conversion)

2016-09-27 Thread chengniansun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77752

Bug ID: 77752
   Summary: ICE on C++ code on x86_64-linux-gnu (internal compiler
error: Segmentation fault, build_list_conv,
implicit_conversion)
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160926 (experimental) [trunk revision 240511] (GCC) 
$ 
$ gcc-trunk small.C
small.C: In function ‘void f(std::initializer_list)’:
small.C:4:30: error: ‘l’ has incomplete type
 void f(std::initializer_list l) { f({2}); }
  ^
small.C:2:7: note: forward declaration of ‘class std::initializer_list’
 class initializer_list;
   ^~~~
small.C:4:40: internal compiler error: Segmentation fault
 void f(std::initializer_list l) { f({2}); }
^
0xdcb7df crash_signal
../../gcc-source-trunk/gcc/toplev.c:337
0x650c8d tree_check
../../gcc-source-trunk/gcc/tree.h:3030
0x650c8d build_list_conv
../../gcc-source-trunk/gcc/cp/call.c:788
0x650c8d implicit_conversion
../../gcc-source-trunk/gcc/cp/call.c:1816
0x65c7e8 add_function_candidate
../../gcc-source-trunk/gcc/cp/call.c:2142
0x64ee06 add_candidates
../../gcc-source-trunk/gcc/cp/call.c:5410
0x6628cc perform_overload_resolution
../../gcc-source-trunk/gcc/cp/call.c:4067
0x662abe build_new_function_call(tree_node*, vec**, bool, int)
../../gcc-source-trunk/gcc/cp/call.c:4144
0x806718 finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc-source-trunk/gcc/cp/semantics.c:2440
0x77edcb cp_parser_postfix_expression
../../gcc-source-trunk/gcc/cp/parser.c:6937
0x787b82 cp_parser_unary_expression
../../gcc-source-trunk/gcc/cp/parser.c:8019
0x7886a7 cp_parser_cast_expression
../../gcc-source-trunk/gcc/cp/parser.c:8696
0x788c73 cp_parser_binary_expression
../../gcc-source-trunk/gcc/cp/parser.c:8798
0x789563 cp_parser_assignment_expression
../../gcc-source-trunk/gcc/cp/parser.c:9086
0x78c069 cp_parser_expression
../../gcc-source-trunk/gcc/cp/parser.c:9253
0x78c7f8 cp_parser_expression_statement
../../gcc-source-trunk/gcc/cp/parser.c:10771
0x77a87a cp_parser_statement
../../gcc-source-trunk/gcc/cp/parser.c:10587
0x77b7d5 cp_parser_statement_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:10913
0x77b8af cp_parser_compound_statement
../../gcc-source-trunk/gcc/cp/parser.c:10867
0x799753 cp_parser_function_body
../../gcc-source-trunk/gcc/cp/parser.c:20887
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$ 
$ cat small.C
namespace std {
class initializer_list;
}
void f(std::initializer_list l) { f({2}); }

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
   Host||i?86-unknown-freebsd9
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Confirmed.  You can't do this for flags not present in all GG supported for
stage1.  See how -Wno-error is used instead of a specific warning on other
objects for the very same reason.

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

Bernd Edlinger  changed:

   What|Removed |Added

 CC||bernd.edlinger at hotmail dot 
de

--- Comment #4 from Bernd Edlinger  ---
Yes.  m68k seems to have similar problems:

https://gcc.gnu.org/ml/gcc-testresults/2016-09/msg02465.html

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #5 from Bernd Edlinger  ---
I think the problem is that tree libstdc++ functions are called,
but the basic_string structure has been c-reduced.
Especially _Alloc_hider, but when that is removed the test
case does no longer reproduce the original problem

But at least tow externals can be removed easily.
Does this work?

--- pr77550.C.orig  2016-09-27 10:05:17.812179103 +0200
+++ pr77550.C   2016-09-27 10:13:50.407075199 +0200
@@ -231,9 +231,8 @@
   } _M_dataplus;
   size_type _M_string_length;
   enum { _S_local_capacity = 15 } _M_local_buf[_S_local_capacity];
-  pointer _M_local_data();
-  void _M_set_length(size_type);
-  basic_string() : _M_dataplus(_M_local_data()) { _M_set_length(0); }
+  pointer _M_local_data() { return 0; }
+  basic_string() : _M_dataplus(_M_local_data()) {}
   basic_string(const basic_string &) : _M_dataplus(0) {}
   size_type size() { return _M_string_length; }
   char *data() const {}

[Bug bootstrap/77753] New: [7 Regression] broken profiledbootstrap due to -Werror=format-length in varasm.c:1573

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77753

Bug ID: 77753
   Summary: [7 Regression] broken profiledbootstrap due to
-Werror=format-length in varasm.c:1573
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Running profiledbootstrap on a ppc64le machine:

../../gcc/varasm.c: In function ‘void
default_named_section_asm_out_destructor(rtx, int)’:
../../gcc/varasm.c:1573:1: error: ‘%.5u’ directive writing between 5 and 10
bytes into a region of size 9 [-Werror=format-length=]
 default_named_section_asm_out_destructor (rtx symbol, int priority)
 ^~~~
../../gcc/varasm.c:1573:1: note: directive argument in the range [-2147418112,
2147483647]
../../gcc/varasm.c:1568:7: note: format output between 13 and 18 bytes into a
destination of size 16
 p);
   ^
../../gcc/varasm.c: In function ‘void
default_named_section_asm_out_constructor(rtx, int)’:
../../gcc/varasm.c:1596:1: error: ‘%.5u’ directive writing between 5 and 10
bytes into a region of size 9 [-Werror=format-length=]
 default_named_section_asm_out_constructor (rtx symbol, int priority)
 ^
../../gcc/varasm.c:1596:1: note: directive argument in the range [-2147418112,
2147483647]
../../gcc/varasm.c:1568:7: note: format output between 13 and 18 bytes into a
destination of size 16
 p);


code snippet:

  char buf[16];

  /* ??? This only works reliably with the GNU linker.  */
  sprintf (buf, "%s.%.5u",
   constructor_p ? ".ctors" : ".dtors",
   /* Invert the numbering so the linker puts us in the proper
  order; constructors are run from right to left, and the
  linker sorts in increasing order.  */
   MAX_INIT_PRIORITY - priority);

I'm wondering whether "%.5u" format (limiting output to 5 digits) is really
supported by sprintf?
If not, I guess we should either increase buffer size. Can sprintf format check
utilize VRP information?

[Bug lto/77754] New: internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread laurent.alfonsi at st dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

Bug ID: 77754
   Summary: internal compiler error : tree code 'call_expr' is not
supported in LTO streams
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: laurent.alfonsi at st dot com
  Target Milestone: ---

Created attachment 39695
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39695&action=edit
testcase

Hi,

I am obtaining a ICE in LTO phase, when passing the enclosed example using a
nested function with a variable length array parameter :
  -
  <>
  int fn3();

  void fn1() {
void fn2(int[][fn3()]);
  }
  -


I have been able to reproduce with a x86_64 native gcc :
  $ gcc -c -flto reduce.c
  reduce.c:5:1: internal compiler error: tree code 'call_expr' is not supported
in LTO streams
  }


My gcc configuration is very simple :
$ gcc -v 
Configured with: ../configure --prefix= --with-gnu-as --with-gnu-ld
--enable-shared --enable-languages=c,c++ --disable-libgcj --disable-nls
--with-gmp= --with-mpfr= --with-mpc=
--with-isl= --with-cloog= --disable-bootstrap --enable-lto
--with-local-prefix=
Thread model: posix
gcc version 5.3.0 (GCC) 

It well passes with gcc 4.9.0 to 4.9.4.

Regards,

[Bug c++/77752] ICE on C++ code on x86_64-linux-gnu (internal compiler error: Segmentation fault, build_list_conv, implicit_conversion)

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77752

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
ICEs for all releases I have (4.5.0+).

[Bug target/27077] [x86, 4.1] builtin strlen poor performance

2016-09-27 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27077

--- Comment #9 from Thomas Koenig  ---
Please see https://gcc.gnu.org/bugs/#need for the things that
are required for a bug report.

Specifically, 

the preprocessed file (*.i*) that triggers the bug, generated by adding
-save-temps to the complete compilation command, or, in the case of a bug
report for the GNAT front end, a complete set of source files (see below).

[Bug lto/77754] internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1
  Known to fail||5.4.0, 6.2.0, 7.0

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

Richard Biener  changed:

   What|Removed |Added

 CC||jwakely.gcc at gmail dot com
  Component|target  |libstdc++

--- Comment #10 from Richard Biener  ---
So it's

@(insn:TI 21 24 15 (parallel [
@(set (reg:SI 0 r0)
@(mem/c:SI (reg/f:SI 3 r3 [120]) [23 MEM[(union _Any_data
&)&D.50945]+0 S4 A64]))
@(set (reg:SI 1 r1)
@(mem/c:SI (plus:SI (reg/f:SI 3 r3 [120])
@(const_int 4 [0x4])) [23 MEM[(union _Any_data
&)&D.50945]+4 S4 A32]))
@]) t.ii:1926 383 {*ldm2_}
@ (nil))
ldm r3, {r0, r1}@ 21*ldm2_  [length = 4]

vs.

@(insn:TI 17 25 18 (set (mem/f/c:SI (plus:SI (reg/f:SI 13 sp)
@(const_int 32 [0x20])) [30 MEM[(struct __lambda1 *)&D.50945]+0
S4 A64])
@(reg/f:SI 5 r5 [orig:114 this ] [114])) 630 {*arm_movsi_vfp}
@ (nil))
str r5, [sp, #32]   @ 17*arm_movsi_vfp/6[length = 4]
@(insn:TI 18 17 118 (set (mem/f/c:SI (plus:SI (reg/f:SI 13 sp)
@(const_int 36 [0x24])) [30 MEM[(struct __lambda1 *)&D.50945 +
4B]+0 S4 A32])
@(reg/f:SI 5 r5 [orig:114 this ] [114])) 630 {*arm_movsi_vfp}
@ (nil))
str r5, [sp, #36]   @ 18*arm_movsi_vfp/6[length = 4]

and obviously r3 == sp + 32 and thus this is a must-alias.  But the alias sets
are 30 vs. 23 here.

At RTL expansion time:

;; MEM[(struct __lambda1 *)&D.50945] = this_4(D);

(insn 17 16 0 (set (mem/f/c:SI (plus:SI (reg/f:SI 105 virtual-stack-vars)
(const_int -16 [0xfff0])) [30 MEM[(struct __lambda1
*)&D.50945]+0 S4 A64])
(reg/f:SI 114 [ this ])) -1
 (nil))

;; MEM[(struct __lambda1 *)&D.50945 + 4B] = this_4(D);

(insn 18 17 0 (set (mem/f/c:SI (plus:SI (reg/f:SI 105 virtual-stack-vars)
(const_int -12 [0xfff4])) [30 MEM[(struct __lambda1
*)&D.50945 + 4B]+0 S4 A32])
(reg/f:SI 114 [ this ])) -1
 (nil))

...

;; __tmp = MEM[(union _Any_data &)&D.50945];

(insn 19 18 20 (set (reg:SI 119)
(plus:SI (reg/f:SI 105 virtual-stack-vars)
(const_int -40 [0xffd8]))) t.ii:1926 -1
 (nil))

(insn 20 19 21 (set (reg:SI 120)
(plus:SI (reg/f:SI 105 virtual-stack-vars)
(const_int -16 [0xfff0]))) t.ii:1926 -1
 (nil))

(insn 21 20 22 (parallel [
(set (reg:SI 0 r0)
(mem/c:SI (reg:SI 120) [23 MEM[(union _Any_data &)&D.50945]+0
S4 A64]))
(set (reg:SI 1 r1)
(mem/c:SI (plus:SI (reg:SI 120)
(const_int 4 [0x4])) [23 MEM[(union _Any_data
&)&D.50945]+4 S4 A32]))
]) t.ii:1926 -1
 (nil))

(insn 22 21 0 (parallel [
(set (mem/c:SI (reg:SI 119) [23 __tmp+0 S4 A64])
(reg:SI 0 r0))
(set (mem/c:SI (plus:SI (reg:SI 119)
(const_int 4 [0x4])) [23 __tmp+4 S4 A32])
(reg:SI 1 r1))
]) t.ii:1926 -1
 (nil))


From GIMPLE with more context:

;;   basic block 2, loop depth 0
;;pred:   ENTRY
  dummy_a = 1;
  std::__ostream_insert > (&cout, "", 0);
  MEM[(struct  &)&f] ={v} {CLOBBER};
  MEM[(struct  &)&f] ={v} {CLOBBER};
  MEM[(union _Any_data *)&f] = this_4(D);
  MEM[(union _Any_data *)&f + 4B] = &dummy_a;
  MEM[(struct  &)&D.50945] ={v} {CLOBBER};
  MEM[(struct  &)&D.50945] ={v} {CLOBBER};
  MEM[(struct __lambda1 *)&D.50945] = this_4(D);  <---
  MEM[(struct __lambda1 *)&D.50945 + 4B] = this_4(D); <---
  __tmp = MEM[(union _Any_data &)&D.50945];   <---
  MEM[(union _Any_data *)&D.50945] = MEM[(union _Any_data &)&f];
  MEM[(union _Any_data *)&f] = __tmp;
  __tmp ={v} {CLOBBER};
...

not very well optimized either, the copy to __tmp could be elided.

What SRA does is obviously correct now (and incorrect before):

-  MEM[(struct __lambda0 *)&D.47785] = __f;
+  MEM[(struct __lambda0 *)&D.47785] = __f$__this_17;
+  MEM[(struct __lambda0 *)&D.47785 + 4B] = __f$__dummy_a_19;
...

-  MEM[(struct __lambda1 *)&D.47815] = __f;
+  MEM[(struct __lambda1 *)&D.47815] = __f$__this_17;
+  MEM[(struct __lambda1 *)&D.47815 + 4B] = __f$__tmp_19;

so you see it now preserves the alias sets for the stores.

That _Any_data identifier makes me suspicious of the testcase invoking
undefined behavior:

  union _Any_data
  {
void* _M_access() { return &_M_pod_data[0]; }
const void* _M_access() const { return &_M_pod_data[0]; }
template
  _Tp&
  _M_access()
  { return *static_cast<_Tp*>(_M_access()); }
template
  const _Tp&
  _M_access() const
  { return *static_cast(_M_access()); }
_Nocopy_types _M_unused;
char _M_pod_data[sizeof(_Nocopy_types)];
  };

it seems to fall foul of the common misconception that you can do a

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #11 from Richard Biener  ---
;; Function void std::function<_Res(_ArgTypes
...)>::swap(std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes =
{}] (null)
;; enabled by -tree-original


<<< Unknown tree: must_not_throw_expr
  < ((union _Any_data &) &((struct function *)
this)->D.45189._M_functor, (union _Any_data &) &((struct function *)
__x)->D.45189._M_functor) >;



doing std::swap on _Any_data.  That's of course bogus.

  /**
   *  @brief Swap the targets of two %function objects.
   *  @param __x A %function with identical call signature.
   *
   *  Swap the targets of @c this function object and @a __f. This
   *  function will not throw an %exception.
   */
  void swap(function& __x) noexcept
  {
std::swap(_M_functor, __x._M_functor);
std::swap(_M_manager, __x._M_manager);
std::swap(_M_invoker, __x._M_invoker);
  }

and swap() seems to be used in multiple places throughout functional.

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #12 from Richard Biener  ---
Index: libstdc++-v3/include/std/functional
===
--- libstdc++-v3/include/std/functional (revision 240521)
+++ libstdc++-v3/include/std/functional (working copy)
@@ -1418,7 +1418,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, t

 _Nocopy_types _M_unused;
 char _M_pod_data[sizeof(_Nocopy_types)];
-  };
+  } __attribute__((may_alias));

   enum _Manager_operation
   {

fixes this testcase.  As std::swap takes reference args I suppose it should
reliably work to prevent the issue.

[Bug lto/77754] [5/6/7 Regression] internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||marxin at gcc dot gnu.org
  Known to work||4.9.0
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org

--- Comment #1 from Martin Liška  ---
I can confirm that GCC ICEs for all revisions I have expect 4.9.x.
I'm going to take a look how is the CALL_EXPR optimized out.

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

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 c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #6 from Andreas Schwab  ---
On m68k it crashes here:

Program received signal SIGSEGV, Segmentation fault.
__GI_memcmp (s1=0x0, s2=0x0, len=2285895680) at memcmp.c:333
333 memcmp.c: No such file or directory.
(gdb) up
#1  0x893c in std::char_traits::compare (p3=, 
p2=) at ../gcc/testsuite/g++.dg/pr77550.C:221
221 return __builtin_memcmp(0, p2, p3);

With the change in #c5 it runs successfully.

[Bug fortran/77746] [5/6/7 Regression] Wrong subroutine called, clash of specific procedure name and binding-name

2016-09-27 Thread vladimir.fuka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77746

--- Comment #3 from Vladimir Fuka  ---
Indeed, 4.9 crashes as well, my first description is incorrect. It was running 
well in 4.8.5.

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #13 from Jonathan Wakely  ---
(In reply to Richard Biener from comment #12)
> Index: libstdc++-v3/include/std/functional
> ===
> --- libstdc++-v3/include/std/functional (revision 240521)
> +++ libstdc++-v3/include/std/functional (working copy)
> @@ -1418,7 +1418,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, t
>  
>  _Nocopy_types _M_unused;
>  char _M_pod_data[sizeof(_Nocopy_types)];
> -  };
> +  } __attribute__((may_alias));
>  
>enum _Manager_operation
>{
> 
> fixes this testcase.  As std::swap takes reference args I suppose it should
> reliably work to prevent the issue.

I think this is the right fix. IIUC this is a valid use of may_alias, as the
whole point of _Any_data is that it can alias an unbounded set of types.

[Bug bootstrap/77749] [7 Regression] profiledbootstrap broken

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

--- Comment #3 from Martin Liška  ---
Author: marxin
Date: Tue Sep 27 10:04:39 2016
New Revision: 240524

URL: https://gcc.gnu.org/viewcvs?rev=240524&root=gcc&view=rev
Log:
Remove __gcov_merge_delta (PR bootstrap/77749)

PR bootstrap/77749
* gcov-counter.def: Remove GCOV_COUNTER_V_DELTA.
PR bootstrap/77749
* Makefile.in: Remove _gcov_merge_delta.
* libgcov-merge.c (void __gcov_merge_delta): Remove.
* libgcov-util.c (__gcov_delta_counter_op): Remove.
* libgcov.h: Remove declaration of __gcov_merge_delta.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcov-counter.def
trunk/libgcc/ChangeLog
trunk/libgcc/Makefile.in
trunk/libgcc/libgcov-merge.c
trunk/libgcc/libgcov-util.c
trunk/libgcc/libgcov.h

[Bug bootstrap/77749] [7 Regression] profiledbootstrap broken

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77749

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #14 from Richard Biener  ---
Just to explain a little bit.  Consider

void foo (void)
{
  union { float f; char c[4]; } u, v;
  *(int *)&u = 0;
  v = u;
  return *(int *)&v;
}

then C11 6.5/6,7 make it clear that it is not valid to use 'u' (of union type)
to access the object which now has effective type 'int' (in fact that store
alone, given strict reading of C11 6.5/6 is invalid as u has a declared type).
The union does not have 'int' amongst its members.  Putting 'char' or an
array of 'char' into the union does not make the access fall under 6.5/7
as 'a character type' only follows 'an aggregate or union type that includes
one
of the _AFOREMENTIONED_ types...' (emphasis mine).

GCC allows even objects with a declared type to take any effective type by
means of storing to it with that type (to support existing practice and
multiple languages).

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #15 from Richard Biener  ---
Btw, what I fail to find is sth in the (C) standard that specifies the
semantics of an aggregate assignment of union type.  Thus I interpret it to use
the
effective type of the object (determined by the last access) and thus only
transfer the active object (so a union aggregate copy is _not_ a bytewise
copy of size sizeof (union type)).

[Bug target/27077] [x86, 4.1] builtin strlen poor performance

2016-09-27 Thread var at schellong dot biz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27077

--- Comment #10 from Helmut Schellong  ---
(In reply to Thomas Koenig from comment #9)
> Please see https://gcc.gnu.org/bugs/#need for the things that
> are required for a bug report.
> 
> Specifically, 
> 
> the preprocessed file (*.i*) that triggers the bug, generated by adding
> -save-temps to the complete compilation command, or, in the case of a bug
> report for the GNAT front end, a complete set of source files (see below).

In this case a lot of informations are not necessary.
This can be shortened to:
   "Change each builtin that implements string instructions."
That's almost enough.

Example:
The strlen() in (my) libc reads eight bytes and realizes a zero byte
therein at a single blow.
scasb cannot be so fast (bytewise).

This C code (translated):
   while (*s)  ++s;
   return (s-s0);
runs three times faster than the scasb-builtin.
This says all-inclusive.

[Bug c/77754] [5/6/7 Regression] internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

Richard Biener  changed:

   What|Removed |Added

  Component|lto |c
   Target Milestone|--- |5.5

--- Comment #2 from Richard Biener  ---
The issue is we fail to gimplify type sizes properly:

fn1 ()
{
  extern void fn2 (int[0:(sizetype) ((long int) SAVE_EXPR  + -1)] *);


}

happens when we try to output the function type of fn2.  Bug in the frontend,
a DECL_EXPR is missing here.

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Tue Sep 27 10:40:37 2016
New Revision: 240526

URL: https://gcc.gnu.org/viewcvs?rev=240526&root=gcc&view=rev
Log:
PR bootstrap/77751
* Makefile.in (insn-attrtab.o-warn, insn-dfatab.o-warn,
insn-latencytab.o-warn, insn-output.o-warn, insn-emit.o-warn): Use
-Wno-error instead of -Wno-implicit-fallthrough.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/Makefile.in

[Bug c/77754] [5/6/7 Regression] internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

Richard Biener  changed:

   What|Removed |Added

   Keywords||lto
 CC||jsm28 at gcc dot gnu.org

--- Comment #3 from Richard Biener  ---
Note this isn't a nested function but a function declaration. Doesn't ICE with
a nested function:

int fn3();

void fn1() {
void fn2(int a[][fn3()])
  {
  }
int x[1][fn3()];
fn2(x);
}

but still has the bogus non-gimplified type:

fn1 ()
{
...
  static void fn2 (int[0:(sizetype) ((long int) SAVE_EXPR  + -1)] *);


and odd place of evaluating fn3():

fn2 (int[0:D.1798] * a)
{
  int D.1797;
  sizetype D.1798;
  bitsizetype D.1799;
  sizetype D.1800;

  D.1797 = fn3 ();
  _1 = (long int) D.1797;
...


I wonder what the standards say about side-effects in those "declarations".

[Bug bootstrap/77753] [7 Regression] broken profiledbootstrap due to -Werror=format-length in varasm.c:1573

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77753

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug c/77754] [5/6/7 Regression] internal compiler error : tree code 'call_expr' is not supported in LTO streams

2016-09-27 Thread christophe.monat at st dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77754

--- Comment #4 from Christophe Monat  ---
(In reply to Richard Biener from comment #3)

> I wonder what the standards say about side-effects in those "declarations".

From my instance of ISO+IEC+9899-2011.pdf

6.7.6.2 Array declarators
Constraints
...
Semantics
(5) If the size is an expression that is not an integer constant expression: if
it occurs in a
declaration at function prototype scope, it is treated as if it were replaced
by *; otherwise,
each time it is evaluated it shall have a value greater than zero. The size of
each instance
of a variable length array type does not change during its lifetime. Where a
size
expression is part of the operand of a sizeof operator and changing the value
of the
size expression would not affect the result of the operator, it is unspecified
whether or not
the size expression is evaluated.

And
6.7.6.3 Function declarators (including prototypes)
(12) If the function declarator is not part of a definition of that function,
parameters may have
incomplete type and may use the [*] notation in their sequences of declarator
specifiers
to specify variable length array types.

So to me it looks, like the compiler could consider the original declaration as
if it where:
void fn2(int[][*]);

[Bug middle-end/77436] [5 Regression] Incorrect constant result for summing loop inserted

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77436

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

[Bug fortran/77679] [6 Regression] ICE in fold_array_ctor_reference, at gimple-fold.c:5586

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77679

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

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

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

[Bug tree-optimization/77544] [6 Regression] segfault at -O0 - infinite loop in simplification

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77544

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

[Bug tree-optimization/77605] [5/6 Regression] wrong code at -O3 on x86_64-linux-gnu

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77605

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

[Bug tree-optimization/77514] [6 Regression] ICE in VN_INFO_GET, at tree-ssa-sccvn.c:406 w/ -O2 (and above)

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77514

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 10:54:00 2016
New Revision: 240527

URL: https://gcc.gnu.org/viewcvs?rev=240527&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

Backport from mainline
2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

2016-09-15  Richard Biener  

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Handle garbage
only forced_stmts sequence.

* gcc.dg/torture/pr77514.c: New testcase.

2016-09-15  Richard Biener  

PR middle-end/77544
* fold-const.c (split_tree): Do not split constant ~X.

* c-c++-common/torture/pr77544.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-09-22  Richard Biener  

PR middle-end/77679
* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
fold fails.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr77544.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77514.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.c
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/gimple-fold.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-chrec.c
branches/gcc-6-branch/gcc/tree-data-ref.c
branches/gcc-6-branch/gcc/tree-ssa-pre.c

[Bug tree-optimization/77544] [6 Regression] segfault at -O0 - infinite loop in simplification

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77544

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||6.2.0

--- Comment #10 from Richard Biener  ---
Fixed.

[Bug tree-optimization/77514] [6 Regression] ICE in VN_INFO_GET, at tree-ssa-sccvn.c:406 w/ -O2 (and above)

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77514

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||6.2.0

--- Comment #10 from Richard Biener  ---
Fixed.

[Bug fortran/77679] [6 Regression] ICE in fold_array_ctor_reference, at gimple-fold.c:5586

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77679

--- Comment #6 from Richard Biener  ---
Fixed.

[Bug c++/16855] gcov does not report the fact that static destructors actually run.

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16855

--- Comment #2 from Martin Liška  ---
Author: marxin
Date: Tue Sep 27 11:07:11 2016
New Revision: 240529

URL: https://gcc.gnu.org/viewcvs?rev=240529&root=gcc&view=rev
Log:
gcov: dump in a static dtor instead of in an atexit handler

PR gcov-profile/7970
PR gcov-profile/16855
PR gcov-profile/44779
* g++.dg/gcov/pr16855.C: New test.
* coverage.c (build_gcov_exit_decl): New function.
(coverage_obj_init): Call the function and generate __gcov_exit
destructor.
* doc/gcov.texi: Document when __gcov_exit function is called.
* libgcov-driver.c (__gcov_init): Do not register a atexit
handler.
(__gcov_exit): Rename from gcov_exit.
* libgcov.h (__gcov_exit): Declare.

Added:
trunk/gcc/testsuite/g++.dg/gcov/pr16855.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/coverage.c
trunk/gcc/doc/gcov.texi
trunk/gcc/testsuite/ChangeLog
trunk/libgcc/ChangeLog
trunk/libgcc/libgcov-driver.c
trunk/libgcc/libgcov.h

[Bug gcov-profile/7970] Arc profiling doesn't work reliably on global destructors

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7970

--- Comment #6 from Martin Liška  ---
Author: marxin
Date: Tue Sep 27 11:07:11 2016
New Revision: 240529

URL: https://gcc.gnu.org/viewcvs?rev=240529&root=gcc&view=rev
Log:
gcov: dump in a static dtor instead of in an atexit handler

PR gcov-profile/7970
PR gcov-profile/16855
PR gcov-profile/44779
* g++.dg/gcov/pr16855.C: New test.
* coverage.c (build_gcov_exit_decl): New function.
(coverage_obj_init): Call the function and generate __gcov_exit
destructor.
* doc/gcov.texi: Document when __gcov_exit function is called.
* libgcov-driver.c (__gcov_init): Do not register a atexit
handler.
(__gcov_exit): Rename from gcov_exit.
* libgcov.h (__gcov_exit): Declare.

Added:
trunk/gcc/testsuite/g++.dg/gcov/pr16855.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/coverage.c
trunk/gcc/doc/gcov.texi
trunk/gcc/testsuite/ChangeLog
trunk/libgcc/ChangeLog
trunk/libgcc/libgcov-driver.c
trunk/libgcc/libgcov.h

[Bug gcov-profile/44779] The gcov library does not adequately handle functions with constructor/destructor attributes

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44779

--- Comment #8 from Martin Liška  ---
Author: marxin
Date: Tue Sep 27 11:07:11 2016
New Revision: 240529

URL: https://gcc.gnu.org/viewcvs?rev=240529&root=gcc&view=rev
Log:
gcov: dump in a static dtor instead of in an atexit handler

PR gcov-profile/7970
PR gcov-profile/16855
PR gcov-profile/44779
* g++.dg/gcov/pr16855.C: New test.
* coverage.c (build_gcov_exit_decl): New function.
(coverage_obj_init): Call the function and generate __gcov_exit
destructor.
* doc/gcov.texi: Document when __gcov_exit function is called.
* libgcov-driver.c (__gcov_init): Do not register a atexit
handler.
(__gcov_exit): Rename from gcov_exit.
* libgcov.h (__gcov_exit): Declare.

Added:
trunk/gcc/testsuite/g++.dg/gcov/pr16855.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/coverage.c
trunk/gcc/doc/gcov.texi
trunk/gcc/testsuite/ChangeLog
trunk/libgcc/ChangeLog
trunk/libgcc/libgcov-driver.c
trunk/libgcc/libgcov.h

[Bug gcov-profile/7970] Arc profiling doesn't work reliably on global destructors

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7970

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug gcov-profile/44779] The gcov library does not adequately handle functions with constructor/destructor attributes

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44779

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #7 from Bernd Edlinger  ---
This avoids also the _Alloc_hider constructor.
But it still reproduces with gcc-6 and gcc-7.

I have found no way to add __attribute((noinline, noclone))
to the template specialization, that works.
So I did the dirty trick...

It would not have been able to link with gcc-6
because the signature appears to have changed.

So that would have been necessary to do anyway.

Can you try this please?


--- pr77550.C.orig  2016-09-27 10:05:17.812179103 +0200
+++ pr77550.C   2016-09-27 13:08:25.465060583 +0200
@@ -231,13 +231,15 @@ template 
   } _M_dataplus;
   size_type _M_string_length;
   enum { _S_local_capacity = 15 } _M_local_buf[_S_local_capacity];
-  pointer _M_local_data();
-  void _M_set_length(size_type);
-  basic_string() : _M_dataplus(_M_local_data()) { _M_set_length(0); }
+  basic_string() : _M_dataplus(0) {}
   basic_string(const basic_string &) : _M_dataplus(0) {}
   size_type size() { return _M_string_length; }
   char *data() const {}
 };
+//template<> basic_string,
std::allocator>::
+//_Alloc_hider::_Alloc_hider(char*, std::allocator&&) {}
+extern "C" void
+_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_
(...) {}
 }
 template 
 int operator==(basic_string<_CharT> &p1, const basic_string<_CharT> &p2) {

[Bug target/77478] Incorrect code generated with -O3, m32, -msse2 and -ffast-math

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77478

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 11:27:54 2016
New Revision: 240530

URL: https://gcc.gnu.org/viewcvs?rev=240530&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

PR tree-optimization/77478
* gcc.dg/torture/pr77478.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr77478.c
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug target/77478] Incorrect code generated with -O3, m32, -msse2 and -ffast-math

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77478

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 11:29:28 2016
New Revision: 240531

URL: https://gcc.gnu.org/viewcvs?rev=240531&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

PR tree-optimization/77478
* gcc.dg/torture/pr77478.c: New testcase.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77478.c
Modified:
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #8 from Andreas Schwab  ---
That change also makes it run successfully.

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #16 from Jonathan Wakely  ---
For C++ 12.8 [class.copy] says:

-16- The implicitly-defined copy/move constructor for a union X copies the
object representation (3.9) of X.


and 

-29- The implicitly-defined copy assignment operator for a union X copies the
object representation (3.9) of X.

so it is a bytewise copy for PODs.

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #17 from Jonathan Wakely  ---
(In reply to Richard Biener from comment #14)
> Just to explain a little bit.  Consider
> 
> void foo (void)
> {
>   union { float f; char c[4]; } u, v;
>   *(int *)&u = 0;
>   v = u;
>   return *(int *)&v;
> }
> 
> then C11 6.5/6,7 make it clear that it is not valid to use 'u' (of union
> type)
> to access the object which now has effective type 'int' (in fact that store
> alone, given strict reading of C11 6.5/6 is invalid as u has a declared
> type).
> The union does not have 'int' amongst its members.  Putting 'char' or an
> array of 'char' into the union does not make the access fall under 6.5/7
> as 'a character type' only follows 'an aggregate or union type that includes
> one
> of the _AFOREMENTIONED_ types...' (emphasis mine).

But would *(int*)u.c be OK, because that is a character type? Given that C++
does define what the assignment means for the union, we just need to make sure
we do *(int*)u.c not *(int*)&u or is that still not enough?

If not, what does the last bullet of 6.5/7 allow?

[Bug libstdc++/77459] [6/7 Regression] undefined reference to `snprintf' when building mingw-w64 cross-compiler

2016-09-27 Thread gk at torproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77459

Georg Koppen  changed:

   What|Removed |Added

 CC||fdumont at gcc dot gnu.org

--- Comment #1 from Georg Koppen  ---
FWIW: backing out r227885 (and r227888) "fixes" this problem for me.

[Bug target/77728] [5/6/7 Regression] Miscompilation multiple vector iteration on ARM

2016-09-27 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #3 from ktkachov at gcc dot gnu.org ---
Started with r225465.
Something to do with alignment.
I wonder if it's related to PR69841 ?

[Bug libstdc++/77686] [6/7 Regression] wrong code on arm-linux-gnueabi and arm-linux-gnueabihf

2016-09-27 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686

--- Comment #18 from rguenther at suse dot de  ---
On Tue, 27 Sep 2016, redi at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686
> 
> --- Comment #17 from Jonathan Wakely  ---
> (In reply to Richard Biener from comment #14)
> > Just to explain a little bit.  Consider
> > 
> > void foo (void)
> > {
> >   union { float f; char c[4]; } u, v;
> >   *(int *)&u = 0;
> >   v = u;
> >   return *(int *)&v;
> > }
> > 
> > then C11 6.5/6,7 make it clear that it is not valid to use 'u' (of union
> > type)
> > to access the object which now has effective type 'int' (in fact that store
> > alone, given strict reading of C11 6.5/6 is invalid as u has a declared
> > type).
> > The union does not have 'int' amongst its members.  Putting 'char' or an
> > array of 'char' into the union does not make the access fall under 6.5/7
> > as 'a character type' only follows 'an aggregate or union type that includes
> > one
> > of the _AFOREMENTIONED_ types...' (emphasis mine).
> 
> But would *(int*)u.c be OK, because that is a character type? Given that C++
> does define what the assignment means for the union, we just need to make sure
> we do *(int*)u.c not *(int*)&u or is that still not enough?

No, *(int *)u.c is not OK, because that's still 'int', not a character 
type (because of the cast).

> If not, what does the last bullet of 6.5/7 allow?

It allows

  *(char *)&u

basically it allows a memcpy implementation to exist.

[Bug target/77478] Incorrect code generated with -O3, m32, -msse2 and -ffast-math

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77478

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED
   Target Milestone|--- |5.5
  Known to fail||5.4.0

--- Comment #12 from Richard Biener  ---
Fixed.

[Bug target/77478] Incorrect code generated with -O3, m32, -msse2 and -ffast-math

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77478

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 12:44:42 2016
New Revision: 240532

URL: https://gcc.gnu.org/viewcvs?rev=240532&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

PR tree-optimization/77478
* tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop):
Fix alignment of SSA var used before the alignment prologue.

* gcc.dg/torture/pr77478.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77478.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-vect-loop-manip.c

[Bug target/51244] [SH] Inefficient conditional branch and code around T bit

2016-09-27 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51244

--- Comment #88 from Oleg Endo  ---
Author: olegendo
Date: Tue Sep 27 12:50:27 2016
New Revision: 240533

URL: https://gcc.gnu.org/viewcvs?rev=240533&root=gcc&view=rev
Log:
gcc/
PR target/51244
* config/sh/sh.c (sh_rtx_costs): Fix return value of SET of movt and
movrt patterns.  Match them before anything else in the SET case.


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

[Bug c++/77755] New: [concepts] Abbreviatd function template pack expansions not working

2016-09-27 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77755

Bug ID: 77755
   Summary: [concepts] Abbreviatd function template pack
expansions not working
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

Pack expansions are not handled correctly in the context of abbreviated
function templates. For example, foo in 

template  struct S{};

template 
concept bool Integral = std::is_integral::value;

int foo (S)
{
return 0;
}

fails to compile with the error: expansion pattern 'auto:1' contains no
argument packs

[Bug libstdc++/77459] [6/7 Regression] undefined reference to `snprintf' when building mingw-w64 cross-compiler

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77459

--- Comment #2 from Jonathan Wakely  ---
It's 2016, how can snprintf not be supported still?

[Bug tree-optimization/77745] [5/6 Regression] Inconsistent application of aliasing rules

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77745

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Tue Sep 27 12:56:38 2016
New Revision: 240534

URL: https://gcc.gnu.org/viewcvs?rev=240534&root=gcc&view=rev
Log:
2016-09-27  Richard Biener  

PR tree-optimization/77745
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
When removing redundant stores make sure to check compatibility
of the TBAA state for downstream accesses.
* tree-ssa-sccvn.c (visit_reference_op_store): Likewise for when
value-numbering virtual operands for store matches.

* g++.dg/torture/pr77745.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr77745.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-pre.c
trunk/gcc/tree-ssa-sccvn.c

[Bug tree-optimization/77745] [5/6 Regression] Inconsistent application of aliasing rules

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77745

Richard Biener  changed:

   What|Removed |Added

  Known to work||7.0
Summary|[5/6/7 Regression]  |[5/6 Regression]
   |Inconsistent application of |Inconsistent application of
   |aliasing rules  |aliasing rules
  Known to fail|7.0 |6.2.0

--- Comment #7 from Richard Biener  ---
Fixed on trunk sofar.

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #4 from Marek Polacek  ---
Should be fixed.

[Bug tree-optimization/77745] [5/6 Regression] Inconsistent application of aliasing rules

2016-09-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77745

Richard Biener  changed:

   What|Removed |Added

  Known to work||4.6.4
  Known to fail||4.7.0, 4.7.3, 4.8.5, 4.9.4

--- Comment #9 from Richard Biener  ---
Started to appear with GCC 4.7 btw.

[Bug inline-asm/77756] New: cpuid

2016-09-27 Thread yzhang1985 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77756

Bug ID: 77756
   Summary: cpuid
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yzhang1985 at gmail dot com
  Target Milestone: ---

Created attachment 39696
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39696&action=edit
should print 99 when run on an AVX2 capable processor

I've found a bug in __get_cpuid() in the compiler internal header, cpuid.h.

I wish to detect if the CPU supports AVX2, but when I call __get_cpuid(7, ...),
EBX is all zeros. The problem is for level 7, ECX must be set to 0 before
calling cpuid.

As a work around, I've added "xor %%ecx, %%ecx" to __cpuid() and that took care
of the problem:

#define __cpuid(level, a, b, c, d) \
  __asm__("xor %%ecx, %%ecx\n" \
  "cpuid\n" \
  : "=a"(a), "=b"(b), "=c"(c), "=d"(d) \
  : "0"(level))

It looks like Intel only started requiring this for level 7. Who knows if
they'll require setting ECX to other values for future levels, but for know, it
seems always setting ECX to 0 is OK.

One mystery is why GCC's builtin AVX2 auto detection for function
multiversioning, which uses __get_cpuid() works (see multiversioning.cpp).
However, I can't use multiversioning because ifunc hasn't been ported to
Windows, so I have to do manual detection.

I don't think attaching a preprocessed C file is necessary to reproduce this.
Here's the output of gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.2.0-4'
--with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20160914 (Debian 6.2.0-4)

[Bug libstdc++/77459] [6/7 Regression] undefined reference to `snprintf' when building mingw-w64 cross-compiler

2016-09-27 Thread gk at torproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77459

--- Comment #3 from Georg Koppen  ---
(In reply to Jonathan Wakely from comment #2)
> It's 2016, how can snprintf not be supported still?

I asked about that problem in #mingw-w64 a while ago and got the following
answer:

M$ does not provide `snprintf()` despite their non-standard extension
`_snprintf()`. With mingw-w64, if the macro `__USE_MINGW_ANSI_STDIO` is defined
to `1`, `snprintf` is a macro that redirects calls to `snprintf` to
`__mingw_snprintf` instead.

Not sure if that helps debugging/fixing.

[Bug libstdc++/77459] [6/7 Regression] undefined reference to `snprintf' when building mingw-w64 cross-compiler

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77459

--- Comment #4 from Jonathan Wakely  ---
Does this help?


--- a/libstdc++-v3/src/c++11/debug.cc
+++ b/libstdc++-v3/src/c++11/debug.cc
@@ -540,10 +540,25 @@ namespace
   using _Error_formatter = __gnu_debug::_Error_formatter;
   using _Parameter = __gnu_debug::_Error_formatter::_Parameter;

+#ifdef _GLIBCXX_USE_C99_STDIO
   template
 int
 format_word(char* buf, int n, const char* fmt, _Tp s)
 { return std::min(__builtin_snprintf(buf, n, fmt, s), n - 1); }
+#else
+int
+format_word(char* buf, int n, const char* fmt, const char* s)
+{
+  if ((int)__builtin_strlen(s) >= n)
+   s = "???";
+  return std::min(__builtin_sprintf(buf, fmt, s), n - 1);
+}
+
+  template
+int
+format_word(char* buf, int n, const char* fmt, _Tp s)
+{ return std::min(__builtin_sprintf(buf, fmt, s), n - 1); }
+#endif

   void
   get_max_length(std::size_t& max_length)

[Bug gcov-profile/46266] gcov generates data for non-existing file

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46266

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug gcov-profile/46266] gcov generates data for non-existing file

2016-09-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46266

--- Comment #4 from Martin Liška  ---
Author: marxin
Date: Tue Sep 27 13:22:04 2016
New Revision: 240536

URL: https://gcc.gnu.org/viewcvs?rev=240536&root=gcc&view=rev
Log:
Fix PR gcov-profile/46266

PR gcov-profile/46266
* lib/gcov.exp: Verify that .gcov file is not
considered.
* input.h (RESERVED_LOCATION_P): New macro.
* profile.c (branch_prob): Use RESERVED_LOCATION_P and
instread of comparison with UNKNOWN_LOCATION.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/input.h
trunk/gcc/profile.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/gcov.exp

[Bug c/77757] New: mips16: generated assembly has loads too far away

2016-09-27 Thread ggo at andred dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77757

Bug ID: 77757
   Summary: mips16: generated assembly has loads too far away
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ggo at andred dot net
  Target Milestone: ---

Created attachment 39697
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39697&action=edit
pre-processed output

The attached doesn't compile on mips16:

mipsel-poky-linux-musl-gcc -mel -mabi=32 -msoft-float -march=mips32r2 -mips16
-minterlink-compressed -mtune=24kec -mdsp
--sysroot=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/tgm-r2 -Wall
-Os -g -feliminate-unused-debug-types -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -c
./havegecollect.i  -fPIC -DPIC -o .libs/libhavege_la-havegecollect.o  -pipe -v
Using built-in specs.
COLLECT_GCC=mipsel-poky-linux-musl-gcc
Target: mipsel-poky-linux-musl
Configured with: ../../../../../../work-shared/gcc-6.2.0-r0/gcc-6.2.0/configure
--build=x86_64-linux --host=x86_64-linux --target=mipsel-poky-linux-musl
--prefix=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr
--exec_prefix=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr
--bindir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/bin/mipsel-poky-linux-musl
--sbindir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/bin/mipsel-poky-linux-musl
--libexecdir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/libexec/mipsel-poky-linux-musl
--datadir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/share
--sysconfdir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/etc
--sharedstatedir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/com
--localstatedir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/var
--libdir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/lib/mipsel-poky-linux-musl
--includedir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/include
--oldincludedir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/include
--infodir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/share/info
--mandir=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/share/man
--disable-silent-rules --disable-dependency-tracking
--with-libtool-sysroot=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux
--enable-clocale=generic --with-gnu-ld --enable-shared --enable-languages=c,c++
--enable-threads=posix --disable-multilib --enable-c99 --enable-long-long
--enable-symvers=gnu --enable-libstdcxx-pch
--program-prefix=mipsel-poky-linux-musl- --without-local-prefix --enable-lto
--enable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap
--with-system-zlib --with-linker-hash-style=sysv --enable-linker-build-id
--with-ppl=no --with-cloog=no --enable-checking=release
--enable-cheaders=c_global --without-isl
--with-gxx-include-dir=/not/exist/usr/include/c++/6.2.0
--with-sysroot=/not/exist
--with-build-sysroot=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/tgm-r2
--with-mips-plt --without-long-double-128 --enable-poison-system-directories
--with-mpfr=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr
--with-system-zlib --disable-static --disable-nls
Thread model: posix
gcc version 6.2.0 (GCC) 
COLLECT_GCC_OPTIONS='--sysroot=/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/tgm-r2'
'-mel' '-mabi=32' '-msoft-float' '-march=mips32r2' '-mips16'
'-minterlink-compressed' '-mtune=24kec' '-mdsp' '-Wall' '-Os' '-g'
'-feliminate-unused-debug-types' '-fstack-protector-strong' '-D'
'_FORTIFY_SOURCE=2' '-Wformat=1' '-Wformat-security' '-Werror=format-security'
'-c' '-fPIC' '-D' 'PIC' '-o' '.libs/libhavege_la-havegecollect.o' '-pipe' '-v'
'-mllsc'  '-mips32r2' '-EL'

/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/libexec/mipsel-poky-linux-musl/gcc/mipsel-poky-linux-musl/6.2.0/cc1
-fpreprocessed ./havegecollect.i -isysroot
/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/tgm-r2 -mel -quiet
-dumpbase havegecollect.i -mel -mabi=32 -msoft-float -march=mips32r2 -mips16
-minterlink-compressed -mtune=24kec -mdsp -mllsc -mips32r2 -auxbase-strip
.libs/libhavege_la-havegecollect.o -g -Os -Wall -Wformat=1 -Wformat-security
-Werror=format-security -version -feliminate-unused-debug-types
-fstack-protector-strong -fPIC -o - |

/scratch/yocto/build-tgm-r2-poky-fpp-tgm/tmp/sysroots/x86_64-linux/usr/libexec/mipsel-poky-linux-musl/gcc/mipsel-poky-linux-musl/6.2.0/as
-v -EL -mips32r2 -mips16 -mdsp -O2 -g -no-mdebug -mabi=32 -march=mips32r2
-mtune=24kec -msoft-float -KPIC -o .libs/libhavege_la-havegecollect.o
GNU assembler version 2.

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #9 from Christophe Lyon  ---
Did you try on arm-none-eabi too?
It does not seem to work for me.

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #10 from Bernd Edlinger  ---
(In reply to Christophe Lyon from comment #9)
> Did you try on arm-none-eabi too?
> It does not seem to work for me.

Hmmm, I don't have the exact environment, but
I used your .s file, removed the abi lines,
and linked it against the linux, and got immediately
a seg-fault, in the _Alloc_hider constructor.

That looked like a logical explanation, but
it's possible that I still don't understand.


Could you try to get a call stack of the seg-fault,
with the second patch?

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #12 from Christophe Lyon  ---
Created attachment 39699
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39699&action=edit
assembler-v2

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #13 from Christophe Lyon  ---
Created attachment 39700
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39700&action=edit
qemu trace v2

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #14 from Christophe Lyon  ---
I've attached the "v2" version of the .ii, .s and trace files.

[Bug bootstrap/77751] [7 regression] cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" for insn-emit.o

2016-09-27 Thread gerald at pfeifer dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77751

Gerald Pfeifer  changed:

   What|Removed |Added

 Status|RESOLVED|VERIFIED

--- Comment #5 from Gerald Pfeifer  ---
(In reply to Marek Polacek from comment #4)
> Should be fixed.

Yep, verified.

[Bug c++/77748] pr77550.C fails on arm-none-eabi

2016-09-27 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

--- Comment #11 from Christophe Lyon  ---
Created attachment 39698
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39698&action=edit
preprocessed-v2

[Bug middle-end/77718] [7 Regression] expand_builtin_memcmp swaps args

2016-09-27 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77718

--- Comment #4 from Bernd Schmidt  ---
So something like this maybe?

Index: builtins.c
===
--- builtins.c  (revision 240511)
+++ builtins.c  (working copy)
@@ -3707,11 +3707,13 @@ expand_builtin_memcmp (tree exp, rtx tar

   by_pieces_constfn constfn = NULL;

-  const char *src_str = c_getstr (arg1);
-  if (src_str == NULL)
-src_str = c_getstr (arg2);
-  else
-std::swap (arg1_rtx, arg2_rtx);
+  const char *src_str = c_getstr (arg2);
+  if (result_eq && src_str == NULL)
+{
+  src_str = c_getstr (arg1);
+  if (src_str != NULL)
+   std::swap (arg1_rtx, arg2_rtx);
+}

   /* If SRC is a string constant and block move would be done
  by pieces, we can avoid loading the string from memory

[Bug tree-optimization/77677] [7 Regression] ICE at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in set_value_range, at tree-vrp.c:361)

2016-09-27 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77677

--- Comment #12 from Pat Haugen  ---
(In reply to kugan from comment #11)
> 2016-09-27  Kugan Vivekanandarajah  
> 
>   PR ipa/77677
>   * ipa-prop.c (ipa_compute_jump_functions_for_edge): Use
>   extract_range_from_unary_expr to convert value_range.
>   * tree-vrp.c (extract_range_from_unary_expr_1): Rename to.
>   (extract_range_from_unary_expr): This.
>   * tree-vrp.h (extract_range_from_unary_expr): Declare.

176.gcc is working on powerpc now, thanks.

[Bug target/77759] New: internal compiler error: in function_arg_record_value

2016-09-27 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77759

Bug ID: 77759
   Summary: internal compiler error: in function_arg_record_value
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrtc27 at jrtc27 dot com
  Target Milestone: ---

Source:

struct empty {};

struct pair_empty {
struct empty a;
struct empty b;
};

void f(int slot0, int slot1, int slot2, int slot3, int slot4, int slot5,
struct pair_empty pair) {
}

int main(int argc, char **argv) {
struct pair_empty pair;
f(0, 0, 0, 0, 0, 0, pair);
return 0;
}

With g++ 6.2.0 in Debian unstable:

main.cpp: In function ‘void f(int, int, int, int, int, int, pair_empty)’:
main.cpp:8:6: internal compiler error: in function_arg_record_value, at
config/sparc/sparc.c:6729
 void f(int slot0, int slot1, int slot2, int slot3, int slot4, int slot5,
struct pair_empty pair) {
  ^
0xa3bf7f function_arg_record_value
../../src/gcc/config/sparc/sparc.c:6729
0xa3c5bb sparc_function_arg_1
../../src/gcc/config/sparc/sparc.c:6879
0x58ea7b assign_parm_find_entry_rtl
../../src/gcc/function.c:2534
0x58ea7b assign_parms
../../src/gcc/function.c:3723
0x590537 expand_function_start(tree_node*)
../../src/gcc/function.c:5207
0x465243 execute
../../src/gcc/cfgexpand.c:6225
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

With g++ 7.0.0 20160927 from master (7469707ce8cf1d74002118cdca992650998d4acd):

main.cpp: In function ‘void f(int, int, int, int, int, int, pair_empty)’:
main.cpp:8:6: internal compiler error: in function_arg_record_value, at
config/sparc/sparc.c:6739
 void f(int slot0, int slot1, int slot2, int slot3, int slot4, int slot5,
struct pair_empty pair) {
  ^
0xdd8f4f function_arg_record_value
../../upstream/gcc/config/sparc/sparc.c:6739
0xdd9dbb sparc_function_arg_1
../../upstream/gcc/config/sparc/sparc.c:6889
0x79fe93 assign_parm_find_entry_rtl
../../upstream/gcc/function.c:2532
0x79fe93 assign_parms
../../upstream/gcc/function.c:3725
0x7a2ae3 expand_function_start(tree_node*)
../../upstream/gcc/function.c:5209
0x61c5cf execute
../../upstream/gcc/cfgexpand.c:6256
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

function_arg_slotno gets to the MODE_RANDOM case, and follows the
`TARGET_ARCH64 && type` branch. traverse_record_type walks over the the
pair_empty type, but as there are no actual fields (only other records which
are traversed), classify_registers is never called, so data remains { false,
false, false }. Thus, neither of the conditions for returning -1 for records
are satisfied, and so slotno (which is 6) is returned.

Then, in function_arg_record_value, it takes the `nregs == 0` branch (since
traverse_record_type never calls count_registers for the same reason as above),
tries nregs = 1, but then hits the `nregs + slotno > SPARC_INT_ARG_MAX` branch,
and so nregs gets set to `SPARC_INT_ARG_MAX - slotno`, which is 0 in this case
(and would be negative if more ints were added to f to fill up the slots).
Then, the gcc_assert(nregs > 0) fails and gives the above backtrace.

The following patch fixes this; thoughts?

--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -6450,10 +6450,9 @@ function_arg_slotno (const struct sparc_args *cum,
machine_mode mode,
  && slotno >= SPARC_FP_ARG_MAX - 1)
return -1;

- /* If there are only int args and all int slots are filled,
-then must pass on stack.  */
+ /* If there are only int args or this is an empty record type,
+and all int slots are filled, then must pass on stack.  */
  if (!data.fp_regs
- && data.int_regs
  && slotno >= SPARC_INT_ARG_MAX)
return -1;
}

[Bug c/77758] New: OpenMP sections: intermittent incorrect behavior in reduction

2016-09-27 Thread andrey.vul at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77758

Bug ID: 77758
   Summary: OpenMP sections: intermittent incorrect behavior in
reduction
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.vul at gmail dot com
  Target Milestone: ---

gcc -fopenmp t.c && ./a.out; echo $? on the following file produces unexpected
values.

t.c:

#define aN 2
int main(int argc, char *argv[]) {
int a[aN];
long b = 0;
for (int i = 0; i < aN; ++i)
a[i] = i + 1;

#pragma omp parallel
#pragma omp sections reduction(+:b)
{
#pragma omp section
{   b = a[0];   }
#pragma omp section
{   b = a[1];   }
}

return (a[0]+a[1])-b;
}

A non-zero return code indicates invalid reduction between sections.

The separate parallel and sections directives produce a fail rate of 90+%.
When the parallel and sections directions are combined, ie (#pragma omp
parallel sections reduction(+:b)), the fail rate drops to ~2%.

Rates were calculated from running the produced executable 1000 times and
watching how many times a non-zero return was calculated.

As the non-zero return code is exclusively 1, it appears that instead of
reduction, the second sections block executes sequentially after the first
sections block in the same task, as opposed to parallel tasks then reduction
between the final values in each task, as is expected of reduction.

gcc -v:
Using built-in specs.
COLLECT_GCC=gcc-6.2.0
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/6.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-6.2.0/work/gcc-6.2.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/6.2.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.2.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.2.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/6.2.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 6.2.0 p1.0' --disable-esp --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --enable-libcilkrts
--disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --with-isl
--disable-isl-version-check --enable-libsanitizer --disable-default-pie
--disable-default-ssp
Thread model: posix
gcc version 6.2.0 (Gentoo 6.2.0 p1.0)

[Bug libstdc++/77760] New: get_time needs to set tm_wday amd tm_yday

2016-09-27 Thread drepper.fsp+rhbz at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77760

Bug ID: 77760
   Summary: get_time needs to set tm_wday amd tm_yday
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: drepper.fsp+rhbz at gmail dot com
  Target Milestone: ---

Created attachment 39701
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39701&action=edit
Test case to show get_time vs strptime

Currently the get_time function sets the tm_wday member of tm only when
explicitly asked and doesn't set tm_yday at all.  This does not match
strptime() which this function should emulate.

Basically, every time the parsing has enough information to compute that data
it should be done.  In the simplest case, of day of the month, month, and year
are known the two fields can be computed.

The glibc strptime function does all that.  It gets complicated, true, but
users of the functions will expect this behaviour since otherwise the results
are strange.  I know the standard does not explicitly say this.  See the
attached code for a test case.  I see

Sun Sep 27 03:11:41 2016 vs Tue Sep 27 03:11:41 2016 FAIL

because tm_wday == 0 means Sunday.

[Bug c++/77742] Warning about placement new for over-aligned type

2016-09-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77742

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-27
 Blocks||65122
 Ever confirmed|0   |1


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65122
[Bug 65122] std::vector doesn't honor element alignment

[Bug target/27077] [x86, 4.1] builtin strlen poor performance

2016-09-27 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27077

--- Comment #11 from Thomas Koenig  ---
> In this case a lot of informations are not necessary.

Those bug reporting guidelines are there for a reason:
To make it easier for developers (whose time is very
limited) to quickly reproduce bugs.

Without a self-contained test case, as specified in the
bug reporting guidelines, the chance that somebody will
look at this PR are very close to zero.

So, it's up to you.

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

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

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

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

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

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

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

[Bug middle-end/77718] [7 Regression] expand_builtin_memcmp swaps args

2016-09-27 Thread acsawdey at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77718

--- Comment #5 from Aaron Sawdey  ---
On Tue, 2016-09-27 at 14:30 +, bernds at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77718
> 
> --- Comment #4 from Bernd Schmidt  ---
> So something like this maybe?
> 
> Index: builtins.c
> ===
> --- builtins.c  (revision 240511)
> +++ builtins.c  (working copy)
> @@ -3707,11 +3707,13 @@ expand_builtin_memcmp (tree exp, rtx tar
> 
>    by_pieces_constfn constfn = NULL;
> 
> -  const char *src_str = c_getstr (arg1);
> -  if (src_str == NULL)
> -src_str = c_getstr (arg2);
> -  else
> -std::swap (arg1_rtx, arg2_rtx);
> +  const char *src_str = c_getstr (arg2);
> +  if (result_eq && src_str == NULL)
> +{
> +  src_str = c_getstr (arg1);
> +  if (src_str != NULL)
> +   std::swap (arg1_rtx, arg2_rtx);
> +}
> 
>    /* If SRC is a string constant and block move would be done
>   by pieces, we can avoid loading the string from memory
Bernd,
  Yeah that is about what I was thinking it needed. I'll test this on
ppc64le.

Thanks,
    Aaron

[Bug c/77762] New: Incorrect destination buffer length in -Wformat-length warning

2016-09-27 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77762

Bug ID: 77762
   Summary: Incorrect destination buffer length in -Wformat-length
warning
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fw at gcc dot gnu.org
CC: msebor at gcc dot gnu.org
  Target Milestone: ---

Created attachment 39703
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39703&action=edit
dbg_log.c

The attached test case, extracted from nscd/dbg_log.c in glibc, prints (when
compiled with -O2 -Wall):

dbg_log.c: In function ‘dbg_log’:
dbg_log.c:11:10: warning: specified size 512 exceeds the size 1 of the
destination object [-Wformat-length=]
   return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
  ^
 __bos (__s), __fmt, __ap);
 ~

This appears to be different from bug 77743 because GCC should not have buffer
length information in this case.

[Bug fortran/77763] New: ICE in parse_struct_map, at fortran/parse.c:3064

2016-09-27 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77763

Bug ID: 77763
   Summary: ICE in parse_struct_map, at fortran/parse.c:3064
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Doing some tests now with lately introduced DEC extensions.
Needs option -fdec, affects version 6 and 7 :


$ cat z1.f90
block data
   structure /s1/
   end structure
end block data


$ gfortran-7-20160925 -fdec -c z1.f90
z1.f90:2:17:

structure /s1/
 1
Error: STRUCTURE statement is not allowed inside of BLOCK DATA at (1)
f951: internal compiler error: Segmentation fault
0xc28c9f crash_signal
../../gcc/toplev.c:337
0x6d9bff parse_struct_map
../../gcc/fortran/parse.c:3064
0x6da781 parse_spec
../../gcc/fortran/parse.c:3688
0x6de3e0 parse_block_data
../../gcc/fortran/parse.c:5679
0x6de3e0 gfc_parse_file()
../../gcc/fortran/parse.c:6049
0x720d82 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:198

---

Replacing "structure" with "type" :

$ cat y1.f90
block data
   type s1
   end type
end block data

$ gfortran-7-20160925 -c y1.f90
$

[Bug fortran/77764] New: ICE in is_anonymous_component, at fortran/interface.c:450

2016-09-27 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77764

Bug ID: 77764
   Summary: ICE in is_anonymous_component, at
fortran/interface.c:450
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Needs option -fdec, affects version 6 and 7 :


$ cat z1.f90
program p
   structure /s1/
  union
 map
 end map
 map
real :: a = 2.0
 end map
  end union
   end structure
end


$ gfortran-7-20160925 -fdec z1.f90
f951: internal compiler error: Segmentation fault
0xc28c9f crash_signal
../../gcc/toplev.c:337
0x692c10 is_anonymous_component
../../gcc/fortran/interface.c:450
0x69464a compare_components
../../gcc/fortran/interface.c:479
0x6947aa gfc_compare_union_types(gfc_symbol*, gfc_symbol*)
../../gcc/fortran/interface.c:552
0x68f3e2 gfc_check_assign(gfc_expr*, gfc_expr*, int, bool)
../../gcc/fortran/expr.c:3290
0x692029 gfc_check_assign_symbol(gfc_symbol*, gfc_component*, gfc_expr*)
../../gcc/fortran/expr.c:3869
0x6f8c84 resolve_component
../../gcc/fortran/resolve.c:13349
0x6f9a72 resolve_fl_struct
../../gcc/fortran/resolve.c:13405
0x6f4807 resolve_symbol
../../gcc/fortran/resolve.c:13850
0x70df2b do_traverse_symtree
../../gcc/fortran/symbol.c:3963
0x6f782a resolve_types
../../gcc/fortran/resolve.c:15644
0x6f346c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:15757
0x6ddf9a resolve_all_program_units
../../gcc/fortran/parse.c:5879
0x6ddf9a gfc_parse_file()
../../gcc/fortran/parse.c:6131
0x720d82 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:198

[Bug middle-end/77683] [7 regression] ICE on %lf directive in format_floating in gimple-ssa-sprintf.c:1163

2016-09-27 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77683

Martin Sebor  changed:

   What|Removed |Added

 CC||gerald at pfeifer dot com

--- Comment #2 from Martin Sebor  ---
*** Bug 77740 has been marked as a duplicate of this bug. ***

[Bug middle-end/77740] [7 regression] internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1165

2016-09-27 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77740

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Martin Sebor  ---
This is a duplicate of bug 77683 a patch for which is in the review queue:

  https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01470.html

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

  1   2   >