[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

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 43572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43572&action=edit
gcc8-pr84710.patch

Full untested patch.

[Bug c++/84281] Heap grows indefinitely

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84281

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #11 from Richard Biener  ---
As said, fixed.

[Bug target/84719] gcc's __builtin_memcpy performance with certain number of bytes is terrible compared to clang's

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84719

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #9 from Richard Biener  ---
So with 2 bytes we get

.L3:
movzwl  (%rax), %edx
addq$3, %rax
movw%dx, 8(%rsp)
movq8(%rsp), %rdx
imulq   %rcx, %rdx
shrq$48, %rdx
addq%rdx, %rsi
cmpq%rdi, %rax
jne .L3

while with 3 bytes we see

.L3:
movzwl  (%rax), %edx
addq$3, %rax
movw%dx, 8(%rsp)
movzbl  -1(%rax), %edx
movb%dl, 10(%rsp)
movq8(%rsp), %rdx
imulq   %rcx, %rdx
shrq$48, %rdx
addq%rdx, %rsi
cmpq%rdi, %rax
jne .L3

while clang outputs

.LBB0_3:# =>This Inner Loop Header: Depth=1
movzwl  (%r14,%rcx), %edx
movzbl  2(%r14,%rcx), %edi
shlq$16, %rdi
orq %rdx, %rdi
andq$-16777216, %rbx# imm = 0xFF00
orq %rdi, %rbx
movq%rbx, %rdx
imulq   %rax, %rdx
shrq$48, %rdx
addq%rdx, %rsi
addq$3, %rcx
cmpq$2, %rcx# imm = 0x3B9AC9F8
jb  .LBB0_3

that _looks_ slower.  Are you sure performance isn't dominated by the
first init loop (both GCC and clang vectorize it).  I notice we spill
in the above loop for the bitfield insert where clang uses register
operations.  We refuse to inline the memcpy at the GIMPLE level
and further refuse to optimzie it to a BIT_INSERT_EXPR which would
be a possibility.

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||aoliva at gcc dot gnu.org

[Bug c++/84720] [7/8 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at cp/tree.c:3472

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84720

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Priority|P3  |P2
   Target Milestone|--- |7.4
Summary|internal compiler error:|[7/8 Regression] internal
   |tree check: expected tree   |compiler error: tree check:
   |that contains 'decl |expected tree that contains
   |minimal' structure, have|'decl minimal' structure,
   |'error_mark' in |have 'error_mark' in
   |decl_anon_ns_mem_p, at  |decl_anon_ns_mem_p, at
   |cp/tree.c:3472  |cp/tree.c:3472

[Bug middle-end/84722] [8 Regression] ICE in create_dispatcher_calls, at multiple_target.c:147

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84722

Richard Biener  changed:

   What|Removed |Added

 Target||x86_64-*-* i?86-*-*
   Priority|P3  |P1
  Component|c   |middle-end
   Target Milestone|--- |8.0

[Bug middle-end/84723] [8 Regression] ICE in create_target_clone, at multiple_target.c:275

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84723

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
  Component|c   |middle-end
   Target Milestone|--- |8.0

[Bug c++/84724] [7/8 Regression] internal compiler error: in single_succ_edge, at basic-block.h:339 with a declaration of __builtin_trap

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84724

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |7.4

--- Comment #2 from Richard Biener  ---
Yeah.  Or rather the FEs shouldn't clobber the builtin decls (_not_ merge into
them) so that when the ME looks up decls for them they never pick up user
decls.

Similar issues for builtin folding if the folded-to builtin is misdeclared.

[Bug c++/84727] [8 regression] Constant class initialization not detected as such

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84727

Richard Biener  changed:

   What|Removed |Added

   Keywords||rejects-valid
   Target Milestone|--- |8.0

[Bug c++/84727] [8 regression] Constant class initialization not detected as such

2018-03-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84727

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||mpolacek at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #2 from Marek Polacek  ---
Yeah, already fixed by my r258116.

[Bug middle-end/84722] [8 Regression] ICE in create_dispatcher_calls, at multiple_target.c:147

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84722

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-03-06
 CC||marxin at gcc dot gnu.org
  Known to work||7.3.0
 Ever confirmed|0   |1
  Known to fail||8.0

--- Comment #1 from Martin Liška  ---
Started with r249365, thus mine.

[Bug c++/84729] internal compiler error: verify_gimple failed

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84729

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

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

[Bug target/84719] gcc's __builtin_memcpy performance with certain number of bytes is terrible compared to clang's

2018-03-06 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84719

--- Comment #10 from Marc Glisse  ---
(In reply to Richard Biener from comment #9)
> So with 2 bytes we get

Try 3 bytes (the worst case).

> Are you sure performance isn't dominated by the
> first init loop (both GCC and clang vectorize it).

Replacing memcpy(,,block) with memcpy(,,8) (the next line masks the other bytes
anyway) gained a factor 8 in running time, when I tried the other day.

[Bug c++/84729] [6/7/8 Regression] internal compiler error: verify_gimple failed

2018-03-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84729

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |6.5
Summary|internal compiler error:|[6/7/8 Regression] internal
   |verify_gimple failed|compiler error:
   ||verify_gimple failed

[Bug c++/84729] internal compiler error: verify_gimple failed

2018-03-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84729

--- Comment #2 from Marek Polacek  ---
Probably started with r175674.

[Bug c++/84720] [7/8 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at cp/tree.c:3472

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84720

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
  Known to work||6.4.0
 Ever confirmed|0   |1
  Known to fail||7.3.0, 8.0

--- Comment #1 from Martin Liška  ---
Started with r241425.

[Bug c++/84728] internal compiler error: Segmentation fault (is_gimple_variable())

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84728

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, all releases I have do ICE (4.6.0+).

[Bug tree-optimization/83325] Compile time hog w/ -Os -fwrapv

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83325

Richard Biener  changed:

   What|Removed |Added

 Target|powerpc-linux   |x86_64-*-*
   Last reconfirmed|2017-12-08 00:00:00 |2018-3-6
Version|8.0 |7.3.1

--- Comment #3 from Richard Biener  ---
Re-confirmed on the GCC 7 branch for x86_64-linux, on trunk powerpc it no
longer reproduces.  I will try to isolate a GIMPLE testcase now...

[Bug inline-asm/84683] [6/7/8 Regression] internal compiler error: in move_for_stack_reg, at reg-stack.c:1173

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84683

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar  6 09:23:36 2018
New Revision: 258273

URL: https://gcc.gnu.org/viewcvs?rev=258273&root=gcc&view=rev
Log:
PR inline-asm/84683
* reg-stack.c (move_for_stack_reg): If any_malformed_asm, avoid
assertion failure.

* g++.dg/ext/pr84683.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/pr84683.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/reg-stack.c
trunk/gcc/testsuite/ChangeLog

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #3 from Segher Boessenkool  ---
Well, yuck, I missed that part of rtl.texi (or somehow I thought this RTL would
be refused earlier).

Please use reg_or_subregno in the patch though?

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #4 from Segher Boessenkool  ---
The testcase does not crash for me; does it need more non-default options?

The testcase has UB of course (d is undefined).

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #5 from Jakub Jelinek  ---
(In reply to Segher Boessenkool from comment #4)
> The testcase does not crash for me; does it need more non-default options?
> 
> The testcase has UB of course (d is undefined).

The compiler needs to be configured with --enable-checking=yes,rtl .

--- gcc/combine.c.jj2018-03-05 23:13:26.478215559 +0100
+++ gcc/combine.c   2018-03-06 08:50:17.756288841 +0100
@@ -4283,12 +4283,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2,
   if (GET_CODE (x) == PARALLEL)
x = XVECEXP (newi2pat, 0, 0);

-  /* It can only be a SET of a REG or of a paradoxical SUBREG of a REG. 
*/
-  x = SET_DEST (x);
-  if (paradoxical_subreg_p (x))
-   x = SUBREG_REG (x);
-
-  unsigned int regno = REGNO (x);
+  /* It can only be a SET of a REG or of a SUBREG of a REG.  */
+  unsigned int regno = reg_or_subregno (SET_DEST (x));

   bool done = false;
   for (rtx_insn *insn = NEXT_INSN (i3);

is the combine.c part I'll be testing.  And, the testcase is dg-do compile
only,
so it doesn't matter if there is UB in it or not, we shouldn't ICE on it (and
yes, my attempts to get rid of the uninit use just resulted in the ICE no
longer happening).

[Bug c/84607] [6/7 Regression] Side effects discarded in address computation inside 'if'

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84607

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Tue Mar  6 10:01:52 2018
New Revision: 258274

URL: https://gcc.gnu.org/viewcvs?rev=258274&root=gcc&view=rev
Log:
2018-03-06  Richard Biener  

Backport from mainline
2018-03-05  Richard Biener  

PR tree-optimization/84486
* tree-ssa-pre.c (create_expression_by_pieces): Remove dead code.
When inserting a __builtin_assume_aligned call set the LHS
SSA name alignment info accordingly.

2018-02-28  Richard Biener  

PR middle-end/84607
* genmatch.c (capture_info::walk_match): Do not mark
captured expressions without operands as expr_p given
they act more like predicates and should be subject to
"lost tail" side-effect preserving.

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

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84607.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/genmatch.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-pre.c

[Bug tree-optimization/84486] [7 Regression] code hoisting removes alignment assumption

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84486

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Tue Mar  6 10:01:52 2018
New Revision: 258274

URL: https://gcc.gnu.org/viewcvs?rev=258274&root=gcc&view=rev
Log:
2018-03-06  Richard Biener  

Backport from mainline
2018-03-05  Richard Biener  

PR tree-optimization/84486
* tree-ssa-pre.c (create_expression_by_pieces): Remove dead code.
When inserting a __builtin_assume_aligned call set the LHS
SSA name alignment info accordingly.

2018-02-28  Richard Biener  

PR middle-end/84607
* genmatch.c (capture_info::walk_match): Do not mark
captured expressions without operands as expr_p given
they act more like predicates and should be subject to
"lost tail" side-effect preserving.

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

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84607.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/genmatch.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-pre.c

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
The C FE uses building_stmt_list_p predicate in multiple spots, and that
doesn't really work well if we've already pushed a DEBUG_BEGIN_STMT into some
STATEMENT_LIST.

I have an untested patch.

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #6 from Zdenek Sojka  ---
(In reply to Segher Boessenkool from comment #4)
> The testcase has UB of course (d is undefined).

The original testcase had defined behavior. The uninitialized use is the result
of delta/creduce reduction. There was an ICE with the unreduced testcase as
well.

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #7 from Zdenek Sojka  ---
Created attachment 43573
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43573&action=edit
original testcase

Unreduced testcase; needs additional -fkeep-inline-functions:
$ aarch64-unknown-linux-gnu-gcc -O -fno-forward-propagate
-fkeep-inline-functions xxx.c -w
during RTL pass: combine
xxx.c: In function 'bar2':
xxx.c:81:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1896
 }
...

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 43574
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43574&action=edit
gcc8-pr84721.patch

Untested fix.  Besides fixing this PR, I think it is plain wrong to add the
DEBUG_BEGIN_STMTs somewhere at the file scope, they are necessarily tied to
functions, so it makes only sense to emit them inside of functions.

[Bug tree-optimization/84486] [7 Regression] code hoisting removes alignment assumption

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84486

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #8 from Segher Boessenkool  ---
Ah right, I had checking disabled.  Need more coffee I guess.

The insns I see are different:

Trying 19, 20 -> 21:
   19: r106:SI#0=0
   20: r108:SI=zero_extend(r106:SI#0)
   21: r109:SI=r108:SI 0>>0x8
  REG_DEAD r108:SI

(see insn 20); maybe the i3 in #c1 is already modified?

The #c5 patch is okay for trunk, thanks!

[Bug target/84710] [8 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1896 with -O -fno-forward-propagate

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84710

--- Comment #9 from Jakub Jelinek  ---
(In reply to Segher Boessenkool from comment #8)
> Ah right, I had checking disabled.  Need more coffee I guess.

You don't really need to build the checking compiler for this though, it is
enough to put a breakpoint on that REGNO (x) line and debug_rtx (x) first.

> The insns I see are different:
> 
> Trying 19, 20 -> 21:
>19: r106:SI#0=0
>20: r108:SI=zero_extend(r106:SI#0)
>21: r109:SI=r108:SI 0>>0x8
>   REG_DEAD r108:SI
> 
> (see insn 20); maybe the i3 in #c1 is already modified?

Likely, yes.  I've just done up and debug_rtx on the 3 insns passed to
try_combine.

> The #c5 patch is okay for trunk, thanks!

Thanks.

[Bug middle-end/84723] [8 Regression] ICE in create_target_clone, at multiple_target.c:275

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84723

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
There are other reasons why versioning is forbidden, e.g.
__attribute__((target_clones ("avx", "default")))
void
foo (void)
{
  static void *p = &&lab;
  asm volatile ("" : "+m" (p) : : "memory");
lab:;
}

and

__attribute__((target_clones ("avx", "default")))
int
foo (int x)
{
  __label__ lab;
  __attribute__((noinline)) void bar () { goto lab; }
  if (x == 5)
bar ();
  x++;
lab:;
  return x;
}

ICE too, even when they don't have any extra attributes.  So the target clones
code needs to cope with those in any case.

[Bug tree-optimization/83325] Compile time hog w/ -Os -fwrapv

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83325

--- Comment #4 from Richard Biener  ---
Got distracted by analysis... we don't do anything "wrong" but hit the latent
issue that we're allowing x_1 -> y_3 lattice transitions.  Those are
unfortunately required by the redundant IV removal testcases
tree-ssa/pr19590.c and tree-ssa/ssa-sccvn-{1,2,4}.c who all are very similar.

Index: gcc/tree-ssa-sccvn.c
===
--- gcc/tree-ssa-sccvn.c(revision 258272)
+++ gcc/tree-ssa-sccvn.c(working copy)
@@ -3283,6 +3283,20 @@ set_ssa_val_to (tree from, tree to)
   && (to == from || SSA_VAL (to) == to))
  || is_gimple_min_invariant (to)));

+  bool changed = false;
+  if (currval != to
+  && !operand_equal_p (currval, to, 0)
+  /* ???  For addresses involving volatile objects or types
operand_equal_p
+ does not reliably detect ADDR_EXPRs as equal.  We know we are only
+getting invariant gimple addresses here, so can use
+get_addr_base_and_unit_offset to do this comparison.  */
+  && !(TREE_CODE (currval) == ADDR_EXPR
+  && TREE_CODE (to) == ADDR_EXPR
+  && (get_addr_base_and_unit_offset (TREE_OPERAND (currval, 0), &coff)
+  == get_addr_base_and_unit_offset (TREE_OPERAND (to, 0), &toff))
+  && coff == toff))
+changed = true;
+
   if (from != to)
 {
   if (currval == from)
@@ -3297,9 +3311,10 @@ set_ssa_val_to (tree from, tree to)
}
  return false;
}
-  else if (currval != VN_TOP
-  && ! is_gimple_min_invariant (currval)
-  && is_gimple_min_invariant (to))
+  else if (changed
+  && currval != VN_TOP
+  && !(is_gimple_min_invariant (currval)
+   && !is_gimple_min_invariant (to)))
{
  if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -3308,9 +3323,9 @@ set_ssa_val_to (tree from, tree to)
  print_generic_expr (dump_file, from, 0);
  fprintf (dump_file, " from ");
  print_generic_expr (dump_file, currval, 0);
- fprintf (dump_file, " (non-constant) to ");
+ fprintf (dump_file, " to ");
  print_generic_expr (dump_file, to, 0);
- fprintf (dump_file, " (constant)\n");
+ fprintf (dump_file, "\n");
}
  to = from;
}
@@ -3327,17 +3342,7 @@ set_ssa_val_to (tree from, tree to)
   print_generic_expr (dump_file, to, 0);
 }

-  if (currval != to
-  && !operand_equal_p (currval, to, 0)
-  /* ???  For addresses involving volatile objects or types
operand_equal_p
- does not reliably detect ADDR_EXPRs as equal.  We know we are only
-getting invariant gimple addresses here, so can use
-get_addr_base_and_unit_offset to do this comparison.  */
-  && !(TREE_CODE (currval) == ADDR_EXPR
-  && TREE_CODE (to) == ADDR_EXPR
-  && (get_addr_base_and_unit_offset (TREE_OPERAND (currval, 0), &coff)
-  == get_addr_base_and_unit_offset (TREE_OPERAND (to, 0), &toff))
-  && coff == toff))
+  if (changed)
 {
   /* If we equate two SSA names we have to make the side-band info
  of the leader conservative (and remember whatever original value

[Bug c++/84730] New: internal compiler error: Segmentation fault (build_class_member_access_expr)

2018-03-06 Thread vegard.nossum at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84730

Bug ID: 84730
   Summary: internal compiler error: Segmentation fault
(build_class_member_access_expr)
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at gmail dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct {
  int a;
  struct {
int b = decltype(b);
int a;
  };
};

Output:

$ xgcc -x c++ -S -
:5:9: error: 'int a' conflicts with
a previous declaration
:2:7: note: previous declaration 'int ::a'
:4:22: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x1409270 build_class_member_access_expr(cp_expr, tree_node*, tree_node*, bool,
int)
/home/vegard/git/gcc/gcc/cp/typeck.c:2408
0x140a55a build_class_member_access_expr(cp_expr, tree_node*, tree_node*, bool,
int)
/home/vegard/git/gcc/gcc/cp/typeck.c:2501
0x12a9da1 finish_non_static_data_member(tree_node*, tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:1860
0x12aec62 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
/home/vegard/git/gcc/gcc/cp/semantics.c:3726
0xf7b055 cp_parser_decltype_expr
/home/vegard/git/gcc/gcc/cp/parser.c:14001
0xf7b055 cp_parser_decltype
/home/vegard/git/gcc/gcc/cp/parser.c:14135
0xf2db37 cp_parser_simple_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17065
0xf76736 cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:6951
0xf2a4b7 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8322
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xecc0a3 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9770
0xed334e cp_parser_initializer_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21916
0xedc293 cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21856
0xedc4d1 cp_parser_late_parse_one_default_arg
/home/vegard/git/gcc/gcc/cp/parser.c:27761
0xf15be0 cp_parser_late_parsing_nsdmi
/home/vegard/git/gcc/gcc/cp/parser.c:27813
0xf15be0 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22715
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768


$ xgcc --version
xgcc (GCC) 8.0.1 20180306 (experimental)

Built from git 11a93d7a09b871b3b9a2eb108eb91ad83d94e070 (r258271).

7.3.0 gives:

:5:9: error: redeclaration of 'int a'
 int a;
 ^
:2:7: note: previous declaration 'int ::a'
   int a;
   ^
:4: confused by earlier errors, bailing out
Compiler returned: 1

Test case was minimised by C-Reduce.

[Bug c++/84730] internal compiler error: Segmentation fault (build_class_member_access_expr)

2018-03-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84730

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed, even 4.7 ICEs.

[Bug inline-asm/71572] ICE with VLA and "+g" inline-asm in force_constant_size, at gimplify.c:671

2018-03-06 Thread vegard.nossum at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71572

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at gmail dot com

--- Comment #3 from Vegard Nossum  ---
FWIW this still ICEs on latest trunk (r258271) for me. It also reproduces using
"+r" instead of "+g".

An alternative test case (which is admittedly invalid code) is:

void f() {
  int a[0 / 0];
  asm("" : "+r" (a));
}

[Bug driver/84731] New: -Bsymbolic switch ignored

2018-03-06 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84731

Bug ID: 84731
   Summary: -Bsymbolic switch ignored
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
  Assignee: unassigned at gcc dot gnu.org
  Reporter: stsp at users dot sourceforge.net
  Target Milestone: ---

-Bsymbolic option is ignored by gcc.
-Wl,-Bsymbolic works correctly.

-Bsymbolic should either be rejected, or
passed to the linker, but not ignored.

[Bug middle-end/84723] [8 Regression] ICE in create_target_clone, at multiple_target.c:275

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84723

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 43575
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43575&action=edit
gcc8-pr84723.patch

Untested fix.

[Bug driver/84731] -Bsymbolic switch ignored

2018-03-06 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84731

Andreas Schwab  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andreas Schwab  ---
It is not ignored, it has a differnt meaning.

  -BAdd  to the compiler's search paths

[Bug inline-asm/84683] [6/7 Regression] internal compiler error: in move_for_stack_reg, at reg-stack.c:1173

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84683

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[6/7/8 Regression] internal |[6/7 Regression] internal
   |compiler error: in  |compiler error: in
   |move_for_stack_reg, at  |move_for_stack_reg, at
   |reg-stack.c:1173|reg-stack.c:1173

--- Comment #4 from Jakub Jelinek  ---
Fixed for 8.1+ so far.

[Bug c++/71832] [7/8 Regression] ICE on invalid C++11 code with incorrect decltype use for non-type template parameter: Segmentation fault

2018-03-06 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71832

--- Comment #7 from Paolo Carlini  ---
Skipping completely the body works for this testcase, isn't that difficult to
do, but goes too far, the template completely disappears and we end up with bad
error recovery for anything referring to it afterwards. Probably, a better
approximation would be skipping the *instantiations* of the body.

[Bug target/84719] gcc's __builtin_memcpy performance with certain number of bytes is terrible compared to clang's

2018-03-06 Thread gpnuma at centaurean dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84719

--- Comment #11 from gpnuma at centaurean dot com ---
Yes it's not the init loop the problem. Just to make sure, with the following
code :

#include 
#include 
#include 
#include 
#include 
#include 
#include 

int main(int argc, char *argv[]) {
const uint64_t size = 10;
const size_t alloc_mem = size * sizeof(uint8_t);
uint8_t *mem = malloc(alloc_mem);
//for (uint_fast64_t i = 0; i < size; i++)
//mem[i] = (uint8_t) (i >> 7);

uint_fast64_t counter = 0;
uint64_t total = 0x123456789abcdefllu;
uint64_t receiver = 0;

printf("%u ...\n", 3);
counter = 0;
while (counter < size - 8) {
__builtin_memcpy(&receiver, &mem[counter], 3);
//receiver &= (0xllu >> (64 - ((3) << 3)));
total += ((receiver * 0x321654987cbafedllu) >> 48);
counter += 3;
}

printf("=> %llu\n", total);
return EXIT_SUCCESS;
}

The result is (the calculated sum is unreliable since we do not init memory) :
gcc
3 ...
=> 81985529216486895

real0m3.180s
user0m2.822s
sys 0m0.328s

clang
time ./a.out
3 ...
=> 81985529216486895

real0m0.972s
user0m0.621s
sys 0m0.338s

Still 4x faster

(In reply to Richard Biener from comment #9)
> So with 2 bytes we get
> 
> .L3:
> movzwl  (%rax), %edx
> addq$3, %rax
> movw%dx, 8(%rsp)
> movq8(%rsp), %rdx
> imulq   %rcx, %rdx
> shrq$48, %rdx
> addq%rdx, %rsi
> cmpq%rdi, %rax
> jne .L3
> 
> while with 3 bytes we see
> 
> .L3:
> movzwl  (%rax), %edx
> addq$3, %rax
> movw%dx, 8(%rsp)
> movzbl  -1(%rax), %edx
> movb%dl, 10(%rsp)
> movq8(%rsp), %rdx
> imulq   %rcx, %rdx
> shrq$48, %rdx
> addq%rdx, %rsi
> cmpq%rdi, %rax
> jne .L3
> 
> while clang outputs
> 
> .LBB0_3:# =>This Inner Loop Header: Depth=1
> movzwl  (%r14,%rcx), %edx
> movzbl  2(%r14,%rcx), %edi
> shlq$16, %rdi
> orq %rdx, %rdi
> andq$-16777216, %rbx# imm = 0xFF00
> orq %rdi, %rbx
> movq%rbx, %rdx
> imulq   %rax, %rdx
> shrq$48, %rdx
> addq%rdx, %rsi
> addq$3, %rcx
> cmpq$2, %rcx# imm = 0x3B9AC9F8
> jb  .LBB0_3
> 
> that _looks_ slower.  Are you sure performance isn't dominated by the
> first init loop (both GCC and clang vectorize it).  I notice we spill
> in the above loop for the bitfield insert where clang uses register
> operations.  We refuse to inline the memcpy at the GIMPLE level
> and further refuse to optimzie it to a BIT_INSERT_EXPR which would
> be a possibility.

[Bug target/84521] [8 Regression] aarch64: Frame-pointer corruption with __builtin_setjmp/__builtin_longjmp and -fomit-frame-pointer

2018-03-06 Thread sudi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84521

sudi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug c++/84724] [7/8 Regression] internal compiler error: in single_succ_edge, at basic-block.h:339 with a declaration of __builtin_trap

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84724

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
The C FE has quite a lot of code in this case, e.g.
match_builtin_function_types, which the C++ FE doesn't seem to have, and indeed
the C FE leaves the __builtin_trap decl untouched after warning, while the C++
FE changes it.

The ICE in this case isn't caused by a mismatch between __builtin_trap ()
return type, but rather the lack of noreturn attribute on the new decl.
Though I'm sure that redefining similar way many other builtins that GCC emits
on its own or expects a particular arguments or return types will cause many
other ICEs.

[Bug sanitizer/84732] New: false-positive -Wstringop-truncation warning with -fsanitize-coverage=trace-pc

2018-03-06 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84732

Bug ID: 84732
   Summary: false-positive -Wstringop-truncation warning with
-fsanitize-coverage=trace-pc
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: arnd at linaro dot org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Created attachment 43576
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43576&action=edit
linux/drivers/staging/lustre/lnet/lnet/lib-socket.c, preprocessed, not reduced

I ran into this warning for what looks like correct code in the linux kernel
that we should not warn about:

$ aarch64-linux-gcc-8.0.1 -fno-strict-aliasing -Wno-pointer-sign
-fsanitize-coverage=trace-pc  -Wall -O2 -c lib-socket.i
In file included from /git/arm-soc/arch/arm64/include/asm/processor.h:37,
 from /git/arm-soc/arch/arm64/include/asm/spinlock.h:21,
 from /git/arm-soc/include/linux/spinlock.h:88,
 from /git/arm-soc/include/linux/wait.h:9,
 from /git/arm-soc/include/linux/net.h:23,
 from
/git/arm-soc/drivers/staging/lustre/lnet/lnet/lib-socket.c:37:
/git/arm-soc/drivers/staging/lustre/lnet/lnet/lib-socket.c: In function
'lnet_ipif_query':
/git/arm-soc/include/linux/string.h:254:9: warning: '__builtin_strncpy'
specified bound 16 equals destination size [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
 ^
/git/arm-soc/include/linux/string.h:254:9: warning: '__builtin_strncpy'
specified bound 16 equals destination size [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
 ^
/git/arm-soc/include/linux/string.h:254:9: warning: '__builtin_strncpy'
specified bound 16 equals destination size [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
 ^

See
https://elixir.bootlin.com/linux/v4.15/source/drivers/staging/lustre/lnet/lnet/lib-socket.c#L99
for the original source code. Without -fsanitize-coverage=trace-pc, the
strlen() comparison is sufficient to avoid that warning, with
fsanitize=coverage=trace-pc, that logic fails:

if (strlen(name) > sizeof(ifr.ifr_name) - 1)
return -E2BIG;
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));


I can probably create a reduced test case if that helps.

[Bug sanitizer/84732] false-positive -Wstringop-truncation warning with -fsanitize-coverage=trace-pc

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84732

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-03-06
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Let me take a look.

[Bug c++/84720] [7/8 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at cp/tree.c:3472

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84720

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
clang++ accepts this.
In tsubst_function_decl we set DECL_CONTEXT to error_mark_node as that is what
12520 if (member && !closure)
12521   ctx = tsubst_aggr_type (ctx, args,
12522   complain, t, /*entering_scope=*/1);
returns (complain is tf_none), returning error_mark_node here if ctx is
error_mark_node doesn't help, it ICEs later on elsewhere.

[Bug c++/71832] [7/8 Regression] ICE on invalid C++11 code with incorrect decltype use for non-type template parameter: Segmentation fault

2018-03-06 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71832

--- Comment #8 from Paolo Carlini  ---
Another idea - which appears to work great! - is skipping the bodies of the
member function definitions. If everything goes well I'll send soon a draft
patch.

[Bug rtl-optimization/84659] [8 Regression] ICE: Segmentation fault (stack overflow in bb_note) w/ selective scheduling

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84659

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
 CC||abel at gcc dot gnu.org,
   ||amonakov at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
So, we have bb 5:
(code_label 29 65 30 5 4 (nil) [1 uses])
(note 30 29 32 5 [bb 5] NOTE_INSN_BASIC_BLOCK)
(insn 32 30 33 5 (set (mem:SI (reg/f:SI 125 [ _5 ]) [1 *_20+0 S4 A32])
(reg:SI 143)) "pr84659.c":7 503 {*movsi_internal1}
 (expr_list:REG_DEAD (reg:SI 143)
(expr_list:REG_DEAD (reg/f:SI 125 [ _5 ])
(nil
(insn 33 32 34 5 (set (reg/f:SI 125 [ _5 ])
(mem/f:SI (reg/v/f:SI 129 [ x ]) [2 *x_10(D)+0 S4 A32])) "pr84659.c":4
503 {*movsi_internal1}
 (nil))
(insn 34 33 36 5 (set (reg:SI 126 [ _6 ])
(mem:SI (reg/f:SI 125 [ _5 ]) [1 *_5+0 S4 A32])) "pr84659.c":4 503
{*movsi_internal1}
 (nil))
(insn 36 34 64 5 (set (reg:CC 144)
(compare:CC (reg:SI 126 [ _6 ])
(const_int 0 [0]))) "pr84659.c":4 774 {*cmpsi_signed}
 (nil))
(insn 64 36 37 5 (const_int -1 [0x]) "pr84659.c":7 -1
 (nil))
(jump_insn 37 64 38 5 (set (pc)
(if_then_else (le (reg:CC 144)
(const_int 0 [0]))
(label_ref:SI 29)
(pc))) "pr84659.c":4 849 {*rs6000.md:12271}
 (expr_list:REG_DEAD (reg:CC 144)
(int_list:REG_BR_PROB 955630228 (nil)))
 -> 29)

with succs edges 5->5 and 5->6, and call compute_live_after_bb on that bb.
This in turn does:
3073  IOR_REG_SET (lv, compute_live (sel_bb_head (e->dest)));
where sel_bb_head is insn 32 above, but src is NULL there, BB_LV_SET_VALID_P
(bb) is false and so is INSN_LIVE_VALID_P in all the insns (32, 34, 36, 64 and
37).
This means we:
3124  temp = NEXT_INSN (insn);
3125  final = NEXT_INSN (BB_END (bb));
3126  while (temp != final && ! INSN_LIVE_VALID_P (temp))
3127temp = NEXT_INSN (temp);
3128  if (temp == final)
3129{
3130  lv = compute_live_after_bb (bb);
3131  temp = PREV_INSN (temp);
3132}
temp == final == first insn of the following bb, and we recurse again into
compute_live_after_bb.

[Bug rtl-optimization/84659] [6/7/8 Regression] ICE: Segmentation fault (stack overflow in bb_note) w/ selective scheduling

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84659

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
Summary|[8 Regression] ICE: |[6/7/8 Regression] ICE:
   |Segmentation fault (stack   |Segmentation fault (stack
   |overflow in bb_note) w/ |overflow in bb_note) w/
   |selective scheduling|selective scheduling

--- Comment #2 from Jakub Jelinek  ---
Started with r211725 (though, that likely just made a latent sel-sched bug
reproducible).

[Bug tree-optimization/84114] global reassociation pass prevents fma usage, generates slower code

2018-03-06 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84114

--- Comment #8 from Wilco  ---
(In reply to Steve Ellcey from comment #6)
> (In reply to Wilco from comment #5)
> > (In reply to Steve Ellcey from comment #4)
> > > While teaching the reassociation pass about fma's seems like the right
> > > answer would it be reasonable (and simpler) to do the fma pass
> > > (pass_optimize_widening_mul) before
> > > the reassociation pass (pass_reassoc) to get the most fma's?
> > > 
> > > That fixes my small test case but I haven't done a bigger performance 
> > > check
> > > to see what the overall impact would be.
> > 
> > I don't know what else that would affect since the reassociation phase runs
> > very early - and it's late at this stage. My patch seems much safer. Even
> > easier might be to return 1 for FLOAT_MODE PLUS_EXPR in
> > aarch64_reassociation_width. Then we can fix the reassociation phase in 
> > GCC9.
> 
> Moving the fma phase did not have a good performance impact (it was worse).

So it looks like it's best to teach the reassociation phase about FMA for GCC9.

> Your patch of setting the reassociation width to 1 did help performance on
> ThunderX2.

Can you let me know if my workaround helped? If useful I could backport it to
GCC7 as well.

[Bug c++/53281] poor error message for calling a non-const method from a const object

2018-03-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53281

--- Comment #3 from Jonathan Wakely  ---
Current trunk gives:

cv.cc: In member function ‘void Foo::bar2(const Foo&)’:
cv.cc:4:26: error: passing ‘const Foo’ as ‘this’ argument discards qualifiers
[-fpermissive]
 foo.bar1();
  ^
cv.cc:2:14: note:   in call to ‘void Foo::bar1()’
 void bar1() {}
  ^~~~


With this patch:

--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7799,7 +7799,24 @@ build_over_call (struct z_candidate *cand, int flags,
tsubst_flags_t complain)
  if (permerror (input_location, "passing %qT as % "
 "argument discards qualifiers",
 TREE_TYPE (argtype)))
-   inform (DECL_SOURCE_LOCATION (fn), "  in call to %qD", fn);
+   {
+ int argquals = cp_type_quals (TREE_TYPE (argtype));
+ int fnquals = cp_type_quals (TREE_TYPE (fn));
+ int discarded = argquals & ~fnquals;
+ bool non_const = discarded & TYPE_QUAL_CONST;
+ bool non_volatile = discarded & TYPE_QUAL_VOLATILE;
+ const char *descr;
+ if (non_const && non_volatile)
+   descr = " which is non-const and non-volatile";
+ else if (non_const)
+   descr = " which is non-const";
+ else if (non_volatile)
+   descr = " which is non-volatile";
+ else
+   descr = "";
+ inform (DECL_SOURCE_LOCATION (fn), "  in call to %qD%s",
+ fn, descr);
+   }
}
  else
return error_mark_node;


we get:

cv.cc: In member function ‘void Foo::bar2(const Foo&)’:
cv.cc:4:26: error: passing ‘const Foo’ as ‘this’ argument discards qualifiers
[-fpermissive]
 foo.bar1();
  ^
cv.cc:2:14: note:   in call to ‘void Foo::bar1()’ which is non-const
 void bar1() {}
  ^~~~

Note the addition of "which is non-const" to the note.

[Bug c++/84733] New: internal compiler error: Segmentation fault (check_local_shadow())

2018-03-06 Thread vegard.nossum at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Bug ID: 84733
   Summary: internal compiler error: Segmentation fault
(check_local_shadow())
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at gmail dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct c {
  ~c();
} b;

void f() {
  try {
d:
;
  } catch (int) {
  }

  decltype(b) a;
  int e;
  struct e f;
}

Output:

$ xgcc -x c++ -S -
:14:10: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0xe47760 check_local_shadow
/home/vegard/git/gcc/gcc/cp/name-lookup.c:2683
0xe5b1b7 do_pushdecl
/home/vegard/git/gcc/gcc/cp/name-lookup.c:3086
0xe6030f pushdecl(tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:3154
0xe6030f do_pushdecl_with_scope
/home/vegard/git/gcc/gcc/cp/name-lookup.c:3982
0xe62f98 do_pushtag
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6444
0xe62f98 pushtag(tree_node*, tree_node*, tag_scope)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6514
0xb5f965 xref_tag_1
/home/vegard/git/gcc/gcc/cp/decl.c:13726
0xb5f965 xref_tag(tag_types, tree_node*, tag_scope, bool)
/home/vegard/git/gcc/gcc/cp/decl.c:13783
0xf8396d cp_parser_elaborated_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17918
0xf2265c cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16802
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfa3a70 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12938
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xfade64 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12476
0xefab2b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10925
0xefe5eb cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11274
0xeff08a cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11228
0xf9283b cp_parser_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21778
0xf9283b cp_parser_ctor_initializer_opt_and_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21813

$ xgcc --version
xgcc (GCC) 8.0.1 20180306 (experimental)

Built from git 11a93d7a09b871b3b9a2eb108eb91ad83d94e070 (r258271).

5.5.0 says:

: In function 'void f()':
:12:13: error: 'decltype' was not declared in this scope
   decltype(b) a;
 ^
:14:12: error: aggregate 'f()::e f' has incomplete type and cannot be
defined
   struct e f;
^
Compiler returned: 1

Test case was minimised by C-Reduce.

[Bug tree-optimization/68523] CFG Expansion Computes Incorrect Block Frequencies for Nested Loops

2018-03-06 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68523

Segher Boessenkool  changed:

   What|Removed |Added

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

--- Comment #3 from Segher Boessenkool  ---
The constant loop is now completely optimised away before expand; use
-fno-loop-interchange to prevent that.

Even with that I see no problem any more now, maybe the new frequency
stuff changed this?

Resolving as fixed.

[Bug c++/53281] poor error message for calling a non-const method from a const object

2018-03-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53281

--- Comment #4 from Jonathan Wakely  ---
FWIW Clang says:

cv.cc:4:17: error: member function 'bar1' not viable: 'this' argument has type
'const Foo', but function is not marked const
foo.bar1();
^~~
cv.cc:2:14: note: 'bar1' declared here
void bar1() {}
 ^
1 error generated.


And EDG says:

"cv.cc", line 4: error: the object has type qualifiers that are not compatible
  with the member function
object type is: const Foo
  foo.bar1();
  ^

1 error detected in the compilation of "cv.cc".

[Bug fortran/84734] New: [8 Regression] Compiling gfortran.dg/size_kind_(2|3).f90 with -fdefault-integer-8 gives an ICE

2018-03-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84734

Bug ID: 84734
   Summary: [8 Regression] Compiling
gfortran.dg/size_kind_(2|3).f90 with
-fdefault-integer-8 gives an ICE
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dominiq at lps dot ens.fr
  Target Milestone: ---

Compiling gfortran.dg/size_kind_(2|3).f90 with -fdefault-integer-8 gives an
ICE:

% gfc /opt/gcc/_clean/gcc/testsuite/gfortran.dg/size_kind_2.f90
-fdefault-integer-8
f951: internal compiler error: Segmentation fault: 11

The backtrace is

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
frame #0: 0x00012367 f951`::eval_intrinsic_f3(op=INTRINSIC_PLUS,
eval=(f951`::gfc_arith_plus(gfc_expr *, gfc_expr *, gfc_expr **) at
arith.c:614), op1=0x, op2=0x)(gfc_expr *,
gfc_expr *, gfc_expr **), gfc_expr *, gfc_expr *) at arith.c:1661
   1658 static int
   1659 gfc_zero_size_array (gfc_expr *e)
   1660 {
-> 1661   if (e->expr_type != EXPR_ARRAY)
   1662 return 0;
   1663 
   1664   return e->value.constructor == NULL;
Target 0: (f951) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
  * frame #0: 0x00012367 f951`::eval_intrinsic_f3(op=INTRINSIC_PLUS,
eval=(f951`::gfc_arith_plus(gfc_expr *, gfc_expr *, gfc_expr **) at
arith.c:614), op1=0x, op2=0x)(gfc_expr *,
gfc_expr *, gfc_expr **), gfc_expr *, gfc_expr *) at arith.c:1661
frame #1: 0x00010003cc13 f951`gfc_simplify_expr(p=0x0001439187e0,
type=0) at expr.c:1133
frame #2: 0x000100029a4f f951`gfc_match_data_decl() at decl.c:2365
frame #3: 0x0001000299d4 f951`gfc_match_data_decl()
frame #4: 0x00010008e984 f951`::decode_statement() at parse.c:65
frame #5: 0x00010008e97f f951`::decode_statement()
frame #6: 0x0001000928b5 f951`::next_statement() at parse.c:1230
frame #7: 0x00010009a05f f951`gfc_parse_file() at parse.c:6190
frame #8: 0x0001000e661c f951`::gfc_be_parse_file() at f95-lang.c:204
frame #9: 0x000100c2f59a f951`::compile_file() at toplev.c:455
frame #10: 0x0001012973eb f951`toplev::main(int, char**) at
toplev.c:2132
frame #11: 0x000101298f2e f951`main(argc=3, argv=0x7ffeefbff220) at
main.c:39

The change occurred between revisions r257969 (2018-02-25, OK) and r258235
(2018-03-04, ICE).

[Bug fortran/84734] [8 Regression] Compiling gfortran.dg/size_kind_(2|3).f90 with -fdefault-integer-8 gives an ICE

2018-03-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84734

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-06
  Known to work||6.4.0, 7.3.0
 Blocks||32770
   Target Milestone|--- |8.0
 Ever confirmed|0   |1
  Known to fail||8.0


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32770
[Bug 32770] [Meta-bug] -fdefault-integer-8 issues

[Bug fortran/84734] [8 Regression] Compiling gfortran.dg/size_kind_(2|3).f90 with -fdefault-integer-8 gives an ICE

2018-03-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84734

--- Comment #1 from Dominique d'Humieres  ---
The following variant

integer(4) :: B(huge(1_4)+3_8,2_8)
integer(8) :: var1(2), var2, var3

print *, kind(B), size(B)
var1 = shape(B) ! { dg-error "SHAPE overflows its kind" }
print *, var1
var2 = size(B) ! { dg-error "SIZE overflows its kind" }
var3 = size(B,dim=1) ! { dg-error "SIZE overflows its kind" }
end

gives the expected errors when compiled without -fdefault-integer-8, but
compile with -fdefault-integer-8 and gives at run time

4   4294967300
   21474836502

[Bug c++/53281] poor error message for calling a non-const method from a const object

2018-03-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53281

--- Comment #5 from Jonathan Wakely  ---
A further improvement might be to stop talking about "passing '...' as 'this'
argument" since that's a leaky abstraction: although member functions are
implemented with a hidden 'this' parameter, that's not how most C++ programmers
think of it, or how the abstract machine is described. Also, 'this' is a
pointer, and 'const Foo' is not a pointer type (Clang loses points there too).

So maybe this would be better:

--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7796,8 +7796,15 @@ build_over_call (struct z_candidate *cand, int flags,
tsubst_flags_t complain)
{
  if (complain & tf_error)
{
- if (permerror (input_location, "passing %qT as % "
-"argument discards qualifiers",
+ int argquals = cp_type_quals (TREE_TYPE (argtype));
+ int fnquals = cp_type_quals (TREE_TYPE (fn));
+ int discarded = argquals & ~fnquals;
+ bool non_const = discarded & TYPE_QUAL_CONST;
+ bool non_volatile = discarded & TYPE_QUAL_VOLATILE;
+ if (permerror (input_location, "cannot call %s%s member "
+"function on object of type %qT",
+non_const ? "non-const" : "",
+non_volatile ? "non-volatile" : "",
 TREE_TYPE (argtype)))
inform (DECL_SOURCE_LOCATION (fn), "  in call to %qD", fn);
}


cv.cc: In member function 'void Foo::bar2(const Foo&)':
cv.cc:4:26: error: cannot call non-const member function on object of type
'const Foo' [-fpermissive]
 foo.bar1();
  ^
cv.cc:2:14: note:   in call to 'void Foo::bar1()'
 void bar1() {}
  ^~~~

[Bug gcov-profile/84735] New: [8 Regression] Describe recent gcov data file format changes in gcov-io.h

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84735

Bug ID: 84735
   Summary: [8 Regression] Describe recent gcov data file format
changes in gcov-io.h
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Brief Description of 'gcov' Data Files
in the manual says:
The full details of the file format is specified in 'gcov-io.h', and
functions provided in that header file should be used to access the
coverage files.
but the recent changes weren't documented in gcov-io.h.

[Bug sanitizer/84732] false-positive -Wstringop-truncation warning with -fsanitize-coverage=trace-pc

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84732

--- Comment #2 from Martin Liška  ---
Reduced test-case:

$ cat ~/Programming/testcases/ice.i
char *arg;

struct buffer{
  char a[16];
};

struct buffer a, b;

void e(void) {
  if (__builtin_strlen(arg) > 1)
__builtin_strncpy(a.a, arg, sizeof(struct buffer));
}

Without coverage sanitization:

$ ./xgcc -B. ~/Programming/testcases/ice.i -c -O2 -Wall
-fdump-tree-strlen=/dev/stdout

;; Function e (e, funcdef_no=0, decl_uid=1962, cgraph_uid=0, symbol_order=3)

e ()
{
  char * arg.0_1;
  long unsigned int _2;

   [local count: 1073741825]:
  arg.0_1 = arg;
  _2 = __builtin_strlen (arg.0_1);
  if (_2 > 1)
goto ; [41.48%]
  else
goto ; [58.52%]

   [local count: 445388109]:
  __builtin_strncpy (&a.a, arg.0_1, 16);

   [local count: 1073741825]:
  return;

}

With:

./xgcc -B. ~/Programming/testcases/ice.i -c -O2 -fsanitize-coverage=trace-pc
-fdump-tree-strlen=/dev/stdout

;; Function e (e, funcdef_no=0, decl_uid=2322, cgraph_uid=0, symbol_order=3)

e ()
{
  char * arg.0_1;
  long unsigned int _2;

   [local count: 1073741825]:
  __builtin___sanitizer_cov_trace_pc ();
  arg.0_1 = arg;
  _2 = __builtin_strlen (arg.0_1);
  if (_2 > 1)
goto ; [41.48%]
  else
goto ; [58.52%]

   [local count: 445388109]:
  __builtin___sanitizer_cov_trace_pc ();
  __builtin_strncpy (&a.a, arg.0_1, 16);

   [local count: 1073741825]:
  __builtin___sanitizer_cov_trace_pc ();
  return;

}

I guess it somehow confuses VRP, Martin can you please take a look? Note that
__builtin___sanitizer_cov_trace_pc is pure function, can't modify memory in
original program.

[Bug gcov-profile/84735] [8 Regression] Describe recent gcov data file format changes in gcov-io.h

2018-03-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84735

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-03-06
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Target Milestone|--- |8.0
 Ever confirmed|0   |1
  Known to fail||8.0

[Bug c++/79937] [6/7/8 Regression] ICE in replace_placeholders_r

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79937

--- Comment #12 from Jakub Jelinek  ---
Created attachment 43577
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43577&action=edit
gcc8-pr79937.patch

My #c8 patch doesn't work at all, but this one at least fixes the two testcases
(but indeed doesn't fix one where bar returns X rather than C).

[Bug tree-optimization/28364] poor optimization choices when iterating over a std::string (probably not c++-specific)

2018-03-06 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364

amker at gcc dot gnu.org changed:

   What|Removed |Added

 CC||amker at gcc dot gnu.org

--- Comment #32 from amker at gcc dot gnu.org ---
(In reply to bin.cheng from comment #31)
> This is a really old issue!  I will also check status of this issue on trunk.

For multi-exit cases, I wonder if it's possible to only copy wrto the one
checking IV.  It should still satisfy ch's purpose.

[Bug c++/79937] [6/7/8 Regression] ICE in replace_placeholders_r

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79937

--- Comment #13 from Jakub Jelinek  ---
That said, I've tried:
--- gcc/cp/semantics.c.jj   2018-03-06 08:01:37.851883447 +0100
+++ gcc/cp/semantics.c  2018-03-06 15:19:27.685013764 +0100
@@ -2814,6 +2814,11 @@ finish_compound_literal (tree type, tree
   if (!VECTOR_TYPE_P (type))
 compound_literal = get_target_expr_sfinae (compound_literal, complain);

+  if (TREE_CODE (compound_literal) == TARGET_EXPR)
+compound_literal
+  = replace_placeholders (compound_literal,
+ TARGET_EXPR_SLOT (compound_literal));
+
   return compound_literal;
 }

instead, but that fails miserably during gimplification, seems we optimize away
those TARGET_EXPRs at some point just to their TARGET_EXPR_INITIAL and
referring in that CONSTRUCTOR to the TARGET_EXPR_SLOT then doesn't really work.

The regression was introduced by the:
-case TARGET_EXPR:
-  /* Don't mess with placeholders in an unrelated object.  */
-  *walk_subtrees = false;
-  break;
replace_placeholders_r change, which makes me wonder if replace_placeholders
could somehow make a difference between TARGET_EXPRs it wants to walk into
(e.g. the TARGET_EXPR created in nsdmi-aggr3.C:
#0  make_node (code=TARGET_EXPR) at ../../gcc/tree.c:1056
#1  0x015d4974 in build4 (code=TARGET_EXPR, tt=, arg0=, 
arg1=, arg2=, arg3=) at
../../gcc/tree.c:4797
#2  0x00ace5e4 in build_target_expr (decl=,
value=, complain=3)
at ../../gcc/cp/tree.c:454
#3  0x00acf39c in build_cplus_new (type=,
init=, complain=3)
at ../../gcc/cp/tree.c:631
#4  0x00ad8b16 in bot_manip (tp=0x7fffc3c8,
walk_subtrees=0x7fffc37c, data=0x2dd3c80) at ../../gcc/cp/tree.c:2915
#5  0x015f02f2 in walk_tree_1 (tp=0x7fffc3c8, func=0xad89ae
, data=0x2dd3c80, pset=0x0, 
lh=0xae085b  >*)>) at ../../gcc/tree.c:11400
#6  0x00ad94e2 in break_out_target_exprs (t=) at ../../gcc/cp/tree.c:3050
#7  0x0093e0f2 in get_nsdmi (member=,
in_ctor=false, complain=3) at ../../gcc/cp/init.c:637
and the TARGET_EXPRs created by finish_compound_literal by the testcase
included in the above patch or the:
// PR c++/79937
// { dg-do run { target c++14 } }

struct X {
  unsigned i;
  unsigned n = i;
  unsigned m = i;
};

X
bar (X x)
{
  if (x.i != 1 || x.n != 2 || x.m != 1)
__builtin_abort ();
  return x;
}

int
main ()
{
  X x = bar (X {1, X {2}.n});
  if (x.i != 1 || x.n != 2 || x.m != 1)
__builtin_abort ();
}

E.g. could we walk into TARGET_EXPRs that have TARGET_EXPR_INITIAL
AGGR_INIT_EXPR, but avoid those that have TARGET_EXPR_INITIAL a CONSTRUCTOR, or
a CONSTRUCTOR with certain flags, or have some flags on TARGET_EXPRs?

Tried:
--- gcc/cp/tree.c.jj2018-03-06 08:01:37.851883447 +0100
+++ gcc/cp/tree.c   2018-03-06 16:07:53.296061505 +0100
@@ -3165,6 +3165,13 @@ replace_placeholders_r (tree* t, int* wa
break;
   }

+case TARGET_EXPR:
+  /* Don't mess with placeholders in finish_compound_literal
+created TARGET_EXPRs.  */
+  if (TREE_CODE (TARGET_EXPR_INITIAL (*t)) == CONSTRUCTOR)
+   *walk_subtrees = false;
+  break;
+
 default:
   if (d->pset->add (*t))
*walk_subtrees = false;
but that FAILs nsdmi13.C, where the TARGET_EXPR is created by:
#4  0x015c5ff9 in make_node (code=TARGET_EXPR) at ../../gcc/tree.c:1053
#5  0x015d49ca in build4 (code=TARGET_EXPR, tt=, arg0=, 
arg1=, arg2=, arg3=) at
../../gcc/tree.c:4797
#6  0x00ace5e4 in build_target_expr (decl=,
value=, complain=3)
at ../../gcc/cp/tree.c:454
#7  0x00acfaee in force_target_expr (type=, init=, complain=3)
at ../../gcc/cp/tree.c:782
#8  0x00acfa92 in build_target_expr_with_type (init=, type=, complain=3)
at ../../gcc/cp/tree.c:766
#9  0x00acfc0e in get_target_expr_sfinae (init=, complain=3) at ../../gcc/cp/tree.c:797
#10 0x00821df6 in convert_like_real (convs=0x2e5f280, expr=, fn=, 
argnum=0, issue_conversion_warnings=true, c_cast_p=false, complain=3) at
../../gcc/cp/call.c:6902
#11 0x00821ede in convert_like_real (convs=0x2e5f2b0, expr=, fn=, 
argnum=0, issue_conversion_warnings=true, c_cast_p=false, complain=3) at
../../gcc/cp/call.c:6912
#12 0x00826426 in build_over_call (cand=0x2e5f2e0, flags=1, complain=3)
at ../../gcc/cp/call.c:7945
#13 0x0082d3fb in build_new_method_call_1 (instance=, fns=,

[Bug debug/63572] [6/7/8 Regression] ICF breaks user debugging experience

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.5

[Bug c++/79937] [6/7/8 Regression] ICE in replace_placeholders_r

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79937

--- Comment #14 from Jakub Jelinek  ---
The CONSTRUCTORS in TARGET_EXPR in the pr79937-{1,2,3}.C testcases have all
CONSTRUCTOR_IS_DIRECT_INIT and TREE_HAS_CONSTRUCTOR set, while nsdmi13.C
doesn't.
Does any of those matter?

In the nsdmi13.C case, there is just a single replace_placeholders call on the
whole testcase, so if we don't replace everything, we die during
gimplification,
but in pr79937-{1,2,3}.C the gimplification of the CONSTRUCTOR results in
cp_gimplify_init_expr and calls it there and handles the replacements that
aren't otherwise done.

[Bug c++/80598] [7/8 regression] -Wunused triggers for functions used in uninstantiated templates

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80598

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |7.4

[Bug c++/81764] [6/7/8 Regression] Visibility attributes for explicitly instantiated template class get warned if it has been implicitly instantiated

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81764

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.5

[Bug c++/83268] [7 Regression] internal compiler error: in lambda_expr_this_capture, at cp/lambda.c:785

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83268

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |7.4

[Bug c++/83911] [6/7/8 Regression] ICE with target attribute on constructor in gimplify_expr at gimplify.c:11321

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83911

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |6.5

[Bug middle-end/84034] [6/7 Regression] incomplete warning message with dos line endings

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84034

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||8.0
   Target Milestone|--- |6.5

[Bug tree-optimization/84178] [7/8 Regression] ICE in release_bb_predicate

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84178

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |7.4

[Bug target/84280] [6/7/8 Regression] Performance regression in g++-7 with Eigen for non-AVX2 CPUs

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84280

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.5

[Bug fortran/84394] [7/8 Regression] compiler error when using modules with derived types in block data subprograms

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84394

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.4

[Bug c++/84611] [6/7/8 Regression] ICE in operator[], at vec.h:826 (local_class_index())

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84611

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |6.5
Summary|[5/67/8 Regression] ICE in  |[6/7/8 Regression] ICE in
   |operator[], at vec.h:826|operator[], at vec.h:826
   |(local_class_index())   |(local_class_index())

[Bug c++/84588] [8 Regression] internal compiler error: Segmentation fault (contains_struct_check())

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84588

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |8.0

[Bug c++/84221] [6/7/8 Regression] spurious -Wunused warning on a variable of a template type declared unused

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84221

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/84222] [6/7/8 Regression] [[deprecated]] class complains about internal class usage

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84222

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug lto/84241] [8 regression] test case g++.dg/torture/pr67600.C fails starting with r257412

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84241

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug target/84719] gcc's __builtin_memcpy performance with certain number of bytes is terrible compared to clang's

2018-03-06 Thread manuel.lauss at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84719

Manuel Lauss  changed:

   What|Removed |Added

 CC||manuel.lauss at googlemail dot 
com

--- Comment #12 from Manuel Lauss  ---
clang-7 achieves an impressive level of ipc (amd zen):

 Performance counter stats for './memtime-clangO2' (10 runs):

358,260795  task-clock:u (msec)   #0,999 CPUs utilized 
  ( +-  1,43% )
 0  context-switches:u#0,000 K/sec  
 0  cpu-migrations:u  #0,000 K/sec  
   244.191  page-faults:u #0,682 M/sec 
  ( +-  0,00% )
 1.253.573.425  cycles:u  #3,499 GHz   
  ( +-  1,50% )
   149.207.036  stalled-cycles-frontend:u #   11,90% frontend cycles
idle ( +-  2,04% )
   333.373.414  stalled-cycles-backend:u  #   26,59% backend cycles
idle  ( +-  0,00% )
 4.333.767.562  instructions:u#3,46  insn per cycle 
  #0,08  stalled cycles per
insn  ( +-  0,00% )
   333.621.304  branches:u#  931,225 M/sec 
  ( +-  0,00% )
   248.011  branch-misses:u   #0,07% of all branches   
  ( +-  0,06% )

   0,358644336 seconds time elapsed
 ( +-  1,43% )


compared to gcc-8 as of today:
 Performance counter stats for './memtime-gcc8O2' (10 runs):

   2087,357431  task-clock:u (msec)   #1,000 CPUs utilized 
  ( +-  0,19% )
 0  context-switches:u#0,000 K/sec  
 0  cpu-migrations:u  #0,000 K/sec  
   244.191  page-faults:u #0,117 M/sec 
  ( +-  0,00% )
 8.273.911.027  cycles:u  #3,964 GHz   
  ( +-  0,00% )
 3.691.281.142  stalled-cycles-frontend:u #   44,61% frontend cycles
idle ( +-  0,02% )
   333.373.414  stalled-cycles-backend:u  #4,03% backend cycles
idle  ( +-  0,00% )
 3.667.101.412  instructions:u#0,44  insn per cycle 
  #1,01  stalled cycles per
insn  ( +-  0,00% )
   333.621.824  branches:u#  159,830 M/sec 
  ( +-  0,00% )
   248.423  branch-misses:u   #0,07% of all branches   
  ( +-  0,01% )

   2,088370519 seconds time elapsed
 ( +-  0,19% )

[Bug target/84251] [8 Regression] Performance regression in gcc 8 when comparing floating point numbers

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84251

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

--- Comment #6 from Richard Biener  ---
So we changed wrong-code to missed-optimization.  Sounds reasonable enough to
not make this P1.

[Bug target/84301] [6/7/8 Regression] ICE in create_pre_exit, at mode-switching.c:451

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84301

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug rtl-optimization/84345] [8 Regression] ICE: qsort checking failed (error: qsort comparator non-negative on sorted output: 1)

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84345

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug testsuite/84456] [8 regression] gcc.dg/guality/pr49888.c fail

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84456

Richard Biener  changed:

   What|Removed |Added

  Component|debug   |testsuite

--- Comment #3 from Richard Biener  ---
So it's a testsuite issue?  Can somebody with a recent assembler verify with
-gno-whatever?  Maybe we need a dg-require-effective-target locview?

[Bug tree-optimization/84468] [8 Regression] bogus -Wstringop-truncation despite assignment after conditional strncpy

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84468

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #16 from Richard Biener  ---
I still say simply walk to the next VDEF...

[Bug debug/84550] [8 Regression] stepping through gcc does not work with gdb 8.0.1

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84550

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #8 from Richard Biener  ---
Raising priority.  A fix can be either in GCC or in gdb (we can just document a
new gdb requirement).

[Bug tree-optimization/84552] [8 Regression] Compile time hog w/ -O2 -floop-nest-optimize -fno-tree-copy-prop -fno-tree-fre -fno-tree-loop-ivcanon

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84552

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug target/84565] [8 Regression] ICE in extract_insn, at recog.c:2304 on aarch64

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84565

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/84610] [6/7/8 Regression] ICE in synthesize_implicit_template_parm, at cp/parser.c:38843

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84610

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/84650] [8 Regression] [graphite] ICE: Segmentation fault (in create_new_iv)

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84650

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug c++/84729] [6/7/8 Regression] internal compiler error: verify_gimple failed

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84729

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/80511] [8 Regression] gcc.dg/Wstrict-overflow-18.c gcc.dg/Wstrict-overflow-7.c gcc.dg/pragma-diag-3.c

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80511

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug c++/79937] [6/7/8 Regression] ICE in replace_placeholders_r

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79937

