[Bug debug/68010] internal compiler error: in tree_to_shwi, at tree.h:3661

2016-11-03 Thread sr at evolgo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68010

--- Comment #9 from Stephan Rudlof  ---
There is another - short - code snippet triggering this bug; see attachment
  src.c
.
Session:
+++
sr@free:/tmp$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sr@free:/tmp$ gcc -c src.c
sr@free:/tmp$ gcc -O -c src.c
src.c: In function ‘String_new’:
src.c:29:1: internal compiler error: in tree_to_shwi, at tree.h:3661
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Preprocessed source stored into /tmp/ccAnah8K.out file, please attach this to
your bugreport.
sr@free:/tmp$ 
+++

[Bug debug/68010] internal compiler error: in tree_to_shwi, at tree.h:3661

2016-11-03 Thread sr at evolgo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68010

Stephan Rudlof  changed:

   What|Removed |Added

 CC||sr at evolgo dot de

--- Comment #8 from Stephan Rudlof  ---
Created attachment 39961
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39961=edit
short code snippet triggering bug

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #15 from David Edelsohn  ---
Another option is to force the COMDAT group to NULL in set_comdat_group() if
!HAVE_COMDAT_GROUP. That would allow the rest of the COMDAT functionality to
continue to work.  Does that make any sense to try?

[Bug target/78192] extract from vector registers to int results in wrong data order

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78192

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #4 from Michael Meissner  ---
Fixed in subversion id 241834.

[Bug target/78192] extract from vector registers to int results in wrong data order

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78192

--- Comment #3 from Michael Meissner  ---
Author: meissner
Date: Thu Nov  3 23:32:07 2016
New Revision: 241834

URL: https://gcc.gnu.org/viewcvs?rev=241834=gcc=rev
Log:
2016-11-03  Michael Meissner  

PR target/78192
* config/rs6000/vsx.md (vsx_extract__di): The element number
has already been adjusted for endianness, so don't adjust it any
further.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/vsx.md

[Bug c/78203] New: missing warning on return of unitialized variable

2016-11-03 Thread fwd at quantentunnel dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78203

Bug ID: 78203
   Summary: missing warning on return of unitialized variable
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fwd at quantentunnel dot de
  Target Milestone: ---

Compiling the following code with gcc version 4.9.2 only one warning about the
use of uninitialized variables is issued. I expected a warning in func1 too.

int func1(const int x)
{
  int i;

  if (0 == x)
  {
i = 1;
  }

  return i; // no warning that 'i' may be used uninitialized in this function
}

int func2(const int x)
{
  int i;

  if (0 == x)
  {
return 1;
  }

  return i; // ok, warning is issued
}

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


Changing func1 to static and adding
int main(void)
{
  int a;
  a = func1(1);
  return a;
}
again does not show the expected warning.


With -O2 there is no warning at all.


clang issues both warning, icc also does not.
Versions 5.4, 6.2 and 7 also do not show a warning.

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

2016-11-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77834

--- Comment #4 from Jakub Jelinek  ---
Created attachment 39960
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39960=edit
gcc7-pr77834-2.patch

Per ml and IRC discussions, this patch attempts not to consider call mem
operand as memory read from the first byte of a function in DSE.
Unfortunately, it breaks pr67960.c testcase at -m32 -Os, we optimize away then
the argument store; while it is store to 8(%ebp), for whatever reason cselib
thinks it is %argp based rather than %ebp and as check is a const sibcall,
doesn't consider the argument memory slot being needed.

I'd say it is a RA bug, in that there is:
(insn 16 3 6 2 (set (reg/v/f:SI 0 ax [orig:89 pi ] [89])
(mem/f/c:SI (plus:SI (reg/f:SI 6 bp)
(const_int 8 [0x8])) [2 pi+0 S4 A32])) "pr67690.c":21 82
{*movsi_internal}
 (expr_list:REG_EQUIV (mem/f/c:SI (reg/f:SI 16 argp) [2 pi+0 S4 A32])
(nil)))
(insn 6 16 7 2 (set (reg:SI 0 ax [orig:90 *pi_3(D) ] [90])
(mem:SI (reg/v/f:SI 0 ax [orig:89 pi ] [89]) [1 *pi_3(D)+0 S4 A32]))
"pr67690.c":21 82 {*movsi_internal}
 (expr_list:REG_EQUIV (mem:SI (reg/f:SI 16 argp) [0  S4 A32])
(nil)))
after reload - note in the first insn LRA properly reloaded the argp in (mem
(argp)) in the SET_SRC, but not in REG_EQUIV.  Vlad, do you agree that is a LRA
bug?  But not sure if fixing the REG_EQUIV would help, I've tried to update
them from the debugger and df_insn_rescan at the beginning of dse2, but dse2
still removed the insns.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #14 from David Edelsohn  ---
Honza suggested

Index: varasm.c
===
--- varasm.c(revision 241793)
+++ varasm.c(working copy)
@@ -6036,7 +6036,8 @@
 #ifdef MAKE_DECL_ONE_ONLY
   MAKE_DECL_ONE_ONLY (decl);
 #endif
