[Bug fortran/71623] [5/6/7 Regression] Segfault when allocating deferred-length characters to size of a pointer

2016-07-01 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71623

vehre at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #5 from vehre at gcc dot gnu.org ---
Patch at:

https://gcc.gnu.org/ml/fortran/2016-06/msg00120.html

Waiting for review.

[Bug fortran/71717] A gfortran silent "wrong code" bug in the transition from 4.9.0 -> 4.9.1, using OpenMP.

2016-07-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71717

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed that starting from 4.9.1 the output of the snippet changed.

[Bug c++/71718] ICE on erroneous recursive template error printing

2016-07-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71718

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug fortran/71723] ICE with attempted pointer initialization

2016-07-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71723

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #1 from Martin Liška  ---
ICE started with GCC 4.6.0.

[Bug target/71725] New: Backend decides to generate larger and possibly slower float ops for integer ops that appear in source

2016-07-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71725

Bug ID: 71725
   Summary: Backend decides to generate larger and possibly slower
float ops for integer ops that appear in source
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-*-*

The following testcase derived from gcc.target/i386/xorps-sse2.c (see PR54716)
generates FP ops for the xor which uses a larger opcode and possibly is slower
when g is a trap/denormal representation(?)

#define vector __attribute__ ((vector_size (16)))

vector int x(vector float f, vector int h)
{
  vector int g = { 0x8000, 0, 0x8000, 0 };
  vector int f_int = (vector int) f;
  return (f_int ^ g) + h;
}

x:
.LFB1:
.cfi_startproc
xorps   .LC0(%rip), %xmm0
paddd   %xmm1, %xmm0
ret

flags used are -O -msse2 -mno-sse3.

Today r191827 might be better implemented in sth like the STV pass which can
apply logic that isn't localized to a single instruction but really to
the context as the gcc.target/i386/xorps-sse2.c testcase claims to test.

[Bug middle-end/71716] [7 Regression] gcc.dg/atomic/c11-atomic-exec-4.c is miscompiled with -march=corei7

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71716

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Short testcase for -Os -march=corei7:

static void
test_mult (void)
{
  static volatile _Atomic (long double) a = (long double) -3;
  if ((a *= 5) != (long double) ((long double) -3 * 5))
__builtin_abort ();
  if (a != (long double) ((long double) -3 * 5))
__builtin_abort ();
  static volatile _Atomic (long double) b = (long double) -7;
  if ((b *= -20) != (long double) ((long double) -7 * -20))
__builtin_abort ();
  if (b != (long double) ((long double) -7 * -20))
__builtin_abort ();
  static volatile _Atomic (long double) c = (long double) 1.25;
  if ((c *= 3.5) != (long double) ((long double) 1.25 * 3.5))
__builtin_abort ();
  if (c != (long double) ((long double) 1.25 * 3.5))
__builtin_abort ();
}

int
main ()
{
  test_mult ();
  return 0;
}

The problem is, before the ATOMIC_COMPARE_EXCHANGE transformation we have:
  long double D.1752;
  long double D.1751;
...
  _1 = __atomic_load_16 (&a, 5);
  _2 = VIEW_CONVERT_EXPR(_1);
  D.1751 = _2;
...
  _4 = D.1751;
  _5 = D.1750;
  _6 = (long double) _5;
  _7 = _4 * _6;
  D.1752 = _7;
  _8 = D.1752;
  _9 = VIEW_CONVERT_EXPR<__int128 unsigned>(_8);
  _10 = __atomic_compare_exchange_16 (&a, &D.1751, _9, 0, 5, 5);
Already the VCE to long double might be weird, what if the memory at a contains
some bits the VCE to long double does not preserve.  What about sNaNs, etc.?
In the lowering, because D.1751 is not addressable otherwise, we turn it into:
  _9 = VIEW_CONVERT_EXPR<__int128 unsigned>(_7);
  _128 = _146;
  _129 = VIEW_CONVERT_EXPR<__int128 unsigned>(_146);
  _130 = ATOMIC_COMPARE_EXCHANGE (&a, _129, _9, 16, 5, 5);
  _131 = IMAGPART_EXPR <_130>;
  _10 = (_Bool) _131;
  _132 = REALPART_EXPR <_130>;
  _133 = VIEW_CONVERT_EXPR(_132);
  _152 = _133;
which introduces another VCE, and apparently both __int128 -> long double and
long double -> __int128 VCEs are expanded as a store to a stack slot and load
from it.  The problem is that storing a long double into memory doesn't
overwrite all bits and thus the subsequent load of __int128 contains some
uninitialized bits in it.

[Bug tree-optimization/71726] New: Simplify (intptr_t)p+4-(intptr_t)(p+4)

2016-07-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71726

Bug ID: 71726
   Summary: Simplify (intptr_t)p+4-(intptr_t)(p+4)
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00010.html

#include 
intptr_t f(char*p){return (intptr_t)p+4-(intptr_t)(p+4);}

We only manage to simplify this to return 0 in RTL. "maybe we can value-number
it
the same with some tricks" but that would not help for
(intptr_t)p+8-(intptr_t)(p+4), or even for (intptr_t)(p+4)-4-(intptr_t)p.