--- Comment #15 from Jakub Jelinek  ---
Created attachment 43578
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43578&action=edit
gcc8-pr79937.patch

Actually, seems TREE_HAS_CONSTRUCTOR is set on a CONSTRUCTOR only by
finish_compound_literal.  So if those are something we don't want to walk into
and everything else we do, then this patch might be it (passed make
check-c++-all, but otherwise untested).

[Bug rtl-optimization/80791] [8 regression] test case gcc.dg/sms-1.c fail2 starting with r247885

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80791

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/81572] [7 Regression] gcc-7 regression: unnecessary vector regmove on compare

2018-03-06 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81572

--- Comment #7 from Peter Bergner  ---
Author: bergner
Date: Tue Mar  6 15:54:30 2018
New Revision: 258280

URL: https://gcc.gnu.org/viewcvs?rev=258280&root=gcc&view=rev
Log:
gcc/
Backport from mainline
2018-02-22  Vladimir Makarov  

PR target/81572
* lra-int.h (LRA_UNKNOWN_ALT, LRA_NON_CLOBBERED_ALT): New macros.
* lra.c (lra_set_insn_recog_data, lra_update_insn_recog_data): Use
LRA_UNKNOWN_ALT.
* lra-constraints.c (curr_insn_transform): Set up
LRA_NON_CLOBBERED_ALT for moves processed on the fast path.  Use
LRA_UNKNOWN_ALT.
(remove_inheritance_pseudos): Use LRA_UNKNOWN_ALT.
* lra-eliminations.c (spill_pseudos): Ditto.
(process_insn_for_elimination): Ditto.
* lra-lives.c (reg_early_clobber_p): Use the new macros.
* lra-spills.c (spill_pseudos): Use LRA_UNKNOWN_ALT and
LRA_NON_CLOBBERED_ALT.