-  symbol->set_comdat_group (comdat_group);
+  if (HAVE_COMDAT_GROUP)
+symbol->set_comdat_group (comdat_group);
 }
   else if (VAR_P (decl)
&& (DECL_INITIAL (decl) == 0
Index: ipa-comdats.c
===
--- ipa-comdats.c   (revision 241793)
+++ ipa-comdats.c   (working copy)
@@ -210,6 +210,7 @@
 {
   symtab_node *head = (symtab_node *)head_p;

+  gcc_assert (HAVE_COMDAT_GROUP || head_p == NULL);
   gcc_assert (!symbol->get_comdat_group ());
   symbol->set_comdat_group (head->get_comdat_group ());
   symbol->add_to_same_comdat_group (head);

I bootstrapped and tested both trunk with the patch, and 6-branch with the
patch and Richi's backported tree-ssa-sccvn.c patch.  The good news is 6-branch
bootstraps with the above patch and a backport of Richi's patch, so COMDAT is
the cause.  The bad news, as one can see from the published test results, is
testsuite carnage -- ugly, ugly, ugly.   Hundreds of new failures in C, C++ and
libstdc++.  Apparently something needs COMDAT groups, although it doesn't fully
function on AIX.

I will try again without the COMDAT patch and gating ipa-comdats on
HAVE_COMDAT_GROUP.

[Bug libitm/78202] New: declarations of builtins in libitm don't match

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78202

Bug ID: 78202
   Summary: declarations of builtins in libitm don't match
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libitm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bernd.edlinger at hotmail dot de
  Target Milestone: ---

C++ does currently not give a warning about it, but this is about to change
soon.

The following functions are declared in libitm.h:

void _ITM_L##T (const _ITM_TYPE##T *) ;
void _ITM_LB (const void *, size_t) ;

But the builtin functions have a different signature

void _ITM_L##T (const _ITM_TYPE##T *) ATTR_TM_TMPURE_NOTHROW_LIST;
void _ITM_LB (volatile void*, size_t) ATTR_TM_TMPURE_NOTHROW_LIST;

I doubt that the builtin attributes are used due to the type conflict,
some of the attributes are impossible to write down in the source code,
like attribute((*tm regparm)) so there is probably no work-around.

[Bug bootstrap/77993] [7 regression] bootstrap failure on PowerPC/Linux

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77993

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #13 from Michael Meissner  ---
Fixed in subversion id 241833.

[Bug bootstrap/77993] [7 regression] bootstrap failure on PowerPC/Linux

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77993

--- Comment #12 from Michael Meissner  ---
Author: meissner
Date: Thu Nov  3 21:25:12 2016
New Revision: 241833

URL: https://gcc.gnu.org/viewcvs?rev=241833=gcc=rev
Log:
2016-11-03  Michael Meissner  

PR target/77993
* config/rs6000/rs6000.h (FLOAT128_IBM_P): Do not allow IFmode or
ICmode unless we have standard PowerPC floating point.
* config/rs6000/rs6000.md (FP iterator): Likewise.
(FMOVE128 iterator): Likewise.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.h
trunk/gcc/config/rs6000/rs6000.md

[Bug fortran/42913] [FIXME] Should gfc_conv_expr_descriptor be setting bounds correctly?

2016-11-03 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42913

Paul Thomas  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #2 from Paul Thomas  ---
I guess not!

I have closed it as a WONT FIX.

Thanks

Paul

[Bug debug/28767] GCC should output DW_TAG_ptr_to_member for member functions

2016-11-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28767

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Thu Nov  3 21:18:49 2016
New Revision: 241832

URL: https://gcc.gnu.org/viewcvs?rev=241832=gcc=rev
Log:
PR debug/28767
PR debug/56974
* langhooks.h (struct lang_hooks_for_types): Add type_dwarf_attribute
langhook.
* langhooks.c (lhd_type_dwarf_attribute): New function.
* langhooks-def.h (lhd_type_dwarf_attribute): Declare.
(LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add
LANG_HOOKS_TYPE_DWARF_ATTRIBUTE.
(check_qualified_type, check_aligned_type): Call it.
* dwarf2out.c (modified_type_die): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type.
(gen_ptr_to_mbr_type_die): If lookup_type_die is already non-NULL,
return early.  For pointer-to-data-member add DW_AT_use_location
attribute.
(gen_subroutine_type_die): Add DW_AT_{,rvalue_}reference attribute
if needed.
(gen_type_die_with_usage): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type.  Formatting fixes. Call
get_debug_type langhook.
cp/
* tree.c (cp_check_qualified_type): Use check_base_type and
TYPE_QUALS comparison instead of check_qualified_type.
(cxx_type_hash_eq): Return false if type_memfn_rqual don't match.
* cp-objcp-common.c (cp_get_debug_type): New function.
(cp_decl_dwarf_attribute): Don't handle types here.
(cp_type_dwarf_attribute): New function.
* cp-objcp-common.h (cp_get_debug_type, cp_type_dwarf_attribute):
Declare.
(LANG_HOOKS_GET_DEBUG_TYPE, LANG_HOOKS_TYPE_DWARF_ATTRIBUTE):
Define.
testsuite/
* g++.dg/debug/dwarf2/ptrdmem-1.C: New test.
* g++.dg/debug/dwarf2/ref-3.C: New test.
* g++.dg/debug/dwarf2/ref-4.C: New test.
* g++.dg/debug/dwarf2/refqual-1.C: New test.
* g++.dg/debug/dwarf2/refqual-2.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-objcp-common.c
trunk/gcc/cp/cp-objcp-common.h
trunk/gcc/dwarf2out.c
trunk/gcc/langhooks-def.h
trunk/gcc/langhooks.c
trunk/gcc/langhooks.h
trunk/gcc/testsuite/ChangeLog

[Bug debug/56974] c++ ref qualifiers not represented in DWARF

2016-11-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56974

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Thu Nov  3 21:18:49 2016
New Revision: 241832

URL: https://gcc.gnu.org/viewcvs?rev=241832=gcc=rev
Log:
PR debug/28767
PR debug/56974
* langhooks.h (struct lang_hooks_for_types): Add type_dwarf_attribute
langhook.
* langhooks.c (lhd_type_dwarf_attribute): New function.
* langhooks-def.h (lhd_type_dwarf_attribute): Declare.
(LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add
LANG_HOOKS_TYPE_DWARF_ATTRIBUTE.
(check_qualified_type, check_aligned_type): Call it.
* dwarf2out.c (modified_type_die): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type.
(gen_ptr_to_mbr_type_die): If lookup_type_die is already non-NULL,
return early.  For pointer-to-data-member add DW_AT_use_location
attribute.
(gen_subroutine_type_die): Add DW_AT_{,rvalue_}reference attribute
if needed.
(gen_type_die_with_usage): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type.  Formatting fixes. Call
get_debug_type langhook.
cp/
* tree.c (cp_check_qualified_type): Use check_base_type and
TYPE_QUALS comparison instead of check_qualified_type.
(cxx_type_hash_eq): Return false if type_memfn_rqual don't match.
* cp-objcp-common.c (cp_get_debug_type): New function.
(cp_decl_dwarf_attribute): Don't handle types here.
(cp_type_dwarf_attribute): New function.
* cp-objcp-common.h (cp_get_debug_type, cp_type_dwarf_attribute):
Declare.
(LANG_HOOKS_GET_DEBUG_TYPE, LANG_HOOKS_TYPE_DWARF_ATTRIBUTE):
Define.
testsuite/
* g++.dg/debug/dwarf2/ptrdmem-1.C: New test.
* g++.dg/debug/dwarf2/ref-3.C: New test.
* g++.dg/debug/dwarf2/ref-4.C: New test.
* g++.dg/debug/dwarf2/refqual-1.C: New test.
* g++.dg/debug/dwarf2/refqual-2.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-objcp-common.c
trunk/gcc/cp/cp-objcp-common.h
trunk/gcc/dwarf2out.c
trunk/gcc/langhooks-def.h
trunk/gcc/langhooks.c
trunk/gcc/langhooks.h
trunk/gcc/testsuite/ChangeLog

[Bug c++/78201] New: [7 Regression] ICE in tree_to_shwi, at tree.h:4037 (seen both on ARM32 an AArch64)

2016-11-03 Thread yroux at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78201

Bug ID: 78201
   Summary: [7 Regression] ICE in tree_to_shwi, at tree.h:4037
(seen both on ARM32 an AArch64)
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yroux at gcc dot gnu.org
  Target Milestone: ---

Created attachment 39959
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39959=edit
Reduced testcase

Hi,

the attached reduced testcase fails with ICE on trunk since r239561.  It was
observed on ARM and AArch64 targets, but might affect targets with
section-anchors enabled.

$ aarch64-linux-gnu-g++ -O2 reduced.C
reduced.C: In function 'void f()':
reduced.C:7:8: internal compiler error: in tree_to_shwi, at tree.c:7313
   char a[e] = "";
^
0x1007a32 tree_to_shwi(tree_node const*)
.../gcc.git~master/gcc/tree.c:7313
0x105bffa default_use_anchors_for_symbol_p(rtx_def const*)
.../gcc.git~master/gcc/varasm.c:6810
...

The issue is that tree_to_shwi is called without checking its parameter fits in
a signed HOST_WIDE_INT first.  I've validated the following fix, which does the
checking and avoid using section anchors if it fails, on ARM and AArch64
targets, and will submit it on the list.

diff --git a/gcc/varasm.c b/gcc/varasm.c
index 6a7ffc2..231ac05 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6807,8 +6807,9 @@ default_use_anchors_for_symbol_p (const_rtx symbol)
 anchor range to reduce the amount of instructions require to refer
 to the entire declaration.  */
   if (decl && DECL_SIZE (decl)
-&& tree_to_shwi (DECL_SIZE (decl))
-   >= (targetm.max_anchor_offset * BITS_PER_UNIT))
+ && (!tree_fits_shwi_p (DECL_SIZE (decl))
+ || tree_to_shwi (DECL_SIZE (decl))
+>= (targetm.max_anchor_offset * BITS_PER_UNIT)))
return false;

[Bug c++/78198] ICE on valid code in: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:203

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78198

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

class A {};
class D;
template using UniquePtr = A;
struct C {
typedef UniquePtr SingleObject;
};
template C::SingleObject MakeUnique(Args... aArgs)
{
D(aArgs...);
}
class B {};
template class BufferList {
public:
BufferList(unsigned, unsigned, unsigned, AllocPolicy = AllocPolicy());
};
class D : BufferList {
BufferList::BufferList;
};
UniquePtr setCloneBuffer_impl_buf = MakeUnique(0, 0, 0);

[Bug target/78192] extract from vector registers to int results in wrong data order

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78192

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-11-03
 Ever confirmed|0   |1

--- Comment #2 from Michael Meissner  ---
It looks like I didn't properly switch the offset for LE numbering.  The test
does work in BE, and in LE vec_extract (, 0) returns vec_extract (, 3)

[Bug tree-optimization/77848] Gimple if-conversion results in redundant comparisons

2016-11-03 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77848

--- Comment #5 from Bill Schmidt  ---
I suppose that's not sensible as stated, as the SLP vectorizer doesn't really
think in terms of loops.

But this is an existing problem independent of whether we force loop-versioning
on in all cases.  Right now, a versioned loop that is not loop vectorized will
not allow SLP vectorization on the if-converted version.  We just don't happen
to have test coverage that notices that.

[Bug tree-optimization/78200] [7 regression]: 429.mcf of cpu2006 regresses in GCC trunk for avx2 target.

2016-11-03 Thread venkataramanan.kumar at amd dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78200

--- Comment #1 from Venkataramanan  ---
(In reply to Venkataramanan from comment #0)
> Noticed 5% regression with 429.mcf of cpu2006 on x86_64 AVX2 (bdver4) with
> GCC trunk gcc version 7.0.0 20161028 (experimental) (GCC).
> 
> Flag used is -O3 -mavx2 -mprefer-avx128
> 
> Not seen with GCC 6.1 or with GCC trunk for -O3 -mavx -mprefer-avx128
> 
> Assembly difference is observed in hot function primal_bea_mpp of pbeampp.c. 
> 
> -O3 -mavx -mprefer-avx128 -O3 -mavx2 -mprefer-avx128
> 
> .L98: |  .L98:
>   |  jle .L97 <==  order of
> comparison 
>   cmpl$2, %r9d|  cmpl$2, %r9d  is
> different.
>   jne .L97|  jne .L97
>   testq   %rdi, %rdi  |  ---
>   jle .L97|  ---
>   .L99:   |  .L99:
>   addq$1, %r13|  addq$1, %r13
>   movq%rdi, %r12  |  movq%rdi, %r12
>   movqperm(,%r13,8), %r9  |  movqperm(,%r13,8), %r9
>   sarq$63, %r12   |  sarq$63, %r12
>   movq%rdi, 8(%r9)|  movq%rdi, 8(%r9)
> + +-- 12 lines: xorq %r12, %rdi---|+ +-- 12 lines: xorq %r12, %rdi--
>   jle .L97|  jle .L97
>   movq8(%rax), %r14   |  movq8(%rax), %r14
>   movq(%rax), %rdi|  movq(%rax), %rdi
>   subq(%r14), %rdi|  subq(%r14), %rdi
>   movq16(%rax), %r14  |  movq16(%rax), %r14
>   addq(%r14), %rdi|  addq(%r14), %rdi
>   jns .L98|  cmpq$0, %rdi
>   |  jge .L98
> 
> 
> Gimple optimzied dump shows 
> 
> GCC trunk -O3 -mavx -mprefer-avx128 
> ;;   basic block 20, loop depth 2, count 0, freq 1067, maybe hot
> ;;   Invalid sum of incoming frequencies 1216, should be 1067
> ;;prev block 19, next block 21, flags: (NEW, REACHABLE, VISITED)
> ;;pred:   18 [64.0%]  (FALSE_VALUE,EXECUTABLE)
>   # RANGE [0, 1]
>   _496 = _512 == 2;
>   # RANGE [0, 1]
>   _495 = red_cost_503 > 0;
>   # RANGE [0, 1]
>   _494 = _495 & _496;
>   if (_494 != 0)
> goto ;
>   else
> goto ;
> 
for GCC trunk -O3 -mavx -mprefer-avx128 optimized dumps look like this.
;;   basic block 20, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 19, next block 21, flags: (NEW, REACHABLE, VISITED)
;;pred:   18 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  # RANGE [0, 1]
  _340 = _23 == 2;
  # RANGE [0, 1]
  _341 = red_cost_86 > 0;
  # RANGE [0, 1]
  _338 = _340 & _341;
  if (_338 != 0)
goto ;
  else
goto ;

[Bug tree-optimization/78200] New: [7 regression]: 429.mcf of cpu2006 regresses in GCC trunk for avx2 target.

2016-11-03 Thread venkataramanan.kumar at amd dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78200

Bug ID: 78200
   Summary: [7 regression]: 429.mcf of cpu2006 regresses in GCC
trunk for avx2 target.
   Product: gcc
   Version: tree-ssa
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: venkataramanan.kumar at amd dot com
  Target Milestone: ---

Noticed 5% regression with 429.mcf of cpu2006 on x86_64 AVX2 (bdver4) with GCC
trunk gcc version 7.0.0 20161028 (experimental) (GCC).

Flag used is -O3 -mavx2 -mprefer-avx128

Not seen with GCC 6.1 or with GCC trunk for -O3 -mavx -mprefer-avx128

Assembly difference is observed in hot function primal_bea_mpp of pbeampp.c. 

-O3 -mavx -mprefer-avx128   -O3 -mavx2 -mprefer-avx128

.L98: |  .L98:
  |  jle .L97 <==  order of
comparison 
  cmpl$2, %r9d|  cmpl$2, %r9d  is
different.
  jne .L97|  jne .L97
  testq   %rdi, %rdi  |  ---
  jle .L97|  ---
  .L99:   |  .L99:
  addq$1, %r13|  addq$1, %r13
  movq%rdi, %r12  |  movq%rdi, %r12
  movqperm(,%r13,8), %r9  |  movqperm(,%r13,8), %r9
  sarq$63, %r12   |  sarq$63, %r12
  movq%rdi, 8(%r9)|  movq%rdi, 8(%r9)
+ +-- 12 lines: xorq %r12, %rdi---|+ +-- 12 lines: xorq %r12, %rdi--
  jle .L97|  jle .L97
  movq8(%rax), %r14   |  movq8(%rax), %r14
  movq(%rax), %rdi|  movq(%rax), %rdi
  subq(%r14), %rdi|  subq(%r14), %rdi
  movq16(%rax), %r14  |  movq16(%rax), %r14
  addq(%r14), %rdi|  addq(%r14), %rdi
  jns .L98|  cmpq$0, %rdi
  |  jge .L98


Gimple optimzied dump shows 

GCC trunk -O3 -mavx -mprefer-avx128 
;;   basic block 20, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 19, next block 21, flags: (NEW, REACHABLE, VISITED)
;;pred:   18 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  # RANGE [0, 1]
  _496 = _512 == 2;
  # RANGE [0, 1]
  _495 = red_cost_503 > 0;
  # RANGE [0, 1]
  _494 = _495 & _496;
  if (_494 != 0)
goto ;
  else
goto ;


GCC trunk -O3 -mavx2 -mprefer-avx128 

;;   basic block 20, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 19, next block 21, flags: (NEW, REACHABLE, VISITED)
;;pred:   18 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  # RANGE [0, 1]
  _496 = _512 == 2;
  # RANGE [0, 1]
  _495 = red_cost_503 > 0;  
  # RANGE [0, 1]
  _494 = _495 & _496; <== operation order is different on AVX2.
  if (_494 != 0)
goto ;
  else
goto ;

operation order is changed at pbeampp.c.171t.reassoc2.
;;   basic block 20, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 19, next block 21, flags: (NEW, REACHABLE, VISITED)
;;pred:   18 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  _496 = _512 == 2;
  _495 = red_cost_503 > 0;
  _494 = _495 & _496;
  if (_494 != 0)
goto ;
  else
goto ;

Looking backwards further, found that in tree if conversion generates
non-canonical gimple. 
pbeampp.c.155t.ifcvt

;;   basic block 27, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 26, next block 28, flags: (NEW, REACHABLE, VISITED)
;;pred:   25 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  _496 = _512 == 2;
  _495 = red_cost_503 > 0;
  _494 = _496 & _495;<== comparison order is same but LHS of "&" has a
greater number.
  if (_494 != 0)
goto ;
  else
goto ;


pbeampp.c.154t.ch_vect
;;   basic block 23, loop depth 2, count 0, freq 1067, maybe hot
;;   Invalid sum of incoming frequencies 1216, should be 1067
;;prev block 22, next block 24, flags: (NEW, REACHABLE, VISITED)
;;pred:   21 [64.0%]  (FALSE_VALUE,EXECUTABLE)
  _340 = _23 == 2;
  _341 = red_cost_86 > 0;
  _338 = _340 & _341;  <==  comparison order is same here.
  if (_338 != 0)
goto ;
  else
goto ;



compiling pbeampp.c with -O3 -mavx2 -mprefer-avx128 
-fno-tree-loop-if-conversion 
and rest of benchmark changes with  -O3 -mavx2 -mprefer-avx128 brings back the
score same as that of 
-O3 -mavx  or GCC 6.1 -O3 -mavx2.

[Bug tree-optimization/77848] Gimple if-conversion results in redundant comparisons

2016-11-03 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77848

--- Comment #4 from Bill Schmidt  ---
Ah, never mind, I see what's happening.

The order of events is
 * if-conversion
 * loop vectorization
 * DCE
 * cunroll
 * slp vectorization

If we force versioning on with if-conversion, then the loop vectorizer sees
that it can't do anything with the loop, so it folds away the if-converted
version.  Thus SLP never gets a chance to look at the if-converted loop.  So it
seems that always forcing versioning on has an unintended consequence of
missing SLP opportunities.

Should the folding of LOOP_VECTORIZED (1, 2) be deferred to the SLP vectorizer?

[Bug fortran/78122] [5/6/7 Regression] ICE in get, at cgraph.h:395

2016-11-03 Thread physiker at toast2 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78122

--- Comment #3 from physiker at toast2 dot net ---
(In reply to Martin Liška from comment #2)
> Not being a fortran expert, however ifort rejects the source code:
> 
> /tmp/pi.f90(5): error #6592: This symbol must be a defined parameter, an
> enumerator, or an argument of an inquiry function that evaluates to a
> compile-time constant.   [A]
> real, pointer :: p => a
> --^
> /tmp/pi.f90(5): error #6973: This is not a valid initialization expression. 
> [A]
> real, pointer :: p => a
> --^
> 
> Problem is that symtab_node::get is called for a local symbol.

Ifort version 17 (linux) compiles pi.f90.
ifort -o pi pi.f90 -warn all -check all 
 ./pi
 a:   1.00
 p:  0.000E+00
 T
ifort -v
ifort version 17.0.0

[Bug target/78176] [MIPS] miscompiles ldxc1 with large pointers on 32-bits

2016-11-03 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78176

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #6 from Eric Botcazou  ---
> The issue may stem from the C front end where the dumps start off as below.
> Note that the '-1' in kappa-1 has ended up being represented as 1073741823
> (0x3fff) presumably owing to the fact it will be multiplied by 4
> eventually and hence be 'safe'.

All pointer calculations are done in sizetype and it is unsigned.  This kind of
issues generally come from the RTL level, maybe expansion here.

[Bug target/77483] [6/7 regression] gcc.target/i386/mask-unpack.c etc. FAIL

2016-11-03 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77483

--- Comment #7 from Rainer Orth  ---
Author: ro
Date: Thu Nov  3 17:06:49 2016
New Revision: 241825

URL: https://gcc.gnu.org/viewcvs?rev=241825=gcc=rev
Log:
Work around 32-bit i386 STV testcases failing with -mstackrealign (PR
target/77483)

Backport from mainline
2016-10-24  Rainer Orth  

PR target/77483
* gcc.target/i386/mask-unpack.c (dg-options): Add -mno-stackrealign.
* gcc.target/i386/pr65105-1.c: Likewise.
* gcc.target/i386/pr65105-2.c: Likewise.
* gcc.target/i386/pr65105-3.c: Likewise.
* gcc.target/i386/pr65105-5.c: Likewise.
* gcc.target/i386/pr67761.c: Likewise.

Modified:
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/mask-unpack.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr65105-1.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr65105-2.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr65105-3.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr65105-5.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr67761.c

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #61 from Bernd Edlinger  ---
Created attachment 39958
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39958=edit
patch for enabling ldrdstrd peephole

And this is what I will bootstrap in the next cycle.

It will enable all ldrd/strd peephole rules, as suggested
by Wilco.

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

Bernd Edlinger  changed:

   What|Removed |Added

  Attachment #39940|0   |1
is obsolete||

--- Comment #60 from Bernd Edlinger  ---
Created attachment 39957
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39957=edit
patch for di-mode early splitting

This is the di-mode early splitting patch which is same as the
previous one with the ldrdstrd part removed.

So I am currently bootstrapping with this patch.

It tries to reduce the stack usage with -msoft-float
to 272 bytes, and does nothing in thumb1 and vfp/neon modes.

[Bug tree-optimization/78180] Poor optimization of std::array on gcc 4.8/5.4/6.2 as compared to simple raw array

2016-11-03 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78180

--- Comment #8 from Barry Revzin  ---
-D_GLIBCXX_USE_CXX11_ABI=0 doesn't matter. It's just that I'd compiled google
benchmark with 4.8, and then wanted to test this behavior with 5.4 and 6.2. It
has no impact on the generated assembly as far as I could tell.

[Bug target/78176] [MIPS] miscompiles ldxc1 with large pointers on 32-bits

2016-11-03 Thread matthew.fortune at imgtec dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78176

Matthew Fortune  changed:

   What|Removed |Added

 CC||matthew.fortune at imgtec dot 
com

--- Comment #5 from Matthew Fortune  ---
I'm struggling to see what can be fixed in GCC for this (and I'm not sure I
follow why there is a problem with GCC's behaviour) but...

The issue may stem from the C front end where the dumps start off as below.
Note that the '-1' in kappa-1 has ended up being represented as 1073741823
(0x3fff) presumably owing to the fact it will be multiplied by 4 eventually
and hence be 'safe'. I can't figure out so far what creates this value but the
behavior started some time between gcc 4.7 and 4.8 I believe. The questionably
bad code then shows up dependent on optimisations and instruction availability.
If the calculation had been done with ADDU instead of in the LDXC1 then all
would be well.

Regardless of whether this is a real bug for the compiler then the Linux kernel
should be making use of the status.UX bit in order to properly emulate a 32-bit
environment for o32 on 64-bit kernel/hardware and had this been run using a
32-bit kernel (on 64-bit hardware) then it would run correctly. There is an
issue for N32 code with the UX bit in that you also need the PX bit available
to independently control 64-bit instruction availability vs address space but
this is only missing in MIPSIV cores.

;; Function ldxc1_test (null)
;; enabled by -tree-original


{
  int kappa2 = kappa;
  double tmp = 0.0;

int kappa2 = kappa;
double tmp = 0.0;
  :;
  kappa-- ;
  if (zeros + 1 < kappa)
{
  tmp = *(*(r->rows + ((sizetype) kappa + 1073741823) * 4) + ((sizetype)
kappa + 536870911) * 8) * ctt;
  tmp = ldexp (tmp, *(expo + ((sizetype) kappa + 1073741823) * 4) - *(expo
+ (sizetype) ((unsigned int) kappa2 * 4)));
}
  if (zeros + 1 < kappa && *(s + ((sizetype) kappa + 536870911) * 8) <= tmp)
goto ; else goto ;
  :;
  return tmp;

[Bug bootstrap/77993] [7 regression] bootstrap failure on PowerPC/Linux

2016-11-03 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77993

--- Comment #11 from Eric Botcazou  ---
> Revised proposed patch to fix the problem without syntax error

This one fixes the bootstrap failure.  Testsuite running...

[Bug rtl-optimization/78186] [7 Regression] FAIL: gcc.c-torture/execute/bf64-1.c execution test because of revision 241664

2016-11-03 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78186

Segher Boessenkool  changed:

   What|Removed |Added

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

--- Comment #6 from Segher Boessenkool  ---
Fixed.  If there are any other problems exposed by this patch, please
open a new PR.

[Bug rtl-optimization/78186] [7 Regression] FAIL: gcc.c-torture/execute/bf64-1.c execution test because of revision 241664

2016-11-03 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78186

--- Comment #5 from Segher Boessenkool  ---
Author: segher
Date: Thu Nov  3 16:04:22 2016
New Revision: 241824

URL: https://gcc.gnu.org/viewcvs?rev=241824=gcc=rev
Log:
combine lhs zero_extract fix (PR78186)


PR rtl-optimization/78186
* combine.c (change_zero_ext): Mask the RHS of a zero_extract as
well, when converting to IOR.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c

[Bug driver/78196] [7 Regression] GCC self-test breaks native Windows x86 builds

2016-11-03 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

--- Comment #3 from tnfchris at gcc dot gnu.org ---
There's actually a very simple fix for this :)

I should be able to post it tomorrow! Regressions are running now so I can.

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #59 from wilco at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #58)
> (In reply to wilco from comment #57)
> > (In reply to Bernd Edlinger from comment #56)
> > > Agreed, I can split the patch.
> > > 
> > > From what I understand, we should never emit ldrd/strd out of
> > > the memmovdi2 pattern when optimizing for speed and disable
> > > the peephole in the way I proposed it in the patch.
> > 
> > No that's incorrect. Not generating LDRD when optimizing for speed means a
> > slowdown on most cores, so it is essential we keep generating LDRD whenever
> > possible.
> 
> But if that is true, the current setting of prefer_lrdr_strd is wrong
> in most cores, and should be fixed.

The meaning is really: "prefer using ldrd/strd over ldm/stm in function
prolog/epilog and inlined memcpy". So it says something about performance of
large LDMs vs multiple LDRDs, rather than about performance of a single LDRD vs
2x LDR (basically LDRD doubles available memory bandwidth so is pretty much
always a good idea). And yes I wouldn't be surprised if the setting is
non-optimal for some cores.

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #57 from wilco at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #56)
> (In reply to wilco from comment #55)
> > (In reply to Bernd Edlinger from comment #39)
> > > Created attachment 39940 [details]
> > > proposed patch, v2
> > > 
> > > last upload was accidentally truncated.
> > > uploaded the right patch.
> > 
> > Right so looking at your patch, I think we should make the LDRD peephole
> > change in a separate patch. I tried your foo example on all combinations of
> > ARM, Thumb-2, VFP, NEON on various CPUs with both settings of
> > prefer_ldrd_strd.
> > 
> > In all cases the current GCC generates LDRD/STRD, even for zero offsets.
> > CPUs where prefer_ldrd_strd=false emit LDR/STR for the shifts with
> > -msoft-float or -mfpu=vfp (but not -mfpu=neon). This is clearly incorrect
> > given that LDRD/STRD is used in all other cases, and prefer_ldrd_strd seems
> > to imply whether to prefer using LDRD/STRD in prolog/epilog and inlined
> > memcpy.
> > 
> > So that means we should remove the odd checks for codesize and
> > current_tune->prefer_ldrd_strd from all the peepholes.
> 
> Agreed, I can split the patch.
> 
> From what I understand, we should never emit ldrd/strd out of
> the memmovdi2 pattern when optimizing for speed and disable
> the peephole in the way I proposed it in the patch.

No that's incorrect. Not generating LDRD when optimizing for speed means a
slowdown on most cores, so it is essential we keep generating LDRD whenever
possible.

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #58 from Bernd Edlinger  ---
(In reply to wilco from comment #57)
> (In reply to Bernd Edlinger from comment #56)
> > Agreed, I can split the patch.
> > 
> > From what I understand, we should never emit ldrd/strd out of
> > the memmovdi2 pattern when optimizing for speed and disable
> > the peephole in the way I proposed it in the patch.
> 
> No that's incorrect. Not generating LDRD when optimizing for speed means a
> slowdown on most cores, so it is essential we keep generating LDRD whenever
> possible.

But if that is true, the current setting of prefer_lrdr_strd is wrong
in most cores, and should be fixed.

[Bug tree-optimization/77848] Gimple if-conversion results in redundant comparisons

2016-11-03 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77848

--- Comment #3 from Bill Schmidt  ---
Just got back to looking at this.  I've implemented this suggestion and it
seems to work well for the most part; it solves the poor code generation we
were seeing on this test case, and most of the test suite passes.  I am seeing
a couple of failures, though.

The one I'm investigating now is gcc.dg/vect/bb-slp-cond-1.c.  When not
versioning the loop, SLP vectorization succeeds.  When versioning the loop, an
identical loop under the vectorization check is not vectorized for SLP.

Looking at the vectorization detail dump, it appears that the blocks in the
if-converted loop are not visited when the loop is versioned.  Only the blocks
in the original fallback loop are visited, which of course cannot be vectorized
since only if-conversion allows vectorization to take place.

I'll dig into it further, but I'm wondering if anyone has seen this sort of
behavior before, and can give me an idea what to look for.  I wonder if
versioning can leave the loop with a stale DFS numbering or something similar.

Any help appreciated!

Bill

[Bug driver/78196] [7 Regression] GCC self-test breaks native Windows x86 builds

2016-11-03 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

--- Comment #2 from David Malcolm  ---
Sorry for the breakage.

There seem to be two parts to this bug:

(a) allow building with /dev/null on Windows, by having the driver pick a
better name for the .s file.  (
https://msdn.microsoft.com/en-us/library/aa365247.aspx seems to be the official
docs on valid filenames on Windows ).

(b) fix the build.  Obviously this can be hacked around locally e.g. by
removing "s-selftest" from "selftest" in gcc/Makefile.in.  If (a) is hard to
fix, we could pick a different source file e.g. have an "empty.c", and pass
that in instead (this would avoid the need for the "-xc" also).

[Bug fortran/78122] [5/6/7 Regression] ICE in get, at cgraph.h:395

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78122

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #2 from Martin Liška  ---
Not being a fortran expert, however ifort rejects the source code:

/tmp/pi.f90(5): error #6592: This symbol must be a defined parameter, an
enumerator, or an argument of an inquiry function that evaluates to a
compile-time constant.   [A]
real, pointer :: p => a
--^
/tmp/pi.f90(5): error #6973: This is not a valid initialization expression.  
[A]
real, pointer :: p => a
--^

Problem is that symtab_node::get is called for a local symbol.

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #56 from Bernd Edlinger  ---
(In reply to wilco from comment #55)
> (In reply to Bernd Edlinger from comment #39)
> > Created attachment 39940 [details]
> > proposed patch, v2
> > 
> > last upload was accidentally truncated.
> > uploaded the right patch.
> 
> Right so looking at your patch, I think we should make the LDRD peephole
> change in a separate patch. I tried your foo example on all combinations of
> ARM, Thumb-2, VFP, NEON on various CPUs with both settings of
> prefer_ldrd_strd.
> 
> In all cases the current GCC generates LDRD/STRD, even for zero offsets.
> CPUs where prefer_ldrd_strd=false emit LDR/STR for the shifts with
> -msoft-float or -mfpu=vfp (but not -mfpu=neon). This is clearly incorrect
> given that LDRD/STRD is used in all other cases, and prefer_ldrd_strd seems
> to imply whether to prefer using LDRD/STRD in prolog/epilog and inlined
> memcpy.
> 
> So that means we should remove the odd checks for codesize and
> current_tune->prefer_ldrd_strd from all the peepholes.

Agreed, I can split the patch.

From what I understand, we should never emit ldrd/strd out of
the memmovdi2 pattern when optimizing for speed and disable
the peephole in the way I proposed it in the patch.

[Bug debug/78191] [7 regression] ICE in calc_die_sizes

2016-11-03 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78191

--- Comment #4 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #3 from Jakub Jelinek  ---
> Created attachment 39954
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39954=edit
> gcc7-pr78191.patch

With this patch, an i386-pc-solaris2.10 bootstrap has just completed
successfully.

Thanks.
Rainer

[Bug target/78199] New: [PowerPC] Missing optimization for local-exec TLS model

2016-11-03 Thread sebastian.hu...@embedded-brains.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78199

Bug ID: 78199
   Summary: [PowerPC] Missing optimization for local-exec TLS
model
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sebastian.hu...@embedded-brains.de
  Target Milestone: ---

The following test case:

extern __thread int i;

extern int s;

int fi(void)
{
return i;
}

int fs(void)
{
return s;
}

generates:

powerpc-rtems4.12-gcc -O2 -S -ftls-model=local-exec tls.c -o -
.file   "tls.c"
.machine ppc
.section".text"
.align 2
.globl fi
.type   fi, @function
fi:
addis 9,2,i@tprel@ha
addi 9,9,i@tprel@l
lwz 3,0(9)
blr
.size   fi, .-fi
.align 2
.globl fs
.type   fs, @function
fs:
lis 9,s@ha
lwz 3,s@l(9)
blr
.size   fs, .-fs
.ident  "GCC: (GNU) 7.0.0 20161103 (experimental) [master revision
bad2001:22427cc:8c7ce92980721624d9f2ac6332fe34188d09b851]"

This can be optimized to:

fi:
lis 9,2,i@tprel@ha
lwz 9,i@tprel@l(2)
blr

This issue seems to be target specific, for example:

gcc -O2 -S -ftls-model=local-exec tls.c -o -
.file   "tls.c"
.text
.p2align 4,,15
.globl  fi
.type   fi, @function
fi:
.LFB0:
.cfi_startproc
movl%fs:i@tpoff, %eax
ret
.cfi_endproc
.LFE0:
.size   fi, .-fi
.p2align 4,,15
.globl  fs
.type   fs, @function
fs:
.LFB1:
.cfi_startproc
movls(%rip), %eax
ret
.cfi_endproc
.LFE1:
.size   fs, .-fs
    .ident  "GCC: (GNU) 7.0.0 20161103 (experimental) [master revision
bad2001:22427cc:8c7ce92980721624d9f2ac6332fe34188d09b851]"
.section.note.GNU-stack,"",@progbits

However:

gcc -O2 -S -ftls-model=local-exec tls.c -o -
.file   "tls.c"
.text
.p2align 4,,15
.globl  fi
.type   fi, @function
fi:
.LFB0:
.cfi_startproc
movq%fs:0, %rax
movli@tpoff(%rax), %eax
ret
.cfi_endproc
.LFE0:
.size   fi, .-fi
.p2align 4,,15
.globl  fs
.type   fs, @function
fs:
.LFB1:
.cfi_startproc
movls(%rip), %eax
ret
.cfi_endproc
.LFE1:
.size   fs, .-fs
.ident  "GCC: (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision
202388]"
.section.note.GNU-stack,"",@progbits

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-11-03 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #55 from wilco at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #39)
> Created attachment 39940 [details]
> proposed patch, v2
> 
> last upload was accidentally truncated.
> uploaded the right patch.

Right so looking at your patch, I think we should make the LDRD peephole change
in a separate patch. I tried your foo example on all combinations of ARM,
Thumb-2, VFP, NEON on various CPUs with both settings of prefer_ldrd_strd.

In all cases the current GCC generates LDRD/STRD, even for zero offsets. CPUs
where prefer_ldrd_strd=false emit LDR/STR for the shifts with -msoft-float or
-mfpu=vfp (but not -mfpu=neon). This is clearly incorrect given that LDRD/STRD
is used in all other cases, and prefer_ldrd_strd seems to imply whether to
prefer using LDRD/STRD in prolog/epilog and inlined memcpy.

So that means we should remove the odd checks for codesize and
current_tune->prefer_ldrd_strd from all the peepholes.

[Bug gcov-profile/65831] gcov does not output 0% coverage files

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65831

--- Comment #6 from Martin Liška  ---
Backport has been done to both active branches.

[Bug bootstrap/77768] [7 Regression] LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0: internal compiler error: Segmentation fault

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77768

--- Comment #14 from Richard Biener  ---
Author: rguenth
Date: Thu Nov  3 13:25:51 2016
New Revision: 241818

URL: https://gcc.gnu.org/viewcvs?rev=241818=gcc=rev
Log:
2016-11-03  Richard Biener  

Backport from mainline
2016-09-29  Richard Biener  

PR tree-optimization/77768
* tree-ssa-sccvn.c (visit_reference_op_store): Properly deal
with stores to a place we know has a constant value.
* tree-vrp.c (set_defs_to_varying): New helper avoiding
writing to vr_const_varying.
(vrp_initialize): Call it.
(vrp_visit_stmt): Likewise.
(evrp_dom_walker::before_dom_children): Likewise.
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Handle stores to readonly memory when removing redundant stores.

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

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77768.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-ssa-pre.c
branches/gcc-6-branch/gcc/tree-ssa-sccvn.c
branches/gcc-6-branch/gcc/tree-vrp.c

[Bug bootstrap/78195] [6 Regression] Profiledbootstrap broken

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78195

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Richard Biener  ---
Duplicate.

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

[Bug bootstrap/77768] [7 Regression] LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0: internal compiler error: Segmentation fault

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77768

--- Comment #13 from Richard Biener  ---
*** Bug 78195 has been marked as a duplicate of this bug. ***

[Bug bootstrap/77993] [7 regression] bootstrap failure on PowerPC/Linux

2016-11-03 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77993

Michael Meissner  changed:

   What|Removed |Added

  Attachment #39951|0   |1
is obsolete||

--- Comment #10 from Michael Meissner  ---
Created attachment 39956
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39956=edit
Revised proposed patch to fix the problem without syntax error

This patch adds the () to avoid the &&/|| need parenthesis warning.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #13 from Richard Biener  ---
Testcase is alongside

int a;
static void __attribute__((noinline)) foo () { a = 1; }
static void __attribute__((noinline)) foo2 () { a = 2; }

struct X
{
  virtual void bar (int i) { if (!i) { foo (); __builtin_abort (); } }
};

void baz (int i)
{
  if (!i)
 { foo2 (); __builtin_abort (); }
}

X xx;

which should make both foo and foo2 .text.unlikely and ipa-comdat should
move foo into bars comdat group.

On x86_64-linux it happens that we can have both .text.unlikely and comdat
membership:

.section   
.text.unlikely._ZL3foov,"axG",@progbits,_ZN1X3barEi,comdat
.type   _ZL3foov, @function
_ZL3foov:
.LFB0:
.cfi_startproc
movl$1, a(%rip)
ret

and it doesn't conflict with:

.section.text.unlikely,"ax",@progbits
.type   _ZL4foo2v, @function
_ZL4foo2v:
.LFB1:
.cfi_startproc
movl$2, a(%rip)
ret
.cfi_endproc


With the cross to AIX I get

./../trunk-g/gcc/t.C: In function ‘void foo2()’:
../../trunk-g/gcc/t.C:3:39: error: void foo2() causes a section type conflict
with void foo()
 static void __attribute__((noinline)) foo2 () { a = 2; }
   ^~~~
../../trunk-g/gcc/t.C:2:39: note: ‘void foo()’ was declared here
 static void __attribute__((noinline)) foo () { a = 1; }
   ^~~

[Bug libgcc/78067] liggcc2 calls count_leading_zero with 0

2016-11-03 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78067

Bernd Edlinger  changed:

   What|Removed |Added

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

--- Comment #4 from Bernd Edlinger  ---
fixed.

[Bug fortran/69834] Collision in derived type hashes

2016-11-03 Thread paul.richard.thomas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69834

--- Comment #12 from paul.richard.thomas at gmail dot com  ---
Hi Dominique,

I was intending to backport to 6-branch but wanted to be sure that no
nasties come out of the woodwork on trunk.

Best regards

Paul

PS Will be back in France late tonight and will start picking up the
threads again. My Mother's death and funeral have taken up the last 10
days.

On 3 November 2016 at 11:15, dominiq at lps dot ens.fr
 wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69834
>
> Dominique d'Humieres  changed:
>
>What|Removed |Added
> 
>  Status|NEW |WAITING
>
> --- Comment #11 from Dominique d'Humieres  ---
> Paul,
>
> Are you planning to back port r241450? If no, is there any reason to keep this
> PR open?
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
> You reported the bug.

[Bug libgcc/78067] liggcc2 calls count_leading_zero with 0

2016-11-03 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78067

--- Comment #3 from Bernd Edlinger  ---
Author: edlinger
Date: Thu Nov  3 12:52:19 2016
New Revision: 241817

URL: https://gcc.gnu.org/viewcvs?rev=241817=gcc=rev
Log:
2016-11-03  Bernd Edlinger  

PR libgcc/78067
* libgcc2.c (__floatdisf, __floatdidf): Avoid undefined results from
count_leading_zeros.

testsuite:
2016-11-03  Bernd Edlinger  

PR libgcc/78067
* gcc.dg/torture/fp-int-convert.h: Add more conversion tests.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
trunk/libgcc/ChangeLog
trunk/libgcc/libgcc2.c

[Bug target/78056] [7 Regression] build failure on Power7

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78056

David Edelsohn  changed:

   What|Removed |Added

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

--- Comment #19 from David Edelsohn  ---
Fixed.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #12 from Richard Biener  ---
Breakpoint 8, symtab_node::set_comdat_group (this=0x2f05ea10, 
group=)
at /space/rguenther/src/gcc-git/gcc/cgraph.h:218
218|| DECL_P (group));
(gdb) p this->decl
$17 = 

from IPA comdat.

Now trying to reduce the testcase.

[Bug middle-end/22141] [5/6/7 Regression] Missing optimization when storing structures

2016-11-03 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=22141

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|5.5 |7.0

--- Comment #39 from ktkachov at gcc dot gnu.org ---
Adjusting target milestone for bookkeeping.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #11 from Richard Biener  ---
Ok, I can reproduce it with the cross now.  -O2 -fno-exceptions.  I'll try to
reduce.

(gdb) p debug_tree (decl)
 named.decl)
 common.flags
$5 = 0x300102
(gdb) p/x flags
$6 = 0x200902

SECTION_DECLARED is missing (doesn't matter) but SECTION_LINKONCE is set which
is what causes the error.  The named section is 'text.unlikely'.

We get that flags from

422   flags = targetm.section_type_flags (decl, name, reloc);
423   return get_section (name, flags, decl);

which in turn gets it from default_section_type_flags which adds
SECTION_LINKONCE because

  if (decl && DECL_P (decl) && DECL_COMDAT_GROUP (decl))
flags |= SECTION_LINKONCE;

but there is no DECL_COMDAT_GROUP for the gimple_ops function decl.

Note we assign the section name in default_function_section.  So this seems to
be a general issue somehow.  Honza?  How is this situation avoided on other
targets?

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #10 from David Edelsohn  ---
The get_create() change does change the section_type_conflict on AIX.

[Bug other/78196] [7 Regression] GCC self-test breaks native Windows builds

2016-11-03 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

--- Comment #1 from tnfchris at gcc dot gnu.org ---
Just to clarify, I mean the native Windows x86 build.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #9 from David Edelsohn  ---
Any difference if you force more GC? AIX has a different process address space
layout and has much more aggressive memory reclamation in malloc/free.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #8 from David Edelsohn  ---
Reading specs from /edelsohn/RICHI/./prev-gcc/specs
COLLECT_GCC=/edelsohn/RICHI/./prev-gcc/xg++
Target: powerpc-ibm-aix7.2.0.0
Configured with: /nasfarm/edelsohn/src/sandbox/configure --disable-werror
--enable-languages=c,c++,fortran,objc
--with-gmp=/gsa/yktgsa/home/e/d/edelsohn/install
--with-isl=/gsa/yktgsa/home/e/d/edelsohn/install
--with-libiconv-prefix=/gsa/yktgsa/home/e/d/edelsohn/install
--disable-libstdcxx-pch --with-included-gettext
Thread model: aix
gcc version 7.0.0 20161102 (experimental) [trunk revision 241798] (GCC) 
COLLECT_GCC_OPTIONS='-B' '/edelsohn/RICHI/./prev-gcc/' '-B'
'/usr/local/powerpc-ibm-aix7.2.0.0/bin/' '-nostdinc++' '-B'
'/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/src/.libs' '-B'
'/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/libsupc++/.libs' '-I'
'/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/include/powerpc-ibm-aix7.2.0.0'
'-I' '/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/include' '-I'
'/nasfarm/edelsohn/src/sandbox/libstdc++-v3/libsupc++'
'-L/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/src/.libs'
'-L/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/libsupc++/.libs'
'-fno-PIE' '-c' '-g' '-O2' '-D' 'IN_GCC' '-fno-exceptions' '-fno-rtti'
'-fasynchronous-unwind-tables' '-Wextra' '-Wall' '-Wno-narrowing'
'-Wwrite-strings' '-Wcast-qual' '-Wsuggest-attribute=format'
'-Woverloaded-virtual' '-Wpedantic' '-Wno-long-long' '-Wno-variadic-macros'
'-Wno-overlength-strings' '-fno-common' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I' '.'
'-I' '/nasfarm/edelsohn/src/sandbox/gcc' '-I'
'/nasfarm/edelsohn/src/sandbox/gcc/.' '-I'
'/nasfarm/edelsohn/src/sandbox/gcc/../include' '-I' './../intl' '-I'
'/nasfarm/edelsohn/src/sandbox/gcc/../libcpp/include' '-I'
'/gsa/yktgsa/home/e/d/edelsohn/install/include' '-I'
'/nasfarm/edelsohn/src/sandbox/gcc/../libdecnumber' '-I'
'/nasfarm/edelsohn/src/sandbox/gcc/../libdecnumber/dpd' '-I' '../libdecnumber'
'-I' '/nasfarm/edelsohn/src/sandbox/gcc/../libbacktrace' '-I'
'/gsa/yktgsa/home/e/d/edelsohn/install/include' '-I'
'/gsa/yktgsa/home/e/d/edelsohn/install/include' '-o' 'tree-ssa-sccvn.o' '-MT'
'tree-ssa-sccvn.o' '-MMD' '-MP' '-MF' './.deps/tree-ssa-sccvn.TPo' '-v'
'-shared-libgcc'

 /edelsohn/RICHI/./prev-gcc/cc1plus -quiet -nostdinc++ -v -I
/edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/include/powerpc-ibm-aix7.2.0.0
-I /edelsohn/RICHI/prev-powerpc-ibm-aix7.2.0.0/libstdc++-v3/include -I
/nasfarm/edelsohn/src/sandbox/libstdc++-v3/libsupc++ -I . -I . -I
/nasfarm/edelsohn/src/sandbox/gcc -I /nasfarm/edelsohn/src/sandbox/gcc/. -I
/nasfarm/edelsohn/src/sandbox/gcc/../include -I ./../intl -I
/nasfarm/edelsohn/src/sandbox/gcc/../libcpp/include -I
/gsa/yktgsa/home/e/d/edelsohn/install/include -I
/nasfarm/edelsohn/src/sandbox/gcc/../libdecnumber -I
/nasfarm/edelsohn/src/sandbox/gcc/../libdecnumber/dpd -I ../libdecnumber -I
/nasfarm/edelsohn/src/sandbox/gcc/../libbacktrace -I
/gsa/yktgsa/home/e/d/edelsohn/install/include -I
/gsa/yktgsa/home/e/d/edelsohn/install/include -iprefix
/edelsohn/RICHI/prev-gcc/../lib/gcc/powerpc-ibm-aix7.2.0.0/7.0.0/ -isystem
/edelsohn/RICHI/./prev-gcc/include -isystem
/edelsohn/RICHI/./prev-gcc/include-fixed -MMD tree-ssa-sccvn.d -MF
./.deps/tree-ssa-sccvn.TPo -MP -MT tree-ssa-sccvn.o -D_ALL_SOURCE
-D__COMPATMATH__ -D IN_GCC -D HAVE_CONFIG_H
/nasfarm/edelsohn/src/sandbox/gcc/tree-ssa-sccvn.c -quiet -dumpbase
tree-ssa-sccvn.c -auxbase-strip tree-ssa-sccvn.o -g -O2 -Wextra -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wsuggest-attribute=format
-Woverloaded-virtual -Wpedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -version -fno-PIE -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -fno-common -o /tmp//ccrLceWm.s
GNU C++14 (GCC) version 7.0.0 20161102 (experimental) [trunk revision 241798]
(powerpc-ibm-aix7.2.0.0)

[Bug c++/78198] ICE on valid code in: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:203

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78198

--- Comment #2 from Martin Liška  ---
Created attachment 39955
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39955=edit
test-case

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #7 from Richard Biener  ---
Same w/o -g.

#2  0x014f17a3 in rs6000_xcoff_declare_object_name (file=0x25634c0, 
name=0x2cd771b0 "*LDFCM..0", decl=)
at /space/rguenther/src/gcc-git/gcc/config/rs6000/rs6000.c:35418
35418, true);
(gdb) l
35413   {
35414 struct declare_alias_data data = {file, false};
35415 RS6000_OUTPUT_BASENAME (file, name);
35416 fputs (":\n", file);
35417 symtab_node::get (decl)->call_for_symbol_and_aliases
(rs6000_declare_alias,
35418, true);
35419   }

symtab_node::get (decl) returns NULL.

(gdb) p debug_tree (decl)
 >
sizes-gimplified public unsigned type_6 SI
size 
unit size 
align 32 symtab 0 alias set 105 canonical type 0x2c0462a0
pointer_to_this  reference_to_this
>
readonly asm_written static unsigned ignored SI file (null) line 0 col 0
size  unit size 
align 32 initial 
(mem/u/f/c:SI (symbol_ref:SI ("*LDFCM..0") [flags 0x2] ) [105 *LDFCM..0+0 S4 A32])>

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 49985f1..72e0f0c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -35414,7 +35414,7 @@ rs6000_xcoff_declare_object_name (FILE *file, const
char *name, tree decl)
   struct declare_alias_data data = {file, false};
   RS6000_OUTPUT_BASENAME (file, name);
   fputs (":\n", file);
-  symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias,
+  symtab_node::get_create (decl)->call_for_symbol_and_aliases
(rs6000_declare_alias,
, true);
 }


fixes this ICE.  But then compilation goes through w/o hitting the
section type conflict.

[Bug c++/78198] New: ICE on valid code in: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:203

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78198

Bug ID: 78198
   Summary: ICE on valid code in: tree check: expected record_type
or union_type or qual_union_type, have
template_type_parm in lookup_base, at cp/search.c:203
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Running:
$ g++  -std=gnu++11 x.ii -Wno-invalid-offsetof -c 


 JS_DECLARE_NEW_METHODS(js_new, js_malloc, static MOZ_ALWAYS_INLINE)
   
   
^ 
0x1062efc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9746
0x81661d tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
../../gcc/tree.h:3085
0x81661d lookup_base(tree_node*, tree_node*, int, base_kind*, int)
../../gcc/cp/search.c:203
0x67c3a5 build_user_type_conversion_1
../../gcc/cp/call.c:3699
0x67d46d implicit_conversion
../../gcc/cp/call.c:1875
0x679b60 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
../../gcc/cp/call.c:9968
0x67474b convert_default_arg(tree_node*, tree_node*, tree_node*, int, int)
../../gcc/cp/call.c:7234
0x67509e build_over_call
../../gcc/cp/call.c:7802
0x68215f build_new_method_call_1
../../gcc/cp/call.c:8746
0x68215f build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
../../gcc/cp/call.c:8816
0x68312e build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int)
../../gcc/cp/call.c:8348
0x801da7 build_new_1
../../gcc/cp/init.c:3232
0x802705 build_new(vec**, tree_node*, tree_node*,
vec**, int, int)
../../gcc/cp/init.c:3494
0x6ee15b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:16563
0x6ed269 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:16905
0x6e3ab3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:15984
0x6e3535 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:15281
0x6e3344 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:15271
0x6e3074 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:15462
0x725eb5 instantiate_decl(tree_node*, int, bool)
../../gcc/cp/pt.c:22269
Please submit a full bug report,

causes ICE on a valid code.

[Bug c++/78198] ICE on valid code in: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:203

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78198

--- Comment #1 from Martin Liška  ---
Started with r241765, I'm reducing the testcase.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #6 from Richard Biener  ---
Can you also share -v output of the failing command?  With just -O2 -g and a
cross from x86_64-linux to powerpc-ibm-aix7.1 I get

obj-ppc-aix/gcc> ./cc1plus  -quiet t.ii -O2 -g
/nasfarm/edelsohn/src/sandbox/gcc/tree-ssa-sccvn.c:4986:1: internal compiler
error: Segmentation fault
0x10d0aa4 crash_signal
/space/rguenther/src/gcc-git/gcc/toplev.c:338
0x14e665e rs6000_declare_alias
/space/rguenther/src/gcc-git/gcc/config/rs6000/rs6000.c:35248
0xb973fa symtab_node::call_for_symbol_and_aliases(bool (*)(symtab_node*,
void*), void*, bool)
/space/rguenther/src/gcc-git/gcc/cgraph.h:3116
0x14e6f52 rs6000_xcoff_declare_object_name(_IO_FILE*, char const*, tree_node*)
/space/rguenther/src/gcc-git/gcc/config/rs6000/rs6000.c:35413
0x1475fba assemble_variable_contents
/space/rguenther/src/gcc-git/gcc/varasm.c:2058
0x1476b84 assemble_variable(tree_node*, int, int, int)
/space/rguenther/src/gcc-git/gcc/varasm.c:2252
0xc054d0 dw2_output_indirect_constant_1
/space/rguenther/src/gcc-git/gcc/dwarf2asm.c:939
0xc055fe dw2_output_indirect_constants()
/space/rguenther/src/gcc-git/gcc/dwarf2asm.c:961
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/78197] Stack layout strangeness on AIX and Power

2016-11-03 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78197

--- Comment #1 from Dominik Vogt  ---
(... does it use a different condition *on purrpose* ...)

[Bug ada/78175] segfault/assertion failure on package instantiation

2016-11-03 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78175

Eric Botcazou  changed:

   What|Removed |Added

 Target|x86_64-*-*  |
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-11-03
 CC||ebotcazou at gcc dot gnu.org
Summary|[Ada] Storage_Error stack   |segfault/assertion failure
   |overflow or erroneous   |on package instantiation
   |memory access   |
 Ever confirmed|0   |1
  Known to fail||5.4.1, 6.2.1, 7.0

--- Comment #2 from Eric Botcazou  ---
Confirmed as an assertion failure on mainline:

eric@polaris:~/build/gcc/native> ~/install/gcc/bin/gcc -c list_words.adb 
+===GNAT BUG DETECTED==+
| 7.0.0 20161103 (experimental) [trunk revision 241808] (x86_64-suse-linux) |
| Assert_Failure einfo.adb:1402|
| Error detected at list_words.adb:26:4

[Bug debug/78191] [7 regression] ICE in calc_die_sizes

2016-11-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78191

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 39954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39954=edit
gcc7-pr78191.patch

The bug is specific I think just to -gdwarf-{2,3} -gno-strict-dwarf, where
DW_FORM_exprloc can't be used for location expressions and some location
expression contains DW_OP_GNU_{{const,regval,deref}_type,convert,reinterpret}
and there are at least 128 die abbreviations used by more than one DIE.
Because of the lack of DW_FORM_exprloc we need to decide on
DW_FORM_block{1,2,4} and size the location expression, for that we need to know
the DIE offsets of base offset DIEs that are referenced and for that their size
and their abbreviation values need to be constant, so the optimize_abbrev_table
opts that reorder abbreviation numbers by decreasing usage count or for
-gdwarf-5 attempt to optimize implicit constants can't be done for the CU and
base types.
For -gdwarf-4 and above, we can emit DW_FORM_exprloc, so value_format doesn't
need to compute any sizes and thus calc_base_type_die_sizes shouldn't be
called.

[Bug bootstrap/77993] [7 regression] bootstrap failure on PowerPC/Linux

2016-11-03 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77993

--- Comment #9 from Eric Botcazou  ---
> Eric, if you could try it in your environment to see if it solves the
> problem, it would be helpful.

It doesn't fly:

/work/botcazou/gcc-head/src/gcc/config/rs6000/rs6000.md:7525:33: note: in
expansion of macro 'FLOAT128_IBM_P'
&& TARGET_LONG_DOUBLE_128 && FLOAT128_IBM_P (mode)"
 ^~
/work/botcazou/gcc-head/src/gcc/config/rs6000/rs6000.h:453:8: error: suggest
parentheses around '&&' within '||' [-Werror=parentheses]
&& ((MODE) == IFmode) || ((MODE) == ICmode)))
/work/botcazou/gcc-head/src/gcc/config/rs6000/rs6000.md:505:2: note: in
expansion of macro 'FLOAT128_IBM_P'
 (define_mode_iterator IBM128 [(IF "FLOAT128_IBM_P (IFmode)")
  ^~
cc1plus: all warnings being treated as errors
make[3]: *** [build/gencondmd.o] Error 1

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #5 from David Edelsohn  ---
Created attachment 39953
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39953=edit
Pre-processed tree-ssa-sccvn.c

[Bug other/78196] [7 Regression] GCC self-test breaks native Windows builds

2016-11-03 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

tnfchris at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-11-03
 CC||tnfchris at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |tnfchris at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug bootstrap/78195] [6 Regression] Profiledbootstrap broken

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78195

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-11-03
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Oh, I forgot to backport a followup.

2016-09-29  Richard Biener  

PR tree-optimization/77768
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Handle stores to readonly memory when removing redundant stores.

and others for that PR.

[Bug target/78056] [7 Regression] build failure on Power7

2016-11-03 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78056

--- Comment #18 from Dominik Vogt  ---
Seems to be fixed.

[Bug target/78197] New: Stack layout strangeness on AIX and Power

2016-11-03 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78197

Bug ID: 78197
   Summary: Stack layout strangeness on AIX and Power
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vogt at linux dot vnet.ibm.com
CC: dje at gcc dot gnu.org
  Target Milestone: ---
Target: AIX, Power

The file rs6000.h contains the macros

--
#define STACK_BOUNDARY  \
  ((TARGET_32BIT && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI && !TARGET_VSX) \
? 64 : 128)

#define STARTING_FRAME_OFFSET   \
  (FRAME_GROWS_DOWNWARD \
   ? 0  \
   : (RS6000_ALIGN (crtl->outgoing_args_size,   \
(TARGET_ALTIVEC || TARGET_VSX) ? 16 : 8)\
  + RS6000_SAVE_AREA))

#define STACK_DYNAMIC_OFFSET(FUNDECL)   \
  (RS6000_ALIGN (crtl->outgoing_args_size,  \
 (TARGET_ALTIVEC || TARGET_VSX) ? 16 : 8)   \
   + (STACK_POINTER_OFFSET))
--

Does STACK_BOUNDARY use a different conditions to decide betweeen 8 and 16 byte
alignment than the other two macros?  In aix.h, STACK_BOUNDARY is hard coded to
128, so at least on AIX these conditions seem to be broken.

[Bug pch/63319] [5 Regression] ICE: Segmentation fault building qt5 with pch

2016-11-03 Thread linux at carewolf dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63319

Allan Jensen  changed:

   What|Removed |Added

 CC||linux at carewolf dot com

--- Comment #12 from Allan Jensen  ---
There is a chance this has already been fixed. We recently ran into the issue
again, see https://bugreports.qt.io/browse/QTBUG-56817 but it only affects GCC
5.3.1. On Debian's gcc 5.4.1 version it works.

[Bug other/78196] [7 Regression] GCC self-test breaks native Windows builds

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

Richard Biener  changed:

   What|Removed |Added

   Keywords||build
 Target||mingw-w64
   Target Milestone|--- |7.0
Summary|GCC self-test breaks native |[7 Regression] GCC
   |Windows builds  |self-test breaks native
   ||Windows builds

[Bug bootstrap/77359] [7 Regression] AIX bootstrap failure due to alignment of stack pointer + STACK_DYNAMIC_OFFSET

2016-11-03 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77359

--- Comment #21 from Dominik Vogt  ---
Patch posted here:
https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00266.html

This needs to pass the AIX testsuite which I cannot run with the available
resources.

[Bug c/77876] -Wbool-operation rejects useful code involving '~'

2016-11-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77876

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-11-03
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Let me look into this.

[Bug other/78196] New: GCC self-test breaks native Windows builds

2016-11-03 Thread tamar.christina at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78196

Bug ID: 78196
   Summary: GCC self-test breaks native Windows builds
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tamar.christina at arm dot com
  Target Milestone: ---

The GCC self-test added in r237144 breaks the native Windows builds (e.g.
mingw-w64).

The test essentially does `-xc -S -c /dev/null -fself-test`

`/dev/null` is then converted into the Windows null device `nul` by the MSYS
shell, which is correct. But then the driver adds a filename to the name,
trying to write the output to `nul.s`. `nul` is a reserved filename on Windows.
As such it's invalid to create this file and the call always fails using
CreateFile.

This makes you unable to make native windows builds of GCC 7.

[Bug fortran/42913] [FIXME] Should gfc_conv_expr_descriptor be setting bounds correctly?

2016-11-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42913

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #1 from Dominique d'Humieres  ---
Is this still valid more than six years later?

[Bug fortran/69834] Collision in derived type hashes

2016-11-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69834

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #11 from Dominique d'Humieres  ---
Paul,

Are you planning to back port r241450? If no, is there any reason to keep this
PR open?

[Bug middle-end/65855] SCEV / SCCP missing optimization: triangular numbers

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855

Richard Biener  changed:

   What|Removed |Added

Summary|missing optimization:   |SCEV / SCCP missing
   |triangular numbers  |optimization: triangular
   ||numbers

--- Comment #7 from Richard Biener  ---
From the duplicate a related testcase:

int square(int x) {
  int result = 0;
  for (int i = 0; i < x; ++i)
result += x;
  return result;
}

is not optimized into return x * x; while llvm can do that.

[Bug middle-end/65855] missing optimization: triangular numbers

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855

Richard Biener  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #6 from Richard Biener  ---
*** Bug 78194 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/78194] Failure to optimize squaring

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78194

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener  ---
Even a duplicate I'd say.

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

[Bug tree-optimization/78194] Failure to optimize squaring

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78194

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-11-03
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Looks somewhat artificial (we do have a related bug I think where I played with
enhancing chrec_apply, PR65855).

That said, SCEV / SCCP is supposed to catch these things and chrec_apply is
where limited support comes in.

[Bug bootstrap/78195] [6 Regression] Profiledbootstrap broken

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78195

Richard Biener  changed:

   What|Removed |Added

 Target||x86_64-*-*, ppc64le-*-*,
   ||s390x-*-*
   Priority|P3  |P1
   Host|x86_64-*-*, ppc64le-*-*,|
   |s390x-*-*   |
   Target Milestone|--- |6.3

--- Comment #1 from Richard Biener  ---
Investigating.

[Bug bootstrap/78195] New: [6 Regression] Profiledbootstrap broken

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78195

Bug ID: 78195
   Summary: [6 Regression] Profiledbootstrap broken
   Product: gcc
   Version: 6.2.1
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-*-*, ppc64le-*-*, s390x-*-*

09:09 < richi> [15714s] ../../gcc/tree-vrp.c:10455:24: internal compiler error: 
   Segmentation fault
09:09 < richi> [15714s]virtual unsigned int execute (function *)

in stagefeedback

[Bug tree-optimization/78194] New: Failure to optimize squaring

2016-11-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78194

Bug ID: 78194
   Summary: Failure to optimize squaring
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

int square(int x) {
  int result = 0;
  for (int i = 0; i < x; ++i)
result += x;
  return result;
}
is not optimized into return x * x; while llvm can do that.

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #4 from Richard Biener  ---
So the error message at hand is

  /* Sanity check user variables for flag changes.  */
  if (sect->named.decl != NULL
  && DECL_P (sect->named.decl)
  && decl != sect->named.decl)
{
  if (decl != NULL && DECL_P (decl))
error ("%+D causes a section type conflict with %D",
   decl, sect->named.decl);

which means we have a named section created for gimple_ops and we are
requesting the same section for vn_valueize but the section flags requested
are different.

Note vn_valueize is used as callback and thus may have its address taken
while gimple_ops usually will not.

I'll first dig into what are the flag mismatches (once I reproduced the
FAIL).  I believe the issue should be reproducible with just preprocessed
source for tree-ssa-sccvn.c and thus we should be able to reduce a testcase
(and in turn make that less fragile with respect to inlining decisions).

[Bug bootstrap/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

--- Comment #3 from Richard Biener  ---
I believe we are chasing a latent bug that gets triggered by changes in inliner
behavior with respect to vn_valueize in tree-ssa-sccvn.c.  I hope to reproduce
on the CF machine.

[Bug rtl-optimization/78186] [7 Regression] FAIL: gcc.c-torture/execute/bf64-1.c execution test because of revision 241664

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78186

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0
Summary|FAIL:   |[7 Regression] FAIL:
   |gcc.c-torture/execute/bf64- |gcc.c-torture/execute/bf64-
   |1.c execution test because  |1.c execution test because
   |of revision 241664  |of revision 241664

[Bug tree-optimization/78189] [5/6/7 Regression] movaps generated for unaligned store in aligned struct, when struct is referenced via unaligned member.

2016-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78189

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-11-03
  Known to work||4.9.4
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |5.5
Summary|movaps generated for|[5/6/7 Regression] movaps
   |unaligned store in aligned  |generated for unaligned
   |struct, when struct is  |store in aligned struct,
   |referenced via unaligned|when struct is referenced
   |member. |via unaligned member.
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Mine.  Looks like we are confused by the MEM_REF offset:

MEM[(struct B *)misalignedPtr_1(D) + -8B].a.a

DR_BASE_ADDRESS is misalignedPtr_1, DR_INIT (used as 'misalign') is 16(OVF)
and DR_ALIGNED_TO is 128.  That looks good but then we go:

  /* To look at alignment of the base we have to preserve an inner MEM_REF
 as that carries alignment information of the actual access.  */
  base = ref;
  while (handled_component_p (base))
base = TREE_OPERAND (base, 0);
  if (TREE_CODE (base) == MEM_REF)
base = build2 (MEM_REF, TREE_TYPE (base), base_addr,
   build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)), 0));
  unsigned int base_alignment = get_object_alignment (base);

and that computes an aligned base (but doesn't factor in the misalignment
from the MEM_REF offset we just stripped).

[Bug rtl-optimization/78186] FAIL: gcc.c-torture/execute/bf64-1.c execution test because of revision 241664

2016-11-03 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78186

--- Comment #4 from amker at gcc dot gnu.org ---
(In reply to Segher Boessenkool from comment #3)
> Hi Bin,
> 
> Could you try this patch please?
> 
> ===
> diff --git a/gcc/combine.c b/gcc/combine.c
> index 7c21fe4..7ed0a62 100644
> --- a/gcc/combine.c
> +++ b/gcc/combine.c
> @@ -11224,6 +11224,9 @@ change_zero_ext (rtx pat)
>rtx x = gen_rtx_AND (mode, reg, immed_wide_int_const (mask, mode));
>rtx y = simplify_gen_binary (ASHIFT, mode, SET_SRC (pat),
>GEN_INT (offset));
> +  wide_int mask2 = wi::shifted_mask (offset, width, false, reg_width);
> +  y = simplify_gen_binary (AND, mode, y,
> +  immed_wide_int_const (mask2, mode));
>rtx z = simplify_gen_binary (IOR, mode, x, y);
>SUBST (SET_DEST (pat), reg);
>SUBST (SET_SRC (pat), z);
> ===

Hi Segher,

Thanks for the patch, it at least fixes:
FAIL: gcc.c-torture/execute/bf64-1.c -O1 execution test
FAIL: gcc.c-torture/execute/pr57130.c   -O1  execution test
FAIL: g++.dg/torture/vshuf-v8si.C -O2 execution test

It also changes behavior for:
FAIL: c-c++-common/torture/vector-compare-1.c   -O1  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -O2  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -O2 -flto
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -O3 -g  execution test
FAIL: c-c++-common/torture/vector-compare-1.c   -Os  execution test

But now I suspect there are other problems with it.

Thanks,
bin

[Bug c++/78193] [7 regression] g++.dg/concepts/inherit-ctor3.C etc. FAIL

2016-11-03 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78193

Rainer Orth  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug c++/78193] New: [7 regression] g++.dg/concepts/inherit-ctor3.C etc. FAIL

2016-11-03 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78193

Bug ID: 78193
   Summary: [7 regression] g++.dg/concepts/inherit-ctor3.C etc.
FAIL
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
CC: ebotcazou at gcc dot gnu.org, jason at gcc dot gnu.org
  Target Milestone: ---
  Host: sparc-sun-solaris2.12
Target: sparc-sun-solaris2.12
 Build: sparc-sun-solaris2.12

Between 20161101 (r241748) and 20161102 (r241801), a couple of testcases
began to FAIL on 32-bit (only) Solaris/SPARC:

+FAIL: g++.dg/concepts/inherit-ctor3.C   (internal compiler error)
+FAIL: g++.dg/concepts/inherit-ctor3.C   (test for excess errors)
+FAIL: g++.dg/cpp0x/inh-ctor20.C  -std=c++11 (internal compiler error)
+FAIL: g++.dg/cpp0x/inh-ctor20.C  -std=c++11 (test for excess errors)
+FAIL: g++.dg/cpp0x/inh-ctor20.C  -std=c++14 (internal compiler error)
+FAIL: g++.dg/cpp0x/inh-ctor20.C  -std=c++14 (test for excess errors)
+FAIL: g++.dg/cpp1z/inh-ctor35a.C  -std=gnu++11 (internal compiler error)
+FAIL: g++.dg/cpp1z/inh-ctor35a.C  -std=gnu++11 (test for excess errors)
+FAIL: g++.dg/cpp1z/inh-ctor35a.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/cpp1z/inh-ctor35a.C  -std=gnu++14 (test for excess errors)

FAIL: g++.dg/concepts/inherit-ctor3.C   (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/concepts/inherit-ctor3.C:14:18:
internal compiler error: in expand_expr_addr_expr_1, at expr.c:7806
0x8f5fff expand_expr_addr_expr_1
/vol/gcc/src/hg/trunk/local/gcc/expr.c:7806
0x8d82c7 expand_expr_addr_expr
/vol/gcc/src/hg/trunk/local/gcc/expr.c:7919
0x8d82c7 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:10998
0x7a75ab expand_normal
/vol/gcc/src/hg/trunk/local/gcc/expr.h:285
0x7a75ab precompute_register_parameters
/vol/gcc/src/hg/trunk/local/gcc/calls.c:951
0x7a75ab expand_call(tree_node*, rtx_def*, int)
/vol/gcc/src/hg/trunk/local/gcc/calls.c:3324
0x8d954f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:10776
0x7bb9fb expand_expr
/vol/gcc/src/hg/trunk/local/gcc/expr.h:279
0x7bb9fb expand_call_stmt
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:2668
0x7bb9fb expand_gimple_stmt_1
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:3581
0x7bb9fb expand_gimple_stmt
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:3747
0x7c132f expand_gimple_basic_block
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:5754
0x7c42af execute
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:6368

  Rainer

[Bug target/78168] [7 Regression] Second ICE in maybe_record_trace_start, at dwarf2cfi.c:2285

2016-11-03 Thread sebastian.hu...@embedded-brains.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78168

Sebastian Huber  changed:

   What|Removed |Added

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

--- Comment #13 from Sebastian Huber  ---
Thanks, looks good to me.

[Bug fortran/78062] sinus and cosinus fails

2016-11-03 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78062

--- Comment #5 from Andreas Schwab  ---
This is most likely .

[Bug tree-optimization/78190] [7 Regression] ice in get_alias_type_for_stmts

2016-11-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78190

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||marxin at gcc dot gnu.org
 Resolution|--- |WORKSFORME

--- Comment #2 from Martin Liška  ---
Was fixed in r241778.

[Bug c/65892] gcc fails to implement N685 aliasing of union members

2016-11-03 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892

--- Comment #24 from rguenther at suse dot de  ---
On Wed, 2 Nov 2016, txr at alumni dot caltech.edu wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65892
> 
> --- Comment #22 from Tim Rentsch  ---
> [responding to comments from rguent...@suse.de in Comment 20]
> 
> > GCC already implements this if you specify -fno-strict-aliasing.
> 
> The main point of my comments is that the ISO C standard requires
> the behavior in this case (and similar cases) be defined and not
> subject to any reordering.  In other words the result must be the
> same as an unoptimized version.  If a -fstrict-aliasing gcc /does/
> transform the code so that the behavior is not the same as an
> unoptimized version, then gcc is not a conforming implementation.

GCC has various optimization options that make it a not strictly
conforming implementation (-ffast-math for example), various
GNU extensions to the language, etc.

> Or is it your position that gcc is conforming only when operated
> in the -fno-strict-aliasing mode?  That position seems contrary to
> the documented description of the -fstrict-aliasing option.

Well, N685 is still disputed in this bug.  I was just pointing out
that GCC has a switch to make it conforming to your interpretation
of the standard (and this switch is the default at -O0 and -O1).

[Bug tree-optimization/78170] [7 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu

2016-11-03 Thread saaadhu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78170

--- Comment #8 from Senthil Kumar Selvaraj  ---
Author: saaadhu
Date: Thu Nov  3 08:04:40 2016
New Revision: 241809

URL: https://gcc.gnu.org/viewcvs?rev=241809=gcc=rev
Log:
Fix bougs PR 78170 failure for avr

The test defines int bitfields that are more than 16 bits wide, and this
fails for the avr with its 16 bit integer size. Therefore, require
effective target int32plus.

gcc/testsuite/

2016-11-03  Senthil Kumar Selvaraj  

* gcc.c-torture/execute/pr78170.c: Require int32plus.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.c-torture/execute/pr78170.c

[Bug debug/78191] [7 regression] ICE in calc_die_sizes

2016-11-03 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78191

--- Comment #2 from Rainer Orth  ---
Created attachment 39952
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39952=edit
i386-pc-solaris2.10 auto-host.h

Sure, and for the reference, here's the diff between the Solaris 10 and 12
ones:

--- /homes/ro/auto-host.h.s10   2016-11-02 20:01:48.430054000 +
+++ trunk/12-gcc/build/gcc/auto-host.h  2016-11-02 20:49:06.719315248 +
@@ -71 +71 @@
-/* #undef DEFAULT_USE_CXA_ATEXIT */
+#define DEFAULT_USE_CXA_ATEXIT 2
@@ -194 +194 @@
-/* #undef ENABLE_PLUGIN */
+#define ENABLE_PLUGIN 1
@@ -735 +735 @@
-#define HAVE_COMDAT_GROUP 0
+#define HAVE_COMDAT_GROUP 1
@@ -969 +969 @@
-#define HAVE_DECL_MADVISE 0
+#define HAVE_DECL_MADVISE 1
@@ -1038 +1038 @@
-#define HAVE_DECL_STPCPY 0
+#define HAVE_DECL_STPCPY 1
@@ -1045 +1045 @@
-#define HAVE_DECL_STRNLEN 0
+#define HAVE_DECL_STRNLEN 1
@@ -1140 +1140 @@
-#define HAVE_EXT_HASH_MAP 1
+/* #undef HAVE_EXT_HASH_MAP */
@@ -1405 +1405 @@
-#define HAVE_INITFINI_ARRAY_SUPPORT 0
+#define HAVE_INITFINI_ARRAY_SUPPORT 1
@@ -1466 +1466 @@
-/* #undef HAVE_LD_AS_NEEDED */
+#define HAVE_LD_AS_NEEDED 1
@@ -1491 +1491 @@
-#define HAVE_LD_COMPRESS_DEBUG 0
+#define HAVE_LD_COMPRESS_DEBUG 3
@@ -1503 +1503 @@
-#define HAVE_LD_EH_FRAME_CIEV3 0
+#define HAVE_LD_EH_FRAME_CIEV3 1
@@ -1508 +1508 @@
-/* #undef HAVE_LD_EH_FRAME_HDR */
+#define HAVE_LD_EH_FRAME_HDR 1
@@ -1545 +1545 @@
-/* #undef HAVE_LD_PIE */
+#define HAVE_LD_PIE 1
@@ -1714 +1714 @@
-/* #undef HAVE_SOLARIS_CRTS */
+#define HAVE_SOLARIS_CRTS 1
@@ -1867 +1867 @@
-/* #undef HAVE_UNORDERED_MAP */
+#define HAVE_UNORDERED_MAP 1
@@ -1971 +1971 @@
-/* #undef LD_AS_NEEDED_OPTION */
+#define LD_AS_NEEDED_OPTION "-z ignore"
@@ -1977 +1977 @@
-#define LD_COMPRESS_DEBUG_OPTION ""
+#define LD_COMPRESS_DEBUG_OPTION "-z compress-sections"
@@ -1989 +1989 @@
-/* #undef LD_NO_AS_NEEDED_OPTION */
+#define LD_NO_AS_NEEDED_OPTION "-z record"
@@ -2134 +2134 @@
-/* #undef TARGET_DL_ITERATE_PHDR */
+#define TARGET_DL_ITERATE_PHDR 1

  1   2   >