[Bug tree-optimization/89772] New: memchr for a character not in constant nul-padded string not folded

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89772

Bug ID: 89772
   Summary: memchr for a character not in constant nul-padded
string not folded
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Only the first of the two calls to memchr below is folded, the second one
isn't.  Looks like it's simply because fold_const_call considers only string
lengths (it calls c_getstr()) and doesn't take advantage of the knowledge that
all the other characters past the terminating NUL are also NUL.

If fold_const_call either called string_constant instead, or if c_getstr()
exposed the size of the constant string in addition to its length, it would be
able to fold the second call as well.

$ cat u.c && gcc -O2 -S -Wall -Wextra -Wpedantic
-fdump-tree-optimized=/dev/stdout u.c
const char a[5] = "123";

void f3 (void)
{
  if (!__builtin_memchr (a, '3', sizeof a))   // folded to false
__builtin_abort ();
}

void f7 (void)
{
  if (__builtin_memchr (a, '7', sizeof a))   // not folded
__builtin_abort ();
}

;; Function f3 (f3, funcdef_no=0, decl_uid=1907, cgraph_uid=1, symbol_order=1)

f3 ()
{
   [local count: 1073741824]:
  return;

}



;; Function f7 (f7, funcdef_no=1, decl_uid=1910, cgraph_uid=2, symbol_order=2)

f7 ()
{
  void * _1;

   [local count: 1073741824]:
  _1 = __builtin_memchr (, 55, 5);
  if (_1 != 0B)
goto ; [0.00%]
  else
goto ; [100.00%]

   [count: 0]:
  __builtin_abort ();

   [local count: 1073741824]:
  return;

}

[Bug testsuite/89771] [9 regression] c-c++-common/Wrestrict.c fails starting with r269807

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89771

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org

--- Comment #1 from Martin Sebor  ---
r269809 should clear up the failures.  See also:
https://gcc.gnu.org/ml/gcc-patches/2019-03/msg00944.html

[Bug tree-optimization/89688] [9 Regression] -Wstringop-overflow confused by const 2D array of char

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89688

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #6 from Martin Sebor  ---
Patch committed in r269814.

[Bug tree-optimization/83819] [meta-bug] missing strlen optimizations

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819
Bug 83819 depends on bug 89688, which changed state.

Bug 89688 Summary: [9 Regression] -Wstringop-overflow confused by const 2D 
array of char
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89688

   What|Removed |Added

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

[Bug tree-optimization/89688] [9 Regression] -Wstringop-overflow confused by const 2D array of char

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89688

--- Comment #5 from Martin Sebor  ---
Author: msebor
Date: Tue Mar 19 22:43:10 2019
New Revision: 269814

URL: https://gcc.gnu.org/viewcvs?rev=269814=gcc=rev
Log:
PR tree-optimization/89688 - -Wstringop-overflow confused by const 2D array of
char

gcc/c/ChangeLog:

PR tree-optimization/89688
* c-decl.c (finish_decl): Call braced_lists_to_string for more
kinds of initializers.

gcc/c-family/ChangeLog:

PR tree-optimization/89688
* c-common.c (braced_list_to_string): Make static.
(braced_lists_to_strings): Define new function.
* c-common.h (braced_list_to_string): Remove.
(braced_lists_to_strings): Declare.

gcc/cp/ChangeLog:

PR tree-optimization/89688
* typeck2.c (store_init_value): Call braced_lists_to_string for more
kinds of initializers.

gcc/testsuite/ChangeLog:

PR tree-optimization/89688
* gcc.dg/strlenopt-61.c: New test.
* g++.dg/warn/Wstringop-overflow-2.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/warn/Wstringop-overflow-2.C
trunk/gcc/testsuite/gcc.dg/strlenopt-61.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c-family/c-common.h
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog

[Bug target/89411] RISC-V backend will generate wrong instruction for longlong type like lw a3,-2048(a5)

2019-03-19 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89411

Jim Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |wilson at gcc dot 
gnu.org

--- Comment #6 from Jim Wilson  ---
Fixed, with testcase added.

[Bug target/89411] RISC-V backend will generate wrong instruction for longlong type like lw a3,-2048(a5)

2019-03-19 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89411

--- Comment #5 from Jim Wilson  ---
Author: wilson
Date: Tue Mar 19 22:33:34 2019
New Revision: 269813

URL: https://gcc.gnu.org/viewcvs?rev=269813=gcc=rev
Log:
RISC-V: Fix %lo overflow with BLKmode references.

gcc/
PR target/89411
* config/riscv/riscv.c (riscv_valid_lo_sum_p): New arg x.  New locals
align, size, offset.  Use them to handle a BLKmode reference.  Update
comment.
(riscv_classify_address): Pass info->offset to riscv_valid_lo_sum_p.

gcc/testsuite/
PR target/89411
* gcc.target/riscv/losum-overflow.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/riscv/losum-overflow.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/riscv/riscv.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/89601] [8 Regression] [PDT] ICE: Segmentation fault (in resolve_component)

2019-03-19 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89601

janus at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #7 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #6)
> Is this fixed or is there any plan to back port r269658?

Fixed on trunk only up to now. I don't think it's worth backporting. Closing
this PR as fixed.

[Bug fortran/82173] [meta-bug] Parameterized derived type errors

2019-03-19 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82173
Bug 82173 depends on bug 89601, which changed state.

Bug 89601 Summary: [8 Regression] [PDT] ICE: Segmentation fault (in 
resolve_component)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89601

   What|Removed |Added

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

[Bug c++/87145] [7/8/9 Regression] Implicit conversion to scoped enum fails: "error: taking address of temporary/rvalue"

2019-03-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87145

--- Comment #5 from Marek Polacek  ---
It's _strict since https://gcc.gnu.org/ml/gcc-patches/2010-09/msg02144.html --
that was a desirable change.

[Bug fortran/83515] ICE: Invalid expression in gfc_element_size

2019-03-19 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83515

--- Comment #8 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #7)
The following patch fixes the ICE:

Index: trans-types.c
===
--- trans-types.c   (revision 269779)
+++ trans-types.c   (working copy)
@@ -1194,6 +1194,9 @@
basetype = pfunc_type_node;
}
break;
+case BT_PROCEDURE:
+  basetype = pfunc_type_node;
+  break;
 default:
   gcc_unreachable ();
 }
Index: target-memory.c
===
--- target-memory.c (revision 269779)
+++ target-memory.c (working copy)
@@ -120,6 +120,7 @@
 case BT_CLASS:
 case BT_VOID:
 case BT_ASSUMED:
