[Bug target/83250] _mm256_zextsi128_si256 missing for AVX2 zero extension

2019-06-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83250

Uroš Bizjak  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #2 from Uroš Bizjak  ---
Adding CC.

[Bug fortran/90329] Incompatibility between gfortran and C lapack calls

2019-06-22 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329

--- Comment #47 from Thomas Koenig  ---
(In reply to Kaz Kylheku from comment #45)
> Hi everyone.
> 
> Pardon my ignorance of C-Fortran bridging matters, but does any of the
> following make sense?
> 
> The Fortran subroutine has no idea whether the word where the argument is
> supposed to be is really the argument, or just some unrelated part of the
> stack (because the caller didn't pass the argument).
> 
> Can't the Fortran routine check whether that word has the expected value 1?
> Then in that case, just pretend it's the argument (whether that is the case,
> or whether that 1 is just a spurious value that looks like the right
> argument). In this case, just do all the tail calling to sibling routines
> happily, who will get the right string length.

I see two problems with this suggestion, one minor and one major.

First, there may well be a value > 1 on the stack for a regular
call, see comment #15.

Second, the value 1 may end up being there by accident, then this
method would cause a crash, and this would be even harder to debug
than the original case.

[Bug c/90962] New: Array bound over optimization

2019-06-22 Thread patrick.pelissier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90962

Bug ID: 90962
   Summary: Array bound over optimization
   Product: gcc
   Version: 7.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: patrick.pelissier at gmail dot com
  Target Milestone: ---

For the following program, GCC optimizes away the loop that affects the array:

#include 
#include 
struct node_s {
  unsigned int size;
  struct m_s *tab[1];   
};
typedef struct m_s {
  unsigned int type;
  union {
struct node_s n;
  } val[1];
} *m_t;
extern m_t node_c(uint8_t, unsigned int_t);
#define SET_AT(_x,_n,_y) ((_x)->val[0].n.tab[(_n)] = (_y))
m_t add_vc (unsigned int size, const m_t *tab)
{
  if (size == 0)
return NULL;
  m_t y = node_c (2, size);
  for (unsigned int i = 0; i < size; i++) /* here */
SET_AT (y, i, tab[i]);
  return y;
}


The following asm is generated for x86-64 when building it with  gcc -O2 -S
t.c:

add_vc:
.LFB10:
.cfi_startproc
testl   %edi, %edi
je  .L3
pushq   %rbx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
movq%rsi, %rbx
movl%edi, %esi
movl$2, %edi
callnode_c
movq(%rbx), %rdx
movq%rdx, 16(%rax)   // Only tab[0] is set
popq%rbx
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L3:
.cfi_restore 3
xorl%eax, %eax
ret

The loop is removed with GCC 7.3, GCC 8.2 and GCC 9.1: only tab[0] is set. 
The loop is not removed and the program behaves as expected with GCC 4.9, GCC
6.3

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881

--- Comment #7 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 14:43:00 2019
New Revision: 272585

URL: https://gcc.gnu.org/viewcvs?rev=272585&root=gcc&view=rev
Log:
PR c++/90881 - bogus -Wunused-value in unevaluated context.
* cvt.c (convert_to_void): Don't emit unused warnings in
an unevaluated context.

* g++.dg/cpp0x/Wunused-value1.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/Wunused-value1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cvt.c
trunk/gcc/testsuite/ChangeLog

[Bug c/89180] [meta-bug] bogus/missing -Wunused warnings

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89180
Bug 89180 depends on bug 90881, which changed state.

Bug 90881 Summary: -Wunused-value false positive in SFINAE context
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881

   What|Removed |Added

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

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #8 from Marek Polacek  ---
Fixed.  The behavior is now asi outlined in Comment 5.

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-22 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881

--- Comment #9 from Federico Kircheis  ---
Hi,

did you consider my last comment (Comment 6)?

I find it unfortunate that gcc will not warn anymore about unused variables in
some circumstances.

Maybe my example was not a good one, but I guess that a warning in
`decltype(0,0)` would be useful if one intended `decltype(0.0)`.

[Bug c++/86476] Members declared later in a class appear to be unavailable

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86476

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 15:14:30 2019
New Revision: 272586

URL: https://gcc.gnu.org/viewcvs?rev=272586&root=gcc&view=rev
Log:
PR c++/86476 - noexcept-specifier is a complete-class context.
PR c++/52869
* cp-tree.def (DEFAULT_ARG): Update commentary.
* cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
(tree_default_arg): Use tree_base instead of tree_common.
(do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
* decl.c (do_push_parm_decls): New function, broken out of...
(store_parm_decls): ...here.  Call it.
* except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
* parser.c (cp_parser_noexcept_specification_opt,
cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
Forward-declare.
(unparsed_noexcepts): New macro.
(push_unparsed_function_queues): Update initializer.
(cp_parser_direct_declarator): Pass FRIEND_P to
cp_parser_exception_specification_opt.
(inject_parm_decls): New.
(pop_injected_parms): New.
(cp_parser_class_specifier_1): Implement delayed parsing of
noexcept-specifiers.
(cp_parser_save_noexcept): New.
(cp_parser_late_noexcept_specifier): New.
(noexcept_override_late_checks): New.
(cp_parser_noexcept_specification_opt): Add FRIEND_P parameter.  Call
cp_parser_save_noexcept instead of the normal processing if needed.
(cp_parser_exception_specification_opt): Add FRIEND_P parameter and
pass it to cp_parser_noexcept_specification_opt.
(cp_parser_save_member_function_body): Fix comment.
(cp_parser_save_default_args): Maybe save the noexcept-specifier to
post process.
(cp_parser_transaction): Update call to
cp_parser_noexcept_specification_opt.
(cp_parser_transaction_expression): Likewise.
* parser.h (cp_unparsed_functions_entry): Add new field to carry
a noexcept-specifier.
* pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
* search.c (maybe_check_overriding_exception_spec): New function,
broken
out of...
(check_final_overrider): ...here.  Call
maybe_check_overriding_exception_spec.
* tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
(cp_tree_equal): Handle DEFAULT_ARG.

* g++.dg/cpp0x/noexcept45.C: New test.
* g++.dg/cpp0x/noexcept46.C: New test.
* g++.dg/cpp0x/noexcept47.C: New test.
* g++.dg/cpp0x/noexcept48.C: New test.
* g++.dg/cpp0x/noexcept49.C: New test.
* g++.dg/cpp0x/noexcept50.C: New test.
* g++.dg/cpp0x/noexcept51.C: New test.
* g++.dg/cpp0x/noexcept52.C: New test.
* g++.dg/cpp0x/noexcept53.C: New test.
* g++.dg/eh/shadow1.C: Adjust dg-error.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept45.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept46.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept47.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept48.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept49.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept50.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept51.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept52.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept53.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.def
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/except.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/parser.h
trunk/gcc/cp/pt.c
trunk/gcc/cp/search.c
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/eh/shadow1.C

[Bug c++/52869] [DR 1207] "this" not being allowed in noexcept clauses

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869

--- Comment #18 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 15:14:30 2019
New Revision: 272586

URL: https://gcc.gnu.org/viewcvs?rev=272586&root=gcc&view=rev
Log:
PR c++/86476 - noexcept-specifier is a complete-class context.
PR c++/52869
* cp-tree.def (DEFAULT_ARG): Update commentary.
* cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
(tree_default_arg): Use tree_base instead of tree_common.
(do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
* decl.c (do_push_parm_decls): New function, broken out of...
(store_parm_decls): ...here.  Call it.
* except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
* parser.c (cp_parser_noexcept_specification_opt,
cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
Forward-declare.
(unparsed_noexcepts): New macro.
(push_unparsed_function_queues): Update initializer.
(cp_parser_direct_declarator): Pass FRIEND_P to
cp_parser_exception_specification_opt.
(inject_parm_decls): New.
(pop_injected_parms): New.
(cp_parser_class_specifier_1): Implement delayed parsing of
noexcept-specifiers.
(cp_parser_save_noexcept): New.
(cp_parser_late_noexcept_specifier): New.
(noexcept_override_late_checks): New.
(cp_parser_noexcept_specification_opt): Add FRIEND_P parameter.  Call
cp_parser_save_noexcept instead of the normal processing if needed.
(cp_parser_exception_specification_opt): Add FRIEND_P parameter and
pass it to cp_parser_noexcept_specification_opt.
(cp_parser_save_member_function_body): Fix comment.
(cp_parser_save_default_args): Maybe save the noexcept-specifier to
post process.
(cp_parser_transaction): Update call to
cp_parser_noexcept_specification_opt.
(cp_parser_transaction_expression): Likewise.
* parser.h (cp_unparsed_functions_entry): Add new field to carry
a noexcept-specifier.
* pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
* search.c (maybe_check_overriding_exception_spec): New function,
broken
out of...
(check_final_overrider): ...here.  Call
maybe_check_overriding_exception_spec.
* tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
(cp_tree_equal): Handle DEFAULT_ARG.

* g++.dg/cpp0x/noexcept45.C: New test.
* g++.dg/cpp0x/noexcept46.C: New test.
* g++.dg/cpp0x/noexcept47.C: New test.
* g++.dg/cpp0x/noexcept48.C: New test.
* g++.dg/cpp0x/noexcept49.C: New test.
* g++.dg/cpp0x/noexcept50.C: New test.
* g++.dg/cpp0x/noexcept51.C: New test.
* g++.dg/cpp0x/noexcept52.C: New test.
* g++.dg/cpp0x/noexcept53.C: New test.
* g++.dg/eh/shadow1.C: Adjust dg-error.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept45.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept46.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept47.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept48.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept49.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept50.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept51.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept52.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept53.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.def
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/except.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/parser.h
trunk/gcc/cp/pt.c
trunk/gcc/cp/search.c
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/eh/shadow1.C

[Bug middle-end/90963] New: [10 Regression] FAIL: gcc.c-torture/execute/built-in-setjmp.c execution test

2019-06-22 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90963

Bug ID: 90963
   Summary: [10 Regression] FAIL:
gcc.c-torture/execute/built-in-setjmp.c execution test
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
CC: wdijkstr at arm dot com
  Target Milestone: ---
  Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
 Build: hppa-unknown-linux-gnu

In revision 272526, the built-in-setjmp.c test fails on hppa-linux:

Executing on host: /home/dave/gnu/gcc/objdir/gcc/xgcc
-B/home/dave/gnu/gcc/objdi
r/gcc/
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/built-in-setjm
p.c-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnost
ics-color=never-O0  -w  -lm  -o ./built-in-setjmp.exe(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir/gcc/xgcc
-B/home/dave/gnu/gcc/obj
dir/gcc/
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/built-in-set
jmp.c -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnosti
cs-color=never -O0 -w -lm -o ./built-in-setjmp.exe
PASS: gcc.c-torture/execute/built-in-setjmp.c   -O0  (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/dave/gnu/gcc/objdir/gcc::/home/dave/gnu/gcc/ob
jdir/gcc:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/src/.libs:/home/d
ave/gnu/gcc/objdir/hppa-linux-gnu/libssp/.libs:/home/dave/gnu/gcc/objdir/hppa-li
nux-gnu/libphobos/src/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libgomp/.li
bs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libatomic/.libs:/home/dave/gnu/gcc/o
bjdir/./gcc:/home/dave/gnu/gcc/objdir/./prev-gcc:/home/dave/gnu/gcc/objdir/hppa-
linux-gnu/libstdc++-v3/src/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libssp
/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libphobos/src/.libs:/home/dave/g
nu/gcc/objdir/hppa-linux-gnu/libgomp/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-
gnu/libatomic/.libs:/home/dave/gnu/gcc/objdir/./gcc:/home/dave/gnu/gcc/objdir/./
prev-gcc
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.c-torture/execute/built-in-setjmp.c   -O0  execution test

This fail was likely introduced by this change:

2019-06-19  Wilco Dijkstra  

PR middle-end/84521
* builtins.c (expand_builtin_setjmp_setup): Save
hard_frame_pointer_rtx.
(expand_builtin_setjmp_receiver): Do not emit sfp = fp move since we
restore fp.
* function.c (expand_function_start): Save hard_frame_pointer_rtx for
non-local goto.
* lra-eliminations.c (eliminate_regs_in_insn): Remove sfp = fp
elimination code.
(remove_reg_equal_offset_note): Remove unused function.
* reload1.c (eliminate_regs_in_insn): Remove sfp = hfp elimination
code.
* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
(arc_builtin_setjmp_frame_value): Remove function.
* config/avr/avr.c  (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
(avr_builtin_setjmp_frame_value): Remove function.
* config/i386/i386.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
(ix86_builtin_setjmp_frame_value): Remove function.
* config/pa/pa.md (nonlocal_goto): Remove FP adjustment.
* config/sparc/sparc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
(sparc_builtin_setjmp_frame_value): Remove function.
* config/vax/vax.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
(vax_builtin_setjmp_frame_value): Remove function.
* config/xtensa/xtensa.c (xtensa_frame_pointer_required): Force frame
pointer if has_nonlocal_label.

Similar fails:
FAIL: gcc.c-torture/execute/pr60003.c   -O0  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O0  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O1  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O2  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/pr64242.c   -Os  execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O0  execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O0 -fpic execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O1  execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O1 -fpic execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O2  execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  execution test
FAIL: gcc.dg/torture/stackalign/setjmp-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none -fpic execution te

[Bug c++/86476] Members declared later in a class appear to be unavailable

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86476

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #4 from Marek Polacek  ---
Fixed.

[Bug c++/52869] [DR 1207] "this" not being allowed in noexcept clauses

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #19 from Marek Polacek  ---
Fixed.

[Bug c++/90537] Implement P1286R2, Contra CWG DR1778

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90537
Bug 90537 depends on bug 86476, which changed state.

Bug 86476 Summary: Members declared later in a class appear to be unavailable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86476

   What|Removed |Added

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

[Bug c++/66256] noexcept evaluation done before end of class

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66256

--- Comment #13 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 15:51:49 2019
New Revision: 272588

URL: https://gcc.gnu.org/viewcvs?rev=272588&root=gcc&view=rev
Log:
PR c++/66256
* g++.dg/cpp0x/noexcept54.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept54.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/66256] noexcept evaluation done before end of class

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66256

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #14 from Marek Polacek  ---
Fixed by r272586.

[Bug c++/90964] New: SJLJ: Backtrace stopped: previous frame inner to this frame (corrupt stack?)

2019-06-22 Thread ocroquette at free dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90964

Bug ID: 90964
   Summary: SJLJ: Backtrace stopped: previous frame inner to this
frame (corrupt stack?)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ocroquette at free dot fr
  Target Milestone: ---

On Windows with the SJLJ exception handling, the backtrace doesn't work in GDB
as soon a method enters a try/catch block, instead GDB reports:

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The problem can be easily reproduced with any SJLJ Mingw-w64 toolchain.
The problem doesn't occur with SEH exception handling.

It is not clear if the problem is in GCC, GDB or MinGW-w64. I don't know how to
find out, hopefully someone competent can tell if it is a GCC bug or not.

main.cpp:

#include 

 void
 dummy()
 {
 volatile int i = 0;
 }

 bool
 expectTrue( bool value )
 {
 dummy();

 if ( !static_cast( value ) )
 {
 throw std::runtime_error("value failed");
 }

 dummy();

 return value;
 }

 int
 main( int argc, char** argv )
 {
 dummy();
 expectTrue( true );
 dummy();
 }


gcc --version

gcc (x86_64-posix-sjlj-rev0, Built by MinGW-W64 project) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


g++ -g -O0 main.cpp -o main


gdb ./main

GNU gdb (GDB) 8.0.1
...
(gdb) break dummy
Breakpoint 1 at 0x401578: file main.cpp, line 7.
(gdb) run
...

Thread 1 hit Breakpoint 1, dummy () at main.cpp:7
7   volatile int i = 0;
(gdb) backtrace
#0  dummy () at main.cpp:7
#1  0x00401728 in main (argc=1, argv=0x25d1d20) at main.cpp:28
(gdb) continue
Continuing.

Thread 1 hit Breakpoint 1, dummy () at main.cpp:7
7   volatile int i = 0;
(gdb) backtrace
#0  dummy () at main.cpp:7
#1  0x00401626 in expectTrue (value=true) at main.cpp:13
#2  0x in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) continue
Continuing.

Thread 1 hit Breakpoint 1, dummy () at main.cpp:7
7   volatile int i = 0;
(gdb) backtrace
#0  dummy () at main.cpp:7
#1  0x0040167b in expectTrue (value=true) at main.cpp:20
#2  0x in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) continue
Continuing.

Thread 1 hit Breakpoint 1, dummy () at main.cpp:7
7   volatile int i = 0;
(gdb) backtrace
#0  dummy () at main.cpp:7
#1  0x00401737 in main (argc=1, argv=0x25d1d20) at main.cpp:30
(gdb) continue
Continuing.
[Thread 5844.0x1750 exited with code 0]
[Thread 5844.0x1320 exited with code 0]
[Thread 5844.0x2334 exited with code 0]
[Inferior 1 (process 5844) exited normally]
(gdb)

[Bug c++/90964] SJLJ: Backtrace stopped: previous frame inner to this frame (corrupt stack?)

2019-06-22 Thread ocroquette at free dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90964

--- Comment #1 from Olivier Croquette  ---
Also reported in the MinGW-w64 project:
https://sourceforge.net/p/mingw-w64/bugs/800/

[Bug c++/58836] [c++11] ICE with wrong usage of initializer list in non-type template argument

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58836

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 16:29:06 2019
New Revision: 272589

URL: https://gcc.gnu.org/viewcvs?rev=272589&root=gcc&view=rev
Log:
PR c++/65707
PR c++/89480
PR c++/58836
* g++.dg/cpp0x/nondeduced5.C: New test.
* g++.dg/cpp0x/nondeduced6.C: New test.
* g++.dg/cpp0x/nondeduced7.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced5.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced6.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced7.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/89480] internal compiler error: in unify, at cp/pt.c:22160 with the template argument force conversion

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89480

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 16:29:06 2019
New Revision: 272589

URL: https://gcc.gnu.org/viewcvs?rev=272589&root=gcc&view=rev
Log:
PR c++/65707
PR c++/89480
PR c++/58836
* g++.dg/cpp0x/nondeduced5.C: New test.
* g++.dg/cpp0x/nondeduced6.C: New test.
* g++.dg/cpp0x/nondeduced7.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced5.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced6.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced7.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/65707] internal compiler error: in unify, at cp/pt.c:18577

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65707

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Sat Jun 22 16:29:06 2019
New Revision: 272589

URL: https://gcc.gnu.org/viewcvs?rev=272589&root=gcc&view=rev
Log:
PR c++/65707
PR c++/89480
PR c++/58836
* g++.dg/cpp0x/nondeduced5.C: New test.
* g++.dg/cpp0x/nondeduced6.C: New test.
* g++.dg/cpp0x/nondeduced7.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced5.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced6.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced7.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/65707] internal compiler error: in unify, at cp/pt.c:18577

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65707

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #6 from Marek Polacek  ---
Fixed by r272571.  Test added.

[Bug c++/89480] internal compiler error: in unify, at cp/pt.c:22160 with the template argument force conversion

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89480

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #6 from Marek Polacek  ---
Fixed by r272571.  Test added.

[Bug c++/58836] [c++11] ICE with wrong usage of initializer list in non-type template argument

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58836

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #4 from Marek Polacek  ---
Fixed by r272571.  Test added.

[Bug c++/90455] braced-init and incomplete type instantiation

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90455

--- Comment #2 from Marek Polacek  ---
Fixed (by r272287 I suspect).

[Bug c++/90455] braced-init and incomplete type instantiation

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90455

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-06-22
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug fortran/90329] Incompatibility between gfortran and C lapack calls

2019-06-22 Thread kkylheku at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329

--- Comment #48 from Kaz Kylheku  ---
(In reply to Thomas Koenig from comment #47)
> I see two problems with this suggestion, one minor and one major.
> 
> First, there may well be a value > 1 on the stack for a regular
> call, see comment #15.

Thus it adds overhead to cases like when "ab" is passed, where the callee
treats that as a length 1 string. It has to be suspicious of the value 2 and go
through the self-calling hoop.

(Oh well; obviously this is a workaround that would have to go through
deprecation and removal.)

> Second, the value 1 may end up being there by accident, then this

That I clearly understand: a value 1 may be there spuriously even if no
argument was passed.

> method would cause a crash, and this would be even harder to debug
> than the original case.

That's the thing I'm keenly curious about: if that value is fortuitously the
right one, in the right place on the stack, where is the crash?

(Of course, we must not mutate that word; it belongs to the C caller's frame.)

[Bug c++/90965] New: Improve diagnostic for out-of-line constructor

2019-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90965

Bug ID: 90965
   Summary: Improve diagnostic for out-of-line constructor
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

See .

[Bug tree-optimization/19347] Invariant load not moved out of loop

2019-06-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19347

--- Comment #7 from Eric Gallager  ---
(In reply to Richard Biener from comment #6)
> Reconfirmed.  Note we do vectorize the loop now but we add a runtime check
> for the aliasing (and not move the invariant out either).

So wait if the vectorization part is done now, then why did you make this block
the vectorizer meta-bug? I mean, if that's the part that works and it's only
the other stuff that's still in need of fixing...

[Bug fortran/89782] Can do an internal READ of a character array when it is a parameter, but not a scalar character parameter

2019-06-22 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89782

--- Comment #6 from Jerry DeLisle  ---
Author: jvdelisle
Date: Sat Jun 22 19:58:47 2019
New Revision: 272594

URL: https://gcc.gnu.org/viewcvs?rev=272594&root=gcc&view=rev
Log:
2019-06-22  Jerry DeLisle  

PR fortran/89782
* io.c (gfc_resolve_dt): Check that internal units are not
character PARAMETER.

* gfortran.dg/io_constraints.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/io_constraints_14.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/io.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/90966] New: ICE in tsubst_copy, at cp/pt.c:16155

2019-06-22 Thread frankhb1989 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90966

Bug ID: 90966
   Summary: ICE in tsubst_copy, at cp/pt.c:16155
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: frankhb1989 at gmail dot com
  Target Milestone: ---

template
void f()
{
using S = signed char;
constexpr const S v[]{0};
}

int main()
{
f();
}

a.cc: In instantiation of 'void f() [with I = int]':
a.cc:10:9:   required from here
a.cc:5:20: internal compiler error: in tsubst_copy, at cp/pt.c:16155
5 |  constexpr const S v[]{0};
  |^