[Bug c++/58822] Segfault when calling make_shared

2016-04-12 Thread michi at triodia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58822

--- Comment #27 from Michi Henning  ---
My apologies for my incredibly late reply. (I just stumbled across this issue
again.) And my thanks to you for taking the time to analyse this!

I think your analysis is right. 3.8.5/3:

"- the pointer is implicitly converted to a pointer to a virtual base class"

So, this is UB. Really nasty, in the sense that

make_shared(args) doesn't always do the same thing as shared_ptr(new
T(args))

Seeing how subtle this is, a warning for the implicit conversion to pointer to
base would be supremely useful.

[Bug c++/70610] [6 regression] error: invalid initialization of non-const reference of type

2016-04-12 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70610

Patrick Palka  changed:

   What|Removed |Added

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

--- Comment #8 from Patrick Palka  ---
Fixed.

[Bug c++/70610] [6 regression] error: invalid initialization of non-const reference of type

2016-04-12 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70610

--- Comment #7 from Patrick Palka  ---
Author: ppalka
Date: Wed Apr 13 00:06:51 2016
New Revision: 234926

URL: https://gcc.gnu.org/viewcvs?rev=234926=gcc=rev
Log:
Fix PR c++/70610 (wrong overload resolution during template processing)

gcc/cp/ChangeLog:

PR c++/70610
* tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
recurse into it.
* typeck.c (build_x_conditional_expr): Unconditionally remember
that the result is an lvalue or xvalue.

gcc/testsuite/ChangeLog:

PR c++/70610
* g++.dg/template/pr70610.C: New test.
* g++.dg/template/pr70610-2.C: New test.
* g++.dg/template/pr70610-3.C: New test.
* g++.dg/template/pr70610-4.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/template/pr70610-2.C
trunk/gcc/testsuite/g++.dg/template/pr70610-3.C
trunk/gcc/testsuite/g++.dg/template/pr70610-4.C
trunk/gcc/testsuite/g++.dg/template/pr70610.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/tree.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/61839] More optimize opportunity for VRP

2016-04-12 Thread kugan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61839

kugan at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kugan at gcc dot gnu.org
  Known to fail|4.10.0  |5.0

--- Comment #2 from kugan at gcc dot gnu.org ---

> -  c = b != 0 ? 486097858 : 972195717;
> +  c = a + 972195718 >> (b != 0);

...

> until the very end, not transforming c_6.  Note that VRP could do the
> missing transform as it knows that _5 is [0, 1] (it has to jump through
> the shift - the value-range for the shift itself is too broad).
> 
> If written this kind of transform should be applied more generally, not
> just for shifts.  It basically wants to ask whether a conditional test
> can be carried out against another SSA name (and another constant) if
> an intermediate compute can be omitted in that case.