gcc/testsuite/
Backport from mainline
2018-02-22  Vladimir Makarov  

PR target/81572
* gcc.target/powerpc/pr81572.c: New.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/pr81572.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/lra-constraints.c
branches/gcc-7-branch/gcc/lra-eliminations.c
branches/gcc-7-branch/gcc/lra-int.h
branches/gcc-7-branch/gcc/lra-lives.c
branches/gcc-7-branch/gcc/lra-spills.c
branches/gcc-7-branch/gcc/lra.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/81764] [6/7/8 Regression] Visibility attributes for explicitly instantiated template class get warned if it has been implicitly instantiated

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81764

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/81572] [7 Regression] gcc-7 regression: unnecessary vector regmove on compare

2018-03-06 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81572

Peter Bergner  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED
URL||https://gcc.gnu.org/ml/gcc-
   ||patches/2018-02/msg01310.ht
   ||ml

--- Comment #8 from Peter Bergner  ---
Backport testing was clean.  Patch committed to the GCC 7 release branch.
Closing as fixed everywhere.

[Bug debug/84550] [8 Regression] stepping through gcc does not work with gdb 8.0.1

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84550

--- Comment #9 from Jakub Jelinek  ---
My limited understanding is this is a GDB bug and that it basically never
worked properly with -freorder-blocks-and-partition.  So not really sure how we
could work around it in GCC.  Pedro, do you agree?