"to handle (long)p + 4 - (long)(p + 4) the only thing we need is to
transform (long)(p + 4) to (long)p + 4 ... that would simplify things but
of course we cannot ever undo that canonicalization if the result is
ever converted back to a pointer." Indeed, I don't know if on average it would
be a win or a loss (I'd bet a little on "win").

Easiest seems to be to add a few more match.pd patterns as we hit them in real
code, and hope they cover enough cases that we can forget about the rest for a
while, until someone enhances reassoc.

[Bug c/71727] New: O3 optimization assumes 16byte alignment

2016-07-01 Thread steffen-schmidt at siemens dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71727

Bug ID: 71727
   Summary: O3 optimization assumes 16byte alignment
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: steffen-schmidt at siemens dot com
  Target Milestone: ---

Created attachment 38810
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38810&action=edit
ZIP contains source and results

Hello all,

When using aarch64 gcc with -O3 the optimization tries to make use of 16byte
vfp unit commands for accessing data structures containing 8byte data members,
where possible, as shown in the example below.

The generated code runs in early stages of the startup process for the
processor, without an active MMU, in which stage the Aarch64 Armv-8 Cortex A53
processor always checks correct alignment of data, otherwise throws an
exception (data abort, address size fault first level). Meaning that when using
vfp "q" registers, the data must be aligned on 16byte boundaries.

GCC compilation uses option -mstrict-align forcing natural alignment of data.

It seems the generated code in the example below assumes the data structure is
aligned 16 byte (it uses vfp q registers) although the actual alignment of the
data structure is only on 8 byte boundaries.

Note:
We're using variable char _a to move the structure away from the 16 byte
aligned region start address. The optimization using "q" registers is only done
when struct contains even number of 64bit data members. 

--
Code example:
struct test_struct_s {
  long  a;
  long  b;  
  long  c;  
  long  d;
  unsigned long  e;
};


char _a;  // forcing an offset of 8 byte forcing 8 byte alignment of struct
struct test_struct_s  xarray[128];

void  _start(void)
{
  struct test_struct_s *new_entry;

  new_entry=&xarray[0];
  new_entry->a=1;
  new_entry->b=2;
  new_entry->c=3;
  new_entry->d=4;
  new_entry->e=5;

  return;
}
--
GCC call:
aarch64-elf-gcc -mstrict-align -O3 -nostdlib aligntest.c -o aligntest.elf
-Wl,-Map=aligntest.map -Wl,--section-start=.bss=0x8

--
Linker Map:

.bss0x0008 0x1408
 *(.dynbss)
 *(.bss .bss.* .gnu.linkonce.b.*)
 .bss   0x00080x0 \Temp\ccWaWhWH.o
 *(COMMON)
 COMMON 0x0008 0x1408 \Temp\ccWaWhWH.o
0x0008_a
0x00080008xarray
0x00081408. = ALIGN ((. !=
0x0)?0x8:0x1)
0x00081408_bss_end__ = .
0x00081408__bss_end__ = .
0x00081408. = ALIGN (0x8)
0x00081408. = SEGMENT_START
("ldata-segment", .)
0x00081408. = ALIGN (0x8)
0x00081408__end__ = .
0x00081408_end = .
[!provide]PROVIDE (end, .)


--
aligntest.elf: file format elf64-littleaarch64


Disassembly of section .text:

0040 <_start>:
  40:   9003adrpx3, 40 <_start>
  44:   9002adrpx2, 40 <_start>
  48:   90ffe400adrpx0, 8 <_a>
  4c:   d28000a1mov x1, #0x5// #5
  400010:   3dc00c61ldr q1, [x3,#48]
  400014:   91002000add x0, x0, #0x8  // <-- 8 byte aligned
  400018:   3dc01040ldr q0, [x2,#64]
  40001c:   f9001001str x1, [x0,#32]
  400020:   3d81str q1, [x0]  // <-- runtime exception
  400024:   3d800400str q0, [x0,#16]
  400028:   d65f03c0ret



--
gcc -v

Using built-in specs.
COLLECT_GCC=aarch64-elf-gcc
COLLECT_LTO_WRAPPER=aarch64_gcc_elf_6.1.0/bin/../libexec/gcc/aarch64-elf/6.1.0/lto-wrapper.exe
Target: aarch64-elf
Configured with: ../../gcc-6.1.0//configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32
--prefix=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf
--target=aarch64-elf --disable-nls --enable-multilib
--with-multilib-list=lp64,ilp32 --enable-languages=c,c++
--disable-decimal-float
--with-sysroot=/build/aarch64-elf_6.1.0_x64/cross-gcc/aarch64-elf
--without-headers --disable-shared --disable-threads --disable-lto
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libffi
--disable-libstdcxx-pch --disable-win32-registry
--with-host-libstdcxx='-static-libgcc -Wl,-Bs

[Bug tree-optimization/70729] Loop marked with omp simd pragma is not vectorized

2016-07-01 Thread kyukhin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70729

--- Comment #28 from Kirill Yukhin  ---
Author: kyukhin
Date: Fri Jul  1 09:42:01 2016
New Revision: 237907

URL: https://gcc.gnu.org/viewcvs?rev=237907&root=gcc&view=rev
Log:
PR tree-optimization/70729

gcc/
* tree-vectorizer.c (adjust_simduid_builtins): Nullify safelen field
of loop since it can be not valid after transformation.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vectorizer.c

[Bug middle-end/71716] [7 Regression] gcc.dg/atomic/c11-atomic-exec-4.c is miscompiled with -march=corei7

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71716

Jakub Jelinek  changed:

   What|Removed |Added

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

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

Untested fix.

Beyond this, it would be nice if at least the C FE _Atomic cas loop lowering is
improved (for the lock-free case only?), so that the old var does not have
floating point type, but instead corresponding integral type.  The thing is,
otherwise if one is unlucky enough, the VIEW_CONVERT_EXPR in the IL from
__int128 to long double can be expanded through XFmode store to uninitialized
memory slot, which leaves lots of bits uninitialized.  If those uninitialized
bits don't match the one in the *addr, then the CAS will fail the first time.

[Bug rtl-optimization/71709] powerpc64le: argument to strcpy() optimised out

2016-07-01 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71709

--- Comment #8 from Alan Modra  ---
Author: amodra
Date: Fri Jul  1 11:15:17 2016
New Revision: 237909

URL: https://gcc.gnu.org/viewcvs?rev=237909&root=gcc&view=rev
Log:
strcpy arg optimised out

For functions that return an argument unchanged, like strcat,
find_call_crossed_cheap_reg attempts to find an assignment between
a pseudo reg and the arg reg before the call, so that uses of the
pseudo after the call can instead use the return value.  The exit
condition on the loop looking at previous insns was wrong.  Uses of
the arg reg don't matter.  What matters is the insn setting the arg
reg as any assignment involving the arg reg prior to that insn is
likely a completely unrelated use of the hard reg.

PR rtl-optimization/71709
* ira-lives.c (find_call_crossed_cheap_reg): Exit loop on arg reg
being set, not referenced.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira-lives.c

[Bug target/71151] [avr] -fmerge-constants and -fdata-sections/-ffunction-sections results in string constants in .progmem.gcc_sw section

2016-07-01 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71151

--- Comment #14 from Georg-Johann Lay  ---
Author: gjl
Date: Fri Jul  1 12:09:53 2016
New Revision: 237910

URL: https://gcc.gnu.org/viewcvs?rev=237910&root=gcc&view=rev
Log:
gcc/testsuite/
PR target/71151
* gcc.target/avr/pr71151-common.h (foo): Use macro SECTION_NAME
instead of ".foo" for its section name.
* gcc.target/avr/pr71151-2.c (SECTION_NAME): Define appropriately
depending on MCU's flash size.
* gcc.target/avr/pr71151-3.c (SECTION_NAME): Dito.
* gcc.target/avr/pr71151-4.c (SECTION_NAME): Dito.
* gcc.target/avr/pr71151-5.c (SECTION_NAME): Dito.
* gcc.target/avr/pr71151-6.c (SECTION_NAME): Dito.
* gcc.target/avr/pr71151-7.c (SECTION_NAME): Dito.
* gcc.target/avr/pr71151-8.c (SECTION_NAME): Dito.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/avr/pr71151-2.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-3.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-4.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-5.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-6.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-7.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-8.c
trunk/gcc/testsuite/gcc.target/avr/pr71151-common.h

[Bug rtl-optimization/71709] powerpc64le: argument to strcpy() optimised out

2016-07-01 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71709

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #9 from Alan Modra  ---
Fixed.

[Bug rtl-optimization/70164] [6/7 Regression] Code/performance regression due to poor register allocation on Cortex-M0

2016-07-01 Thread andre.simoesdiasvieira at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70164

--- Comment #16 from Andre Vieira  ---
Any progress on this one?

[Bug c++/71714] -g flag doubles size

2016-07-01 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71714

--- Comment #4 from Jonathan Wakely  ---
You need to explain what you mean by "release version" and "debug version".
There are no such "modes" for GCC, you can use any combination of -O
optimization options and also use -g for debug info.

So instead of talking about "release version" and "debug versions" you need to
tell us exactly which sets of options you are using in each case.

[Bug fortran/70748] [6/7 Regression] ICE with debug in gfc_trans_block_construct

2016-07-01 Thread antony at cosmologist dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70748

Antony Lewis  changed:

   What|Removed |Added

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

--- Comment #4 from Antony Lewis  ---
Resolved by other changes

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

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71719

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-07-01
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r236630, only for C, not for C++.  I'll have a look.

[Bug web/69601] current/ redirect is off by at least a day

2016-07-01 Thread Joost.VandeVondele at mat dot ethz.ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69601

Joost VandeVondele  changed:

   What|Removed |Added

   Last reconfirmed|2016-06-26 00:00:00 |2016-7-1

--- Comment #4 from Joost VandeVondele  
---
and also in July...

[Bug target/71698] ICE related to decimal float when compiling with -mcpu=power9

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71698

--- Comment #6 from Peter Bergner  ---
Author: bergner
Date: Fri Jul  1 13:51:35 2016
New Revision: 237911

URL: https://gcc.gnu.org/viewcvs?rev=237911&root=gcc&view=rev
Log:
gcc/
PR target/71698
* config/rs6000/rs6000.c (rs6000_secondary_reload_simple_move):
Disallow
TDmode values.

gcc/testsuite/
PR target/71698
* gcc.target/powerpc/pr71698.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/powerpc/pr71698.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/71728] New: ICE with goto in statement-expression inside a condition

2016-07-01 Thread andrey.vihrov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71728

Bug ID: 71728
   Summary: ICE with goto in statement-expression inside a
condition
   Product: gcc
   Version: 6.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.vihrov at gmail dot com
  Target Milestone: ---

Compiling this source:

int main()
{
if (({ goto test; test: 1; }));
}

with "g++ -Wall test.cpp -o test" gives:

test.cpp: In function 'int main()':
test.cpp:3:34: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.c:5151
 if (({ goto test; test: 1; }));
  ^

Note that without -Wall there is no ICE.

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

[Bug target/65248] Copy relocation against protected symbol doesn't work

2016-07-01 Thread jb999 at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

--- Comment #10 from jb999 at gmx dot de ---
Could someone please explain what this means for binutils >= 2.26 and gcc
4.9.3?

[Bug c++/71728] ICE with goto in statement-expression inside a condition

2016-07-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71728

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, ICE with 6.1.0 and current trunk; produces 'sorry, unimplemented'
for GCC 5 branch.

[Bug fortran/71729] New: -Wl,-z,noexecstack Segmentation fault

2016-07-01 Thread elhombrefr at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729

Bug ID: 71729
   Summary: -Wl,-z,noexecstack Segmentation fault
   Product: gcc
   Version: 6.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: elhombrefr at yahoo dot fr
  Target Milestone: ---

Created attachment 38812
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38812&action=edit
Code example

By compiling and running the attached fortran code prof.f90

You get this error

$ gfortran -Wl,-z,noexecstack prog.f90 ; ./a.out

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f5d7e300e3a
#1  0x7f5d7e30002d
#2  0x7f5d7d7f676f
#3  0x7ffd879cf620
Segmentation fault (core dumped)

without any flag you get

gfortran prog.f90
$ ./a.out
   1.

Unfortunately this flag is present in MPICH alias mpif90.

I get the bug on fedora 24 with gcc version 6.1.1 20160621

[Bug c/71719] [7 Regression] invalid set-but-not-used warning with vectors

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71719

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

Untested fix.

[Bug fortran/71717] A gfortran silent "wrong code" bug in the transition from 4.9.0 -> 4.9.1, using OpenMP.

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71717

--- Comment #2 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jul  1 15:13:28 2016
New Revision: 237916

URL: https://gcc.gnu.org/viewcvs?rev=237916&root=gcc&view=rev
Log:
PR fortran/71717
* trans-openmp.c (gfc_omp_privatize_by_reference): Return false
for GFC_DECL_ASSOCIATE_VAR_P with POINTER_TYPE.

* testsuite/libgomp.fortran/associate3.f90: New test.

Added:
trunk/libgomp/testsuite/libgomp.fortran/associate3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-openmp.c
trunk/libgomp/ChangeLog

[Bug fortran/71729] -Wl,-z,noexecstack Segmentation fault

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #1 from Jakub Jelinek  ---
Don't do it then.  -z noexecstack asserts there are no trampolines in the code,
but your code does need trampolines and thus executable stack, because you are
passing address of a nested (contained) subroutine/function to another and not
optimizing, so it is not inlined.

[Bug rtl-optimization/71724] [5/6/7 Regression] ICE: Segmentation fault, deep recursion between combine_simplify_rtx and subst

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71724

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |5.5

[Bug fortran/71730] New: ICE when character length specification uses an undefined variable

2016-07-01 Thread bardeau at iram dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71730

Bug ID: 71730
   Summary: ICE when character length specification uses an
undefined variable
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bardeau at iram dot fr
  Target Milestone: ---

Hi,

the following code raises an ICE. The error was seen with gfortran 5.3.0 and
6.1.0.

Cheers



$ cat ice.f90
subroutine foo
  implicit none
  character(len=bar) :: a
end subroutine foo


$ gfortran ice.f90
ice.f90:1:0:

 subroutine foo

internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:1064
0x6e981b gfc_typenode_for_spec(gfc_typespec*)   
../../srcdir/gcc/fortran/trans-types.c:1064 
0x6e9b0f gfc_sym_type(gfc_symbol*)  
../../srcdir/gcc/fortran/trans-types.c:2160
0x69cf4c gfc_get_symbol_decl(gfc_symbol*)
../../srcdir/gcc/fortran/trans-decl.c:1574
0x69f907 generate_local_decl
../../srcdir/gcc/fortran/trans-decl.c:5220
0x69fcde expr_decls
../../srcdir/gcc/fortran/trans-decl.c:5168
0x5ee249 gfc_traverse_expr(gfc_expr*, gfc_symbol*, bool (*)(gfc_expr*,
gfc_symbol*, int*), int)
../../srcdir/gcc/fortran/expr.c:4148
0x69fc10 generate_expr_decls
../../srcdir/gcc/fortran/trans-decl.c:5175
0x69fc10 generate_dependency_declarations
../../srcdir/gcc/fortran/trans-decl.c:5190
0x69fc10 generate_local_decl
../../srcdir/gcc/fortran/trans-decl.c:5217
0x6686bb do_traverse_symtree
../../srcdir/gcc/fortran/symbol.c:3817
0x6a053a generate_local_vars
../../srcdir/gcc/fortran/trans-decl.c:5410
0x6a053a gfc_generate_function_code(gfc_namespace*)
../../srcdir/gcc/fortran/trans-decl.c:6089
0x639430 translate_all_program_units
../../srcdir/gcc/fortran/parse.c:5613
0x639430 gfc_parse_file()
../../srcdir/gcc/fortran/parse.c:5819
0x67a5c5 gfc_be_parse_file
../../srcdir/gcc/fortran/f95-lang.c:201
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/bardeau/Softs/gcc-6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../srcdir/configure --with-gmp=/home/bardeau/Softs
--prefix=/home/bardeau/Softs/gcc-6.1.0 --enable-languages=c,c++,fortran
Thread model: posix
gcc version 6.1.0 (GCC)

[Bug fortran/71729] -Wl,-z,noexecstack Segmentation fault

2016-07-01 Thread elhombrefr at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729

--- Comment #2 from Pierre Navaro  ---
(In reply to Jakub Jelinek from comment #1)
> Don't do it then.  -z noexecstack asserts there are no trampolines in the
> code, but your code does need trampolines and thus executable stack, because
> you are passing address of a nested (contained) subroutine/function to
> another and not optimizing, so it is not inlined.

It means i have to submit the bug to mpich developers that add this flag in the
alias mpif90 ?

[Bug target/71731] New: incorrect result for vectorized char rotate with -mcpu=power9

2016-07-01 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71731

Bug ID: 71731
   Summary: incorrect result for vectorized char rotate with
-mcpu=power9
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: acsawdey at gcc dot gnu.org
  Target Milestone: ---
Target: powerpc64le-linux

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

In test case gcc/testsuite/gcc.c-torture/execute/pr56866.c

with flags -mcpu=power9 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops
-ftracer -finline-functions

The attached test case passes if compiled with -DDONTFAIL and fails otherwise.

#ifndef DONTFAIL
  for (t = 0; t < 256; ++t)
rs[t] = (ws[t] >> 9) | (ws[t] << (sizeof (ws[0]) * __CHAR_BIT__ - 9));
#endif
  for (t = 0; t < 256; ++t)
rc[t] = (wc[t] >> 5) | (wc[t] << (sizeof (wc[0]) * __CHAR_BIT__ - 5));  asm 

volatile ("" : : "g" (rq), "g" (ri), "g" (rs), "g" (rc) : "memory");

#ifndef DONTFAIL
  if (rs[0] != 0xb3a2 || rs[1])
__builtin_abort ();
#endif
  if (rc[0] != 0x9b || rc[1])
__builtin_abort ();

[Bug target/71731] incorrect result for vectorized char rotate with -mcpu=power9

2016-07-01 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71731

--- Comment #1 from acsawdey at gcc dot gnu.org ---
Created attachment 38815
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38815&action=edit
asm source of test case

[Bug target/71698] ICE related to decimal float when compiling with -mcpu=power9

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71698

--- Comment #7 from Peter Bergner  ---
Author: bergner
Date: Fri Jul  1 16:06:26 2016
New Revision: 237917

URL: https://gcc.gnu.org/viewcvs?rev=237917&root=gcc&view=rev
Log:
gcc/
Backport from trunk
2016-07-01  Peter Bergner  

PR target/71698
* config/rs6000/rs6000.c (rs6000_secondary_reload_simple_move):
Disallow
TDmode values.

gcc/testsuite/
Backport from trunk
2016-07-01  Peter Bergner  

PR target/71698
* gcc.target/powerpc/pr71698.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/pr71698.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/71698] ICE related to decimal float when compiling with -mcpu=power9

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71698

Peter Bergner  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0
  Known to fail||6.2.0, 7.0

--- Comment #8 from Peter Bergner  ---
Fixed on trunk and the FSF 6 branch.

[Bug fortran/71730] ICE when character length specification uses an undefined variable

2016-07-01 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71730

--- Comment #1 from kargl at gcc dot gnu.org ---
Index: decl.c
===
@@ -905,6 +906,7 @@ char_len_param_value (gfc_expr **expr, b
 goto syntax;
   else if ((*expr)->expr_type == EXPR_VARIABLE)
 {
+  bool t;
   gfc_expr *e;

   e = gfc_copy_expr (*expr);
@@ -916,7 +918,15 @@ char_len_param_value (gfc_expr **expr, b
  && e->ref->u.ar.dimen_type[0] == DIMEN_RANGE)
goto syntax;

-  gfc_reduce_init_expr (e);
+  t = gfc_reduce_init_expr (e);
+
+  if (!t && (e->ts.type == BT_UNKNOWN
+&& e->symtree->n.sym->attr.untyped == 1
+&& e->symtree->n.sym->ns->seen_implicit_none == 1))
+   {
+ gfc_free_expr (e);
+ goto syntax;
+   }

   if ((e->ref && e->ref->type == REF_ARRAY
   && e->ref->u.ar.type != AR_ELEMENT)

[Bug debug/71667] [7 Regression] ICE in as_a, at is-a.h:192 w/ -g -O2 -ftree-vectorize

2016-07-01 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71667

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #4 from Qirun Zhang  ---
(In reply to alahay01 from comment #3)
> "-g" is the important thing here.
> 
> A statement has been marked live, and a use of it outside the loop is a
> DEBUG stmt.
> 
> vectorizable_live_operation fails trying to treat the DEBUG stmt as a phi.

Here is a case triggering the ICE without the "-g".

I am not sure if it is a dup, so I leave it here. My bisection indicates that
the ICE for this case also starts with r237064.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160701 (experimental) [trunk revision 237910] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:4:6: internal compiler error: in as_a, at is-a.h:192
 void fn1() {
  ^~~
0x5e1131 gphi const* as_a(gimple const*)
../../gcc/gcc/is-a.h:192
0x5e1131 gimple_phi_num_args
../../gcc/gcc/gimple.h:4264
0xdbd150 gimple_phi_result
../../gcc/gcc/ssa-iterators.h:921
0xdbd150 vectorizable_live_operation(gimple*, gimple_stmt_iterator*,
_slp_tree*, int, gimple**)
../../gcc/gcc/tree-vect-loop.c:6417
0xdb6a9f vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
../../gcc/gcc/tree-vect-stmts.c:8439
0xdbd905 vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6893
0xdda9fe vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:558
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.


$ cat abc.c
char a;
short b;
int c, d;
void fn1() {
  char e = 75, g;
  unsigned char *f = &e;
  a = 21;
  for (; a <= 48; a++) {
for (; e <= 6;)
  ;
g -= e -= b || g <= c;
  }
  d = *f;
}

[Bug target/71656] ICE in reload when generating code for -mcpu=power9 -mpower9-dform-vector

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71656

--- Comment #6 from Peter Bergner  ---
Author: bergner
Date: Fri Jul  1 17:56:54 2016
New Revision: 237919

URL: https://gcc.gnu.org/viewcvs?rev=237919&root=gcc&view=rev
Log:
gcc/
Backport from trunk
2016-06-27  Peter Bergner  

PR target/71656
* config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add
OPTION_MASK_P9_DFORM_VECTOR.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Do not
disable -mpower9-dform-vector when using reload.
(quad_address_p): Remove 'gpr_p' argument and all associated code.
New 'strict' argument.  Update all callers.  Add strict addressing
support.
(rs6000_legitimate_offset_address_p): Remove call to
virtual_stack_registers_memory_p.
(rs6000_legitimize_reload_address): Add quad address support.
(rs6000_legitimate_address_p): Move call to quad_address_p above
call to virtual_stack_registers_memory_p.  Adjust quad_address_p args
to account for new strict usage.
(rs6000_output_move_128bit): Adjust quad_address_p args to account
for new strict usage.
* config/rs6000/predicates.md (quad_memory_operand): Likewise.

gcc/testsuite/
Backport from trunk
2016-06-27  Peter Bergner  

PR target/71656
* gcc.target/powerpc/pr71656-1.c: New test.
* gcc.target/powerpc/pr71656-2.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/pr71656-1.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/pr71656-2.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/rs6000/predicates.md
branches/gcc-6-branch/gcc/config/rs6000/rs6000-cpus.def
branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/71656] ICE in reload when generating code for -mcpu=power9 -mpower9-dform-vector

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71656

Peter Bergner  changed:

   What|Removed |Added

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

--- Comment #7 from Peter Bergner  ---
Now fixed in the FSF 6 branch too.

[Bug target/65248] Copy relocation against protected symbol doesn't work

2016-07-01 Thread nix at esperi dot org.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

--- Comment #11 from Nix  ---
The symptoms are failures to link with "relocation against protected symbol is
invalid" errors which go away when you use gold. (You can see it if you try to
build firefox, for instance.)

[Bug middle-end/49905] Better sanity checking on sprintf src & dest to produce warning for dodgy code ?

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

--- Comment #7 from Martin Sebor  ---
Patch posted for review:
https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00056.html

[Bug target/71720] initialization of a vector of floats generates incorrect code for -mcpu=power9

2016-07-01 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71720

--- Comment #3 from Michael Meissner  ---
Author: meissner
Date: Fri Jul  1 18:23:29 2016
New Revision: 237920

URL: https://gcc.gnu.org/viewcvs?rev=237920&root=gcc&view=rev
Log:
[gcc]
2016-07-01  Michael Meissner  

PR target/71720
* config/rs6000/vsx.md (vsx_splat_v4sf_internal): When splitting
the insns, use vsx_xxspltw_v4sf_direct which does not check for
little endian.

[gcc/testsuite]
2016-07-01  Michael Meissner  

PR target/71720
* gcc.target/powerpc/pr71720.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/powerpc/pr71720.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/vsx.md
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/49905] Better sanity checking on sprintf src & dest to produce warning for dodgy code ?

2016-07-01 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

--- Comment #8 from David Binderman  ---
(In reply to Martin Sebor from comment #7)
> Patch posted for review:
> https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00056.html

Fascinating stuff. Thanks.

I'll give it a good going over by throwing Fedora at it sometime early next
week, but first, may I ask if you tried a gcc bootstrap 
or a Linux kernel build with it, and if so, did it find much ?

[Bug middle-end/71732] New: FAIL: gcc.dg/torture/pr71532.c at -O2 and above

2016-07-01 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71732

Bug ID: 71732
   Summary: FAIL: gcc.dg/torture/pr71532.c at -O2 and above
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, law at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa*-*-* (32 bit)
Target: hppa*-*-* (32 bit)
 Build: hppa*-*-* (32 bit)

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

The following fails of gcc.dg/torture/pr71532.c occur on 32-bit hppa:

FAIL: gcc.dg/torture/pr71532.c   -O2  execution test
FAIL: gcc.dg/torture/pr71532.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr71532.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr71532.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr71532.c   -Os  execution test

Looking at the -O2 build, it appears the last argument passed on the stack
to bar is off by one:

(gdb) x/32x $sp-128
0xfd703380: 0x000f2000  0xfcc56b20  0x00011146  0x0001110c
0xfd703390: 0x000101e8  0x00117488  0x  0x000f2000
0xfd7033a0: 0xfcc56b20  0x00011146  0x  0x000103d3
0xfd7033b0: 0x000d  0x000b  0x000a  0x0009
0xfd7033c0: 0x0008  0x0007  0x0006  0x0005
0xfd7033d0: 0x0005  0x0004  0x0003  0x0002
0xfd7033e0: 0xfd47e3c8  0x  0xfd47c1ac  0x00010a1b
0xfd7033f0: 0x  0x  0x  0x
(gdb) p/x $sp
$7 = 0xfd703400
(gdb) bt
#0  bar (a=a@entry=1, b=b@entry=2, c=c@entry=3, d=d@entry=4, 
e=, f=, g=, 
h=, i=, j=, 
k=, l=)
at /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr71532.c:17
#1  0x00010a4c in test ()
at /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr71532.c:29
#2  0x00010410 in main ()
at /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr71532.c:36
(gdb) p $r26
$8 = 1
(gdb) p $r25
$9 = 2
(gdb) p $r24
$10 = 3
(gdb) p $r23
$11 = 4

The stack argument slots start at 0xfd7033dc and go to 0xfd7033b0.  The first
four arguments are passed in r26-r23 and are reserved for use by callee.  They
are not set by caller.

Need to look at argument setup in test.

[Bug middle-end/71732] FAIL: gcc.dg/torture/pr71532.c at -O2 and above

2016-07-01 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71732

--- Comment #1 from John David Anglin  ---
The last argument (in r18) is not stored to argument slot:

ldi 5,%r4
stw %r18,-80(%r30)
stw %r16,-76(%r30)
stw %r14,-72(%r30)
stw %r12,-68(%r30)
stw %r10,-64(%r30)
stw %r8,-60(%r30)
stw %r6,-56(%r30)
bl foo,%r2
stw %r4,-52(%r30)
.LVL28:
.loc 1 29 0
stw %r16,0(%r15)
ldi 4,%r23
ldi 3,%r24
stw %r14,0(%r13)
ldi 2,%r25
ldi 1,%r26
stw %r12,0(%r11)
stw %r10,0(%r9)
stw %r8,0(%r7)
stw %r6,0(%r5)
stw %r4,0(%r3)
stw %r12,0(%r11)
stw %r10,0(%r9)
stw %r8,0(%r7)
stw %r6,0(%r5)
stw %r4,0(%r3)
bl bar,%r2
stw %r28,-184(%r30)

[Bug middle-end/71732] FAIL: gcc.dg/torture/pr71532.c at -O2 and above

2016-07-01 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71732

--- Comment #2 from John David Anglin  ---
Present in 4.9, 5 and 6.

[Bug fortran/35849] "wrong" line shown in error message for parameter

2016-07-01 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35849

--- Comment #5 from kargl at gcc dot gnu.org ---
Index: simplify.c
===
--- simplify.c  (revision 237855)
+++ simplify.c  (working copy)
@@ -3280,7 +3280,6 @@ gfc_simplify_ishftc (gfc_expr *e, gfc_ex
return NULL;

   gfc_extract_int (sz, &ssize);
-
 }
   else
 ssize = isize;
@@ -3294,7 +3293,10 @@ gfc_simplify_ishftc (gfc_expr *e, gfc_ex
 {
   if (sz == NULL)
gfc_error ("Magnitude of second argument of ISHFTC exceeds "
-  "BIT_SIZE of first argument at %L", &s->where);
+  "BIT_SIZE of first argument at %C");
+  else
+   gfc_error ("Absolute value of SHIFT shall be less than or equal "
+  "to SIZE at %C");
   return &gfc_bad_expr;
 }

[Bug target/71731] incorrect result for vectorized char rotate with -mcpu=power9

2016-07-01 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71731

--- Comment #2 from acsawdey at gcc dot gnu.org ---
This fails with trunk 237811 or later, but that is because power9-dform-vector
was turned on by default there. For instance 237715 also fails this if you add
-mpower9-dform-vector to the flags.

[Bug fortran/68566] ICE on using unusable array in reshape (double free or corruption)

2016-07-01 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68566

--- Comment #13 from Jerry DeLisle  ---
(In reply to kargl from comment #12)
> ===
> --- check.c   (revision 237855)
> +++ check.c   (working copy)
> @@ -3820,7 +3820,7 @@ gfc_check_reshape (gfc_expr *source, gfc
>if (!type_check (order, 3, BT_INTEGER))
>   return false;
>  
> -  if (order->expr_type == EXPR_ARRAY)
> +  if (order->expr_type == EXPR_ARRAY && gfc_is_constant_expr (order))
>   {
> int i, order_size, dim, perm[GFC_MAX_DIMENSIONS];
> gfc_expr *e;

I will commit this for you Steve after regtesting, Drop me an email if you plan
to do so.

[Bug target/71733] New: ICE in vmx test cases with -mcpu=power9

2016-07-01 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71733

Bug ID: 71733
   Summary: ICE in vmx test cases with -mcpu=power9
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: acsawdey at gcc dot gnu.org
CC: bergner at gcc dot gnu.org, wschmidt at gcc dot gnu.org
  Target Milestone: ---
Target: powerpc64le-linux

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

tested against 237922:

genoa 8839 -> /home/sawdey/src/gcc/trunk2/build/gcc/xgcc
-B/home/sawdey/src/gcc/trunk2/build/gcc/ vmx_1b-04.i -mcpu=power9
-fno-diagnostics-show-caret -fdiagnostics-color=never -O0 -maltivec
-mabi=altivec -std=gnu99 -mno-vsx -lm -o ./1b-04.exe
/home/sawdey/src/gcc/trunk/gcc/gcc/testsuite/gcc.dg/vmx/1b-04.c: In function
âmainâ:
/home/sawdey/src/gcc/trunk/gcc/gcc/testsuite/gcc.dg/vmx/1b-04.c:7:1: error:
insn does not satisfy its constraints:
(insn 20 5 31 (set (mem/c:V16QI (plus:DI (reg/f:DI 31 31)
(const_int 64 [0x40])) [0  S16 A128])
(reg:V16QI 77 0 [157]))
/home/sawdey/src/gcc/trunk/gcc/gcc/testsuite/gcc.dg/vmx/1b-04.c:5 1205
{*altivec_movv16qi}
 (nil))
/home/sawdey/src/gcc/trunk/gcc/gcc/testsuite/gcc.dg/vmx/1b-04.c:7:1: internal
compiler error: in extract_constrain_insn_cached, at recog.c:2223
0x10833bf3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../trunk/gcc/rtl-error.c:108
0x10833c57 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../trunk/gcc/rtl-error.c:119
0x107fa273 extract_constrain_insn_cached(rtx_insn*)
../../trunk/gcc/recog.c:2223
0x10e15327 insn_default_length(rtx_insn*)
../../trunk/gcc/config/rs6000/rs6000.md:6424
0x104da113 shorten_branches(rtx_insn*)
../../trunk/gcc/final.c:1184
0x104da3d3 rest_of_handle_shorten_branches
../../trunk/gcc/final.c:4537
0x104da3d3 execute
../../trunk/gcc/final.c:4566

[Bug middle-end/71732] FAIL: gcc.dg/torture/pr71532.c at -O2 and above

2016-07-01 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71732

--- Comment #3 from John David Anglin  ---
The following insn is deleted in postreload:

(insn 55 50 91 2 (set (mem:SI (reg/f:SI 17 %r17 [101]) [0  S4 A32])
(reg:SI 18 %r18 [102]))
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr71532.c:29 42
{*pa.md:2184}
 (nil))

;; Function test (test, funcdef_no=2, decl_uid=1447, cgraph_uid=2,
symbol_order=2)

rescanning insn with uid = 110.
rescanning insn with uid = 109.
rescanning insn with uid = 44.
rescanning insn with uid = 39.
rescanning insn with uid = 34.
rescanning insn with uid = 29.
rescanning insn with uid = 24.
rescanning insn with uid = 19.
rescanning insn with uid = 14.
rescanning insn with uid = 9.
deleting insn with uid = 55.
starting the processing of deferred insns
ending the processing of deferred insns

SI 17 and 18 were set as follows:

(insn 8 97 7 2 (set (reg:SI 18 %r18 [102])
(const_int 12 [0xc]))
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tortur
e/pr71532.c:28 42 {*pa.md:2184}
 (expr_list:REG_EQUIV (const_int 12 [0xc])
(nil)))
(insn 7 8 9 2 (set (reg/f:SI 17 %r17 [101])
(plus:SI (reg/f:SI 30 %r30)
(const_int -80 [0xffb0])))
/home/dave/gnu/gcc/gcc/gcc/te
stsuite/gcc.dg/torture/pr71532.c:28 116 {addsi3}
 (nil))
(insn 9 7 13 2 (set (mem:SI (reg/f:SI 17 %r17 [101]) [0  S4 A32])
(reg:SI 18 %r18 [102]))
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tort
ure/pr71532.c:28 42 {*pa.md:2184}
 (nil))

The call to bar looks like this:

(call_insn/i 95 109 113 2 (parallel [
(set (reg:SI 28 %r28)
(call (mem:SI (symbol_ref/v:SI ("@bar") [flags 0x3] 
) [0 bar S4 A32])(const_int 48 [0x30])))
(clobber (reg:SI 1 %r1))(clobber (reg:SI 2 %r2))
(use (const_int 0 [0]))
]) /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr71532.c:29 206 
{call_val_symref}
 (expr_list:REG_CALL_DECL (symbol_ref/v:SI ("@bar") [flags 0x3] 
)
(expr_list:REG_EH_REGION (const_int 0 [0])
(nil)))
(expr_list:SI (use (reg:SI 26 %r26))(expr_list:SI (use (reg:SI 25
%r25))
(expr_list:SI (use (reg:SI 24 %r24))
(expr_list:SI (use (reg:SI 23 %r23))   
(expr_list:SI (use (mem:SI (plus:SI (reg/f:SI 30 %r30)
(const_int -52 [0xffcc])) [0 
S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI (reg/f:SI 30 %r30)
(const_int -56 [0xffc8]))
[0
  S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI (reg/f:SI 30
%r30)
(const_int -60
[0xffc4])) [0  S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI (reg/f:SI
30 %r30)
(const_int -64
[0xffc0])) [0  S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI
(reg/f:SI 30 %r30)
(const_int -68
[0xffbc])) [0  S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI
(reg/f:SI 30 %r30)
(const_int -72
[0xffb8])) [0  S4 A32]))
(expr_list:SI (use (mem:SI (plus:SI
(reg/f:SI 30 %r30)
(const_int -76
[0xffb4])) [0  S4 A32]))
(expr_list:SI (use (mem:SI
(plus:SI (reg/f:SI 30 %r30)
(const_int -80
[0xffb0])) [0  S4 A32]))
(nil))

The call to foo has same set of uses.  Not sure why more insns were not
deleted.

It was my general impression that the stack argument slots should be treated
as being clobbered on hppa but that isn't clearly stated in runtime document.

[Bug target/71722] incorrect code for test pr64252.c for -mcpu=power9 -mpower9-vector -ftree-vectorize -O3

2016-07-01 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71722

--- Comment #2 from acsawdey at gcc dot gnu.org ---
adding -mno-power9-dform-vector does not help this one. So, likely not
dform-vector related.

[Bug fortran/71687] ICE in omp_add_variable, at gimplify.c:5821

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71687

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jul  1 20:52:54 2016
New Revision: 237926

URL: https://gcc.gnu.org/viewcvs?rev=237926&root=gcc&view=rev
Log:
PR fortran/71687
* f95-lang.c (struct binding_level): Add reversed field.
(clear_binding_level): Adjust initializer.
(getdecls): If reversed is clear, set it and nreverse the names
chain before returning it.
(poplevel): Use getdecls.
* trans-decl.c (gfc_generate_function_code, gfc_process_block_locals):
Use nreverse to pushdecl decls in the declaration order.

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

Added:
trunk/gcc/testsuite/gfortran.dg/gomp/pr71687.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/f95-lang.c
trunk/gcc/fortran/trans-decl.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/41922] Diagnostic: No location shown for overlappingly initialized EQUIVALENCEd character vars

2016-07-01 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41922

--- Comment #3 from kargl at gcc dot gnu.org ---
Index: target-memory.h
===
--- target-memory.h (revision 237855)
+++ target-memory.h (working copy)
@@ -44,7 +44,7 @@ int gfc_interpret_derived (unsigned char
 int gfc_target_interpret_expr (unsigned char *, size_t, gfc_expr *, bool);

 /* Merge overlapping equivalence initializers for trans-common.c. */
-size_t gfc_merge_initializers (gfc_typespec, gfc_expr *,
+size_t gfc_merge_initializers (gfc_typespec, gfc_expr *, locus *,
   unsigned char *, unsigned char *,
   size_t);

Index: target-memory.c
===
--- target-memory.c (revision 237855)
+++ target-memory.c (working copy)
@@ -639,7 +639,8 @@ gfc_target_interpret_expr (unsigned char
error.  */

 static size_t
-expr_to_char (gfc_expr *e, unsigned char *data, unsigned char *chk, size_t
len)
+expr_to_char (gfc_expr *e, locus *loc,
+ unsigned char *data, unsigned char *chk, size_t len)
 {
   int i;
   int ptr;
@@ -663,7 +664,7 @@ expr_to_char (gfc_expr *e, unsigned char
continue;
  ptr = TREE_INT_CST_LOW(DECL_FIELD_OFFSET(cmp->backend_decl))
+ TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(cmp->backend_decl))/8;
- expr_to_char (c->expr, &data[ptr], &chk[ptr], len);
+ expr_to_char (c->expr, loc, &data[ptr], &chk[ptr], len);
}
   return len;
 }
@@ -674,12 +675,16 @@ expr_to_char (gfc_expr *e, unsigned char
   buffer = (unsigned char*)alloca (len);
   len = gfc_target_encode_expr (e, buffer, len);

-for (i = 0; i < (int)len; i++)
+  for (i = 0; i < (int)len; i++)
 {
   if (chk[i] && (buffer[i] != data[i]))
{
- gfc_error ("Overlapping unequal initializers in EQUIVALENCE "
-"at %L", &e->where);
+ if (loc)
+   gfc_error ("Overlapping unequal initializers in EQUIVALENCE "
+   "at %L", loc);
+ else
+   gfc_error ("Overlapping unequal initializers in EQUIVALENCE "
+   "at %C");
  return 0;
}
   chk[i] = 0xFF;
@@ -695,7 +700,8 @@ expr_to_char (gfc_expr *e, unsigned char
the union declaration.  */

 size_t
-gfc_merge_initializers (gfc_typespec ts, gfc_expr *e, unsigned char *data,
+gfc_merge_initializers (gfc_typespec ts, gfc_expr *e, locus *loc,
+   unsigned char *data,
unsigned char *chk, size_t length)
 {
   size_t len = 0;
@@ -705,8 +711,7 @@ gfc_merge_initializers (gfc_typespec ts,
 {
 case EXPR_CONSTANT:
 case EXPR_STRUCTURE:
-  len = expr_to_char (e, &data[0], &chk[0], length);
-
+  len = expr_to_char (e, loc, &data[0], &chk[0], length);
   break;

 case EXPR_ARRAY:
@@ -718,7 +723,7 @@ gfc_merge_initializers (gfc_typespec ts,
  if (mpz_cmp_si (c->offset, 0) != 0)
len = elt_size * (size_t)mpz_get_si (c->offset);

- len = len + gfc_merge_initializers (ts, c->expr, &data[len],
+ len = len + gfc_merge_initializers (ts, c->expr, loc, &data[len],
  &chk[len], length - len);
}
   break;
Index: trans-common.c
===
--- trans-common.c  (revision 237855)
+++ trans-common.c  (working copy)
@@ -532,10 +532,15 @@ get_init_field (segment_info *head, tree
   memset (chk, '\0', (size_t)length);
   for (s = head; s; s = s->next)
 if (s->sym->value)
-  gfc_merge_initializers (s->sym->ts, s->sym->value,
+  {
+   locus *loc = NULL;
+   if (s->sym->ns->equiv && s->sym->ns->equiv->eq)
+ loc = &s->sym->ns->equiv->eq->expr->where;
+   gfc_merge_initializers (s->sym->ts, s->sym->value, loc,
  &data[s->offset],
  &chk[s->offset],
 (size_t)s->length);
+  }

   for (i = 0; i < length; i++)
 CONSTRUCTOR_APPEND_ELT (v, NULL, build_int_cst (type, data[i]));

[Bug middle-end/71734] New: [7 Regression] FAIL: libgomp.fortran/simd4.f90 -O3 -g execution test

2016-07-01 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71734

Bug ID: 71734
   Summary: [7 Regression] FAIL: libgomp.fortran/simd4.f90   -O3
-g  execution test
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
CC: ysrumyan at gmail dot com
  Target Milestone: ---

On Linux/x86-64, r237844 caused:

FAIL: libgomp.fortran/simd3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: libgomp.fortran/simd3.f90   -O3 -g  execution test
FAIL: libgomp.fortran/simd4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: libgomp.fortran/simd4.f90   -O3 -g  execution test

I still see them with r237916.

[Bug c++/71728] [5/6/7 Regression] ICE with goto in statement-expression inside a condition

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71728

Martin Sebor  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||msebor at gcc dot gnu.org
  Known to fail||5.2.1, 6.1.0, 7.0

--- Comment #2 from Martin Sebor  ---
The ICE was introduced in r217663:

r217663 | jason | 2014-11-17 13:16:14 -0500 (Mon, 17 Nov 2014) | 48 lines

C++14 constexpr support (minus loops and multiple returns)

[Bug c++/71718] [6/7 Regression] ICE on erroneous recursive template error printing

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71718

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org
  Known to fail||4.8.5, 4.9.3, 5.3.0, 6.1.0,
   ||7.0

--- Comment #2 from Martin Sebor  ---
The likely commit to introduce the ICE is r191412 in the 4.8 time frame:

r191412 | jason | 2012-09-17 23:47:35 -0400 (Mon, 17 Sep 2012) | 4 lines

PR c++/54575
* pt.c (instantiate_alias_template): New.
(tsubst): Use it.
(push_access_scope): Allow TYPE_DECL.

The last relevant one before that was r191400 which errors out with:

t.C:14:26: error: template instantiation depth exceeds maximum of 32 (use
-ftemplate-depth= to increase the maximum) substituting ‘template sp rec() [with T = ; int num = ]’
   return rec();  
  ^
t.C:14:26:   recursively required from ‘sp rec() [with T = Base; int num =
0; sp = A]’
t.C:14:26:   required from ‘sp rec() [with T = Base; int num = 1; sp =
A]’
t.C:18:13:   required from here

t.C:14:26: error: no matching function for call to ‘rec()’
t.C:14:26: note: candidate is:
t.C:12:3: note: template sp rec()
   rec() 
   ^
t.C:12:3: note:   substitution of deduced template arguments resulted in errors
seen above

[Bug target/71722] incorrect code for test pr64252.c for -mcpu=power9 -mpower9-vector -ftree-vectorize -O3

2016-07-01 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71722

Bill Schmidt  changed:

   What|Removed |Added

 CC||meissner at gcc dot gnu.org

--- Comment #3 from Bill Schmidt  ---
For some reason I can't yet reproduce this from the original test case.  I'm
getting an unvectorized version of the code instead.  Also, I'm having trouble
compiling the preprocessed test case.  Perhaps you could point me to a copy
offline.

That said, the only suspicious P9 instruction I see in here is an mtvsrws. 
There are a couple of xxspltib instructions, but they are obviously just
splatting 0 and -1 and it doesn't seem like much can go wrong there.  I'd guess
the direct move to be worth looking at.

[Bug target/71733] ICE in vmx test cases with -mcpu=power9

2016-07-01 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71733

--- Comment #1 from Peter Bergner  ---
That altivec load should not be using reg+offset (dform) addressing.  I'll have
a look.

[Bug c/71713] "initializer element is not constant" with nested casts

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71713

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|minor   |enhancement

--- Comment #1 from Martin Sebor  ---
I believe the error is justified because a compound literal (i.e., "(struct
Str1){1}") is not a constant expression, and so it cannot be used to initialize
an object with static storage duration.  GCC accepts compound literals as
initializers in some contexts as an extension but not here.  For instance, the
following is accepted but in pedantic mode diagnosed with

  struct Str1 x = (struct Str1){ 0 };

  warning: initializer element is not constant [-Wpedantic]

...but it doesn't accept the more involved initializer in the submitted test
case.  Since there are a number of enhancement requests to change GCC to accept
more expressions as initializers that aren't constant expressions (for example,
bug 53091) I will confirm this as such.

[Bug c++/71710] [7 Regression] ICE on valid C++11 code with decltype and alias template: in lookup_member, at cp/search.c:1255

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71710

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor  ---
My bisection script points to r236221 as the responsible commit:

r236221 | jason | 2016-05-13 15:18:35 -0400 (Fri, 13 May 2016) | 23 lines

Fix type-dependence and the current instantiation.

PR c++/10200
PR c++/69753

[Bug c++/70385] Lambda capture by reference of const reference fails

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70385

Martin Sebor  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
 CC||msebor at gcc dot gnu.org
 Blocks||54367
 Ever confirmed|0   |1
  Known to fail||5.3.0, 6.1.0, 7.0

--- Comment #2 from Martin Sebor  ---
Confirmed with today's top of trunk (7.0).  The code never seems to have been
accepted.

$ cat xxx.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S
-Wall -Wextra -Wpedantic -xc++ xxx.c
int const i = 0;
auto test = [&j = i]() { };
xxx.c:2:13: error: binding ‘const int’ to reference of type ‘int&’ discards
qualifiers
 auto test = [&j = i]() { };
 ^


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54367
[Bug 54367] [meta-bug] lambda expressions

[Bug tree-optimization/71595] [7 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org
  Known to fail||7.0

--- Comment #3 from Martin Sebor  ---
The ICE was introduced in r236874:

r236874 | hubicka | 2016-05-30 06:40:33 -0400 (Mon, 30 May 2016) | 10 lines

* predict.h (force_edge_cold): Declare.
* predict.c (force_edge_cold): New function.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Fix profile
updating.
(canonicalize_loop_induction_variables): Fix formating.

* gcc.dg/tree-ssa/cunroll-12.c: New testcase.
* gcc.dg/tree-ssa/cunroll-13.c: New testcase.
* gcc.dg/tree-ssa/cunroll-14.c: New testcase.

[Bug middle-end/71734] [7 Regression] FAIL: libgomp.fortran/simd4.f90 -O3 -g execution test

2016-07-01 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71734

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-01
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
Both tests have

simd3.f90:! { dg-additional-options "-mavx" { target avx_runtime } }
simd4.f90:! { dg-additional-options "-mavx" { target avx_runtime } }

-mavx hides this regression. All those SIMD tests with

{ dg-additional-options "-mavx" { target avx_runtime } }

should also have the counter parts without it so that SSE SIMD tests will
run on AVX machines.

[Bug c/71560] union compound literal initializes wrong union field

2016-07-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71560

--- Comment #7 from Martin Sebor  ---
Patch posted for review:
https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00069.html

[Bug fortran/29819] Error/warning message should ignore comments for "1" in %C output

2016-07-01 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29819

--- Comment #3 from kargl at gcc dot gnu.org ---
Index: parse.c
===
--- parse.c (revision 236243)
+++ parse.c (working copy)
@@ -5237,6 +5237,7 @@ parse_contained (int module)
   gfc_statement st;
   gfc_symbol *sym;
   gfc_entry_list *el;
+  locus old_loc;
   int contains_statements = 0;
   int seen_error = 0;

@@ -5253,6 +5254,7 @@ parse_contained (int module)
  next:
   /* Process the next available statement.  We come here if we got an
error
 and rejected the last statement.  */
+  old_loc = gfc_current_locus;
   st = next_statement ();

   switch (st)
@@ -5358,7 +5360,7 @@ parse_contained (int module)
   pop_state ();
   if (!contains_statements)
 gfc_notify_std (GFC_STD_F2008, "CONTAINS statement without "
-   "FUNCTION or SUBROUTINE statement at %C");
+   "FUNCTION or SUBROUTINE statement at %L", &old_loc);
 }

[Bug fortran/38351] Poor error message for rank mismatch in operator args

2016-07-01 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38351

--- Comment #2 from kargl at gcc dot gnu.org ---
Index: resolve.c
===
--- resolve.c   (revision 236243)
+++ resolve.c   (working copy)
@@ -3586,7 +3586,13 @@ resolve_operator (gfc_expr *e)
  break;
}

-  sprintf (msg,
+  if (op1->ts.type == BT_DERIVED || op2->ts.type == BT_DERIVED)
+   sprintf (msg,
+_("Incompatible data types for operands of defined "
+  "binary operator %%<%s%%> at %%L"),
+gfc_op2string (e->value.op.op));
+  else
+   sprintf (msg,
   _("Operands of binary numeric operator %%<%s%%> at %%L are
%s/%s"),
   gfc_op2string (e->value.op.op), gfc_typename (&op1->ts),
   gfc_typename (&op2->ts));

[Bug c/71719] [7 Regression] invalid set-but-not-used warning with vectors

2016-07-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71719

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Sat Jul  2 06:41:29 2016
New Revision: 237937

URL: https://gcc.gnu.org/viewcvs?rev=237937&root=gcc&view=rev
Log:
PR c/71719
* c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.

* c-c++-common/Wunused-var-15.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/Wunused-var-15.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog