[Bug middle-end/78519] missing warning for sprintf %s with null pointer

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78519

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
Committed in 243684.

[Bug middle-end/78519] missing warning for sprintf %s with null pointer

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78519

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Thu Dec 15 04:35:31 2016
New Revision: 243684

URL: https://gcc.gnu.org/viewcvs?rev=243684&root=gcc&view=rev
Log:
PR middle-end/78519 - missing warning for sprintf %s with null pointer

gcc/ChangeLog:

PR middle-end/78519
* gimple-ssa-sprintf.c (format_string): Handle null pointers.
(format_directive): Diagnose null pointer arguments.
(pass_sprintf_length::handle_gimple_call): Diagnose null destination
pointers.  Correct location of null format string in diagnostics.

gcc/testsuite/ChangeLog:

PR middle-end/78519
* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-8.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-sprintf.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/77445] [7 Regression] Performance drop after r239219 on coremark test

2016-12-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77445

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #9 from Jeffrey A. Law  ---
Not looking at it right now, but given it's a regression relative to gcc-6
it'll have to be looked at during this release cycle.

[Bug c++/78774] [6/7 Regression] ICE in constexpr string literals and templates

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78774

Martin Sebor  changed:

   What|Removed |Added

  Known to fail|7.0 |

--- Comment #8 from Martin Sebor  ---
Fixed on trunk by r243683.

[Bug c++/78774] [6/7 Regression] ICE in constexpr string literals and templates

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78774

--- Comment #7 from Martin Sebor  ---
Author: msebor
Date: Thu Dec 15 03:08:14 2016
New Revision: 243683

URL: https://gcc.gnu.org/viewcvs?rev=243683&root=gcc&view=rev
Log:
PR c++/78774 - [6/7 Regression] ICE in constexpr string literals and templates

gcc/cp/ChangeLog:

PR c++/78774
* pt.c (convert_template_argument): Avoid assuming operand type
is non-null since that of SCOPE_REF is not.

gcc/testsuite/ChangeLog:

PR c++/78774
* g++.dg/cpp1y/pr78774.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr78774.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug target/78213] [7 Regression] -fself-test fails on aarch64

2016-12-14 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78213

--- Comment #12 from David Malcolm  ---
(In reply to Markus Trippelsdorf from comment #10)
> testsuite/gcc.dg/pr78213.c often times out:
> 
> FAIL: gcc.dg/pr78213.c (test for excess errors)
> FAIL: gcc.dg/pr78213.c -fself-test (test for warnings, line )
> WARNING: program timed out.
> 
> This happens on ppc64le with "make -j60 check".

I disabled this test as part of r243681; see
https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00914.html for discussion
("PR target/78213 revisited (was Re: [PATCH 5/9] Introduce
selftest::locate_file (v4))").

[Bug target/78213] [7 Regression] -fself-test fails on aarch64

2016-12-14 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78213

--- Comment #11 from David Malcolm  ---
Author: dmalcolm
Date: Thu Dec 15 01:47:48 2016
New Revision: 243681

URL: https://gcc.gnu.org/viewcvs?rev=243681&root=gcc&view=rev
Log:
Introduce selftest::locate_file

gcc/ChangeLog:
* Makefile.in (SELFTEST_FLAGS): Add path argument to -fself-test.
(s-selftest): Add dependency on the selftests data directory.
* common.opt (fself-test): Rename to...
(fself-test=): ...this, documenting the meaning of the argument.
* selftest-run-tests.c (along): Likewise.
* selftest-run-tests.c: Include "options.h".
(selftest::run_tests): Initialize selftest::path_to_selftest_files
from flag_self_test.
* selftest.c (selftest::path_to_selftest_files): New global.
(selftest::locate_file): New function.
(selftest::test_locate_file): New function.
(selftest_c_tests): Likewise.
(selftest::selftest_c_tests): Call test_locate_file.
* selftest.h (selftest::locate_file): New decl.
(selftest::path_to_selftest_files): New decl.

gcc/testsuite/ChangeLog:
PR target/78213
* gcc.dg/cpp/pr71591.c: Add a fake value for the argument of
-fself-test.
* gcc.dg/pr78213.c: Disable this test.
* selftests/example.txt: New file.

Added:
trunk/gcc/testsuite/selftests/
trunk/gcc/testsuite/selftests/example.txt
Modified:
trunk/gcc/ChangeLog
trunk/gcc/Makefile.in
trunk/gcc/common.opt
trunk/gcc/selftest-run-tests.c
trunk/gcc/selftest.c
trunk/gcc/selftest.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/cpp/pr71591.c
trunk/gcc/testsuite/gcc.dg/pr78213.c

[Bug target/78818] New: msp430 persistent attribute is not applied correctly in some cases

2016-12-14 Thread awygle at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78818

Bug ID: 78818
   Summary: msp430 persistent attribute is not applied correctly
in some cases
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: awygle at gmail dot com
  Target Milestone: ---

The MS430 variable attribute "persistent" places variables in a special section
.persistent so that they will not be re-initialized on reset and so that the
linker can place them in non-volatile storage. Variables with this attribute
aren't placed in this section when:

1) the variables are specified as "static" AND are not initialized or are
initialized to 0. In this case the variables are placed in the .bss section.
2) the program is compiled with the -fdata-sections optimization option. In
this case the variables are placed in either .bss.foo or .text.foo.

An example program and two compilations:

test.i:
# 1 "test.c"
# 1 ""
# 1 ""
# 1 "test.c"

__attribute__((persistent)) int persist = 1;
__attribute__((persistent)) int global_persist = 0;
static __attribute__((persistent)) int static_persist = 1;
static __attribute__((persistent)) int static_nopersist = 0;

void main() {

  while(1);
}


Compilation without -fdata-sections:

% msp430-elf-gcc -msim -c test.i -o test.o
% msp430-elf-objdump -x --syms test.o

test.o: file format elf32-msp430
test.o
architecture: MSP430X, flags 0x0011:
HAS_RELOC, HAS_SYMS
start address 0x

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0004      0034  2**1
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data       0038  2**0
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss  0002      0038  2**1
  ALLOC
  3 .persistent   0006      0038  2**1
  CONTENTS, ALLOC, LOAD, DATA
  4 .comment  0012      003e  2**0
  CONTENTS, READONLY
  5 .MSP430.attributes 0017      0050  2**0
  CONTENTS, READONLY
SYMBOL TABLE:
 ldf *ABS*   test.c
 ld  .text   .text
 ld  .data   .data
 ld  .bss    .bss
 ld  .persistent .persistent
0004 l O .persistent0002 static_persist
 l O .bss   0002 static_nopersist
 ld  .comment    .comment
 ld  .MSP430.attributes  .MSP430.attributes
 g O .persistent0002 persist
0002 g O .persistent0002 global_persist
 *UND*   __crt0_init_bss
 g F .text  0004 main


RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE  VALUE
0002 R_MSP430X_ABS16   .L2

Compilation with -fdata-sections:

% msp430-elf-gcc -msim -fdata-sections -c test.i -o test.o
% msp430-elf-objdump -x --syms test.o

test.o: file format elf32-msp430
test.o
architecture: MSP430X, flags 0x0011:
HAS_RELOC, HAS_SYMS
start address 0x

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0004      0034  2**1
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data       0038  2**0
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss        0038  2**0
  ALLOC
  3 .data.persist 0002      0038  2**1
  CONTENTS, ALLOC, LOAD, DATA
  4 .bss.global_persist 0002      003a  2**1
  ALLOC
  5 .data.static_persist 0002      003a  2**1
  CONTENTS, ALLOC, LOAD, DATA
  6 .bss.static_nopersist 0002      003c  2**1
  ALLOC
  7 .comment  0012      003c  2**0
  CONTENTS, READONLY
  8 .MSP430.attributes 0017      004e  2**0
  CONTENTS, READONLY
SYMBOL TABLE:
 ldf *ABS*   test.c
 ld  .text   .text
 ld  .data   .data
 ld  .bss    .bss
 ld  .data.persist   .data.persist
 ld  .bss.global_persist .bss.global_persist
 ld  .data.static_persist    .data.static_persist
 l O .data.static_persist   0002 static_persist
 ld  .bss.static_nopersist   .bss.static_nopersist
 l O .bss.static_nopersist  0002 static_nopersist
 ld  .comment    .comment
 ld  .MSP430.attributes

[Bug tree-optimization/78696] [7 Regression] -fprintf-return-value misoptimizes %.Ng where N is greater than 10

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78696

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #17 from Martin Sebor  ---
Patch submitted for review:
https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00905.html

[Bug fortran/72709] Incorrect assignment of allocatable character array used as component of derived type

2016-12-14 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72709

--- Comment #4 from janus at gcc dot gnu.org ---
Extension / variation of the test case:


programread_exp_data
   implicit none

   type experimental_data_t
  character(len=:), dimension(:), allocatable :: header
   end type

   type(experimental_data_t) :: ex
   integer, parameter :: nh = 3
   integer :: i

   allocate(character(len=2) :: ex%header(nh))

   ex%header(3) = "C"
   ex%header(2) = "B"
   ex%header(1) = "A"

   do i = 1, nh
  write(*,*) "header(",i,") = ", ex%header(i), " loc: ", loc(ex%header(i))
   enddo

end program


This prints:

 header(   1 ) = A  loc:  16642032
 header(   2 ) = A  loc:  16642032
 header(   3 ) = A  loc:  16642032


which shows that the problem is apparently not only in the writing into the
array, but also in the output. All elements appear to have the same address!

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-14 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #6 from Jiri Danek  ---
I can reproduce this on OpenSuse Tumbleweed (in Docker)

$ docker run --rm -it jdanekrh/gcc-78763-opensuse make

]...]

[ 66%] Built target reactor_send_cpp
Scanning dependencies of target go-build
# qpid.apache.org/amqp
go1: internal compiler error: in do_get_backend, at
go/gofrontend/expressions.cc:8352
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[2]: *** [proton-c/bindings/go/CMakeFiles/go-build.dir/build.make:57:
proton-c/bindings/go/CMakeFiles/go-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1890:
proton-c/bindings/go/CMakeFiles/go-build.dir/all] Error 2
make: *** [Makefile:139: all] Error 2

I used the following Dockerfile:

FROM library/opensuse:tumbleweed
MAINTAINER jda...@redhat.com

RUN zypper refresh
RUN zypper --non-interactive install --force-resolution git gcc6 gcc6-go
gcc6-c++ cmake libuv-devel python-pip swig openssl openssl-devel

#RUN pip install python-qpid-proton

RUN git clone https://github.com/apache/qpid-proton.git
WORKDIR /qpid-proton

RUN mkdir /qpid-proton/build
WORKDIR /qpid-proton/build
RUN CC=gcc-6 CXX=g++-6 cmake -DGO_EXE=/usr/bin/go-6 -DCMAKE_BUILD_TYPE=Debug ..

[Bug bootstrap/78817] stage2 bootstrap failure in vec.h:1613:5: error: argument 1 null where non-null expected after r243661

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78817

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Martin Sebor  ---
Patch for the warnings posted for review:
  https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01324.html

Segher, I haven't had luck reproducing the bootstrap comparison failure on my
POWER8 machine.  If you are sure this patch causes it can you provide more
details (your configure options and anything else I might need to reproduce
it).

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

2016-12-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77834

Bill Schmidt  changed:

   What|Removed |Added

 CC||wschmidt at gcc dot gnu.org

--- Comment #13 from Bill Schmidt  ---
The new test case fails on the GCC 6.3 release candidate for
powerpc64le-unknown-linux-gnu:

spawn /home/wschmidt/gcc/build/gcc-6.3.0-RC-20161214/gcc/xgcc
-B/home/wschmidt/g
cc/build/gcc-6.3.0-RC-20161214/gcc/
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O -ftree-pre -Wno-psabi
-S -m64 -o pr77834.s
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c: In
function 'foo':
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c:10:1:
warning: GCC vector returned by reference: non-standard ABI extension with no
compatibility guarantee
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c:9:1:
warning: GCC vector passed by reference: non-standard ABI extension with no
compatibility guarantee
output is:
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c: In
function 'foo':
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c:10:1:
warning: GCC vector returned by reference: non-standard ABI extension with no
compatibility guarantee
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr77834.c:9:1:
warning: GCC vector passed by reference: non-standard ABI extension with no
compatibility guarantee

FAIL: gcc.dg/pr77834.c (test for excess errors)

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

2016-12-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78540

Bill Schmidt  changed:

   What|Removed |Added

 CC||wschmidt at gcc dot gnu.org

--- Comment #8 from Bill Schmidt  ---
The new test case fails on powerpc64le-unknown-linux-gnu in the GCC 6.3 RC:

spawn /home/wschmidt/gcc/build/gcc-6.3.0-RC-20161214/gcc/xgcc
-B/home/wschmidt/gcc/build/gcc-6.3.0-RC-20161214/gcc/
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -Wno-psabi -S -m64 -o
pr78540.s
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c: In
function 'foo':
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c:11:1:
warning: GCC vector returned by reference: non-standard ABI extension with no
compatibility guarantee
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c:10:1:
warning: GCC vector passed by reference: non-standard ABI extension with no
compatibility guarantee
output is:
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c: In
function 'foo':
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c:11:1:
warning: GCC vector returned by reference: non-standard ABI extension with no
compatibility guarantee
/home/wschmidt/gcc/gcc-6.3.0-RC-20161214/gcc/testsuite/gcc.dg/pr78540.c:10:1:
warning: GCC vector passed by reference: non-standard ABI extension with no
compatibility guarantee

FAIL: gcc.dg/pr78540.c (test for excess errors)

[Bug driver/78772] -fstrict-aliasing should turn on Wstrict-aliasing automaticly

2016-12-14 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772

Jim Wilson  changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #8 from Jim Wilson  ---
Looking at the 2011 ISO C standard, section 6.5 Expressions, paragraph 7, says
"An object shall have its stored value accessed only by an lvalue expression
that has one of the following types:".  It then lists compatible types, a
qualified compatible type, a signed/unsigned compatible type, a signed/unsigned
qualified compatible type, an aggregate/union that contains a compatible type,
or a char type.  If your code conforms to this rule, then -fstrict-aliasing
will not break it.

GCC supports type punning via unions.  Or you can use -fno-strict-aliasing if
you want to use pointer casts for type punning.

[Bug target/78791] [7 regression] ACATS cxf2001 failure

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78791

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug middle-end/78786] GCC hangs/out of memory calling sprintf with large precision

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78786

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #7 from Martin Sebor  ---
Fixed in r243672.

[Bug middle-end/78786] GCC hangs/out of memory calling sprintf with large precision

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78786

--- Comment #6 from Martin Sebor  ---
Author: msebor
Date: Wed Dec 14 21:58:19 2016
New Revision: 243672

URL: https://gcc.gnu.org/viewcvs?rev=243672&root=gcc&view=rev
Log:
PR middle-end/78786 - GCC hangs/out of memory calling sprintf with large
precision

gcc/ChangeLog:

PR middle-end/78786
* gimple-ssa-sprintf.c (target_dir_max): New macro.
(get_mpfr_format_length): New function.
(format_integer): Use HOST_WIDE_INT instead of int.
(format_floating_max): Same.
(format_floating): Call get_mpfr_format_length.
(format_directive): Use target_dir_max.

gcc/testsuite/ChangeLog:

PR middle-end/78786
* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-7.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-sprintf.c
trunk/gcc/testsuite/ChangeLog

[Bug bootstrap/78817] stage2 bootstrap failure in vec.h:1613:5: error: argument 1 null where non-null expected after r243661

2016-12-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78817

Segher Boessenkool  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #1 from Segher Boessenkool  ---
The comparison failure (as described in PR17308) is also caused by the patch
in PR17308.

[Bug target/78791] [7 regression] ACATS cxf2001 failure

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78791

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Wed Dec 14 21:39:51 2016
New Revision: 243671

URL: https://gcc.gnu.org/viewcvs?rev=243671&root=gcc&view=rev
Log:
PR target/78791
* config/i386/i386.h (enum ix86_stack_slot): Add SLOT_STV_TEMP.
* config/i386/i386.c (dimode_scalar_chain::make_vector_copies,
dimode_scalar_chain::convert_reg): Use SLOT_STV_TEMP instead of
SLOT_TEMP.

* gcc.c-torture/execute/pr78791.c: New test.
* gcc.target/i386/pr78791.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr78791.c
trunk/gcc/testsuite/gcc.target/i386/pr78791.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/i386.h
trunk/gcc/testsuite/ChangeLog

[Bug c++/78813] constexpr function returns wrong value

2016-12-14 Thread charles.frasch at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78813

--- Comment #3 from Charles  ---
Thanks; didn't find that ticket before I submitted the bug. Validated that the
error does not occur on a fresh gcc-6-branch checkout.

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

Uroš Bizjak  changed:

   What|Removed |Added

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

--- Comment #14 from Uroš Bizjak  ---
Fixed.

[Bug bootstrap/78817] stage2 bootstrap failure in vec.h:1613:5: error: argument 1 null where non-null expected after r243661

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78817

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-12-14
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

--- Comment #13 from Uroš Bizjak  ---
(In reply to Allan Jensen from comment #8)
> Thanks that looks good. I will test it when I have a chance. I am changing
> the Qt sources to not assume the presence of __builtin_clzs when __BMI__ is
> defined. It can use __builtin_clz() and __builtin_ctz()-16U instead, but for
> general compatibility it is nice that GCC also keeps it around. 

There are now several possibilities:

a) Use apparently de-facto standard __builtin_clzs and __builtin_ctzs.

b) (gcc-7+) You can use documented __builtin_clz/__builtin_ctz builtins with
operand casted to (unsigned short). When instruction is available, the compiler
synthesizes 16bit insn variant from 32bit insn and zero-extension, as evident
from gcc.target/i386/pr59874-?.c test cases. This is the most portable
solution.

c) (gcc-6.3+) Figure out how to use __lzcnt16/__tzcnt_u16, as suggested in
Comment #3. This is the optimal solution, as checks for zero operand are not
needed.

> Note, it would be even better though if GCC could support the short forms as
> generic builtins. That changes the semantics slightly, but they are named so
> similarly to the clz, clzl and clzll it would be easy to assume they also
> are generics, with similar semantics, and can work across all targets.
> 
> Btw. I assume __builtin_clzs being a target specific builtin, that GCC never
> had the capability of resolving it at compile-time? If that is the case, it
> might actually be a bug that GCC allowed it at all in a constexpr function.

Hm, I'm not versed in c++, but the provided headers that define various
intrinsics are used in various c++ projects. In gcc-6.3+, the compiler folds
these two builtins with constant operand at compile time, so please retry your
tests with a newer compiler version.

[Bug middle-end/17308] nonnull attribute not as useful as it could be

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #20 from Martin Sebor  ---
I've raised bug 78817 for the powerpc64le bootstrap failure.

[Bug bootstrap/78817] New: stage2 bootstrap failure in vec.h:1613:5: error: argument 1 null where non-null expected after r243661

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78817

Bug ID: 78817
   Summary: stage2 bootstrap failure in vec.h:1613:5: error:
argument 1 null where non-null expected after r243661
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Commit r243661 causes a bootstrap failure on powerpc64l-linux with the
following error:

In file included from /src/gcc/trunk/gcc/hash-table.h:236:0,
 from /src/gcc/trunk/gcc/coretypes.h:369,
 from /src/gcc/trunk/gcc/tree-inline.c:23:
/src/gcc/trunk/gcc/vec.h: In function ‘basic_block_def*
copy_bb(copy_body_data*, basic_block, int, gcov_type)’:
/src/gcc/trunk/gcc/vec.h:1613:5: error: argument 1 null where non-null expected
[-Werror=nonnull]
 memset (&(address ()[oldlen]), 0, sz);
 ^~
In file included from
/build/gcc-trunk/prev-powerpc64le-unknown-linux-gnu/libstdc++-v3/include/cstring:42:0,
 from /src/gcc/trunk/gcc/system.h:235,
 from /src/gcc/trunk/gcc/tree-inline.c:22:
/usr/include/string.h:62:14: note: in a call to function ‘void* memset(void*,
int, size_t)’ declared here
 extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
  ^~

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

--- Comment #12 from Uroš Bizjak  ---
The above patch also reintroduces reintroduces __builtin_clzs and
__builtin_ctzs to mainline.

[Bug c++/72775] [6 Regression] internal compiler error: in finish_expr_stmt, at cp/semantics.c:677

2016-12-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72775

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
Summary|[6/7 Regression] internal   |[6 Regression] internal
   |compiler error: in  |compiler error: in
   |finish_expr_stmt, at|finish_expr_stmt, at
   |cp/semantics.c:677  |cp/semantics.c:677

--- Comment #16 from Marek Polacek  ---
Fixed.

[Bug fortran/78814] ICE in symbol_rank, at fortran/interface.c:1265

2016-12-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78814

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug sanitizer/78815] [7 Regression] ICE: segfault with -fopenmp -fsanitize=address

2016-12-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78815

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-14
 CC||dodji at gcc dot gnu.org,
   ||dvyukov at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||kcc at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
  Component|fortran |sanitizer
Summary|ICE: segfault with -fopenmp |[7 Regression] ICE:
   |-fsanitize=address  |segfault with -fopenmp
   ||-fsanitize=address
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
That's mine, started with r241896.

[Bug c++/72775] [6/7 Regression] internal compiler error: in finish_expr_stmt, at cp/semantics.c:677

2016-12-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72775

--- Comment #15 from Marek Polacek  ---
Author: mpolacek
Date: Wed Dec 14 20:41:43 2016
New Revision: 243669

URL: https://gcc.gnu.org/viewcvs?rev=243669&root=gcc&view=rev
Log:
PR c++/72775
* init.c (perform_member_init): Diagnose member initializer for
flexible array member. 

* g++.dg/ext/flexary12.C: Adjust dg-error.
* g++.dg/ext/flexary20.C: New.
* g++.dg/ext/flexary21.C: New.

Added:
trunk/gcc/testsuite/g++.dg/ext/flexary20.C
trunk/gcc/testsuite/g++.dg/ext/flexary21.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ext/flexary12.C

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

--- Comment #11 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Dec 14 20:27:06 2016
New Revision: 243668

URL: https://gcc.gnu.org/viewcvs?rev=243668&root=gcc&view=rev
Log:
PR target/59874
* config/i386/i386-builtin.def: Add __builtin_clzs and __builtin_ctzs.
(ix86_fold_builtin): Handle IX86_BUILTIN_CTZS and IX86_BUILTIN_CLZS.
* config/i386/i386.md (*ctzhi2): New insn_and_split pattern.
(*clzhi2): Ditto.

testsuite/ChangeLog

PR target/59874
* gcc.target/i386/pr59874-1.c: New test.
* gcc.target/i386/pr59874-2.c: Ditto.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr59874-1.c
trunk/gcc/testsuite/gcc.target/i386/pr59874-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386-builtin.def
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/i386.md
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/17308] nonnull attribute not as useful as it could be

2016-12-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

--- Comment #19 from Segher Boessenkool  ---
powerpc64-linux, even.

[Bug middle-end/17308] nonnull attribute not as useful as it could be

2016-12-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

Segher Boessenkool  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||segher at gcc dot gnu.org
 Resolution|FIXED   |---

--- Comment #18 from Segher Boessenkool  ---
This gives a warning in powerpc-linuc (which breaks bootstrap), when
compiling tree-inline.c:

/home/segher/src/gcc/gcc/vec.h:1613:5: error: argument 1 null where non-null
expected [-Werror=nonnull]
   memset (&(address ()[oldlen]), 0, sz);
   ^~

Configuring with --disable-werror ends with a bootstrap comparison failure:

Bootstrap comparison failure!
gcc/gcc.o differs
gcc/plugin.o differs

(which could of course be something else).

[Bug fortran/78797] It is time perhaps to implement -std=f2015

2016-12-14 Thread paul.richard.thomas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797

--- Comment #5 from paul.richard.thomas at gmail dot com  ---
I do apologise, it seems that Mr Reid did not do his usual update. We
will have to work from the draft standard itself.

Paul

On 14 December 2016 at 20:36, paul.richard.thomas at gmail dot com
 wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797
>
> --- Comment #4 from paul.richard.thomas at gmail dot com  at gmail dot com> ---
> Hi Janus,
>
> Yes there is one - I had it open but somehow provided the link to the
> wrong one...
>
> Paul
>
> On 14 December 2016 at 19:20, janus at gcc dot gnu.org
>  wrote:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797
>>
>> --- Comment #3 from janus at gcc dot gnu.org ---
>> (In reply to Paul Thomas from comment #2)
>>> I will post the existence of this PR to the list over the weekend togetehr
>>> with: ftp://ftp.nag.co.uk/sc22wg5/n1551-n1600/n1579.pdf
>>
>> This document describes the new features of Fortran 2003, and I know that 
>> there
>> is also one for 2008. But what about 2015?
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug debug/77844] [5/7 Regression] Compilation of simple C++ example exhaust memory

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77844

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Wed Dec 14 19:40:05 2016
New Revision: 243662

URL: https://gcc.gnu.org/viewcvs?rev=243662&root=gcc&view=rev
Log:
PR debug/77844
* valtrack.c: Include rtl-iter.h.
(struct rtx_subst_pair): Add insn field.
(propagate_for_debug_subst): If pair->to contains at least 2
regs, create a DEBUG_INSN with a debug temp before pair->insn
and replace from with the debug temp instead of pair->to.
(propagate_for_debug): Initialize p.insn.
* combine.c (insn_uid_check): New inline function.
(INSN_COST, LOG_LINKS): Use it instead of INSN_UID.
(find_single_use, combine_instructions,
cant_combine_insn_p, try_combine): Use NONDEBUG_INSN_P instead of
INSN_P.

* g++.dg/opt/pr77844.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr77844.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/valtrack.c

[Bug fortran/78797] It is time perhaps to implement -std=f2015

2016-12-14 Thread paul.richard.thomas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797

--- Comment #4 from paul.richard.thomas at gmail dot com  ---
Hi Janus,

Yes there is one - I had it open but somehow provided the link to the
wrong one...

Paul

On 14 December 2016 at 19:20, janus at gcc dot gnu.org
 wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797
>
> --- Comment #3 from janus at gcc dot gnu.org ---
> (In reply to Paul Thomas from comment #2)
>> I will post the existence of this PR to the list over the weekend togetehr
>> with: ftp://ftp.nag.co.uk/sc22wg5/n1551-n1600/n1579.pdf
>
> This document describes the new features of Fortran 2003, and I know that 
> there
> is also one for 2008. But what about 2015?
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug fortran/78797] It is time perhaps to implement -std=f2015

2016-12-14 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797

--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #2)
> I will post the existence of this PR to the list over the weekend togetehr
> with: ftp://ftp.nag.co.uk/sc22wg5/n1551-n1600/n1579.pdf

This document describes the new features of Fortran 2003, and I know that there
is also one for 2008. But what about 2015?

[Bug debug/59161] GDB pretty printers: iterator->reference not printed

2016-12-14 Thread jan.kratochvil at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59161

Jan Kratochvil  changed:

   What|Removed |Added

 CC||palves at redhat dot com

--- Comment #5 from Jan Kratochvil  ---
Returning gdb.Value means for GDB the pretty printer is printing its elements
which are printed in a simplified way - suppressing their addresses - since:

Message-Id: <20091110021158.c3c2576...@ppluzhnikov.mtv.corp.google.com>
https://sourceware.org/ml/gdb/2009-11/msg00105.html
Message-Id: <20091110214517.49a3e76...@ppluzhnikov.mtv.corp.google.com>
https://sourceware.org/ml/gdb-patches/2009-11/msg00234.html
commit 269f82e5eb0aa5d5b4c1accc858f95b62bc16df4

Printing an iterator means GDB should print the referenced element in its
normal form - the referenced element are not data items of the iterator itself.
The str() cast has a side-effect GDB will print format the data without the
simplification from patch above.

It may be weird that GDB value_print_options::deref_ref is off, therefore GDB
then prints neither the reference address nor the referenced value.  But that
is unrelated IMO.

No matter how weird the GDB printing is in the end I find str() does the right
thing for GDB in this case.

[Bug fortran/78797] It is time perhaps to implement -std=f2015

2016-12-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78797

--- Comment #2 from Paul Thomas  ---
(In reply to janus from comment #1)
> +1
> 
> Can you remind us which F15 features we have already?
> 
> On https://gcc.gnu.org/wiki/GFortran/News I see:
> * Support for IMPLICIT NONE (external, type).
> * ERROR STOP is now permitted in pure procedures.
> 
> Anything else?

Assumed type and assumed rank(partial). I thought that we had implemented the
RANK intrinsic as well but the Chivers et al. table shows N.

There are rather a lot of features that are obsolete or deleted in F2015:
Labeled DO loops have been redundant since Fortran 90 and are now specified to
be obsolescent. The arithmetic IF statement has been deleted. The EQUIVALENCE
and COMMON statements and the block data program unit have been redundant since
Fortran 90 and are now specified to be obsolescent. The nonblock DO construct
has been deleted. The FORALL is now specified to be obsolescent.

What has been done with intrinsics, I am not sure; eg. has COSHAPE been
implemented?

I will post the existence of this PR to the list over the weekend togetehr
with: ftp://ftp.nag.co.uk/sc22wg5/n1551-n1600/n1579.pdf

Cheers

Paul

[Bug c++/78816] New: [c++14] Static auto variable usage in generic/variadic lambda fails to compile

2016-12-14 Thread jeroendebusser at telenet dot be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78816

Bug ID: 78816
   Summary: [c++14] Static auto variable usage in generic/variadic
lambda fails to compile
   Product: gcc
   Version: 6.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jeroendebusser at telenet dot be
  Target Milestone: ---

Sample code adapted from https://adishavit.github.io/2016/Technical-Debt/
(https://godbolt.org/g/osKPbq):
void f(void (*f1)(int)) {
  f1(42);
}

//Converts any lambda to a captureless lambda that converts nicely to a
function pointer for the lifetime of the temporary.
template 
static auto callback(Lambda &&l)
{
  static auto* p = &l;
  p = &l;
  return [](auto... x){ return (*p)(x...); };
}

int main() {
  int x = 5;
  f(callback([=](int y){std::cout << x << ' ' << y;}));
}

Gives the error:
: In instantiation of 'callback(Lambda&&):: [with
auto:1 = {int}; Lambda = main()::]':
:14:22:   required by substitution of 'template
callback(Lambda&&) [with Lambda = main()::]operator decltype (((const callback(Lambda&&) [with Lambda =
main()::]::*)((const callback(Lambda&&) [with
Lambda = main()::]::*
const)0u))->operator()(static_cast(callback::__lambda0::_FUN::)
...)) (*)(auto:1 ...)() const [with auto:1 = {int}]'
:19:54:   required from here
:14:33: error: use of 'p' before deduction of 'auto'
return [](auto... x){ return (*p)(x...); };
~^~~
:14:36: error: invalid use of 'auto'
return [](auto... x){ return (*p)(x...); };
^~

Making the lambda in callback non-generic(ie: [](int x){return (*p)(x);}) or
explicitly calculating the type of p(std::add_pointer_t) makes the
code compile successfully.

[Bug libstdc++/59171] pretty printers: reverse iterator off by one

2016-12-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59171

--- Comment #5 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #4)
> In the general case we can't print the correct value, because we may not be
> able to increment the 'current' member to point to the object that would
> result from dereferencing the reverse_iterator. The code for ++current might
> not be present in the executable.

Oops, I meant decrement, and --current of course!

[Bug c/78673] sprintf missing attribute nonnull on destination argument

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78673

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
Implemented in 7.0 in r243661.

[Bug middle-end/17308] nonnull attribute not as useful as it could be

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
Summary|nonnull attribute not as|nonnull attribute not as
   |useful as it could  |useful as it could be

--- Comment #17 from Martin Sebor  ---
Implemented in 7.0 in r243661.

[Bug libstdc++/59171] pretty printers: reverse iterator off by one

2016-12-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59171

--- Comment #4 from Jonathan Wakely  ---
Actually I'm not sure what can be done to fix this.

In the general case we can't print the correct value, because we may not be
able to increment the 'current' member to point to the object that would result
from dereferencing the reverse_iterator. The code for ++current might not be
present in the executable.

Even if we could do that, we'd get inconsistent behaviour depending on the type
of current. If it's a container from the C++03 standard library then we'd
automatically dereference it (because the iterators from those containers have
pretty printers that auto-dereference), if it's a pointer, or a user-defined
iterator, or and iterator from a container from the C++11 standard library then
we don't have a printer and so won't auto-dereference it. Which is yet another
reason not to automatically dereference iterators.

[Bug c++/78701] [6/7 Regression] ICE: unexpected expression N of kind template_parm_index

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78701

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #7 from Nathan Sidwell  ---
fixed on trunk & gcc-6 branch

[Bug c++/78701] [6/7 Regression] ICE: unexpected expression N of kind template_parm_index

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78701

--- Comment #6 from Nathan Sidwell  ---
Author: nathan
Date: Wed Dec 14 17:23:06 2016
New Revision: 243660

URL: https://gcc.gnu.org/viewcvs?rev=243660&root=gcc&view=rev
Log:
PR c++/78701
* pt.c (type_unification_real): Check tsubst arg doesn't have
remaining template parms before converting it.

PR c++/78701
* g++.dg/cpp0x/pr78701.C: New.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/pr78701.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/pt.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/17308] nonnull attribute not as useful as it could

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

--- Comment #16 from Martin Sebor  ---
Author: msebor
Date: Wed Dec 14 17:23:16 2016
New Revision: 243661

URL: https://gcc.gnu.org/viewcvs?rev=243661&root=gcc&view=rev
Log:
PR c/78673 - sprintf missing attribute nonnull on destination argument
PR c/17308 - nonnull attribute not as useful as it could be

gcc/ChangeLog:

PR c/17308
* builtin-attrs.def (ATTR_NONNULL_1_1, ATTR_NONNULL_1_2): Defined.
(ATTR_NONNULL_1_3, ATTR_NONNULL_1_4, ATTR_NONNULL_1_5): Same.
(ATTR_NOTHROW_NONNULL_1_1, ATTR_NOTHROW_NONNULL_1_2): Same.
(ATTR_NOTHROW_NONNULL_1_3, ATTR_NOTHROW_NONNULL_1_4): Same.
(ATTR_NOTHROW_NONNULL_1_5): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_1_2): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_2_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_2_3): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_3_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_3_4): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_4_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_4_5): Same.
* builtins.c (validate_arg): Add argument.  Treat null pointers
passed to nonnull arguments as invalid.
(validate_arglist): Same.
* builtins.def (fprintf, fprintf_unlocked): Add nonnull attribute.
(printf, printf_unlocked, sprintf. vfprintf, vsprintf): Same.
(__sprintf_chk, __vsprintf_chk, __fprintf_chk, __vfprintf_chk): Same.
* calls.c (get_nonnull_ags, maybe_warn_null_arg): New functions.
(initialize_argument_information): Diagnose null pointers passed to
arguments declared nonnull.
* calls.h (get_nonnull_args): Declared.

gcc/c-family/ChangeLog:

PR c/17308
* c-common.c (check_nonnull_arg): Disable when optimization
is enabled.

gcc/testsuite/ChangeLog:

PR c/17308
* gcc.dg/builtins-nonnull.c: New test.
* gcc.dg/nonnull-4.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/builtins-nonnull.c
trunk/gcc/testsuite/gcc.dg/nonnull-4.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtin-attrs.def
trunk/gcc/builtins.c
trunk/gcc/builtins.def
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/calls.c
trunk/gcc/calls.h
trunk/gcc/testsuite/ChangeLog

[Bug c/78673] sprintf missing attribute nonnull on destination argument

2016-12-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78673

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Wed Dec 14 17:23:16 2016
New Revision: 243661

URL: https://gcc.gnu.org/viewcvs?rev=243661&root=gcc&view=rev
Log:
PR c/78673 - sprintf missing attribute nonnull on destination argument
PR c/17308 - nonnull attribute not as useful as it could be

gcc/ChangeLog:

PR c/17308
* builtin-attrs.def (ATTR_NONNULL_1_1, ATTR_NONNULL_1_2): Defined.
(ATTR_NONNULL_1_3, ATTR_NONNULL_1_4, ATTR_NONNULL_1_5): Same.
(ATTR_NOTHROW_NONNULL_1_1, ATTR_NOTHROW_NONNULL_1_2): Same.
(ATTR_NOTHROW_NONNULL_1_3, ATTR_NOTHROW_NONNULL_1_4): Same.
(ATTR_NOTHROW_NONNULL_1_5): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_1_2): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_2_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_2_3): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_3_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_3_4): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_4_0): Same.
(ATTR_NONNULL_1_FORMAT_PRINTF_4_5): Same.
* builtins.c (validate_arg): Add argument.  Treat null pointers
passed to nonnull arguments as invalid.
(validate_arglist): Same.
* builtins.def (fprintf, fprintf_unlocked): Add nonnull attribute.
(printf, printf_unlocked, sprintf. vfprintf, vsprintf): Same.
(__sprintf_chk, __vsprintf_chk, __fprintf_chk, __vfprintf_chk): Same.
* calls.c (get_nonnull_ags, maybe_warn_null_arg): New functions.
(initialize_argument_information): Diagnose null pointers passed to
arguments declared nonnull.
* calls.h (get_nonnull_args): Declared.

gcc/c-family/ChangeLog:

PR c/17308
* c-common.c (check_nonnull_arg): Disable when optimization
is enabled.

gcc/testsuite/ChangeLog:

PR c/17308
* gcc.dg/builtins-nonnull.c: New test.
* gcc.dg/nonnull-4.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/builtins-nonnull.c
trunk/gcc/testsuite/gcc.dg/nonnull-4.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtin-attrs.def
trunk/gcc/builtins.c
trunk/gcc/builtins.def
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/calls.c
trunk/gcc/calls.h
trunk/gcc/testsuite/ChangeLog

[Bug fortran/78815] ICE: segfault with -fopenmp -fsanitize=address

2016-12-14 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78815

--- Comment #1 from Gerhard Steinmetz  
---

This concerns several files from testsuite/gfortran.dg :

   goacc/default_none.f95
   goacc/kernels-alias-4.f95
   goacc/kernels-loop-2.f95
   goacc/kernels-loop-data-2.f95
   goacc/kernels-loop-data-enter-exit-2.f95
   goacc/kernels-loop-data-enter-exit.f95
   goacc/kernels-loop-data.f95
   goacc/kernels-loop-data-update.f95
   goacc/kernels-loop.f95
   goacc/kernels-loop-n.f95
   gomp/gridify-1.f90
   gomp/pr69281.f90
   gomp/pr71758.f90
   gomp/pr77973.f90
   gomp/target1.f90

[Bug fortran/78815] New: ICE: segfault with -fopenmp -fsanitize=address

2016-12-14 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78815

Bug ID: 78815
   Summary: ICE: segfault with -fopenmp -fsanitize=address
   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: ---

Follow-up of pr77973, since about 20161113.
An example with an automatic explicit-shape array :


$ cat z1.f90
subroutine s(n)
   integer :: i, n, z(n)
   !$omp target
   !$omp parallel do
   do i = 1, n
  z(i) = 1
   end do
  !$omp end target
end


$ gfortran-7-20161211 -fsanitize=address -fopenmp -c z1.f90
f951: internal compiler error: Segmentation fault
0xc4e79f crash_signal
../../gcc/toplev.c:333
0x9f8a7e hash_table,
xcallocator>::find_slot_with_hash(tree_node* const&, unsigned int,
insert_option)
../../gcc/hash-table.h:859
0x9e7d98 hash_set >::add(tree_node*
const&)
../../gcc/hash-set.h:47
0x9e7d98 gimplify_decl_expr
../../gcc/gimplify.c:1630
0x9d87da gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:11379
0x9db806 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6459
0x9db852 gimplify_and_add(tree_node*, gimple**)
../../gcc/gimplify.c:434
0x9f935a force_gimple_operand_1(tree_node*, gimple**, bool (*)(tree_node*),
tree_node*)
../../gcc/gimplify-me.c:73
0xb485ff lower_omp_target
../../gcc/omp-low.c:16846
0xb485ff lower_omp_1
../../gcc/omp-low.c:17521
0xb485ff lower_omp
../../gcc/omp-low.c:17614
0xb4333c lower_omp_1
../../gcc/omp-low.c:17453
0xb4333c lower_omp
../../gcc/omp-low.c:17614
0xb43cec lower_omp_1
../../gcc/omp-low.c:17462
0xb43cec lower_omp
../../gcc/omp-low.c:17614
0xb4af5f execute_lower_omp
../../gcc/omp-low.c:18983
0xb4af5f execute
../../gcc/omp-low.c:19020

[Bug fortran/78814] New: ICE in symbol_rank, at fortran/interface.c:1265

2016-12-14 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78814

Bug ID: 78814
   Summary: ICE in symbol_rank, at fortran/interface.c:1265
   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: ---

With invalid code, down to at least 4.8 :
(bailed out with official releases 5, 6)


$ cat z1.f90
program p
   class(*) :: x
   print *, f(x)
end


$ cat z2.f90
program p
   class(*) :: x
   x = f(x)
end


$ gfortran-7-20161211 -c z1.f90
z1.f90:2:16:

class(*) :: x
1
Error: CLASS variable 'x' at (1) must be dummy, allocatable or pointer
f951: internal compiler error: Segmentation fault
0xc4e79f crash_signal
../../gcc/toplev.c:333
0x6a07d3 symbol_rank
../../gcc/fortran/interface.c:1265
0x6a07d3 gfc_procedure_use(gfc_symbol*, gfc_actual_arglist**, locus*)
../../gcc/fortran/interface.c:3642
0x6f4764 resolve_unknown_f
../../gcc/fortran/resolve.c:2740
0x6f4764 resolve_function
../../gcc/fortran/resolve.c:3024
0x6f4dda gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:6471
0x6fb3f2 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:10807
0x6fb0c7 gfc_resolve_blocks(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:9854
0x6fb4fb gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:10797
0x6fdee2 resolve_codes
../../gcc/fortran/resolve.c:16056
0x6fdfde gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:16091
0x6e82ba resolve_all_program_units
../../gcc/fortran/parse.c:5947
0x6e82ba gfc_parse_file()
../../gcc/fortran/parse.c:6194
0x72c312 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:202

[Bug c++/77553] [6/7 Regression] wrong code with post-increment operator in constexpr

2016-12-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77553

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||charles.frasch at gmail dot com

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

[Bug c++/78813] constexpr function returns wrong value

2016-12-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78813

Markus Trippelsdorf  changed:

   What|Removed |Added

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

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

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

[Bug rtl-optimization/78727] [7 Regression] ICE in rtl_verify_bb_insns, at cfgrtl.c:2656 (error: flow control insn inside a basic block)

2016-12-14 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78727

Bernd Schmidt  changed:

   What|Removed |Added

 CC||bernds at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |bernds at gcc dot 
gnu.org

--- Comment #5 from Bernd Schmidt  ---
Patch posted.

[Bug c++/78813] constexpr function returns wrong value

2016-12-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78813

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||wrong-code

--- Comment #1 from Jonathan Wakely  ---
This seems to be already fixed with 6.2.1 and 7.0 dev snapshots, I can only
reproduce it with the 6.1.0 and 6.2.0 releases.

[Bug c++/78701] [6/7 Regression] ICE: unexpected expression N of kind template_parm_index

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78701

--- Comment #5 from Nathan Sidwell  ---
Author: nathan
Date: Wed Dec 14 16:45:33 2016
New Revision: 243657

URL: https://gcc.gnu.org/viewcvs?rev=243657&root=gcc&view=rev
Log:
PR c++/78701
* pt.c (type_unification_real): Check tsubst arg doesn't have
remaining template parms before converting it.

PR c++/78701
* g++.dg/cpp0x/pr78701.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr78701.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/69481] ICE with C++11 alias using with templates

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69481

--- Comment #14 from Nathan Sidwell  ---
Author: nathan
Date: Wed Dec 14 16:43:07 2016
New Revision: 243656

URL: https://gcc.gnu.org/viewcvs?rev=243656&root=gcc&view=rev
Log:
PR c++/69481
* cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Always use
TYPE_ALIAS_TEMPLATE_INFO for aliases.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h

[Bug c++/78813] New: constexpr function returns wrong value

2016-12-14 Thread charles.frasch at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78813

Bug ID: 78813
   Summary: constexpr function returns wrong value
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: charles.frasch at gmail dot com
  Target Milestone: ---

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

The code below fails to compile when the second static_assert fails.

source.cpp: In function ‘int main()’:
source.cpp:25:3: error: static assertion failed
   static_assert(cx_convert("123", 3) == 123);
   ^


It compiles and the runtime produces the expected result when the second static
assert is commented out.

When the replacement code is used the second static assert passes while the
first fails as would be expected.


#include   
#include   

constexpr std::int64_t  
cx_convert(char const * const s, std::size_t const length)  
{   
  std::size_t i = 0;
  std::int64_t whole = 0;   
  while (i < length) {  
whole *= 10;
whole += s[i++] - '0';
// Replace line above with this and expected value is returned
// whole += s[i] - '0'; i++;
  } 
  return whole; 
}   

int main() {
  // Passes!
  static_assert(cx_convert("123", 3) == -28);

  // Fails; cx_convert returns -28 as above
  static_assert(cx_convert("123", 3) == 123);

  // Passes at runtime if second static_assert is commented out.
  assert(cx_convert("123", 3) == 123);
}   



cfrasch@telx-sb-dev3:~/projects/theme_gcc62(feature/ticket_22439)$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/cfrasch/local/bin/../libexec/gcc/x86_64-linux-gnu/6.2.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-6.2.0/configure -v --enable-languages=c,c++
--disable-multilib --with-build-config=bootstrap-lto --program-suffix=-6.2
--enable-shared --without-included-gettext --enable-threads=posix --enable-nls
--enable-nls --enable-gnu-unique-object --with-system-zlib --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu --with-pkgversion=Thesys 6.2-1 ubuntu 14.04
Thread model: posix
gcc version 6.2.0 (Thesys) 


Compile using:  g++ -std=c++14 source.cpp

[Bug rtl-optimization/78812] New: Wrong code generation due to hoisting memory load across function call

2016-12-14 Thread uweigand at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78812

Bug ID: 78812
   Summary: Wrong code generation due to hoisting memory load
across function call
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: uweigand at gcc dot gnu.org
  Target Milestone: ---

Compiling the following test case with g++ -Os -fpic on s390x-ibm-linux results
in abort() being called unexpectedly:

extern "C" void abort (void) __attribute__ ((__noreturn__));

class Transaction
{
public:
  bool Aborted;

  Transaction () : Aborted (false) { }

  ~Transaction ()
  {
if (!Aborted)
  abort ();
  }
};

void test (Transaction &Trans) __attribute__ ((noinline));
void test (Transaction &Trans)
{
  Trans.Aborted = true;
}

int main (void)
{
  Transaction T;
  test (T);
}


What happens is that the destructor for Transaction is inlined into main
(twice, once in the regular exit and once in the exception path).  The load of
the Aborted member is then moved by the code hoisting pass (pass_rtl_hoist) in
gcse.c to a single location in basic block 2.

However, that basic block ends with the call to the "test" routine, and for
some reason, code hoisting thinks it therefore needs to move the hoisted
instruction to *before* that call (see the CALL_P case of
insert_insn_end_basic_block).  This causes wrong code generation since that
call actually modifies the memory that is being loaded.

There seems to be other code that appears intended to recognize that case and
avoid hoisting then (see prune_expressions), but that apparently only looks for
abnormal edges, which we don't have here.

Not sure how this is supposed to work correctly ...

[Bug preprocessor/78811] [7 Regression] raw-string-6.c testsuite failure

2016-12-14 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78811

David Malcolm  changed:

   What|Removed |Added

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

[Bug tree-optimization/77445] [7 Regression] Performance drop after r239219 on coremark test

2016-12-14 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77445

--- Comment #8 from James Greenhalgh  ---
Is anyone currently looking at this?

If the bug is still blocked on correcting the profile information (which sounds
like a large job), should we consider weakening or reverting the cost model for
GCC 7?

[Bug target/78417] target_clones default for powerpc64

2016-12-14 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78417

--- Comment #3 from David Edelsohn  ---
Bounty available!

[Bug target/78417] target_clones default for powerpc64

2016-12-14 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78417

David Edelsohn  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-14
 Ever confirmed|0   |1

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

Target hooks need to be implemented.

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

--- Comment #10 from Uroš Bizjak  ---
(In reply to uros from comment #9)
> Author: uros
> Date: Wed Dec 14 15:44:07 2016
> New Revision: 243651

This patch reintroduces __builtin_clzs and __builtin_ctzs to gcc-6 branch to
resolve compatibility issues on gcc-6 branch.

[Bug target/78811] [7 Regression] raw-string-6.c testsuite failure

2016-12-14 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78811

--- Comment #3 from Andreas Schwab  ---
http://gcc.gnu.org/ml/gcc-patches/2016-12/msg01272.html

[Bug target/78811] [7 Regression] raw-string-6.c testsuite failure

2016-12-14 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78811

--- Comment #2 from David Edelsohn  ---
Started somewhere between 243555 and 243578.
Requires -mcpu=power7 or lower. Works with -mcpu=power8.
Possibly r243578 combine.c change.

[Bug c++/77830] internal compiler error: in output_constructor_regular_field, at varasm.c:4968, when using constexpr (with testcase)

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77830

Jakub Jelinek  changed:

   What|Removed |Added

  Attachment #40324|0   |1
is obsolete||

--- Comment #5 from Jakub Jelinek  ---
Created attachment 40340
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40340&action=edit
gcc7-pr77830.patch

Updated patch.  The problem is more complicated.

[Bug target/59874] Missing builtin (__builtin_clzs) when compiling with g++

2016-12-14 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59874

--- Comment #9 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Dec 14 15:44:07 2016
New Revision: 243651

URL: https://gcc.gnu.org/viewcvs?rev=243651&root=gcc&view=rev
Log:
PR target/59874
* config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_CLZS
and IX86_BUILTIN_CTZS.
(bdesc_args): Add __builtin_clzs and __builtin_ctzs.
(ix86_fold_builtin): Handle IX86_BUILTIN_CTZS and IX86_BUILTIN_CLZS.


Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/i386/i386.c

[Bug target/78811] [7 Regression] raw-string-6.c testsuite failure

2016-12-14 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78811

David Edelsohn  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-14
 CC||bergner at gcc dot gnu.org,
   ||segher at gcc dot gnu.org,
   ||wschmidt at gcc dot gnu.org
 Ever confirmed|0   |1

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

[Bug target/78811] New: [7 Regression] raw-string-6.c testsuite failure

2016-12-14 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78811

Bug ID: 78811
   Summary: [7 Regression] raw-string-6.c testsuite failure
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dje at gcc dot gnu.org
  Target Milestone: ---
Target: powerpc*-*-*

c-c++-common/raw-string-6.c:5:18: error: unterminated raw string
c-c++-common/raw-string-6.c:5:1: internal compiler error: Segmentation fault

[Bug target/78791] [7 regression] ACATS cxf2001 failure

2016-12-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78791

--- Comment #6 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #5)
> Created attachment 40339 [details]
> gcc7-pr78791.patch
> 
> Untested fix.  I don't see other easy fix than not reusing temporaries
> between those from the expansion and those from the stv pass, trying to
> asses what extent the temporaries from the expansion have during stv would
> be hard.

This patch is OK. We have to take care fro various passes to not clobber shared
stack slots, and STV pass is just too invasive to let it share SLOT_TEMP.

[Bug target/77933] Stack corruption on ARM when using high registers and __builtin_return_address

2016-12-14 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77933

Richard Earnshaw  changed:

   What|Removed |Added

   Target Milestone|--- |5.5

[Bug target/77904] [ARM Cortex-M0] Frame pointer thrashes registers if assembly statements with "sp" clobber are used

2016-12-14 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77904

Richard Earnshaw  changed:

   What|Removed |Added

   Target Milestone|--- |6.3

[Bug target/78791] [7 regression] ACATS cxf2001 failure

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78791

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek  ---
Created attachment 40339
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40339&action=edit
gcc7-pr78791.patch

Untested fix.  I don't see other easy fix than not reusing temporaries between
those from the expansion and those from the stv pass, trying to asses what
extent the temporaries from the expansion have during stv would be hard.

[Bug libstdc++/59170] pretty printers: end iterator invalid pointer

2016-12-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59170

--- Comment #15 from Jonathan Wakely  ---
Author: redi
Date: Wed Dec 14 15:17:57 2016
New Revision: 243650

URL: https://gcc.gnu.org/viewcvs?rev=243650&root=gcc&view=rev
Log:
Make printers detect invalid debug mode iterators

PR libstdc++/59170
* python/libstdcxx/v6/printers.py (StdDebugIteratorPrinter): Use
_M_sequence and _M_version to detect invalid iterators.
* testsuite/libstdc++-prettyprinters/debug.cc: Test debug mode vector
and test invalid iterators.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: New test.

Added:
trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/debug_cxx11.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/python/libstdcxx/v6/printers.py
trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/debug.cc

[Bug libgcc/78804] [RX] -m64bit-doubles does not work

2016-12-14 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78804

Oleg Endo  changed:

   What|Removed |Added

 CC||nickc at gcc dot gnu.org

--- Comment #1 from Oleg Endo  ---
Nick, maybe you have an idea what's wrong here?

[Bug target/78791] [7 regression] ACATS cxf2001 failure

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78791

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-14
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #4 from Jakub Jelinek  ---
Testcase transformed into something I can grok:

__attribute__((used, noinline, noclone)) unsigned long long
foo (unsigned long long x, unsigned long long y, unsigned long long z)
{
  unsigned long long a = x / y;
  unsigned long long b = x % y;
  a |= z;
  b ^= z;
  return a + b;
}

int
main ()
{
  if (foo (64, 7, 0) != 10
  || foo (28, 3, 2) != 14)
__builtin_abort ();
  return 0;
}

Indeed, the
(mem/c:DI (plus:SI (reg/f:SI 20 frame) (const_int -8 [0xfff8])) [0 
S8 A64])
stack slot holds one of the two return values during the call (returned by
reference), and the stv2
pass reuses the same slot for storing the other DImode return value (from
%eax:%edx) into the stack, so that it can be loaded into a SSE register, before
the value from the call in the [frame-8] memory slot is loaded.

[Bug tree-optimization/78810] [7 Regression] Optimized out volatile memory access

2016-12-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78810

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2016-12-14
 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |7.0

[Bug tree-optimization/78810] New: [7 Regression] Optimized out volatile memory access

2016-12-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78810

Bug ID: 78810
   Summary: [7 Regression] Optimized out volatile memory access
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Starting from r239778, Ruby 2.3 package can't be compiled.

$ cat /tmp/chunk.cpp 
class NODE;
typedef unsigned long VALUE;

struct parser_params
{
};

struct parser_params *get_parser();
NODE *yycompile(parser_params *parser, VALUE a, VALUE b);

NODE*
rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
{
struct parser_params *parser;
parser = get_parser(); 

NODE *node = yycompile(parser, fname, start);
(*({volatile VALUE *rb_gc_guarded_ptr = (&(vparser));
rb_gc_guarded_ptr;}));

return node;
}

$ ./xgcc -B. /tmp/chunk.cpp -c -O2 -fdump-tree-optimized=/dev/stdout

;; Function NODE* rb_parser_compile_file_path(VALUE, VALUE, VALUE, int)
(_Z27rb_parser_compile_file_pathmmmi, funcdef_no=0, decl_uid=2287,
cgraph_uid=0, symbol_order=0)

NODE* rb_parser_compile_file_path(VALUE, VALUE, VALUE, int) (VALUE vparser,
VALUE fname, VALUE file, int start)
{
  long unsigned int _1;
  struct parser_params * _4;
  struct NODE * _8;

   [100.0%]:
  _4 = get_parser ();
  _1 = (long unsigned int) start_5(D);
  _8 = yycompile (_4, fname_6(D), _1); [tail call]
  return _8;

}

Testing following patch:

diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 62eea8bb8a4..b92513fcf23 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1385,7 +1385,8 @@ non_rewritable_mem_ref_base (tree ref)
   if (! DECL_P (decl))
return NULL_TREE;
   if (! is_gimple_reg_type (TREE_TYPE (base))
- || VOID_TYPE_P (TREE_TYPE (base)))
+ || VOID_TYPE_P (TREE_TYPE (base))
+ || TREE_THIS_VOLATILE (decl) != TREE_THIS_VOLATILE (base))
return decl;
   if ((TREE_CODE (TREE_TYPE (decl)) == VECTOR_TYPE
   || TREE_CODE (TREE_TYPE (decl)) == COMPLEX_TYPE)

[Bug fortran/78757] [7 Regression] ICE with function returning a pointer to a character

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78757

--- Comment #5 from Jakub Jelinek  ---
Created attachment 40338
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40338&action=edit
gcc7-pr78757.patch

The following untested patch fixes the ICE for me, but whether it is right,
dunno...

[Bug c++/77659] [5/6/7 Regression] internal compiler error: in gimplify_expr, at gimplify.c:8858

2016-12-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77659

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #5 from Marek Polacek  ---
The PLACEHOLDER_EXPR comes from get_nsdmi
 539   if (!in_ctor)
 540 {
 541   /* Use a PLACEHOLDER_EXPR when we don't have a 'this' parameter to
 542  refer to; constexpr evaluation knows what to do with it.  */
 543   current_class_ref = build0 (PLACEHOLDER_EXPR, DECL_CONTEXT
(member));
 544   current_class_ptr = build_address (current_class_ref);
 545 }
but no idea how tsubst_copy should handle that.

[Bug middle-end/78809] Inline strcmp with small constant strings

2016-12-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809

--- Comment #2 from wilco at gcc dot gnu.org ---
(In reply to Richard Biener from comment #1)
> We may have dups of this.  And we now have inlining for strcmp/memcmp when
> the
> result is only compared against zero.

I don't see that happening with latest trunk (maybe patches are still
outstanding?), however if so then that code could be generalized to support any
strcmp.

[Bug middle-end/78809] Inline strcmp with small constant strings

2016-12-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization

--- Comment #1 from Richard Biener  ---
We may have dups of this.  And we now have inlining for strcmp/memcmp when the
result is only compared against zero.

[Bug other/78808] target_clones not applying to openmp functions

2016-12-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78808

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-14
 Ever confirmed|0   |1

--- Comment #4 from Richard Biener  ---
Both "cloning" machineries likely do not interact well.

[Bug middle-end/78809] New: Inline strcmp with small constant strings

2016-12-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809

Bug ID: 78809
   Summary: Inline strcmp with small constant strings
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wilco at gcc dot gnu.org
  Target Milestone: ---

GCC currently doesn't optimize str(n)cmp of small constant strings (besides the
empty string).  Such cases can be inlined to avoid the overhead of calling
strcmp - benchmarking shows that this is ~2-3x faster.  GLIBC does this
optimization for strings up to size 3 in the headers, however it is better to
implement this in GCC.