Do you mean something like,

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index bbdf9ce..dfce619 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -9902,6 +9902,47 @@ simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
 {
   enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
   tree rhs1 = gimple_assign_rhs1 (stmt);
+  tree rhs2 = gimple_assign_rhs2 (stmt);
+  tree var;
+
+  /* Convert:
+COND_RES = X COMPARE Y
+TMP = (CAST) COND_RES
+LHS = CST BINOP TMP
+
+To:
+LHS = COND_RES ? (CST BINOP 1) : (CST BINOP 0) */
+
+  if (TREE_CODE_CLASS (rhs_code) == tcc_binary
+ && TREE_CODE (rhs1) == INTEGER_CST
+ && TREE_CODE (rhs2) == SSA_NAME
+ && is_gimple_assign (SSA_NAME_DEF_STMT (rhs2))
+ && gimple_assign_rhs_code (SSA_NAME_DEF_STMT (rhs2)) == NOP_EXPR
+ && (var = gimple_assign_rhs1 (SSA_NAME_DEF_STMT (rhs2)))
+ && TREE_CODE (var) == SSA_NAME
+ && is_gimple_assign (SSA_NAME_DEF_STMT (var))
+ && TREE_CODE_CLASS (gimple_assign_rhs_code (SSA_NAME_DEF_STMT (var)))
+ == tcc_comparison)
+
+   {
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ value_range *vr = get_value_range (var);
+ if (range_int_cst_p (vr)
+ && integer_zerop (vr->min)
+ && integer_onep (vr->max))
+   {
+
+ tree lhs = gimple_assign_lhs (stmt);
+ tree new_rhs1 =  int_const_binop (rhs_code, rhs1, vr->min);
+ tree new_rhs2 =  int_const_binop (rhs_code, rhs1, vr->max);
+
+ gimple *s = gimple_build_assign (lhs, COND_EXPR, var,
+  new_rhs1,
+  new_rhs2 PASS_MEM_STAT);
+ gsi_replace (, s, false);
+ return true;
+   }
+   }

   switch (rhs_code)
{

[Bug target/70107] ICE: in emit_move_insn, at expr.c:3546 with -mcpu=power8

2016-04-12 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70107

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |amodra at gmail dot com
   Target Milestone|--- |4.9.4

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

[Bug target/70107] ICE: in emit_move_insn, at expr.c:3546 with -mcpu=power8

2016-04-12 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70107

--- Comment #8 from Alan Modra  ---
Author: amodra
Date: Tue Apr 12 22:59:05 2016
New Revision: 234925

URL: https://gcc.gnu.org/viewcvs?rev=234925=gcc=rev
Log:
Fix target/70107, another case of PR c++/70096

gcc/cp/
PR target/70107
PR c++/70096
* pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.

gcc/testsuite/
* g++.dg/template/ptrmem30.C (read): Rename to data_read.
(Holder::foo): Reflect this.

PR c++/70096
* g++.dg/template/ptrmem30.C: New test.

Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/template/ptrmem30.C
Modified:
branches/gcc-4_9-branch/gcc/cp/ChangeLog
branches/gcc-4_9-branch/gcc/cp/pt.c
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog

[Bug c++/70096] [6 Regression] [Invalid codegen] Read of uninitialized value in ref-qualified pointer to member function

2016-04-12 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70096

--- Comment #9 from Alan Modra  ---
Author: amodra
Date: Tue Apr 12 22:59:05 2016
New Revision: 234925

URL: https://gcc.gnu.org/viewcvs?rev=234925=gcc=rev
Log:
Fix target/70107, another case of PR c++/70096

gcc/cp/
PR target/70107
PR c++/70096
* pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.

gcc/testsuite/
* g++.dg/template/ptrmem30.C (read): Rename to data_read.
(Holder::foo): Reflect this.

PR c++/70096
* g++.dg/template/ptrmem30.C: New test.

Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/template/ptrmem30.C
Modified:
branches/gcc-4_9-branch/gcc/cp/ChangeLog
branches/gcc-4_9-branch/gcc/cp/pt.c
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog

[Bug target/70107] ICE: in emit_move_insn, at expr.c:3546 with -mcpu=power8

2016-04-12 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70107

--- Comment #7 from Alan Modra  ---
Author: amodra
Date: Tue Apr 12 22:58:36 2016
New Revision: 234924

URL: https://gcc.gnu.org/viewcvs?rev=234924=gcc=rev
Log:
Fix target/70107, another case of PR c++/70096

gcc/cp/
PR target/70107
PR c++/70096
* pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.

gcc/testsuite/
* g++.dg/template/ptrmem30.C (read): Rename to data_read.
(Holder::foo): Reflect this.

PR c++/70096
* g++.dg/template/ptrmem30.C: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/template/ptrmem30.C
Modified:
branches/gcc-5-branch/gcc/cp/ChangeLog
branches/gcc-5-branch/gcc/cp/pt.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug c++/70096] [6 Regression] [Invalid codegen] Read of uninitialized value in ref-qualified pointer to member function

2016-04-12 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70096

--- Comment #8 from Alan Modra  ---
Author: amodra
Date: Tue Apr 12 22:58:36 2016
New Revision: 234924

URL: https://gcc.gnu.org/viewcvs?rev=234924=gcc=rev
Log:
Fix target/70107, another case of PR c++/70096

gcc/cp/
PR target/70107
PR c++/70096
* pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.

gcc/testsuite/
* g++.dg/template/ptrmem30.C (read): Rename to data_read.
(Holder::foo): Reflect this.

PR c++/70096
* g++.dg/template/ptrmem30.C: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/template/ptrmem30.C
Modified:
branches/gcc-5-branch/gcc/cp/ChangeLog
branches/gcc-5-branch/gcc/cp/pt.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug c++/70641] [5/6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

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

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||ice-checking
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-04-12
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |5.4
Summary|ICE on valid code at -O1|[5/6 Regression] ICE on
   |and above on|valid code at -O1 and above
   |x86_64-linux-gnu:   |on x86_64-linux-gnu:
   |verify_gimple failed|verify_gimple failed
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r221719.

[Bug middle-end/70643] New: broken openacc reduction inside a fortran module

2016-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70643

Bug ID: 70643
   Summary: broken openacc reduction inside a fortran module
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: cesar at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38248=edit
broken test case

The attached test case causes an ICE in omp_low.c:lower_oacc_reductions because
that function is only guarding the incoming reduction variable against
INTEGER_CST when it comes time to build a mem_ref to it. Instead that function
should be checking if incoming is a TREE_CONSTANT.

Thomas reported this problem for gomp-4_0-branch here
, and as he stated
this is also present in trunk. I'm testing a patch for it.

[Bug sanitizer/70624] [6 Regression] Several hundred asan failures with 6.0 on x86_64-apple-darwin10.8

2016-04-12 Thread howarth.at.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70624

--- Comment #7 from Jack Howarth  ---
Also, note that upstream has in compiler-rt/cmake/config-ix.cmake...

if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
  message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
endif()

so they haven't allowed building on 10.6 since
https://github.com/llvm-mirror/compiler-rt/commit/19c8451a0e798abcfd1762fa8196f22b43018d2e#diff-2eeb0237a3e7842df96b4c1280614125

[Bug sanitizer/70624] [6 Regression] Several hundred asan failures with 6.0 on x86_64-apple-darwin10.8

2016-04-12 Thread howarth.at.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70624

--- Comment #6 from Jack Howarth  ---
(In reply to Jakub Jelinek from comment #5)
> So can dyldVersionNumber be only used for #if SANITIZER_IOSSIM and otherwise
> use what it did before?

The IOSSIM code from llvm's sanitizer was never migrated into gcc so that would
be a red herring. The underlying issue is that the
/usr/lib/system/libdyld.dylib required for the current code to work was only
introduced in 10.7 (darwin11). So a test for the target being darwin10 or
earlier would be the appropriate test for utilizing the legacy code.

[Bug c++/70634] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70634

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c++/70642] New: Invalid alias template instantiation not rejected if previously used in SFINAE context

2016-04-12 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70642

Bug ID: 70642
   Summary: Invalid alias template instantiation not rejected if
previously used in SFINAE context
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rs2740 at gmail dot com
  Target Milestone: ---

Reduced from http://stackoverflow.com/q/36578055/2756719.

The following ill-formed code is incorrectly accepted by GCC:

template struct enable_if {};
template struct enable_if { using type = T; };

template 
struct foo
{
 template 
 using meow = typename enable_if::type;

 template// 1
 meow bar () = delete;

 int bar ()
 {
meow i;  // 2
return 0; // 3
 }
};

int j = foo().bar();

Attempting to use i (by changing line #3 to 'return i;') causes an ICE:

prog.cc: In instantiation of 'int foo::bar() [with X = long int]':
prog.cc:20:25:   required from here
prog.cc:16:16: internal compiler error: in tsubst_copy, at cp/pt.c:14043
 return i;
^
0x6019dd tsubst_copy
/home/heads/gcc/gcc-source/gcc/cp/pt.c:14041
0x602021 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:16993
0x5fdcd8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15802
0x5fda06 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15114
0x5fd454 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15104
0x5fdb73 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15290
0x5fc36f instantiate_decl(tree_node*, int, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:22014
0x618c8b instantiate_pending_templates(int)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:22131
0x636eed c_parse_final_cleanups()
/home/heads/gcc/gcc-source/gcc/cp/decl2.c:4599
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

The problem appears to only arise if the types in Lines #1 and #2 match (i.e.,
when the alias template has been instantiated in a SFINAE context already); if
either (but not both) is changed to, e.g., void, or if the first bar() overload
is removed, then the error is correctly diagnosed.

[Bug target/70630] [6 regression] sparc bootstrap failure: sparc.c:4919:6: error: suggest explicit braces to avoid ambiguous 'else'

2016-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70630

Eric Botcazou  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|6.0 |4.9.4

--- Comment #6 from Eric Botcazou  ---
.

[Bug target/70630] [6 regression] sparc bootstrap failure: sparc.c:4919:6: error: suggest explicit braces to avoid ambiguous 'else'

2016-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70630

--- Comment #5 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Apr 12 20:56:11 2016
New Revision: 234920

URL: https://gcc.gnu.org/viewcvs?rev=234920=gcc=rev
Log:
2016-04-12  Eric Botcazou  

PR target/70630
* config/sparc/sparc.c (sparc_compute_frame_size): Add parentheses.

Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config/sparc/sparc.c

[Bug target/70630] [6 regression] sparc bootstrap failure: sparc.c:4919:6: error: suggest explicit braces to avoid ambiguous 'else'

2016-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70630

--- Comment #4 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Apr 12 20:55:33 2016
New Revision: 234919

URL: https://gcc.gnu.org/viewcvs?rev=234919=gcc=rev
Log:
PR target/70630
* config/sparc/sparc.c (sparc_compute_frame_size): Add parentheses.

Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/sparc/sparc.c

[Bug target/70630] [6 regression] sparc bootstrap failure: sparc.c:4919:6: error: suggest explicit braces to avoid ambiguous 'else'

2016-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70630

--- Comment #3 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Apr 12 20:55:05 2016
New Revision: 234918

URL: https://gcc.gnu.org/viewcvs?rev=234918=gcc=rev
Log:
2016-04-12  Eric Botcazou  

PR target/70630
* config/sparc/sparc.c (sparc_compute_frame_size): Add parentheses.

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

[Bug c++/70641] New: ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-12 Thread su at cs dot ucdavis.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

Bug ID: 70641
   Summary: ICE on valid code at -O1 and above on
x86_64-linux-gnu: verify_gimple failed
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current GCC trunk at
-O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.  

This is a regression from 5.3.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 6.0.0 20160412 (experimental) [trunk revision 234895] (GCC) 
$ 
$ g++-trunk -O0 -c small.cpp
$ g++-5.3 -O1 -c small.cpp
$ 
$ g++-trunk -O1 -c small.cpp
small.cpp: In function ‘void foo()’:
small.cpp:9:1: error: statement marked for throw, but doesn’t
 }
 ^
# .MEM_2 = VDEF <.MEM_1(D)>
foo ();
small.cpp:9:1: internal compiler error: verify_gimple failed
0xd9bd4f verify_gimple_in_cfg(function*, bool)
../../gcc-source-trunk/gcc/tree-cfg.c:5125
0xc8a392 execute_function_todo
../../gcc-source-trunk/gcc/passes.c:1958
0xc8ac7b execute_todo
../../gcc-source-trunk/gcc/passes.c:2010
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


-


void foo ()
{
  try { 
foo ();
  }
  catch ( ... ) { 
__builtin_abort ();
  }
}

[Bug target/70640] IEEE 128-bit floating point negative/abs has two thinkos

2016-04-12 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70640

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #2 from Michael Meissner  ---
Fixed in subversion id 234910.

[Bug c++/70615] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in add_expr, at tree.c:7870

2016-04-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70615

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c++/70501] [6 Regression] internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2249

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

Jakub Jelinek  changed:

   What|Removed |Added

 CC||su at cs dot ucdavis.edu

--- Comment #6 from Jakub Jelinek  ---
*** Bug 70571 has been marked as a duplicate of this bug. ***

[Bug c++/70571] [6 Regression] ICE on valid code on x86_64-linux-gnu in verify_ctor_sanity, at cp/constexpr.c:2259

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

Jakub Jelinek  changed:

   What|Removed |Added

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

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

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

[Bug c++/70571] [6 Regression] ICE on valid code on x86_64-linux-gnu in verify_ctor_sanity, at cp/constexpr.c:2259

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

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Apr 12 19:35:23 2016
New Revision: 234911

URL: https://gcc.gnu.org/viewcvs?rev=234911=gcc=rev
Log:
PR c++/70571
* g++.dg/ext/pr70571.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/pr70571.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug target/70640] IEEE 128-bit floating point negative/abs has two thinkos

2016-04-12 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70640

--- Comment #1 from Michael Meissner  ---
Created attachment 38247
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38247=edit
Proposed patch to fix the problem

[Bug c++/68722] [4.9/5 Regression] internal compiler error: in merge_exception_specifiers, at cp/typeck2.c:2108

2016-04-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68722

Paolo Carlini  changed:

   What|Removed |Added

Summary|[4.9/5/6 Regression]|[4.9/5 Regression] internal
   |internal compiler error: in |compiler error: in
   |merge_exception_specifiers, |merge_exception_specifiers,
   |at cp/typeck2.c:2108|at cp/typeck2.c:2108

--- Comment #5 from Paolo Carlini  ---
Fixed in trunk so far.

[Bug c++/68722] [4.9/5/6 Regression] internal compiler error: in merge_exception_specifiers, at cp/typeck2.c:2108

2016-04-12 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68722

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Tue Apr 12 17:54:34 2016
New Revision: 234909

URL: https://gcc.gnu.org/viewcvs?rev=234909=gcc=rev
Log:
/cp
2016-04-12  Paolo Carlini  

PR c++/68722
* parser.c (cp_parser_cache_defarg): When file ends in default
argument simply return error_mark_node.

/testsuite
2016-04-12  Paolo Carlini  

PR c++/68722
* g++.dg/parse/pr68722.C: New.

Added:
trunk/gcc/testsuite/g++.dg/parse/pr68722.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/70571] [6 Regression] ICE on valid code on x86_64-linux-gnu in verify_ctor_sanity, at cp/constexpr.c:2259

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

--- Comment #2 from Jakub Jelinek  ---
Indeed, Nathan patch for PR70501 fixed this, testing now
2016-04-12  Jakub Jelinek  

PR c++/70571
* g++.dg/ext/pr70571.C: New test.

--- gcc/testsuite/g++.dg/ext/pr70571.C.jj   2016-04-12 19:28:38.378163234
+0200
+++ gcc/testsuite/g++.dg/ext/pr70571.C  2016-04-12 19:28:06.0 +0200
@@ -0,0 +1,10 @@
+// PR c++/70571
+// { dg-do compile }
+
+typedef int V __attribute__ ((vector_size (sizeof (int;
+
+void
+foo (V *x, V *y, int z)
+{
+  *x = (z == *y);
+}

and will commit it and close this PR once bootstrap/regtest with it is
finished.

[Bug target/70640] IEEE 128-bit floating point negative/abs has two thinkos

2016-04-12 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70640

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-04-12
 Ever confirmed|0   |1

[Bug rtl-optimization/70596] [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

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

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug target/70640] New: IEEE 128-bit floating point negative/abs has two thinkos

2016-04-12 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70640

Bug ID: 70640
   Summary: IEEE 128-bit floating point negative/abs has two
thinkos
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: meissner at gcc dot gnu.org
  Target Milestone: ---

In applying the second fix for PR 70381, I noticed that the test float128-1.c
does not run on the pre-gcc7 branch, which is a branch I am collecting fixes to
be pushed upstream when GCC 7.0 opens up. One of the features of this branch is
that the default for register allocator was changed from the traditional reload
to LRA.

In looking at the test, it is generating incorrect code for IEEE 128-bit
floating point negate for power7/power8 systems (power9 is correct, since it
has hardware support).

If you compile the following file with -O2 -mvsx -mfloat128:

__float128 foo (__float128 a) { return -a; }

It will generate the following with reload:

xxlorc 32,32,32
xxlxor 33,33,33
vslb 0,0,0
vsldoi 0,0,1,15
xxlxor 34,34,32
blr

But with -mlra, it will generate:

xxlxor 34,34,32
blr

The reason is due to this insn:

(define_insn "*ieee_128bit_vsx_neg2_internal"
  [(set (match_operand:IEEE128 0 "register_operand" "=wa")
(neg:IEEE128 (match_operand:IEEE128 1 "register_operand" "wa")))
   (use (match_operand:V16QI 2 "register_operand" "=v"))]
  "TARGET_FLOAT128 && !TARGET_FLOAT128_HW"
  "xxlxor %x0,%x1,%x2"
  [(set_attr "type" "vecsimple")])

In particular, the (use ...) has a constraint of "=v" when it should have "v".
LRA notices it is an output constraint, and discards the previous insns that
generate the -0.0q constant used by the negative operation.  In addition,
absolute value and negative absolute value have the same problem.

In addition, the expander for negative absolute value creates the wrong insn:

(define_insn_and_split "*ieee_128bit_vsx_nabs2"
  [(set (match_operand:IEEE128 0 "register_operand" "=wa")
(neg:IEEE128
 (abs:IEEE128
  (match_operand:IEEE128 1 "register_operand" "wa"
   (clobber (match_scratch:V16QI 2 "=v"))]
  "TARGET_FLOAT128 && !TARGET_FLOAT128_HW && FLOAT128_IEEE_P (mode)"
  "#"
  "&& 1"
  [(parallel [(set (match_dup 0)
   (abs:IEEE128 (match_dup 1)))
  (use (match_dup 2))])]
{
  if (GET_CODE (operands[2]) == SCRATCH)
operands[2] = gen_reg_rtx (V16QImode);

  operands[3] = gen_reg_rtx (V16QImode);
  emit_insn (gen_ieee_128bit_negative_zero (operands[2]));
}
  [(set_attr "length" "8")
   (set_attr "type" "vecsimple")])

I.e. it creates (abs ...) when it should create (neg (abs ...)).

[Bug rtl-optimization/70596] [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

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

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Apr 12 17:18:31 2016
New Revision: 234906

URL: https://gcc.gnu.org/viewcvs?rev=234906=gcc=rev
Log:
PR rtl-optimization/70596
* lra-spills.c (spill_pseudos): Don't delete debug insns, instead
just invalidate LRA data and reset them.  Adjust dump wording.

* gcc.target/i386/pr70596.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr70596.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lra-spills.c
trunk/gcc/testsuite/ChangeLog

[Bug target/70381] On powerpc, -mfloat128 is on by default for all VSX systems

2016-04-12 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70381

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #8 from Michael Meissner  ---
Subversion id 234843 on the trunk contains the fix.

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

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

--- Comment #3 from Marek Polacek  ---
Weird that with my patch cc1plus warns like this
e.C: In function ‘void foo(int)’:
e.C:5:3: warning: this ‘switch’ clause does not guard...
[-Wmisleading-indentation]
   switch (x);
   ^~
e.C:6:5: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the ‘switch’
 bar (x);
 ^~~
while cc1 is quiet.  Isn't the cc1plus warning bogus though?

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

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

--- Comment #2 from Marek Polacek  ---
Shorter testcase:

void bar (int);
void
foo (int x)
{
  switch (x);
bar (x);
}

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

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

--- Comment #1 from Marek Polacek  ---
This (completely untested) should fix it though:

diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c
index 1da3f68..ddab880 100644
--- a/gcc/c-family/c-indentation.c
+++ b/gcc/c-family/c-indentation.c
@@ -556,6 +556,8 @@ guard_tinfo_to_string (const token_indent_info
_tinfo)
   return "while";
 case RID_DO:
   return "do";
+case RID_SWITCH:
+  return "switch";
 default:
   gcc_unreachable ();
 }

[Bug c++/70639] New: internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

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

Bug ID: 70639
   Summary: internal compiler error: in guard_tinfo_to_string, at
c-family/c-indentation.c:560
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

$ cat e.C
void bar (int);

void
foo (int x)
{
  if (x > 0)
switch (x);
  bar (x);
}

$ ./cc1plus -quiet  e.C -Wall
e.C: In function ‘void foo(int)’:
e.C:7:15: internal compiler error: in guard_tinfo_to_string, at
c-family/c-indentation.c:560
 switch (x);
   ^
0x98d787 guard_tinfo_to_string
/home/marek/src/gcc/gcc/c-family/c-indentation.c:560
0x98db65 warn_for_misleading_indentation(token_indent_info const&,
token_indent_info const&, token_indent_info const&)
/home/marek/src/gcc/gcc/c-family/c-indentation.c:605
0x830373 cp_parser_implicitly_scoped_statement
/home/marek/src/gcc/gcc/cp/parser.c:11928
0x82932c cp_parser_selection_statement
/home/marek/src/gcc/gcc/cp/parser.c:10982
0x82932c cp_parser_statement
/home/marek/src/gcc/gcc/cp/parser.c:10389
0x83033e cp_parser_implicitly_scoped_statement
/home/marek/src/gcc/gcc/cp/parser.c:11921
0x829812 cp_parser_selection_statement
/home/marek/src/gcc/gcc/cp/parser.c:10888
0x829812 cp_parser_statement
/home/marek/src/gcc/gcc/cp/parser.c:10389
0x829e4c cp_parser_statement_seq_opt
/home/marek/src/gcc/gcc/cp/parser.c:10806
0x829f5f cp_parser_compound_statement
/home/marek/src/gcc/gcc/cp/parser.c:10760
0x82a130 cp_parser_function_body
/home/marek/src/gcc/gcc/cp/parser.c:20653
0x82a130 cp_parser_ctor_initializer_opt_and_function_body
/home/marek/src/gcc/gcc/cp/parser.c:20689
0x82abf1 cp_parser_function_definition_after_declarator
/home/marek/src/gcc/gcc/cp/parser.c:25351
0x82b8b4 cp_parser_function_definition_from_specifiers_and_declarator
/home/marek/src/gcc/gcc/cp/parser.c:25263
0x82b8b4 cp_parser_init_declarator
/home/marek/src/gcc/gcc/cp/parser.c:18429
0x82bb70 cp_parser_simple_declaration
/home/marek/src/gcc/gcc/cp/parser.c:12379
0x82be6a cp_parser_block_declaration
/home/marek/src/gcc/gcc/cp/parser.c:12248
0x835680 cp_parser_declaration
/home/marek/src/gcc/gcc/cp/parser.c:12145
0x833f16 cp_parser_declaration_seq_opt
/home/marek/src/gcc/gcc/cp/parser.c:12024
0x83422c cp_parser_translation_unit
/home/marek/src/gcc/gcc/cp/parser.c:4323
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/70501] [6 Regression] internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2249

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

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #5 from Nathan Sidwell  ---
Fixed r234904.

[Bug c++/70501] [6 Regression] internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2249

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

--- Comment #4 from Nathan Sidwell  ---
Author: nathan
Date: Tue Apr 12 16:24:11 2016
New Revision: 234904

URL: https://gcc.gnu.org/viewcvs?rev=234904=gcc=rev
Log:
PR c++/70501

cp/
* constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
similarly to PMF.

testsuite/
* g++.dg/init/pr70501.C: New.

Added:
trunk/gcc/testsuite/g++.dg/init/pr70501.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/testsuite/ChangeLog

[Bug target/70633] [5/6 Regression] ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand

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

--- Comment #4 from Jakub Jelinek  ---
Created attachment 38246
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38246=edit
gcc6-pr70633.patch

Untested fix.  This works for me, but Richard, if you have a different patch
already in testing or if you think this is bad approach, I'll leave it to you.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

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

--- Comment #27 from Nathan Sidwell  ---
(In reply to Jason Merrill from comment #26)

> With this patch gengtype seems to assign gt_ggc_mx(tree&) to cp/constexpr.o,
> breaking cc1 link.  I'm not going to try to fix that now, though someone
> else is welcome to.

Yeah, a similar link failure led me to adding all that gt_ggc_mx stuff in
yesterday's protopatch.  However, I think you're on the right minimal track. 
When the constexpr_call_table is gc-deleted, the preservation of the
fn_copies_table will guarantee we won't change UID allocation.  We'll still
want the post-parseing hook to kill the copies table.

I'll see what I can do with your patch.

[Bug tree-optimization/70604] switch statement optimization creates dead code

2016-04-12 Thread jpoimboe at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70604

--- Comment #3 from Josh Poimboeuf  ---
Hi Richard, thanks for looking at it!

(In reply to Richard Biener from comment #2)
> Are the cases you still see indirect jumps to only one active case or
> is it just that if()s with multiple cases would have avoided the dead
> code?

I don't quite understand the second part of your question, but maybe this
information will answer it.

With GCC 6 I've only seen one occurrence of this issue, which is the one for
which I posted the assembler and .i file above.  It has an indirect jump which
is hard-coded to use only one entry in the jump table, as shown in the
assembler code above.

Note that the C code has two switch statements, which seem to correspond to the
two "normal" cases of indirect jump table patterns.  But then there's the third
unusual indirect jump, shown above, which also corresponds to one of the two
switch statements -- so there are two jump tables for a single switch
statement, where one of the tables appears to be optimized for a single case. 
Hopefully I'm making sense :-)

With GCC 5, the other occurrences of this issue were very similar, with switch
statements and indirect jumps to a single entry in the jump table.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #26 from Jason Merrill  ---
(In reply to Jason Merrill from comment #25)
> Created attachment 38245 [details]
> Patch to not discard copies
> 
> This seems like a minimal fix; does it in fact fix the bug?

With this patch gengtype seems to assign gt_ggc_mx(tree&) to cp/constexpr.o,
breaking cc1 link.  I'm not going to try to fix that now, though someone else
is welcome to.

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

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

--- Comment #8 from ktkachov at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #7)
> Created attachment 38242 [details]
> gcc6-pr70628.patch
> 
> IMNSHO simplify-rtx.c should never generate instructions, it carefully uses
> gen_lowpart_no_emit hook instead of gen_lowpart etc., but the
> convert_memory_addr seems to be the only cases which violate this.

The patch passed bootstrap on aarch64 but fails with a -Werror warning on
armhf:
gcc/explow.c:269:15: error: unused parameter 'no_emit'
[-Werror=unused-parameter]
  bool no_emit)
   ^~~

This is because arm doesn't define POINTERS_EXTEND_UNSIGNED so the new
parameter no_emit is seen as unused.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #25 from Jason Merrill  ---
Created attachment 38245
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38245=edit
Patch to not discard copies

This seems like a minimal fix; does it in fact fix the bug?

[Bug target/70633] [5/6 Regression] ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand

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

--- Comment #3 from Jakub Jelinek  ---
Guess the problem is a disagreement on what is valid constructor initializer.
initializer_constant_valid_p on (int)  says it is valid constant, but the
gimplifier doesn't keep it around and instead replaces it with a temporary.
So, either the gimplifier shouldn't do that for elements that satisfy
initializer_constant_valid_p, or (perhaps safer) it should clear TREE_STATIC on
the CONSTRUCTOR when it does this.

[Bug middle-end/70638] transaction_wrap: too strict compatibility check and transaction_pure wrappers fail to wrap

2016-04-12 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70638

--- Comment #1 from torvald at gcc dot gnu.org ---
Created attachment 38244
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38244=edit
test case

[Bug middle-end/70638] New: transaction_wrap: too strict compatibility check and transaction_pure wrappers fail to wrap

2016-04-12 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70638

Bug ID: 70638
   Summary: transaction_wrap: too strict compatibility check and
transaction_pure wrappers fail to wrap
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: torvald at gcc dot gnu.org
  Target Milestone: ---

The attached test case shows two issues with transaction_wrap:

1) If the original function is not transaction_safe, but the wrapper is
declared safe, this incorrectly results in an compilation error about the
original and the wrapper function being incompatible.
I believe this used to work before, but haven't checked.

2) If a wrapper is declared transaction_pure, the original function is
incorrectly considered to be transaction_pure.

The fourth case in the test might be something to be considered adding support
for.  OTOH, perhaps it's safer for programmers having to explicitly select
whether a wrapper is pure or safe, given that there seem to be these two
separate use cases (ie, making it pure to customize instrumentation, and making
it safe to use a transaction-friendly wrapper that still needs to be
instrumented).

[Bug testsuite/68242] FAIL: libgomp.oacc-c-c++-common/reduction-2.c, and other OpenACC reduction test case "oddities"

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

--- Comment #6 from Jakub Jelinek  ---
Yeah, I'm seeing this in i686-linux regtests on the trunk too.

[Bug c++/70634] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

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

--- Comment #2 from Jakub Jelinek  ---
So, when value_dependent_expression is called on the VAR_DECL i,
it (since the above mentioned change) recurse on its DECL_INITIAL:
  if (DECL_INITIAL (expression)
  && decl_constant_var_p (expression)
  && (TREE_CODE (DECL_INITIAL (expression)) == TREE_LIST
  /* cp_finish_decl doesn't fold reference initializers.  */
  || TREE_CODE (TREE_TYPE (expression)) == REFERENCE_TYPE
  || value_dependent_expression_p (DECL_INITIAL (expression
return true;
then when seeing the SIZEOF_EXPR in there we do:
  return instantiation_dependent_expression_p (expression);
on the SIZEOF_EXPR's operand (which is VAR_DECL i), and
instantiation_dependent_r for VAR_DECL just calls value_dependent_expression
again, which closes the infinite recursion.  So we need to break the recursion
somewhere, perhaps by remembering in which VAR_DECL initializers we are already
in, or by temporarily clearing the DECL_INITIALIZER of the VAR_DECLs we are
recursing into, whatever.  Jason, any thoughts on this?

[Bug sanitizer/70624] [6 Regression] Several hundred asan failures with 6.0 on x86_64-apple-darwin10.8

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

--- Comment #5 from Jakub Jelinek  ---
So can dyldVersionNumber be only used for #if SANITIZER_IOSSIM and otherwise
use what it did before?

[Bug testsuite/70577] [6 regression] tree-ssa/prefetch-5.c scan-tree-dump-times aprefetch failures

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

--- Comment #11 from Martin Liška  ---
Author: marxin
Date: Tue Apr 12 13:38:46 2016
New Revision: 234902

URL: https://gcc.gnu.org/viewcvs?rev=234902=gcc=rev
Log:
Revert r234572 (aka PR testsuite/70577)

Revert
2016-03-30  Jan Hubicka  

* tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can't get realistic
estimates here.
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
max_loop_iterations_int.
(tree_unswitch_outer_loop): Likewise.
* tree-ssa-loop-ivopts.c (avg_loop_niter): Likewise.
* tree-vect-loop.c (vect_analyze_loop_2): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-loop-ivopts.c
trunk/gcc/tree-ssa-loop-niter.c
trunk/gcc/tree-ssa-loop-unswitch.c
trunk/gcc/tree-vect-loop.c

[Bug testsuite/70577] [6 regression] tree-ssa/prefetch-5.c scan-tree-dump-times aprefetch failures

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

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #12 from Martin Liška  ---
Fixed.

[Bug c++/70637] New: Ambiguity error invoking a constructor with double brace initialization

2016-04-12 Thread steveire at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70637

Bug ID: 70637
   Summary: Ambiguity error invoking a constructor with double
brace initialization
   Product: gcc
   Version: 5.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: steveire at gmail dot com
  Target Milestone: ---

$ g++ --version
g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 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.

$ g++ double-braces.cpp -std=c++11
double-braces.cpp: In function ‘int main()’:
double-braces.cpp:16:20: error: call of overloaded ‘SomeClass()’ is ambiguous
   SomeClass sc({{}});
^
double-braces.cpp:7:12: note: candidate:
SomeClass::SomeClass(std::vector)
   explicit SomeClass(std::vector samples)
^
double-braces.cpp:4:7: note: candidate: SomeClass::SomeClass(const SomeClass&)
 class SomeClass
   ^
double-braces.cpp:4:7: note: candidate: SomeClass::SomeClass(SomeClass&&)
$ cat double-braces.cpp 

#include 

class SomeClass
{
public:
  explicit SomeClass(std::vector samples)
: mSamples(std::move(samples))
  {
  }
  std::vector mSamples;
};

int main()
{
  SomeClass sc({{}});
}

[Bug c++/70029] [6 Regression] ICE with C++11 and -flto

2016-04-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #8 from Jason Merrill  ---
(In reply to Jan Hubicka from comment #7)
> Hmm, both options sounds quite involved. Perhaps for stage4 we can simply
> drop the sanity check and add yet another FIXME to the verifier? Alias.c is
> relatively robust about walking to main variants so I can't think of wrong
> code issue caused by this.

Yes, I think better to defer a proper fix until GCC 7.

[Bug c++/70615] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in add_expr, at tree.c:7870

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

--- Comment #3 from Jakub Jelinek  ---
cp_gimplify_expr has code to handle the PTRMEM_CST case, but that is
unfortunately too late, if it appears in a CONSTRUCTOR, the gimplifier can try
to hash the CONSTRUCTOR which obviously can't handle the FE specific trees.

So, shall the FE somewhere early remove the PTRMEM_CSTs, or shall
cp_genericize_r remove them (well, replace with cplus_expand_constant result),
or shall cp_gimplify_expr have a case for CONSTRUCTOR where it would walk_tree
the ctor and use cplus_expand_constant in there?

[Bug c++/70636] New: Link failure when C++ brace initialization is used

2016-04-12 Thread steveire at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70636

Bug ID: 70636
   Summary: Link failure when C++ brace initialization is used
   Product: gcc
   Version: 5.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: steveire at gmail dot com
  Target Milestone: ---

$ g++ --version
g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 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.

$ cat brace-init.cpp 

#include 
#include 

class Expression
{
public:
  std::vector args;
};


Expression getExpr(const Expression& def = {})
{
  return def;
}

int main()
{
  auto a = getExpr();


  // auto a = getExpr({});
}
$ g++ brace-init.cpp -std=c++11 -v
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-22ubuntu2'
--with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) 
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu
-D_GNU_SOURCE brace-init.cpp -quiet -dumpbase brace-init.cpp -mtune=generic
-march=x86-64 -auxbase brace-init -std=c++11 -version -fstack-protector-strong
-Wformat -Wformat-security -o /tmp/ccsM0fgs.s
GNU C++11 (Ubuntu 5.2.1-22ubuntu2) version 5.2.1 20151010 (x86_64-linux-gnu)
compiled by GNU C version 5.2.1 20151010, GMP version 6.0.0, MPFR
version 3.1.3, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++11 (Ubuntu 5.2.1-22ubuntu2) version 5.2.1 20151010 (x86_64-linux-gnu)
compiled by GNU C version 5.2.1 20151010, GMP version 6.0.0, MPFR
version 3.1.3, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5ed623d6fe11f4bcc1afee70f77e33b0
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 as -v --64 -o /tmp/cc7GSdPa.o /tmp/ccsM0fgs.s
GNU assembler version 2.25.1 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.25.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin
/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccq481oT.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc_s 

[Bug tree-optimization/70623] [6 Regression] ICE in compute_antic at -O2

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

--- Comment #4 from Richard Biener  ---
This seems to be a bug in iteration order.

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

2016-04-12 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70627

Jan Hubicka  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #6 from Jan Hubicka  ---
The variant is created by:
#0  copy_node_stat (node=0x76b7ab28) at ../../gcc/tree.c:1148
#1  0x01364e93 in build_distinct_type_copy (type=0x76b7ab28) at
../../gcc/tree.c:6701
#2  0x0136506f in build_variant_type_copy (type=0x76b7ab28) at
../../gcc/tree.c:6741
#3  0x01364b1a in build_qualified_type (type=0x76b7ab28,
type_quals=1) at ../../gcc/tree.c:6637
#4  0x00973077 in cp_build_qualified_type_real (type=0x76b7ab28,
type_quals=1, complain=3) at ../../gcc/cp/tree.c:1151
#5  0x008f208d in build_class_member_access_expr (object=...,
member=0x76b63da8, access_path=0x0, preserve_reference=false, complain=3)
at ../../gcc/cp/typeck.c:2448
#6  0x00949f92 in finish_non_static_data_member (decl=0x76b63da8,
object=0x76b76cc0, qualifying_scope=0x0) at ../../gcc/cp/semantics.c:1821
#7  0x00950f6c in finish_id_expression (id_expression=0x76b78000,
decl=0x76b63da8, scope=0x0, idk=0x7fffce9c,
integral_constant_expression_p=false,
allow_non_integral_constant_expression_p=false, 
non_integral_constant_expression_p=0x77ff5add, template_p=false,
done=true, address_p=false, template_arg_p=false, error_msg=0x7fffcc18,
location=304544) at ../../gcc/cp/semantics.c:3717
#8  0x0088cdb8 in cp_parser_primary_expression (parser=0x77ff5ab0,
address_p=false, cast_p=false, template_arg_p=false, decltype_p=false,
idk=0x7fffce9c) at ../../gcc/cp/parser.c:5285
#9  0x00890370 in cp_parser_postfix_expression (parser=0x77ff5ab0,
address_p=false, cast_p=false, member_access_only_p=false, decltype_p=false,
pidk_return=0x0) at ../../gcc/cp/parser.c:6690
#10 0x008936ae in cp_parser_unary_expression (parser=0x77ff5ab0,
pidk=0x0, address_p=false, cast_p=false, decltype_p=false) at
../../gcc/cp/parser.c:7988
#11 0x0089448f in cp_parser_cast_expression (parser=0x77ff5ab0,
address_p=false, cast_p=false, decltype_p=false, pidk=0x0) at
../../gcc/cp/parser.c:8665
#12 0x0089457d in cp_parser_binary_expression (parser=0x77ff5ab0,
cast_p=false, no_toplevel_fold_p=false, decltype_p=false,
prec=PREC_NOT_OPERATOR, pidk=0x0) at ../../gcc/cp/parser.c:8767
#13 0x00895287 in cp_parser_assignment_expression
(parser=0x77ff5ab0, pidk=0x0, cast_p=false, decltype_p=false) at
../../gcc/cp/parser.c:9055
#14 0x0089245d in cp_parser_parenthesized_expression_list
(parser=0x77ff5ab0, is_attribute_list=0, cast_p=false,
allow_expansion_p=true, non_constant_p=0x0, close_paren_loc=0x7fffd8dc)
at ../../gcc/cp/parser.c:7459

and later we change TREE_TYPE of the main variant in:
0x0078a3ce in start_enum (name=0x76b77f20, enumtype=0x76b7ab28,
underlying_type=0x76b7a930, attributes=0x0, scoped_enum_p=true,
is_new=0x7fffe637) at ../../gcc/cp/decl.c:13231
13231 ENUM_UNDERLYING_TYPE (enumtype) = underlying_type;
(gdb) bt
#0  0x0078a3ce in start_enum (name=0x76b77f20,
enumtype=0x76b7ab28, underlying_type=0x76b7a930, attributes=0x0,
scoped_enum_p=true, is_new=0x7fffe637) at ../../gcc/cp/decl.c:13231
#1  0x008a36d4 in cp_parser_enum_specifier (parser=0x77ff5ab0) at
../../gcc/cp/parser.c:17183
#2  0x008a1266 in cp_parser_type_specifier (parser=0x77ff5ab0,
flags=1, decl_specs=0x7fffe7f0, is_declaration=true,
declares_class_or_enum=0x7fffe784, is_cv_qualifier=0x7fffe783)
at ../../gcc/cp/parser.c:15806
#3  0x0089c342 in cp_parser_decl_specifier_seq (parser=0x77ff5ab0,
flags=1, decl_specs=0x7fffe7f0, declares_class_or_enum=0x7fffe894) at
../../gcc/cp/parser.c:12758
#4  0x0089b90d in cp_parser_simple_declaration (parser=0x77ff5ab0,
function_definition_allowed_p=true, maybe_range_for_decl=0x0) at
../../gcc/cp/parser.c:12301
#5  0x0089b899 in cp_parser_block_declaration (parser=0x77ff5ab0,
statement_p=false) at ../../gcc/cp/parser.c:12248
#6  0x0089b61c in cp_parser_declaration (parser=0x77ff5ab0) at
../../gcc/cp/parser.c:12145
#7  0x0089b16e in cp_parser_declaration_seq_opt (parser=0x77ff5ab0)
at ../../gcc/cp/parser.c:12024
#8  0x0088b25e in cp_parser_translation_unit (parser=0x77ff5ab0) at
../../gcc/cp/parser.c:4323

Jason, perhaps start_enum wants to walk variants and update them after
finalizing underlying type?

I am also fine with disabling the check and deferring for next stage1.

[Bug rtl-optimization/70030] [LRA]ICE when reload insn with output scratch operand

2016-04-12 Thread renlin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70030

--- Comment #7 from Renlin Li  ---
(In reply to Vladimir Makarov from comment #6)
> Created attachment 38033 [details]
> A patch
> 
> Here is the patch which might solve the problem.

Hi Vladimir, sorry for the late reply. I am just back from holiday.

Thanks for the patch. I have tested that it fixes the ICE reported here!

scratch register in reload instructions are replaced by pseudo registers just
as other instructions feeding into LRA.

I have also did regression test and bootstrap check. It's all good for
aarch64-none-linux-gnu toolchain.

Are you going to post it?

[Bug rtl-optimization/70596] [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
Created attachment 38243
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38243=edit
gcc6-pr70596.patch

Untested fix.

[Bug libstdc++/59075] python pretty printer does not work at OS X

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

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #8 from Jonathan Wakely  ---
Odd, on GNU/Linux I get:

type = class std::vector > :
protected std::_Vector_base > {


i.e. it has std:: qualification, and doesn't have the [with _Tp = ...] stuff
which G++ outputs in diagnostics, but doesn't belong in the debug info if I
understand correctly.

Iain, I don't know how to read the DWARF in the attachments, do you? And do you
know anything about why the DWARF info is different in this way?

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #24 from Tobias Burnus  ---
(In reply to Jakub Jelinek from comment #18)
> For the testcases in this PR probably: [...[
> [...] would be enough [...] But the #c0 report suggests this affects
> more than that, but only Tobias has the reproducer that.

I applied that patch - and can confirm that it fixes the LLVM issue (comment
4), but not the original issue (comment 0).

Regarding comment 3, using -fdump-final-insns= without vs. with --param
ggc-min-expand=0 --param ggc-min-heapsize=0 gives indeed a different result for
comment 0's test case; however, that flag makes GCC extremely slow; the compile
time goes up from 11s to 15min - which is also not the best for delta.pl
reduction.
The changes are in items such as 'net_stream.160_55->D.114439._vptr.' where
D.114439 changes to D.114447 and the decl_uid in the ";; Function" lines
changes.

(In reply to Jakub Jelinek from comment #20)
> Tobias, could you try your to reproduce your #c0 issue, with a debugging
> patch like:
[...]
I will try this now.

[Bug rtl-optimization/70596] [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #1 from Jakub Jelinek  ---
This one is impossible to bisect, as the testcase ICEs starting with
r226901 and r232445 fixed this, but the -fcompare-debug issue is already there.
r226900 has been the last version that didn't ICE and didn't result in compare
debug failure.
That said, it is clearly the bug in r232445, we should never delete debug
insns, just reset them instead.  Let me try a fix.

[Bug testsuite/68242] [gomp4] FAIL: libgomp.oacc-c-c++-common/reduction-2.c -DACC_DEVICE_TYPE_host=1 execution test

2016-04-12 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68242

Thomas Schwinge  changed:

   What|Removed |Added

  Component|libgomp |testsuite
   Assignee|nathan at gcc dot gnu.org  |cesar at gcc dot gnu.org
   Target Milestone|--- |7.0

--- Comment #5 from Thomas Schwinge  ---
(In reply to vries from comment #0)
> I observe when testing gomp4_0-branch on x86_64 with -m32:
> ...
> FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/reduction-2.c
> -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable execution test
> ...

(In reply to Thomas Schwinge from comment #2)
> Yes, I had reported that to Cesar in
>  schwinge.homeip.net%3E>, but it has not yet been fixed.  (Same for the other
> items that I reported in this email.)

Now seen on trunk.

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #7 from Jakub Jelinek  ---
Created attachment 38242
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38242=edit
gcc6-pr70628.patch

IMNSHO simplify-rtx.c should never generate instructions, it carefully uses
gen_lowpart_no_emit hook instead of gen_lowpart etc., but the
convert_memory_addr seems to be the only cases which violate this.

[Bug fortran/69497] ICE in gfc_free_namespace, at fortran/symbol.c:3701

2016-04-12 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69497

--- Comment #5 from Dominique d'Humieres  ---
The patch in comment 3 also fixes the first test in pr69498 comment 0, but not
the tests containing submodule which gives the following ICE

pr69498_1.f90:3:19:

submodule (m) sm
   1
Error: Unexpected SUBMODULE statement at (1)
f951: internal compiler error: in resolve_assoc_var, at fortran/resolve.c:8099

[Bug tree-optimization/70623] [6 Regression] ICE in compute_antic at -O2

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

--- Comment #3 from Richard Biener  ---
Value numbers:
_1 = _31
_4 = 1

and

:
_4 = rc_35 != 0;
_31 = _9 == 0;
_1 = _4 & _31;
if (_1 != 0)

which is in the loop we don't converge for ANTIC compute:

...

Starting iteration 497
ANTIC_OUT[10] := { _9 (0006) }
ANTIC_IN[10] := { _9 (0006), rc_35 (0017), {plus_expr,rc_35,1} (0008) }
S[10] := { _9 (0006) }
ANTIC_OUT[18] := { _9 (0006), rc_13 (0008) }
ANTIC_IN[18] := { _9 (0006), rc_13 (0008) }
S[18] := { _9 (0006), rc_13 (0008) }

Starting iteration 498
ANTIC_OUT[10] := {  }
ANTIC_IN[10] := { rc_35 (0017), {plus_expr,rc_35,1} (0008) }
S[10] := {  }
ANTIC_OUT[18] := { rc_13 (0008) }
ANTIC_IN[18] := { rc_13 (0008) }
S[18] := { rc_13 (0008) }

Starting iteration 498
ANTIC_OUT[10] := {  }
ANTIC_IN[10] := { rc_35 (0017), {plus_expr,rc_35,1} (0008) }
S[10] := {  }
ANTIC_OUT[18] := { _9 (0006), rc_13 (0008) }
ANTIC_IN[18] := { _9 (0006), rc_13 (0008) }
S[18] := { _9 (0006), rc_13 (0008) }

...
Starting iteration 499
ANTIC_OUT[10] := { _9 (0006) }
ANTIC_IN[10] := { _9 (0006), rc_35 (0017), {plus_expr,rc_35,1} (0008) }
S[10] := { _9 (0006) }
ANTIC_OUT[18] := { rc_13 (0008) }
ANTIC_IN[18] := { rc_13 (0008) }
S[18] := { rc_13 (0008) }

I think we're just unlucky here to run into a latent issue (IIRC a similar
testcase ICEs on the gcc-5 branch instead).

Investigating more closely.

[Bug target/70566] [4.9/5 Regression] Bad ARM code generated for evaluating unsigned int bitfield value

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

--- Comment #12 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Tue Apr 12 10:58:28 2016
New Revision: 234898

URL: https://gcc.gnu.org/viewcvs?rev=234898=gcc=rev
Log:
[ARM] PR target/70566 Check that condition register is dead in tst-imm ->
lsls-imm Thumb2 peepholes

Backport from mainline
2016-04-08  Kyrylo Tkachov  

PR target/70566
* config/arm/thumb2.md (tst + branch-> lsls + branch
peephole below *orsi_not_shiftsi_si): Require that condition
register is dead after the peephole.
(second peephole after the above): Likewise.

* gcc.c-torture/execute/pr70566.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.c-torture/execute/pr70566.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/arm/thumb2.md
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/70604] switch statement optimization creates dead code

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

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-04-12
 CC||jamborm at gcc dot gnu.org
  Component|c   |tree-optimization
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
For GCC 6 stronger value-numbering might have fixed most cases.

Are the cases you still see indirect jumps to only one active case or
is it just that if()s with multiple cases would have avoided the dead
code?

I can see

  :
  _139 = [(void *)cmd_84(D) + 930B];
  _141 = conn_140(D)->sess;
  _142 = _141->se_sess;
  _143 = _84(D)->se_cmd;
  transport_init_se_cmd (_143, _ops, _142, 0, 3, 32, _139);
  target_get_sess_cmd (_143, 1);
  switch (_58) , case 1: , case 2: , case 3: ,
case 4: , case 5: , case 6: , case 7: >

:
  goto  ();

:
  goto  ();

:
  goto  ();

:
  goto  ();

:
  goto  ();

:
  _146 = (int) _58;
  printk ("\13Unknown iSCSI TMR Function: 0x%02x\n", _146);
  _351 = iscsit_add_reject_from_cmd (cmd_84(D), 10, 1, buf_55(D)); [tail call]
  goto ;

:

  # prephitmp_14 = PHI <1(18), 2(11), 3(12), 4(13), 5(14), 6(15), 7(16)>
:


with the default case looping back.  switch conversion should probably handle
this but is run too early.  OTOH it seems to be confused by the default
case not falling thru, failing to see the "simple" transform to a

  if (... >= 1 && ... <= 7)
   ;
  else
   old default;

beginning to process the following SWITCH statement
(drivers/target/iscsi/iscsi_target.c:1807) : ---
switch (_74) , case 1: , case 2: , case 3: ,
case 4: , case 5: , case 6: , case 7: >

Bailing out - no common successor to all case label target blocks found

beginning to process the following SWITCH statement
(drivers/target/iscsi/iscsi_target.c:1866) : ---
switch (_74) , case 1: , case 2 ... 5: , case 6:
, case 7: , case 8: >

Bailing out - no common successor to all case label target blocks found



Not sure what the other cases are.

[Bug c++/70635] [4.9/5/6 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70635

--- Comment #3 from Paolo Carlini  ---
I think we can simply restrict the same_type_p call to type_decls with
TREE_TYPE with CLASS_TYPE_P true or something very close. I'm testing a patch.

[Bug c++/70635] [4.9/5/6 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70635

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

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

--- Comment #6 from ktkachov at gcc dot gnu.org ---
The ICE in cselib occurs when it calls gen_reg_rtx after reload, which is not
allowed.

This is through a call to simplify_unary_operation_1 on
(zero_extend:DI (high:SI (symbol_ref/f:SI ("*.LC3") [flags 0x82] )))

and more specifically a call to convert_memory_address here:

1594 #if defined(POINTERS_EXTEND_UNSIGNED)
1595   /* As we do not know which address space the pointer is referring
to,
1596  we can do this only if the target does not support different
pointer
1597  or address modes depending on the address space.  */
1598   if (target_default_pointer_address_modes_p ()
1599   && POINTERS_EXTEND_UNSIGNED > 0
1600   && mode == Pmode && GET_MODE (op) == ptr_mode
1601   && (CONSTANT_P (op)
1602   || (GET_CODE (op) == SUBREG
1603   && REG_P (SUBREG_REG (op))
1604   && REG_POINTER (SUBREG_REG (op))
1605   && GET_MODE (SUBREG_REG (op)) == Pmode))
1606   && !targetm.have_ptr_extend ())
1607 return convert_memory_address (Pmode, op);
1608 #endif

[Bug tree-optimization/70602] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 32-bit mode (and at -Os only in 64-bit mode)

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

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Component|rtl-optimization|tree-optimization
 Resolution|--- |FIXED

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

[Bug tree-optimization/70600] Missed tree optimization with multiple additions in different types.

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

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener  ---
I believe this should be fixed in reassoc which needs to be teached to
handle mixed sign and mixed precision chains.

[Bug tree-optimization/70614] [4.9/5/6 Regression] GCC gets stuck with -O

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

--- Comment #4 from Richard Biener  ---
And I already removed the quadraticness there!  In an original version of the
patch I only looked at BIVs but that regressed sth.  See PR67783.

[Bug c++/70615] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in add_expr, at tree.c:7870

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/70616] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu in build_base_path, at cp/class.c:303

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/70617] internal compiler error: Segmentation fault

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

--- Comment #6 from Richard Biener  ---
But it ICEs differently, so the reduction is bogus:

> ./cc1plus -quiet t.c -m32 -w
t.c:2:23: error: field ‘TYPES’ has incomplete type ‘UINT’
 typedef struct { UINT TYPES } eType;
   ^
t.c:1:8: note: forward declaration of ‘struct UINT’
 struct UINT;
^
t.c:2:23: error: expected ‘;’ at end of member declaration
 typedef struct { UINT TYPES } eType;
   ^
t.c:3:10: error: ISO C++ forbids declaration of ‘fn1’ with no type
[-fpermissive]
 fn1(eType) {
  ^
t.c: In function ‘int fn1(eType)’:
t.c:3:12: error: expected ‘}’ at end of input
 fn1(eType) {
^
t.c:3:1: internal compiler error: Segmentation fault
 fn1(eType) {
 ^
0xfa527c crash_signal
/space/rguenther/src/svn/gcc-5-branch/gcc/toplev.c:383
0x7056f3 tree_int_cst_elt_check(tree_node*, int, char const*, int, char const*)
/space/rguenther/src/svn/gcc-5-branch/gcc/tree.h:3050
0x1082419 chkp_find_bound_slots_1(tree_node const*, bitmap_head*, long)
/space/rguenther/src/svn/gcc-5-branch/gcc/tree-chkp.c:1699
0x1082708 chkp_find_bound_slots(tree_node const*, bitmap_head*)
/space/rguenther/src/svn/gcc-5-branch/gcc/tree-chkp.c:1730
0x107fe9a chkp_type_bounds_count(tree_node const*)

[Bug tree-optimization/70623] [6 Regression] ICE in compute_antic at -O2

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

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener  ---
Mine.

[Bug sanitizer/70624] [6 Regression] Several hundred asan failures with 6.0 on x86_64-apple-darwin10.8

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

[Bug rtl-optimization/70625] [4.9/5 Regression] Memory exhaustion when building specific snippet at -O2

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

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |4.9.4

[Bug tree-optimization/68953] [6 Regression] [graphite] Wrong code w/ -O[12] -floop-nest-optimize

2016-04-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68953

vries at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #11 from vries at gcc dot gnu.org ---
patch with test-case committed, follow-up question answered (
https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00473.html ). Marking
resolved-fixed.

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

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

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-checking
   Priority|P3  |P1

[Bug c++/70594] [6 Regression] -fcompare-debug failure

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

--- Comment #23 from Jakub Jelinek  ---
2016-04-12  Jakub Jelinek  

PR c++/70594
* tree-sra.c (make_fancy_decl_name): Don't add DECL_UID
into the fancy names if -fdump-final-insns=.

--- gcc/tree-sra.c.jj   2016-04-12 11:08:10.0 +0200
+++ gcc/tree-sra.c  2016-04-12 11:15:35.519676357 +0200
@@ -1543,6 +1543,9 @@ make_fancy_decl_name (tree decl)
   if (name)
 obstack_grow (_obstack, IDENTIFIER_POINTER (name),
  IDENTIFIER_LENGTH (name));
+  /* Avoid -fcompare-debug issues on DECL_UID differences.  */
+  else if (flag_dump_final_insns != NULL)
+obstack_grow (_obstack, "D", 5);
   else
 {
   sprintf (buffer, "D%u", DECL_UID (decl));

is something we should do in any case, because the DECL_IGNORED names can make
it into the -fdump-final-insns= dump and the TDF_NOUID in that case can't help
with that.

[Bug target/70633] [5/6 Regression] ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand

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

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener  ---
Mine then.

[Bug c++/70634] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/70630] [6 regression] sparc bootstrap failure: sparc.c:4919:6: error: suggest explicit braces to avoid ambiguous 'else'

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/70635] [4.9/5/6 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/69728] [6 Regression] internal compiler error: in outer_projection_mupa, at graphite-sese-to-poly.c:1175

2016-04-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69728

--- Comment #2 from vries at gcc dot gnu.org ---
For two more testcases: PR68756 comment 3

[Bug tree-optimization/68756] [6 Regression] ICE w/ -O1 -floop-nest-optimize and isl 0.15: isl-0.15/isl_id.c:213: unable to find id

2016-04-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68756

vries at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|spop at gcc dot gnu.org|vries at gcc dot gnu.org

--- Comment #11 from vries at gcc dot gnu.org ---
patch with testcase committed, marking resolved fixed.

[Bug ipa/70583] [6 Regression] FAIL: g++.old-deja/g++.abi/vtable2.C -std=gnu++98 execution test

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

[Bug tree-optimization/68756] [6 Regression] ICE w/ -O1 -floop-nest-optimize and isl 0.15: isl-0.15/isl_id.c:213: unable to find id

2016-04-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68756

--- Comment #10 from vries at gcc dot gnu.org ---
Author: vries
Date: Tue Apr 12 10:08:48 2016
New Revision: 234896

URL: https://gcc.gnu.org/viewcvs?rev=234896=gcc=rev
Log:
Fix typo in copy_cond_phi_args

2016-04-12  Tom de Vries  

PR tree-optimization/68756
* graphite-isl-ast-to-gimple.c (copy_cond_phi_args): Use new_expr
instead of new_name.

* gcc.dg/graphite/pr68756.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/graphite/pr68756.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/graphite-isl-ast-to-gimple.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/70594] [6 Regression] -fcompare-debug failure

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

--- Comment #22 from Richard Biener  ---
The make_fancy_decl_name change is desirable but decls made by SRA should be
DECL_IGNORED and thus not end up anywhere in debug info.

Allocating or not allocating DECL_UIDs based on GC is a recipie for desaster.
We definiely do _not_ want that.

[Bug rtl-optimization/70596] [6 Regression] -fcompare-debug failure with one extra NOTE_INSN_DELETED

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

Richard Biener  changed:

   What|Removed |Added

Version|unknown |6.0
   Target Milestone|--- |6.0

[Bug go/70597] [6 Regression] cmd/go: deduplicate gccgo afiles by package path, not *Package

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |6.0

[Bug c++/70635] [4.9/5/6 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70635

--- Comment #2 from Paolo Carlini  ---
It's an infinite recursion affecting the same_type_p call at parser.c:25125
which I added in that patch.

[Bug c++/70570] Assembler error "symbol already defined" from nested lambdas and function-static variable

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

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-04-12
Version|unknown |5.3.0
 Ever confirmed|0   |1
  Known to fail||5.3.0, 6.0

--- Comment #1 from Richard Biener  ---
Confirmed.  GCC 4.9 complains:

> g++-4.9 t.C -std=c++14 
t.C: In instantiation of ‘main():: [with auto:1 = int]’:
t.C:2:8:   required from ‘void foo(T) [with T = main()::]’
t.C:12:3:   required from here
t.C:8:2: error: ‘x’ was not declared in this scope
  x;
  ^

  1   2   >