+case BT_PROCEDURE:
   {
/* Determine type size without clobbering the typespec for ISO C
   binding types.  */

However, I do not have a working code sample to run.

[Bug fortran/83515] ICE: Invalid expression in gfc_element_size

2019-03-19 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83515

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #7 from anlauf at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #3)

In class.c we have:

Breakpoint 1, find_intrinsic_vtab (ts=0x2474758)
at ../../trunk/gcc/fortran/class.c:2715
2715gfc_element_size (e, _size);

(gdb) p e->ts.type
$8 = BT_PROCEDURE

This case is something that is generally not handled.
What is the storage size of procedure (pointers)?

This needs to be added in gfc_element_size or gfc_typenode_for_spec,
and the call in class.c needs to be adjusted accordingly.

[Bug c++/87145] [7/8/9 Regression] Implicit conversion to scoped enum fails: "error: taking address of temporary/rvalue"

2019-03-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87145

--- Comment #4 from Marek Polacek  ---
The fix for 77656 caused us to call convert_nontype_argument even for
value-dependent arguments, to perform the conversion in order to avoid a bogus
warning.

In this case, the argument is Pod{N}.  The call to
build_converted_constant_expr in convert_nontype_argument produces
Pod::operator Enum(&{N}).  It doesn't crash because we're in a template and
build_address no longer crashed on CONSTRUCTORs in a template.

Then when instantiating  function foo we substitute its argument: &{N}.  So
we're in tsubst_copy_and_build/ADDR_EXPR.  The call to
tsubst_non_call_postfix_expression turns {N} into TARGET_EXPR .
Then build_x_unary_op is supposed to put the ADDR_EXPR back.  It calls
cp_build_addr_expr_strict.  But it's *strict*, so the prvalue of class type
TARGET_EXPR  isn't allowed -> error.

[Bug testsuite/89771] New: [9 regression] c-c++-common/Wrestrict.c fails starting with r269807

2019-03-19 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89771

Bug ID: 89771
   Summary: [9 regression] c-c++-common/Wrestrict.c fails starting
with r269807
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

There are a whole bunch of new failures from this test case starting with
r269807. 


r269807 | msebor | 2019-03-19 12:45:34 -0500 (Tue, 19 Mar 2019) | 14 lines

PR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on
strncpy

gcc/ChangeLog:

PR tree-optimization/89644
* tree-ssa-strlen.c (handle_builtin_stxncpy): Consider unterminated
arrays in determining sequence sizes in strncpy and stpncpy.

gcc/testsuite/ChangeLog:

PR tree-optimization/89644
* gcc.dg/Wstringop-truncation-8.c: New test.

Some of the excess errors:

Excess errors:
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:811:3:
warning: 'strncpy' accessing 4 bytes at offsets 0 and 1 overlaps 2 bytes at
offset 1 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:812:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and 1 overlaps 2 bytes at
offset 1 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:813:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and 1 overlaps 2 bytes at
offset 1 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:819:3:
warning: 'strncpy' accessing 4 bytes at offsets 0 and 2 overlaps 1 byte at
offset 2 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:820:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and 2 overlaps 1 byte at
offset 2 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:827:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and 2 overlaps 2 bytes at
offset 2 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:828:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and 2 overlaps 2 bytes at
offset 2 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:867:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and [1, 5] may overlap up to
3 bytes at offset [3, 1] [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:875:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and [2, 5] may overlap up to
2 bytes at offset [3, 2] [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:876:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and [2, 5] may overlap up to
2 bytes at offset [3, 2] [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:884:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and [3, 5] may overlap 1 byte
at offset 3 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:885:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and [3, 5] may overlap 1 byte
at offset 3 [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:893:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and [4, 5] may overlap up to
0 bytes at offset [9223372036854775807, -9223372036854775808] [-Wrestrict]
/home/seurer/gcc/gcc-trunk/gcc/testsuite/c-c++-common/Wrestrict.c:894:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and [4, 5] may overlap up to
0 bytes at offset [9223372036854775807, -9223372036854775808] [-Wrestrict]


diff between r269806's and r267807's output for one run:

131,133c131,133
< /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:811:3:
warning: 'strncpy' accessing 4 bytes at offsets 0 and 1 overlaps 3 bytes at
offset 1 [-Wrestrict]
< /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:812:3:
warning: 'strncpy' accessing 5 bytes at offsets 0 and 1 overlaps 3 bytes at
offset 1 [-Wrestrict]
< /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:813:3:
warning: 'strncpy' accessing 6 bytes at offsets 0 and 1 overlaps 3 bytes at
offset 1 [-Wrestrict]
---
> /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:811:3: 
> warning: 'strncpy' accessing 4 bytes at offsets 0 and 1 overlaps 2 bytes at 
> offset 1 [-Wrestrict]
> /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:812:3: 
> warning: 'strncpy' accessing 5 bytes at offsets 0 and 1 overlaps 2 bytes at 
> offset 1 [-Wrestrict]
> /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:813:3: 
> warning: 'strncpy' accessing 6 bytes at offsets 0 and 1 overlaps 2 bytes at 
> offset 1 [-Wrestrict]
135,136c135,136
< /home/seurer/gcc/gcc-test/gcc/testsuite/c-c++-common/Wrestrict.c:819:3:
warning: 'strncpy' accessing 4 bytes at offsets 0 and 2 overlaps 

[Bug middle-end/89769] [7/8/9 Regression] attribute((aligned(x))) array testcase run error with option -fno-tree-loop-im

2019-03-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

--- Comment #5 from Andrew Pinski  ---
Isn't this a dup of bug 43798 ?

[Bug middle-end/89769] [7/8/9 Regression] attribute((aligned(x))) array testcase run error with option -fno-tree-loop-im

2019-03-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||pinskia at gcc dot gnu.org

--- Comment #4 from Andrew Pinski  ---
I had a similar report to me but I never got around to debugging it and filing
this.  NOTE my report to me did not require -fno-tree-loop-im to run into the
issue.

[Bug rtl-optimization/89768] [7/8 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8/9 Regression] ICE in   |[7/8 Regression] ICE in
   |compare_and_jump_seq at |compare_and_jump_seq at
   |loop-unroll.c:838   |loop-unroll.c:838

--- Comment #5 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug rtl-optimization/89768] [7/8/9 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 19 19:04:14 2019
New Revision: 269812

URL: https://gcc.gnu.org/viewcvs?rev=269812=gcc=rev
Log:
PR rtl-optimization/89768
* loop-unroll.c (unroll_loop_constant_iterations): Use gen_int_mode
instead of GEN_INT.
(unroll_loop_runtime_iterations): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-unroll.c

[Bug fortran/71861] [7/8/9 Regression] [F03] ICE in write_symbol(): bad module symbol

2019-03-19 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71861

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |ice-on-invalid-code

--- Comment #9 from janus at gcc dot gnu.org ---
(In reply to janus from comment #8)
> I'm about to regtest this ...

No failures observed.

[Bug tree-optimization/89644] [8 Regression] false-positive -Warray-bounds on strncpy with unterminated array

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89644

--- Comment #5 from Martin Sebor  ---
Author: msebor
Date: Tue Mar 19 18:35:42 2019
New Revision: 269809

URL: https://gcc.gnu.org/viewcvs?rev=269809=gcc=rev
Log:
PR tree-optimization/89644 - false-positive -Warray-bounds on strncpy with
unterminated array

gcc/ChangeLog:
* tree-ssa-strlen.c (handle_builtin_stxncpy): Use full_string_p
rather than endptr as an indicator of nul-termination.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-strlen.c

[Bug c++/87145] [7/8/9 Regression] Implicit conversion to scoped enum fails: "error: taking address of temporary/rvalue"

2019-03-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87145

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
This hunk in particular broke this:

@@ -7278,7 +7306,7 @@ convert_template_argument (tree parm,
  val = error_mark_node;
}
}
-  else if (!dependent_template_arg_p (orig_arg)
+  else if (!type_dependent_expression_p (orig_arg)
   && !uses_template_parms (t))
/* We used to call digest_init here.  However, digest_init
   will report errors, which we don't want when complain

[Bug debug/88389] -flto -g -gsplit-dwarf is broken

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389

--- Comment #6 from Richard Biener  ---
Mitigated for GCC 8+ by ignoring -gsplit-dwarf with -flto.

[Bug tree-optimization/89644] [8 Regression] false-positive -Warray-bounds on strncpy with unterminated array

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89644

Martin Sebor  changed:

   What|Removed |Added

Summary|[8/9 Regression]|[8 Regression]
   |false-positive  |false-positive
   |-Warray-bounds on strncpy   |-Warray-bounds on strncpy
   |with unterminated array |with unterminated array
  Known to fail|9.0 |

--- Comment #4 from Martin Sebor  ---
Fixed in GCC 9.0 via r269807.

[Bug debug/88389] -flto -g -gsplit-dwarf is broken

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Tue Mar 19 17:46:22 2019
New Revision: 269808

URL: https://gcc.gnu.org/viewcvs?rev=269808=gcc=rev
Log:
2019-03-19  Richard Biener  

PR debug/88389
* opts.c (finish_options): Disable -gsplit-dwarf when doing LTO.

Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/opts.c

[Bug tree-optimization/89644] [8/9 Regression] false-positive -Warray-bounds on strncpy with unterminated array

2019-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89644

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Tue Mar 19 17:45:34 2019
New Revision: 269807

URL: https://gcc.gnu.org/viewcvs?rev=269807=gcc=rev
Log:
PR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on
strncpy

gcc/ChangeLog:

PR tree-optimization/89644
* tree-ssa-strlen.c (handle_builtin_stxncpy): Consider unterminated
arrays in determining sequence sizes in strncpy and stpncpy.

gcc/testsuite/ChangeLog:

PR tree-optimization/89644
* gcc.dg/Wstringop-truncation-8.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/Wstringop-truncation-8.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-strlen.c

[Bug web/89770] New: move java-related mailing lists on lists.html to the "Historical lists" section

2019-03-19 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89770

Bug ID: 89770
   Summary: move java-related mailing lists on lists.html to the
"Historical lists" section
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Keywords: documentation
  Severity: normal
  Priority: P3
 Component: web
  Assignee: unassigned at gcc dot gnu.org
  Reporter: egallager at gcc dot gnu.org
CC: gerald at pfeifer dot com
  Target Milestone: ---

Right now java-related mailing lists are still listed in the active mailing
lists section of lists.html, giving the impression that they are still active:
https://gcc.gnu.org/lists.html
They should be moved to the "Historical lists (archives only, no longer in
use)" section since java has been removed.

[Bug ipa/89762] [8 Regression] Mixing optimization levels with ostream gives lto1: internal compiler error: in get_odr_type, at ipa-devirt.c:2098

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89762

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #3 from Martin Liška  ---
Thank you Honza, I am assigning that to you.

[Bug middle-end/89737] [9 Regression] ICE in set_even_probabilities at predict.c:893 since r267485

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89737

Martin Liška  changed:

   What|Removed |Added

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

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

[Bug middle-end/89737] [9 Regression] ICE in set_even_probabilities at predict.c:893 since r267485

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89737

--- Comment #2 from Martin Liška  ---
Author: marxin
Date: Tue Mar 19 17:08:28 2019
New Revision: 269804

URL: https://gcc.gnu.org/viewcvs?rev=269804=gcc=rev
Log:
Fix set of even probabilities (PR middle-end/89737).

2019-03-19  Martin Liska  

PR middle-end/89737
* predict.c (combine_predictions_for_bb): Empty likely_edges and
unlikely_edges if there's an edge that belongs to both these sets.
2019-03-19  Martin Liska  

PR middle-end/89737
* gcc.dg/pr89737.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr89737.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/predict.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/71861] [7/8/9 Regression] [F03] ICE in write_symbol(): bad module symbol

2019-03-19 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71861

janus at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #8 from janus at gcc dot gnu.org ---
(In reply to kargl from comment #7)
> Does Note 15.2 in F2018 apply?
> 
>An interface body cannot be used to describe the interface of an
>internal procedure, a module procedure that is not a separate module
>procedure, or an intrinsic procedure because the interfaces of such
>procedures are already explicit. However, the name of a procedure
>can appear in a PROCEDURE statement in an interface block (15.4.3.2).

Probably yes. In any case, the test cases are rejected with an INTERFACE that
is not ABSTRACT:

Error: EXTERNAL attribute conflicts with INTRINSIC attribute at (1)


With an ABSTRACT INTERFACE, they can be rejected via:

diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index c342d62ead1..ec753229a98 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -557,6 +557,7 @@ check_conflict (symbol_attribute *attr, const char *name,
locus *where)

   conf (external, intrinsic);
   conf (entry, intrinsic);
+  conf (abstract, intrinsic);

   if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained)
 conf (external, subroutine);



I'm about to regtest this ...

[Bug libstdc++/85965] [8/9 Regression] G++ gives cryptic error instead of incomplete type

2019-03-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965

--- Comment #5 from Jonathan Wakely  ---
No problem, it's not the reporter's responsibility to categorise it correctly.

[Bug target/89746] powerpc-none-eabi-gcc emits code using stfiwx to misaligned address

2019-03-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89746

--- Comment #7 from Segher Boessenkool  ---
Author: segher
Date: Tue Mar 19 16:58:42 2019
New Revision: 269802

URL: https://gcc.gnu.org/viewcvs?rev=269802=gcc=rev
Log:
rs6000: Unaligned stfiwx on older CPUs (PR89746)

The "classic" PowerPCs (6xx/7xx) are not STRICT_ALIGNMENT, but their
floating point units are.  This is not normally a problem, the ABIs
make everything FP aligned.  The RTL patterns converting FP to integer
however get a potentially unaligned destination, and we do not want to
do an stfiwx on that on such older CPUs.

This fixes it.  It does not change anything for TARGET_MFCRF targets
(POWER4 and later).  It also won't change anything for strict-alignment
targets, or CPUs without hardware FP of course, or CPUs that do not
implement stfiwx (older 4xx/5xx/8xx).

It does not change the corresponding fixuns* pattern, because that can
not be enabled on any CPU that cannot handle unaligned FP well.


PR target/89746
* config/rs6000/rs6000.md (fix_truncsi2_stfiwx): If we have a
non-TARGET_MFCRF target, and the dest is memory but not 32-bit aligned,
go via a stack temporary.

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

[Bug libstdc++/85965] [8/9 Regression] G++ gives cryptic error instead of incomplete type

2019-03-19 Thread psmith at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965

--- Comment #4 from Paul Smith  ---
Oops sorry: I guess I'm not familiar enough with the vagaries of the bug
trackers :).  Thanks Jonathan!

[Bug fortran/89751] [PDT] ICE: Segmentation fault (in resolve_component)

2019-03-19 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89751

janus at gcc dot gnu.org changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=89707

--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> The test compiles with the following patch
> 
> --- ../_clean/gcc/fortran/resolve.c   2019-03-18 09:41:55.0 +0100
> +++ gcc/fortran/resolve.c 2019-03-18 11:37:56.0 +0100
> @@ -13973,7 +13976,7 @@ resolve_component (gfc_component *c, gfc
>  }
>  
>/* Procedure pointer components: Check PASS arg.  */
> -  if (c->attr.proc_pointer && !c->tb->nopass && c->tb->pass_arg_num == 0
> +  if (c->attr.proc_pointer && c->tb && !c->tb->nopass &&
> c->tb->pass_arg_num == 0
>&& !sym->attr.vtype)
>  {
>gfc_symbol* me_arg;

I don't think this is a particularly good idea. One should rather make sure
that the tb component is present, e.g. via:

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 749faf9fabe..86beb2c6f2f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3737,6 +3737,7 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list,
gfc_symbol **sym,

   c2->ts = c1->ts;
   c2->attr = c1->attr;
+  c2->tb = c1->tb;

   /* The order of declaration of the type_specs might not be the
 same as that of the components.  */

However this runs into a different ICE :(


> However I have no idea if the test is valid or not.

I would say it is valid (at least I don't see why it wouldn't be).


This is very much related to PR 89707, almost a duplicate.

[Bug libstdc++/85965] [8/9 Regression] G++ gives cryptic error instead of incomplete type

2019-03-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
  Known to work||7.3.0
   Keywords|diagnostic  |rejects-valid
   Last reconfirmed||2019-03-19
  Component|c++ |libstdc++
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|G++ gives cryptic error |[8/9 Regression] G++ gives
   |instead of incomplete type  |cryptic error instead of
   ||incomplete type
   Target Milestone|--- |8.4
  Known to fail||8.3.0, 9.0

--- Comment #3 from Jonathan Wakely  ---
(In reply to Hedayat Vatankhah from comment #2)
> Probably, __is_invocable<> should not signal an error if it finds an
> incomplete type, or it should be replaced with a construct that doesn't.

It's not possible for a type trait to give a different answer depending whether
a type is complete or not. That would violate the One-Definition Rule.

I'd forgotten about this issue because the component wasn't libstdc++. I will
remove the is_invocable checks.

[Bug target/89378] [9 regression][MIPS] FAIL: gcc.dg/vect/pr88598-3.c -mmsa (internal compiler error)

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89378

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

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

[Bug ipa/89684] [8 Regression] ICE in gsi_for_stmt, at gimple-iterator.c:613

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89684

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9 Regression] ICE in |[8 Regression] ICE in
   |gsi_for_stmt, at|gsi_for_stmt, at
   |gimple-iterator.c:613   |gimple-iterator.c:613

--- Comment #7 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug target/89378] [9 regression][MIPS] FAIL: gcc.dg/vect/pr88598-3.c -mmsa (internal compiler error)

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89378

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 19 16:10:59 2019
New Revision: 269801

URL: https://gcc.gnu.org/viewcvs?rev=269801=gcc=rev
Log:
PR target/89378
* config/mips/mips.c (mips_expand_vec_cond_expr): Use gen_lowpart
instead of gen_rtx_SUBREG.
* config/mips/mips-msa.md (vec_extract): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/mips/mips-msa.md
trunk/gcc/config/mips/mips.c

[Bug target/89726] [7/8 Regression] Incorrect inlined version of 'ceil' for 32bit

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89726

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8/9 Regression]  |[7/8 Regression] Incorrect
   |Incorrect inlined version   |inlined version of 'ceil'
   |of 'ceil' for 32bit |for 32bit

--- Comment #9 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

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 45997
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45997=edit
gcc9-pr89767.patch

Untested fix.

[Bug ipa/89693] [9 Regression] ICE: verify_cgraph_node failed (error: edge points to wrong declaration)

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89693

Jan Hubicka  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #2 from Jan Hubicka  ---
ip-cp clones thunk:
Evaluating opportunities for virtual C* C::_ZTch0_h8_N1C3TwoEv()/5. 
 - Creating a specialized node of virtual C* C::_ZTch0_h8_N1C3TwoEv()/5 for all
known contexts.
 the new node is _ZTch0_h8_N1C3TwoEv.constprop/41.

and this makes verifier unhappy. clone_of returns false for:
(gdb) p node->debug ()
_ZTchn8_h8_N1C3TwoEv/7 (virtual C* C::_ZTchn8_h8_N1C3TwoEv()) @0x770e9ca8
  Type: function definition analyzed
  Visibility: externally_visible asm_written public virtual artificial
  Address is taken.
  References: 
  Referring: _ZTV1C/25 (addr)
  Availability: available
  Function flags: indirect_call_target
  Thunk fixed offset -8 virtual value 0 indirect_offset 0 has virtual offset 0
  Called by: 
  Calls: C* C::*.LTHUNK1()/6 
$21 = void
(gdb) p node2->debug ()
_ZTch0_h8_N1C3TwoEv.constprop.0/41 (_ZTch0_h8_N1C3TwoEv.constprop)
@0x77262708
  Type: function definition analyzed
  Visibility: artificial
  References: 
  Referring: 
  Clone of _ZTch0_h8_N1C3TwoEv/5
  Availability: local
  Function flags: count:1 (estimated locally) local
  Former thunk fixed offset 8 virtual value 0 indirect_offset 0 has virtual
offset 0
  Called by: int main()/24 (1073741824 (estimated locally),1.00 per call) 
  Calls: 

I think the bug here is that Martin's patch makes clone_of to look at thunk
target of _ZTchn8_h8_N1C3TwoEv, but _ZTch0_h8_N1C3TwoEv.constprop.0 actual
clone of _ZTchn8_h8_N1C3TwoEv.

[Bug middle-end/89769] [7/8/9 Regression] attribute((aligned(x))) array testcase run error with option -fno-tree-loop-im

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

Richard Biener  changed:

   What|Removed |Added

 CC||jsm28 at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
  Component|tree-optimization   |middle-end

--- Comment #3 from Richard Biener  ---
The issue is that array_ref_element_size of the [i] ref returns 24.  Even when
inside just

unsigned long long foo(int i)
{
  return bid_Kx192[i].w[0];
}

and RTL expansion get_inner_reference produces for offset
(sizetype) i_2(D) * 24 resulting in

foo:
.LFB0:
.cfi_startproc
movslq  %edi, %rdi
leaq(%rdi,%rdi,2), %rax
movqbid_Kx192(,%rax,8), %rax
ret

Now the issue with SCCVN is that it expects TYPE_SIZE_UNIT to be exactly
dividable by TYPE_ALIGN_UNIT which it isn't (we divide 24 by 16):

/* But record element size in units of the type alignment.  */
temp.op2 = TREE_OPERAND (ref, 3);
temp.align = eltype->type_common.align;
if (! temp.op2)
  temp.op2 = size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (eltype),
 size_int (TYPE_ALIGN_UNIT (eltype)));

that is, for this ARRAY_REF there exists no valid value to put in
TREE_OPERAND (ref, 3), the aligned size tree operand used by
array_ref_element_size.

IMHO this should never happen.

The IL claims the array elements are all aligned to 16 bytes but they are
obviously not.

Joseph?  Who's at fault here?

(side-note, the wide-int code treats EXACT_DIV_EXPR just like TRUNC_DIV_EXPR
reporting no error).

[Bug c++/85965] G++ gives cryptic error instead of incomplete type

2019-03-19 Thread hedayat.fwd at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965

Hedayat Vatankhah  changed:

   What|Removed |Added

 CC||hedayat.fwd at gmail dot com

--- Comment #2 from Hedayat Vatankhah  ---
IMHO, it is very unfortunate that we need to provide the full definition for
this to work. It has forced me to include a header file just for this error to
go away, which is not desirable. I guess it doesn't compile a completely valid
C++ code (at least, I've not found that this is a std::set requirement). 

Probably, __is_invocable<> should not signal an error if it finds an incomplete
type, or it should be replaced with a construct that doesn't.

So, if the code using an incomplete type pointer for std::set is a valid C++
code, this is a sever (non-standard conforming) bug in library.

[Bug lto/89335] [9 Regression] ICE with LTO -Wsuggest-final-methods: ICE during IPA pass devirt in types_same_for_odr, at ipa-devirt.c:391

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89335
Bug 89335 depends on bug 87089, which changed state.

Bug 87089 Summary: [9 regression] tree check: expected class 'type', have 
'declaration' (namespace_decl) in type_with_linkage_p, at ipa-utils.h
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87089

   What|Removed |Added

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

[Bug lto/87089] [9 regression] tree check: expected class 'type', have 'declaration' (namespace_decl) in type_with_linkage_p, at ipa-utils.h

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87089

Jan Hubicka  changed:

   What|Removed |Added

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

--- Comment #13 from Jan Hubicka  ---
Fixed.

[Bug lto/89335] [9 Regression] ICE with LTO -Wsuggest-final-methods: ICE during IPA pass devirt in types_same_for_odr, at ipa-devirt.c:391

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89335

Jan Hubicka  changed:

   What|Removed |Added

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

--- Comment #5 from Jan Hubicka  ---
Fixed.

[Bug target/89736] New test pr87532-mc.c fails on compiler not defaulting to VSX

2019-03-19 Thread kelvin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89736

kelvin at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #4 from kelvin at gcc dot gnu.org ---
Patch committed to trunk.

[Bug debug/88389] -flto -g -gsplit-dwarf is broken

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389

--- Comment #4 from Richard Biener  ---
Author: rguenth
Date: Tue Mar 19 14:57:18 2019
New Revision: 269800

URL: https://gcc.gnu.org/viewcvs?rev=269800=gcc=rev
Log:
2019-03-19  Richard Biener  

PR debug/88389
* opts.c (finish_options): Disable -gsplit-dwarf when doing LTO.

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

[Bug lto/89335] [9 Regression] ICE with LTO -Wsuggest-final-methods: ICE during IPA pass devirt in types_same_for_odr, at ipa-devirt.c:391

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89335

--- Comment #4 from Jan Hubicka  ---
Author: hubicka
Date: Tue Mar 19 14:53:43 2019
New Revision: 269799

URL: https://gcc.gnu.org/viewcvs?rev=269799=gcc=rev
Log:

PR lto/87809
PR lto/89335
* tree.c (free_lang_data_in_decl): Do not free context of C++
destrutors.

* g++.dg/lto/pr87089_0.C: New testcase.
* g++.dg/lto/pr87089_1.C: New testcase.
* g++.dg/lto/pr89335_0.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/lto/pr87089_0.C
trunk/gcc/testsuite/g++.dg/lto/pr87089_1.C
trunk/gcc/testsuite/g++.dg/lto/pr89335_0.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c

[Bug libstdc++/87809] [8/9 Regression] Can't create empty std::optional>

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87809

--- Comment #9 from Jan Hubicka  ---
Author: hubicka
Date: Tue Mar 19 14:53:43 2019
New Revision: 269799

URL: https://gcc.gnu.org/viewcvs?rev=269799=gcc=rev
Log:

PR lto/87809
PR lto/89335
* tree.c (free_lang_data_in_decl): Do not free context of C++
destrutors.

* g++.dg/lto/pr87089_0.C: New testcase.
* g++.dg/lto/pr87089_1.C: New testcase.
* g++.dg/lto/pr89335_0.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/lto/pr87089_0.C
trunk/gcc/testsuite/g++.dg/lto/pr87089_1.C
trunk/gcc/testsuite/g++.dg/lto/pr89335_0.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c

[Bug ipa/89762] [8 Regression] Mixing optimization levels with ostream gives lto1: internal compiler error: in get_odr_type, at ipa-devirt.c:2098

2019-03-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89762

--- Comment #2 from Jan Hubicka  ---
The patch can't be backported since it depends on the rest of type
simplification infrastructure that is GCC 9 only.  I will take a look why
registration fails - it looks like the patch above only works around the issue
anyway.

Honza

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

--- Comment #6 from Jakub Jelinek  ---
Ah, so the reason why __t PARM_DECL is not normally removed is that we reuse
IDENTIFIER_MARKED for something different, in particular:
  /* If TREE_TYPE isn't set, we're still in the introducer, so check
 for duplicates.  */
  if (!LAMBDA_EXPR_CLOSURE (lambda))
{
  if (IDENTIFIER_MARKED (name))
{
  pedwarn (input_location, 0,
   "already captured %qD in lambda expression", id);
  return NULL_TREE;
}
  IDENTIFIER_MARKED (name) = true;
}
and we only clear it much later in register_capture_members:
  IDENTIFIER_MARKED (DECL_NAME (field)) = false;
But, while we are parsing the lambda, we perform those push_to_top_level and
pop_from_top_level and those do use IDENTIFIER_MARKED to determine if the
identifier binding actually should be saved/restored or not.
This particular testcase I guess could be fixed by replacing:
  /* Add __ to the beginning of the field name so that user code
 won't find the field with name lookup.  We can't just leave the name
 unset because template instantiation uses the name to find
 instantiated fields.  */
  buf = (char *) alloca (IDENTIFIER_LENGTH (id) + 3);
  buf[1] = buf[0] = '_';
  memcpy (buf + 2, IDENTIFIER_POINTER (id),
  IDENTIFIER_LENGTH (id) + 1);
with using say ".." as prefix instead of "__", so that it is use inaccessible.
But what about following testcase?

void bar (int);
void foo () { int x = 0; auto z = [x, y = [x] { bar (x); }] { y (); bar (x); };
z (); }

clang++ -std=c++17 accepts that, g++ rejects with:
pr89767-4.C: In function ‘void foo()’:
pr89767-4.C:2:44: warning: already captured ‘x’ in lambda expression
2 | void foo () { int x = 0; auto z = [x, y = [x] { bar (x); }] { y (); bar
(x); }; z (); }
  |^
pr89767-4.C: In lambda function:
pr89767-4.C:2:54: error: ‘x’ is not captured
2 | void foo () { int x = 0; auto z = [x, y = [x] { bar (x); }] { y (); bar
(x); }; z (); }
  |  ^
pr89767-4.C:2:45: note: the lambda has no capture-default
2 | void foo () { int x = 0; auto z = [x, y = [x] { bar (x); }] { y (); bar
(x); }; z (); }
  | ^
pr89767-4.C:2:19: note: ‘int x’ declared here
2 | void foo () { int x = 0; auto z = [x, y = [x] { bar (x); }] { y (); bar
(x); }; z (); }
  |   ^

Seems the use of IDENTIFIER_MARKED for this purpose has been added in r175211,
i.e. PR43831 fix.  So, if we want to keep using that and not something
different, we'd need to do those ..s or something similar and save/restore it
when starting to parse a new lambda.

[Bug target/89607] Missing optimization for store of multiple registers on aarch64

2019-03-19 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89607

Wilco  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||wilco at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |9.0

--- Comment #9 from Wilco  ---
Fixed in GCC9 already, so closing.

[Bug ada/89493] [9 Regression] Stack smashing on armv7hl

2019-03-19 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89493

Wilco  changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #2 from Wilco  ---
So is this an Ada unwind bug? What kind of unwinder does Ada use?

[Bug target/89736] New test pr87532-mc.c fails on compiler not defaulting to VSX

2019-03-19 Thread kelvin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89736

--- Comment #3 from kelvin at gcc dot gnu.org ---
Author: kelvin
Date: Tue Mar 19 13:44:03 2019
New Revision: 269796

URL: https://gcc.gnu.org/viewcvs?rev=269796=gcc=rev
Log:
gcc/testsuite/ChangeLog:

2019-03-19  Kelvin Nilsen  

PR target/89736
* gcc.target/powerpc/pr87532-mc.c: Modify dejagnu directives to
restrict this test to vsx targets.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/powerpc/pr87532-mc.c

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

Jakub Jelinek  changed:

   What|Removed |Added

 CC||nathan at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Though, following doesn't ICE:
template 
constexpr bool foo (int x) { return x; }
template 
constexpr bool bar (int x) { return foo  (x); }
template 
constexpr bool baz (int x) { return bar  (x); }
auto a = baz<0> (0);
and the IDENTIFIER_BINDING of x is saved/restored through push_to_top_level and
pop_from_top_level.  For the above testcase it is called too, but for some
reason the binding that is pushed to toplevel is the bo function one, not aw.

[Bug c++/67070] [concepts] Concept with negation and disjunction not checked correctly

2019-03-19 Thread godeffroy.valet at m4x dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67070

Godeffroy Valet  changed:

   What|Removed |Added

 CC||godeffroy.valet at m4x dot org

--- Comment #10 from Godeffroy Valet  ---
I confirm that I get different result using the constraint !(C && C) or
using (!C || !C), which is quite unexpected. I have "g++ (Debian
8.2.0-14)".

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

--- Comment #4 from Jakub Jelinek  ---
GCC 7.x and earlier used to do:
  /* The local structure or class can't use parameters of
 the containing function anyway.  */
  if (DECL_CONTEXT (oldlocal) != current_function_decl)
{
  cp_binding_level *scope = current_binding_level;
  tree context = DECL_CONTEXT (oldlocal);
  for (; scope; scope = scope->level_chain)
   {
 if (scope->kind == sk_function_parms
 && scope->this_entity == context)
  break;
 if (scope->kind == sk_class
 && !LAMBDA_TYPE_P (scope->this_entity))
   {
 nowarn = true;
 break;
   }
   }
}
but r248123 after moving it to a different function changed it to:
  /* The local structure or class can't use parameters of
 the containing function anyway.  */
  if (DECL_CONTEXT (old) != current_function_decl)
{
  for (cp_binding_level *scope = current_binding_level;
   scope != old_scope; scope = scope->level_chain)
if (scope->kind == sk_class
&& !LAMBDA_TYPE_P (scope->this_entity))
  return;
}
If old comes from a different function, such as in this case where there are
two nested instantiate_decl calls, one (the inner one) for av function above,
another one for aw, and I believe especially because the two functions aren't
lexically nested, it is just not possible to reach the old_scope (from the aw
function) from current_binding_level (in av function).

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-19
 CC||jason at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Jakub Jelinek  ---
Reduced testcase:

// PR c++/89767
// { dg-do compile { target c++11 } }
// { dg-options "-O2 -Wall" }

template  struct e { using g = d; };
template  class> using h = e;
template  class i>
using j = typename h::g;
template  int k(c);
template  class au;
struct l { template  using m = typename c::f; };
struct s : l { using af = j *, m>; };
template  struct o;
template  using q = typename o::g;
template  struct r;
template  struct r { typedef c aj; };
template  struct al { typename r::aj operator*();
void operator++(); };
template 
bool operator!=(al, al);
template  struct ap;
template 
struct ap : ap<1, as...> {};
template  struct ap {};
template  class au : public ap<0, at...> {};
template 
struct o> : o> {};
template  struct o<0, au> { typedef ar
g; };
template  constexpr ar av(ap __t) { return ar (); }
template  constexpr q> aw(au __t) {
av(__t); return q> (); }
struct bg { typedef s::af af; };
struct F { typedef al bk; bk begin(); bk end(); };
void bo() { int t = 0; F cv; for (auto bp : cv) [t, n = k(aw<1>(bp))] {}; }

Started to ICE with r261086 aka CWG 1581 implementation.
Though, that change doesn't seem to be in 8.3.

[Bug tree-optimization/89769] [7/8/9 Regression] attribute((aligned(x))) array testcase run error with option -fno-tree-loop-im

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

--- Comment #2 from Jakub Jelinek  ---
--- pr89769.c.126t.pre_ 2019-03-19 07:17:59.0 -0400
+++ pr89769.c.126t.pre  2019-03-19 07:18:28.0 -0400
@@ -120,7 +120,7 @@ main ()
 goto ;

   :
-  pretmp_5 = bid_Kx192[1].w[1];
+  pretmp_5 = bid_Kx192[1]{lb: 0 sz: 16}.w[1];

   :
   # i_24 = PHI <0(4), i_14(5)>

is the first difference and that difference is there up to *.optimized.
sizeof(bid_Kx192) is 768 bytes, so the aligned(16) attribute looks bogus, so
maybe just invalid testcase?
If one uses typedef struct __attribute__((aligned(16))) { unsigned long long
w[3]; } UINT192;
where the type then has 32 bytes in size, 16 byte alignment, rather than 24
bytes in size, then it works fine.

[Bug tree-optimization/88800] [8 Regression] Spurious -Werror=array-bounds for non-taken branch

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88800

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||9.0
   Target Milestone|--- |8.4
  Known to fail|9.0 |

[Bug libstdc++/88740] [7/8 Regression] libstdc++ tests no longer print assertion failure messages

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88740

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||9.0
   Target Milestone|--- |7.5
  Known to fail|9.0 |

[Bug libstdc++/88066] [7 Regression] Relative includes in bits/locale_conv.h should be prefixed

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88066

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |7.5
Summary|[7/8 Regression] Relative   |[7 Regression] Relative
   |includes in |includes in
   |bits/locale_conv.h should   |bits/locale_conv.h should
   |be prefixed |be prefixed

[Bug target/85711] [8 regression] ICE in aarch64_classify_address, at config/aarch64/aarch64.c:5678

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85711

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||9.0
   Target Milestone|--- |8.4

[Bug ipa/89762] [8 Regression] Mixing optimization levels with ostream gives lto1: internal compiler error: in get_odr_type, at ipa-devirt.c:2098

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89762

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |8.4

[Bug tree-optimization/89769] [7/8/9 Regression] attribute((aligned(x))) array testcase run error with option -fno-tree-loop-im

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-19
 CC||jakub at gcc dot gnu.org
  Component|c   |tree-optimization
   Target Milestone|--- |7.5
Summary|attribute((aligned(x))) |[7/8/9 Regression]
   |array testcae  run error|attribute((aligned(x)))
   |with option |array testcase  run error
   |-fno-tree-loop-im   |with option
   ||-fno-tree-loop-im
 Ever confirmed|0   |1

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

[Bug tree-optimization/89644] [8/9 Regression] false-positive -Warray-bounds on strncpy with unterminated array

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89644

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |8.4

[Bug middle-end/89621] [7/8/9 Regression] ICE with allocatable character and openmp

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89621

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Component|fortran |middle-end
   Target Milestone|--- |7.5

[Bug ada/89493] [9 Regression] Stack smashing on armv7hl

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89493

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |9.0

[Bug c/89769] New: attribute((aligned(x))) array testcae run error with option -fno-tree-loop-im

2019-03-19 Thread xuzheliang at huawei dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89769

Bug ID: 89769
   Summary: attribute((aligned(x))) array testcae  run error with
option -fno-tree-loop-im
   Product: gcc
   Version: 7.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xuzheliang at huawei dot com
  Target Milestone: ---

>>cat pr43783.c
typedef __attribute__((aligned(16)))
struct {
  unsigned long long w[3];
} UINT192;

UINT192 bid_Kx192[32];

extern void abort (void);

int main()
{
  int i = 0;
  unsigned long x = 0;
  for (i = 0; i < 32; ++i)
bid_Kx192[i].w[1] = i == 1;
  for (i = 0; i < 32; ++i)
x += bid_Kx192[1].w[1];
  if (x != 32)
abort ();
  return 0;
}

>>gcc  -O2 pr43783.c  -fno-tree-loop-im -o pr43783.exe
>>./pr43783.exe
Aborted

[Bug sanitizer/89764] [8 Regression] ubsan diagnostic on generic lambdas decayed to function pointers

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89764

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #2 from Martin Liška  ---
Started with Jason's r268700 aka PR86943.

[Bug target/89752] [8/9 Regression] ICE in emit_move_insn, at expr.c:3723

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752

--- Comment #14 from Jakub Jelinek  ---
The following patch fixes the remaining ICE for me:
--- gcc/lra-constraints.c.jj2019-03-16 22:17:21.060937047 +0100
+++ gcc/lra-constraints.c   2019-03-19 11:49:11.982058568 +0100
@@ -2350,6 +2350,8 @@ process_alt_operands (int only_alternati
  break;

reg:
+ if (mode == BLKmode)
+   break;
  this_alternative = reg_class_subunion[this_alternative][cl];
  IOR_HARD_REG_SET (this_alternative_set,
reg_class_contents[cl]);
@@ -2360,8 +2362,6 @@ process_alt_operands (int only_alternati
  IOR_HARD_REG_SET (this_costly_alternative_set,
reg_class_contents[cl]);
}
- if (mode == BLKmode)
-   break;
  winreg = true;
  if (REG_P (op))
{
What in my understanding happens is that even when the r constraint for the
BLKmode MEM doesn't win, this_alternative is still updated (to GENERAL_REGS in
this case) and as the m constraint matches, we still process it as if
GENERAL_REGS is an option.  It is not, BLKmode must live in memory.

[Bug debug/88389] -flto -g -gsplit-dwarf is broken

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |SUSPENDED
   Last reconfirmed||2019-03-19
   Target Milestone|8.4 |---
Summary|[8/9 Regression] -flto -g   |-flto -g -gsplit-dwarf is
   |-gsplit-dwarf is broken |broken
 Ever confirmed|0   |1

--- Comment #3 from Richard Biener  ---
So the issues are multiples.  First of all the way we handle split-dwarf
requires the driver to objcopy the .dwo sections to the .o.dwo files - this
step
would have to happen after copying out early debug into temporaries.  But then
I have a hard time seeing how to find the debug.

Of course -gsplit-dwarf at link-time doesn't make much sense.

I guess the proper way of doing -gsplit-dwarf at compile-time with -flto
would be to emit a _single_ (independent of -ffat-lto-objects) set of
.dwo sections from dwarf2out_early_finish - in fact move _all_ of the
split-dwarf handling there.  Then the only "LTO" debug sections would be
the skeleton ones.  There's still the unsolved issue that late debug info
will refer to DIEs in the .dwo debug in its symbol + offset way which of
course does not work.  There's no way to do this since .dwo files are
designed to have _all_ the debug info, not just type or decl parts like
-fdebug-types-sections.

So -flto looks like fundamentally incompatible with -gsplit-dwarf
and I doubt it's worth supporting it for the fat part of the objects.

[Bug target/89506] [7/8 Regression] ICE: in decompose, at rtl.h:2266 with -Og -g

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89506

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 19 10:05:10 2019
New Revision: 269795

URL: https://gcc.gnu.org/viewcvs?rev=269795=gcc=rev
Log:
PR target/89506
* config/arm/arm.md (cmpsi2_addneg): Swap the alternatives and use
subs for the first alternative except when operands[3] is 1.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.md

[Bug c++/89571] [9 Regression] ICE in nothrow_spec_p, at cp/except.c:1238

2019-03-19 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89571

Paolo Carlini  changed:

   What|Removed |Added

 CC||paolo.carlini at oracle dot com

--- Comment #10 from Paolo Carlini  ---
For error-recovery sake, I think that we can just skip the functions with
eh_spec == error_mark_node and continue the loop:

Index: method.c
===
--- method.c(revision 269783)
+++ method.c(working copy)
@@ -2274,6 +2274,9 @@ after_nsdmi_defaulted_late_checks (tree t)
  continue;

tree eh_spec = get_defaulted_eh_spec (fn);
+   if (eh_spec == error_mark_node)
+ continue;
+
if (!comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)),
eh_spec, ce_normal))
  DECL_DELETED_FN (fn) = true;

What do you think, Jason?

[Bug sanitizer/89764] [8 Regression] ubsan diagnostic on generic lambdas decayed to function pointers

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89764

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |8.4

[Bug rtl-optimization/89768] [7/8/9 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

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

Full patch I'm going to bootstrap/regtest.

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #9 from Jakub Jelinek  ---
Another (hopefully valid) testcase, accepted by trunk, r269511 and clang++, all
with -std=c++17, ICEs with r269512 and up.

struct A;
template  class> struct B;
template  class T> struct B;
template  struct C {
  template  int operator[] (int) const;
  template  int operator[] (A) const;
};

[Bug sanitizer/89764] [8 Regression] ubsan diagnostic on generic lambdas decayed to function pointers

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89764

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-03-19
  Known to work||7.4.0, 9.0
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
Summary|ubsan diagnostic on generic |[8 Regression] ubsan
   |lambdas decayed to function |diagnostic on generic
   |pointers|lambdas decayed to function
   ||pointers
 Ever confirmed|0   |1
  Known to fail||8.3.1

--- Comment #1 from Martin Liška  ---
Confirmed, I probably see it only for GCC 8.x branch. Let me bisect that..

[Bug rtl-optimization/89768] [7/8/9 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

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  ---
I can reproduce even with
--param max-unroll-times=7 --param max-unrolled-insns=28 -funroll-loops
-Ofast --param max-average-unrolled-insns=28 -fno-tree-dominator-opts 
pr80565.c
--- gcc/loop-unroll.c.jj2019-03-19 09:09:32.686006683 +0100
+++ gcc/loop-unroll.c   2019-03-19 10:15:50.319343904 +0100
@@ -652,7 +652,7 @@ unroll_loop_constant_iterations (struct
   if (loop->any_likely_upper_bound)
 loop->nb_iterations_likely_upper_bound
   = wi::udiv_trunc (loop->nb_iterations_likely_upper_bound, max_unroll +
1);
-  desc->niter_expr = GEN_INT (desc->niter);
+  desc->niter_expr = gen_int_mode (desc->niter, desc->mode);

   /* Remove the edges.  */
   FOR_EACH_VEC_ELT (remove_edges, i, e)
@@ -1020,9 +1020,9 @@ unroll_loop_runtime_iterations (struct l
   preheader = split_edge (loop_preheader_edge (loop));
   /* Add in count of edge from switch block.  */
   preheader->count += iter_count;
-  branch_code = compare_and_jump_seq (copy_rtx (niter), GEN_INT (j), EQ,
- block_label (preheader), p,
- NULL);
+  branch_code = compare_and_jump_seq (copy_rtx (niter),
+ gen_int_mode (j, desc->mode), EQ,
+ block_label (preheader), p, NULL);

   /* We rely on the fact that the compare and jump cannot be optimized
out,
 and hence the cfg we create is correct.  */
fixes the ICE, still the testcase is not usable for the testsuite, seems it has
481318 basic blocks in the function and seems to spent like forever in
#0  0x00bbf031 in et_splay (occ=0x2f8b4c8) at ../../gcc/et-forest.c:319
#1  0x00bbfc2d in et_below (down=0x301e8f8, up=0x301eaa8) at
../../gcc/et-forest.c:718
#2  0x00b181be in dominated_by_p (dir=CDI_DOMINATORS,
bb1=0x7fffea96e138, bb2=0x7fffea97f208) at ../../gcc/dominance.c:1126
#3  0x00b1865a in prune_bbs_to_update_dominators (bbs=...,
conservative=true) at ../../gcc/dominance.c:1257
#4  0x00b18c94 in iterate_fix_dominators (dir=CDI_DOMINATORS, bbs=...,
conservative=true) at ../../gcc/dominance.c:1464
#5  0x00a7f150 in remove_path (e=, 
irred_invalidated=0x7fffce4f, loop_closed_ssa_invalidated=0x0) at
../../gcc/cfgloopmanip.c:412
#6  0x00eab54e in unroll_loop_runtime_iterations (loop=0x7fffea953000)
at ../../gcc/loop-unroll.c:1110
#7  0x00ea91f8 in unroll_loops (flags=1) at ../../gcc/loop-unroll.c:299

[Bug ipa/89762] [8 Regression] Mixing optimization levels with ostream gives lto1: internal compiler error: in get_odr_type, at ipa-devirt.c:2098

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89762

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-03-19
  Known to work||7.4.0, 9.0
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
Summary|Mixing optimization levels  |[8 Regression] Mixing
   |with ostream gives lto1:|optimization levels with
   |internal compiler error: in |ostream gives lto1:
   |get_odr_type, at|internal compiler error: in
   |ipa-devirt.c:2098   |get_odr_type, at
   ||ipa-devirt.c:2098
 Ever confirmed|0   |1
  Known to fail||8.3.1

--- Comment #1 from Martin Liška  ---
Confirmed, started on trunk in r259479 and was fixed in r265638.
Honza is the patch subject for backport?

[Bug rtl-optimization/89768] [7/8/9 Regression] ICE in compare_and_jump_seq at loop-unroll.c:838

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89768

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |7.5
Summary|ICE in compare_and_jump_seq |[7/8/9 Regression] ICE in
   |at loop-unroll.c:838|compare_and_jump_seq at
   ||loop-unroll.c:838
 Ever confirmed|0   |1

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

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread rimvydas.jas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

--- Comment #8 from Rimvydas (RJ)  ---
Created attachment 45995
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45995=edit
Compressed original case (3.3M).

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #7 from Jakub Jelinek  ---
Indeed, the invalid testcase is now accepted:

$ ./cc1plus.269511 -quiet pr89766.C -std=c++17 -fno-checking; echo $?
pr89766.C:7:38: error: ‘template template bool d<
 >::e() const’ cannot be overloaded with
‘template template bool d< 
>::e() const’
   template  bool e() const;
  ^
pr89766.C:6:40: note: previous declaration ‘template template bool d<  >::e() const’
   template  bool e() const;
^
1
$ ./cc1plus.269512 -quiet pr89766.C -std=c++17 -fno-checking; echo $?
0

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |ice-on-invalid-code
   Priority|P2  |P1
 CC||jason at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek  ---
Started with r269512 aka PR88419 fix.

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

--- Comment #5 from Martin Liška  ---
(In reply to Rimvydas (RJ) from comment #4)
> @Martin: Yes, ICE happens for valid code too only if -fchecking=1. Reduced
> cases are invalid and rejected by 9.0.1 20190319 and 8.2.1 20181127.
> However 8.3.1 20190319 accepts them even for -fchecking=0.

Please attach the valid code snippet.

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread rimvydas.jas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

--- Comment #4 from Rimvydas (RJ)  ---
@Martin: Yes, ICE happens for valid code too only if -fchecking=1. Reduced
cases are invalid and rejected by 9.0.1 20190319 and 8.2.1 20181127.
However 8.3.1 20190319 accepts them even for -fchecking=0.

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Reducing and bisecting now.

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

--- Comment #3 from Martin Liška  ---
@RJ: Btw. do you see the ICE also for a valid C++ code? The test-case you
provided isn't valid if I'm correct?

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
I can reproduce that, but only with GCC tip:
gcc version 8.3.1 20190319 (GCC) 

$ ./xg++ -B. /home/marxin/Programming/testcases/pr89766.cpp -c -fchecking
-std=c++17 --param ggc-min-expand=0 --param ggc-min-heapsize=0
/home/marxin/Programming/testcases/pr89766.cpp:7:47: internal compiler error:
canonical types differ for identical types ‘a’ and ‘’
   template  bool e() const;
   ^
0xa1338f comptypes(tree_node*, tree_node*, int)
../../gcc/cp/typeck.c:1480
0x98bae1 comp_template_parms(tree_node const*, tree_node const*)
../../gcc/cp/pt.c:3302
0x8579e5 add_method(tree_node*, tree_node*, bool)
../../gcc/cp/class.c:1062
0x9e201c finish_member_declaration(tree_node*)
../../gcc/cp/semantics.c:3114
0x95ffa5 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.c:27077
0x960419 cp_parser_explicit_template_declaration
../../gcc/cp/parser.c:27236
0x960473 cp_parser_template_declaration_after_export
../../gcc/cp/parser.c:27255
0x94bcfd cp_parser_template_declaration
../../gcc/cp/parser.c:15026
0x95a413 cp_parser_member_declaration
../../gcc/cp/parser.c:23552
0x95a306 cp_parser_member_specification_opt
../../gcc/cp/parser.c:23479
0x95891e cp_parser_class_specifier_1
../../gcc/cp/parser.c:22610
0x95936a cp_parser_class_specifier
../../gcc/cp/parser.c:22872
0x94e900 cp_parser_type_specifier
../../gcc/cp/parser.c:16788
0x949dd0 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:13626
0x960585 cp_parser_single_declaration
../../gcc/cp/parser.c:27307
0x95fc98 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.c:26999
0x960419 cp_parser_explicit_template_declaration
../../gcc/cp/parser.c:27236
0x960473 cp_parser_template_declaration_after_export
../../gcc/cp/parser.c:27255
0x94bcfd cp_parser_template_declaration
../../gcc/cp/parser.c:15026
0x94824b cp_parser_declaration
../../gcc/cp/parser.c:12724

(gdb) p debug_tree(t1)
 >
$3 = void
(gdb) p debug_tree(t2)
 >

(gdb) p debug_tree((tree)0x77a32a80)
 >

(gdb) p debug_tree((tree)0x77a32f18)
 >

[Bug target/89752] [8/9 Regression] ICE in emit_move_insn, at expr.c:3723

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752

--- Comment #13 from Jakub Jelinek  ---
Fixed on the originally provided testcase, not on the #c7 testcase, that needs
to be fixed in LRA not to try to reload BLKmode MEMs into REGs.

[Bug target/89752] [8/9 Regression] ICE in emit_move_insn, at expr.c:3723

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 19 08:11:25 2019
New Revision: 269793

URL: https://gcc.gnu.org/viewcvs?rev=269793=gcc=rev
Log:
PR target/89752
* gimplify.c (gimplify_asm_expr): For output argument with
TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
diagnose error.

* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
* g++.dg/ext/asm16.C: Likewise.
* g++.dg/ext/asm17.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/asm17.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ext/asm15.C
trunk/gcc/testsuite/g++.dg/ext/asm16.C

[Bug c++/89767] [8/9 Regression] ICE with tuple and optimization

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89767

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Priority|P3  |P2
  Known to work||7.3.0
   Target Milestone|--- |9.0
Summary|ICE with tuple and  |[8/9 Regression] ICE with
   |optimization|tuple and optimization
  Known to fail||8.2.0, 8.3.0

[Bug rtl-optimization/89753] [8/9 Regression] ICE in unroll_loop_constant_iterations, at loop-unroll.c:498

2019-03-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89753

Eric Botcazou  changed:

   What|Removed |Added

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

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

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-checking,
   ||ice-on-valid-code
   Priority|P3  |P2
  Known to work||8.1.0, 9.0
  Known to fail||8.3.1

[Bug rtl-optimization/89753] [8/9 Regression] ICE in unroll_loop_constant_iterations, at loop-unroll.c:498

2019-03-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89753

--- Comment #5 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Mar 19 08:10:08 2019
New Revision: 269792

URL: https://gcc.gnu.org/viewcvs?rev=269792=gcc=rev
Log:
PR rtl-optimization/89753
* loop-unroll.c (decide_unroll_constant_iterations): Make guard for
explicit unrolling factor even more robust.

Added:
branches/gcc-8-branch/gcc/testsuite/c-c++-common/unroll-7.c
  - copied unchanged from r269791,
trunk/gcc/testsuite/c-c++-common/unroll-7.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/loop-unroll.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug libstdc++/89760] [9 Regression] libstdc++ experimental testsuite failures

2019-03-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89760

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |9.0

[Bug rtl-optimization/89753] [8/9 Regression] ICE in unroll_loop_constant_iterations, at loop-unroll.c:498

2019-03-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89753

--- Comment #4 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Mar 19 08:06:48 2019
New Revision: 269791

URL: https://gcc.gnu.org/viewcvs?rev=269791=gcc=rev
Log:
PR rtl-optimization/89753
* loop-unroll.c (decide_unroll_constant_iterations): Make guard for
explicit unrolling factor even more robust.

Added:
trunk/gcc/testsuite/c-c++-common/unroll-7.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-unroll.c
trunk/gcc/testsuite/ChangeLog

[Bug libfortran/89747] valgrind error in gfc_match_decl_type_spec

2019-03-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89747

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Martin Liška  ---
I was able to reproduce that, but is gone with
--expensive-definedness-checks=yes.

[Bug c++/89766] [8 Regression] ICE: canonical types differ for identical types, -std=c++17

2019-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-19
 CC||jakub at gcc dot gnu.org
Version|unknown |8.3.1
   Target Milestone|--- |8.4
Summary|ICE: canonical types differ |[8 Regression] ICE:
   |for identical types,|canonical types differ for
   |-std=c++17  |identical types, -std=c++17
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
I can reproduce on current 8.x branch, can't reproduce with 8.3.1 20190223, nor
at 8.x branchpoint, nor gcc trunk.

  1   2   >