int t1(const char *s) { return __builtin_strcmp (s, "a"); }
int t2(const char *s) { return strcmp (s, "a"); }

Currently generates for AArch64 with -O2:

t1:
adrpx1, .LC2
add x1, x1, :lo12:.LC2
b   strcmp

t2:
ldrbw2, [x0]
mov w1, 97
subsw1, w1, w2
bne .L17
ldrbw1, [x0, 1]
neg w1, w1
.L17:
neg w0, w1
ret

GCC should be able to generate:

t2:
ldrbw2, [x0]
subsw1, w2, 97
bne .L17
ldrbw1, [x0, 1]
.L17:
ret

[Bug fortran/78757] [7 Regression] ICE with function returning a pointer to a character

2016-12-14 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78757

--- Comment #4 from rguenther at suse dot de  ---
On Wed, 14 Dec 2016, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78757
> 
> --- Comment #3 from Jakub Jelinek  ---
> So the bug is that nothing has gimplified the MAX_EXPR in:
>   character(kind=1)[1:MAX_EXPR <_1, 0>] * pstr.0;
>   struct FRAME.MAIN__ FRAME.3;
>   character(kind=1)[1:30] * s;
>   integer(kind=4) _1;
>   integer(kind=4) _2;
>   integer(kind=8) * _5;
>   integer(kind=8) _6;
> 
>[0.0%]:
>   FRAME.3.FRAME_BASE.PARENT = 0B;
>   _5 = &C.3472;
>   _6 = *_5;
>   _1 = (integer(kind=4)) _6;
>   _2 = MAX_EXPR <_1, 0>;
>   f4 (&pstr.0, _2, _5); [static-chain: &FRAME.3]
>   s_8 = pstr.0;
>   pstr.0 ={v} {CLOBBER};
>   GIMPLE_NOP
>   return;
> or something different?
> If this, this has been broken by the r117493 change.  So perhaps we need some
> DECL_EXPR somewhere, but not sure which.

Yes, as usual - some forgotten DECL_EXPR.

[Bug fortran/78757] [7 Regression] ICE with function returning a pointer to a character

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78757

--- Comment #3 from Jakub Jelinek  ---
So the bug is that nothing has gimplified the MAX_EXPR in:
  character(kind=1)[1:MAX_EXPR <_1, 0>] * pstr.0;
  struct FRAME.MAIN__ FRAME.3;
  character(kind=1)[1:30] * s;
  integer(kind=4) _1;
  integer(kind=4) _2;
  integer(kind=8) * _5;
  integer(kind=8) _6;

   [0.0%]:
  FRAME.3.FRAME_BASE.PARENT = 0B;
  _5 = &C.3472;
  _6 = *_5;
  _1 = (integer(kind=4)) _6;
  _2 = MAX_EXPR <_1, 0>;
  f4 (&pstr.0, _2, _5); [static-chain: &FRAME.3]
  s_8 = pstr.0;
  pstr.0 ={v} {CLOBBER};
  GIMPLE_NOP
  return;
or something different?
If this, this has been broken by the r117493 change.  So perhaps we need some
DECL_EXPR somewhere, but not sure which.

[Bug c++/78771] [5/6/7 Regression] ICE when using inherited constructors (instantiate_template_1 in gcc/cp/pt.c:17391)

2016-12-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78771

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/77585] g++ incorrectly decides that member function is called without object in generic lambda

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77585

--- Comment #2 from Nathan Sidwell  ---
Created attachment 40337
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40337&action=edit
Let's try that again ...

[Bug c++/77585] g++ incorrectly decides that member function is called without object in generic lambda

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77585

Nathan Sidwell  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-12-14
   Assignee|unassigned at gcc dot gnu.org  |nathan at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug c++/77585] g++ incorrectly decides that member function is called without object in generic lambda

2016-12-14 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77585

Nathan Sidwell  changed:

   What|Removed |Added

 CC||nathan at gcc dot gnu.org

--- Comment #1 from Nathan Sidwell  ---
Created attachment 40336
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40336&action=edit
smaller testcase

I independently reduced an exemplar to the attached testcase.  The necessary
condition is that the lambda is defined within the argument list of the
function it is being passed to.

[Bug target/78694] [ARM] ICE with -mthumb -ftls-model=local-exec -O2

2016-12-14 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78694

--- Comment #16 from ktkachov at gcc dot gnu.org ---
Yes, the bug is in the arm backend.
I posted a patch to fix it at:
https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00849.html

[Bug libstdc++/59170] pretty printers: end iterator invalid pointer

2016-12-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59170

--- Comment #14 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #7)
> "print it" should not automatically dereference.

The Python code that registers the printers for iterators even says:

# These shouldn't be necessary, if GDB "print *i" worked.
# But it often doesn't, so here they are.

i.e. automatically dereferencing is a hack due to the fact that trying to do it
inside GDB doesn't work.

But with Xmethods we can make "print *i" work, even when the relevant operator
definition is inlined and not in the debug info.

[Bug other/78808] target_clones not applying to openmp functions

2016-12-14 Thread steven at uplinklabs dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78808

--- Comment #3 from Steven Noonan  ---
Created attachment 40335
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40335&action=edit
compiled with -fopenmp

[Bug other/78808] target_clones not applying to openmp functions

2016-12-14 Thread steven at uplinklabs dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78808

--- Comment #2 from Steven Noonan  ---
Created attachment 40334
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40334&action=edit
compiled without -fopenmp

[Bug fortran/78757] [7 Regression] ICE with function returning a pointer to a character

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78757

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||jakub at gcc dot gnu.org

[Bug other/78808] target_clones not applying to openmp functions

2016-12-14 Thread steven at uplinklabs dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78808

--- Comment #1 from Steven Noonan  ---
Created attachment 40333
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40333&action=edit
test.c - test case for target_clones with(out) -fopenmp

[Bug other/78808] New: target_clones not applying to openmp functions

2016-12-14 Thread steven at uplinklabs dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78808

Bug ID: 78808
   Summary: target_clones not applying to openmp functions
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: steven at uplinklabs dot net
  Target Milestone: ---

Simple test case:

---
__attribute__((target_clones("arch=haswell", "arch=sandybridge", "default")))
static void _saxpy(int n, float a, float * restrict x, float * restrict y)
{
#pragma omp parallel for
for (int i = 0; i < n; ++i)
y[i] = a*x[i] + y[i];
}

void saxpy(int n, float a, float * restrict x, float * restrict y)
{
return _saxpy(n, a, x, y);
}
---

Compile with:

gcc-6 -O3 -std=gnu11 -ffast-math -S

If -fopenmp is specified, the OpenMP-generated function for the parallelized
for() loop is generated with the default optimizations (not respecting
target_clones).

See attachments for comparison.

[Bug target/78694] [ARM] ICE with -mthumb -ftls-model=local-exec -O2

2016-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78694

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #15 from Jakub Jelinek  ---
That is not a bad commit, just reenabling something that has been mistakenly
disabled for 3.5 years.  So, the regression happened during that time and went
unnoticed.

  1   2   >