[Bug c++/84983] New: [8 regression] g++.dg/ext/pr84828.C fail

2018-03-19 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84983

Bug ID: 84983
   Summary: [8 regression] g++.dg/ext/pr84828.C fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
  Target Milestone: ---

r258476 triggers this:

spawn -ignore SIGHUP /work/gcc/testsuite/g++2/../../xg++
-B/work/gcc/testsuite/g++2/../../ /source/gcc/testsuite/g++.dg/ext/pr84828.C
-fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include
-I/source/libstdc++-v3/libsupc++ -I/source/libstdc++-v3/include/backward
-I/source/libstdc++-v3/testsuite/util -fmessage-length=0 -std=gnu++98 -Og
-mno-sse2 -S -o pr84828.s
FAIL: g++.dg/ext/pr84828.C  -std=gnu++98 (internal compiler error)

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

Also confirmed on Silvermont.

[Bug c++/84850] [8 Regression] -Wclass-memaccess on a memcpy in a copy assignment operator with no nontrivial bases or members

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

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #6 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00915.html

[Bug target/82624] [msp430] Target must allow for NULL pointer dereferences

2018-03-19 Thread oarias at knights dot ucf.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82624

Orlando Arias  changed:

   What|Removed |Added

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

--- Comment #3 from Orlando Arias  ---
Patch committed and applied:

https://gcc.gnu.org/viewcvs/gcc?view=revision=253921

I can't change the target milestone as mandated by the policies, but this was
fixed in the 8.0 branch.

[Bug rtl-optimization/84660] Combine doing wrong optimization for 64 bits with SHIFT_COUNT_TRUNCATED target

2018-03-19 Thread npickito at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84660

--- Comment #7 from Kito Cheng  ---
Hi Jim:

Thanks your update, we'll test that again, btw, we can also test on x86-64 and
aarch64 if you have no time to test other target.

[Bug c/84982] New: logically inverting bools into local array results in bitwise negation

2018-03-19 Thread gcc at basnieuwenhuizen dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84982

Bug ID: 84982
   Summary: logically inverting bools into local array results in
bitwise negation
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at basnieuwenhuizen dot nl
  Target Milestone: ---

Example program:
#include 

struct T {
  bool a;
  bool b;
};

extern void t_dummy(bool *flags);

void t(struct T *t) {
  bool flags[2];

  // These two logical nots get combined and converted to a single bitwise not.
  // of course a bitwise not does not give the expected results.
  flags[0] = !t->a;
  flags[1] = !t->b;

  t_dummy(flags);
}

output with gcc -v -save-temps -c -o /tmp/test.o /tmp/test.c -O3:
 :
   0:   48 83 ec 18 sub$0x18,%rsp
   4:   0f b7 07movzwl (%rdi),%eax
   7:   48 8d 7c 24 0e  lea0xe(%rsp),%rdi
   c:   f7 d0   not%eax
   e:   66 89 44 24 0e  mov%ax,0xe(%rsp)
  13:   e8 00 00 00 00  callq  18 <t+0x18>
  18:   48 83 c4 18 add$0x18,%rsp
  1c:   c3  retq   


The logical negation gets turned into a bitwise negation during optimization.
As a result if the input contains 1 the output contains 254 instead of zero.
GCC seems to assume values of {0,1} otherwise, as the non-merged not is a xor
with 1.

This happens on svn trunk as of today (8.0.1 20180319 (experimental)), the 8.0
provided by fedora (8.0.1 20180222 (Red Hat 8.0.1-0.16)), but does not happen
on the arch gcc version (7.3.1 20180312). If I figure out how to bisect with
SVN I might have time to bisect this later this week.

It seems that if I make the flags array an argument instead of a local + a
function call using it, the merging goes away and with it the problem.

Apologies if this the wrong component. I have no idea which optimization layer
of GCC would cause this, and hence no idea where to route it to.

[Bug fortran/42651] Functions with result: Wrongly accepts attributes to function name

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42651

--- Comment #3 from kargl at gcc dot gnu.org ---
Patch submitted.

[Bug rtl-optimization/84660] Combine doing wrong optimization for 64 bits with SHIFT_COUNT_TRUNCATED target

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

Jim Wilson  changed:

   What|Removed |Added

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

--- Comment #6 from Jim Wilson  ---
Using this:
+   && (SHIFT_COUNT_TRUNCATED
+   && nonzero_bits (XEXP (x, 1), GET_MODE (XEXP (x, 1)))
+   < (unsigned HOST_WIDE_INT) GET_MODE_PRECISION (GET_MODE
(x)
doesn't work for a !SHIFT_COUNT_TRUNCATED target.  That is equivalent to adding
a && 0 to the expression, which breaks the other tests.  I believe this needs
to be instead
+   && (! SHIFT_COUNT_TRUNCATED
+   || (nonzero_bits (XEXP (x, 1), GET_MODE (XEXP (x, 1)))
+   < (unsigned HOST_WIDE_INT) GET_MODE_PRECISION
(xmode)
so that for a !SHIFT_COUNT_TRUNCATED target we get "&& 1" which is no change,
and for a SHIFT_COUNT_TRUNCATED target the additional nonzero_bits test must
pass.

[Bug target/78818] msp430 persistent attribute is not applied correctly in some cases

2018-03-19 Thread dj at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78818

DJ Delorie  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||dj at redhat dot com
 Resolution|--- |FIXED

--- Comment #4 from DJ Delorie  ---
Fixed.

[Bug target/78818] msp430 persistent attribute is not applied correctly in some cases

2018-03-19 Thread jozef.l at mittosystems dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78818

Jozef Lawrynowicz  changed:

   What|Removed |Added

 CC||jozef.l at mittosystems dot com

--- Comment #3 from Jozef Lawrynowicz  ---
This has been fixed, could someone close this PR please.

[Bug fortran/42651] Functions with result: Wrongly accepts attributes to function name

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42651

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
From F2018, 

  C1560 (R1530) If RESULT appears, the function-name shall not appear
  in any specification statement in the scoping unit of the function
  subprogram.

Note, a similar constraint appears in F2003.

Thus, the error messages in comment #1 are correct.  The problem
is that the matchers for some attribute statements do not check
for a problem.  I have a fix for the one in the code contained
herein.

[Bug target/82624] [msp430] Target must allow for NULL pointer dereferences

2018-03-19 Thread jozef.l at mittosystems dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82624

Jozef Lawrynowicz  changed:

   What|Removed |Added

 CC||jozef.l at mittosystems dot com

--- Comment #2 from Jozef Lawrynowicz  ---
This was fixed in r253921, could someone close this please.

[Bug c++/84981] C++17 allows function pointers with no linkage as template parameters but gcc errors, stating the function has no linkage

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

--- Comment #2 from Jonathan Wakely  ---
And maybe also this for references as template arguments:

--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6259,7 +6259,8 @@ convert_nontype_argument_function (tree type, tree expr,
 }

   linkage = decl_linkage (fn_no_ptr);
-  if (cxx_dialect >= cxx11 ? linkage == lk_none : linkage != lk_external)
+  if ((cxx_dialect < cxx11 && linkage != lk_external)
+  || (cxx_dialect < cxx17 && linkage == lk_none))
 {
   if (complain & tf_error)
{


But I think there's more needed to ensure we don't produce invalid GIMPLE.

[Bug c++/52036] C++11 allows template parameters to have internal linkage

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

--- Comment #14 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #13)
> It should work in C++17, but is not the subject of this bug report.

That's now PR 84981.

For this PR, the only remaining bug seems to be comment 8.

[Bug c++/84981] C++17 allows function pointers with no linkage as template parameters but gcc errors, stating the function has no linkage

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

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-19
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Confirmed.

Without the lambda:

template struct X { };

void f()
{
  struct Locale {
static void f() { }
  };

  X<::f> x;
}

c12.cc: In function 'void f()':
c12.cc:9:15: error: 'f()::Locale::f' is not a valid template argument for type
'void (*)()' because 'static void f()::Locale::f()' has no linkage
   X<::f> x;
   ^


This seems to fix it:

--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6259,7 +6259,8 @@ convert_nontype_argument_function (tree type, tree expr,
 }

   linkage = decl_linkage (fn_no_ptr);
-  if (cxx_dialect >= cxx11 ? linkage == lk_none : linkage != lk_external)
+  if ((cxx_dialect < cxx11 && linkage != lk_external)
+  || (cxx_dialect < cxx17 && linkage == lk_none))
 {
   if (complain & tf_error)
{

[Bug c++/84981] New: C++17 allows function pointers with no linkage as template parameters but gcc errors, stating the function has no linkage

2018-03-19 Thread xaxxon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84981

Bug ID: 84981
   Summary: C++17 allows function pointers with no linkage as
template parameters but gcc errors, stating the
function has no linkage
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xaxxon at gmail dot com
  Target Milestone: ---

https://godbolt.org/g/7qE4iW


template
void func() {
}
int main() {

constexpr auto lambda_function_pointer = +[](){};
func();

}


:9:35: error: 'main()::::_FUN' is not a valid template
argument for type 'void (*)()' because 'static constexpr void
main()::::_FUN()' has no linkage

[Bug c++/52036] C++11 allows template parameters to have internal linkage

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

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2012-01-29 00:00:00 |2018-3-19

--- Comment #13 from Jonathan Wakely  ---
That fails because the function has *no* linkage, not because it has internal
linkage. That's a different case (and not supported in C++11 or C++14).

It should work in C++17, but is not the subject of this bug report.

[Bug fortran/84931] Expansion of array constructor with constant implied-do-object goes sideways

2018-03-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84931

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #8 from Thomas Koenig  ---
Fixed on all open branches, closing.

[Bug fortran/84931] Expansion of array constructor with constant implied-do-object goes sideways

2018-03-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84931

--- Comment #7 from Thomas Koenig  ---
Author: tkoenig
Date: Mon Mar 19 22:49:33 2018
New Revision: 258667

URL: https://gcc.gnu.org/viewcvs?rev=258667=gcc=rev
Log:
2018-03-19  Thomas Koenig  

PR fortran/84931
Backport from trunk
* simplify.c (gfc_convert_constant): Correctly handle iterators
for type conversion.

2018-03-19  Thomas Koenig  

PR fortran/84931
Backport from trunk
* gfortran.dg/array_constructor_52.f90: New test.


Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/array_constructor_52.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/simplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/84980] [concepts] ICE with missing typename in cocept

2018-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84980

--- Comment #1 from Volker Reichelt  ---
That's of course "-fconcepts" instead of "-fconcpets".

[Bug c++/84980] New: [concepts] ICE with missing typename in cocept

2018-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84980

Bug ID: 84980
   Summary: [concepts] ICE with missing typename in cocept
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with "-fconcpets")
triggers an ICE since GCC 6.1.0:


template concept bool C = true;

template struct A;


bug.cc:1:10: error: 'T' has not been declared
 template concept bool C = true;
  ^
bug.cc:3:11: internal compiler error: tree check: expected class 'expression',
have 'exceptional' (error_mark) in tree_operand_check, at tree.h:3633
 template struct A;
   ^~~
0x78c78a tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9372
0x5e8cf2 expr_check(tree_node*, char const*, int, char const*)
../../gcc/gcc/tree.h:3304
0x5e8cf2 tree_operand_check(tree_node*, int, char const*, int, char const*)
../../gcc/gcc/tree.h:3633
0x5e8cf2 finish_shorthand_constraint(tree_node*, tree_node*)
../../gcc/gcc/cp/constraint.cc:1277
0x95d90d process_template_parm(tree_node*, unsigned int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:4430
0x93f273 cp_parser_template_parameter_list
../../gcc/gcc/cp/parser.c:15059
0x94294c cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:27111
0x94294c cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:27145
0x947d39 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12729
0x948021 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12656
0x948314 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4561
0x948314 c_parse_file()
../../gcc/gcc/cp/parser.c:39008
0xa47716 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1132
Please submit a full bug report, [etc.]

[Bug fortran/44348] ICE in build_function_decl

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44348

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #22 from kargl at gcc dot gnu.org ---
(In reply to Harald Anlauf from comment #21)
> I did not encounter any ICE with the test cases in this PR which I tried.
> Have they been fixed by Steve's recent patch?

Yes, at least for comment #2 and #12.  It is a duplicate PR77414.

[Bug c++/84979] New: [6/7/8 Regression] ICE with auto as template parameter and -fconcepts

2018-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84979

Bug ID: 84979
   Summary: [6/7/8 Regression] ICE with auto as template parameter
and -fconcepts
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with "-fconcepts")
triggers an ICE since GCC 6.1.0:

=
template void foo() {}

void bar()
{
  foo();
}
=

bug.cc:6:1: internal compiler error: Segmentation fault
 }
 ^
0xebabbf crash_signal
../../gcc/gcc/toplev.c:325
0xad7774 tree_check(tree_node const*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3390
0xad7774 symbol_table::decl_assembler_name_hash(tree_node const*)
../../gcc/gcc/symtab.c:83
0xadb520 symtab_node::get_for_asmname(tree_node const*)
../../gcc/gcc/symtab.c:959
0xadb61f symtab_node::verify_base()
../../gcc/gcc/symtab.c:1029
0xae7a13 cgraph_node::verify_node()
../../gcc/gcc/cgraph.c:3131
0xadc0ec symtab_node::verify()
../../gcc/gcc/symtab.c:1205
0xadc1b7 symtab_node::verify_symtab_nodes()
../../gcc/gcc/symtab.c:1225
0xaf04a4 symtab_node::checking_verify_symtab_nodes()
../../gcc/gcc/cgraph.h:620
0xaf04a4 symbol_table::compile()
../../gcc/gcc/cgraphunit.c:2540
0xaf23e9 symbol_table::compile()
../../gcc/gcc/cgraphunit.c:2537
0xaf23e9 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2717
Please submit a full bug report, [etc.]

[Bug fortran/49025] gfortran bug: Local variable does not hide generic procedure.

2018-03-19 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49025

Harald Anlauf  changed:

   What|Removed |Added

 CC||anlauf at gmx dot de

--- Comment #3 from Harald Anlauf  ---
Bug still present in 8.0.1 rev.258658

[Bug c/84900] Compiler report a error unexpectedly.

2018-03-19 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84900

--- Comment #3 from joseph at codesourcery dot com  ---
Yes, I'd consider this invalid code.  Presumably there's some issue with 
the GNU extension allowing casts of structs to the same type, whereby in 
some cases it fails to make the result of the cast not an lvalue.

[Bug fortran/84931] Expansion of array constructor with constant implied-do-object goes sideways

2018-03-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84931

--- Comment #6 from Thomas Koenig  ---
Author: tkoenig
Date: Mon Mar 19 22:03:01 2018
New Revision: 258666

URL: https://gcc.gnu.org/viewcvs?rev=258666=gcc=rev
Log:
2018-03-19  Thomas Koenig  

PR fortran/84931
Backport from trunk
* simplify.c (gfc_convert_constant): Correctly handle iterators
for type conversion.

2018-03-19  Thomas Koenig  

PR fortran/84931
Backport from trunk
* gfortran.dg/array_constructor_52.f90: New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/array_constructor_52.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/simplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/44348] ICE in build_function_decl

2018-03-19 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44348

--- Comment #21 from Harald Anlauf  ---
I did not encounter any ICE with the test cases in this PR which I tried.
Have they been fixed by Steve's recent patch?

[Bug c++/84978] ice in cxx_eval_constant_expression at gcc/cp/constexpr.c:4109

2018-03-19 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84978

--- Comment #1 from David Binderman  ---
Reduced C++ code:

typedef struct { struct a *b; } c;
typedef void (*d)(c *);
typedef struct a {
  d e;
  int f;
  long g;
} h;
h i() {
  h j;
  ((c *)j.f)->b->e(0);
  return j;
}

[Bug c++/84978] New: ice in cxx_eval_constant_expression at gcc/cp/constexpr.c:4109

2018-03-19 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84978

Bug ID: 84978
   Summary: ice in cxx_eval_constant_expression at
gcc/cp/constexpr.c:4109
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 43712
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43712=edit
gzipped C++ source code

The attached C++ code does this with recent gcc trunk:

$ ../results/bin/gcc -c bug422.cc 
quadprog/quadprog.cpp: In function ‘__Pyx_memviewslice
__pyx_memoryview_copy_new
_contig(const __Pyx_memviewslice*, const char*, int, size_t, int, int)’:
quadprog/quadprog.cpp:20986:1: internal compiler error: Segmentation fault
0x100d46f crash_signal
../../trunk/gcc/toplev.c:325
0x63e895 cxx_eval_constant_expression
../../trunk/gcc/cp/constexpr.c:4109
0x64563f cxx_eval_component_reference
../../trunk/gcc/cp/constexpr.c:2494
0x63e966 cxx_eval_constant_expression
../../trunk/gcc/cp/constexpr.c:4494
$ ../results/bin/gcc -v
Using built-in specs.
COLLECT_GCC=../results/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb/gcc/results.258623/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk/configure --prefix=/home/dcb/gcc/results.258623
--disable-bootstrap --disable-multilib --disable-werror
--enable-checking=df,extra,fold,rtl,yes --enable-languages=c,c++,fortran
Thread model: posix
gcc version 8.0.1 20180317 (experimental) (GCC) 
$ 

The problem seems to exist between revisions 258584 and 258623.

I'll have my usual go at reducing the original test case.

[Bug tree-optimization/84811] [8 Regression] ICE on valid code at -O3 in 64-bit mode on x86_64-linux-gnu: in smallest_mode_for_size, at stor-layout.c:355

2018-03-19 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84811

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #25 from rsandifo at gcc dot gnu.org  
---
Mine

[Bug c++/84977] New: internal compiler error: Segmentation fault (build_x_unary_op())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84977

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

Input:

a(int b, decltype(&(b = c(auto;

Output:

$ cc1plus 
:1:27: error: expected primary-expression before 'auto'
:1:31: error: expected ')' before ';' token
:1:31: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x13c5bac build_x_unary_op(unsigned int, tree_code, cp_expr, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:5595
0xf29932 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8272
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xec87ea cp_parser_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9655
0xf7afbe cp_parser_decltype_expr
/home/vegard/git/gcc/gcc/cp/parser.c:14061
0xf7afbe cp_parser_decltype
/home/vegard/git/gcc/gcc/cp/parser.c:14135
0xf2db37 cp_parser_simple_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17065
0xf22abd cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16852
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfb6b9d cp_parser_parameter_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:21506
0xfb94ea cp_parser_parameter_declaration_list
/home/vegard/git/gcc/gcc/cp/parser.c:21318
0xfbc180 cp_parser_parameter_declaration_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21239
0xf5883f cp_parser_direct_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19992
0xf9e4f8 cp_parser_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19866
0xf9e7ce cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19392
0xfa57a7 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84937] [7/8 Regression] ICE with class template argument deduction and auto

2018-03-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84937

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c++/84976] New: internal compiler error: Segmentation fault (cp_build_modify_expr())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84976

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

Input:

double b;
a(decltype(b = (b = auto)))

Output:

$ cc1plus 
:2:21: error: expected primary-expression before 'auto'
:2:20: error: expected ')' before 'auto'
:2:27: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x140c534 cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
/home/vegard/git/gcc/gcc/cp/typeck.c:8108
0x14116b6 build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
/home/vegard/git/gcc/gcc/cp/typeck.c:8300
0xec6668 cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9527
0xec87ea cp_parser_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9655
0xf7afbe cp_parser_decltype_expr
/home/vegard/git/gcc/gcc/cp/parser.c:14061
0xf7afbe cp_parser_decltype
/home/vegard/git/gcc/gcc/cp/parser.c:14135
0xf2db37 cp_parser_simple_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17065
0xf22abd cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16852
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfb6b9d cp_parser_parameter_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:21506
0xfb94ea cp_parser_parameter_declaration_list
/home/vegard/git/gcc/gcc/cp/parser.c:21318
0xfbc180 cp_parser_parameter_declaration_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21239
0xf5883f cp_parser_direct_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19992
0xf9e4f8 cp_parser_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19866
0xf9e7ce cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19392
0xfa57a7 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xffead5 cp_parser_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12780
0xff5b8b cp_parser_declaration_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:12656
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84975] New: internal compiler error: Segmentation fault (outer_binding()/lookup_name_real_1())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84975

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

Input:

void a() {
  for (;;)
union {
  int a;
  struct a struct {
void a();
  };
};
  a
}

Output:

$ cc1plus 
 void a()
:7:7: error: multiple types in one declaration
:9:3: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0xe1d562 outer_binding(tree_node*, cxx_binding*, bool)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:5879
0xe58739 lookup_name_real_1
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6002
0xe58739 lookup_name_real(tree_node*, int, int, bool, int, int)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6103
0xe8b562 cp_parser_lookup_name
/home/vegard/git/gcc/gcc/cp/parser.c:26235
0xf48d2a cp_parser_class_name
/home/vegard/git/gcc/gcc/cp/parser.c:22352
0xf49359 cp_parser_type_name
/home/vegard/git/gcc/gcc/cp/parser.c:17350
0xf2e479 cp_parser_type_name
/home/vegard/git/gcc/gcc/cp/parser.c:17332
0xf2e479 cp_parser_simple_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17204
0xf22abd cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16852
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfa3a70 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12938
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xfade64 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12476
0xefab2b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10925
0xefe5eb cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11274
0xeff08a cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11228
0xf9283b cp_parser_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21778
0xf9283b cp_parser_ctor_initializer_opt_and_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21813
0xf9ba45 cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26818
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84974] New: internal compiler error: Segmentation fault (ovl_first()/location_of())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84974

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

Input:

namespace {
template  void a();
}
void a() {
  struct {
__attribute__((noinline(a(;
int a;
  }
}

Output:

$ cc1plus 
 void a()
:7:9: error: declaration of 'int a()a'
[-fpermissive]
:7:9: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0xc88b74 ovl_first(tree_node*)
/home/vegard/git/gcc/gcc/cp/cp-tree.h:7442
0xc88b74 location_of(tree_node*)
/home/vegard/git/gcc/gcc/cp/error.c:3027
0x9cf0a3 note_name_declared_in_class(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/class.c:8253
0xe11d52 push_class_level_binding_1
/home/vegard/git/gcc/gcc/cp/name-lookup.c:4730
0xe4df5b push_class_level_binding(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:4755
0xe4df5b pushdecl_class_level(tree_node*)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:4480
0x1279877 finish_member_declaration(tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:3076
0xfdea1c cp_parser_member_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:23964
0xf142ab cp_parser_member_specification_opt
/home/vegard/git/gcc/gcc/cp/parser.c:23374
0xf142ab cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22516
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
0xf231cb cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16774
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfa3a70 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12938
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xfade64 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12476
0xefab2b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10925
0xefe5eb cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11274
0xeff08a cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11228
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

Valgrind says:

==7029== Invalid read of size 2
==7029==at 0xC88B74: ovl_first (cp-tree.h:7442)
==7029==by 0xC88B74: location_of(tree_node*) (error.c:3027)
==7029==by 0x9CF0A3: note_name_declared_in_class(tree_node*, tree_node*)
(class.c:8253)
==7029==by 0xE11D52: push_class_level_binding_1(tree_node*, tree_node*)
(name-lookup.c:4730)
==7029==by 0xE4DF5B: push_class_level_binding (name-lookup.c:4755)
==7029==by 0xE4DF5B: pushdecl_class_level(tree_node*) [clone .part.99]
(name-lookup.c:4480)
==7029==by 0x1279877: finish_member_declaration(tree_node*)
(semantics.c:3076)
==7029==by 0xFDEA1C: cp_parser_member_declaration(cp_parser*)
(parser.c:23964)
==7029==by 0xF142AB: cp_parser_member_specification_opt (parser.c:23374)
==7029==by 0xF142AB: cp_parser_class_specifier_1(cp_parser*)
(parser.c:22516)
==7029==by 0xF231CB: cp_parser_class_specifier (parser.c:22768)
==7029==by 0xF231CB: cp_parser_type_specifier(cp_parser*, int,
cp_decl_specifier_seq*, bool, int*, bool*) (parser.c:16774)
==7029==by 0xF8858A: cp_parser_decl_specifier_seq(cp_parser*, int,
cp_decl_specifier_seq*, int*) (parser.c:13629)
==7029==by 0xFA3A70: cp_parser_simple_declaration(cp_parser*, bool,
tree_node**) (parser.c:12938)
==7029==by 0xFAB998: cp_parser_block_declaration(cp_parser*, bool)
(parser.c:12883)
==7029==by 0xFADE64: cp_parser_declaration_statement(cp_parser*)
(parser.c:12476)
==7029==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

That's:

7439 inline tree
7440 ovl_first (tree node)
7441 {
7442   while (TREE_CODE (node) == OVERLOAD)
7443 node = OVL_FUNCTION (node);
7444   return node;
7445 }

[Bug c++/84927] [7 Regression] ICE with NSDMI and reference

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

Marek Polacek  changed:

   What|Removed |Added

Summary|[7/8 Regressiion] ICE with  |[7 Regression] ICE with
   |NSDMI and reference |NSDMI and reference

--- Comment #4 from Marek Polacek  ---
Fixed on trunk so far.

[Bug rtl-optimization/84643] gcc/optabs.c:6549:26: runtime error: load of value 131075, which is not a valid value for type 'memmodel'

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

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug other/63426] [meta-bug] Issues found with -fsanitize=undefined

2018-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
Bug 63426 depends on bug 84946, which changed state.

Bug 84946 Summary: [8 Regression] UBSAN: in mem_valid_for_store_merging 
../../gcc/gimple-ssa-store-merging.c:3951
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84946

   What|Removed |Added

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

[Bug other/63426] [meta-bug] Issues found with -fsanitize=undefined

2018-03-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
Bug 63426 depends on bug 84643, which changed state.

Bug 84643 Summary: gcc/optabs.c:6549:26: runtime error: load of value 131075, 
which is not a valid value for type 'memmodel'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84643

   What|Removed |Added

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

[Bug tree-optimization/84946] [8 Regression] UBSAN: in mem_valid_for_store_merging ../../gcc/gimple-ssa-store-merging.c:3951

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

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug sanitizer/84761] AddressSanitizer is not compatible with glibc 2.27 on x86

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

--- Comment #10 from Jakub Jelinek  ---
Fixed for 8+ so far.

[Bug tree-optimization/84946] [8 Regression] UBSAN: in mem_valid_for_store_merging ../../gcc/gimple-ssa-store-merging.c:3951

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

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Mon Mar 19 20:49:57 2018
New Revision: 258665

URL: https://gcc.gnu.org/viewcvs?rev=258665=gcc=rev
Log:
PR tree-optimization/84946
* gimple-ssa-store-merging.c (mem_valid_for_store_merging): Compute
bitsize + bitsize in poly_uint64 rather than poly_int64.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-store-merging.c

[Bug c++/84973] New: internal compiler error: Segmentation fault (tree_check()/ultimate_transparent_alias_target())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84973

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

Input:

template  void a() {
  typedef struct {
void b() try { b; } catch (short) {
}
  } c;
}

Output:

$ cc1plus 
 void a() void a()b()
: At global scope:
:6:1: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
/home/vegard/git/gcc/gcc/toplev.c:325
0x41a568c tree_check(tree_node*, char const*, int, char const*, tree_code)
/home/vegard/git/gcc/gcc/tree.h:3131
0x41a568c ultimate_transparent_alias_target
/home/vegard/git/gcc/gcc/varasm.c:1285
0x41ab7a7 notice_global_symbol(tree_node*)
/home/vegard/git/gcc/gcc/varasm.c:1670
0x1995af3 cgraph_node::finalize_function(tree_node*, bool)
/home/vegard/git/gcc/gcc/cgraphunit.c:452
0x128999b expand_or_defer_fn(tree_node*)
/home/vegard/git/gcc/gcc/cp/semantics.c:4253
0xc6c3f8 c_parse_final_cleanups()
/home/vegard/git/gcc/gcc/cp/decl2.c:4896
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug sanitizer/78651] Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active

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

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Mon Mar 19 20:48:39 2018
New Revision: 258664

URL: https://gcc.gnu.org/viewcvs?rev=258664=gcc=rev
Log:
PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

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

[Bug sanitizer/84761] AddressSanitizer is not compatible with glibc 2.27 on x86

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

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Mon Mar 19 20:47:29 2018
New Revision: 258663

URL: https://gcc.gnu.org/viewcvs?rev=258663=gcc=rev
Log:
PR sanitizer/84761
* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
Define if not defined.
(DL_INTERNAL_FUNCTION): Don't define.
(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
determine at runtime whether to use regparm(3), stdcall calling
convention for older glibcs or normal calling convention for
newer glibcs for call to _dl_get_tls_static_info.

Modified:
trunk/libsanitizer/ChangeLog
trunk/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

[Bug rtl-optimization/84643] gcc/optabs.c:6549:26: runtime error: load of value 131075, which is not a valid value for type 'memmodel'

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

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Mon Mar 19 20:46:23 2018
New Revision: 258662

URL: https://gcc.gnu.org/viewcvs?rev=258662=gcc=rev
Log:
PR rtl-optimization/84643
* memmodel.h (enum memmodel): Add MEMMODEL_MAX enumerator.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/memmodel.h

[Bug c++/84927] [7/8 Regressiion] ICE with NSDMI and reference

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

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Mon Mar 19 20:46:16 2018
New Revision: 258661

URL: https://gcc.gnu.org/viewcvs?rev=258661=gcc=rev
Log:
PR c++/84927
* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
as we evaluate the elements.
(cxx_eval_constant_expression): Verify constructor's flags
unconditionally.

* g++.dg/cpp1y/nsdmi-aggr9.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr9.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/81837] Internal compiler error (cp/typeck2.c:1264)

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

--- Comment #6 from Paolo Carlini  ---
See Comment 4: why 2 errors?

[Bug c++/84925] [8 Regression] ICE with segfault in __PRETTY_FUNCTION__

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

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/84925] [8 Regression] ICE with segfault in __PRETTY_FUNCTION__

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

--- Comment #6 from Marek Polacek  ---
Author: mpolacek
Date: Mon Mar 19 20:34:45 2018
New Revision: 258660

URL: https://gcc.gnu.org/viewcvs?rev=258660=gcc=rev
Log:
PR c++/84925
* pt.c (enclosing_instantiation_of): Check if fn is null.

* g++.dg/cpp1z/lambda-__func__.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/lambda-__func__.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/71834] [6/7/8 Regression] accepts invalid C++11 code with too few number of template arguments for class template

2018-03-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71834

--- Comment #6 from Jason Merrill  ---
Author: jason
Date: Mon Mar 19 20:32:57 2018
New Revision: 258659

URL: https://gcc.gnu.org/viewcvs?rev=258659=gcc=rev
Log:
PR c++/71834 - template-id with too few arguments.

* pt.c (coerce_template_parms): Check fixed_parameter_pack_p.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-nested3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/71638] [6/7/8 Regression] ICE on invalid C++ code on x86_64-linux-gnu with -Wall (internal compiler error: non-constant element in constant CONSTRUCTOR)

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71638

vegard.nossum at gmail dot com  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #8 from vegard.nossum at gmail dot com  ---
FWIW here is a slightly smaller test case for what I assume is the same
underlying bug, but this test case doesn't give any errors before the ICE:

struct {
  int &
  int b{a};
} c[] {
  2
}

Output:

$ cc1plus 
:6:1: internal compiler error: non-constant element in constant
CONSTRUCTOR
0x40096d3 verify_constructor_flags(tree_node*)
/home/vegard/git/gcc/gcc/tree.c:2005
[...]

[Bug c++/84644] internal compiler error: in warn_misplaced_attr_for_class_type, at cp/decl.c:4718

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84644

vegard.nossum at gmail dot com  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #2 from vegard.nossum at gmail dot com  ---
FWIW, slightly different test case:

template 
void b() {
decltype(a) __attribute__(volatile);
}

[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

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

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Sebor  ---
Resolving as Won't Fix based on comment #2.  (I will update gcc-8/changes.html
before the release and may update the documentation of attribute const in the
manual with additional detail.)

[Bug c++/84972] New: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in extended_tree, at tree.h:5545

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84972

Bug ID: 84972
   Summary: internal compiler error: tree check: expected class
'type', have 'exceptional' (error_mark) in
extended_tree, at tree.h:5545
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

char(a[])({.a = 0})

Output:

$ cc1plus 
:1:19: warning: list-initializer for non-class type must not be
parenthesized
:1:19: error: name 'a' used in a GNU-style designated initializer for an
array
:1:19: error: name 'a' used in a GNU-style designated initializer for an
array
:1:19: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in extended_tree, at tree.h:5545
0x660619 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/vegard/git/gcc/gcc/tree.c:9388
0x1506d85 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/vegard/git/gcc/gcc/tree.h:3255
0x1506d85 wi::extended_tree<192>::extended_tree(tree_node const*)
/home/vegard/git/gcc/gcc/tree.h:5545
0x1506d85 generic_wide_int >::generic_wide_int(tree_node const* const&)
/home/vegard/git/gcc/gcc/wide-int.h:750
0x1506d85 wi::to_widest(tree_node const*)
/home/vegard/git/gcc/gcc/tree.h:5472
0x1506d85 tree_int_cst_lt(tree_node const*, tree_node const*)
/home/vegard/git/gcc/gcc/tree.h:5725
0x1506d85 complete_array_type(tree_node**, tree_node*, bool)
/home/vegard/git/gcc/gcc/c-family/c-common.c:6353
0xb41f7a cp_complete_array_type(tree_node**, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/decl.c:8320
0x141da51 process_init_constructor
/home/vegard/git/gcc/gcc/cp/typeck2.c:1724
0x141da51 digest_init_r
/home/vegard/git/gcc/gcc/cp/typeck2.c:1148
0x142ad1a digest_init_flags(tree_node*, tree_node*, int, int)
/home/vegard/git/gcc/gcc/cp/typeck2.c:1193
0x142ad1a store_init_value(tree_node*, tree_node*, vec**, int)
/home/vegard/git/gcc/gcc/cp/typeck2.c:814
0xb45618 check_initializer
/home/vegard/git/gcc/gcc/cp/decl.c:6424
0xbd954e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
/home/vegard/git/gcc/gcc/cp/decl.c:7078
0xfa0a29 cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19731
0xfa57a7 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xffead5 cp_parser_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12780
0xff5b8b cp_parser_declaration_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:12656
0xff71b3 cp_parser_translation_unit
/home/vegard/git/gcc/gcc/cp/parser.c:4561
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

Looks potentially similar to #84662, but that one has been fixed on trunk
according to godbolt.org, whereas this one still crashes.

[Bug tree-optimization/84969] [8 Regression] Wrong code with -ftree-loop-distribute-patterns

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

amker at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug tree-optimization/84969] [8 Regression] Wrong code with -ftree-loop-distribute-patterns

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

amker at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #1 from amker at gcc dot gnu.org ---
Sorry for the breakage, I will investigate it.

[Bug c++/84971] New: internal compiler error: in build_non_dependent_expr, at cp/pt.c:25367

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84971

Bug ID: 84971
   Summary: internal compiler error: in build_non_dependent_expr,
at cp/pt.c:25367
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

void a();
void a(short);
template  decltype(__builtin_inf) b { int(&() >) }

Output:

$ cc1plus 
:3:54: internal compiler error: in build_non_dependent_expr, at
cp/pt.c:25367
0x10518a7 build_non_dependent_expr(tree_node*)
/home/vegard/git/gcc/gcc/cp/pt.c:25367
0x13933bf build_x_binary_op(unsigned int, tree_code, tree_node*, tree_code,
tree_node*, tree_code, tree_node**, int)
/home/vegard/git/gcc/gcc/cp/typeck.c:4024
0xec484b cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9356
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xed4304 cp_parser_parenthesized_expression_list
/home/vegard/git/gcc/gcc/cp/parser.c:7764
0xedcd27 cp_parser_functional_cast
/home/vegard/git/gcc/gcc/cp/parser.c:27371
0xf76815 cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:6956
0xf2a4b7 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8322
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xecc0a3 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9770
0xecd8d5 cp_parser_initializer_clause
/home/vegard/git/gcc/gcc/cp/parser.c:21916
0xecd8d5 cp_parser_initializer_list
/home/vegard/git/gcc/gcc/cp/parser.c:22185
0xecd8d5 cp_parser_braced_list
/home/vegard/git/gcc/gcc/cp/parser.c:21956
0xedc221 cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21874
0xfa0f3d cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19677
0xfa3619 cp_parser_single_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:27281
0xfc5428 cp_parser_template_declaration_after_parameters
/home/vegard/git/gcc/gcc/cp/parser.c:26876
0xfc3a2b cp_parser_explicit_template_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:27114
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84970] New: internal compiler error: in tsubst_copy, at cp/pt.c:15085

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84970

Bug ID: 84970
   Summary: internal compiler error: in tsubst_copy, at
cp/pt.c:15085
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: nathan at gcc dot gnu.org, webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

namespace {
void a();
}
template  void a(b) { int c(a); }
void d { a(1e31) }

Output:

$ cc1plus 
 void a(b)
: At global scope:
:5:6: error: variable or field 'd' declared void
 void a(b) [with b = double]
: In instantiation of 'void a(b) [with b = double]':
:5:16:   required from here
:4:39: internal compiler error: in tsubst_copy, at cp/pt.c:15085
0x10e5c47 tsubst_copy
/home/vegard/git/gcc/gcc/cp/pt.c:15085
0x10f43f3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/vegard/git/gcc/gcc/cp/pt.c:17573
0x10f31ce tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/vegard/git/gcc/gcc/cp/pt.c:18184
0x10bd816 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/pt.c:16987
0x5ea152 tsubst_init
/home/vegard/git/gcc/gcc/cp/pt.c:14876
0x10c830e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/pt.c:16317
0x10bc178 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/pt.c:16471
0x10b2b3f instantiate_decl(tree_node*, bool, bool)
/home/vegard/git/gcc/gcc/cp/pt.c:23542
0x11e75d7 instantiate_pending_templates(int)
/home/vegard/git/gcc/gcc/cp/pt.c:23658
0xc68614 c_parse_final_cleanups()
/home/vegard/git/gcc/gcc/cp/decl2.c:4721
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

Error message looks like a dup of bug #84702 but this test case also reproduces
on trunk on godbolt.org (20180318).

[Bug tree-optimization/84969] [8 Regression] Wrong code with -ftree-loop-distribute-patterns

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

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2018-3-19
  Known to work||7.3.0
   Target Milestone|--- |8.0
  Known to fail||8.0

[Bug sanitizer/78651] Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active

2018-03-19 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78651

--- Comment #6 from chefmax at gcc dot gnu.org ---
Author: chefmax
Date: Mon Mar 19 19:59:56 2018
New Revision: 258658

URL: https://gcc.gnu.org/viewcvs?rev=258658=gcc=rev
Log:
2018-03-19  Maxim Ostapenko  

gcc/

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

gcc/testsuite/

PR sanitizer/78651
* g++.dg/asan/pr78651.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/asan/pr78651.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2asm.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/84969] New: [8 Regression] Wrong code with -ftree-loop-distribute-patterns

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

Bug ID: 84969
   Summary: [8 Regression] Wrong code with
-ftree-loop-distribute-patterns
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: amker at gcc dot gnu.org
  Target Milestone: ---

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

Starting from r253859 we generate wrong code for:

$ gcc -O2 isolate.c   && ./a.out 
retval: {{{0,1},{2,3}}}

$ gcc -O2 isolate.c -ftree-loop-distribute-patterns  && ./a.out 
retval: {{
Aborted (core dumped)

[Bug c++/84968] New: internal compiler error: in strip_typedefs_expr, at cp/tree.c:1792

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84968

Bug ID: 84968
   Summary: internal compiler error: in strip_typedefs_expr, at
cp/tree.c:1792
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct {
  template 
  void a()
try {
} catch (int () noexcept (({ union b a; })))
};

Output:

$ cc1plus 
 void::a()
:3:51: internal compiler error: in strip_typedefs_expr, at
cp/tree.c:1792
0x1377a9f strip_typedefs_expr(tree_node*, bool*)
/home/vegard/git/gcc/gcc/cp/tree.c:1792
0x1374363 strip_typedefs_expr(tree_node*, bool*)
/home/vegard/git/gcc/gcc/cp/tree.c:1813
0x13741b6 strip_typedefs_expr(tree_node*, bool*)
/home/vegard/git/gcc/gcc/cp/tree.c:1813
0xcd34dd build_noexcept_spec(tree_node*, int)
/home/vegard/git/gcc/gcc/cp/except.c:1223
0xeebc5c cp_parser_noexcept_specification_opt
/home/vegard/git/gcc/gcc/cp/parser.c:24352
0xf72bbd cp_parser_exception_specification_opt
/home/vegard/git/gcc/gcc/cp/parser.c:24380
0xf58cff cp_parser_direct_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:20024
0xf5fc70 cp_parser_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19866
0xf9b0ce cp_parser_exception_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:24627
0xf9b0ce cp_parser_handler
/home/vegard/git/gcc/gcc/cp/parser.c:24577
0xf9bc27 cp_parser_handler_seq
/home/vegard/git/gcc/gcc/cp/parser.c:24553
0xf9bc27 cp_parser_function_try_block
/home/vegard/git/gcc/gcc/cp/parser.c:24535
0xf9bc27 cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26815
0xf9dd0c cp_parser_late_parsing_for_member
/home/vegard/git/gcc/gcc/cp/parser.c:27699
0xf17c75 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22742
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
0xf231cb cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16774
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfa3a70 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12938
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84967] New: internal compiler error: in process_init_constructor_array, at cp/typeck2.c:1324

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84967

Bug ID: 84967
   Summary: internal compiler error: in
process_init_constructor_array, at cp/typeck2.c:1324
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

int b([] {
  struct c {
double (*d)();
c() {
  decltype(alignof(d)) a[] { sizeof d[0] }
}
  };
})

Output:

$ cc1plus 
  ::c::c()
:5:44: warning: pointer to a function used in arithmetic
[-Wpointer-arith]
:5:44: warning: invalid application of 'sizeof' to a function type
[-Wpointer-arith]
:5:46: internal compiler error: in process_init_constructor_array, at
cp/typeck2.c:1324
0x1425b4f process_init_constructor_array
/home/vegard/git/gcc/gcc/cp/typeck2.c:1323
0x141db7c process_init_constructor
/home/vegard/git/gcc/gcc/cp/typeck2.c:1711
0x141db7c digest_init_r
/home/vegard/git/gcc/gcc/cp/typeck2.c:1148
0x142ad1a digest_init_flags(tree_node*, tree_node*, int, int)
/home/vegard/git/gcc/gcc/cp/typeck2.c:1193
0x142ad1a store_init_value(tree_node*, tree_node*, vec**, int)
/home/vegard/git/gcc/gcc/cp/typeck2.c:814
0xb45618 check_initializer
/home/vegard/git/gcc/gcc/cp/decl.c:6424
0xbd954e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
/home/vegard/git/gcc/gcc/cp/decl.c:7078
0xfa0a29 cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19731
0xfa57a7 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xfade64 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12476
0xefab2b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10925
0xefe5eb cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11274
0xeff08a cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11228
0xf9283b cp_parser_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21778
0xf9283b cp_parser_ctor_initializer_opt_and_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21813
0xf9ba45 cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26818
0xf9dd0c cp_parser_late_parsing_for_member
/home/vegard/git/gcc/gcc/cp/parser.c:27699
0xf17c75 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22742
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/81837] Internal compiler error (cp/typeck2.c:1264)

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81837

vegard.nossum at gmail dot com  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #5 from vegard.nossum at gmail dot com  ---
This looks like it has been fixed, maybe somebody can confirm and change
status.

[Bug inline-asm/84966] New: internal compiler error: verify_gimple failed (verify_gimple_in_cfg())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84966

Bug ID: 84966
   Summary: internal compiler error: verify_gimple failed
(verify_gimple_in_cfg())
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

int a;
int main() {
  short b;
  asm("" : "+m"(b = a));
}

Output:

$ cc1plus 
 int main()
Analyzing compilation unit

:5:26: warning: memory input 1 is not directly addressable
Performing interprocedural optimizations
 <*free_lang_data>  :8:1: error:
non-register as LHS of unary operation
b = (short int) a.0_1;
during GIMPLE pass: ssa
:8:1: internal compiler error: verify_gimple failed
0x32e305f verify_gimple_in_cfg(function*, bool)
/home/vegard/git/gcc/gcc/tree-cfg.c:5579
0x2b67427 execute_function_todo
/home/vegard/git/gcc/gcc/passes.c:1994
0x2b700f6 do_per_function
/home/vegard/git/gcc/gcc/passes.c:1659
0x2b700f6 execute_todo
/home/vegard/git/gcc/gcc/passes.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84965] New: internal compiler error: unexpected expression '__alignof__ (({...}))' of kind alignof_expr

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84965

Bug ID: 84965
   Summary: internal compiler error: unexpected expression
'__alignof__ (({...}))' of kind alignof_expr
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

void a() { [](decltype((alignof({}) != 0 && (auto }

Output:

$ cc1plus 
 void a()
:1:35: warning: invalid application of '__alignof__' to a void type
[-Wpointer-arith]
:1:46: error: expected primary-expression before 'auto'
:1:46: error: expected ')' before 'auto'
:1:53: internal compiler error: unexpected expression '__alignof__
(({...}))' of kind alignof_expr
0xa38a8b cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4772
0xa3fa54 cxx_eval_binary_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:2019
0xa3046c cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4452
0xa4996a cxx_eval_outermost_constant_expr
/home/vegard/git/gcc/gcc/cp/constexpr.c:4832
0xa57256 maybe_constant_value(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/constexpr.c:5049
0xab6bea cp_fully_fold(tree_node*)
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2041
0xec373b cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9297
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xec87ea cp_parser_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9655
0xf3478f cp_parser_primary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:5206
0xf7698b cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:7030
0xf2a4b7 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8322
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xec87ea cp_parser_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9655
0xf7afbe cp_parser_decltype_expr
/home/vegard/git/gcc/gcc/cp/parser.c:14061
0xf7afbe cp_parser_decltype
/home/vegard/git/gcc/gcc/cp/parser.c:14135
0xf2db37 cp_parser_simple_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:17065
0xf22abd cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16852
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug Duplication Problem] Survey Invite

2018-03-19 Thread amcgitirana

I've invited you to fill out the following form:
Professional Profile

To fill it out, visit:
https://docs.google.com/forms/d/e/1FAIpQLSfQTZkrylE1t49gjzewPQSPWHFnPtGCZfRujg_G8VTwqGrbHg/viewform?c=0w=1usp=mail_form_link

Dear friend,

I am a masters student in Computer Science at the Federal University  
of Bahia, Salvador, Brazil, under the advising of Dr. Eduardo Almeida.


We chose you because you participated in one of the open source projects  
included in this study. All the information provided will be kept  
confidential. We have no intention to judge your work since we are merely  
interested in learning about some aspects of your work.


We are investigating the bug report duplication problem, so based on your  
experience using bug-trackers, we would like to invite you to participate  
in a short 8-10 minute survey that our research group is conducting to get  
opinion about this subject.


Please, return it until February 31st, 2018. We will offer a lottery ticket  
to compete for an Amazon $100 credit and the results of the study when we  
finished the analysis.



We appreciate your time!

Best Regards,

Alexandre Gitirana


Google Forms: Create and analyze surveys.


[Bug c++/84964] New: internal compiler error: in expand_call, at calls.c:4540

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84964

Bug ID: 84964
   Summary: internal compiler error: in expand_call, at
calls.c:4540
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct a {
  short b : -1ULL;
};
void c(...) { c(a()); }

Output:

$ cc1plus 
:2:14: warning: width of 'a::b' exceeds its type
 void c(...)
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   

  Assembling functions:
   void c(...)
: In function 'void c(...)':
:4:16: sorry, unimplemented: passing too large argument on stack
during RTL pass: expand
:4:16: internal compiler error: in expand_call, at calls.c:4540
0x17b719f expand_call(tree_node*, rtx_def*, int)
/home/vegard/git/gcc/gcc/calls.c:4537
0x1e78955 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/vegard/git/gcc/gcc/expr.c:11002
0x181e6d4 expand_expr
/home/vegard/git/gcc/gcc/expr.h:276
0x181e6d4 expand_call_stmt
/home/vegard/git/gcc/gcc/cfgexpand.c:2690
0x181e6d4 expand_gimple_stmt_1
/home/vegard/git/gcc/gcc/cfgexpand.c:3624
0x181e6d4 expand_gimple_stmt
/home/vegard/git/gcc/gcc/cfgexpand.c:3790
0x1824c48 expand_gimple_basic_block
/home/vegard/git/gcc/gcc/cfgexpand.c:5819
0x18443d7 execute
/home/vegard/git/gcc/gcc/cfgexpand.c:6425
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug fortran/84963] New: [8 Regression] ICE in get_constraint_for_ssa_var, at tree-ssa-structalias.c:2955

2018-03-19 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84963

Bug ID: 84963
   Summary: [8 Regression] ICE in get_constraint_for_ssa_var, at
tree-ssa-structalias.c:2955
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20180311 and 20180318, reappearance of pr70856 :


$ cat z1.f90
program p
   print *, sin([1.0, 2.0])
   print *, cos([1.0, 2.0])
end


$ gfortran-8-20180311 -c z1.f90 -fopenacc -O2
$ gfortran-8-20180318 -c z1.f90 -fopenacc -O1
$
$ gfortran-8-20180318 -c z1.f90 -fopenacc -O2
during IPA pass: pta
z1.f90:4:0:

 end

internal compiler error: in get_constraint_for_ssa_var, at
tree-ssa-structalias.c:2955
0xd2f3b0 get_constraint_for_ssa_var
../../gcc/tree-ssa-structalias.c:2952
0xd2f4de get_constraint_for_1
../../gcc/tree-ssa-structalias.c:3559
0xd2f5c9 get_constraint_for_component_ref
../../gcc/tree-ssa-structalias.c:3237
0xd2f5c9 get_constraint_for_1
../../gcc/tree-ssa-structalias.c:3514
0xd31bf7 find_func_aliases
../../gcc/tree-ssa-structalias.c:4911
0xd392e1 ipa_pta_execute
../../gcc/tree-ssa-structalias.c:7988

[Bug c++/84962] New: internal compiler error: in get_fns, at cp/tree.c:2505

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84962

Bug ID: 84962
   Summary: internal compiler error: in get_fns, at cp/tree.c:2505
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct {
  struct {
template  void a();
  };  : a
}

Output:

$ cc1plus 
:4:17: internal compiler error: in get_fns, at cp/tree.c:2505
0x130ac07 get_fns(tree_node*)
/home/vegard/git/gcc/gcc/cp/tree.c:2504
0x130adf0 get_first_fn(tree_node*)
/home/vegard/git/gcc/gcc/cp/tree.c:2514
0x12ae65f finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
/home/vegard/git/gcc/gcc/cp/semantics.c:3731
0xf33f42 cp_parser_primary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:5611
0xf7698b cp_parser_postfix_expression
/home/vegard/git/gcc/gcc/cp/parser.c:7030
0xf2a4b7 cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8322
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xecbd14 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9762
0xfdec8d cp_parser_member_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:23684
0xf142ab cp_parser_member_specification_opt
/home/vegard/git/gcc/gcc/cp/parser.c:23374
0xf142ab cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22516
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
0xf231cb cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16774
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
0xfa3a70 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12938
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xffead5 cp_parser_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12780
0xff5b8b cp_parser_declaration_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:12656
0xff71b3 cp_parser_translation_unit
/home/vegard/git/gcc/gcc/cp/parser.c:4561
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84961] New: internal compiler error: verify_ssa failed

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84961

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

Input:

short a;
volatile double b;
void c() { asm("" : "=a"(b = a)); }

Output:

$ cc1plus 
 void c()
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>  
:3:35: error: SSA_NAME_DEF_STMT is wrong
Expected definition statement:
__asm__("" : "=a" _3);

Actual definition statement:
_3 = _2;
during GIMPLE pass: ssa
:3:35: internal compiler error: verify_ssa failed
0x3d61773 verify_ssa(bool, bool)
/home/vegard/git/gcc/gcc/tree-ssa.c:1188
0x2b674cd execute_function_todo
/home/vegard/git/gcc/gcc/passes.c:2001
0x2b700f6 do_per_function
/home/vegard/git/gcc/gcc/passes.c:1659
0x2b700f6 execute_todo
/home/vegard/git/gcc/gcc/passes.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84960] New: internal compiler error: verify_flow_info failed

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84960

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

Input:

int a;
float b;
void c() {
  long d;
e:
  if ((b - (a %= 0) < 1) * -1)
;
  else {
decltype(d) f(a);
__builtin_unreachable();
__builtin_prefetch(&);
  }
  goto *a;
}

Output:

$ cc1plus -O2 -fno-strict-overflow
 void c()
:6:15: warning: division by zero [-Wdiv-by-zero]

Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   

  
 Assembling functions:
   void c()
: In function 'void c()':
:3:6: error: ENTRY_BLOCK has IL associated with it
during GIMPLE pass: isolate-paths
:3:6: internal compiler error: verify_flow_info failed
0x185ac87 verify_flow_info()
/home/vegard/git/gcc/gcc/cfghooks.c:265
0x331048c checking_verify_flow_info
/home/vegard/git/gcc/gcc/cfghooks.h:198
0x331048c cleanup_tree_cfg_noloop
/home/vegard/git/gcc/gcc/tree-cfgcleanup.c:920
0x331048c cleanup_tree_cfg()
/home/vegard/git/gcc/gcc/tree-cfgcleanup.c:971
0x2b66e84 execute_function_todo
/home/vegard/git/gcc/gcc/passes.c:1947
0x2b700f6 do_per_function
/home/vegard/git/gcc/gcc/passes.c:1659
0x2b700f6 execute_todo
/home/vegard/git/gcc/gcc/passes.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c++/84959] New: internal compiler error: in store_binding, at cp/name-lookup.c:6549 (store_binding()/store_class_binding())

2018-03-19 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84959

Bug ID: 84959
   Summary: internal compiler error: in store_binding, at
cp/name-lookup.c:6549
(store_binding()/store_class_binding())
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vegard.nossum at oracle dot com
CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

class {
  void a() {
struct {
  virtual void b();
  union b
}
  }
  char b;
};

Output:

$ cc1plus 
 void::a()
:6:5: error: expected unqualified-id before '}' token
:3:12: internal compiler error: in store_binding, at
cp/name-lookup.c:6549
0xe2f887 store_binding
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6549
0xe2f887 store_class_bindings
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6611
0xe30189 do_push_to_top_level
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6657
0xe4cec0 do_push_nested_namespace
/home/vegard/git/gcc/gcc/cp/name-lookup.c:6751
0xe4d654 push_nested_namespace(tree_node*)
/home/vegard/git/gcc/gcc/cp/name-lookup.c:7037
0x120b92f push_abi_namespace
/home/vegard/git/gcc/gcc/cp/rtti.c:149
0x120b92f get_tinfo_desc
/home/vegard/git/gcc/gcc/cp/rtti.c:1449
0x120b552 get_tinfo_desc
/home/vegard/git/gcc/gcc/cp/rtti.c:1330
0x121092e get_tinfo_decl(tree_node*)
/home/vegard/git/gcc/gcc/cp/rtti.c:452
0x9ac8bf build_rtti_vtbl_entries
/home/vegard/git/gcc/gcc/cp/class.c:9636
0x9ac8bf build_vtbl_initializer
/home/vegard/git/gcc/gcc/cp/class.c:9151
0x9ac8bf dfs_accumulate_vtbl_inits
/home/vegard/git/gcc/gcc/cp/class.c:9075
0x9ac8bf accumulate_vtbl_inits
/home/vegard/git/gcc/gcc/cp/class.c:8978
0x9e45a1 finish_vtbls
/home/vegard/git/gcc/gcc/cp/class.c:8609
0x9e45a1 finish_struct_1(tree_node*)
/home/vegard/git/gcc/gcc/cp/class.c:6905
0x9ebe54 finish_struct(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/class.c:7065
0xf144c3 cp_parser_class_specifier_1
/home/vegard/git/gcc/gcc/cp/parser.c:22524
0xf231cb cp_parser_class_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:22768
0xf231cb cp_parser_type_specifier
/home/vegard/git/gcc/gcc/cp/parser.c:16774
0xf8858a cp_parser_decl_specifier_seq
/home/vegard/git/gcc/gcc/cp/parser.c:13629
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

[Bug c/84953] [6/7/8 Regression] misleading warning from strpbrk(x,"")

2018-03-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84953

--- Comment #7 from Bernd Edlinger  ---
Well, okay then...

Thanks!

[Bug fortran/77414] ICE in create_function_arglist, at fortran/trans-decl.c:2410

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77414

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.4

--- Comment #9 from kargl at gcc dot gnu.org ---
Fixed on 7-branch and trunk.  Thanks for bug report.
Patch does not apply cleanly to 6-branch.

[Bug fortran/65453] ICE in build_function_decl, at fortran/trans-decl.c:2001

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65453

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.5

--- Comment #6 from kargl at gcc dot gnu.org ---
Fixed on 6-branch, 7-branch, and trunk.

[Bug tree-optimization/84958] int loads not eliminated against larger stores

2018-03-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84958

--- Comment #1 from Tom de Vries  ---
https://gcc.gnu.org/ml/gcc-cvs/2018-03/msg00566.html :

Author: vries
Date: Mon Mar 19 19:12:53 2018
New Revision: 258656

URL: https://gcc.gnu.org/viewcvs?rev=258656=gcc=rev
Log:
[testsuite] Add nvptx xfail to pr84512.c

2018-03-19  Tom de Vries  

* gcc.dg/tree-ssa/pr84512.c: Don't require effective target
vect_int_mult.  Add nvptx xfail for PR84958.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c

[Bug fortran/65453] ICE in build_function_decl, at fortran/trans-decl.c:2001

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65453

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Mar 19 19:14:06 2018
New Revision: 258657

URL: https://gcc.gnu.org/viewcvs?rev=258657=gcc=rev
Log:
2018-03-19  Steven G. Kargl  

PR fortran/65453
* decl.c (get_proc_name): Catch clash between a procedure statement
and a contained subprogram

2018-03-19  Steven G. Kargl  

PR fortran/65453
* gfortran.dg/pr65453.f90: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr65453.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/decl.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/84908] retpoline weirdness: 7.3.0-1 and 4.8.5-16: with -fPIC: R_X86_64_PC32 against undefined symbol `__x86_indirect_thunk_rax'

2018-03-19 Thread jason.vas.dias at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84908

--- Comment #8 from Jason Vas Dias  ---
Thanks for the clarification, and I hope the kernel
developers stop compiling the mainline vDSO with
-mindirect-branch=thunk-extern -mindirect-branch-register 
.

But there are still a few things I am trying to figure out :

 o Why is the thunk entry reference & relocation inserted
   for 6 switch clauses and not for 5 ?


 o So do I understand correctly: 

__x86_indirect_thunk_rax

   is resolved and jumped to save %rax , jump to the address in %rcx, 
   and then restore %rax, and return ?

   it is normally 
A) generated for libraries / executable as required or 
B) is in libgcc ?

   If (A), then what triggers it and why is it not being generated for the
vDSO?
   If (B), then where is the code in libgcc ? I can't find it.


I'd also like more details on why it is wrong to compile the vDSO with these 
flags - it does work, and yes causes compilation problems like this one which
can be worked around by declaring all 'notrace static inline' entry points
in vclock_gettime.c to have the function attributes:
   static inline 
   __attribute__((
 indirect_branch("keep"),
 function_return("keep")
   ))
   int do_monotonic_raw( int clock, struct timespec *ts );
which effectively disables the effect of 
   -mindirect-branch=thunk-extern -mindirect-branch-register
for these functions ; also __vdso_clock_gettime itself MUST
be then declared:
   __attribute__((
 indirect_branch("keep"),
 function_return("keep")
   )) 
   int __vdso_clock_gettime ( ... ) { ...

But does it cause any other issues ?

I did investigate changing the switch in __vdso_clock_gettime
to :

#define _GTOD_LABEL_PREFIX_ _vcg_
#define _SYMCAT_(_S1_,_S2_) _S1_##_S2_
#define _GTOD_CLK_LABEL_(_CLK_) _SYMCAT_(_GTOD_LABEL_PREFIX_,_CLK_)

notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
{
static const void * clk_jmp_tbl[ MAX_CLOCKS ]   = {
[ CLOCK_REALTIME  ] =
&&_GTOD_CLK_LABEL_(CLOCK_REALTIME) ,
[ CLOCK_MONOTONIC ] =
&&_GTOD_CLK_LABEL_(CLOCK_MONOTONIC) ,
[ CLOCK_PROCESS_CPUTIME_ID ]= & ,
[ CLOCK_THREAD_CPUTIME_ID  ]= & ,
[ CLOCK_MONOTONIC_RAW  ]=
&&_GTOD_CLK_LABEL_(CLOCK_MONOTONIC_RAW) ,
[ CLOCK_REALTIME_COARSE]=
&&_GTOD_CLK_LABEL_(CLOCK_REALTIME_COARSE) ,
[ CLOCK_MONOTONIC_COARSE   ]=
&&_GTOD_CLK_LABEL_(CLOCK_MONOTONIC_COARSE) ,
[ CLOCK_BOOTTIME   ]= & ,
[ CLOCK_BOOTTIME_ALARM ]= & ,
[ CLOCK_SGI_CYCLE  ]= & ,
[ CLOCK_TAI]= & , // unused clocks
[ 12   ]= &_supported ,
[ 13   ]= &_supported ,
[ 14   ]= &_supported ,
[ 15   ]= &_supported
};

goto *clk_jmp_tbl [ clock & 0xf ] ;

 _GTOD_CLK_LABEL_(CLOCK_REALTIME):
if (do_realtime(ts) == VCLOCK_NONE)
goto fallback;
goto return_ok;
 _GTOD_CLK_LABEL_(CLOCK_MONOTONIC)   :
if (do_monotonic(ts) == VCLOCK_NONE)
goto fallback;
goto return_ok;
 _GTOD_CLK_LABEL_(CLOCK_MONOTONIC_RAW)   :
if (do_monotonic_raw(ts) == VCLOCK_NONE)
goto fallback;
goto return_ok;
 _GTOD_CLK_LABEL_(CLOCK_REALTIME_COARSE) :
do_realtime_coarse(ts);
goto return_ok;
 _GTOD_CLK_LABEL_(CLOCK_MONOTONIC_COARSE):
do_monotonic_coarse(ts);
goto return_ok;
 return_ok:
return 0;
 not_supported:
return -1;
 fallback:
return vdso_fallback_gettime(clock, ts);
}

Results in 16 dynamic relocations,

shown in objdump -R arch/x86/entry/vdso/vdso64.so.dbg output:

DYNAMIC RELOCATION RECORDS
OFFSET   TYPE  VALUE
04a0 R_X86_64_RELATIVE  *ABS*+0x0c49
...
518 R_X86_64_RELATIVE  *ABS*+0x0b31

what's the problem with dyn relocs ?


I can't understand why GCC decides to generate relocations 
here - it knows all the information before hand - why 
can't it insert code to compute 
( ( LOAD_ADDRESS_OF(__vdso_clock_gettime) == %pc at entry) + label_offset )
and populate the clk_jmp_table in an initializer in the
above version of the function rather than generate 
relocations ? 

Thanks & Best Regards,
Jason

[Bug c/84953] [6/7/8 Regression] misleading warning from strpbrk(x,"")

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

--- Comment #6 from Jakub Jelinek  ---
I disagree, it is a well documented behavior and user gets exactly what he
asked for.  There is no questionable or problematic behavior with those
options.  It is not any different from strchr ("abcd", 'e') and many other
functions that can be determined at compile time to return NULL.

[Bug c++/84835] [8 Regression] ICE in add_method, at cp/class.c:996

2018-03-19 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84835

--- Comment #4 from Nathan Sidwell  ---
Author: nathan
Date: Mon Mar 19 18:56:22 2018
New Revision: 258655

URL: https://gcc.gnu.org/viewcvs?rev=258655=gcc=rev
Log:
[PR c++/84835] ICE with generic lambda in extern "C"

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00890.html
PR c++/84835
* lambda.c (maybe_add_lambda_conv_op): Force C++ linkage.
* pt.c (build_template_decl): Propagate language linkage.

PR c++/84835
* g++.dg/cpp1y/pr84835.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr84835.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/lambda.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/84835] [8 Regression] ICE in add_method, at cp/class.c:996

2018-03-19 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84835

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #3 from Nathan Sidwell  ---
Fixed r258655.

[Bug fortran/77414] ICE in create_function_arglist, at fortran/trans-decl.c:2410

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77414

--- Comment #8 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Mar 19 18:54:29 2018
New Revision: 258654

URL: https://gcc.gnu.org/viewcvs?rev=258654=gcc=rev
Log:
2018-03-19  Steven G. Kargl  

PR fortran/77414
* decl.c (get_proc_name):  Check for a subroutine re-defined in
the contain portion of a subroutine.  Change language of existing
error message to better describe the issue. While here fix whitespace
issues.

2018-03-19  Steven G. Kargl  

PR fortran/77414
* gfortran.dg/pr77414.f90: New test.
* gfortran.dg/internal_references_1.f90: Adjust error message.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/pr77414.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/internal_references_1.f90

[Bug target/81647] inconsistent LTGT behavior at different optimization levels on AArch64.

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

--- Comment #9 from sudi at gcc dot gnu.org ---
Author: sudi
Date: Mon Mar 19 18:50:32 2018
New Revision: 258653

URL: https://gcc.gnu.org/viewcvs?rev=258653=gcc=rev
Log:
[PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md

This patch fixes the inconsistent behavior observed at -O3 for the unordered
comparisons. According to the online docs (https://gcc.gnu.org/onlinedocs
/gcc-7.2.0/gccint/Unary-and-Binary-Expressions.html), all of the following
should not raise an FP exception:
- UNGE_EXPR
- UNGT_EXPR
- UNLE_EXPR
- UNLT_EXPR
- UNEQ_EXPR
Also ORDERED_EXPR and UNORDERED_EXPR should only return zero or one.

The aarch64-simd.md handling of these were generating exception raising
instructions such as fcmgt. This patch changes the instructions that are
emitted in order to not give out the exceptions. We first check each
operand for NaNs and force any elements containing NaN to zero before using
them in the compare.

Example: UN (a, b) -> UNORDERED (a, b)
  | (cm (isnan (a) ? 0.0 : a, isnan (b) ? 0.0 : b))


The ORDERED_EXPR is now handled as (cmeq (a, a) & cmeq (b, b)) and
UNORDERED_EXPR as ~ORDERED_EXPR and UNEQ as (~ORDERED_EXPR | cmeq (a,b)).

ChangeLog Entries:

*** gcc/ChangeLog ***

2018-03-19  Sudakshina Das  

PR target/81647
* config/aarch64/aarch64-simd.md (vec_cmp): Modify
instructions for UNLT, UNLE, UNGT, UNGE, UNEQ, UNORDERED and ORDERED.

*** gcc/testsuite/ChangeLog ***

2018-03-19  Sudakshina Das  

PR target/81647
* gcc.target/aarch64/pr81647.c: New.

Added:
trunk/gcc/testsuite/gcc.target/aarch64/pr81647.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64-simd.md
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/84958] New: int loads not eliminated against larger stores

2018-03-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84958

Bug ID: 84958
   Summary: int loads not eliminated against larger stores
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

[ As discussed here: https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00800.html ]

This test-case:
...
int foo()
{
  int a[10];
  for(int i = 0; i < 10; ++i)
a[i] = i*i;
  int res = 0;
  for(int i = 0; i < 10; ++i)
res += a[i];
  return res;
}
...

compiled with -O3 results in this gimple at optimized:
...
  MEM[(int *)] = { 0, 1 };
  MEM[(int *) + 8B] = { 4, 9 };
  MEM[(int *) + 16B] = { 16, 25 };
  MEM[(int *) + 24B] = { 36, 49 };
  MEM[(int *) + 32B] = { 64, 81 };
  _6 = a[0];
  _28 = a[1];
  res_29 = _6 + _28;
  _35 = a[2];
  res_36 = res_29 + _35;
  _42 = a[3];
  res_43 = res_36 + _42;
  _49 = a[4];
  res_50 = res_43 + _49;
  _56 = a[5];
  res_57 = res_50 + _56;
  _63 = a[6];
  res_64 = res_57 + _63;
  _70 = a[7];
  res_71 = res_64 + _70;
  _77 = a[8];
  res_78 = res_71 + _77;
  _2 = a[9];
  res_11 = _2 + res_78;
  a ={v} {CLOBBER};
  return res_11;
...

Loop vectorization has no effect, and the scalar loops are completely unrolled.
Then slp vectorization vectorizes the stores. 

When disabling slp vectorization, we have instead:
...
return 285;
...


[ FWIW, adding an extra fre pass here also results in optimal gimple:
...
diff --git a/gcc/passes.def b/gcc/passes.def
index 3ebcfc30349..6b64f600c4a 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -325,6 +325,7 @@ along with GCC; see the file COPYING3.  If not see
   NEXT_PASS (pass_tracer);
   NEXT_PASS (pass_thread_jumps);
   NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
+  NEXT_PASS (pass_fre);
   NEXT_PASS (pass_strlen);
   NEXT_PASS (pass_thread_jumps);
   NEXT_PASS (pass_vrp, false /* warn_array_bounds_p */);
...
]

[Bug fortran/65453] ICE in build_function_decl, at fortran/trans-decl.c:2001

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65453

--- Comment #4 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Mar 19 18:36:29 2018
New Revision: 258652

URL: https://gcc.gnu.org/viewcvs?rev=258652=gcc=rev
Log:
2018-03-19  Steven G. Kargl  

PR fortran/65453
* decl.c (get_proc_name): Catch clash between a procedure statement
and a contained subprogram

2018-03-19  Steven G. Kargl  

PR fortran/65453
* gfortran.dg/pr65453.f90: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/pr65453.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/84957] New: [8 Regression] ICE in gfc_sym_type, at fortran/trans-types.c:2255

2018-03-19 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84957

Bug ID: 84957
   Summary: [8 Regression] ICE in gfc_sym_type, at
fortran/trans-types.c:2255
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20171119 and 20171126 :


$ cat z1.f90
function f() result(u)
entry g() result(v)
contains
   function v(x) result(z)
  character :: x(2)
  character(sum(len_trim(x))) :: z
   end
end


$ cat z2.f90
function f() result(u)
entry g() result(v)
contains
   function u(x) result(z)
  character :: x(2)
  character(sum(len_trim(x))) :: z
   end
end


$ gfortran-8-20171119 -c z1.f90
$
$ gfortran-8-20180318 -c z1.f90
z1.f90:2:0:

 entry g() result(v)

internal compiler error: Segmentation fault
0xb9bd5f crash_signal
../../gcc/toplev.c:325
0x7c348b gfc_sym_type(gfc_symbol*)
../../gcc/fortran/trans-types.c:2255
0x7c18e3 gfc_get_function_type(gfc_symbol*)
../../gcc/fortran/trans-types.c:3031
0x766a9f build_function_decl
../../gcc/fortran/trans-decl.c:2233
0x768561 build_entry_thunks
../../gcc/fortran/trans-decl.c:2739
0x768561 gfc_create_function_decl(gfc_namespace*, bool)
../../gcc/fortran/trans-decl.c:2913
0x77284b gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6398
0x7009c0 translate_all_program_units
../../gcc/fortran/parse.c:6121
0x7009c0 gfc_parse_file()
../../gcc/fortran/parse.c:6324
0x74755f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:204

[Bug c/84956] New: ICE in replace_block_by, at tree-ssa-tail-merge.c:1546

2018-03-19 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84956

Bug ID: 84956
   Summary: ICE in replace_block_by, at tree-ssa-tail-merge.c:1546
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Derived from gcc/testsuite/gcc.dg/torture/pr82264.c
ICEs at -O[s23] on x86_64/linux, gcc-4.8 compiles.


$ cat z1.c
char a;
int c;
unsigned b ();
unsigned
setjmp ()
{
}
static void
d ()
{
  if (b ())
c = 3;
}
void
e ()
{
  d ();
  a && ({ setjmp (); });
  a && ({ setjmp (); });
  a && ({ setjmp (); });
}


$ gcc-4.8 -c z1.c -O2
$ gcc-8-20180318 -c z1.c -O1
$
$ gcc-8-20180318 -c z1.c -O2
during GIMPLE pass: pre
z1.c: In function 'e':
z1.c:15:1: internal compiler error: in replace_block_by, at
tree-ssa-tail-merge.c:1546
 e ()
 ^
0xc90c30 replace_block_by
../../gcc/tree-ssa-tail-merge.c:1546
0xc90c30 apply_clusters
../../gcc/tree-ss a-tail-merge.c:1637
0xc90c30 tail_merge_optimize(unsigned int)
../../gcc/tree-ssa-tail-merge.c:1755
0xc40997 execute
../../gcc/tree-ssa-pre.c:4209

[Bug c/84953] [6/7/8 Regression] misleading warning from strpbrk(x,"")

2018-03-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84953

--- Comment #5 from Bernd Edlinger  ---
WOW! That was quick!

Note that strpbrk(p, "") is certainly worth a warning: in the original
context the second parameter was the result from a macro substitution,
that was far from obvious to spot, and strpbrk does not make much sense
with empty strings.

[Bug fortran/84955] New: [7/8 Regression] ICE in substitute_and_fold_dom_walker, at tree-ssa-propagate.c:1089

2018-03-19 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84955

Bug ID: 84955
   Summary: [7/8 Regression] ICE in
substitute_and_fold_dom_walker, at
tree-ssa-propagate.c:1089
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20170205 and 20170212 :


$ cat z1.f90
subroutine s
   integer :: i, j
   !$acc parallel loop tile(2,3)
   do i = 1, 10
  do j = 1, 10
 do
 end do
  end do
   end do
  !$acc end parallel loop
end


$ gfortran-7-20170205 -c z1.f90 -O2 -fopenacc
$ gfortran-8-20180318 -c z1.f90 -O0 -fopenacc
$
$ gfortran-8-20180318 -c z1.f90 -O2 -fopenacc
during GIMPLE pass: ccp
z1.f90:11:0:

 end

internal compiler error: Segmentation fault
0xb9bd5f crash_signal
../../gcc/toplev.c:325
0xcf35b2 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-propagate.c:1089
0x11dc6ef dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:353
0xcf2ac0 substitute_and_fold_engine::substitute_and_fold()
../../gcc/tree-ssa-propagate.c:1173
0xc73959 ccp_finalize
../../gcc/tree-ssa-ccp.c:992
0xc73959 do_ssa_ccp
../../gcc/tree-ssa-ccp.c:2475
0xc73959 execute
../../gcc/tree-ssa-ccp.c:2518

[Bug fortran/84955] [7/8 Regression] ICE in substitute_and_fold_dom_walker, at tree-ssa-propagate.c:1089

2018-03-19 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84955

--- Comment #1 from G. Steinmetz  ---

Configured with --enable-checking=yes :


$ gfortran-8-20180318 -c z1.f90 -O2 -fopenacc
during GIMPLE pass: fixup_cfg
z1.f90:11:0:

 end

internal compiler error: in operator[], at vec.h:841
0xd2490f vec::operator[](unsigned int)
../../gcc/vec.h:841
0xd2490f extract_true_false_edges_from_block(basic_block_def*, edge_def**,
edge_def**)
../../gcc/tree-cfg.c:9194
0xd29e5d gimple_verify_flow_info
../../gcc/tree-cfg.c:5740
0x87aeb3 verify_flow_info()
../../gcc/cfghooks.c:263
0xc09a71 execute_function_todo
../../gcc/passes.c:2006
0xc0a499 execute_todo
../../gcc/passes.c:2048

[Bug c/84953] [6/7/8 Regression] misleading warning from strpbrk(x,"")

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

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |6.5
Summary|misleading warning from |[6/7/8 Regression]
   |strpbrk(x,"")   |misleading warning from
   ||strpbrk(x,"")

--- Comment #4 from Jakub Jelinek  ---
GCC 3.[234] didn't warn, but already r9 warns here.

[Bug c/84953] misleading warning from strpbrk(x,"")

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

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

Untested fix.

[Bug target/84826] ICE in extract_insn, at recog.c:2304 on arm-linux-gnueabi

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

sudi at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #3 from sudi at gcc dot gnu.org ---
So I looked into this. Turns out the actual issue is that USE_RETURN_INSN
(FALSE) changes its value and becomes false after pass ce3.

According to what I can see, arm_r3_live_at_start_p() starts to return true
after ce3.

+static bool
+arm_r3_live_at_start_p (void)
+{
+  /* Just look at cfg info, which is still close enough to correct at this
+ point.  This gives false positives for broken functions that might use
+ uninitialized data that happens to be allocated in r3, but who cares?  */

This particular test cares :P

+  return REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)), 3);
+}

r3 in this test case is being allocated for b and after ifcvt, it becomes
partially defined and thus the liveness does not get killed. (Look below for
excerpt from ce3)

;; lr  in0 [r0] 3 [r3] 12 [ip] 13 [sp] 14 [lr]
;; lr  use   0 [r0] 3 [r3] 12 [ip] 13 [sp]
;; lr  def   100 [cc]
;; live  in  0 [r0] 3 [r3] 12 [ip] 13 [sp] 14 [lr]
;; live  gen 3 [r3] 100 [cc]
;; live  kill
(note 5 1 47 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note 47 5 2 2 NOTE_INSN_PROLOGUE_END)
(note 2 47 4 2 NOTE_INSN_DELETED)
(note 4 2 7 2 NOTE_INSN_FUNCTION_BEG)
(insn 7 4 10 2 (set (reg:CC 100 cc)
(compare:CC (reg:SI 0 r0 [ cD.5556 ])
(const_int 0 [0]))) "ice.i":6 193 {*arm_cmpsi_insn}
 (expr_list:REG_DEAD (reg:SI 0 r0 [ cD.5556 ])
(nil)))
(insn 10 7 11 2 (cond_exec (ne (reg:CC 100 cc)
(const_int 0 [0]))
(set (reg:SI 3 r3 [orig:115 CHAIN.1_5(D)->bD.5567 ] [115])
(mem/j:SI (reg/f:SI 12 ip [orig:113 CHAIN.1D.5566 ] [113]) [1
CHAIN.1_5(D)->bD.5567+0 S4 A32]))) "ice.i":7 4068 {*p *arm_movsi_vfp}
 (expr_list:REG_EQUIV (mem/j:SI (reg/f:SI 12 ip [orig:113 CHAIN.1D.5566 ]
[113]) [1 CHAIN.1_5(D)->bD.5567+0 S4 A32])
(nil)))

My question is:
1) Is there any easy way to avoid the false positives from
arm_r3_live_at_start_p()
2) Why is r3 still live at IN of BB2 when there is no reaching definition of
it? I mean also there will never be any reaching definition at IN of BB2. So
shouldn't all the liveness (barring the artificially create ones for the
prologues/stack requirements) be killed there? I know I may be over simplifying
all the intricate details of liveness analysis when I ask this question, but I
am looking for some help here!

[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness

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

Jim Wilson  changed:

   What|Removed |Added

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

--- Comment #6 from Jim Wilson  ---
Patch committed.

[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness

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

--- Comment #5 from Jim Wilson  ---
Author: wilson
Date: Mon Mar 19 18:08:24 2018
New Revision: 258650

URL: https://gcc.gnu.org/viewcvs?rev=258650=gcc=rev
Log:
RISC-V: Fix bootstrap failure.

gcc/
PR bootstrap/84856
* config/riscv/riscv.c (riscv_function_arg_boundary): Use
PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY.
(riscv_first_stack_step): Likewise.
(riscv_option_override): Use STACK_BOUNDARY instead of
MIN_STACK_BOUNDARY.
* config/riscv/riscv.h (STACK_BOUNDARY): Renamed from
MIN_STACK_BOUNDARY.
(BIGGEST_ALIGNMENT): Set to 128.
(PREFERRED_STACK_BOUNDARY): Renamed from STACK_BOUNDARY.
(RISCV_STACK_ALIGN): Use PREFERRED_STACK_BOUNDARY instead of
STACK_BOUNDARY.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/riscv/riscv.c
trunk/gcc/config/riscv/riscv.h

[Bug middle-end/70359] [6/7/8 Regression] Code size increase for x86/ARM/others compared to gcc-5.3.0

2018-03-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70359

--- Comment #42 from Aldy Hernandez  ---
(In reply to Jeffrey A. Law from comment #36)
> WRT the division removal.  That seems so profitable that a slight increase
> in codesize is warranted.  So if we fix the other issue  and the source of
> the remaining codesize regressions is the removal of the division, I would
> consider this BZ resolved.

Richi.  Jeff.

Limiting the single_use with optimize_size as well may give us the best of both
worlds.  Would you like me to post the [untested] patch below upstream?  With
this patch code size is even smaller than GCC 5.3.

I really don't care.  Actually, I'd prefer to do nothing and close the PR ;-). 
Up to y'all.

diff --git a/gcc/match.pd b/gcc/match.pd
index f61c4d7440a..5d29bf62dc9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1290,11 +1290,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 /* X / C1 op C2 into a simple range test.  */
 (for cmp (simple_comparison)
  (simplify
-  (cmp (trunc_div:s @0 INTEGER_CST@1) INTEGER_CST@2)
+  (cmp (trunc_div:s@3 @0 INTEGER_CST@1) INTEGER_CST@2)
   (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
&& integer_nonzerop (@1)
&& !TREE_OVERFLOW (@1)
-   && !TREE_OVERFLOW (@2))
+   && !TREE_OVERFLOW (@2)
+   && (!optimize_size || single_use (@3)))
(with { tree lo, hi; bool neg_overflow;
   enum tree_code code = fold_div_compare (cmp, @1, @2, , ,
   _overflow); }
@@ -1456,9 +1457,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (for cmp (eq ne)
  ocmp (lt ge)
  (simplify
-  (cmp (trunc_div @0 @1) integer_zerop)
+  (cmp (trunc_div@2 @0 @1) integer_zerop)
   (if (TYPE_UNSIGNED (TREE_TYPE (@0))
-   && (VECTOR_TYPE_P (type) || !VECTOR_TYPE_P (TREE_TYPE (@0
+   && (VECTOR_TYPE_P (type) || !VECTOR_TYPE_P (TREE_TYPE (@0)))
+   && (!optimize_size || single_use (@2)))
(ocmp @0 @1

 /* X == C - X can never be true if C is odd.  */

[Bug c/84953] misleading warning from strpbrk(x,"")

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

--- Comment #2 from Jakub Jelinek  ---
--- gcc/builtins.c.jj   2018-03-07 22:51:58.871478732 +0100
+++ gcc/builtins.c  2018-03-19 18:49:45.313898848 +0100
@@ -9573,7 +9573,7 @@ fold_builtin_strpbrk (location_t loc, tr
   if (p2[0] == '\0')
/* strpbrk(x, "") == NULL.
   Evaluate and ignore s1 in case it had side-effects.  */
-   return omit_one_operand_loc (loc, TREE_TYPE (s1), integer_zero_node,
s1);
+   return omit_one_operand_loc (loc, type, integer_zero_node, s1);

   if (p2[1] != '\0')
return NULL_TREE;  /* Really call strpbrk.  */

[Bug c/84953] misleading warning from strpbrk(x,"")

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

Jakub Jelinek  changed:

   What|Removed |Added

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

[Bug fortran/84615] [8 Regression] Executable Segfault for some tests compiled with -m32 after r256284

2018-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84615

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #15 from kargl at gcc dot gnu.org ---
(In reply to Janne Blomqvist from comment #12)
> So to be clear, the problem seems to be that while the code generation for
> the function itself appears Ok, it generates the interface wrong (i.e. uses
> the declared charlen kind instead of C_SIZE_T), and thus calling it doesn't
> work properly.
> 
> I still have no idea where in the frontend code the error is.

I haven't looked, but suspect that you can force a
conversion to the correct charlen in

trans-intrinsic.c:gfc_conv_intrinsic_function_args

Well, for intrinsics, the above function has

  if (e->ts.type == BT_CHARACTER)
{
  gfc_conv_expr (, e);
  gfc_conv_string_parameter ();
  argarray[curr_arg++] = argse.string_length;
  gcc_assert (curr_arg < nargs);
}

From trans-expr.c, one has

/* Makes sure se is suitable for passing as a function string parameter.  */
/* TODO: Need to check all callers of this function.  It may be abused.  */

void
gfc_conv_string_parameter (gfc_se * se)

I suspect you can do a fold_convert here or a conversion
before the gfc_conv_expr.

  1   2   3   >