[Bug c++/84736] New: When compiling with -g -O2 internal compiler error: in force_type_die, at dwarf2out.c:25111

2018-03-06 Thread kuba.skowron at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84736

Bug ID: 84736
   Summary: When compiling with -g -O2 internal compiler error: in
force_type_die, at dwarf2out.c:25111
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kuba.skowron at gmail dot com
  Target Milestone: ---

Created attachment 43579
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43579&action=edit
Zipped first.ii file

There is internal compiler error when compiling with -g -O2 (ii file attached).

$ g++-7 -save-temps -Wall -g -O2 first.cpp
In file included from osd/OSD.cc:51:0:
osd/ReplicatedPG.h: In destructor ‘virtual
ReplicatedPG::WaitTrimTimer::WaitTrimTimer(boost::statechart::state::my_context)::OnTimer::~OnTimer()’:
osd/ReplicatedPG.h:1667:14: internal compiler error: in force_type_die, at
dwarf2out.c:25111
   struct OnTimer : Context {
  ^~~
0x8206ba force_type_die
../../src/gcc/dwarf2out.c:25111
0x82089b get_context_die
../../src/gcc/dwarf2out.c:25025
0x82089b force_decl_die
../../src/gcc/dwarf2out.c:25044
0x81ba47 gen_subprogram_die
../../src/gcc/dwarf2out.c:21905
0x816138 gen_decl_die
../../src/gcc/dwarf2out.c:25347
0x816e6e dwarf2out_decl
../../src/gcc/dwarf2out.c:25856
0x81cb42 dwarf2out_abstract_function
../../src/gcc/dwarf2out.c:21681
0xb46695 expand_call_inline
../../src/gcc/tree-inline.c:4887
0xb48084 gimple_expand_calls_inline
../../src/gcc/tree-inline.c:4917
0xb48084 optimize_inline_calls(tree_node*)
../../src/gcc/tree-inline.c:5057
0x113f6a9 early_inliner(function*)
../../src/gcc/ipa-inline.c:2721

$ g++-7 -v
Using built-in specs.
COLLECT_GCC=g++-7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
7.2.0-1ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--with-target-system-zlib --enable-objc-gc=auto --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-1ubuntu1~16.04)

  1   2   >